@cuongtran001/kanna 1.63.2 → 1.63.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -9
- package/dist/client/assets/{BoardsPage-BJalB-bc.js → BoardsPage-AckCuswi.js} +1 -1
- package/dist/client/assets/BoardsRoutePage-DzKwKy3f.js +1 -0
- package/dist/client/assets/ChatPage-DsaH8CTz.js +93 -0
- package/dist/client/assets/{CronJobRow-CPbO_jwU.js → CronJobRow-Bx9gRqKW.js} +1 -1
- package/dist/client/assets/{CronJobsPage-Ck3SNgGi.js → CronJobsPage-v0-2X1oX.js} +1 -1
- package/dist/client/assets/{FilePreviewSheet-XEuUtDPn.js → FilePreviewSheet-B6SDxSD0.js} +2 -2
- package/dist/client/assets/{FlowSurface-BCbeMTJe.js → FlowSurface-CLC-ZFar.js} +1 -1
- package/dist/client/assets/{GenUIBlock-BJy_dfs-.js → GenUIBlock-CC79Ujro.js} +2 -2
- package/dist/client/assets/{KannaSocketProvider-D7Lzlt35.js → KannaSocketProvider-B2sHsWP5.js} +1 -1
- package/dist/client/assets/{LocalProjectsPage-9LJkQjhT.js → LocalProjectsPage-DYBkcEAm.js} +1 -1
- package/dist/client/assets/SettingsPage-CZqMkMRW.js +9 -0
- package/dist/client/assets/{StackBoardsRoutePage-t_EaFNG4.js → StackBoardsRoutePage-Clviz0hX.js} +1 -1
- package/dist/client/assets/{ToolCallMessage-RbF9XT2B.js → ToolCallMessage-BfNbWGmc.js} +1 -1
- package/dist/client/assets/{VChartSurface-CKuPelsn.js → VChartSurface-CUbxyBo3.js} +1 -1
- package/dist/client/assets/{WorkflowsPage-B6qUmQA3.js → WorkflowsPage-rengzb97.js} +1 -1
- package/dist/client/assets/{WorkflowsSection-DxO0S4An.js → WorkflowsSection-DuXdLsMO.js} +1 -1
- package/dist/client/assets/{chart-renderer-DjYZvNxh.js → chart-renderer-D7ukB2wg.js} +1 -1
- package/dist/client/assets/{chatSounds-FD2DQzF6.js → chatSounds-BLg2xPDZ.js} +1 -1
- package/dist/client/assets/chevron-left-RbFvmeyK.js +1 -0
- package/dist/client/assets/{clipboard.adapter-GN9nnYak.js → clipboard.adapter-CgdNwn-1.js} +1 -1
- package/dist/client/assets/{columnStyle-DjA7hA9k.js → columnStyle-CMCF0ds6.js} +1 -1
- package/dist/client/assets/{createScopedStore-BoLB9Rhc.js → createScopedStore-BrD5NHWx.js} +1 -1
- package/dist/client/assets/{dist-CimtOoGK.js → dist-DNSTHlSo.js} +1 -1
- package/dist/client/assets/editor-icons-DY4uKeEY.js +1 -0
- package/dist/client/assets/{ellipsis-Cd7sO0LO.js → ellipsis-OHg0x_x1.js} +1 -1
- package/dist/client/assets/{flow-kinds-CW2TU_83.js → flow-kinds-Ki2DP9nP.js} +1 -1
- package/dist/client/assets/{folder-C7sXCaHj.js → folder-CnWzWIG5.js} +1 -1
- package/dist/client/assets/{formatters-wSVyvDFZ.js → formatters-BGORekd-.js} +1 -1
- package/dist/client/assets/{genui-EzBIAYFE.js → genui-C9i6j0XZ.js} +1 -1
- package/dist/client/assets/{globe-xmRpmpma.js → globe-BjR1tyE4.js} +1 -1
- package/dist/client/assets/{host-DCaA9W-Z.js → host-D9tJwZXl.js} +1 -1
- package/dist/client/assets/{index-CDqjh7nt.js → index-CesRxZ0X.js} +7 -7
- package/dist/client/assets/index-CxDE9VOy.css +1 -0
- package/dist/client/assets/{info-D4MMvZFe.js → info-DNYekoE-.js} +1 -1
- package/dist/client/assets/{input-C4fvDiQ4.js → input-DgW9uRZN.js} +1 -1
- package/dist/client/assets/{lexicalToReact-sPUyOWk6.js → lexicalToReact-CZvp9Pgz.js} +3 -3
- package/dist/client/assets/{log-aTaDVF_e.js → log-DnEvbp3E.js} +1 -1
- package/dist/client/assets/{monitor-_CRKcV1h.js → monitor-qbWfUdBG.js} +1 -1
- package/dist/client/assets/{pencil-fNBeUUCf.js → pencil-C965rrpd.js} +1 -1
- package/dist/client/assets/{pendingActionsStore-COTh4Ztq.js → pendingActionsStore-CxhI19V9.js} +1 -1
- package/dist/client/assets/{play-BAmkJfn6.js → play-uofLR7yT.js} +1 -1
- package/dist/client/assets/{plus-c75CkNEO.js → plus-D4CI6rj1.js} +1 -1
- package/dist/client/assets/{popover-CHM4skzh.js → popover-Bc646hKn.js} +1 -1
- package/dist/client/assets/{pushClient-BJH_ITRB.js → pushClient-CxnHu9h4.js} +1 -1
- package/dist/client/assets/runDetached-DfQXHAaY.js +1 -0
- package/dist/client/assets/{segmented-control-DNOwRupT.js → segmented-control-CKGX29Kl.js} +1 -1
- package/dist/client/assets/{select-dLHiAls6.js → select-BjeajpVt.js} +1 -1
- package/dist/client/assets/{settings-header-button-CGKCzFyk.js → settings-header-button-BYvHR6Xl.js} +1 -1
- package/dist/client/assets/{sidebarPendingActions-Dyp80Lv_.js → sidebarPendingActions-xgMTnfRY.js} +1 -1
- package/dist/client/assets/{square-pen-B1IxmScM.js → square-pen-DmppQdTd.js} +1 -1
- package/dist/client/assets/{state-mark-BhTZfcYe.js → state-mark-C3kEL1hX.js} +1 -1
- package/dist/client/assets/{status-pill-CwhJhaMy.js → status-pill-Bo1Nb6HX.js} +1 -1
- package/dist/client/assets/{terminal-Bnj7qFGw.js → terminal-DfCF-J4p.js} +1 -1
- package/dist/client/assets/{timer.adapter-DHt2zwsL.js → timer.adapter-C2RhP4d6.js} +1 -1
- package/dist/client/assets/{tools-3gJcj3hK.js → tools-t5T_3UBg.js} +1 -1
- package/dist/client/assets/{triangle-alert-CWrc0CIO.js → triangle-alert-CYQhobyY.js} +1 -1
- package/dist/client/assets/useAppGlobalState-DUa3pkCF.js +1 -0
- package/dist/client/assets/useKannaState-FcieR5qb.js +5 -0
- package/dist/client/assets/useTheme-D9sKDPEm.js +1 -0
- package/dist/client/index.html +35 -35
- package/package.json +2 -2
- package/src/server/agent-coordinator-types.ts +0 -6
- package/src/server/agent-coordinator.ts +6 -45
- package/src/server/agent.compaction.test.ts +1 -13
- package/src/server/agent.oauth-account-info.test.ts +0 -3
- package/src/server/agent.oauth-release.test.ts +0 -2
- package/src/server/agent.oauth-rotation.test.ts +0 -9
- package/src/server/agent.oauth-token-share-cap.test.ts +0 -1
- package/src/server/agent.openrouter-model.test.ts +0 -2
- package/src/server/agent.openrouter-watchdog.test.ts +0 -3
- package/src/server/agent.sdk-workflow-register.test.ts +2 -64
- package/src/server/agent.test.ts +1 -319
- package/src/server/app-settings.test.ts +14 -17
- package/src/server/app-settings.ts +22 -37
- package/src/server/auto-continue/e2e.test.ts +0 -1
- package/src/server/background-task-output-registry.test.ts +1 -1
- package/src/server/background-task-output-registry.ts +1 -1
- package/src/server/claude-cancel-handler.test.ts +0 -58
- package/src/server/claude-cancel-handler.ts +1 -17
- package/src/server/claude-harness-stream.test.ts +134 -0
- package/src/server/{claude-pty/jsonl-path.test.ts → claude-projects-path.adapter.test.ts} +1 -19
- package/src/server/{claude-pty/jsonl-path.adapter.ts → claude-projects-path.adapter.ts} +0 -11
- package/src/server/claude-send-command.test.ts +0 -1
- package/src/server/claude-session-config-helpers.test.ts +1 -90
- package/src/server/claude-session-config-helpers.ts +1 -38
- package/src/server/claude-session-error-handler.test.ts +0 -1
- package/src/server/claude-session-lifecycle.test.ts +2 -36
- package/src/server/claude-session-lifecycle.ts +2 -8
- package/src/server/claude-session-runner.test.ts +8 -36
- package/src/server/claude-session-runner.ts +1 -26
- package/src/server/claude-session-spawner.test.ts +5 -64
- package/src/server/claude-session-spawner.ts +49 -115
- package/src/server/claude-session-start.test.ts +1 -14
- package/src/server/claude-session-start.ts +0 -8
- package/src/server/claude-session-state-queries.test.ts +1 -2
- package/src/server/claude-session-state.test.ts +0 -1
- package/src/server/claude-session-state.ts +0 -4
- package/src/server/claude-subagent-wiring.test.ts +2 -68
- package/src/server/claude-subagent-wiring.ts +3 -50
- package/src/server/claude-turn-starter-types.ts +0 -3
- package/src/server/claude-turn-starter.test.ts +0 -28
- package/src/server/claude-turn-starter.ts +0 -5
- package/src/server/event-store.test.ts +0 -2
- package/src/server/events.ts +1 -2
- package/src/server/harness-types.ts +1 -2
- package/src/server/import-subagent-drill.e2e.test.ts +1 -1
- package/src/server/imported-subagents-dir.test.ts +1 -1
- package/src/server/imported-subagents-dir.ts +1 -1
- package/src/server/kanna-mcp.test.ts +0 -75
- package/src/server/kanna-mcp.ts +1 -47
- package/src/server/server.test.ts +5 -7
- package/src/server/server.ts +2 -18
- package/src/server/subagent-orchestrator.test.ts +0 -1
- package/src/server/subagent-provider-run.test.ts +48 -10
- package/src/server/subagent-provider-run.ts +12 -3
- package/src/server/tool-callback.test.ts +1 -1
- package/src/server/ws-router-agent-ctrl.test.ts +0 -45
- package/src/server/ws-router-agent-ctrl.ts +1 -31
- package/src/server/ws-router-broadcast.ts +0 -27
- package/src/server/ws-router-defaults.test.ts +2 -3
- package/src/server/ws-router-defaults.ts +2 -3
- package/src/server/ws-router-envelope.ts +0 -15
- package/src/server/ws-router-observability.test.ts +1 -1
- package/src/server/ws-router-settings.test.ts +2 -2
- package/src/server/ws-router.test.ts +2 -2
- package/src/server/ws-router.ts +0 -8
- package/src/shared/app-settings-types.ts +9 -20
- package/src/shared/claude-api-error-classification.ts +1 -1
- package/src/shared/protocol.ts +1 -11
- package/dist/client/assets/BoardsRoutePage-BTTjJX-Y.js +0 -1
- package/dist/client/assets/ChatPage-DH8wtQyD.js +0 -93
- package/dist/client/assets/SettingsPage-CKrZ6dGQ.js +0 -9
- package/dist/client/assets/chevron-left-CJ0qv9kF.js +0 -1
- package/dist/client/assets/editor-icons-CONDQZof.js +0 -1
- package/dist/client/assets/index-C-UYaDk6.css +0 -1
- package/dist/client/assets/runDetached-DqQ3k2ji.js +0 -1
- package/dist/client/assets/useAppGlobalState-DKOGrO5l.js +0 -1
- package/dist/client/assets/useKannaState-D7R_-dM6.js +0 -5
- package/dist/client/assets/useTheme-B57LIKyx.js +0 -1
- package/src/server/agent.pty-rotation.test.ts +0 -322
- package/src/server/claude-pty/auth.test.ts +0 -38
- package/src/server/claude-pty/auth.ts +0 -17
- package/src/server/claude-pty/claude-session-registry.adapter.ts +0 -68
- package/src/server/claude-pty/claude-session-registry.test.ts +0 -149
- package/src/server/claude-pty/driver.test.ts +0 -1153
- package/src/server/claude-pty/driver.ts +0 -829
- package/src/server/claude-pty/env.test.ts +0 -79
- package/src/server/claude-pty/env.ts +0 -20
- package/src/server/claude-pty/jsonl-to-event.test.ts +0 -882
- package/src/server/claude-pty/jsonl-to-event.ts +0 -357
- package/src/server/claude-pty/parity-matrix.test.ts +0 -437
- package/src/server/claude-pty/pid-registry.adapter.ts +0 -164
- package/src/server/claude-pty/pid-registry.test.ts +0 -178
- package/src/server/claude-pty/preflight/binary-fingerprint.adapter.ts +0 -20
- package/src/server/claude-pty/preflight/binary-fingerprint.test.ts +0 -32
- package/src/server/claude-pty/pty-instance-registry.test.ts +0 -208
- package/src/server/claude-pty/pty-instance-registry.ts +0 -172
- package/src/server/claude-pty/pty-memory-sampler.adapter.test.ts +0 -103
- package/src/server/claude-pty/pty-memory-sampler.adapter.ts +0 -86
- package/src/server/claude-pty/pty-process.adapter.ts +0 -60
- package/src/server/claude-pty/pty-process.test.ts +0 -49
- package/src/server/claude-pty/resolve-binary.adapter.ts +0 -106
- package/src/server/claude-pty/resolve-binary.test.ts +0 -118
- package/src/server/claude-pty/runtime-dir.adapter.ts +0 -19
- package/src/server/claude-pty/sandbox/detect.adapter.ts +0 -17
- package/src/server/claude-pty/sandbox/detect.test.ts +0 -17
- package/src/server/claude-pty/sandbox/platform.test.ts +0 -35
- package/src/server/claude-pty/sandbox/platform.ts +0 -27
- package/src/server/claude-pty/sandbox/preflight-io.adapter.ts +0 -14
- package/src/server/claude-pty/sandbox/preflight.test.ts +0 -69
- package/src/server/claude-pty/sandbox/preflight.ts +0 -44
- package/src/server/claude-pty/sandbox/profile-linux.adapter.ts +0 -63
- package/src/server/claude-pty/sandbox/profile-linux.test.ts +0 -90
- package/src/server/claude-pty/sandbox/profile-macos.adapter.ts +0 -72
- package/src/server/claude-pty/sandbox/profile-macos.test.ts +0 -68
- package/src/server/claude-pty/sandbox/wrap.adapter.ts +0 -58
- package/src/server/claude-pty/sandbox/wrap.test.ts +0 -82
- package/src/server/claude-pty/settings-writer.adapter.ts +0 -23
- package/src/server/claude-pty/settings-writer.test.ts +0 -22
- package/src/server/claude-pty/smoke-test-io.adapter.ts +0 -28
- package/src/server/claude-pty/smoke-test.test.ts +0 -199
- package/src/server/claude-pty/smoke-test.ts +0 -182
- package/src/server/claude-pty/tui-control.test.ts +0 -300
- package/src/server/claude-pty/tui-control.ts +0 -174
- package/src/server/claude-pty/tui-source.adapter.test.ts +0 -374
- package/src/server/claude-pty/tui-source.adapter.ts +0 -294
- package/src/server/http-server.adapter.test.ts +0 -18
- package/src/server/http-server.adapter.ts +0 -39
- package/src/server/kanna-mcp-http.test.ts +0 -274
- package/src/server/kanna-mcp-http.ts +0 -194
- package/src/server/kanna-mcp-tools/ask-user-question.test.ts +0 -108
- package/src/server/kanna-mcp-tools/ask-user-question.ts +0 -55
- package/src/server/kanna-mcp-tools/exit-plan-mode.test.ts +0 -61
- package/src/server/kanna-mcp-tools/exit-plan-mode.ts +0 -49
- package/src/server/mcp-zod-compat.adapter.ts +0 -20
- package/src/shared/pty-instance.ts +0 -43
- /package/src/server/{claude-pty/output-ring.test.ts → output-ring.test.ts} +0 -0
- /package/src/server/{claude-pty/output-ring.ts → output-ring.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./rolldown-runtime-C0FnF6B9.js";import{t as a}from"./react-DiVRNtpo.js";import{t as o}from"./jsx-runtime-BdxMnOeJ.js";import{d as s}from"./log-aTaDVF_e.js";import{n as c}from"./useTheme-B57LIKyx.js";import{O as l}from"./genui-EzBIAYFE.js";import{t as u}from"./runDetached-DqQ3k2ji.js";import{t as d}from"./chart-renderer-DjYZvNxh.js";var f=n(a(),1);function p(e){let t=e.h*Math.PI/180,n=e.c*Math.cos(t),r=e.c*Math.sin(t),i=e.l+.3963377774*n+.2158037573*r,a=e.l-.1055613458*n-.0638541728*r,o=e.l-.0894841775*n-1.291485548*r,s=i**3,c=a**3,l=o**3;return[4.0767416621*s-3.3077115913*c+.2309699292*l,-1.2684380046*s+2.6097574011*c-.3413193965*l,-.0041960863*s-.7034186147*c+1.707614701*l]}var m=/^oklch\(\s*([0-9.]+)(%?)\s+([0-9.]+)\s+([0-9.]+)\s*(?:\/\s*([0-9.]+)(%?)\s*)?\)$/i;function h(e){let t=m.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=t[5]===void 0?1:Number(t[5])/(t[6]?100:1);return{l:t[2]?n/100:n,c:Number(t[3]),h:Number(t[4]),alpha:r}}function g(e){let t=Math.max(0,Math.min(1,e)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.round(n*255)}function _(e,t=1){let[n,r,i]=p(e).map(g);return t>=1?`rgb(${n}, ${r}, ${i})`:`rgba(${n}, ${r}, ${i}, ${t})`}function v(e,t){let n=h(e);return n?_(n,n.alpha):e.trim()||t}function y(e){let t=(t,n)=>v(e(t,``),n),n=Array.from({length:8},(e,n)=>t(`--chart-${n+1}`,`rgb(42, 120, 214)`)),r=t(`--muted-foreground`,`rgb(115, 107, 108)`);return{series:n,compare:r,increase:n[0]??r,decrease:n[7]??r,total:r,grid:t(`--chart-grid`,`rgb(236, 232, 232)`),axis:t(`--chart-axis`,`rgb(204, 198, 198)`),text:t(`--foreground`,`rgb(30, 24, 25)`),mutedText:r,surface:t(`--card`,`rgb(255, 253, 253)`),fontFamily:e(`--kanna-font-body`,`ui-sans-serif, system-ui, sans-serif`)}}var b=.1,x=[4,3],S=11;function C(e,t){return{x:e.x,xLabel:e.xLabel,series:e.series,seriesLabel:t.get(e.series)??e.series,value:e.value,start:e.start??0,end:e.end??e.value}}function w(e,t){switch(e.role){case`compare`:return t.compare;case`increase`:return t.increase;case`decrease`:return t.decrease;case`total`:return t.total;default:return t.series[e.slot??0]??t.series[0]??t.text}}function T(e,t){return{type:`ordinal`,domain:e.series.map(e=>e.label),range:e.series.map(e=>w(e,t))}}function E(e,t){return e.series.some(e=>e.label===t&&e.role===`compare`)}var D=`seriesLabel`;function O(e,t){let n=e?.[t];return typeof n==`string`?n:``}function k(e){let t=e?.value;return typeof t==`number`?t:null}function A(e){let t=t=>l(k(t),e.format);return{mark:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]},dimension:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]}}}function ee(e){return e.kind!==`line`&&e.kind!==`area`}function te(e,t){let n={fill:t.mutedText,fontSize:S,fontFamily:t.fontFamily};return[{orient:`left`,type:`linear`,label:{style:n,formatMethod:t=>l(Number(t),e.format,{compact:!0})},grid:{visible:!0,style:{stroke:t.grid,lineWidth:1,lineDash:[]}},domainLine:{visible:!1},tick:{visible:!1}},{orient:`bottom`,type:`band`,sampling:!ee(e),label:{style:n,autoLimit:!0,formatMethod:t=>e.xLabels[String(t)]??String(t)},domainLine:{visible:!0,style:{stroke:t.axis,lineWidth:1}},tick:{visible:!1},grid:{visible:!1}}]}function ne(e,t){return{visible:e.series.length>=2,orient:`top`,position:`start`,item:{label:{style:{fill:t.text,fontSize:S,fontFamily:t.fontFamily}}}}}function re(e,t){let n=new Map(e.series.map(e=>[e.id,e.label]));return{data:[{id:`points`,values:e.points.map(e=>C(e,n))}],background:`transparent`,padding:{top:8,right:12,bottom:4,left:4},color:T(e,t),tooltip:A(e),legends:ne(e,t)}}function ie(e,t){switch(e.kind){case`line`:return oe(e,t);case`area`:return se(e,t);case`bar`:case`stacked-bar`:return ce(e,t);case`combo`:return le(e,t);case`waterfall`:return ue(e,t);case`composition`:return de(e,t)}}function ae(e){return{xField:{visible:!0,line:{type:`line`,style:{stroke:e.axis,lineWidth:1}}}}}function oe(e,t){return{type:`line`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`,lineDash:t=>E(e,O(t,`seriesLabel`))?x:[]}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}}function se(e,t){return{type:`area`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`}},area:{style:{fillOpacity:t=>E(e,O(t,`seriesLabel`))?0:b}},point:{visible:!1}}}function ce(e,t){let n=e.kind===`stacked-bar`,r=!n&&e.series.length>1;return{type:`bar`,...re(e,t),xField:r?[`x`,D]:`x`,yField:`value`,seriesField:D,stack:n,barMaxWidth:24,barGapInGroup:2,axes:te(e,t),bar:{style:{cornerRadius:n?0:[4,4,0,0],stroke:t.surface,lineWidth:n?2:0}}}}function le(e,t){let[n,r]=e.series,i=re(e,t),a=new Map(e.series.map(e=>[e.id,e.label])),o=t=>e.points.filter(e=>e.series===t).map(e=>C(e,a));return{type:`common`,background:i.background,padding:i.padding,color:i.color,tooltip:i.tooltip,legends:i.legends,data:[{id:`bars`,values:o(n?.id)},{id:`line`,values:o(r?.id)}],series:[{type:`bar`,dataIndex:0,xField:`x`,yField:`value`,seriesField:D,barMaxWidth:24,bar:{style:{cornerRadius:[4,4,0,0]}}},{type:`line`,dataIndex:1,xField:`x`,yField:`value`,seriesField:D,line:{style:{lineWidth:2}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}],axes:te(e,t).map(e=>e.orient===`left`?{...e,seriesIndex:[0,1]}:e)}}function ue(e,t){return{type:`rangeColumn`,...re(e,t),xField:`x`,minField:`start`,maxField:`end`,seriesField:D,barMaxWidth:24,axes:te(e,t),bar:{style:{cornerRadius:2}}}}function de(e,t){return{type:`pie`,...re(e,t),categoryField:D,valueField:`value`,innerRadius:.62,outerRadius:.9,pie:{style:{stroke:t.surface,lineWidth:2}}}}var fe=e=>e,pe;(function(e){e[`desktop-browser`]=`desktop-browser`,e[`mobile-browser`]=`mobile-browser`,e.node=`node`,e.worker=`worker`,e.miniApp=`miniApp`,e.wx=`wx`,e.tt=`tt`,e.harmony=`harmony`,e[`desktop-miniApp`]=`desktop-miniApp`,e.lynx=`lynx`})(pe||={});var j;(function(e){e.cartesianAxis=`cartesianAxis`,e.cartesianBandAxis=`cartesianAxis-band`,e.cartesianLinearAxis=`cartesianAxis-linear`,e.cartesianTimeAxis=`cartesianAxis-time`,e.cartesianLogAxis=`cartesianAxis-log`,e.cartesianSymlogAxis=`cartesianAxis-symlog`,e.polarAxis=`polarAxis`,e.polarBandAxis=`polarAxis-band`,e.polarLinearAxis=`polarAxis-linear`,e.crosshair=`crosshair`,e.cartesianCrosshair=`cartesianCrosshair`,e.polarCrosshair=`polarCrosshair`,e.dataZoom=`dataZoom`,e.geoCoordinate=`geoCoordinate`,e.indicator=`indicator`,e.discreteLegend=`discreteLegend`,e.continuousLegend=`continuousLegend`,e.colorLegend=`colorLegend`,e.sizeLegend=`sizeLegend`,e.markLine=`markLine`,e.markArea=`markArea`,e.markPoint=`markPoint`,e.polarMarkLine=`polarMarkLine`,e.polarMarkArea=`polarMarkArea`,e.polarMarkPoint=`polarMarkPoint`,e.geoMarkPoint=`geoMarkPoint`,e.tooltip=`tooltip`,e.title=`title`,e.player=`player`,e.scrollBar=`scrollBar`,e.label=`label`,e.totalLabel=`totalLabel`,e.brush=`brush`,e.poptip=`poptip`,e.customMark=`customMark`})(j||={});var me=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),he,ge=t((()=>{he=(e,t)=>Object.prototype.toString.call(e)===`[object ${t}]`})),_e,ve=t((()=>{ge(),_e=(e,t=!1)=>t?typeof e==`boolean`:!0===e||!1===e||he(e,`Boolean`)})),M,ye=t((()=>{M=e=>typeof e==`function`})),N,be=t((()=>{N=e=>e==null})),P,xe=t((()=>{P=e=>e!=null})),F,Se=t((()=>{F=e=>{let t=typeof e;return e!==null&&t===`object`||t===`function`}})),Ce,we=t((()=>{Ce=e=>typeof e==`object`&&!!e})),Te,Ee=t((()=>{we(),ge(),Te=function(e){if(!Ce(e)||!he(e,`Object`))return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}})),De,Oe=t((()=>{De=e=>e===void 0})),ke,Ae=t((()=>{ge(),ke=(e,t=!1)=>{let n=typeof e;return t?n===`string`:n===`string`||he(e,`String`)}})),I,je=t((()=>{ge(),I=e=>Array.isArray?Array.isArray(e):he(e,`Array`)})),Me,Ne=t((()=>{Me=function(e){return e!==null&&typeof e!=`function`&&Number.isFinite(e.length)}})),Pe,Fe=t((()=>{ge(),Pe=e=>he(e,`Date`)})),L,Ie=t((()=>{ge(),L=(e,t=!1)=>{let n=typeof e;return t?n===`number`:n===`number`||he(e,`Number`)}})),R,Le=t((()=>{Ie(),R=e=>L(e)&&Number.isFinite(e)})),Re,ze=t((()=>{Re=e=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(e)})),Be,Ve=t((()=>{Be=e=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(e)})),He,Ue=t((()=>{He=e=>({}).toString.call(e).replace(/^\[object /,``).replace(/]$/,``)})),We,Ge,Ke=t((()=>{We=Object.prototype,Ge=function(e){let t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||We)}}));function z(e){if(N(e))return!0;if(Me(e))return!e.length;let t=He(e);if(t===`Map`||t===`Set`)return!e.size;if(Ge(e))return!Object.keys(e).length;for(let t in e)if(qe.call(e,t))return!1;return!0}var qe,Je=t((()=>{be(),Ne(),Ue(),Ke(),qe=Object.prototype.hasOwnProperty})),Ye,Xe=t((()=>{Ae(),Ye=(e,t,n)=>{let r=ke(t)?t.split(`.`):t;for(let t=0;t<r.length;t++)e=e?e[r[t]]:void 0;return e===void 0?n:e}})),Ze,Qe,$e=t((()=>{Ze=Object.prototype.hasOwnProperty,Qe=(e,t)=>e!=null&&Ze.call(e,t)}));function et(e,t,n){let r;if(!P(e)||typeof e!=`object`||t&&t(e))return e;let i=I(e),a=e.length;r=i?Array(a):typeof e==`object`?{}:_e(e)||L(e)||ke(e)?e:Pe(e)?new Date(+e):void 0;let o=i?void 0:Object.keys(Object(e)),s=-1;if(r)for(;++s<(o||e).length;){let i=o?o[s]:s,a=e[i];n&&n.includes(i.toString())?r[i]=a:r[i]=et(a,t,n)}return r}var tt=t((()=>{je(),ve(),Fe(),Ie(),Ae(),xe()}));function nt(e,t,n=!1,r=!1){if(t){if(e===t)return;if(P(t)&&typeof t==`object`){let i=Object(t),a=[];for(let e in i)a.push(e);let{length:o}=a,s=-1;for(;o--;){let o=a[++s];!P(i[o])||typeof i[o]!=`object`||r&&I(e[o])?it(e,o,i[o]):rt(e,t,o,n,r)}}}}function rt(e,t,n,r=!1,i=!1){let a=e[n],o=t[n],s=t[n],c=!0;if(I(o)){if(r)s=[];else if(I(a))s=a;else if(Me(a)){s=Array(a.length);let e=-1,t=a.length;for(;++e<t;)s[e]=a[e]}}else Te(o)?(s=a??{},typeof a!=`function`&&typeof a==`object`||(s={})):c=!1;c&&nt(s,o,r,i),it(e,n,s)}function it(e,t,n){(n!==void 0&&!at(e[t],n)||n===void 0&&!(t in e))&&(e[t]=n)}function at(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ot(e,...t){let n=-1,r=t.length;for(;++n<r;)nt(e,t[n],!0);return e}var st=t((()=>{je(),Ne(),Ee(),xe()}));function ct(e,t){if(!e||!Te(e))return e;let n={};return Object.keys(e).forEach((r=>{let i=e[r],a=!1;t.forEach((e=>{(ke(e)&&e===r||e instanceof RegExp&&r.match(e))&&(a=!0)})),a||(n[r]=i)})),n}var lt=t((()=>{Ee(),Ae()}));function ut(e){return Object.prototype.toString.call(e)}function dt(e){return Object.keys(e)}function ft(e,t,n){if(e===t)return!0;if(typeof e!=typeof t||e==null||t==null)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(ut(e)!==ut(t))return!1;if(M(e))return!!n?.skipFunction;if(typeof e!=`object`)return!1;if(I(e)){if(e.length!==t.length)return!1;for(let r=e.length-1;r>=0;r--)if(!ft(e[r],t[r],n))return!1;return!0}if(!Te(e))return!1;let r=dt(e),i=dt(t);if(r.length!==i.length)return!1;r.sort(),i.sort();for(let e=r.length-1;e>=0;e--)if(r[e]!=i[e])return!1;for(let i=r.length-1;i>=0;i--){let a=r[i];if(!ft(e[a],t[a],n))return!1}return!0}var pt=t((()=>{je(),ye(),Ee()}));function mt(e){if(!e)return[];if(Object.keys)return Object.keys(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(n);return t}function ht(e,t,n){let r=mt(t);for(let i=0;i<r.length;i++){let a=r[i];(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}return e}function gt(e,t,n=!0){if(e=`prototype`in e?e.prototype:e,t=`prototype`in t?t.prototype:t,Object.getOwnPropertyNames){let r=Object.getOwnPropertyNames(t);for(let i=0;i<r.length;i++){let a=r[i];a!==`constructor`&&(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}}else ht(e,t,n)}var _t=t((()=>{}));function B(e){return P(e)?I(e)?e:[e]:[]}function vt(e){if(Me(e))return e[e.length-1]}function yt(e,t){if(!I(e)||!I(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bt(e){if(!I(e))return[e];let t=[];for(let n of e)t.push(...bt(n));return t}var xt,St,Ct=t((()=>{je(),Ne(),xe(),xt=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)>0&&(n=i)}return n},St=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)<0&&(n=i)}return n}}));function wt(e,t,n){P(t)||(t=e,e=0),P(n)||(n=1);let r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),a=Array(i);for(;++r<i;)a[r]=e+r*n;return a}var Tt=t((()=>{xe()}));function Et(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Dt=t((()=>{}));function Ot(e){return Number(e)}var kt=t((()=>{})),At=t((()=>{}));function jt(e,t,n){let r=[t].concat([].slice.call(n));Mt&&console[e].apply(console,r)}var Mt,Nt,Pt,Ft=t((()=>{Ie(),Mt=typeof console<`u`,(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Info=3]=`Info`,e[e.Debug=4]=`Debug`})(Nt||={}),Pt=class e{static getInstance(t,n){return e._instance&&L(t)?e._instance.level(t):e._instance||=new e(t,n),e._instance}static setInstance(t){return e._instance=t}static setInstanceLevel(t){e._instance?e._instance.level(t):e._instance=new e(t)}static clearInstance(){e._instance=null}constructor(e=Nt.None,t){this._onErrorHandler=[],this._level=e,this._method=t}addErrorHandler(e){this._onErrorHandler.find((t=>t===e))||this._onErrorHandler.push(e)}removeErrorHandler(e){let t=this._onErrorHandler.findIndex((t=>t===e));t<0||this._onErrorHandler.splice(t,1)}callErrorHandler(...e){this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Nt.Info}canLogDebug(){return this._level>=Nt.Debug}canLogError(){return this._level>=Nt.Error}canLogWarn(){return this._level>=Nt.Warn}level(e){return arguments.length?(this._level=+e,this):this._level}error(...e){return this._level>=Nt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):jt(this._method??`error`,`ERROR`,e)),this}warn(...e){return this._level>=Nt.Warn&&jt(this._method||`warn`,`WARN`,e),this}info(...e){return this._level>=Nt.Info&&jt(this._method||`log`,`INFO`,e),this}debug(...e){return this._level>=Nt.Debug&&jt(this._method||`log`,`DEBUG`,e),this}},Pt._instance=null}));function It(e,t,n=0,r){for(N(r)&&(r=e.length);n<r;){let i=n+r>>>1;Et(e[i],t)>0?r=i:n=i+1}return n}var Lt,Rt=t((()=>{Dt(),be(),Lt=(e,t,n)=>{let r=e,i=t;for(;r<i;){let e=Math.floor((r+i)/2);n(e)>=0?i=e:r=e+1}return r}}));function zt(e,t,n=Ut,r=Ht){let i=r,a=n*Math.max(e,t);return Math.abs(e-t)<=Math.max(i,a)}function Bt(e,t,n,r){return e>t&&!zt(e,t,n,r)}function Vt(e,t,n,r){return e<t&&!zt(e,t,n,r)}var Ht,Ut,Wt=t((()=>{Ht=1e-10,Ut=1e-10})),Gt,Kt=t((()=>{Gt=e=>{let t=null,n=null;return(...r)=>(t&&r.every(((e,n)=>e===t[n]))||(t=r,n=e(...r)),n)}})),qt,Jt=t((()=>{qt=function(e,t,n){return e<t?t:e>n?n:e}})),Yt,Xt=t((()=>{Yt=(e,t,n)=>{let[r,i]=e;i<r&&(r=e[1],i=e[0]);let a=i-r;return a>=n-t?[t,n]:(r=Math.min(Math.max(r,t),n-a),[r,r+a])}}));function Zt(e,t){let n;return e>t&&(n=e,e=t,t=n),n=>Math.max(e,Math.min(t,n))}var Qt=t((()=>{}));function $t(e,t,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&en;if(typeof e!=`function`)throw TypeError(`Expected a function`);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(cancelAnimationFrame(s),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){let n=e-c;return c===void 0||n>=t||n<0||d&&e-l>=a}function _(){let e=Date.now();if(g(e))return v(e);s=h(_,function(e){let n=e-l,r=t-(e-c);return d?Math.min(r,a-n):r}(e))}function v(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function y(...e){let n=Date.now(),a=g(n);if(r=e,i=this,c=n,a){if(s===void 0)return function(e){return l=e,s=h(_,t),u?m(e):o}(c);if(d)return s=h(_,t),m(c)}return s===void 0&&(s=h(_,t)),o}return t=+t||0,F(n)&&(u=!!n.leading,d=`maxWait`in n,d&&(a=Math.max(R(n.maxWait)?n.maxWait:0,t)),f=`trailing`in n?!!n.trailing:f),y.cancel=function(){s!==void 0&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(s),l=0,r=c=i=s=void 0},y.flush=function(){return s===void 0?o:v(Date.now())},y.pending=function(){return s!==void 0},y}var en,tn=t((()=>{Se(),Le(),en=!1;try{en=typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`}catch{en=!1}en=!1}));function nn(e,t,n){let r=!0,i=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);return F(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),$t(e,t,{leading:r,trailing:i,maxWait:t})}var rn=t((()=>{tn(),Se()}));function an(e,t){return n=>e*(1-n)+t*n}function on(e,t){return function(n){return Math.round(e*(1-n)+t*n)}}function sn(e,t){let n=e.valueOf(),r=t.valueOf(),i=new Date;return e=>(i.setTime(n*(1-e)+r*e),i)}var cn,ln=t((()=>{cn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,new RegExp(cn.source,`g`)})),un=t((()=>{})),dn=t((()=>{})),fn=t((()=>{})),pn=t((()=>{})),mn=t((()=>{})),hn=t((()=>{})),gn=t((()=>{})),_n=t((()=>{})),vn=t((()=>{})),yn=t((()=>{})),bn=t((()=>{})),xn=t((()=>{ve(),ye(),be(),xe(),Se(),we(),Ee(),ge(),Oe(),Ae(),je(),Ne(),Fe(),Ie(),Le(),ze(),Ve(),Je(),Xe(),$e(),tt(),st(),lt(),pt(),_t(),Ct(),Tt(),At(),Rt(),At(),Wt(),Kt(),Jt(),Xt(),Qt(),tn(),rn(),ln(),kt(),un(),dn(),fn(),pn(),mn(),hn(),gn(),_n(),vn(),yn(),bn()})),Sn=t((()=>{}));function Cn(e){return e>1?0:e<-1?jn:Math.acos(e)}function wn(e){return e>=1?Mn:e<=-1?-Mn:Math.asin(e)}function Tn(e,t,n,r,i){let a=n,o=r;return typeof e==`number`&&typeof n==`number`&&(a=(1-i)*e+i*n),typeof t==`number`&&typeof r==`number`&&(o=(1-i)*t+i*r),{x:a,y:o}}function En(e,t){return e[0]*t[1]-e[1]*t[0]}function Dn(e,t){return Pn(e[0]-t[0])+Pn(e[1]-t[1])<1e-12}function On(e,t=10){return Math.round(e*t)/t}function kn(e){let t=e.toString().split(/[eE]/),n=(t[0].split(`.`)[1]||``).length-(+t[1]||0);return n>0?n:0}function An(e,t){return On(e-t,10**Math.max(kn(e),kn(t)))}var jn,Mn,Nn,V,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn=t((()=>{jn=Math.PI,Mn=jn/2,Nn=2*jn,V=2*Math.PI,Pn=Math.abs,Fn=Math.atan2,In=Math.cos,Ln=Math.max,Rn=Math.min,zn=Math.sin,Bn=Math.sqrt,Vn=Math.pow})),Un,Wn,Gn=t((()=>{Ie(),Hn(),Un=class e{constructor(e=0,t=0,n,r){this.x=0,this.y=0,this.x=e,this.y=t,this.x1=n,this.y1=r}clone(){return new e(this.x,this.y)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x1=e.x1,this.y1=e.y1,this.defined=e.defined,this.context=e.context,this}set(e,t){return this.x=e,this.y=t,this}add(e){return L(e)?(this.x+=e,void(this.y+=e)):(this.x+=e.x,this.y+=e.y,this)}sub(e){return L(e)?(this.x-=e,void(this.y-=e)):(this.x-=e.x,this.y-=e.y,this)}multi(e){throw Error(`暂不支持`)}div(e){throw Error(`暂不支持`)}},Wn=class{static distancePP(e,t){return Bn(Vn(e.x-t.x,2)+Vn(e.y-t.y,2))}static distanceNN(e,t,n,r){return Bn(Vn(e-n,2)+Vn(t-r,2))}static distancePN(e,t,n){return Bn(Vn(t-e.x,2)+Vn(n-e.y,2))}static pointAtPP(e,t,n){return new Un((t.x-e.x)*n+e.x,(t.y-e.y)*n+e.y)}}})),Kn=t((()=>{}));function qn(e){return Math.PI/180*e}function Jn(e){return 180*e/Math.PI}function Yn(e,t,n){return t?{x:e.x+t*Math.cos(n),y:e.y+t*Math.sin(n)}:{x:e.x,y:e.y}}function Xn(e){for(;e<0;)e+=2*Math.PI;for(;e>=2*Math.PI;)e-=2*Math.PI;return e}function Zn(e,t){let n=Math.abs(t-e);if(n>=2*Math.PI||2*Math.PI-n<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];let r=Xn(Math.min(e,t)),i=r+n,a=[r,i],o=Math.floor(r/Math.PI)*Math.PI/2;for(;o<i;)o>r&&a.push(o),o+=Math.PI/2;return a}function Qn(e,t,n,r){let{x:i,y:a}=t,o=Zn(n,r),{width:s,height:c}=e,l=[];return o.forEach((e=>{let t=Math.sin(e),n=Math.cos(e);t===1?l.push(c-a):t===-1?l.push(a):n===1?l.push(s-i):n===-1?l.push(i):(t>0?l.push(Math.abs((c-a)/t)):l.push(Math.abs(a/t)),n>0?l.push(Math.abs((s-i)/n)):l.push(Math.abs(i/n)))})),Math.min.apply(null,l)}function $n(e){return(e=Xn(e))>0&&e<=Math.PI/2?2:e>Math.PI/2&&e<=Math.PI?3:e>Math.PI&&e<=3*Math.PI/2?4:1}var er,tr,nr=t((()=>{Hn(),er=(e=0)=>{if(e<0)for(;e<-Nn;)e+=Nn;else if(e>0)for(;e>Nn;)e-=Nn;return e},tr=er}));function rr(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1]}function ir(e,t,n,r){let i=e[0],a=t[0],o=n[0],s=r[0];return a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i)&&(i=e[1],a=t[1],o=n[1],s=r[1],a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i))}function ar(e,t,n,r){if(!ir(e,t,n,r))return!1;let i=[0,0],a=[0,0],o=[0,0];if(rr(i,t,e),rr(a,r,n),Dn(i,a))return!0;rr(o,n,e);let s=En(o,a)/En(i,a);return s>=0&&s<=1&&[e[0]+i[0]*s,e[1]+i[1]*s]}function or(e,t,n){if(e===null)return t;if(t===null)return e;let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,n);return r>=c||i<=s||a>=u||o<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,s),y1:Math.max(a,l),x2:Math.min(i,c),y2:Math.min(o,u)}}function sr(e,t,n){if(e&&t){if(!n)return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1);let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,!0);return!(r>c||i<s||a>u||o<l)}return!0}function cr(e,t,n){if(!t)return!0;if(!n)return e.x>=t.x1&&e.x<=t.x2&&e.y>=t.y1&&e.y<=t.y2;let r=t.x1,i=t.x2,a=t.y1,o=t.y2;return r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),e.x>=r&&e.x<=i&&e.y>=a&&e.y<=o}function lr(e,t){return Math.abs(t[0]*e[0]+t[1]*e[1])}function ur({x:e,y:t},n,r={x:0,y:0}){return{x:(e-r.x)*Math.cos(n)-(t-r.y)*Math.sin(n)+r.x,y:(e-r.x)*Math.sin(n)+(t-r.y)*Math.cos(n)+r.y}}function dr(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function fr(e,t){let n=t?qn(e.angle):e.angle,r=dr(e);return[ur({x:e.x1,y:e.y1},n,r),ur({x:e.x2,y:e.y1},n,r),ur({x:e.x2,y:e.y2},n,r),ur({x:e.x1,y:e.y2},n,r)]}function pr(e,t,n=!1){let r=fr(e,n),i=fr(t,n),a=(e,t)=>[t.x-e.x,t.y-e.y],o=a(dr(e),dr(t)),s=a(r[0],r[1]),c=a(r[1],r[2]),l=a(i[0],i[1]),u=a(i[1],i[2]),d=n?qn(e.angle):e.angle,f=n?qn(90-e.angle):e.angle+Mn,p=n?qn(t.angle):t.angle,m=n?qn(90-t.angle):t.angle+Mn;f>V&&(f-=V),m>V&&(m-=V);let h=(e,t,n,r)=>{let i=[Math.cos(t),Math.sin(t)];return e+(lr(i,n)+lr(i,r))/2>lr(i,o)};return h((e.x2-e.x1)/2,d,l,u)&&h((e.y2-e.y1)/2,f,l,u)&&h((t.x2-t.x1)/2,p,s,c)&&h((t.y2-t.y1)/2,m,s,c)}var mr,hr,gr=t((()=>{nr(),Hn(),(function(e){e[e.NONE=0]=`NONE`,e[e.BBOX1=1]=`BBOX1`,e[e.BBOX2=2]=`BBOX2`})(mr||={}),hr=(e,t,n)=>{let r=e.x1,i=e.x2,a=e.y1,o=e.y2,s=t.x1,c=t.x2,l=t.y1,u=t.y2;return n&&(r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),s>c&&([s,c]=[c,s]),l>u&&([l,u]=[u,l])),{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}}})),_r=t((()=>{})),vr=t((()=>{})),yr=t((()=>{gr(),_r(),vr()})),br=t((()=>{}));function xr(e,t,n,r,i,a){if(a>t&&a>r||a<t&&a<r||r===t)return 0;let o=(a-t)/(r-t),s=r<t?1:-1;o!==1&&o!==0||(s=r<t?.5:-.5);let c=o*(n-e)+e;return c===i?1/0:c>i?s:0}var Sr=t((()=>{})),Cr=t((()=>{})),wr,Tr=t((()=>{wr=e=>{let t=e.charCodeAt(0),n=e.length===2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r===12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r===8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r===172||r===175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r===161||r===164||167<=r&&r<=168||r===170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r===198||r===208||215<=r&&r<=216||222<=r&&r<=225||r===230||232<=r&&r<=234||236<=r&&r<=237||r===240||242<=r&&r<=243||247<=r&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||294<=r&&r<=295||r===299||305<=r&&r<=307||r===312||319<=r&&r<=322||r===324||328<=r&&r<=331||r===333||338<=r&&r<=339||358<=r&&r<=359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||713<=r&&r<=715||r===717||r===720||728<=r&&r<=731||r===733||r===735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r===1025||1040<=r&&r<=1103||r===1105||r===8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r===8240||8242<=r&&r<=8243||r===8245||r===8251||r===8254||r===8308||r===8319||8321<=r&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||8481<=r&&r<=8482||r===8486||r===8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r===8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r===8658||r===8660||r===8679||r===8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r===8715||r===8719||r===8721||r===8725||r===8730||8733<=r&&r<=8736||r===8739||r===8741||8743<=r&&r<=8748||r===8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r===8776||r===8780||r===8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r===8853||r===8857||r===8869||r===8895||r===8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r===9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r===9711||9733<=r&&r<=9734||r===9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r===9756||r===9758||r===9792||r===9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r===9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r===9955||9960<=r&&r<=9983||r===10045||r===10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r===65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`}}));function Er(e,t={},n){n||=1;let{fontStyle:r=t.fontStyle,fontVariant:i=t.fontVariant,fontWeight:a=t.fontWeight,fontSize:o=t.fontSize,fontFamily:s=t.fontFamily}=e;return(r?r+` `:``)+(i?i+` `:``)+(a?a+` `:``)+o*n+`px `+(s||`sans-serif`)}var Dr=t((()=>{})),Or,kr=t((()=>{xn(),Tr(),Dr(),Or=class e{constructor(e,t){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=e,this._userSpec=t??{},this.textSpec=this._initSpec(),P(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=P(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(N(this._canvas)&&(P(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),N(this._canvas)&&typeof window<`u`&&window.document!==void 0&&globalThis&&P(globalThis.document)&&(this._canvas=globalThis.document.createElement(`canvas`))),N(this._context)&&P(this._canvas)){let e=this._canvas.getContext(`2d`);P(e)&&(e.save(),e.font=Er(this.textSpec),this._contextSaved=!0,this._context=e)}return!N(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){let{defaultFontParams:e={}}=this._option,{fontStyle:t=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight??`normal`,fontSize:i=e.fontSize??12,fontFamily:a=e.fontFamily??`sans-serif`,align:o,textAlign:s=o??`center`,baseline:c,textBaseline:l=c??`middle`,ellipsis:u,limit:d}=this._userSpec,{lineHeight:f=i}=this._userSpec;return ke(f)&&f[f.length-1]===`%`&&(f=i*(Number.parseFloat(f.substring(0,f.length-1))/100)),{fontStyle:t,fontVariant:n,fontFamily:a,fontSize:i,fontWeight:r,textAlign:s,textBaseline:l,ellipsis:u,limit:d,lineHeight:f}}measure(e,t){switch(t){case`vrender`:case`canopus`:return this.fullMeasure(e);case`canvas`:return this.measureWithNaiveCanvas(e);case`simple`:return this.quickMeasureWithoutCanvas(e);default:return this.quickMeasure(e)}}fullMeasure(e){if(N(e))return{width:0,height:0};if(N(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(e);let{fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:o,limit:s,lineHeight:c}=this.textSpec,l;try{let u=this._option.getTextBounds({text:e,fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:!!o,maxLineWidth:s||1/0,lineHeight:c});l={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(e)}return l}measureWithNaiveCanvas(e){return this._measureReduce(e,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(e){if(!this.initContext())return this._quickMeasureWithoutCanvas(e);let t=this._context.measureText(e),{fontSize:n,lineHeight:r}=this.textSpec;return{width:t.width,height:r??n,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}quickMeasure(e){return this._measureReduce(e,this._quickMeasure.bind(this))}_quickMeasure(t){let n={width:0,height:0};for(let r=0;r<t.length;r++){let i=t[r],a=this._measureSpecialChar(i);N(a)&&e.NUMBERS_CHAR_SET.includes(i)&&(a=this._measureNumberChar()),N(a)&&[`F`,`W`].includes(wr(i))&&(a=this._measureFullSizeChar()),N(a)&&(a=this._measureLetterChar()),n.width+=a.width,n.height=Math.max(n.height,a.height),!N(a.fontBoundingBoxAscent)&&(n.fontBoundingBoxAscent=a.fontBoundingBoxAscent),!N(a.fontBoundingBoxDescent)&&(n.fontBoundingBoxDescent=a.fontBoundingBoxDescent)}return n}quickMeasureWithoutCanvas(e){return this._measureReduce(e,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(e){let t={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let r=0;r<e.length;r++){let i=e[r],a=[`F`,`W`].includes(wr(i))?1:.53;t.width+=a*n}return t.height=r??n,t}_measureReduce(e,t){let{fontSize:n,lineHeight:r}=this.textSpec,i={width:0,height:0};if(N(e))return i;if(I(e)){let a=e.filter(P).map((e=>e.toString()));return a.length===0?i:a.length===1?t(a[0]):{width:a.reduce(((e,n)=>Math.max(e,t(n).width)),0),height:a.length*((r??n)+1)+1}}return t(e.toString())}_measureNumberChar(){if(N(this._numberCharSize)){let t=this._standardMethod(e.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/e.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return N(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(e.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(N(this._letterCharSize)){let t=this._standardMethod(e.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/e.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(e){return P(this._specialCharSizeMap[e])?this._specialCharSizeMap[e]:this.specialCharSet.includes(e)?(this._specialCharSizeMap[e]=this._standardMethod(e),this._specialCharSizeMap[e]):null}release(){P(this._canvas)&&(this._canvas=null),P(this._context)&&(this._contextSaved&&=(this._context.restore(),!1),this._context=null)}},Or.ALPHABET_CHAR_SET=`abcdefghijklmnopqrstuvwxyz`,Or.NUMBERS_CHAR_SET=`0123456789`,Or.FULL_SIZE_CHAR=`字`})),Ar=t((()=>{})),jr=t((()=>{kr(),Ar(),Dr()})),Mr=t((()=>{Tr(),jr()})),Nr,Pr,Fr,Ir=t((()=>{Nr=(e,t)=>{let{x1:n,x2:r,y1:i,y2:a}=e,o=Math.abs(r-n),s=Math.abs(a-i),c=(n+r)/2,l=(i+a)/2,u=0,d=0;switch(t){case`top`:case`inside-top`:d=-.5;break;case`bottom`:case`inside-bottom`:d=.5;break;case`left`:case`inside-left`:u=-.5;break;case`right`:case`inside-right`:u=.5;break;case`top-right`:u=.5,d=-.5;break;case`top-left`:u=-.5,d=-.5;break;case`bottom-right`:u=.5,d=.5;break;case`bottom-left`:u=-.5,d=.5}return c+=u*o,l+=d*s,{x:c,y:l}},Pr=(e,t)=>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Fr=(e,t)=>{let n=[{x:Math.cos(e.angle),y:Math.sin(e.angle)},{x:-Math.sin(e.angle),y:Math.cos(e.angle)},{x:Math.cos(t.angle),y:Math.sin(e.angle)},{x:-Math.sin(t.angle),y:Math.cos(e.angle)}];function r(e,t,n){let r=e.getRotatedCorners().map((e=>e.x*t+e.y*n));return{min:Math.min(...r),max:Math.max(...r)}}let i=0;for(let a of n){let n=r(e,a.x,a.y),o=r(t,a.x,a.y),s;s=n.max<o.min?o.min-n.max:o.max<n.min?n.min-o.max:0,i=Math.max(i,s)}return i}})),Lr=t((()=>{Kn(),yr(),br(),Sr(),Cr(),Mr(),Ir()}));function Rr(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=t;return n.onlyTranslate()?(e!==t&&e.setValue(t.x1,t.y1,t.x2,t.y2),e.translate(n.e,n.f),t):(e.clear(),e.add(n.a*r+n.c*i+n.e,n.b*r+n.d*i+n.f),e.add(n.a*a+n.c*i+n.e,n.b*a+n.d*i+n.f),e.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),e.add(n.a*r+n.c*o+n.e,n.b*r+n.d*o+n.f),t)}var zr,Br,Vr,Hr=t((()=>{xn(),Lr(),zr=class e{constructor(e){e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}clone(){return new e(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2}setValue(e=0,t=0,n=0,r=0){return this.x1=e,this.y1=t,this.x2=n,this.y2=r,this}set(e=0,t=0,n=0,r=0){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),r<t?(this.y2=t,this.y1=r):(this.y1=t,this.y2=r),this}add(e=0,t=0){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this}expand(e=0){return I(e)?(this.y1-=e[0],this.x2+=e[1],this.y2+=e[2],this.x1-=e[3]):(this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(e=0,t=0){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}rotate(e=0,t=0,n=0){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])}scale(e=0,t=0,n=0,r=0){let i=this.scalePoints(e,t,n,r);return this.clear().add(i[0],i[1]).add(i[2],i[3])}union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this}intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this}encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2}alignsWith(e){return e&&(this.x1===e.x1||this.x2===e.x2||this.y1===e.y1||this.y2===e.y2)}intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)}contains(e=0,t=0){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)}containsPoint(e){return!(e.x<this.x1||e.x>this.x2||e.y<this.y1||e.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(e=0){return this.x1*=e,this.x2*=e,this}scaleY(e=0){return this.y1*=e,this.y2*=e,this}transformWithMatrix(e){return Rr(this,this,e),this}copy(e){return this.x1=e.x1,this.y1=e.y1,this.x2=e.x2,this.y2=e.y2,this}rotatedPoints(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=this,s=Math.cos(e),c=Math.sin(e),l=t-t*s+n*c,u=n-t*c-n*s;return[s*r-c*i+l,c*r+s*i+u,s*r-c*o+l,c*r+s*o+u,s*a-c*i+l,c*a+s*i+u,s*a-c*o+l,c*a+s*o+u]}scalePoints(e,t,n,r){let{x1:i,y1:a,x2:o,y2:s}=this;return[e*i+(1-e)*n,t*a+(1-t)*r,e*o+(1-e)*n,t*s+(1-t)*r]}},Br=class extends zr{},Vr=class e extends zr{constructor(e,t=0){super(e),e&&(this.angle=e.angle??t)}intersects(e){return pr(this,e)}setValue(e=0,t=0,n=0,r=0,i=0){return super.setValue(e,t,n,r),this.angle=i,this}clone(){return new e(this)}getRotatedCorners(){let e={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[ur({x:this.x1,y:this.y1},this.angle,e),ur({x:this.x2,y:this.y1},this.angle,e),ur({x:this.x1,y:this.y2},this.angle,e),ur({x:this.x2,y:this.y2},this.angle,e)]}}}));function Ur(e,t,n,r,i,a,o,s){let c=t.a,l=t.b,u=t.c,d=t.d,f=t.e,p=t.f,m=In(o),h=zn(o),g,_;s?(g=s[0],_=s[1]):(g=n,_=r);let v=g-n,y=_-r,b=c*m+u*h,x=l*m+d*h,S=u*m-c*h,C=d*m-l*h;e.a=i*b,e.b=i*x,e.c=a*S,e.d=a*C,e.e=f+c*g+u*_-b*v-S*y,e.f=p+l*g+d*_-x*v-C*y}var Wr,Gr=t((()=>{nr(),Hn(),Wr=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}equalToMatrix(e){return this.e===e.e&&this.f===e.f&&this.a===e.a&&this.d===e.d&&this.b===e.b&&this.c===e.c}equalTo(e,t,n,r,i,a){return this.e===i&&this.f===a&&this.a===e&&this.d===r&&this.b===t&&this.c===n}setValue(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){let t=this.a,n=this.b,r=this.c,i=this.d,a=this.e,o=this.f,s=new e,c=t*i-n*r;return s.a=i/c,s.b=-n/c,s.c=-r/c,s.d=t/c,s.e=(r*o-i*a)/c,s.f=-(t*o-n*a)/c,s}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a*t+this.c*n,i=this.b*t+this.d*n,a=this.a*-n+this.c*t,o=this.b*-n+this.d*t;return this.a=r,this.b=i,this.c=a,this.d=o,this}rotateByCenter(e,t,n){let r=Math.cos(e),i=Math.sin(e),a=(1-r)*t+i*n,o=(1-r)*n-i*t,s=r*this.a-i*this.b,c=i*this.a+r*this.b,l=r*this.c-i*this.d,u=i*this.c+r*this.d,d=r*this.e-i*this.f+a,f=i*this.e+r*this.f+o;return this.a=s,this.b=c,this.c=l,this.d=u,this.e=d,this.f=f,this}scale(e,t){return this.a*=e,this.b*=e,this.c*=t,this.d*=t,this}setScale(e,t){return this.b=this.b/this.a*e,this.c=this.c/this.d*t,this.a=e,this.d=t,this}transform(e,t,n,r,i,a){return this.multiply(e,t,n,r,i,a),this}translate(e,t){return this.e+=this.a*e+this.c*t,this.f+=this.b*e+this.d*t,this}transpose(){let{a:e,b:t,c:n,d:r,e:i,f:a}=this;return this.a=t,this.b=e,this.c=r,this.d=n,this.e=a,this.f=i,this}multiply(e,t,n,r,i,a){let o=this.a,s=this.b,c=this.c,l=this.d,u=o*e+c*t,d=s*e+l*t,f=o*n+c*r,p=s*n+l*r,m=o*i+c*a+this.e,h=s*i+l*a+this.f;return this.a=u,this.b=d,this.c=f,this.d=p,this.e=m,this.f=h,this}interpolate(t,n){let r=new e;return r.a=this.a+(t.a-this.a)*n,r.b=this.b+(t.b-this.b)*n,r.c=this.c+(t.c-this.c)*n,r.d=this.d+(t.d-this.d)*n,r.e=this.e+(t.e-this.e)*n,r.f=this.f+(t.f-this.f)*n,r}transformPoint(e,t){let{a:n,b:r,c:i,d:a,e:o,f:s}=this,c=n*a-r*i,l=a/c,u=-r/c,d=-i/c,f=n/c,p=(i*s-a*o)/c,m=-(n*s-r*o)/c,{x:h,y:g}=e;t.x=h*l+g*d+p,t.y=h*u+g*f+m}onlyTranslate(e=1){return this.a===e&&this.b===0&&this.c===0&&this.d===e}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){let e=this.a,t=this.b,n=this.c,r=this.d,i=e*r-t*n,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!==0||t!==0){let o=Math.sqrt(e*e+t*t);a.rotateDeg=t>0?Math.acos(e/o):-Math.acos(e/o),a.scaleX=o,a.scaleY=i/o,a.skewX=(e*n+t*r)/i,a.skewY=0}else if(n!==0||r!==0){let o=Math.sqrt(n*n+r*r);a.rotateDeg=Math.PI/2-(r>0?Math.acos(-n/o):-Math.acos(n/o)),a.scaleX=i/o,a.scaleY=o,a.skewX=0,a.skewY=(e*n+t*r)/i}return a.rotateDeg=Jn(a.rotateDeg),a}}})),Kr=t((()=>{Sn(),Gn(),Hr(),Gr()})),qr,Jr=t((()=>{qr=class{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(e,t){let{CLEAN_THRESHOLD:n=this.CLEAN_THRESHOLD,L_TIME:r=this.L_TIME,R_COUNT:i=this.R_COUNT}=t;if(e.size<n)return 0;let a=0,o=t=>{a++,e.delete(t)},s=Date.now();return e.forEach(((e,t)=>{if(e.timestamp.length<i)return o(t);let n=0;for(;s-e.timestamp[e.timestamp.length-1-n]<r&&(n++,!(n>=i)););if(n<i)return o(t);for(;s-e.timestamp[0]>r;)e.timestamp.shift()})),a}addLimitedTimestamp(e,t,n){let{R_TIMESTAMP_MAX_SIZE:r=this.R_TIMESTAMP_MAX_SIZE}=n;e.timestamp.length>r&&e.timestamp.shift(),e.timestamp.push(t)}clearTimeStamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();e.forEach((e=>{for(;r-e.timestamp[0]>n;)e.timestamp.shift()}))}clearItemTimestamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();for(;r-e.timestamp[0]>n;)e.timestamp.shift()}}}));function Yr(e,t,n){t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<60?(o=r,s=i,c=0):60<=e&&e<120?(o=i,s=r,c=0):120<=e&&e<180?(o=0,s=r,c=i):180<=e&&e<240?(o=0,s=i,c=r):240<=e&&e<300?(o=i,s=0,c=r):300<=e&&e<360&&(o=r,s=0,c=i),o=Math.round(255*(o+a)),s=Math.round(255*(s+a)),c=Math.round(255*(c+a)),{r:o,g:s,b:c}}var Xr=t((()=>{}));function Zr(e,t,n){e/=255,t/=255,n/=255;let r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=0,s=0,c=0;return o=a===0?0:i===e?(t-n)/a%6:i===t?(n-e)/a+2:(e-t)/a+4,o=Math.round(60*o),o<0&&(o+=360),c=(i+r)/2,s=a===0?0:a/(1-Math.abs(2*c-1)),s=+(100*s).toFixed(1),c=+(100*c).toFixed(1),{h:o,s,l:c}}var Qr=t((()=>{}));function $r(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?`0`:``)+e.toString(16)}function ei(e){return L(e)?new li(e>>16,e>>8&255,255&e,1):I(e)?new li(e[0],e[1],e[2]):new li(255,255,255)}function ti(e){return L(e)?new li(e>>>24,e>>>16&255,e>>>8&255,255&e):I(e)?new li(e[0],e[1],e[2],e[3]):new li(255,255,255,1)}function ni(e){return e<.04045?.0773993808*e:(.9478672986*e+.0521327014)**2.4}function ri(e){return e<.0031308?12.92*e:1.055*e**.41666-.055}var ii,ai,oi,si,ci,li,ui=t((()=>{xn(),Xr(),Qr(),ii=/^#([0-9a-f]{3,8})$/,ai={transparent:4294967040},oi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},si=(e,t)=>{let n=ii.exec(e);if(t||n){let e=parseInt(n[1],16),t=n[1].length;return t===3?new li((e>>8&15)+((e>>8&15)<<4),(e>>4&15)+((e>>4&15)<<4),(15&e)+((15&e)<<4),1):t===6?ei(e):t===8?new li(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):null}},ci=class e{static Brighter(t,n=1){return n===1?t:new e(t).brighter(n).toRGBA()}static SetOpacity(t,n=1){return n===1?t:new e(t).setOpacity(n).toRGBA()}static getColorBrightness(t,n=`hsl`){let r=t instanceof e?t:new e(t);switch(n){case`hsv`:default:return r.getHSVBrightness();case`hsl`:return r.getHSLBrightness();case`lum`:return r.getLuminance();case`lum2`:return r.getLuminance2();case`lum3`:return r.getLuminance3();case`wcag`:return r.getLuminanceWCAG()}}static parseColorString(e){if(P(ai[e]))return ti(ai[e]);if(P(oi[e]))return ei(oi[e]);let t=`${e}`.trim().toLowerCase(),n=si(t);if(n!==void 0)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(t)){let e=t.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,``).split(`,`);return new li(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(t)){let e=t.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,``).split(`,`),n=Yr(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10));return new li(n.r,n.g,n.b,parseFloat(e[3]))}}constructor(t){let n=e.parseColorString(t);n?this.color=n:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new li(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e))),this}add(e){let{r:t,g:n,b:r}=this.color;return this.color.r+=Math.min(255,t+e.color.r),this.color.g+=Math.min(255,n+e.color.g),this.color.b+=Math.min(255,r+e.color.b),this}sub(e){return this.color.r=Math.max(0,this.color.r-e.color.r),this.color.g=Math.max(0,this.color.g-e.color.g),this.color.b=Math.max(0,this.color.b-e.color.b),this}multiply(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(e,t,n){let r=this.color.opacity,i=Zr(this.color.r,this.color.g,this.color.b),a=Yr(N(e)?i.h:qt(e,0,360),N(t)?i.s:t>=0&&t<=1?100*t:t,N(n)?i.l:n<=1&&n>=0?100*n:n);return this.color=new li(a.r,a.g,a.b,r),this}setRGB(e,t,n){return!N(e)&&(this.color.r=e),!N(t)&&(this.color.g=t),!N(n)&&(this.color.b=n),this}setHex(e){let t=`${e}`.trim().toLowerCase();return si(t,!0)??this}setColorName(e){let t=oi[e.toLowerCase()];return t===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(t),this}setScalar(e){return this.color.r=e,this.color.g=e,this.color.b=e,this}setOpacity(e=1){return this.color.opacity=e,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){let e=this.color.r/255,t=this.color.g/255,n=this.color.b/255,r,i,a;return r=e<=.03928?e/12.92:((e+.055)/1.055)**2.4,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,.2126*r+.7152*i+.0722*a}clone(){return new e(this.color.toString())}copyGammaToLinear(e,t=2){return this.color.r=e.color.r**+t,this.color.g=e.color.g**+t,this.color.b=e.color.b**+t,this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.color.r=e.color.r**+n,this.color.g=e.color.g**+n,this.color.b=e.color.b**+n,this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.color.r=ni(e.color.r),this.color.g=ni(e.color.g),this.color.b=ni(e.color.b),this}copyLinearToSRGB(e){return this.color.r=ri(e.color.r),this.color.g=ri(e.color.g),this.color.b=ri(e.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}},li=class{constructor(e,t,n,r){this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.opacity=P(r)?isNaN(+r)?1:Math.max(0,Math.min(1,+r)):1}formatHex(){return`#${$r(this.r)+$r(this.g)+$r(this.b)+(this.opacity===1?``:$r(255*this.opacity))}`}formatRgb(){let e=this.opacity;return`${e===1?`rgb(`:`rgba(`}${this.r},${this.g},${this.b}${e===1?`)`:`,${e})`}`}formatHsl(){let e=this.opacity,{h:t,s:n,l:r}=Zr(this.r,this.g,this.b);return`${e===1?`hsl(`:`hsla(`}${t},${n}%,${r}%${e===1?`)`:`,${e})`}`}toString(){return this.formatHex()}}}));function di(e){let t=``,n=``,r=``,i=+(e[0]===`#`);for(let a=i;a<e.length;a++)e[a]!==`#`&&(a<i+2?t+=e[a]:a<i+4?n+=e[a]:a<i+6&&(r+=e[a]));return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]}var fi=t((()=>{}));function pi(e,t,n){return Number((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}var mi=t((()=>{}));function hi(e,t){let n=e.r,r=t.r,i=e.g,a=t.g,o=e.b,s=t.b,c=e.opacity,l=t.opacity;return e=>{let t=Math.round(n*(1-e)+r*e),u=Math.round(i*(1-e)+a*e),d=Math.round(o*(1-e)+s*e);return new li(t,u,d,c*(1-e)+l*e)}}var gi=t((()=>{ui()})),_i=r({Color:()=>ci,DEFAULT_COLORS:()=>oi,RGB:()=>li,hexToRgb:()=>di,hslToRgb:()=>Yr,interpolateRgb:()=>hi,rgbToHex:()=>pi,rgbToHsl:()=>Zr}),vi=t((()=>{ui(),fi(),Xr(),mi(),Qr(),gi()})),yi=t((()=>{}));function bi(e){if(R(e))return[e,e,e,e];if(I(e)){let t=e.length;if(t===1){let t=e[0];return[t,t,t,t]}if(t===2){let[t,n]=e;return[t,n,t,n]}if(t===3){let[t,n,r]=e;return[t,n,r,n]}if(t===4)return e}if(F(e)){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e;return[t,n,r,i]}return[0,0,0,0]}var xi=t((()=>{Le(),je(),Se()})),Si=t((()=>{})),Ci=t((()=>{})),wi=t((()=>{Si(),Ci()}));function Ti(e,t=0,n=0){if(!e)return{width:t,height:n};let r;try{r=window==null?void 0:window.getComputedStyle}catch{r=()=>({})}let i=r(e);if(/^(\d*\.?\d+)(px)$/.exec(i.width)){let r=parseFloat(i.width)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)||e.clientWidth-1,a=parseFloat(i.height)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)||e.clientHeight-1;return{width:r<=0?t:r,height:a<=0?n:a}}return{width:t,height:n}}function Ei(e){let{x:t,y:n}=e.getBoundingClientRect();return{x:t,y:n}}var Di,Oi,ki=t((()=>{Di=(e=``)=>{let t={};return e.split(`;`).forEach((e=>{if(e){let n=e.split(`:`);if(n.length===2){let e=n[0].trim(),r=n[1].trim();e&&r&&(t[e]=r)}}})),t},Oi=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase()})),Ai=t((()=>{})),ji=t((()=>{})),Mi=t((()=>{})),Ni=t((()=>{})),Pi=t((()=>{Ai(),ji(),Ni(),Mi()})),Fi,Ii=t((()=>{Fi=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.locale_shortWeekdays=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],this.locale_periods=[`AM`,`PM`],this.locale_weekdays=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],this.locale_shortMonths=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],this.numberRe=/^\s*\d+/,this.pads={"-":``,_:` `,0:`0`},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],this.formatShortWeekday=e=>this.locale_shortWeekdays[e.getDay()],this.formatWeekday=e=>this.locale_weekdays[e.getDay()],this.formatShortMonth=e=>this.locale_shortMonths[e.getMonth()],this.formatMonth=e=>this.locale_months[e.getMonth()],this.formatDayOfMonth=(e,t)=>this.pad(e.getDate(),t,2),this.formatHour24=(e,t)=>this.pad(e.getHours(),t,2),this.formatHour12=(e,t)=>this.pad(e.getHours()%12||12,t,2),this.formatMilliseconds=(e,t)=>this.pad(e.getMilliseconds(),t,3),this.formatMonthNumber=(e,t)=>this.pad(e.getMonth()+1,t,2),this.formatMinutes=(e,t)=>this.pad(e.getMinutes(),t,2),this.formatPeriod=e=>this.locale_periods[+(e.getHours()>=12)],this.formatSeconds=(e,t)=>this.pad(e.getSeconds(),t,2),this.formatFullYear=(e,t)=>this.pad(e.getFullYear()%1e4,t,4),this.formatUTCShortWeekday=e=>this.locale_shortWeekdays[e.getUTCDay()],this.formatUTCWeekday=e=>this.locale_weekdays[e.getUTCDay()],this.formatUTCShortMonth=e=>this.locale_shortMonths[e.getUTCMonth()],this.formatUTCMonth=e=>this.locale_months[e.getUTCMonth()],this.formatUTCDayOfMonth=(e,t)=>this.pad(e.getUTCDate(),t,2),this.formatUTCHour24=(e,t)=>this.pad(e.getUTCHours(),t,2),this.formatUTCHour12=(e,t)=>this.pad(e.getUTCHours()%12||12,t,2),this.formatUTCMilliseconds=(e,t)=>this.pad(e.getUTCMilliseconds(),t,3),this.formatUTCMonthNumber=(e,t)=>this.pad(e.getUTCMonth()+1,t,2),this.formatUTCMinutes=(e,t)=>this.pad(e.getUTCMinutes(),t,2),this.formatUTCPeriod=e=>this.locale_periods[+(e.getUTCHours()>=12)],this.formatUTCSeconds=(e,t)=>this.pad(e.getUTCSeconds(),t,2),this.formatUTCFullYear=(e,t)=>this.pad(e.getUTCFullYear()%1e4,t,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(e,t,n)=>{let r=this.shortWeekdayRe.exec(t.slice(n));return r?(e.w=this.shortWeekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseWeekday=(e,t,n)=>{let r=this.weekdayRe.exec(t.slice(n));return r?(e.w=this.weekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseShortMonth=(e,t,n)=>{let r=this.shortMonthRe.exec(t.slice(n));return r?(e.m=this.shortMonthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseMonth=(e,t,n)=>{let r=this.monthRe.exec(t.slice(n));return r?(e.m=this.monthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseDayOfMonth=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1},this.parseHour24=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1},this.parseMilliseconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1},this.parseMonthNumber=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.m=r-1,n+r[0].length):-1},this.parseMinutes=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1},this.parsePeriod=(e,t,n)=>{let r=this.periodRe.exec(t.slice(n));return r?(e.p=this.periodLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseSeconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1},this.parseFullYear=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(e,t)=>this.newFormat(e,this.formats)(new Date(this.getFullTimeStamp(t))),this.timeUTCFormat=(e,t)=>this.newFormat(e,this.utcFormats)(new Date(this.getFullTimeStamp(t))),this.timeParse=(e,t)=>this.newParse(e,!1)(t+``),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(e){return e.replace(this.requoteRe,`\\$&`)}localDate(e){if(0<=e.y&&e.y<100){let t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}utcDate(e){if(0<=e.y&&e.y<100){let t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}newDate(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}formatRe(e){return RegExp(`^(?:`+e.map(this.requoteF).join(`|`)+`)`,`i`)}formatLookup(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}pad(e,t,n){let r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}parseSpecifier(e,t,n,r){let i=0,a=t.length,o=n.length,s,c;for(;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=this.parses[s in this.pads?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!==n.charCodeAt(r++))return-1}return r}newParse(e,t){let n=this;return function(r){let i=n.newDate(1900,void 0,1);return n.parseSpecifier(i,e,r+=``,0)===r.length?`Q`in i?new Date(i.Q):`s`in i?new Date(1e3*i.s+(`L`in i?i.L:0)):(t&&!(`Z`in i)&&(i.Z=0),`p`in i&&(i.H=i.H%12+12*i.p),i.m===void 0&&(i.m=`q`in i?i.q:0),`Z`in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,n.utcDate(i)):n.localDate(i)):null}}newFormat(e,t){let n=this;return function(r){let i=[],a=-1,o=0,s=e.length,c,l,u;for(r instanceof Date||(r=new Date(+r));++a<s;)e.charCodeAt(a)===37&&(i.push(e.slice(o,a)),(l=n.pads[c=e.charAt(++a)])?c=e.charAt(++a):l=c===`e`?` `:`0`,u=t[c],c=u(r,l),i.push(c),o=a+1);return i.push(e.slice(o,a)),i.join(``)}}getFullTimeStamp(e){let t=parseInt(e+``,10);return String(t).length===10?1e3*t:t}}})),Li=t((()=>{})),Ri=t((()=>{})),zi=t((()=>{Ri(),Li()})),Bi=t((()=>{})),Vi=t((()=>{})),Hi=t((()=>{})),Ui=t((()=>{Bi(),Vi(),Hi()})),Wi,H=t((()=>{Wi=n(me()),xn(),Kr(),Jr(),Hn(),nr(),vi(),Lr(),yi(),Ft(),xi(),wi(),ki(),Pi(),vi(),Ii(),zi(),Ui()})),Gi=(e,t)=>{let{callback:n}=t;return n&&(e=e.filter(n)),e};H();var Ki=function(e,...t){return Yi(et(e),...t)};function qi(e,t,n){let r=t[n];if(r===void 0)e[n]=null;else if(F(r)){F(e[n])||(e[n]={});for(let t in r)qi(e[n],r,t)}else e[n]=r}function Ji(e,t){if(F(t)&&e!==t)for(let n in t)qi(e,t,n)}function Yi(e,...t){e||={};let n=-1,r=t.length;for(;++n<r;)Ji(e,t[n]);return e}var Xi;(function(e){e.DSV=`dsv`,e.TREE=`tree`,e.GEO=`geo`,e.BYTE=`bytejson`,e.HEX=`hex`,e.GRAPH=`graph`,e.TABLE=`table`,e.GEO_GRATICULE=`geo-graticule`})(Xi||={});var Zi=(e,t)=>{let{fields:n,key:r,value:i,retains:a}=t,o=[];for(let t=0;t<e.length;t++)n.forEach((s=>{let c={};if(c[r]=s,c[i]=e[t][s],a)a.forEach((n=>{c[n]=e[t][n]}));else for(let r in e[t])n.indexOf(r)===-1&&(c[r]=e[t][r]);o.push(c)}));return o};H();var Qi=(e,t)=>{if(!t?.fields||e.length===0)return e;let n=t.fields,r=e[0],i={},a=[];for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){let o=n[t];if(o.sort&&(R(o.sortIndex)||(o.sortIndex=0),P(o.sortReverse)||(o.sortReverse=o.sort===`desc`)),!o.type){let n=r;t in r||(n=e.find((e=>t in e))??r),o.type=typeof n[t]==`number`?`linear`:`ordinal`}let s;if(typeof o.sortIndex==`number`&&(s={key:t,type:o.type,index:o.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===o.sortReverse},a.push(s)),o.domain?.length>0){if(o.type===`ordinal`){o._domainCache={},i[t]=o;let e={};o.domain.forEach(((t,n)=>{e[t]=n,o._domainCache[t]=n})),s&&(s.sortIndex=e,s.sortIndexCount=o.domain.length)}else o.domain.length>=2&&(i[t]=o)}}return Object.keys(i).length>0&&(e=e.filter((e=>{for(let t in i){let n=i[t];if(n.type===`ordinal`){if(!(e[t]in n._domainCache))return!1}else if(n.domain[0]>e[t]||n.domain[1]<e[t])return!1}return!0}))),a.sort(((e,t)=>e.index-t.index)),e.sort(((e,t)=>$i(e,t,a))),e};function $i(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=0;if(i.type===`ordinal`?(i.sortIndex[t[i.key]]===void 0&&(i.sortIndex[t[i.key]]=i.sortIndexCount++),i.sortIndex[e[i.key]]===void 0&&(i.sortIndex[e[i.key]]=i.sortIndexCount++),a=i.sortIndex[e[i.key]]-i.sortIndex[t[i.key]]):i.type===`linear`&&(a=e[i.key]-t[i.key]),i.sortReverse&&(a=-a),a!==0)return a}return 0}var ea={},ta={},na=34,ra=10,ia=13;function aa(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function oa(e,t){var n=aa(e);return function(r,i){return t(n(r),i,e)}}function sa(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function ca(e,t){var n=e+``,r=n.length;return r<t?Array(t-r+1).join(0)+n:n}function la(e){return e<0?`-`+ca(-e,6):e>9999?`+`+ca(e,6):ca(e,4)}function ua(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:la(e.getUTCFullYear(),4)+`-`+ca(e.getUTCMonth()+1,2)+`-`+ca(e.getUTCDate(),2)+(i?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`.`+ca(i,3)+`Z`:r?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`Z`:n||t?`T`+ca(t,2)+`:`+ca(n,2)+`Z`:``)}function da(e){var t=RegExp(`["`+e+`
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"./rolldown-runtime-C0FnF6B9.js";import{t as a}from"./react-DiVRNtpo.js";import{t as o}from"./jsx-runtime-BdxMnOeJ.js";import{d as s}from"./log-DnEvbp3E.js";import{n as c}from"./useTheme-D9sKDPEm.js";import{O as l}from"./genui-C9i6j0XZ.js";import{t as u}from"./runDetached-DfQXHAaY.js";import{t as d}from"./chart-renderer-D7ukB2wg.js";var f=n(a(),1);function p(e){let t=e.h*Math.PI/180,n=e.c*Math.cos(t),r=e.c*Math.sin(t),i=e.l+.3963377774*n+.2158037573*r,a=e.l-.1055613458*n-.0638541728*r,o=e.l-.0894841775*n-1.291485548*r,s=i**3,c=a**3,l=o**3;return[4.0767416621*s-3.3077115913*c+.2309699292*l,-1.2684380046*s+2.6097574011*c-.3413193965*l,-.0041960863*s-.7034186147*c+1.707614701*l]}var m=/^oklch\(\s*([0-9.]+)(%?)\s+([0-9.]+)\s+([0-9.]+)\s*(?:\/\s*([0-9.]+)(%?)\s*)?\)$/i;function h(e){let t=m.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=t[5]===void 0?1:Number(t[5])/(t[6]?100:1);return{l:t[2]?n/100:n,c:Number(t[3]),h:Number(t[4]),alpha:r}}function g(e){let t=Math.max(0,Math.min(1,e)),n=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.round(n*255)}function _(e,t=1){let[n,r,i]=p(e).map(g);return t>=1?`rgb(${n}, ${r}, ${i})`:`rgba(${n}, ${r}, ${i}, ${t})`}function v(e,t){let n=h(e);return n?_(n,n.alpha):e.trim()||t}function y(e){let t=(t,n)=>v(e(t,``),n),n=Array.from({length:8},(e,n)=>t(`--chart-${n+1}`,`rgb(42, 120, 214)`)),r=t(`--muted-foreground`,`rgb(115, 107, 108)`);return{series:n,compare:r,increase:n[0]??r,decrease:n[7]??r,total:r,grid:t(`--chart-grid`,`rgb(236, 232, 232)`),axis:t(`--chart-axis`,`rgb(204, 198, 198)`),text:t(`--foreground`,`rgb(30, 24, 25)`),mutedText:r,surface:t(`--card`,`rgb(255, 253, 253)`),fontFamily:e(`--kanna-font-body`,`ui-sans-serif, system-ui, sans-serif`)}}var b=.1,x=[4,3],S=11;function C(e,t){return{x:e.x,xLabel:e.xLabel,series:e.series,seriesLabel:t.get(e.series)??e.series,value:e.value,start:e.start??0,end:e.end??e.value}}function w(e,t){switch(e.role){case`compare`:return t.compare;case`increase`:return t.increase;case`decrease`:return t.decrease;case`total`:return t.total;default:return t.series[e.slot??0]??t.series[0]??t.text}}function T(e,t){return{type:`ordinal`,domain:e.series.map(e=>e.label),range:e.series.map(e=>w(e,t))}}function E(e,t){return e.series.some(e=>e.label===t&&e.role===`compare`)}var D=`seriesLabel`;function O(e,t){let n=e?.[t];return typeof n==`string`?n:``}function k(e){let t=e?.value;return typeof t==`number`?t:null}function A(e){let t=t=>l(k(t),e.format);return{mark:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]},dimension:{title:{value:e=>O(e,`xLabel`)},content:[{key:e=>O(e,`seriesLabel`),value:t}]}}}function ee(e){return e.kind!==`line`&&e.kind!==`area`}function te(e,t){let n={fill:t.mutedText,fontSize:S,fontFamily:t.fontFamily};return[{orient:`left`,type:`linear`,label:{style:n,formatMethod:t=>l(Number(t),e.format,{compact:!0})},grid:{visible:!0,style:{stroke:t.grid,lineWidth:1,lineDash:[]}},domainLine:{visible:!1},tick:{visible:!1}},{orient:`bottom`,type:`band`,sampling:!ee(e),label:{style:n,autoLimit:!0,formatMethod:t=>e.xLabels[String(t)]??String(t)},domainLine:{visible:!0,style:{stroke:t.axis,lineWidth:1}},tick:{visible:!1},grid:{visible:!1}}]}function ne(e,t){return{visible:e.series.length>=2,orient:`top`,position:`start`,item:{label:{style:{fill:t.text,fontSize:S,fontFamily:t.fontFamily}}}}}function re(e,t){let n=new Map(e.series.map(e=>[e.id,e.label]));return{data:[{id:`points`,values:e.points.map(e=>C(e,n))}],background:`transparent`,padding:{top:8,right:12,bottom:4,left:4},color:T(e,t),tooltip:A(e),legends:ne(e,t)}}function ie(e,t){switch(e.kind){case`line`:return oe(e,t);case`area`:return se(e,t);case`bar`:case`stacked-bar`:return ce(e,t);case`combo`:return le(e,t);case`waterfall`:return ue(e,t);case`composition`:return de(e,t)}}function ae(e){return{xField:{visible:!0,line:{type:`line`,style:{stroke:e.axis,lineWidth:1}}}}}function oe(e,t){return{type:`line`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`,lineDash:t=>E(e,O(t,`seriesLabel`))?x:[]}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}}function se(e,t){return{type:`area`,...re(e,t),xField:`x`,yField:`value`,seriesField:D,axes:te(e,t),crosshair:ae(t),line:{style:{lineWidth:2,lineCap:`round`,lineJoin:`round`}},area:{style:{fillOpacity:t=>E(e,O(t,`seriesLabel`))?0:b}},point:{visible:!1}}}function ce(e,t){let n=e.kind===`stacked-bar`,r=!n&&e.series.length>1;return{type:`bar`,...re(e,t),xField:r?[`x`,D]:`x`,yField:`value`,seriesField:D,stack:n,barMaxWidth:24,barGapInGroup:2,axes:te(e,t),bar:{style:{cornerRadius:n?0:[4,4,0,0],stroke:t.surface,lineWidth:n?2:0}}}}function le(e,t){let[n,r]=e.series,i=re(e,t),a=new Map(e.series.map(e=>[e.id,e.label])),o=t=>e.points.filter(e=>e.series===t).map(e=>C(e,a));return{type:`common`,background:i.background,padding:i.padding,color:i.color,tooltip:i.tooltip,legends:i.legends,data:[{id:`bars`,values:o(n?.id)},{id:`line`,values:o(r?.id)}],series:[{type:`bar`,dataIndex:0,xField:`x`,yField:`value`,seriesField:D,barMaxWidth:24,bar:{style:{cornerRadius:[4,4,0,0]}}},{type:`line`,dataIndex:1,xField:`x`,yField:`value`,seriesField:D,line:{style:{lineWidth:2}},point:{style:{size:8,stroke:t.surface,lineWidth:2}}}],axes:te(e,t).map(e=>e.orient===`left`?{...e,seriesIndex:[0,1]}:e)}}function ue(e,t){return{type:`rangeColumn`,...re(e,t),xField:`x`,minField:`start`,maxField:`end`,seriesField:D,barMaxWidth:24,axes:te(e,t),bar:{style:{cornerRadius:2}}}}function de(e,t){return{type:`pie`,...re(e,t),categoryField:D,valueField:`value`,innerRadius:.62,outerRadius:.9,pie:{style:{stroke:t.surface,lineWidth:2}}}}var fe=e=>e,pe;(function(e){e[`desktop-browser`]=`desktop-browser`,e[`mobile-browser`]=`mobile-browser`,e.node=`node`,e.worker=`worker`,e.miniApp=`miniApp`,e.wx=`wx`,e.tt=`tt`,e.harmony=`harmony`,e[`desktop-miniApp`]=`desktop-miniApp`,e.lynx=`lynx`})(pe||={});var j;(function(e){e.cartesianAxis=`cartesianAxis`,e.cartesianBandAxis=`cartesianAxis-band`,e.cartesianLinearAxis=`cartesianAxis-linear`,e.cartesianTimeAxis=`cartesianAxis-time`,e.cartesianLogAxis=`cartesianAxis-log`,e.cartesianSymlogAxis=`cartesianAxis-symlog`,e.polarAxis=`polarAxis`,e.polarBandAxis=`polarAxis-band`,e.polarLinearAxis=`polarAxis-linear`,e.crosshair=`crosshair`,e.cartesianCrosshair=`cartesianCrosshair`,e.polarCrosshair=`polarCrosshair`,e.dataZoom=`dataZoom`,e.geoCoordinate=`geoCoordinate`,e.indicator=`indicator`,e.discreteLegend=`discreteLegend`,e.continuousLegend=`continuousLegend`,e.colorLegend=`colorLegend`,e.sizeLegend=`sizeLegend`,e.markLine=`markLine`,e.markArea=`markArea`,e.markPoint=`markPoint`,e.polarMarkLine=`polarMarkLine`,e.polarMarkArea=`polarMarkArea`,e.polarMarkPoint=`polarMarkPoint`,e.geoMarkPoint=`geoMarkPoint`,e.tooltip=`tooltip`,e.title=`title`,e.player=`player`,e.scrollBar=`scrollBar`,e.label=`label`,e.totalLabel=`totalLabel`,e.brush=`brush`,e.poptip=`poptip`,e.customMark=`customMark`})(j||={});var me=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),he,ge=t((()=>{he=(e,t)=>Object.prototype.toString.call(e)===`[object ${t}]`})),_e,ve=t((()=>{ge(),_e=(e,t=!1)=>t?typeof e==`boolean`:!0===e||!1===e||he(e,`Boolean`)})),M,ye=t((()=>{M=e=>typeof e==`function`})),N,be=t((()=>{N=e=>e==null})),P,xe=t((()=>{P=e=>e!=null})),F,Se=t((()=>{F=e=>{let t=typeof e;return e!==null&&t===`object`||t===`function`}})),Ce,we=t((()=>{Ce=e=>typeof e==`object`&&!!e})),Te,Ee=t((()=>{we(),ge(),Te=function(e){if(!Ce(e)||!he(e,`Object`))return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}})),De,Oe=t((()=>{De=e=>e===void 0})),ke,Ae=t((()=>{ge(),ke=(e,t=!1)=>{let n=typeof e;return t?n===`string`:n===`string`||he(e,`String`)}})),I,je=t((()=>{ge(),I=e=>Array.isArray?Array.isArray(e):he(e,`Array`)})),Me,Ne=t((()=>{Me=function(e){return e!==null&&typeof e!=`function`&&Number.isFinite(e.length)}})),Pe,Fe=t((()=>{ge(),Pe=e=>he(e,`Date`)})),L,Ie=t((()=>{ge(),L=(e,t=!1)=>{let n=typeof e;return t?n===`number`:n===`number`||he(e,`Number`)}})),R,Le=t((()=>{Ie(),R=e=>L(e)&&Number.isFinite(e)})),Re,ze=t((()=>{Re=e=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(e)})),Be,Ve=t((()=>{Be=e=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(e)})),He,Ue=t((()=>{He=e=>({}).toString.call(e).replace(/^\[object /,``).replace(/]$/,``)})),We,Ge,Ke=t((()=>{We=Object.prototype,Ge=function(e){let t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||We)}}));function z(e){if(N(e))return!0;if(Me(e))return!e.length;let t=He(e);if(t===`Map`||t===`Set`)return!e.size;if(Ge(e))return!Object.keys(e).length;for(let t in e)if(qe.call(e,t))return!1;return!0}var qe,Je=t((()=>{be(),Ne(),Ue(),Ke(),qe=Object.prototype.hasOwnProperty})),Ye,Xe=t((()=>{Ae(),Ye=(e,t,n)=>{let r=ke(t)?t.split(`.`):t;for(let t=0;t<r.length;t++)e=e?e[r[t]]:void 0;return e===void 0?n:e}})),Ze,Qe,$e=t((()=>{Ze=Object.prototype.hasOwnProperty,Qe=(e,t)=>e!=null&&Ze.call(e,t)}));function et(e,t,n){let r;if(!P(e)||typeof e!=`object`||t&&t(e))return e;let i=I(e),a=e.length;r=i?Array(a):typeof e==`object`?{}:_e(e)||L(e)||ke(e)?e:Pe(e)?new Date(+e):void 0;let o=i?void 0:Object.keys(Object(e)),s=-1;if(r)for(;++s<(o||e).length;){let i=o?o[s]:s,a=e[i];n&&n.includes(i.toString())?r[i]=a:r[i]=et(a,t,n)}return r}var tt=t((()=>{je(),ve(),Fe(),Ie(),Ae(),xe()}));function nt(e,t,n=!1,r=!1){if(t){if(e===t)return;if(P(t)&&typeof t==`object`){let i=Object(t),a=[];for(let e in i)a.push(e);let{length:o}=a,s=-1;for(;o--;){let o=a[++s];!P(i[o])||typeof i[o]!=`object`||r&&I(e[o])?it(e,o,i[o]):rt(e,t,o,n,r)}}}}function rt(e,t,n,r=!1,i=!1){let a=e[n],o=t[n],s=t[n],c=!0;if(I(o)){if(r)s=[];else if(I(a))s=a;else if(Me(a)){s=Array(a.length);let e=-1,t=a.length;for(;++e<t;)s[e]=a[e]}}else Te(o)?(s=a??{},typeof a!=`function`&&typeof a==`object`||(s={})):c=!1;c&&nt(s,o,r,i),it(e,n,s)}function it(e,t,n){(n!==void 0&&!at(e[t],n)||n===void 0&&!(t in e))&&(e[t]=n)}function at(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ot(e,...t){let n=-1,r=t.length;for(;++n<r;)nt(e,t[n],!0);return e}var st=t((()=>{je(),Ne(),Ee(),xe()}));function ct(e,t){if(!e||!Te(e))return e;let n={};return Object.keys(e).forEach((r=>{let i=e[r],a=!1;t.forEach((e=>{(ke(e)&&e===r||e instanceof RegExp&&r.match(e))&&(a=!0)})),a||(n[r]=i)})),n}var lt=t((()=>{Ee(),Ae()}));function ut(e){return Object.prototype.toString.call(e)}function dt(e){return Object.keys(e)}function ft(e,t,n){if(e===t)return!0;if(typeof e!=typeof t||e==null||t==null)return!1;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(ut(e)!==ut(t))return!1;if(M(e))return!!n?.skipFunction;if(typeof e!=`object`)return!1;if(I(e)){if(e.length!==t.length)return!1;for(let r=e.length-1;r>=0;r--)if(!ft(e[r],t[r],n))return!1;return!0}if(!Te(e))return!1;let r=dt(e),i=dt(t);if(r.length!==i.length)return!1;r.sort(),i.sort();for(let e=r.length-1;e>=0;e--)if(r[e]!=i[e])return!1;for(let i=r.length-1;i>=0;i--){let a=r[i];if(!ft(e[a],t[a],n))return!1}return!0}var pt=t((()=>{je(),ye(),Ee()}));function mt(e){if(!e)return[];if(Object.keys)return Object.keys(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(n);return t}function ht(e,t,n){let r=mt(t);for(let i=0;i<r.length;i++){let a=r[i];(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}return e}function gt(e,t,n=!0){if(e=`prototype`in e?e.prototype:e,t=`prototype`in t?t.prototype:t,Object.getOwnPropertyNames){let r=Object.getOwnPropertyNames(t);for(let i=0;i<r.length;i++){let a=r[i];a!==`constructor`&&(n?t[a]!=null:e[a]==null)&&(e[a]=t[a])}}else ht(e,t,n)}var _t=t((()=>{}));function B(e){return P(e)?I(e)?e:[e]:[]}function vt(e){if(Me(e))return e[e.length-1]}function yt(e,t){if(!I(e)||!I(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bt(e){if(!I(e))return[e];let t=[];for(let n of e)t.push(...bt(n));return t}var xt,St,Ct=t((()=>{je(),Ne(),xe(),xt=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)>0&&(n=i)}return n},St=(e,t)=>{if(e.length===0)return;let n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(t?.(i,n)??i-n)<0&&(n=i)}return n}}));function wt(e,t,n){P(t)||(t=e,e=0),P(n)||(n=1);let r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),a=Array(i);for(;++r<i;)a[r]=e+r*n;return a}var Tt=t((()=>{xe()}));function Et(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Dt=t((()=>{}));function Ot(e){return Number(e)}var kt=t((()=>{})),At=t((()=>{}));function jt(e,t,n){let r=[t].concat([].slice.call(n));Mt&&console[e].apply(console,r)}var Mt,Nt,Pt,Ft=t((()=>{Ie(),Mt=typeof console<`u`,(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Info=3]=`Info`,e[e.Debug=4]=`Debug`})(Nt||={}),Pt=class e{static getInstance(t,n){return e._instance&&L(t)?e._instance.level(t):e._instance||=new e(t,n),e._instance}static setInstance(t){return e._instance=t}static setInstanceLevel(t){e._instance?e._instance.level(t):e._instance=new e(t)}static clearInstance(){e._instance=null}constructor(e=Nt.None,t){this._onErrorHandler=[],this._level=e,this._method=t}addErrorHandler(e){this._onErrorHandler.find((t=>t===e))||this._onErrorHandler.push(e)}removeErrorHandler(e){let t=this._onErrorHandler.findIndex((t=>t===e));t<0||this._onErrorHandler.splice(t,1)}callErrorHandler(...e){this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Nt.Info}canLogDebug(){return this._level>=Nt.Debug}canLogError(){return this._level>=Nt.Error}canLogWarn(){return this._level>=Nt.Warn}level(e){return arguments.length?(this._level=+e,this):this._level}error(...e){return this._level>=Nt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...e):jt(this._method??`error`,`ERROR`,e)),this}warn(...e){return this._level>=Nt.Warn&&jt(this._method||`warn`,`WARN`,e),this}info(...e){return this._level>=Nt.Info&&jt(this._method||`log`,`INFO`,e),this}debug(...e){return this._level>=Nt.Debug&&jt(this._method||`log`,`DEBUG`,e),this}},Pt._instance=null}));function It(e,t,n=0,r){for(N(r)&&(r=e.length);n<r;){let i=n+r>>>1;Et(e[i],t)>0?r=i:n=i+1}return n}var Lt,Rt=t((()=>{Dt(),be(),Lt=(e,t,n)=>{let r=e,i=t;for(;r<i;){let e=Math.floor((r+i)/2);n(e)>=0?i=e:r=e+1}return r}}));function zt(e,t,n=Ut,r=Ht){let i=r,a=n*Math.max(e,t);return Math.abs(e-t)<=Math.max(i,a)}function Bt(e,t,n,r){return e>t&&!zt(e,t,n,r)}function Vt(e,t,n,r){return e<t&&!zt(e,t,n,r)}var Ht,Ut,Wt=t((()=>{Ht=1e-10,Ut=1e-10})),Gt,Kt=t((()=>{Gt=e=>{let t=null,n=null;return(...r)=>(t&&r.every(((e,n)=>e===t[n]))||(t=r,n=e(...r)),n)}})),qt,Jt=t((()=>{qt=function(e,t,n){return e<t?t:e>n?n:e}})),Yt,Xt=t((()=>{Yt=(e,t,n)=>{let[r,i]=e;i<r&&(r=e[1],i=e[0]);let a=i-r;return a>=n-t?[t,n]:(r=Math.min(Math.max(r,t),n-a),[r,r+a])}}));function Zt(e,t){let n;return e>t&&(n=e,e=t,t=n),n=>Math.max(e,Math.min(t,n))}var Qt=t((()=>{}));function $t(e,t,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&en;if(typeof e!=`function`)throw TypeError(`Expected a function`);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(cancelAnimationFrame(s),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){let n=e-c;return c===void 0||n>=t||n<0||d&&e-l>=a}function _(){let e=Date.now();if(g(e))return v(e);s=h(_,function(e){let n=e-l,r=t-(e-c);return d?Math.min(r,a-n):r}(e))}function v(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function y(...e){let n=Date.now(),a=g(n);if(r=e,i=this,c=n,a){if(s===void 0)return function(e){return l=e,s=h(_,t),u?m(e):o}(c);if(d)return s=h(_,t),m(c)}return s===void 0&&(s=h(_,t)),o}return t=+t||0,F(n)&&(u=!!n.leading,d=`maxWait`in n,d&&(a=Math.max(R(n.maxWait)?n.maxWait:0,t)),f=`trailing`in n?!!n.trailing:f),y.cancel=function(){s!==void 0&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(s),l=0,r=c=i=s=void 0},y.flush=function(){return s===void 0?o:v(Date.now())},y.pending=function(){return s!==void 0},y}var en,tn=t((()=>{Se(),Le(),en=!1;try{en=typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`}catch{en=!1}en=!1}));function nn(e,t,n){let r=!0,i=!0;if(typeof e!=`function`)throw TypeError(`Expected a function`);return F(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),$t(e,t,{leading:r,trailing:i,maxWait:t})}var rn=t((()=>{tn(),Se()}));function an(e,t){return n=>e*(1-n)+t*n}function on(e,t){return function(n){return Math.round(e*(1-n)+t*n)}}function sn(e,t){let n=e.valueOf(),r=t.valueOf(),i=new Date;return e=>(i.setTime(n*(1-e)+r*e),i)}var cn,ln=t((()=>{cn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,new RegExp(cn.source,`g`)})),un=t((()=>{})),dn=t((()=>{})),fn=t((()=>{})),pn=t((()=>{})),mn=t((()=>{})),hn=t((()=>{})),gn=t((()=>{})),_n=t((()=>{})),vn=t((()=>{})),yn=t((()=>{})),bn=t((()=>{})),xn=t((()=>{ve(),ye(),be(),xe(),Se(),we(),Ee(),ge(),Oe(),Ae(),je(),Ne(),Fe(),Ie(),Le(),ze(),Ve(),Je(),Xe(),$e(),tt(),st(),lt(),pt(),_t(),Ct(),Tt(),At(),Rt(),At(),Wt(),Kt(),Jt(),Xt(),Qt(),tn(),rn(),ln(),kt(),un(),dn(),fn(),pn(),mn(),hn(),gn(),_n(),vn(),yn(),bn()})),Sn=t((()=>{}));function Cn(e){return e>1?0:e<-1?jn:Math.acos(e)}function wn(e){return e>=1?Mn:e<=-1?-Mn:Math.asin(e)}function Tn(e,t,n,r,i){let a=n,o=r;return typeof e==`number`&&typeof n==`number`&&(a=(1-i)*e+i*n),typeof t==`number`&&typeof r==`number`&&(o=(1-i)*t+i*r),{x:a,y:o}}function En(e,t){return e[0]*t[1]-e[1]*t[0]}function Dn(e,t){return Pn(e[0]-t[0])+Pn(e[1]-t[1])<1e-12}function On(e,t=10){return Math.round(e*t)/t}function kn(e){let t=e.toString().split(/[eE]/),n=(t[0].split(`.`)[1]||``).length-(+t[1]||0);return n>0?n:0}function An(e,t){return On(e-t,10**Math.max(kn(e),kn(t)))}var jn,Mn,Nn,V,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn=t((()=>{jn=Math.PI,Mn=jn/2,Nn=2*jn,V=2*Math.PI,Pn=Math.abs,Fn=Math.atan2,In=Math.cos,Ln=Math.max,Rn=Math.min,zn=Math.sin,Bn=Math.sqrt,Vn=Math.pow})),Un,Wn,Gn=t((()=>{Ie(),Hn(),Un=class e{constructor(e=0,t=0,n,r){this.x=0,this.y=0,this.x=e,this.y=t,this.x1=n,this.y1=r}clone(){return new e(this.x,this.y)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x1=e.x1,this.y1=e.y1,this.defined=e.defined,this.context=e.context,this}set(e,t){return this.x=e,this.y=t,this}add(e){return L(e)?(this.x+=e,void(this.y+=e)):(this.x+=e.x,this.y+=e.y,this)}sub(e){return L(e)?(this.x-=e,void(this.y-=e)):(this.x-=e.x,this.y-=e.y,this)}multi(e){throw Error(`暂不支持`)}div(e){throw Error(`暂不支持`)}},Wn=class{static distancePP(e,t){return Bn(Vn(e.x-t.x,2)+Vn(e.y-t.y,2))}static distanceNN(e,t,n,r){return Bn(Vn(e-n,2)+Vn(t-r,2))}static distancePN(e,t,n){return Bn(Vn(t-e.x,2)+Vn(n-e.y,2))}static pointAtPP(e,t,n){return new Un((t.x-e.x)*n+e.x,(t.y-e.y)*n+e.y)}}})),Kn=t((()=>{}));function qn(e){return Math.PI/180*e}function Jn(e){return 180*e/Math.PI}function Yn(e,t,n){return t?{x:e.x+t*Math.cos(n),y:e.y+t*Math.sin(n)}:{x:e.x,y:e.y}}function Xn(e){for(;e<0;)e+=2*Math.PI;for(;e>=2*Math.PI;)e-=2*Math.PI;return e}function Zn(e,t){let n=Math.abs(t-e);if(n>=2*Math.PI||2*Math.PI-n<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];let r=Xn(Math.min(e,t)),i=r+n,a=[r,i],o=Math.floor(r/Math.PI)*Math.PI/2;for(;o<i;)o>r&&a.push(o),o+=Math.PI/2;return a}function Qn(e,t,n,r){let{x:i,y:a}=t,o=Zn(n,r),{width:s,height:c}=e,l=[];return o.forEach((e=>{let t=Math.sin(e),n=Math.cos(e);t===1?l.push(c-a):t===-1?l.push(a):n===1?l.push(s-i):n===-1?l.push(i):(t>0?l.push(Math.abs((c-a)/t)):l.push(Math.abs(a/t)),n>0?l.push(Math.abs((s-i)/n)):l.push(Math.abs(i/n)))})),Math.min.apply(null,l)}function $n(e){return(e=Xn(e))>0&&e<=Math.PI/2?2:e>Math.PI/2&&e<=Math.PI?3:e>Math.PI&&e<=3*Math.PI/2?4:1}var er,tr,nr=t((()=>{Hn(),er=(e=0)=>{if(e<0)for(;e<-Nn;)e+=Nn;else if(e>0)for(;e>Nn;)e-=Nn;return e},tr=er}));function rr(e,t,n){e[0]=t[0]-n[0],e[1]=t[1]-n[1]}function ir(e,t,n,r){let i=e[0],a=t[0],o=n[0],s=r[0];return a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i)&&(i=e[1],a=t[1],o=n[1],s=r[1],a<i&&([i,a]=[a,i]),s<o&&([s,o]=[o,s]),!(a<o||s<i))}function ar(e,t,n,r){if(!ir(e,t,n,r))return!1;let i=[0,0],a=[0,0],o=[0,0];if(rr(i,t,e),rr(a,r,n),Dn(i,a))return!0;rr(o,n,e);let s=En(o,a)/En(i,a);return s>=0&&s<=1&&[e[0]+i[0]*s,e[1]+i[1]*s]}function or(e,t,n){if(e===null)return t;if(t===null)return e;let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,n);return r>=c||i<=s||a>=u||o<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,s),y1:Math.max(a,l),x2:Math.min(i,c),y2:Math.min(o,u)}}function sr(e,t,n){if(e&&t){if(!n)return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1);let{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}=hr(e,t,!0);return!(r>c||i<s||a>u||o<l)}return!0}function cr(e,t,n){if(!t)return!0;if(!n)return e.x>=t.x1&&e.x<=t.x2&&e.y>=t.y1&&e.y<=t.y2;let r=t.x1,i=t.x2,a=t.y1,o=t.y2;return r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),e.x>=r&&e.x<=i&&e.y>=a&&e.y<=o}function lr(e,t){return Math.abs(t[0]*e[0]+t[1]*e[1])}function ur({x:e,y:t},n,r={x:0,y:0}){return{x:(e-r.x)*Math.cos(n)-(t-r.y)*Math.sin(n)+r.x,y:(e-r.x)*Math.sin(n)+(t-r.y)*Math.cos(n)+r.y}}function dr(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function fr(e,t){let n=t?qn(e.angle):e.angle,r=dr(e);return[ur({x:e.x1,y:e.y1},n,r),ur({x:e.x2,y:e.y1},n,r),ur({x:e.x2,y:e.y2},n,r),ur({x:e.x1,y:e.y2},n,r)]}function pr(e,t,n=!1){let r=fr(e,n),i=fr(t,n),a=(e,t)=>[t.x-e.x,t.y-e.y],o=a(dr(e),dr(t)),s=a(r[0],r[1]),c=a(r[1],r[2]),l=a(i[0],i[1]),u=a(i[1],i[2]),d=n?qn(e.angle):e.angle,f=n?qn(90-e.angle):e.angle+Mn,p=n?qn(t.angle):t.angle,m=n?qn(90-t.angle):t.angle+Mn;f>V&&(f-=V),m>V&&(m-=V);let h=(e,t,n,r)=>{let i=[Math.cos(t),Math.sin(t)];return e+(lr(i,n)+lr(i,r))/2>lr(i,o)};return h((e.x2-e.x1)/2,d,l,u)&&h((e.y2-e.y1)/2,f,l,u)&&h((t.x2-t.x1)/2,p,s,c)&&h((t.y2-t.y1)/2,m,s,c)}var mr,hr,gr=t((()=>{nr(),Hn(),(function(e){e[e.NONE=0]=`NONE`,e[e.BBOX1=1]=`BBOX1`,e[e.BBOX2=2]=`BBOX2`})(mr||={}),hr=(e,t,n)=>{let r=e.x1,i=e.x2,a=e.y1,o=e.y2,s=t.x1,c=t.x2,l=t.y1,u=t.y2;return n&&(r>i&&([r,i]=[i,r]),a>o&&([a,o]=[o,a]),s>c&&([s,c]=[c,s]),l>u&&([l,u]=[u,l])),{x11:r,x12:i,y11:a,y12:o,x21:s,x22:c,y21:l,y22:u}}})),_r=t((()=>{})),vr=t((()=>{})),yr=t((()=>{gr(),_r(),vr()})),br=t((()=>{}));function xr(e,t,n,r,i,a){if(a>t&&a>r||a<t&&a<r||r===t)return 0;let o=(a-t)/(r-t),s=r<t?1:-1;o!==1&&o!==0||(s=r<t?.5:-.5);let c=o*(n-e)+e;return c===i?1/0:c>i?s:0}var Sr=t((()=>{})),Cr=t((()=>{})),wr,Tr=t((()=>{wr=e=>{let t=e.charCodeAt(0),n=e.length===2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r===12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r===8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r===172||r===175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r===161||r===164||167<=r&&r<=168||r===170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r===198||r===208||215<=r&&r<=216||222<=r&&r<=225||r===230||232<=r&&r<=234||236<=r&&r<=237||r===240||242<=r&&r<=243||247<=r&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||294<=r&&r<=295||r===299||305<=r&&r<=307||r===312||319<=r&&r<=322||r===324||328<=r&&r<=331||r===333||338<=r&&r<=339||358<=r&&r<=359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||713<=r&&r<=715||r===717||r===720||728<=r&&r<=731||r===733||r===735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r===1025||1040<=r&&r<=1103||r===1105||r===8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r===8240||8242<=r&&r<=8243||r===8245||r===8251||r===8254||r===8308||r===8319||8321<=r&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||8481<=r&&r<=8482||r===8486||r===8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r===8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r===8658||r===8660||r===8679||r===8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r===8715||r===8719||r===8721||r===8725||r===8730||8733<=r&&r<=8736||r===8739||r===8741||8743<=r&&r<=8748||r===8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r===8776||r===8780||r===8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r===8853||r===8857||r===8869||r===8895||r===8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r===9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r===9711||9733<=r&&r<=9734||r===9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r===9756||r===9758||r===9792||r===9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r===9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r===9955||9960<=r&&r<=9983||r===10045||r===10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r===65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`}}));function Er(e,t={},n){n||=1;let{fontStyle:r=t.fontStyle,fontVariant:i=t.fontVariant,fontWeight:a=t.fontWeight,fontSize:o=t.fontSize,fontFamily:s=t.fontFamily}=e;return(r?r+` `:``)+(i?i+` `:``)+(a?a+` `:``)+o*n+`px `+(s||`sans-serif`)}var Dr=t((()=>{})),Or,kr=t((()=>{xn(),Tr(),Dr(),Or=class e{constructor(e,t){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet=`-/: .,@%'"~`,this._option=e,this._userSpec=t??{},this.textSpec=this._initSpec(),P(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=P(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(N(this._canvas)&&(P(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),N(this._canvas)&&typeof window<`u`&&window.document!==void 0&&globalThis&&P(globalThis.document)&&(this._canvas=globalThis.document.createElement(`canvas`))),N(this._context)&&P(this._canvas)){let e=this._canvas.getContext(`2d`);P(e)&&(e.save(),e.font=Er(this.textSpec),this._contextSaved=!0,this._context=e)}return!N(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){let{defaultFontParams:e={}}=this._option,{fontStyle:t=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight??`normal`,fontSize:i=e.fontSize??12,fontFamily:a=e.fontFamily??`sans-serif`,align:o,textAlign:s=o??`center`,baseline:c,textBaseline:l=c??`middle`,ellipsis:u,limit:d}=this._userSpec,{lineHeight:f=i}=this._userSpec;return ke(f)&&f[f.length-1]===`%`&&(f=i*(Number.parseFloat(f.substring(0,f.length-1))/100)),{fontStyle:t,fontVariant:n,fontFamily:a,fontSize:i,fontWeight:r,textAlign:s,textBaseline:l,ellipsis:u,limit:d,lineHeight:f}}measure(e,t){switch(t){case`vrender`:case`canopus`:return this.fullMeasure(e);case`canvas`:return this.measureWithNaiveCanvas(e);case`simple`:return this.quickMeasureWithoutCanvas(e);default:return this.quickMeasure(e)}}fullMeasure(e){if(N(e))return{width:0,height:0};if(N(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(e);let{fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:o,limit:s,lineHeight:c}=this.textSpec,l;try{let u=this._option.getTextBounds({text:e,fontFamily:t,fontSize:n,fontWeight:r,textAlign:i,textBaseline:a,ellipsis:!!o,maxLineWidth:s||1/0,lineHeight:c});l={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(e)}return l}measureWithNaiveCanvas(e){return this._measureReduce(e,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(e){if(!this.initContext())return this._quickMeasureWithoutCanvas(e);let t=this._context.measureText(e),{fontSize:n,lineHeight:r}=this.textSpec;return{width:t.width,height:r??n,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}quickMeasure(e){return this._measureReduce(e,this._quickMeasure.bind(this))}_quickMeasure(t){let n={width:0,height:0};for(let r=0;r<t.length;r++){let i=t[r],a=this._measureSpecialChar(i);N(a)&&e.NUMBERS_CHAR_SET.includes(i)&&(a=this._measureNumberChar()),N(a)&&[`F`,`W`].includes(wr(i))&&(a=this._measureFullSizeChar()),N(a)&&(a=this._measureLetterChar()),n.width+=a.width,n.height=Math.max(n.height,a.height),!N(a.fontBoundingBoxAscent)&&(n.fontBoundingBoxAscent=a.fontBoundingBoxAscent),!N(a.fontBoundingBoxDescent)&&(n.fontBoundingBoxDescent=a.fontBoundingBoxDescent)}return n}quickMeasureWithoutCanvas(e){return this._measureReduce(e,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(e){let t={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let r=0;r<e.length;r++){let i=e[r],a=[`F`,`W`].includes(wr(i))?1:.53;t.width+=a*n}return t.height=r??n,t}_measureReduce(e,t){let{fontSize:n,lineHeight:r}=this.textSpec,i={width:0,height:0};if(N(e))return i;if(I(e)){let a=e.filter(P).map((e=>e.toString()));return a.length===0?i:a.length===1?t(a[0]):{width:a.reduce(((e,n)=>Math.max(e,t(n).width)),0),height:a.length*((r??n)+1)+1}}return t(e.toString())}_measureNumberChar(){if(N(this._numberCharSize)){let t=this._standardMethod(e.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/e.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return N(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(e.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(N(this._letterCharSize)){let t=this._standardMethod(e.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/e.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(e){return P(this._specialCharSizeMap[e])?this._specialCharSizeMap[e]:this.specialCharSet.includes(e)?(this._specialCharSizeMap[e]=this._standardMethod(e),this._specialCharSizeMap[e]):null}release(){P(this._canvas)&&(this._canvas=null),P(this._context)&&(this._contextSaved&&=(this._context.restore(),!1),this._context=null)}},Or.ALPHABET_CHAR_SET=`abcdefghijklmnopqrstuvwxyz`,Or.NUMBERS_CHAR_SET=`0123456789`,Or.FULL_SIZE_CHAR=`字`})),Ar=t((()=>{})),jr=t((()=>{kr(),Ar(),Dr()})),Mr=t((()=>{Tr(),jr()})),Nr,Pr,Fr,Ir=t((()=>{Nr=(e,t)=>{let{x1:n,x2:r,y1:i,y2:a}=e,o=Math.abs(r-n),s=Math.abs(a-i),c=(n+r)/2,l=(i+a)/2,u=0,d=0;switch(t){case`top`:case`inside-top`:d=-.5;break;case`bottom`:case`inside-bottom`:d=.5;break;case`left`:case`inside-left`:u=-.5;break;case`right`:case`inside-right`:u=.5;break;case`top-right`:u=.5,d=-.5;break;case`top-left`:u=-.5,d=-.5;break;case`bottom-right`:u=.5,d=.5;break;case`bottom-left`:u=-.5,d=.5}return c+=u*o,l+=d*s,{x:c,y:l}},Pr=(e,t)=>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Fr=(e,t)=>{let n=[{x:Math.cos(e.angle),y:Math.sin(e.angle)},{x:-Math.sin(e.angle),y:Math.cos(e.angle)},{x:Math.cos(t.angle),y:Math.sin(e.angle)},{x:-Math.sin(t.angle),y:Math.cos(e.angle)}];function r(e,t,n){let r=e.getRotatedCorners().map((e=>e.x*t+e.y*n));return{min:Math.min(...r),max:Math.max(...r)}}let i=0;for(let a of n){let n=r(e,a.x,a.y),o=r(t,a.x,a.y),s;s=n.max<o.min?o.min-n.max:o.max<n.min?n.min-o.max:0,i=Math.max(i,s)}return i}})),Lr=t((()=>{Kn(),yr(),br(),Sr(),Cr(),Mr(),Ir()}));function Rr(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=t;return n.onlyTranslate()?(e!==t&&e.setValue(t.x1,t.y1,t.x2,t.y2),e.translate(n.e,n.f),t):(e.clear(),e.add(n.a*r+n.c*i+n.e,n.b*r+n.d*i+n.f),e.add(n.a*a+n.c*i+n.e,n.b*a+n.d*i+n.f),e.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),e.add(n.a*r+n.c*o+n.e,n.b*r+n.d*o+n.f),t)}var zr,Br,Vr,Hr=t((()=>{xn(),Lr(),zr=class e{constructor(e){e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}clone(){return new e(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2}setValue(e=0,t=0,n=0,r=0){return this.x1=e,this.y1=t,this.x2=n,this.y2=r,this}set(e=0,t=0,n=0,r=0){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),r<t?(this.y2=t,this.y1=r):(this.y1=t,this.y2=r),this}add(e=0,t=0){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this}expand(e=0){return I(e)?(this.y1-=e[0],this.x2+=e[1],this.y2+=e[2],this.x1-=e[3]):(this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(e=0,t=0){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}rotate(e=0,t=0,n=0){let r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])}scale(e=0,t=0,n=0,r=0){let i=this.scalePoints(e,t,n,r);return this.clear().add(i[0],i[1]).add(i[2],i[3])}union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this}intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this}encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2}alignsWith(e){return e&&(this.x1===e.x1||this.x2===e.x2||this.y1===e.y1||this.y2===e.y2)}intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)}contains(e=0,t=0){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)}containsPoint(e){return!(e.x<this.x1||e.x>this.x2||e.y<this.y1||e.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(e=0){return this.x1*=e,this.x2*=e,this}scaleY(e=0){return this.y1*=e,this.y2*=e,this}transformWithMatrix(e){return Rr(this,this,e),this}copy(e){return this.x1=e.x1,this.y1=e.y1,this.x2=e.x2,this.y2=e.y2,this}rotatedPoints(e,t,n){let{x1:r,y1:i,x2:a,y2:o}=this,s=Math.cos(e),c=Math.sin(e),l=t-t*s+n*c,u=n-t*c-n*s;return[s*r-c*i+l,c*r+s*i+u,s*r-c*o+l,c*r+s*o+u,s*a-c*i+l,c*a+s*i+u,s*a-c*o+l,c*a+s*o+u]}scalePoints(e,t,n,r){let{x1:i,y1:a,x2:o,y2:s}=this;return[e*i+(1-e)*n,t*a+(1-t)*r,e*o+(1-e)*n,t*s+(1-t)*r]}},Br=class extends zr{},Vr=class e extends zr{constructor(e,t=0){super(e),e&&(this.angle=e.angle??t)}intersects(e){return pr(this,e)}setValue(e=0,t=0,n=0,r=0,i=0){return super.setValue(e,t,n,r),this.angle=i,this}clone(){return new e(this)}getRotatedCorners(){let e={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[ur({x:this.x1,y:this.y1},this.angle,e),ur({x:this.x2,y:this.y1},this.angle,e),ur({x:this.x1,y:this.y2},this.angle,e),ur({x:this.x2,y:this.y2},this.angle,e)]}}}));function Ur(e,t,n,r,i,a,o,s){let c=t.a,l=t.b,u=t.c,d=t.d,f=t.e,p=t.f,m=In(o),h=zn(o),g,_;s?(g=s[0],_=s[1]):(g=n,_=r);let v=g-n,y=_-r,b=c*m+u*h,x=l*m+d*h,S=u*m-c*h,C=d*m-l*h;e.a=i*b,e.b=i*x,e.c=a*S,e.d=a*C,e.e=f+c*g+u*_-b*v-S*y,e.f=p+l*g+d*_-x*v-C*y}var Wr,Gr=t((()=>{nr(),Hn(),Wr=class e{constructor(e=1,t=0,n=0,r=1,i=0,a=0){this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}equalToMatrix(e){return this.e===e.e&&this.f===e.f&&this.a===e.a&&this.d===e.d&&this.b===e.b&&this.c===e.c}equalTo(e,t,n,r,i,a){return this.e===i&&this.f===a&&this.a===e&&this.d===r&&this.b===t&&this.c===n}setValue(e,t,n,r,i,a){return this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){let t=this.a,n=this.b,r=this.c,i=this.d,a=this.e,o=this.f,s=new e,c=t*i-n*r;return s.a=i/c,s.b=-n/c,s.c=-r/c,s.d=t/c,s.e=(r*o-i*a)/c,s.f=-(t*o-n*a)/c,s}rotate(e){let t=Math.cos(e),n=Math.sin(e),r=this.a*t+this.c*n,i=this.b*t+this.d*n,a=this.a*-n+this.c*t,o=this.b*-n+this.d*t;return this.a=r,this.b=i,this.c=a,this.d=o,this}rotateByCenter(e,t,n){let r=Math.cos(e),i=Math.sin(e),a=(1-r)*t+i*n,o=(1-r)*n-i*t,s=r*this.a-i*this.b,c=i*this.a+r*this.b,l=r*this.c-i*this.d,u=i*this.c+r*this.d,d=r*this.e-i*this.f+a,f=i*this.e+r*this.f+o;return this.a=s,this.b=c,this.c=l,this.d=u,this.e=d,this.f=f,this}scale(e,t){return this.a*=e,this.b*=e,this.c*=t,this.d*=t,this}setScale(e,t){return this.b=this.b/this.a*e,this.c=this.c/this.d*t,this.a=e,this.d=t,this}transform(e,t,n,r,i,a){return this.multiply(e,t,n,r,i,a),this}translate(e,t){return this.e+=this.a*e+this.c*t,this.f+=this.b*e+this.d*t,this}transpose(){let{a:e,b:t,c:n,d:r,e:i,f:a}=this;return this.a=t,this.b=e,this.c=r,this.d=n,this.e=a,this.f=i,this}multiply(e,t,n,r,i,a){let o=this.a,s=this.b,c=this.c,l=this.d,u=o*e+c*t,d=s*e+l*t,f=o*n+c*r,p=s*n+l*r,m=o*i+c*a+this.e,h=s*i+l*a+this.f;return this.a=u,this.b=d,this.c=f,this.d=p,this.e=m,this.f=h,this}interpolate(t,n){let r=new e;return r.a=this.a+(t.a-this.a)*n,r.b=this.b+(t.b-this.b)*n,r.c=this.c+(t.c-this.c)*n,r.d=this.d+(t.d-this.d)*n,r.e=this.e+(t.e-this.e)*n,r.f=this.f+(t.f-this.f)*n,r}transformPoint(e,t){let{a:n,b:r,c:i,d:a,e:o,f:s}=this,c=n*a-r*i,l=a/c,u=-r/c,d=-i/c,f=n/c,p=(i*s-a*o)/c,m=-(n*s-r*o)/c,{x:h,y:g}=e;t.x=h*l+g*d+p,t.y=h*u+g*f+m}onlyTranslate(e=1){return this.a===e&&this.b===0&&this.c===0&&this.d===e}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){let e=this.a,t=this.b,n=this.c,r=this.d,i=e*r-t*n,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!==0||t!==0){let o=Math.sqrt(e*e+t*t);a.rotateDeg=t>0?Math.acos(e/o):-Math.acos(e/o),a.scaleX=o,a.scaleY=i/o,a.skewX=(e*n+t*r)/i,a.skewY=0}else if(n!==0||r!==0){let o=Math.sqrt(n*n+r*r);a.rotateDeg=Math.PI/2-(r>0?Math.acos(-n/o):-Math.acos(n/o)),a.scaleX=i/o,a.scaleY=o,a.skewX=0,a.skewY=(e*n+t*r)/i}return a.rotateDeg=Jn(a.rotateDeg),a}}})),Kr=t((()=>{Sn(),Gn(),Hr(),Gr()})),qr,Jr=t((()=>{qr=class{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(e,t){let{CLEAN_THRESHOLD:n=this.CLEAN_THRESHOLD,L_TIME:r=this.L_TIME,R_COUNT:i=this.R_COUNT}=t;if(e.size<n)return 0;let a=0,o=t=>{a++,e.delete(t)},s=Date.now();return e.forEach(((e,t)=>{if(e.timestamp.length<i)return o(t);let n=0;for(;s-e.timestamp[e.timestamp.length-1-n]<r&&(n++,!(n>=i)););if(n<i)return o(t);for(;s-e.timestamp[0]>r;)e.timestamp.shift()})),a}addLimitedTimestamp(e,t,n){let{R_TIMESTAMP_MAX_SIZE:r=this.R_TIMESTAMP_MAX_SIZE}=n;e.timestamp.length>r&&e.timestamp.shift(),e.timestamp.push(t)}clearTimeStamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();e.forEach((e=>{for(;r-e.timestamp[0]>n;)e.timestamp.shift()}))}clearItemTimestamp(e,t){let{L_TIME:n=this.L_TIME}=t,r=Date.now();for(;r-e.timestamp[0]>n;)e.timestamp.shift()}}}));function Yr(e,t,n){t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e/60%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<60?(o=r,s=i,c=0):60<=e&&e<120?(o=i,s=r,c=0):120<=e&&e<180?(o=0,s=r,c=i):180<=e&&e<240?(o=0,s=i,c=r):240<=e&&e<300?(o=i,s=0,c=r):300<=e&&e<360&&(o=r,s=0,c=i),o=Math.round(255*(o+a)),s=Math.round(255*(s+a)),c=Math.round(255*(c+a)),{r:o,g:s,b:c}}var Xr=t((()=>{}));function Zr(e,t,n){e/=255,t/=255,n/=255;let r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=0,s=0,c=0;return o=a===0?0:i===e?(t-n)/a%6:i===t?(n-e)/a+2:(e-t)/a+4,o=Math.round(60*o),o<0&&(o+=360),c=(i+r)/2,s=a===0?0:a/(1-Math.abs(2*c-1)),s=+(100*s).toFixed(1),c=+(100*c).toFixed(1),{h:o,s,l:c}}var Qr=t((()=>{}));function $r(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?`0`:``)+e.toString(16)}function ei(e){return L(e)?new li(e>>16,e>>8&255,255&e,1):I(e)?new li(e[0],e[1],e[2]):new li(255,255,255)}function ti(e){return L(e)?new li(e>>>24,e>>>16&255,e>>>8&255,255&e):I(e)?new li(e[0],e[1],e[2],e[3]):new li(255,255,255,1)}function ni(e){return e<.04045?.0773993808*e:(.9478672986*e+.0521327014)**2.4}function ri(e){return e<.0031308?12.92*e:1.055*e**.41666-.055}var ii,ai,oi,si,ci,li,ui=t((()=>{xn(),Xr(),Qr(),ii=/^#([0-9a-f]{3,8})$/,ai={transparent:4294967040},oi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},si=(e,t)=>{let n=ii.exec(e);if(t||n){let e=parseInt(n[1],16),t=n[1].length;return t===3?new li((e>>8&15)+((e>>8&15)<<4),(e>>4&15)+((e>>4&15)<<4),(15&e)+((15&e)<<4),1):t===6?ei(e):t===8?new li(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):null}},ci=class e{static Brighter(t,n=1){return n===1?t:new e(t).brighter(n).toRGBA()}static SetOpacity(t,n=1){return n===1?t:new e(t).setOpacity(n).toRGBA()}static getColorBrightness(t,n=`hsl`){let r=t instanceof e?t:new e(t);switch(n){case`hsv`:default:return r.getHSVBrightness();case`hsl`:return r.getHSLBrightness();case`lum`:return r.getLuminance();case`lum2`:return r.getLuminance2();case`lum3`:return r.getLuminance3();case`wcag`:return r.getLuminanceWCAG()}}static parseColorString(e){if(P(ai[e]))return ti(ai[e]);if(P(oi[e]))return ei(oi[e]);let t=`${e}`.trim().toLowerCase(),n=si(t);if(n!==void 0)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(t)){let e=t.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,``).split(`,`);return new li(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10),parseFloat(e[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(t)){let e=t.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,``).split(`,`),n=Yr(parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10));return new li(n.r,n.g,n.b,parseFloat(e[3]))}}constructor(t){let n=e.parseColorString(t);n?this.color=n:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new li(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e))),this}add(e){let{r:t,g:n,b:r}=this.color;return this.color.r+=Math.min(255,t+e.color.r),this.color.g+=Math.min(255,n+e.color.g),this.color.b+=Math.min(255,r+e.color.b),this}sub(e){return this.color.r=Math.max(0,this.color.r-e.color.r),this.color.g=Math.max(0,this.color.g-e.color.g),this.color.b=Math.max(0,this.color.b-e.color.b),this}multiply(e){let{r:t,g:n,b:r}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(t*e.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(n*e.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*e.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return .5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(e,t,n){let r=this.color.opacity,i=Zr(this.color.r,this.color.g,this.color.b),a=Yr(N(e)?i.h:qt(e,0,360),N(t)?i.s:t>=0&&t<=1?100*t:t,N(n)?i.l:n<=1&&n>=0?100*n:n);return this.color=new li(a.r,a.g,a.b,r),this}setRGB(e,t,n){return!N(e)&&(this.color.r=e),!N(t)&&(this.color.g=t),!N(n)&&(this.color.b=n),this}setHex(e){let t=`${e}`.trim().toLowerCase();return si(t,!0)??this}setColorName(e){let t=oi[e.toLowerCase()];return t===void 0?console.warn(`THREE.Color: Unknown color `+e):this.setHex(t),this}setScalar(e){return this.color.r=e,this.color.g=e,this.color.b=e,this}setOpacity(e=1){return this.color.opacity=e,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){let e=this.color.r/255,t=this.color.g/255,n=this.color.b/255,r,i,a;return r=e<=.03928?e/12.92:((e+.055)/1.055)**2.4,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,.2126*r+.7152*i+.0722*a}clone(){return new e(this.color.toString())}copyGammaToLinear(e,t=2){return this.color.r=e.color.r**+t,this.color.g=e.color.g**+t,this.color.b=e.color.b**+t,this}copyLinearToGamma(e,t=2){let n=t>0?1/t:1;return this.color.r=e.color.r**+n,this.color.g=e.color.g**+n,this.color.b=e.color.b**+n,this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.color.r=ni(e.color.r),this.color.g=ni(e.color.g),this.color.b=ni(e.color.b),this}copyLinearToSRGB(e){return this.color.r=ri(e.color.r),this.color.g=ri(e.color.g),this.color.b=ri(e.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}},li=class{constructor(e,t,n,r){this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.b=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.opacity=P(r)?isNaN(+r)?1:Math.max(0,Math.min(1,+r)):1}formatHex(){return`#${$r(this.r)+$r(this.g)+$r(this.b)+(this.opacity===1?``:$r(255*this.opacity))}`}formatRgb(){let e=this.opacity;return`${e===1?`rgb(`:`rgba(`}${this.r},${this.g},${this.b}${e===1?`)`:`,${e})`}`}formatHsl(){let e=this.opacity,{h:t,s:n,l:r}=Zr(this.r,this.g,this.b);return`${e===1?`hsl(`:`hsla(`}${t},${n}%,${r}%${e===1?`)`:`,${e})`}`}toString(){return this.formatHex()}}}));function di(e){let t=``,n=``,r=``,i=+(e[0]===`#`);for(let a=i;a<e.length;a++)e[a]!==`#`&&(a<i+2?t+=e[a]:a<i+4?n+=e[a]:a<i+6&&(r+=e[a]));return[parseInt(t,16),parseInt(n,16),parseInt(r,16)]}var fi=t((()=>{}));function pi(e,t,n){return Number((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}var mi=t((()=>{}));function hi(e,t){let n=e.r,r=t.r,i=e.g,a=t.g,o=e.b,s=t.b,c=e.opacity,l=t.opacity;return e=>{let t=Math.round(n*(1-e)+r*e),u=Math.round(i*(1-e)+a*e),d=Math.round(o*(1-e)+s*e);return new li(t,u,d,c*(1-e)+l*e)}}var gi=t((()=>{ui()})),_i=r({Color:()=>ci,DEFAULT_COLORS:()=>oi,RGB:()=>li,hexToRgb:()=>di,hslToRgb:()=>Yr,interpolateRgb:()=>hi,rgbToHex:()=>pi,rgbToHsl:()=>Zr}),vi=t((()=>{ui(),fi(),Xr(),mi(),Qr(),gi()})),yi=t((()=>{}));function bi(e){if(R(e))return[e,e,e,e];if(I(e)){let t=e.length;if(t===1){let t=e[0];return[t,t,t,t]}if(t===2){let[t,n]=e;return[t,n,t,n]}if(t===3){let[t,n,r]=e;return[t,n,r,n]}if(t===4)return e}if(F(e)){let{top:t=0,right:n=0,bottom:r=0,left:i=0}=e;return[t,n,r,i]}return[0,0,0,0]}var xi=t((()=>{Le(),je(),Se()})),Si=t((()=>{})),Ci=t((()=>{})),wi=t((()=>{Si(),Ci()}));function Ti(e,t=0,n=0){if(!e)return{width:t,height:n};let r;try{r=window==null?void 0:window.getComputedStyle}catch{r=()=>({})}let i=r(e);if(/^(\d*\.?\d+)(px)$/.exec(i.width)){let r=parseFloat(i.width)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)||e.clientWidth-1,a=parseFloat(i.height)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)||e.clientHeight-1;return{width:r<=0?t:r,height:a<=0?n:a}}return{width:t,height:n}}function Ei(e){let{x:t,y:n}=e.getBoundingClientRect();return{x:t,y:n}}var Di,Oi,ki=t((()=>{Di=(e=``)=>{let t={};return e.split(`;`).forEach((e=>{if(e){let n=e.split(`:`);if(n.length===2){let e=n[0].trim(),r=n[1].trim();e&&r&&(t[e]=r)}}})),t},Oi=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase()})),Ai=t((()=>{})),ji=t((()=>{})),Mi=t((()=>{})),Ni=t((()=>{})),Pi=t((()=>{Ai(),ji(),Ni(),Mi()})),Fi,Ii=t((()=>{Fi=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.locale_shortWeekdays=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],this.locale_periods=[`AM`,`PM`],this.locale_weekdays=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],this.locale_shortMonths=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],this.numberRe=/^\s*\d+/,this.pads={"-":``,_:` `,0:`0`},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],this.formatShortWeekday=e=>this.locale_shortWeekdays[e.getDay()],this.formatWeekday=e=>this.locale_weekdays[e.getDay()],this.formatShortMonth=e=>this.locale_shortMonths[e.getMonth()],this.formatMonth=e=>this.locale_months[e.getMonth()],this.formatDayOfMonth=(e,t)=>this.pad(e.getDate(),t,2),this.formatHour24=(e,t)=>this.pad(e.getHours(),t,2),this.formatHour12=(e,t)=>this.pad(e.getHours()%12||12,t,2),this.formatMilliseconds=(e,t)=>this.pad(e.getMilliseconds(),t,3),this.formatMonthNumber=(e,t)=>this.pad(e.getMonth()+1,t,2),this.formatMinutes=(e,t)=>this.pad(e.getMinutes(),t,2),this.formatPeriod=e=>this.locale_periods[+(e.getHours()>=12)],this.formatSeconds=(e,t)=>this.pad(e.getSeconds(),t,2),this.formatFullYear=(e,t)=>this.pad(e.getFullYear()%1e4,t,4),this.formatUTCShortWeekday=e=>this.locale_shortWeekdays[e.getUTCDay()],this.formatUTCWeekday=e=>this.locale_weekdays[e.getUTCDay()],this.formatUTCShortMonth=e=>this.locale_shortMonths[e.getUTCMonth()],this.formatUTCMonth=e=>this.locale_months[e.getUTCMonth()],this.formatUTCDayOfMonth=(e,t)=>this.pad(e.getUTCDate(),t,2),this.formatUTCHour24=(e,t)=>this.pad(e.getUTCHours(),t,2),this.formatUTCHour12=(e,t)=>this.pad(e.getUTCHours()%12||12,t,2),this.formatUTCMilliseconds=(e,t)=>this.pad(e.getUTCMilliseconds(),t,3),this.formatUTCMonthNumber=(e,t)=>this.pad(e.getUTCMonth()+1,t,2),this.formatUTCMinutes=(e,t)=>this.pad(e.getUTCMinutes(),t,2),this.formatUTCPeriod=e=>this.locale_periods[+(e.getUTCHours()>=12)],this.formatUTCSeconds=(e,t)=>this.pad(e.getUTCSeconds(),t,2),this.formatUTCFullYear=(e,t)=>this.pad(e.getUTCFullYear()%1e4,t,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(e,t,n)=>{let r=this.shortWeekdayRe.exec(t.slice(n));return r?(e.w=this.shortWeekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseWeekday=(e,t,n)=>{let r=this.weekdayRe.exec(t.slice(n));return r?(e.w=this.weekdayLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseShortMonth=(e,t,n)=>{let r=this.shortMonthRe.exec(t.slice(n));return r?(e.m=this.shortMonthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseMonth=(e,t,n)=>{let r=this.monthRe.exec(t.slice(n));return r?(e.m=this.monthLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseDayOfMonth=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1},this.parseHour24=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1},this.parseMilliseconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1},this.parseMonthNumber=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.m=r-1,n+r[0].length):-1},this.parseMinutes=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1},this.parsePeriod=(e,t,n)=>{let r=this.periodRe.exec(t.slice(n));return r?(e.p=this.periodLookup.get(r[0].toLowerCase()),n+r[0].length):-1},this.parseSeconds=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1},this.parseFullYear=(e,t,n)=>{let r=this.numberRe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(e,t)=>this.newFormat(e,this.formats)(new Date(this.getFullTimeStamp(t))),this.timeUTCFormat=(e,t)=>this.newFormat(e,this.utcFormats)(new Date(this.getFullTimeStamp(t))),this.timeParse=(e,t)=>this.newParse(e,!1)(t+``),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(e){return e.replace(this.requoteRe,`\\$&`)}localDate(e){if(0<=e.y&&e.y<100){let t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}utcDate(e){if(0<=e.y&&e.y<100){let t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}newDate(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}formatRe(e){return RegExp(`^(?:`+e.map(this.requoteF).join(`|`)+`)`,`i`)}formatLookup(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}pad(e,t,n){let r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}parseSpecifier(e,t,n,r){let i=0,a=t.length,o=n.length,s,c;for(;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=this.parses[s in this.pads?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!==n.charCodeAt(r++))return-1}return r}newParse(e,t){let n=this;return function(r){let i=n.newDate(1900,void 0,1);return n.parseSpecifier(i,e,r+=``,0)===r.length?`Q`in i?new Date(i.Q):`s`in i?new Date(1e3*i.s+(`L`in i?i.L:0)):(t&&!(`Z`in i)&&(i.Z=0),`p`in i&&(i.H=i.H%12+12*i.p),i.m===void 0&&(i.m=`q`in i?i.q:0),`Z`in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,n.utcDate(i)):n.localDate(i)):null}}newFormat(e,t){let n=this;return function(r){let i=[],a=-1,o=0,s=e.length,c,l,u;for(r instanceof Date||(r=new Date(+r));++a<s;)e.charCodeAt(a)===37&&(i.push(e.slice(o,a)),(l=n.pads[c=e.charAt(++a)])?c=e.charAt(++a):l=c===`e`?` `:`0`,u=t[c],c=u(r,l),i.push(c),o=a+1);return i.push(e.slice(o,a)),i.join(``)}}getFullTimeStamp(e){let t=parseInt(e+``,10);return String(t).length===10?1e3*t:t}}})),Li=t((()=>{})),Ri=t((()=>{})),zi=t((()=>{Ri(),Li()})),Bi=t((()=>{})),Vi=t((()=>{})),Hi=t((()=>{})),Ui=t((()=>{Bi(),Vi(),Hi()})),Wi,H=t((()=>{Wi=n(me()),xn(),Kr(),Jr(),Hn(),nr(),vi(),Lr(),yi(),Ft(),xi(),wi(),ki(),Pi(),vi(),Ii(),zi(),Ui()})),Gi=(e,t)=>{let{callback:n}=t;return n&&(e=e.filter(n)),e};H();var Ki=function(e,...t){return Yi(et(e),...t)};function qi(e,t,n){let r=t[n];if(r===void 0)e[n]=null;else if(F(r)){F(e[n])||(e[n]={});for(let t in r)qi(e[n],r,t)}else e[n]=r}function Ji(e,t){if(F(t)&&e!==t)for(let n in t)qi(e,t,n)}function Yi(e,...t){e||={};let n=-1,r=t.length;for(;++n<r;)Ji(e,t[n]);return e}var Xi;(function(e){e.DSV=`dsv`,e.TREE=`tree`,e.GEO=`geo`,e.BYTE=`bytejson`,e.HEX=`hex`,e.GRAPH=`graph`,e.TABLE=`table`,e.GEO_GRATICULE=`geo-graticule`})(Xi||={});var Zi=(e,t)=>{let{fields:n,key:r,value:i,retains:a}=t,o=[];for(let t=0;t<e.length;t++)n.forEach((s=>{let c={};if(c[r]=s,c[i]=e[t][s],a)a.forEach((n=>{c[n]=e[t][n]}));else for(let r in e[t])n.indexOf(r)===-1&&(c[r]=e[t][r]);o.push(c)}));return o};H();var Qi=(e,t)=>{if(!t?.fields||e.length===0)return e;let n=t.fields,r=e[0],i={},a=[];for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){let o=n[t];if(o.sort&&(R(o.sortIndex)||(o.sortIndex=0),P(o.sortReverse)||(o.sortReverse=o.sort===`desc`)),!o.type){let n=r;t in r||(n=e.find((e=>t in e))??r),o.type=typeof n[t]==`number`?`linear`:`ordinal`}let s;if(typeof o.sortIndex==`number`&&(s={key:t,type:o.type,index:o.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===o.sortReverse},a.push(s)),o.domain?.length>0){if(o.type===`ordinal`){o._domainCache={},i[t]=o;let e={};o.domain.forEach(((t,n)=>{e[t]=n,o._domainCache[t]=n})),s&&(s.sortIndex=e,s.sortIndexCount=o.domain.length)}else o.domain.length>=2&&(i[t]=o)}}return Object.keys(i).length>0&&(e=e.filter((e=>{for(let t in i){let n=i[t];if(n.type===`ordinal`){if(!(e[t]in n._domainCache))return!1}else if(n.domain[0]>e[t]||n.domain[1]<e[t])return!1}return!0}))),a.sort(((e,t)=>e.index-t.index)),e.sort(((e,t)=>$i(e,t,a))),e};function $i(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=0;if(i.type===`ordinal`?(i.sortIndex[t[i.key]]===void 0&&(i.sortIndex[t[i.key]]=i.sortIndexCount++),i.sortIndex[e[i.key]]===void 0&&(i.sortIndex[e[i.key]]=i.sortIndexCount++),a=i.sortIndex[e[i.key]]-i.sortIndex[t[i.key]]):i.type===`linear`&&(a=e[i.key]-t[i.key]),i.sortReverse&&(a=-a),a!==0)return a}return 0}var ea={},ta={},na=34,ra=10,ia=13;function aa(e){return Function(`d`,`return {`+e.map(function(e,t){return JSON.stringify(e)+`: d[`+t+`] || ""`}).join(`,`)+`}`)}function oa(e,t){var n=aa(e);return function(r,i){return t(n(r),i,e)}}function sa(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var r in e)r in t||n.push(t[r]=r)}),n}function ca(e,t){var n=e+``,r=n.length;return r<t?Array(t-r+1).join(0)+n:n}function la(e){return e<0?`-`+ca(-e,6):e>9999?`+`+ca(e,6):ca(e,4)}function ua(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?`Invalid Date`:la(e.getUTCFullYear(),4)+`-`+ca(e.getUTCMonth()+1,2)+`-`+ca(e.getUTCDate(),2)+(i?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`.`+ca(i,3)+`Z`:r?`T`+ca(t,2)+`:`+ca(n,2)+`:`+ca(r,2)+`Z`:n||t?`T`+ca(t,2)+`:`+ca(n,2)+`Z`:``)}function da(e){var t=RegExp(`["`+e+`
|
|
2
2
|
\r]`),n=e.charCodeAt(0);function r(e,t){var n,r,a=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?oa(e,t):aa(e)});return a.columns=r||[],a}function i(e,t){var r=[],i=e.length,a=0,o=0,s,c=i<=0,l=!1;e.charCodeAt(i-1)===ra&&--i,e.charCodeAt(i-1)===ia&&--i;function u(){if(c)return ta;if(l)return l=!1,ea;var t,r=a,o;if(e.charCodeAt(r)===na){for(;a++<i&&e.charCodeAt(a)!==na||e.charCodeAt(++a)===na;);return(t=a)>=i?c=!0:(o=e.charCodeAt(a++))===ra?l=!0:o===ia&&(l=!0,e.charCodeAt(a)===ra&&++a),e.slice(r+1,t-1).replace(/""/g,`"`)}for(;a<i;){if((o=e.charCodeAt(t=a++))===ra)l=!0;else if(o===ia)l=!0,e.charCodeAt(a)===ra&&++a;else if(o!==n)continue;return e.slice(r,t)}return c=!0,e.slice(r,i)}for(;(s=u())!==ta;){for(var d=[];s!==ea&&s!==ta;)d.push(s),s=u();t&&(d=t(d,o++))==null||r.push(d)}return r}function a(t,n){return t.map(function(t){return n.map(function(e){return u(t[e])}).join(e)})}function o(t,n){return n??=sa(t),[n.map(u).join(e)].concat(a(t,n)).join(`
|
|
3
3
|
`)}function s(e,t){return t??=sa(e),a(e,t).join(`
|
|
4
4
|
`)}function c(e){return e.map(l).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{c as n,l as r,u as i}from"./chunk-OB3PAWPO-mARpRU1A.js";import{t as a}from"./jsx-runtime-BdxMnOeJ.js";import{i as o,m as s,t as c}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{c as n,l as r,u as i}from"./chunk-OB3PAWPO-mARpRU1A.js";import{t as a}from"./jsx-runtime-BdxMnOeJ.js";import{i as o,m as s,t as c}from"./log-DnEvbp3E.js";import{c as l,d as u,f as d}from"./pendingActionsStore-CxhI19V9.js";import{n as f,t as p}from"./WorkflowsSection-DuXdLsMO.js";import{a as m,i as h,n as g,r as _,v,y}from"./ToolCallMessage-BfNbWGmc.js";import{Vt as b}from"./lexicalToReact-CZvp9Pgz.js";import{t as x}from"./createScopedStore-BrD5NHWx.js";import{t as S}from"./runDetached-DfQXHAaY.js";import{i as C}from"./status-pill-Bo1Nb6HX.js";import{t as w}from"./settings-header-button-BYvHR6Xl.js";var T={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};T.node;var E=d(T),D=e(t(),1),O=x(`WorkflowsPageView`,()=>e=>({selectedRunId:null,selectedRun:null,selectedAgentId:null,setSelectedRunId:t=>e({selectedRunId:t}),setSelectedRun:t=>e({selectedRun:t}),setSelectedAgentId:t=>e({selectedAgentId:t}),clearSelection:()=>e({selectedRunId:null,selectedRun:null,selectedAgentId:null})})),k=[],A=x(`WorkflowAgentTranscript`,()=>e=>({loadState:`loading`,messages:k,error:null,reloadNonce:0,setLoaded:t=>e({loadState:`loaded`,messages:t}),setError:t=>e({loadState:`error`,error:t}),refresh:()=>e(e=>({loadState:`loading`,error:null,reloadNonce:e.reloadNonce+1}))})),j=e(a(),1);function M({runId:e,agentId:t,agentLabel:n,promptPreview:r,agentIsRunning:i=!1,onClose:a,getTranscript:o}){let c=A.useScopedStore(e=>e.loadState),l=A.useScopedStore(e=>e.messages),d=A.useScopedStore(e=>e.error),f=A.useScopedStore(e=>e.reloadNonce),p=A.useScopedStore(e=>e.setLoaded),g=A.useScopedStore(e=>e.setError),_=A.useScopedStore(e=>e.refresh);(0,D.useEffect)(()=>{let n=!1;return o(e,t).then(e=>{n||p(v(e))}).catch(s(e=>{n||g(e.message)})),()=>{n=!0}},[e,t,o,f,p,g]);let y=(0,D.useCallback)(()=>{_()},[_]);return(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3`,"data-testid":`workflow-agent-transcript-panel`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border pb-2.5`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:a,"aria-label":`Back to run`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,j.jsx)(E,{className:`size-4`,"aria-hidden":!0})}),(0,j.jsx)(`span`,{className:`truncate text-sm font-semibold text-foreground`,children:n}),(0,j.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium tracking-wide text-muted-foreground`,children:`Transcript`}),i?(0,j.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium tracking-wide`,children:[(0,j.jsx)(`span`,{"aria-hidden":!0,className:`inline-block size-1.5 animate-pulse rounded-full bg-emerald-500 dark:bg-emerald-400`}),(0,j.jsx)(`span`,{className:`text-emerald-500 dark:text-emerald-400`,children:`Running`})]}):null,(0,j.jsx)(`button`,{type:`button`,onClick:y,"aria-label":`Refresh transcript`,className:`ml-auto inline-flex size-6 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:(0,j.jsx)(b,{className:c===`loading`?`size-3.5 animate-spin`:`size-3.5`,"aria-hidden":!0})})]}),i?(0,j.jsx)(`p`,{className:`rounded-md border border-amber-500/20 bg-amber-500/5 px-2.5 py-1.5 text-xs text-amber-600 dark:text-amber-400`,children:`This agent is still running — the transcript may be incomplete. Refresh to update.`}):null,r?(0,j.jsxs)(`div`,{className:`rounded-md border border-border/50 bg-muted/40 px-2.5 py-1.5`,children:[(0,j.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Prompt (preview)`}),(0,j.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:r})]}):null,(0,j.jsx)(h,{value:null,children:(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,children:[c===`loading`?(0,j.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,j.jsx)(u,{className:`size-3 animate-spin`,"aria-label":`Loading`}),`Loading transcript…`]}):null,c===`error`?(0,j.jsx)(`div`,{className:`text-xs text-destructive`,children:d}):null,c===`loaded`&&l.length===0?(0,j.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No transcript recorded yet.`}):null,l.map(e=>(0,j.jsx)(m,{message:e,localPath:``},e.id))]})})]})}function N(e){return(0,j.jsx)(A.Provider,{init:void 0,children:(0,j.jsx)(M,{...e})})}function P({runs:e,getRunDetail:t,getAgentTranscript:n,onBackToChat:r}){let i=O.useScopedStore(e=>e.selectedRunId),a=O.useScopedStore(e=>e.selectedRun),d=O.useScopedStore(e=>e.selectedAgentId),m=O.useScopedStore(e=>e.setSelectedRunId),h=O.useScopedStore(e=>e.setSelectedRun),g=O.useScopedStore(e=>e.setSelectedAgentId),_=O.useScopedStore(e=>e.clearSelection),v=(0,D.useRef)(null),b=(0,D.useRef)(0),x=(0,D.useCallback)(n=>{v.current=e,m(n),g(null),h(`loading`);let r=++b.current,i=()=>b.current===r;t(n).then(e=>{i()&&h(e??`not-found`)},s(e=>{c.error(o,`workflows.getRun failed`,e),i()&&h(`failed`)}))},[t,e,m,g,h]),C=(0,D.useCallback)(()=>{_(),v.current=null},[_]);(0,D.useEffect)(()=>{if(i===null||e===v.current)return;let n=e.find(e=>e.runId===i);if(!n||n.status!==`running`)return;let r=!1,a=++b.current;return S(`workflows.getRun refresh`,t(i).then(e=>{r||b.current!==a||e===null||(d===null||e.agents.some(e=>e.agentId===d))&&h(e)})),()=>{r=!0}},[e,i,d,t,h]);let T=a!==`loading`&&a!==`not-found`&&a!==`failed`?a:null,k=d!==null&&T?T.agents.find(e=>e.agentId===d):void 0,A=i!==null,M;return M=a===`loading`?(0,j.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,j.jsx)(u,{className:`size-4 animate-spin`,"aria-label":`Loading`}),`Loading run…`]}):a===`failed`?(0,j.jsx)(I,{text:`Couldn't load this run. Select it again to retry.`}):a===`not-found`?(0,j.jsx)(I,{text:`Run not found or no longer available.`}):k&&T?(0,j.jsx)(N,{runId:T.runId,agentId:k.agentId,agentLabel:k.label,promptPreview:k.promptPreview,agentIsRunning:k.state===`running`||k.state===`progress`,onClose:()=>g(null),getTranscript:n},d??``):T?(0,j.jsx)(p,{run:T,title:T.workflowName??T.runId,onSelectAgent:e=>g(e)}):(0,j.jsx)(I,{text:`Select a run to view its phases and agents.`}),(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-4 py-3 md:px-6`,children:[(0,j.jsx)(y,{className:`size-5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,j.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:`Workflows`}),e.length>0?(0,j.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]}):null,r?(0,j.jsx)(w,{"aria-label":`Back to chat`,className:`ml-auto`,icon:(0,j.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),onClick:r,children:`Back to chat`}):null]}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,j.jsx)(`div`,{className:l(`w-full shrink-0 overflow-auto p-3 md:w-80 md:border-r md:border-border`,A&&`hidden md:block`),children:(0,j.jsx)(f,{runs:e,selectedRunId:i,onSelectRun:x})}),(0,j.jsxs)(`div`,{className:l(`min-w-0 flex-1 overflow-auto px-4 py-4 md:px-6`,!A&&`hidden md:block`),children:[A?(0,j.jsxs)(`button`,{type:`button`,onClick:C,"aria-label":`Back to runs`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground md:hidden`,children:[(0,j.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),`All runs`]}):null,M]})]})]})}function F(e){return(0,j.jsx)(O.Provider,{init:void 0,children:(0,j.jsx)(P,{...e})})}function I({text:e}){return(0,j.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,j.jsxs)(`div`,{className:`flex flex-col items-center gap-3 rounded-lg border border-dashed border-border px-8 py-10 text-center`,children:[(0,j.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,j.jsx)(y,{className:`size-5`,"aria-hidden":!0})}),(0,j.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e})]})})}function L(){let e=r(),t=n(),{chatId:a}=i(),o=_(C(g(a??``))),s=(0,D.useCallback)(async t=>a?e.socket.command({type:`workflows.getRun`,chatId:a,runId:t}):null,[a,e.socket]),c=(0,D.useCallback)(async(t,n)=>a?e.socket.command({type:`workflows.getAgentTranscript`,chatId:a,runId:t,agentId:n}):[],[a,e.socket]),l=(0,D.useCallback)(()=>{a&&t(`/chat/${a}`)},[a,t]);return a?(0,j.jsx)(F,{runs:o,getRunDetail:s,getAgentTranscript:c,onBackToChat:l}):(0,j.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Open a chat to view its workflows.`})}export{L as WorkflowsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,m as i,t as a}from"./log-aTaDVF_e.js";import{c as o,f as s,s as c}from"./pendingActionsStore-COTh4Ztq.js";import{H as l}from"./FilePreviewSheet-XEuUtDPn.js";import{c as u,i as d,n as f,r as p,u as m}from"./timer.adapter-DHt2zwsL.js";import{t as h}from"./createScopedStore-BoLB9Rhc.js";import{t as g}from"./runDetached-DqQ3k2ji.js";import{n as _}from"./status-pill-CwhJhaMy.js";import{t as v}from"./formatDuration-BbWTR_M_.js";import{l as y,s as b,t as x}from"./state-mark-BhTZfcYe.js";var S={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};S.node;var C=s(S),w=e(t(),1),T=h(`WorkflowsSectionDetail`,()=>e=>({selectedRun:null,selectedRunId:null,setSelectedRun:t=>e({selectedRun:t}),setSelectedRunId:t=>e({selectedRunId:t}),clearSelection:()=>e({selectedRun:null,selectedRunId:null})})),E=`Agents`;function D(e){return typeof e.phaseIndex==`number`&&e.phaseIndex>=1}function O(e,t){if(!t.some(D))return t.length===0?[]:[{key:`ungrouped`,phaseIndex:null,title:E,agents:t}];let n=new Map,r=[];for(let e of t)if(D(e)){let t=n.get(e.phaseIndex)??[];t.push(e),n.set(e.phaseIndex,t)}else r.push(e);let i=[];e.forEach((e,t)=>{let r=t+1;i.push({key:`phase-${r}`,phaseIndex:r,title:e.title,detail:e.detail,agents:n.get(r)??[]}),n.delete(r)});for(let e of[...n.keys()].sort((e,t)=>e-t)){let t=n.get(e);i.push({key:`phase-${e}`,phaseIndex:e,title:t[0]?.phaseTitle??`Phase ${e}`,agents:t})}return r.length>0&&i.push({key:`ungrouped`,phaseIndex:null,title:E,agents:r}),i}var k=e(n(),1);function A({runs:e,onSelectRun:t,selectedRunId:n}){return e.length===0?(0,k.jsx)(j,{}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,k.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]})}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,k.jsx)(M,{run:e,selected:e.runId===n,onSelect:t},e.runId))})]})}function j(){return(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`workflow-empty`,children:[(0,k.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,k.jsx)(C,{className:`size-5`,"aria-hidden":!0})}),(0,k.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No workflow runs`}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Workflow runs will appear here when triggered.`})]})}function M(e){let{run:t,selected:n}=e,r=t.workflowName??t.runId,i=t.status===`running`,a=(0,w.useCallback)(()=>{e.onSelect(t.runId)},[e,t.runId]);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-row:${t.runId}`,onClick:a,className:o(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,n&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,(i||n)&&`font-medium`),children:r}),(0,k.jsx)(_,{status:t.status,pulse:!0})]}),(0,k.jsxs)(`span`,{className:`flex w-full items-center gap-3 text-xs text-muted-foreground`,children:[t.agentCount==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.agentCount,` `,t.agentCount===1?`agent`:`agents`]}),t.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.totalTokens.toLocaleString(),` tokens`]}),t.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:v(t.durationMs)})]})]})})}function N(e){return e===`running`||e===`progress`?`active`:e===`failed`||e===`error`?`destructive`:e===`killed`?`attention`:`muted`}function P(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function F({run:e,failed:t}){return e?(0,k.jsx)(z,{run:e}):t?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this run. Close and select it again to retry.`}):(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(c,{}),`Loading…`]})}function I({run:e,failed:t=!1,open:n,onClose:r}){return(0,k.jsx)(f,{open:n,onOpenChange:e=>{e||r()},children:(0,k.jsxs)(d,{size:`lg`,"aria-describedby":void 0,children:[(0,k.jsx)(u,{children:(0,k.jsx)(m,{children:e?e.workflowName??e.runId:`Workflow run`})}),(0,k.jsx)(p,{children:(0,k.jsx)(F,{run:e,failed:t})})]})})}function L({label:e,text:t}){return(0,k.jsxs)(`div`,{className:`rounded border border-border/50 bg-muted/40 px-2 py-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:t})]})}function R({agent:e,onSelectAgent:t}){let n=N(e.state),r=n===`active`,i=!!(t&&e.agentId);return(0,k.jsxs)(`li`,{"data-testid":`workflow-agent:${e.agentId??e.index}`,className:`group flex items-start gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,k.jsx)(x,{tone:n,className:o(`mt-0.5`,b(n))}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,r&&`font-medium`),children:e.label}),e.model?(0,k.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground`,children:e.model}):null,i?(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-agent-transcript:${e.agentId}`,onClick:()=>t?.(e.agentId),className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(l,{className:`size-3`,"aria-hidden":!0}),`Transcript`]}):null]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{className:o(`capitalize`,b(n)),children:e.state}),e.lastToolName?(0,k.jsxs)(`span`,{className:`truncate`,children:[`last: `,e.lastToolName]}):null,e.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,children:v(e.durationMs)}),e.tokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.tokens.toLocaleString(),` tok`]}),e.toolCalls==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.toolCalls,` calls`]})]}),e.lastToolSummary?(0,k.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:e.lastToolSummary}):null,e.promptPreview?(0,k.jsx)(L,{label:`Prompt`,text:e.promptPreview}):null,e.resultPreview?(0,k.jsx)(L,{label:`Result`,text:e.resultPreview}):null]})]})}function z({run:e,onSelectAgent:t,title:n}){let r=y(e.status),i=O(e.phases,e.agents);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,k.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:n}):null,(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(_,{status:e.status,pulse:!0}),e.durationMs==null?null:(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:v(e.durationMs)}),e.agentCount==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agentCount,` `,e.agentCount===1?`agent`:`agents`]}),e.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalTokens.toLocaleString(),` tokens`]}),e.totalToolCalls==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalToolCalls,` tool calls`]})]})]}),e.summary?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Summary`}),(0,k.jsx)(`p`,{className:`text-sm text-foreground whitespace-pre-wrap`,children:e.summary})]}):null,i.length>0?(0,k.jsx)(`section`,{className:`flex flex-col gap-4`,"data-testid":`workflow-progress-tree`,children:i.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.phaseIndex==null?null:(0,k.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground tabular-nums`,children:e.phaseIndex}),(0,k.jsx)(`h4`,{className:`text-xs font-semibold tracking-wide text-foreground`,children:e.title}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agents.length,` `,e.agents.length===1?`agent`:`agents`]})]}),e.detail?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}):null,e.agents.length>0?(0,k.jsx)(`ul`,{className:`ml-1.5 flex flex-col gap-0.5 border-l border-border pl-2.5`,children:e.agents.map(e=>(0,k.jsx)(R,{agent:e,onSelectAgent:t},e.agentId??e.index))}):(0,k.jsx)(`p`,{className:`ml-1.5 border-l border-border pl-2.5 text-xs italic text-muted-foreground/70`,children:`No agents yet`})]},e.key))}):null,e.result?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Result`}),(0,k.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:P(e.result)})]}):null,e.script?(0,k.jsxs)(`details`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium tracking-wide text-muted-foreground hover:text-foreground`,children:`Script`}),(0,k.jsx)(`pre`,{className:`mt-1.5 max-h-96 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:e.script})]}):null,e.error&&e.status!==`completed`?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:o(`text-xs font-medium tracking-wide`,b(r)),children:`Error`}),(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-sm text-destructive whitespace-pre-wrap`,children:e.error})]}):null]})}function B({runs:e,getRunDetail:t}){let n=T.useScopedStore(e=>e.selectedRun),o=T.useScopedStore(e=>e.selectedRunId),s=T.useScopedStore(e=>e.setSelectedRun),c=T.useScopedStore(e=>e.setSelectedRunId),l=T.useScopedStore(e=>e.clearSelection),u=n!==null,d=(0,w.useRef)(null),f=(0,w.useRef)(0),p=(0,w.useCallback)(n=>{d.current=e,c(n),s(`loading`);let o=++f.current,l=()=>f.current===o;t(n).then(e=>{l()&&s(e)},i(e=>{a.error(r,`workflows.getRun failed`,e),l()&&s(`failed`)}))},[t,e,s,c]),m=(0,w.useCallback)(()=>{l(),d.current=null},[l]);return(0,w.useEffect)(()=>{if(o===null||e===d.current)return;let n=e.find(e=>e.runId===o);if(!n||n.status!==`running`)return;let r=!1,i=++f.current;return g(`workflows.getRun refresh`,t(o).then(e=>{r||f.current!==i||e===null||s(e)})),()=>{r=!0}},[e,o,t,s]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(A,{runs:e,onSelectRun:p}),(0,k.jsx)(I,{run:n===`loading`||n===`failed`?null:n,failed:n===`failed`,open:u,onClose:m})]})}function V(e){return(0,k.jsx)(T.Provider,{init:void 0,children:(0,k.jsx)(B,{...e})})}export{C as i,A as n,V as r,z as t};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,m as i,t as a}from"./log-DnEvbp3E.js";import{c as o,f as s,s as c}from"./pendingActionsStore-CxhI19V9.js";import{H as l}from"./FilePreviewSheet-B6SDxSD0.js";import{c as u,i as d,n as f,r as p,u as m}from"./timer.adapter-C2RhP4d6.js";import{t as h}from"./createScopedStore-BrD5NHWx.js";import{t as g}from"./runDetached-DfQXHAaY.js";import{n as _}from"./status-pill-Bo1Nb6HX.js";import{t as v}from"./formatDuration-BbWTR_M_.js";import{l as y,s as b,t as x}from"./state-mark-C3kEL1hX.js";var S={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};S.node;var C=s(S),w=e(t(),1),T=h(`WorkflowsSectionDetail`,()=>e=>({selectedRun:null,selectedRunId:null,setSelectedRun:t=>e({selectedRun:t}),setSelectedRunId:t=>e({selectedRunId:t}),clearSelection:()=>e({selectedRun:null,selectedRunId:null})})),E=`Agents`;function D(e){return typeof e.phaseIndex==`number`&&e.phaseIndex>=1}function O(e,t){if(!t.some(D))return t.length===0?[]:[{key:`ungrouped`,phaseIndex:null,title:E,agents:t}];let n=new Map,r=[];for(let e of t)if(D(e)){let t=n.get(e.phaseIndex)??[];t.push(e),n.set(e.phaseIndex,t)}else r.push(e);let i=[];e.forEach((e,t)=>{let r=t+1;i.push({key:`phase-${r}`,phaseIndex:r,title:e.title,detail:e.detail,agents:n.get(r)??[]}),n.delete(r)});for(let e of[...n.keys()].sort((e,t)=>e-t)){let t=n.get(e);i.push({key:`phase-${e}`,phaseIndex:e,title:t[0]?.phaseTitle??`Phase ${e}`,agents:t})}return r.length>0&&i.push({key:`ungrouped`,phaseIndex:null,title:E,agents:r}),i}var k=e(n(),1);function A({runs:e,onSelectRun:t,selectedRunId:n}){return e.length===0?(0,k.jsx)(j,{}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,k.jsxs)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,style:{fontVariantNumeric:`tabular-nums`},children:[e.length,` `,e.length===1?`run`:`runs`]})}),(0,k.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>(0,k.jsx)(M,{run:e,selected:e.runId===n,onSelect:t},e.runId))})]})}function j(){return(0,k.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-4 rounded-lg border border-dashed border-border px-6 py-14 text-center`,"data-testid":`workflow-empty`,children:[(0,k.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:(0,k.jsx)(C,{className:`size-5`,"aria-hidden":!0})}),(0,k.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`No workflow runs`}),(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Workflow runs will appear here when triggered.`})]})}function M(e){let{run:t,selected:n}=e,r=t.workflowName??t.runId,i=t.status===`running`,a=(0,w.useCallback)(()=>{e.onSelect(t.runId)},[e,t.runId]);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-row:${t.runId}`,onClick:a,className:o(`flex w-full flex-col items-start gap-0.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted`,n&&`bg-muted`),children:[(0,k.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,(i||n)&&`font-medium`),children:r}),(0,k.jsx)(_,{status:t.status,pulse:!0})]}),(0,k.jsxs)(`span`,{className:`flex w-full items-center gap-3 text-xs text-muted-foreground`,children:[t.agentCount==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.agentCount,` `,t.agentCount===1?`agent`:`agents`]}),t.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:[t.totalTokens.toLocaleString(),` tokens`]}),t.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,style:{fontVariantNumeric:`tabular-nums`},children:v(t.durationMs)})]})]})})}function N(e){return e===`running`||e===`progress`?`active`:e===`failed`||e===`error`?`destructive`:e===`killed`?`attention`:`muted`}function P(e){let t=e.trim();if(!t.startsWith(`{`)&&!t.startsWith(`[`))return e;try{return JSON.stringify(JSON.parse(t),null,2)}catch{return e}}function F({run:e,failed:t}){return e?(0,k.jsx)(z,{run:e}):t?(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Couldn't load this run. Close and select it again to retry.`}):(0,k.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,k.jsx)(c,{}),`Loading…`]})}function I({run:e,failed:t=!1,open:n,onClose:r}){return(0,k.jsx)(f,{open:n,onOpenChange:e=>{e||r()},children:(0,k.jsxs)(d,{size:`lg`,"aria-describedby":void 0,children:[(0,k.jsx)(u,{children:(0,k.jsx)(m,{children:e?e.workflowName??e.runId:`Workflow run`})}),(0,k.jsx)(p,{children:(0,k.jsx)(F,{run:e,failed:t})})]})})}function L({label:e,text:t}){return(0,k.jsxs)(`div`,{className:`rounded border border-border/50 bg-muted/40 px-2 py-1`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:e}),(0,k.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-muted-foreground/90`,children:t})]})}function R({agent:e,onSelectAgent:t}){let n=N(e.state),r=n===`active`,i=!!(t&&e.agentId);return(0,k.jsxs)(`li`,{"data-testid":`workflow-agent:${e.agentId??e.index}`,className:`group flex items-start gap-2 rounded-md px-2 py-1.5 transition-colors hover:bg-muted/50`,children:[(0,k.jsx)(x,{tone:n,className:o(`mt-0.5`,b(n))}),(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:o(`truncate text-sm text-foreground`,r&&`font-medium`),children:e.label}),e.model?(0,k.jsx)(`span`,{className:`shrink-0 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground`,children:e.model}):null,i?(0,k.jsxs)(`button`,{type:`button`,"data-testid":`workflow-agent-transcript:${e.agentId}`,onClick:()=>t?.(e.agentId),className:`ml-auto inline-flex shrink-0 items-center gap-1 rounded border border-border bg-card px-1.5 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,k.jsx)(l,{className:`size-3`,"aria-hidden":!0}),`Transcript`]}):null]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-xs text-muted-foreground`,children:[(0,k.jsx)(`span`,{className:o(`capitalize`,b(n)),children:e.state}),e.lastToolName?(0,k.jsxs)(`span`,{className:`truncate`,children:[`last: `,e.lastToolName]}):null,e.durationMs==null?null:(0,k.jsx)(`span`,{className:`tabular-nums`,children:v(e.durationMs)}),e.tokens==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.tokens.toLocaleString(),` tok`]}),e.toolCalls==null?null:(0,k.jsxs)(`span`,{className:`tabular-nums`,children:[e.toolCalls,` calls`]})]}),e.lastToolSummary?(0,k.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:e.lastToolSummary}):null,e.promptPreview?(0,k.jsx)(L,{label:`Prompt`,text:e.promptPreview}):null,e.resultPreview?(0,k.jsx)(L,{label:`Result`,text:e.resultPreview}):null]})]})}function z({run:e,onSelectAgent:t,title:n}){let r=y(e.status),i=O(e.phases,e.agents);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,k.jsx)(`h3`,{className:`truncate text-base font-semibold text-foreground`,children:n}):null,(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(_,{status:e.status,pulse:!0}),e.durationMs==null?null:(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:v(e.durationMs)}),e.agentCount==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agentCount,` `,e.agentCount===1?`agent`:`agents`]}),e.totalTokens==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalTokens.toLocaleString(),` tokens`]}),e.totalToolCalls==null?null:(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.totalToolCalls,` tool calls`]})]})]}),e.summary?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Summary`}),(0,k.jsx)(`p`,{className:`text-sm text-foreground whitespace-pre-wrap`,children:e.summary})]}):null,i.length>0?(0,k.jsx)(`section`,{className:`flex flex-col gap-4`,"data-testid":`workflow-progress-tree`,children:i.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.phaseIndex==null?null:(0,k.jsx)(`span`,{"aria-hidden":!0,className:`flex size-4 shrink-0 items-center justify-center rounded bg-muted text-xs font-medium text-muted-foreground tabular-nums`,children:e.phaseIndex}),(0,k.jsx)(`h4`,{className:`text-xs font-semibold tracking-wide text-foreground`,children:e.title}),(0,k.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:[e.agents.length,` `,e.agents.length===1?`agent`:`agents`]})]}),e.detail?(0,k.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.detail}):null,e.agents.length>0?(0,k.jsx)(`ul`,{className:`ml-1.5 flex flex-col gap-0.5 border-l border-border pl-2.5`,children:e.agents.map(e=>(0,k.jsx)(R,{agent:e,onSelectAgent:t},e.agentId??e.index))}):(0,k.jsx)(`p`,{className:`ml-1.5 border-l border-border pl-2.5 text-xs italic text-muted-foreground/70`,children:`No agents yet`})]},e.key))}):null,e.result?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:`Result`}),(0,k.jsx)(`pre`,{className:`max-h-80 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:P(e.result)})]}):null,e.script?(0,k.jsxs)(`details`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium tracking-wide text-muted-foreground hover:text-foreground`,children:`Script`}),(0,k.jsx)(`pre`,{className:`mt-1.5 max-h-96 overflow-auto rounded-md border border-border/60 bg-muted/40 px-3 py-2 text-xs text-foreground whitespace-pre-wrap break-words`,children:e.script})]}):null,e.error&&e.status!==`completed`?(0,k.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,k.jsx)(`h4`,{className:o(`text-xs font-medium tracking-wide`,b(r)),children:`Error`}),(0,k.jsx)(`p`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-sm text-destructive whitespace-pre-wrap`,children:e.error})]}):null]})}function B({runs:e,getRunDetail:t}){let n=T.useScopedStore(e=>e.selectedRun),o=T.useScopedStore(e=>e.selectedRunId),s=T.useScopedStore(e=>e.setSelectedRun),c=T.useScopedStore(e=>e.setSelectedRunId),l=T.useScopedStore(e=>e.clearSelection),u=n!==null,d=(0,w.useRef)(null),f=(0,w.useRef)(0),p=(0,w.useCallback)(n=>{d.current=e,c(n),s(`loading`);let o=++f.current,l=()=>f.current===o;t(n).then(e=>{l()&&s(e)},i(e=>{a.error(r,`workflows.getRun failed`,e),l()&&s(`failed`)}))},[t,e,s,c]),m=(0,w.useCallback)(()=>{l(),d.current=null},[l]);return(0,w.useEffect)(()=>{if(o===null||e===d.current)return;let n=e.find(e=>e.runId===o);if(!n||n.status!==`running`)return;let r=!1,i=++f.current;return g(`workflows.getRun refresh`,t(o).then(e=>{r||f.current!==i||e===null||s(e)})),()=>{r=!0}},[e,o,t,s]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(A,{runs:e,onSelectRun:p}),(0,k.jsx)(I,{run:n===`loading`||n===`failed`?null:n,failed:n===`failed`,open:u,onClose:m})]})}function V(e){return(0,k.jsx)(T.Provider,{init:void 0,children:(0,k.jsx)(B,{...e})})}export{C as i,A as n,V as r,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,H as t,I as n,k as r}from"./genui-
|
|
1
|
+
import{B as e,H as t,I as n,k as r}from"./genui-C9i6j0XZ.js";var i=`Other`;function a(e,t){let n=t.map(t=>r(e.metrics[t])),[i]=n;return n.every(e=>e.format===i?.format&&e.currency===i?.currency)}function o(e,t,r,i){let a=e.dimensions?.[t];return a?.kind===`time`?n(i,r.grain??a.grain??`month`):i}function s(e,t){let n=[];for(let r of e){let e=r.dimensions[t];e!==void 0&&!n.includes(e)&&n.push(e)}return n}function c(e,t,n){let r=e.dimensions?.[t]?.order;return[...n].sort((e,t)=>{let n=r?r.indexOf(e):-1,i=r?r.indexOf(t):-1;return n===i?e.localeCompare(t,`en`,{numeric:!0}):n===-1?1:i===-1?-1:n-i})}function l(e,t,n,r){let i=new Map;for(let r of e){let e=r.dimensions[t]??``;i.set(e,(i.get(e)??0)+Math.abs(r.values[n]??0))}let a=[...i.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>e);return new Set(a.length>r+1?a.slice(0,r):a)}function u(n,i,a,c){let l=s(a.rows,n.dimension);return{kind:n.chart,xOrder:l,xLabels:Object.fromEntries(l.map(e=>[e,o(i,n.dimension,a,e)])),format:r(i.metrics[c]),valueLabel:t(c,i.metrics[c]),dimensionLabel:e(n.dimension,i.dimensions?.[n.dimension])}}function d(e,t,n){let[r]=e.metrics;if(!r)return{ok:!1,message:`A chart needs a metric`};if(!a(t,[...e.metrics,...e.secondaryMetric?[e.secondaryMetric]:[]]))return{ok:!1,message:`These metrics use different units, and a chart has one axis. Show them in two charts.`};switch(e.chart){case`waterfall`:return m(e,t,n,r);case`composition`:return h(e,t,n,r);case`combo`:return p(e,t,n,r);default:return f(e,t,n)}}function f(e,n,r){let[a=``]=e.metrics;if(e.chart===`stacked-bar`&&!e.series&&e.metrics.length<2)return{ok:!1,message:`A stacked bar needs a series dimension or at least two metrics to stack`};if(e.series&&e.metrics.length>1)return{ok:!1,message:`Split by a series dimension with one metric, or list several metrics without a series`};let o=u(e,n,r,a),d=[],f=[];if(e.series){let t=e.series,u=l(r.rows,t,a,7),p=c(n,t,[...u]),m=s(r.rows,t).some(e=>!u.has(e));p.forEach((e,t)=>f.push({id:e,label:e,role:`series`,slot:t})),m&&f.push({id:i,label:i,role:`series`,slot:p.length});let h=new Map;for(let n of r.rows){let r=n.dimensions[e.dimension],o=n.dimensions[t]??``,s=n.values[a];if(r===void 0||s==null)continue;let c=`${r}\u0001${u.has(o)?o:i}`;h.set(c,(h.get(c)??0)+s)}for(let[e,t]of h){let[n=``,r=``]=e.split(``);d.push({x:n,xLabel:o.xLabels[n]??n,series:r,value:t})}return{ok:!0,model:{...o,points:d,series:f}}}e.metrics.forEach((e,r)=>{f.push({id:e,label:t(e,n.metrics[e]),role:`series`,slot:r})}),r.comparison&&e.metrics.forEach(e=>{f.push({id:`${e}::compare`,label:`${t(e,n.metrics[e])} (${r.comparison?.label})`,role:`compare`,slot:null})});for(let t of r.rows){let n=t.dimensions[e.dimension];if(n!==void 0)for(let r of e.metrics){let e=t.values[r];e!=null&&d.push({x:n,xLabel:o.xLabels[n]??n,series:r,value:e});let i=t.compare?.[r];i!=null&&d.push({x:n,xLabel:o.xLabels[n]??n,series:`${r}::compare`,value:i})}}return{ok:!0,model:{...o,points:d,series:f}}}function p(e,n,r,i){if(!e.secondaryMetric)return{ok:!1,message:`A combo chart needs a secondaryMetric drawn as a line over the bars`};let a=e.secondaryMetric,o=u(e,n,r,i),s=[];for(let t of r.rows){let n=t.dimensions[e.dimension];if(n===void 0)continue;let r=t.values[i],c=t.values[a];r!=null&&s.push({x:n,xLabel:o.xLabels[n]??n,series:i,value:r}),c!=null&&s.push({x:n,xLabel:o.xLabels[n]??n,series:a,value:c})}return{ok:!0,model:{...o,points:s,series:[{id:i,label:t(i,n.metrics[i]),role:`series`,slot:0},{id:a,label:t(a,n.metrics[a]),role:`secondary`,slot:1}]}}}function m(e,t,n,r){if(e.series)return{ok:!1,message:`A waterfall shows one metric; drop the series dimension`};let i=u(e,t,n,r),a=[],o=0;for(let t of n.rows){let n=t.dimensions[e.dimension],s=t.values[r];if(n===void 0||s==null)continue;let c=o;o+=s,a.push({x:n,xLabel:i.xLabels[n]??n,series:s>=0?`increase`:`decrease`,value:s,start:c,end:o})}let s=e.totalLabel??`Total`;return a.push({x:s,xLabel:s,series:`total`,value:o,start:0,end:o}),{ok:!0,model:{...i,points:a,xOrder:[...a.map(e=>e.x)],xLabels:{...i.xLabels,[s]:s},series:[{id:`increase`,label:`Increase`,role:`increase`,slot:null},{id:`decrease`,label:`Decrease`,role:`decrease`,slot:null},{id:`total`,label:s,role:`total`,slot:null}]}}}function h(e,t,n,r){let a=u(e,t,n,r),o=n.rows.map(t=>({key:t.dimensions[e.dimension]??``,value:t.values[r]??0})).filter(e=>e.value!==0);if(o.some(e=>e.value<0))return{ok:!1,message:`A part-to-whole chart cannot show negative values; use a bar chart`};let s=[...o].sort((e,t)=>t.value-e.value),l=s.length>6?s.slice(0,5):s,d=s.slice(l.length).reduce((e,t)=>e+t.value,0),f=c(t,e.dimension,l.map(e=>e.key)),p=new Map(l.map(e=>[e.key,e.value])),m=f.map((e,t)=>({id:e,label:a.xLabels[e]??e,role:`series`,slot:t})),h=f.map(e=>({x:e,xLabel:a.xLabels[e]??e,series:e,value:p.get(e)??0}));return d>0&&(m.push({id:i,label:i,role:`series`,slot:f.length}),h.push({x:i,xLabel:i,series:i,value:d})),{ok:!0,model:{...a,points:h,series:m,xOrder:h.map(e=>e.x)}}}function g(e,t){if(!t||t.x===void 0)return null;let n=String(t.x);return!e.xOrder.includes(n)||e.kind===`waterfall`&&n===e.xOrder[e.xOrder.length-1]?null:{x:n,series:t.series===void 0?``:String(t.series)}}export{d as n,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./log-
|
|
1
|
+
import{d as e}from"./log-DnEvbp3E.js";import{t}from"./timer.adapter-C2RhP4d6.js";import{t as n}from"./runDetached-DfQXHAaY.js";var r={blow:`/chat-sounds/Blow.mp3`,bottle:`/chat-sounds/Bottle.mp3`,frog:`/chat-sounds/Frog.mp3`,funk:`/chat-sounds/Funk.mp3`,glass:`/chat-sounds/Glass.mp3`,ping:`/chat-sounds/Ping.mp3`,pop:`/chat-sounds/Pop.mp3`,purr:`/chat-sounds/Purr.mp3`,tink:`/chat-sounds/Tink.mp3`};function i(t=e){return t.getVisibilityState()!==`visible`||!t.hasFocus()}function a(e){let t=new Audio(r[e]);return t.preload=`auto`,t.play()}async function o(e,r,i=t){if(r<=0)return;let o=Array.from({length:r},(t,r)=>new Promise(t=>{i.setTimeout(()=>{n(`chat sound`,a(e).finally(()=>t()))},r*90)}));await Promise.all(o)}function s(t,n=e){return t===`never`?!1:t===`always`||i(n)}export{s as n,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e}from"./pendingActionsStore-CxhI19V9.js";var t={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};t.node;var n=e(t);export{n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-CxhI19V9.js";var t={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};t.node;var n=e(t),r={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};r.node;var i=e(r),a={writeText(e){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.writeText(e)},readText(){return typeof navigator>`u`||!navigator.clipboard?Promise.reject(Error(`Clipboard API not available`)):navigator.clipboard.readText()}};export{i as n,n as r,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./log-
|
|
1
|
+
import{c as e}from"./log-DnEvbp3E.js";var t=[];function n(e,t){return`${e}:${t}`}var r=e()(e=>({boardsByOwner:{},viewByBoard:{},pageSizeByBoard:{},setBoards:(t,n)=>e(e=>({boardsByOwner:{...e.boardsByOwner,[t]:n}})),setBoardView:(t,n)=>e(e=>({viewByBoard:{...e.viewByBoard,[t]:n}})),growPage:t=>e(e=>{let n=e.viewByBoard[t];if(n&&!Object.values(n.cursors).some(e=>e!==null))return e;let r=e.pageSizeByBoard[t]??30;return{pageSizeByBoard:{...e.pageSizeByBoard,[t]:r+30}}}),clearBoardView:t=>e(e=>{if(!(t in e.viewByBoard))return e;let n={...e.viewByBoard};delete n[t];let r={...e.pageSizeByBoard};return delete r[t],{viewByBoard:n,pageSizeByBoard:r}})}));function i(e){return n=>n.boardsByOwner[e]??t}function a(e){return t=>t.viewByBoard[e]??null}function o(e){return t=>t.pageSizeByBoard[e]??30}var s={"muted-icon":`bg-muted-icon`,info:`bg-info`,success:`bg-success`,warning:`bg-warning`,destructive:`bg-destructive`};function c(e,t){return t!==null&&e>t}export{a,o as i,c as n,i as o,n as r,r as s,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{l as r,u as i}from"./log-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{l as r,u as i}from"./log-DnEvbp3E.js";var a=e(t(),1),o=e(n(),1);function s(e,t){let n=(0,a.createContext)(null);function s({init:e,children:r}){let s=(0,a.useRef)(null);return s.current===null&&(s.current=i(t(e))),(0,o.jsx)(n.Provider,{value:s.current,children:r})}function c(){let t=(0,a.useContext)(n);if(t===null)throw Error(`${e}: useScopedStore must be used inside its Provider`);return t}function l(e){return r(c(),e)}return{Provider:s,useScopedStore:l,useScopedStoreApi:c}}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{f as r}from"./pendingActionsStore-CxhI19V9.js";import{C as i,v as a,w as o}from"./chatFocusPolicy-BbPjp28p.js";var s={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};s.node;var c=r(s),l=e(t(),1),u=e(n(),1),d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let t=e+`CollectionProvider`,[n,r]=i(t),[s,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=f(e=>{let{scope:t,children:n}=e,r=l.useRef(null),i=l.useRef(new Map).current;return(0,u.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);d.displayName=t;let p=e+`CollectionSlot`,m=a(p),h=l.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(p,n),a=o(t,i.collectionRef);return(0,u.jsx)(m,{ref:a,children:r})});h.displayName=p;let g=e+`CollectionItemSlot`,_=`data-radix-collection-item`,v=a(g),y=l.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=l.useRef(null),s=o(t,a),d=c(g,n);return l.useEffect(()=>(d.itemMap.set(a,{ref:a,...i}),()=>void d.itemMap.delete(a))),(0,u.jsx)(v,{[_]:``,ref:s,children:r})});y.displayName=g;function b(t){let n=c(e+`CollectionConsumer`,t);return l.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${_}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return f(b,`useCollection`),[{Provider:d,Slot:h,ItemSlot:y},b,r]}f(p,`createCollection`);var m=new WeakMap,h=class e extends Map{static{f(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],m.set(this,!0)}set(e,t){return m.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=v(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=g(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=g(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return g(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function g(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=_(e,t);return n===-1?void 0:e[n]}f(g,`at`);function _(e,t){let n=e.length,r=v(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}f(_,`toSafeIndex`);function v(e){return e!==e||e===0?0:Math.trunc(e)}f(v,`toSafeInteger`);function y(e){let t=e+`CollectionProvider`,[n,r]=i(t),[s,c]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new h,setItemMap:f(()=>void 0,`setItemMap`)}),d=f(({state:e,...t})=>e?(0,u.jsx)(m,{...t,state:e}):(0,u.jsx)(p,{...t}),`CollectionProvider`);d.displayName=t;let p=f(e=>{let t=T();return(0,u.jsx)(m,{...e,state:t})},`CollectionInit`);p.displayName=t+`Init`;let m=f(e=>{let{scope:t,children:n,state:r}=e,i=l.useRef(null),[a,c]=l.useState(null),d=o(i,c),[f,p]=r;return l.useEffect(()=>{if(!a)return;let e=C(()=>{});return e.observe(a,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[a]),(0,u.jsx)(s,{scope:t,itemMap:f,setItemMap:p,collectionRef:d,collectionRefObject:i,collectionElement:a,children:n})},`CollectionProviderImpl`);m.displayName=t+`Impl`;let g=e+`CollectionSlot`,_=a(g),v=l.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(g,n),a=o(t,i.collectionRef);return(0,u.jsx)(_,{ref:a,children:r})});v.displayName=g;let y=e+`CollectionItemSlot`,x=a(y),w=l.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=l.useRef(null),[s,d]=l.useState(null),f=o(t,a,d),{setItemMap:p}=c(y,n),m=l.useRef(i);b(m.current,i)||(m.current=i);let g=m.current;return l.useEffect(()=>{let e=g;return p(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(S):(t.set(s,{...e,element:s}),t.toSorted(S)):t),()=>{p(e=>!s||!e.has(s)?e:(e.delete(s),new h(e)))}},[s,g,p]),(0,u.jsx)(x,{"data-radix-collection-item":``,ref:f,children:r})});w.displayName=y;function T(){return l.useState(new h)}f(T,`useInitCollection`);function E(t){let{itemMap:n}=c(e+`CollectionConsumer`,t);return n}return f(E,`useCollection`),[{Provider:d,Slot:v,ItemSlot:w},{createCollectionScope:r,useCollection:E,useInitCollection:T}]}f(y,`createCollection`);function b(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}f(b,`shallowEqual`);function x(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}f(x,`isElementPreceding`);function S(e,t){return!e[1].element||!t[1].element?0:x(e[1].element,t[1].element)?-1:1}f(S,`sortByDocumentPosition`);function C(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}f(C,`getChildListObserver`);var w=Object.defineProperty,T=(e,t)=>w(e,`name`,{value:t,configurable:!0}),E=l.createContext(void 0);function D(e){let t=l.useContext(E);return e||t||`ltr`}T(D,`useDirection`);export{p as n,c as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{Q as r,X as i,Z as a,it as o,rn as s}from"./useAppGlobalState-DUa3pkCF.js";import{c,f as l}from"./pendingActionsStore-CxhI19V9.js";import{Bt as u,Ht as d,Ut as f}from"./lexicalToReact-CZvp9Pgz.js";import{p}from"./pushClient-CxnHu9h4.js";import{t as m}from"./createScopedStore-BrD5NHWx.js";import{S as ee,m as h}from"./useTheme-D9sKDPEm.js";import{n as g,r as _,t as v}from"./popover-Bc646hKn.js";var y={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};y.node;var b=l(y),x={name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]};x.node;var S=l(x),C={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};C.node;var w=l(C),T={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};T.node;var E=l(T),D={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};D.node;var O=l(D),k={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};k.node;var A=l(k),j={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};j.node;var M=l(j),N={name:`square-menu`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 8h10`,key:`1jw688`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h10`,key:`wp8him`}]],aliases:[`menu-square`]};N.node;var P=l(N),F={name:`square-minus`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],aliases:[`minus-square`]};F.node;var I=l(F);function L(e){let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(200,Math.max(60,Math.round(t))):60}var R=e(t(),1),z=m(`InputPopover`,()=>e=>({open:!1,setOpen:t=>e({open:t})}));function te(){return e=>({open:!1,query:``,setQuery:t=>e({query:t}),setPopoverOpen:t=>e(t?{open:!0}:{open:!1,query:``}),closeAndClearQuery:()=>e({open:!1,query:``})})}var B=m(`SearchableModelPopover`,te),V=e(n(),1);function H({className:e,...t}){return(0,V.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:c(`shrink-0`,e),...t,children:(0,V.jsx)(`path`,{d:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`})})}function U({className:e,...t}){return(0,V.jsx)(`svg`,{viewBox:`0 0 158.7128 157.296`,fill:`currentColor`,"aria-hidden":`true`,className:c(`shrink-0`,e),...t,children:(0,V.jsx)(`path`,{d:`M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z`})})}function ne({className:e,...t}){return(0,V.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:c(`shrink-0`,e),...t,children:[(0,V.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,V.jsx)(`path`,{d:`M6.3 6.3a8 8 0 1 0 11.4 11.4`}),(0,V.jsx)(`path`,{d:`M17.7 6.3a8 8 0 0 1 0 11.4`}),(0,V.jsx)(`path`,{d:`M2 12h4`}),(0,V.jsx)(`path`,{d:`M18 12h4`})]})}var W={claude:H,codex:U,openrouter:ne};function G({onClick:e,selected:t,icon:n,label:r,description:i,disabled:a}){return(0,V.jsxs)(`button`,{onClick:e,disabled:a,className:c(`w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity`,t?`bg-muted border-border`:`hover:opacity-60`,a&&`opacity-40 cursor-not-allowed`),children:[n,(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-sm font-medium`,children:r}),i?(0,V.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:i}):null]})]})}function K({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){return n?(0,V.jsx)(`button`,{disabled:!0,className:c(`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,t),children:e}):(0,V.jsx)(z.Provider,{init:void 0,children:(0,V.jsx)(q,{trigger:e,triggerClassName:t,children:r})})}function q({trigger:e,triggerClassName:t,children:n}){let r=z.useScopedStore(e=>e.open),i=z.useScopedStore(e=>e.setOpen);return(0,V.jsxs)(v,{open:r,onOpenChange:i,children:[(0,V.jsx)(_,{asChild:!0,children:(0,V.jsx)(`button`,{type:`button`,className:c(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,t),children:e})}),(0,V.jsx)(g,{align:`center`,className:`w-64 p-1`,children:(0,V.jsx)(`div`,{className:`space-y-1`,children:typeof n==`function`?n(()=>i(!1)):n})})]})}function J({models:e,selectedModel:t,onSelect:n,ModelIcon:r}){return(0,V.jsx)(B.Provider,{init:void 0,children:(0,V.jsx)(Y,{models:e,selectedModel:t,onSelect:n,ModelIcon:r})})}function Y({models:e,selectedModel:t,onSelect:n,ModelIcon:r}){let i=B.useScopedStore(e=>e.open),a=B.useScopedStore(e=>e.query),o=B.useScopedStore(e=>e.setPopoverOpen),s=B.useScopedStore(e=>e.setQuery),l=B.useScopedStore(e=>e.closeAndClearQuery),d=(0,R.useCallback)(e=>{n(e),l()},[n,l]),f=e.find(e=>e.id===t)?.label??t,p=(0,R.useMemo)(()=>{let t=a.trim().toLowerCase();return t?e.filter(e=>e.id.toLowerCase().includes(t)||e.label.toLowerCase().includes(t)):e},[e,a]),m;return m=e.length===0?(0,V.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`Loading models… verify OpenRouter API key in Settings.`}):p.length===0?(0,V.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground text-center`,children:`No matches`}):p.map(e=>(0,V.jsx)(G,{onClick:()=>d(e.id),selected:t===e.id,icon:(0,V.jsx)(S,{className:`h-4 w-4 text-muted-foreground`}),label:e.label,description:e.id},e.id)),(0,V.jsxs)(v,{open:i,onOpenChange:o,children:[(0,V.jsx)(_,{asChild:!0,children:(0,V.jsxs)(`button`,{type:`button`,className:c(`flex min-h-[36px] cursor-pointer touch-manipulation items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0 [&>span]:whitespace-nowrap`,`hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,V.jsx)(r,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{className:`max-w-[200px] truncate`,children:f})]})}),(0,V.jsxs)(g,{align:`center`,className:`w-80 p-1`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 border-b border-border/50`,children:[(0,V.jsx)(u,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,V.jsx)(`input`,{type:`text`,value:a,onChange:e=>s(e.target.value),placeholder:`Search models...`,autoFocus:!0,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,V.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-1`,children:m})]})]})}function X({availableProviders:e,selectedProvider:t,showProviderPicker:n=!0,showCodexCliRequirementHints:s=!1,model:l,modelOptions:u,onProviderChange:m,onModelChange:g,onModelOptionChange:_,planMode:v=!1,onPlanModeChange:y,includePlanMode:b=!0,className:x}){let C=ee(h),T=e.find(e=>e.id===t)??e[0],E=W[t],D=S,k=b&&T?.supportsPlanMode&&y,j=t===`claude`&&`contextWindow`in u?u:null,M=t===`codex`&&`fastMode`in u?u:null,N=T.models.find(e=>e.id===l)?.contextWindowOptions??[],F=j?.contextWindow??i[0].id,L=F===`1m`?P:I,R=T.models.find(e=>e.id===l)?.label??l,z=t===`openrouter`?(0,V.jsx)(J,{models:T.models,selectedModel:l,onSelect:e=>g?.(t,e),ModelIcon:D}):(0,V.jsx)(K,{trigger:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(D,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{children:R})]}),children:e=>T.models.map(n=>{let r=S;return(0,V.jsx)(G,{onClick:()=>{g?.(t,n.id),e()},selected:l===n.id,icon:(0,V.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}),label:s&&t===`codex`&&n.id===`gpt-5.5`?(0,V.jsxs)(V.Fragment,{children:[n.label,` `,(0,V.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:`codex-cli >= 0.124`})]}):n.label},n.id)})});return(0,V.jsxs)(`div`,{className:c(`flex md:justify-center items-center gap-0.5`,x),children:[n?(0,V.jsx)(K,{disabled:!m,trigger:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{children:T?.label??t})]}),children:n=>e.map(e=>{let r=W[e.id];return(0,V.jsx)(G,{onClick:()=>{m?.(e.id),n()},selected:t===e.id,icon:(0,V.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}),label:e.label},e.id)})}):null,g==null?(0,V.jsx)(p,{label:`Model is locked while a cron job is running — pause or remove the cron job to change it`,side:`top`,children:(0,V.jsxs)(`span`,{"aria-disabled":`true`,className:`flex min-h-[36px] items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default [&>span]:whitespace-nowrap`,children:[(0,V.jsx)(A,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{children:R})]})}):z,t===`openrouter`?null:(0,V.jsx)(K,{trigger:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{children:t===`claude`?a.find(e=>e.id===u.reasoningEffort)?.label??u.reasoningEffort:r.find(e=>e.id===u.reasoningEffort)?.label??u.reasoningEffort})]}),children:e=>t===`claude`?o(l,C).map(t=>(0,V.jsx)(G,{onClick:()=>{_({type:`claudeReasoningEffort`,effort:t.id}),e()},selected:u.reasoningEffort===t.id,icon:(0,V.jsx)(f,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id)):r.map(t=>(0,V.jsx)(G,{onClick:()=>{_({type:`codexReasoningEffort`,effort:t.id}),e()},selected:u.reasoningEffort===t.id,icon:(0,V.jsx)(f,{className:`h-4 w-4 text-muted-foreground`}),label:t.label},t.id))}),t===`claude`&&N.length>1?(0,V.jsx)(K,{trigger:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(L,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{children:N.find(e=>e.id===F)?.label??F})]}),children:e=>N.map(t=>(0,V.jsx)(G,{onClick:()=>{_({type:`contextWindow`,contextWindow:t.id}),e()},selected:F===t.id,icon:t.id===`1m`?(0,V.jsx)(P,{className:`h-4 w-4 text-muted-foreground`}):(0,V.jsx)(I,{className:`h-4 w-4 text-muted-foreground`}),label:t.label,description:t.id===`1m`?`Expanded context window`:`Standard context window`},t.id))}):null,t===`codex`?(0,V.jsx)(K,{trigger:(0,V.jsxs)(V.Fragment,{children:[M?.fastMode?(0,V.jsx)(w,{className:`h-3.5 w-3.5`}):(0,V.jsx)(w,{className:`h-3.5 w-3.5 -scale-x-100`}),(0,V.jsx)(`span`,{children:M?.fastMode?`Fast Mode`:`Standard`})]}),triggerClassName:M?.fastMode?`text-success-text`:void 0,children:e=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(G,{onClick:()=>{_({type:`fastMode`,fastMode:!1}),e()},selected:!M?.fastMode,icon:(0,V.jsx)(w,{className:`h-4 w-4 text-muted-foreground -scale-x-100`}),label:`Standard`}),(0,V.jsx)(G,{onClick:()=>{_({type:`fastMode`,fastMode:!0}),e()},selected:!!M?.fastMode,icon:(0,V.jsx)(w,{className:`h-4 w-4 text-muted-foreground`}),label:`Fast Mode`})]})}):null,k?(0,V.jsx)(K,{trigger:(0,V.jsxs)(V.Fragment,{children:[v?(0,V.jsx)(d,{className:`h-3.5 w-3.5`}):(0,V.jsx)(O,{className:`h-3.5 w-3.5`}),(0,V.jsx)(`span`,{children:v?`Plan Mode`:`Full Access`})]}),triggerClassName:v?`text-info-text`:void 0,children:e=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(G,{onClick:()=>{y(!1),e()},selected:!v,icon:(0,V.jsx)(O,{className:`h-4 w-4 text-muted-foreground`}),label:`Full Access`,description:`Execution without approval`}),(0,V.jsx)(G,{onClick:()=>{y(!0),e()},selected:v,icon:(0,V.jsx)(d,{className:`h-4 w-4 text-muted-foreground`}),label:`Plan Mode`,description:`Review a plan before execution`})]})}):null]})}var re=[{value:`cursor`,label:`Cursor`},{value:`xcode`,label:`Xcode`},{value:`windsurf`,label:`Windsurf`},{value:`custom`,label:`Custom`}],Z={cursor:`/editor-icons/cursor.png`,defaultApp:`/editor-icons/default-app.png`,finder:`/editor-icons/finder.png`,preview:`/editor-icons/preview.png`,xcode:`/editor-icons/xcode.png`,terminal:`/editor-icons/terminal.png`,windsurf:`/editor-icons/windsurf.png`,custom:`/editor-icons/custom.png`};function Q({src:e,className:t}){return(0,V.jsx)(`img`,{src:e,alt:``,"aria-hidden":`true`,draggable:!1,className:t})}function $({preset:e,className:t}){switch(e){case`xcode`:return(0,V.jsx)(Q,{src:Z.xcode,className:t});case`windsurf`:return(0,V.jsx)(Q,{src:Z.windsurf,className:t});case`custom`:return(0,V.jsx)(Q,{src:Z.custom,className:t});default:return(0,V.jsx)(Q,{src:Z.cursor,className:t})}}function ie({className:e}){return(0,V.jsx)(Q,{src:Z.finder,className:e})}function ae({className:e}){return(0,V.jsx)(Q,{src:Z.preview,className:e})}function oe({className:e}){return(0,V.jsx)(Q,{src:Z.defaultApp,className:e})}function se({className:e}){return(0,V.jsx)(s,{className:e})}function ce({className:e}){return(0,V.jsx)(Q,{src:Z.terminal,className:e})}export{se as a,X as c,A as d,E as f,ie as i,L as l,re as n,ae as o,b as p,$ as r,ce as s,oe as t,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e}from"./pendingActionsStore-
|
|
1
|
+
import{f as e}from"./pendingActionsStore-CxhI19V9.js";var t={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};t.node;var n=e(t);export{n as t};
|