arco-workbench 0.2.2 → 0.2.5
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/CONTRIBUTING.md +1 -1
- package/THIRD_PARTY_NOTICES +2 -2
- package/client/dist/assets/{PhosphorBackdrop-BbR3xmfD.js → PhosphorBackdrop-CLILIwOQ.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-UMjbs9ZN.js → ThemedBackgroundShaderImpl-B87chcb5.js} +1 -1
- package/client/dist/assets/{XtermView-n135qz-f.js → XtermView-BP_j7WSN.js} +1 -1
- package/client/dist/assets/{galleryEditor-CFSke4by.js → galleryEditor-B90phoBI.js} +1 -1
- package/client/dist/assets/{index-DeoJbjI3.js → index-BfPp1Oup.js} +270 -270
- package/client/dist/index.html +1 -1
- package/client/dist/manifest-mobile.webmanifest +1 -0
- package/client/src/App.tsx +2 -2
- package/client/src/components/AuthReloginNotice.tsx +7 -6
- package/client/src/components/ChatMessage.tsx +41 -29
- package/client/src/components/ChatPanel.tsx +17 -4
- package/client/src/components/ClaudeNativeAccountPicker.tsx +32 -0
- package/client/src/components/ClaudeNativeAuthRow.tsx +71 -19
- package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +11 -281
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +1 -1
- package/client/src/components/ClusterRightPanel/FreshMemberForm.tsx +315 -0
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +17 -7
- package/client/src/components/ClusterRightPanel/index.tsx +1 -1
- package/client/src/components/ClusterRightPanel/useFreshMemberPicker.ts +6 -4
- package/client/src/components/ClusterTab.tsx +2 -2
- package/client/src/components/Connections/Connections.tsx +7 -11
- package/client/src/components/Connections/model.ts +3 -1
- package/client/src/components/FileViewerModal.tsx +54 -17
- package/client/src/components/GitHubPanel/index.tsx +9 -5
- package/client/src/components/HandoffDialog.tsx +5 -3
- package/client/src/components/MobileShell.tsx +1 -33
- package/client/src/components/OperatorQuestionNotice.tsx +5 -4
- package/client/src/components/ProvidersPopover.tsx +6 -2
- package/client/src/components/RightPanel/ActivityTab.tsx +2 -1
- package/client/src/components/RightPanel/ConfigTab.tsx +23 -5
- package/client/src/components/RightPanel/OutputsPanel.tsx +21 -9
- package/client/src/components/RightPanel/outputsReconcile.ts +31 -0
- package/client/src/components/SettingsPanel.tsx +7 -10
- package/client/src/components/SpawnDialog.tsx +14 -3
- package/client/src/components/TabBar.tsx +2 -2
- package/client/src/components/TabContextMenu.tsx +73 -133
- package/client/src/components/TerminalInput.tsx +4 -3
- package/client/src/components/TranscriptWorkerDialog.tsx +14 -4
- package/client/src/components/UsageBar.tsx +37 -18
- package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +29 -3
- package/client/src/components/WorkflowCreator/index.tsx +29 -15
- package/client/src/components/WorkflowView.tsx +1 -1
- package/client/src/components/providerIndicator.ts +7 -3
- package/client/src/components/research/QuickResearchOverview.tsx +7 -3
- package/client/src/components/research/SavedQuickKeep.tsx +7 -3
- package/client/src/components/settings/GitHubAuthRow.tsx +34 -0
- package/client/src/explorer/ArtifactsLens.tsx +17 -8
- package/client/src/explorer/ExplorerApp.tsx +3 -3
- package/client/src/explorer/types.ts +3 -1
- package/client/src/help/content/cluster.tsx +10 -4
- package/client/src/help/content/composer.tsx +3 -2
- package/client/src/help/content/header.tsx +6 -3
- package/client/src/help/content/misc.tsx +9 -7
- package/client/src/help/content/rightPanel.tsx +11 -6
- package/client/src/help/content/settings.tsx +14 -3
- package/client/src/help/content/tabbar.tsx +1 -1
- package/client/src/help/manualSections/actions.tsx +5 -1
- package/client/src/help/manualSections/clusters.tsx +21 -15
- package/client/src/help/manualSections/configuration.tsx +6 -4
- package/client/src/help/manualSections/gettingStarted.tsx +4 -2
- package/client/src/help/manualSections/maintenance.tsx +24 -0
- package/client/src/help/manualSections/powerFeatures.tsx +4 -2
- package/client/src/help/manualSections/providers.tsx +11 -4
- package/client/src/help/manualSections/workspace.tsx +3 -3
- package/client/src/hooks/useClaudeNativeCatalog.ts +26 -0
- package/client/src/hooks/useClaudeNativeLogin.ts +16 -11
- package/client/src/hooks/useWebSocket.ts +4 -2
- package/client/src/layout/layoutRange.ts +14 -5
- package/client/src/main.tsx +2 -0
- package/client/src/questions/waitingQuestion.ts +2 -0
- package/client/src/stores/appStore.ts +5 -1
- package/client/src/stores/appStore.types.ts +2 -0
- package/client/src/stores/replayContext.ts +20 -0
- package/client/src/utils/chatFileLinks.ts +34 -3
- package/client/src/utils/claudeAuth.ts +9 -1
- package/client/src/ws/handleServerMessage.ts +11 -3
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/BACKUP.md +1 -1
- package/docs/CHECKPOINTS.md +67 -3
- package/docs/CLIENT.md +11 -6
- package/docs/EXTENDING.md +1 -1
- package/docs/FEATURES.md +3 -3
- package/docs/GETTING_STARTED.md +5 -4
- package/docs/GIT_WORKBENCH.md +8 -0
- package/docs/GLOSSARY.md +2 -2
- package/docs/GOTCHAS.md +4 -4
- package/docs/HTTP_API.md +63 -30
- package/docs/OPERATIONS.md +11 -0
- package/docs/OPERATOR_ACTIONS.md +2 -2
- package/docs/OUTPUTS.md +48 -6
- package/docs/PERSISTENCE.md +1 -1
- package/docs/PRIMITIVES.md +4 -2
- package/docs/PROTOCOL_CLUSTER.md +12 -6
- package/docs/PROTOCOL_PRIMITIVES.md +1 -1
- package/docs/PROVIDERS.md +47 -10
- package/docs/RESEARCH.md +3 -3
- package/docs/SETTINGS.md +9 -4
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +15 -3
- package/node_modules/@arco/shared/dist/protocol/clusters.js +1 -1
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -1
- package/node_modules/@arco/shared/dist/protocol/operatorQuestions.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/settings.d.ts +3 -0
- package/node_modules/@arco/shared/dist/protocol/settings.js +5 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.js +0 -2
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +2 -2
- package/scripts/packaging/services.mjs +20 -1
- package/scripts/packaging/update.mjs +37 -2
- package/server/dist/attention.d.ts +6 -0
- package/server/dist/attention.js +6 -0
- package/server/dist/auth.d.ts +5 -0
- package/server/dist/auth.js +31 -20
- package/server/dist/clusterAutoTurn.d.ts +5 -1
- package/server/dist/clusterAutoTurn.js +31 -9
- package/server/dist/clusterPresets.js +3 -3
- package/server/dist/effortValidation.d.ts +2 -2
- package/server/dist/effortValidation.js +4 -4
- package/server/dist/explorerArtifacts.d.ts +1 -0
- package/server/dist/explorerArtifacts.js +12 -1
- package/server/dist/explorerDocs.d.ts +1 -0
- package/server/dist/explorerDocs.js +4 -4
- package/server/dist/geminiMembers.d.ts +7 -1
- package/server/dist/geminiMembers.js +28 -14
- package/server/dist/gitSnapshots.d.ts +1 -0
- package/server/dist/gitSnapshots.js +547 -83
- package/server/dist/http/clusterRoutes.js +9 -3
- package/server/dist/http/conversationFiles.d.ts +36 -0
- package/server/dist/http/conversationFiles.js +222 -0
- package/server/dist/http/fileBytes.d.ts +3 -0
- package/server/dist/http/fileBytes.js +33 -0
- package/server/dist/http/fileContentRoute.d.ts +2 -0
- package/server/dist/http/fileContentRoute.js +139 -0
- package/server/dist/http/fileRead.d.ts +54 -2
- package/server/dist/http/fileRead.js +31 -24
- package/server/dist/http/outputRoutes.js +14 -21
- package/server/dist/http/readConfinement.d.ts +0 -11
- package/server/dist/http/readConfinement.js +4 -30
- package/server/dist/http/router.js +41 -66
- package/server/dist/index.js +26 -12
- package/server/dist/management/initHubLink.js +1 -1
- package/server/dist/outputs.js +8 -0
- package/server/dist/primitives/exportContext.d.ts +2 -0
- package/server/dist/primitives/exportContext.js +13 -2
- package/server/dist/primitives/runCompare.d.ts +7 -1
- package/server/dist/primitives/runCompare.js +44 -20
- package/server/dist/project/taskLedger.js +46 -34
- package/server/dist/providerAccounts.d.ts +4 -0
- package/server/dist/providerAccounts.js +20 -1
- package/server/dist/providers/antigravity/artifacts.d.ts +23 -0
- package/server/dist/providers/antigravity/artifacts.js +140 -0
- package/server/dist/providers/antigravity/index.js +85 -7
- package/server/dist/providers/antigravity/questions.d.ts +2 -0
- package/server/dist/providers/antigravity/questions.js +58 -0
- package/server/dist/providers/claude-native/auth.d.ts +9 -8
- package/server/dist/providers/claude-native/auth.js +50 -58
- package/server/dist/providers/claude-native/authStatus.d.ts +2 -2
- package/server/dist/providers/claude-native/authStatus.js +9 -7
- package/server/dist/providers/claude-native/catalog.d.ts +6 -5
- package/server/dist/providers/claude-native/catalog.js +50 -39
- package/server/dist/providers/claude-native/oauth.d.ts +10 -9
- package/server/dist/providers/claude-native/oauth.js +120 -96
- package/server/dist/providers/claude-native/worker.d.ts +1 -0
- package/server/dist/providers/claude-native/worker.js +38 -23
- package/server/dist/providers/codex-appserver/operatorQuestions.d.ts +5 -3
- package/server/dist/providers/codex-appserver/operatorQuestions.js +27 -13
- package/server/dist/providers/codexChatBoundary.js +6 -1
- package/server/dist/research/quickPromotion.d.ts +3 -0
- package/server/dist/research/quickPromotion.js +26 -9
- package/server/dist/research/savedQuickPromotion.js +2 -11
- package/server/dist/server/broadcast.js +6 -0
- package/server/dist/settings.d.ts +1 -0
- package/server/dist/settings.js +39 -7
- package/server/dist/skills.js +1 -1
- package/server/dist/smartPickupAdapters.d.ts +1 -0
- package/server/dist/smartPickupAdapters.js +2 -2
- package/server/dist/smartPickupObserver.js +8 -5
- package/server/dist/thirdPartySkills.js +11 -5
- package/server/dist/turnChanges.d.ts +1 -1
- package/server/dist/turnChanges.js +5 -4
- package/server/dist/usage.d.ts +1 -1
- package/server/dist/usage.js +39 -27
- package/server/dist/workers/WorkerManager.d.ts +1 -0
- package/server/dist/workers/WorkerManager.js +1 -0
- package/server/dist/workers/processKill.js +37 -24
- package/server/dist/workflowMeta.js +2 -2
- package/server/dist/ws/clusterHandlers.d.ts +2 -2
- package/server/dist/ws/clusterHandlers.js +127 -113
- package/server/dist/ws/clusterMembers.d.ts +1 -1
- package/server/dist/ws/clusterMembers.js +34 -4
- package/server/dist/ws/compactHandlers.js +30 -14
- package/server/dist/ws/compareHandlers.js +53 -21
- package/server/dist/ws/gateHandlers.js +2 -0
- package/server/dist/ws/genesisHandlers.js +5 -3
- package/server/dist/ws/handoffHandlers.d.ts +1 -1
- package/server/dist/ws/handoffHandlers.js +115 -39
- package/server/dist/ws/transcriptWorkerHandlers.js +7 -2
- package/server/dist/ws/turnEngine.js +37 -19
- package/server/dist/ws/updatePrimaryConfig.d.ts +3 -2
- package/server/dist/ws/updatePrimaryConfig.js +236 -133
- package/server/dist/ws/workflowHandlers.js +21 -4
- package/server/package.json +1 -1
- package/server/src/attention.ts +7 -0
- package/server/src/auth.ts +33 -20
- package/server/src/clusterAutoTurn.ts +31 -11
- package/server/src/clusterPresets.ts +2 -2
- package/server/src/effortValidation.ts +4 -4
- package/server/src/explorerArtifacts.ts +12 -1
- package/server/src/explorerDocs.ts +5 -5
- package/server/src/geminiMembers.ts +26 -15
- package/server/src/gitSnapshots.ts +538 -82
- package/server/src/http/clusterRoutes.ts +10 -3
- package/server/src/http/conversationFiles.ts +231 -0
- package/server/src/http/fileBytes.ts +34 -0
- package/server/src/http/fileContentRoute.ts +123 -0
- package/server/src/http/fileRead.ts +30 -25
- package/server/src/http/outputRoutes.ts +13 -13
- package/server/src/http/readConfinement.ts +3 -30
- package/server/src/http/router.ts +39 -62
- package/server/src/index.ts +27 -18
- package/server/src/management/initHubLink.ts +1 -1
- package/server/src/outputs.ts +8 -0
- package/server/src/primitives/exportContext.ts +14 -2
- package/server/src/primitives/runCompare.ts +73 -46
- package/server/src/project/taskLedger.ts +47 -30
- package/server/src/providerAccounts.ts +20 -1
- package/server/src/providers/antigravity/artifacts.ts +121 -0
- package/server/src/providers/antigravity/index.ts +64 -6
- package/server/src/providers/antigravity/questions.ts +52 -0
- package/server/src/providers/claude-native/auth.ts +45 -60
- package/server/src/providers/claude-native/authStatus.ts +9 -8
- package/server/src/providers/claude-native/catalog.ts +52 -35
- package/server/src/providers/claude-native/oauth.ts +101 -77
- package/server/src/providers/claude-native/worker.ts +38 -22
- package/server/src/providers/codex-appserver/operatorQuestions.ts +26 -12
- package/server/src/providers/codexChatBoundary.ts +6 -1
- package/server/src/research/quickPromotion.ts +24 -6
- package/server/src/research/savedQuickPromotion.ts +2 -8
- package/server/src/server/broadcast.ts +4 -0
- package/server/src/settings.ts +36 -8
- package/server/src/skills.ts +1 -1
- package/server/src/smartPickupAdapters.ts +3 -2
- package/server/src/smartPickupObserver.ts +8 -5
- package/server/src/thirdPartySkills.ts +11 -5
- package/server/src/turnChanges.ts +5 -4
- package/server/src/usage.ts +30 -22
- package/server/src/workers/WorkerManager.ts +2 -0
- package/server/src/workers/processKill.ts +37 -23
- package/server/src/workflowMeta.ts +2 -2
- package/server/src/ws/clusterHandlers.ts +107 -104
- package/server/src/ws/clusterMembers.ts +25 -6
- package/server/src/ws/compactHandlers.ts +29 -15
- package/server/src/ws/compareHandlers.ts +59 -25
- package/server/src/ws/gateHandlers.ts +2 -0
- package/server/src/ws/genesisHandlers.ts +5 -4
- package/server/src/ws/handoffHandlers.ts +105 -37
- package/server/src/ws/transcriptWorkerHandlers.ts +6 -2
- package/server/src/ws/turnEngine.ts +36 -18
- package/server/src/ws/updatePrimaryConfig.ts +230 -132
- package/server/src/ws/workflowHandlers.ts +20 -4
- package/shared/dist/protocol/clusters.d.ts +15 -3
- package/shared/dist/protocol/clusters.js +1 -1
- package/shared/dist/protocol/models.d.ts +6 -1
- package/shared/dist/protocol/operatorQuestions.d.ts +2 -1
- package/shared/dist/protocol/settings.d.ts +3 -0
- package/shared/dist/protocol/settings.js +5 -0
- package/shared/dist/protocol/workflows.d.ts +1 -0
- package/shared/dist/protocol/workflows.js +0 -2
- package/shared/src/protocol/clusters.ts +23 -5
- package/shared/src/protocol/compare.ts +2 -2
- package/shared/src/protocol/models.ts +8 -4
- package/shared/src/protocol/operatorQuestions.ts +2 -1
- package/shared/src/protocol/settings.ts +8 -1
- package/shared/src/protocol/workflows.ts +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -370,7 +370,7 @@ Pull requests are welcome. Include a concise change summary, verification result
|
|
|
370
370
|
|
|
371
371
|
## DEVLOG
|
|
372
372
|
|
|
373
|
-
Significant changes get an entry in [`DEVLOG.md`](DEVLOG.md), a newest-first index of monthly archives under `devlog/YYYY-MM.md
|
|
373
|
+
Significant changes get an entry in [`DEVLOG.md`](DEVLOG.md), a newest-first index of monthly archives under `devlog/YYYY-MM.md`, labelled with the full English month and year. Add the entry to the current month's archive in the same commit as the change; a commit that changes several behaviors adds several entries. Each entry names the user-visible behavior, the controls, commands, scripts, settings or files it touches, what was checked and how, what failed, and what remains, in roughly 150 to 300 words. An entry that could describe any project is rejected.
|
|
374
374
|
|
|
375
375
|
## Local gate and hooks
|
|
376
376
|
|
package/THIRD_PARTY_NOTICES
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Skills from https://github.com/mattpocock/skills
|
|
2
|
-
Commit
|
|
2
|
+
Commit fe3b143d813e0d9f0b22531e4e4c5f239745d643
|
|
3
3
|
|
|
4
|
-
Bundled from that source: grill-me, grill-with-docs, wait-what, retro, grilling, domain-modeling, tdd, diagnosing-bugs, codebase-design, prototype, writing-for-agents. Architecture review is Arco's own built-in.
|
|
4
|
+
Bundled from that source: grill-me, grill-with-docs, wait-what, retro, code-review, grilling, domain-modeling, tdd, diagnosing-bugs, codebase-design, prototype, writing-for-agents. Architecture review is Arco's own built-in.
|
|
5
5
|
|
|
6
6
|
MIT License
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as F,j as d}from"./index-
|
|
1
|
+
import{r as F,j as d}from"./index-BfPp1Oup.js";const W=`// Adapted from the reference terminal crt.js, d52d430. No time-driven scan/band/hum.
|
|
2
2
|
|
|
3
3
|
precision highp float;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as De,r as Z,u as Le,j as oe,T as Re,e as xe}from"./index-
|
|
1
|
+
import{b as De,r as Z,u as Le,j as oe,T as Re,e as xe}from"./index-BfPp1Oup.js";var ge={exports:{}},Ce;function Ae(){return Ce||(Ce=1,(function(Q,se){(function(ee,X){Q.exports=X()})(globalThis,(()=>(()=>{var ee={4567:function(O,r,a){var l=this&&this.__decorate||function(e,t,o,_){var v,p=arguments.length,h=p<3?t:_===null?_=Object.getOwnPropertyDescriptor(t,o):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,t,o,_);else for(var m=e.length-1;m>=0;m--)(v=e[m])&&(h=(p<3?v(h):p>3?v(t,o,h):v(t,o))||h);return p>3&&h&&Object.defineProperty(t,o,h),h},u=this&&this.__param||function(e,t){return function(o,_){t(o,_,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(9924),f=a(844),g=a(4725),c=a(2585),i=a(3656);let s=r.AccessibilityManager=class extends f.Disposable{constructor(e,t,o,_){super(),this._terminal=e,this._coreBrowserService=o,this._renderService=_,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let v=0;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);if(this._topBoundaryFocusListener=v=>this._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((v=>this._handleResize(v.rows)))),this.register(this._terminal.onRender((v=>this._refreshRows(v.start,v.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((v=>this._handleChar(v)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
2
|
`)))),this.register(this._terminal.onA11yTab((v=>this._handleTab(v)))),this.register(this._terminal.onKey((v=>this._handleKey(v.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,i.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,f.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const o=this._terminal.buffer,_=o.lines.length.toString();for(let v=e;v<=t;v++){const p=o.lines.get(o.ydisp+v),h=[],m=(p==null?void 0:p.translateToString(!0,void 0,void 0,h))||"",y=(o.ydisp+v+1).toString(),k=this._rowElements[v];k&&(m.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=m,this._rowColumns.set(k,h)),k.setAttribute("aria-posinset",y),k.setAttribute("aria-setsize",_))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const o=e.target,_=this._rowElements[t===0?1:this._rowElements.length-2];if(o.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==_)return;let v,p;if(t===0?(v=o,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(v=this._rowElements.shift(),p=o,this._rowContainer.removeChild(v)),v.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{const h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var m;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},o={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(o.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===o.node&&t.offset>o.offset)&&([t,o]=[o,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const _=this._rowElements.slice(-1)[0];if(o.node.compareDocumentPosition(_)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(o={node:_,offset:((m=_.textContent)==null?void 0:m.length)??0}),!this._rowContainer.contains(o.node))return;const v=({node:y,offset:k})=>{const D=y instanceof Text?y.parentNode:y;let b=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(b))return console.warn("row is invalid. Race condition?"),null;const x=this._rowColumns.get(D);if(!x)return console.warn("columns is null. Race condition?"),null;let T=k<x.length?x[k]:x.slice(-1)[0]+1;return T>=this._terminal.cols&&(++b,T=0),{row:b,column:T}},p=v(t),h=v(o);if(p&&h){if(p.row>h.row||p.row===h.row&&p.column>=h.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(h.row-p.row)*this._terminal.cols-p.column+h.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=l([u(1,c.IInstantiationService),u(2,g.ICoreBrowserService),u(3,g.IRenderService)],s)},3614:(O,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function u(d,f,g,c){d=l(d=a(d),g.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),f.value=""}function n(d,f,g){const c=g.getBoundingClientRect(),i=d.clientX-c.left-10,s=d.clientY-c.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${i}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=l,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,g,c){d.stopPropagation(),d.clipboardData&&u(d.clipboardData.getData("text/plain"),f,g,c)},r.paste=u,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,g,c,i){n(d,f,g),i&&c.rightClickSelect(d),f.value=c.selectionText,f.select()}},7239:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=a(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(u,n,d){this._css.set(u,n,d)}getCss(u,n){return this._css.get(u,n)}setColor(u,n,d){this._color.set(u,n,d)}getColor(u,n){return this._color.get(u,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,l,u,n){a.addEventListener(l,u,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,u,n))}}}},3551:function(O,r,a){var l=this&&this.__decorate||function(s,e,t,o){var _,v=arguments.length,p=v<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,o);else for(var h=s.length-1;h>=0;h--)(_=s[h])&&(p=(v<3?_(p):v>3?_(e,t,p):_(e,t))||p);return v>3&&p&&Object.defineProperty(e,t,p),p},u=this&&this.__param||function(s,e){return function(t,o){e(t,o,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const n=a(3656),d=a(8460),f=a(844),g=a(2585),c=a(4725);let i=r.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,o,_){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=o,this._linkProviderService=_,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{var v;this._lastMouseEvent=void 0,(v=this._activeProviderReplies)==null||v.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let o=0;o<t.length;o++){const _=t[o];if(_.classList.contains("xterm"))break;if(_.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var o,_;this._activeProviderReplies&&e||((o=this._activeProviderReplies)==null||o.forEach((v=>{v==null||v.forEach((p=>{p.link.dispose&&p.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[v,p]of this._linkProviderService.linkProviders.entries())e?(_=this._activeProviderReplies)!=null&&_.get(v)&&(t=this._checkLinkProviderResult(v,s,t)):p.provideLinks(s.y,(h=>{var y,k;if(this._isMouseOut)return;const m=h==null?void 0:h.map((D=>({link:D})));(y=this._activeProviderReplies)==null||y.set(v,m),t=this._checkLinkProviderResult(v,s,t),((k=this._activeProviderReplies)==null?void 0:k.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let o=0;o<e.size;o++){const _=e.get(o);if(_)for(let v=0;v<_.length;v++){const p=_[v],h=p.link.range.start.y<s?0:p.link.range.start.x,m=p.link.range.end.y>s?this._bufferService.cols:p.link.range.end.x;for(let y=h;y<=m;y++){if(t.has(y)){_.splice(v--,1);break}t.add(y)}}}}_checkLinkProviderResult(s,e,t){var v;if(!this._activeProviderReplies)return t;const o=this._activeProviderReplies.get(s);let _=!1;for(let p=0;p<s;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(_=!0);if(!_&&o){const p=o.find((h=>this._linkAtPosition(h.link,e)));p&&(t=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let p=0;p<this._activeProviderReplies.size;p++){const h=(v=this._activeProviderReplies.get(p))==null?void 0:v.find((m=>this._linkAtPosition(m.link,e)));if(h){t=!0,this._handleNewLink(h);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,o;return(o=(t=this._currentLink)==null?void 0:t.state)==null?void 0:o.decorations.pointerCursor},set:t=>{var o;(o=this._currentLink)!=null&&o.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,o;return(o=(t=this._currentLink)==null?void 0:t.state)==null?void 0:o.decorations.underline},set:t=>{var o,_,v;(o=this._currentLink)!=null&&o.state&&((v=(_=this._currentLink)==null?void 0:_.state)==null?void 0:v.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const o=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,_=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=_&&(this._clearCurrentLink(o,_),this._lastMouseEvent)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}}))))}_linkHover(s,e,t){var o;(o=this._currentLink)!=null&&o.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,o=this._bufferService.buffer.ydisp,_=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-o-1,t.end.x,t.end.y-o-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(_)}_linkLeave(s,e,t){var o;(o=this._currentLink)!=null&&o.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,o=s.range.end.y*this._bufferService.cols+s.range.end.x,_=e.y*this._bufferService.cols+e.x;return t<=_&&_<=o}_positionFromMouseEvent(s,e,t){const o=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(o)return{x:o[0],y:o[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,o,_){return{x1:s,y1:e,x2:t,y2:o,cols:this._bufferService.cols,fg:_}}};r.Linkifier=i=l([u(1,c.IMouseService),u(2,c.IRenderService),u(3,g.IBufferService),u(4,c.ILinkProviderService)],i)},9042:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,r,a){var l=this&&this.__decorate||function(c,i,s,e){var t,o=arguments.length,_=o<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(c,i,s,e);else for(var v=c.length-1;v>=0;v--)(t=c[v])&&(_=(o<3?t(_):o>3?t(i,s,_):t(i,s))||_);return o>3&&_&&Object.defineProperty(i,s,_),_},u=this&&this.__param||function(c,i){return function(s,e){i(s,e,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=r.OscLinkProvider=class{constructor(c,i,s){this._bufferService=c,this._optionsService=i,this._oscLinkService=s}provideLinks(c,i){var m;const s=this._bufferService.buffer.lines.get(c-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,o=new n.CellData,_=s.getTrimmedLength();let v=-1,p=-1,h=!1;for(let y=0;y<_;y++)if(p!==-1||s.hasContent(y)){if(s.loadCell(y,o),o.hasExtendedAttrs()&&o.extended.urlId){if(p===-1){p=y,v=o.extended.urlId;continue}h=o.extended.urlId!==v}else p!==-1&&(h=!0);if(h||p!==-1&&y===_-1){const k=(m=this._oscLinkService.getLinkData(v))==null?void 0:m.uri;if(k){const D={start:{x:p+1,y:c},end:{x:y+(h||y!==_-1?0:1),y:c}};let b=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const x=new URL(k);["http:","https:"].includes(x.protocol)||(b=!0)}catch{b=!0}b||e.push({text:k,range:D,activate:(x,T)=>t?t.activate(x,T,D):g(0,T),hover:(x,T)=>{var I;return(I=t==null?void 0:t.hover)==null?void 0:I.call(t,x,T,D)},leave:(x,T)=>{var I;return(I=t==null?void 0:t.leave)==null?void 0:I.call(t,x,T,D)}})}h=!1,o.hasExtendedAttrs()&&o.extended.urlId?(p=y,v=o.extended.urlId):(p=-1,v=-1)}}i(e)}};function g(c,i){if(confirm(`Do you want to navigate to ${i}?
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as F,l as Z,c as ie,d as cn,r as dn,W as un}from"./index-DeoJbjI3.js";function gn(){let t=document.getElementById("ge-vendor-toast-host");return t||(t=document.createElement("div"),t.id="ge-vendor-toast-host",t.style.cssText="position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:2147483000;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;",document.body.appendChild(t)),t}function Tt(t,{error:n=!1,duration:s=2600}={}){if(typeof document>"u"||!t)return;const o=gn(),r=document.createElement("div");r.textContent=String(t),r.style.cssText=`pointer-events:auto;max-width:480px;padding:8px 14px;border-radius:4px;font-family:var(--font-body,system-ui);font-size:13px;line-height:1.4;box-shadow:0 4px 18px rgba(0,0,0,0.45);opacity:0;transition:opacity .15s;background:var(--color-bg-elevated,#1a1a1a);color:${n?"var(--color-danger,#e06c75)":"var(--color-fg,#9cdef2)"};border:1px solid ${n?"var(--color-danger,#e06c75)":"var(--color-border-bright,#355a66)"};`,o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1"}),setTimeout(()=>{r.style.opacity="0",setTimeout(()=>r.remove(),200)},typeof s=="number"?s:2600)}function pn(t,n){Tt(t,typeof n=="number"?{duration:n}:n||{})}function mn(t){Tt(t,{error:!0,duration:5e3})}function hn(t){return typeof window>"u"||typeof window.confirm!="function"?Promise.resolve(!0):Promise.resolve(window.confirm(String(t)))}function fn(t,{defaultValue:n=""}={}){return typeof window>"u"||typeof window.prompt!="function"?Promise.resolve(null):Promise.resolve(window.prompt(String(t),n))}const W={showToast:pn,showError:mn,styledConfirm:hn,styledPrompt:fn},yn={getJSON(t,n=null){try{const s=localStorage.getItem(t);return s==null?n:JSON.parse(s)}catch{return n}},setJSON(t,n){try{localStorage.setItem(t,JSON.stringify(n))}catch{}},remove(t){try{localStorage.removeItem(t)}catch{}}},Be=new Map;function vn(t,n,s={}){const o=document.getElementById(t);if(!o){console.warn("[DragSort] container not found:",t);return}const r=s.instanceKey||t;Be.has(r)&&(Be.get(r).cleanup(),Be.delete(r));const i={onReorder:s.onReorder||null,handleSelector:s.handleSelector||null,excludeSelector:s.excludeSelector||null,storageKey:s.storageKey||null};let l=null,a=null,c=0,d=[];function u(){let C=Array.from(o.querySelectorAll(n));return i.excludeSelector&&(C=C.filter(M=>!M.matches(i.excludeSelector))),C}function g(C){const M=document.createElement("div");return M.className="drag-placeholder",M.style.height=C+"px",M.style.margin="4px 0",M}function m(C,M){const T=M.getBoundingClientRect(),B=o.getBoundingClientRect(),I=(T.top-B.top)/F()+o.scrollTop,_=(T.left-B.left)/F();c=C-T.top,d=u(),l=M,getComputedStyle(o).position==="static"&&(o.style.position="relative"),a=g(T.height/F()),M.parentNode.insertBefore(a,M),M.classList.add("dragging"),Object.assign(M.style,{position:"absolute",width:T.width/F()+"px",left:_+"px",top:I+"px",zIndex:"9999",pointerEvents:"none",margin:"0",boxSizing:"border-box",transition:"none"})}function w(C){if(!l)return;const M=o.getBoundingClientRect(),T=(C-c-M.top)/F()+o.scrollTop;l.style.top=T+"px";const B=d.filter(O=>O!==l),I=l.getBoundingClientRect(),_=I.top+I.height/2;let P=null;for(const O of B){const A=O.getBoundingClientRect(),D=A.top+A.height/2;if(_<D){P=O;break}}if(P)a.nextElementSibling!==P&&o.insertBefore(a,P);else if(B.length>0){const O=B[B.length-1];a!==O.nextElementSibling&&o.insertBefore(a,O.nextElementSibling)}}function k(){if(!l)return;const C=a.getBoundingClientRect(),M=o.getBoundingClientRect(),T=(C.top-M.top)/F()+o.scrollTop;l.style.transition="top 0.08s ease-out",l.style.top=T+"px",setTimeout(()=>{if(a.parentNode.insertBefore(l,a),a.remove(),l.classList.remove("dragging"),l.style.cssText="",i.storageKey){const B=u().map(I=>I.dataset.sessionId||I.dataset.modelId||I.dataset.filePath).filter(Boolean);B.length&&yn.setJSON(i.storageKey,B)}i.onReorder&&i.onReorder(u()),l=null,a=null,d=[]},80)}function E(C){if(C.button!==0||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector)||(C.preventDefault(),C.stopPropagation(),m(C.clientY,M),document.addEventListener("mousemove",p),document.addEventListener("mouseup",v))}function p(C){w(C.clientY)}function v(){document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",v),k()}let x=null,y=0,f=null;function h(C){if(C.target.closest("button, input, select, a")||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);if(!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector))return;f=M;const T=C.touches[0].clientY;y=T,x=setTimeout(()=>{x=null,f&&(navigator.vibrate&&navigator.vibrate(30),m(T,f),f.classList.add("touch-dragging"))},400)}function L(C){if(x){Math.abs(C.touches[0].clientY-y)>10&&(clearTimeout(x),x=null,f=null);return}l&&(C.preventDefault(),w(C.touches[0].clientY))}function S(){if(x){clearTimeout(x),x=null,f=null;return}l&&(l.classList.remove("touch-dragging"),k())}o.addEventListener("mousedown",E),o.addEventListener("touchstart",h,{passive:!0}),o.addEventListener("touchmove",L,{passive:!1}),o.addEventListener("touchend",S),o.addEventListener("touchcancel",S);const b={cleanup:()=>{o.removeEventListener("mousedown",E),o.removeEventListener("touchstart",h),o.removeEventListener("touchmove",L),o.removeEventListener("touchend",S),o.removeEventListener("touchcancel",S)},refresh:()=>{d=u()}};return Be.set(r,b),b}const Bt={enable:vn};window.dragSortModule=Bt;class Re{constructor(n="AI is processing",s="right",o="spinner"){this.animations={spinner:["|","/","-","\\"],wave:["▁▂▃","▂▃▄","▃▄▅","▄▅▆","▅▆▅","▆▅▄","▅▄▃","▄▃▂","▃▂▁"]},this.animation=o,this.frames=this.animations[o]||this.animations.spinner,this.message=n,this.style=s,this.isRunning=!1,this.currentFrame=0,this.intervalId=null,this.rafId=null,this.element=null}createElement(){if(this.animation==="sinewave")return this._createSineWaveElement();if(this.animation==="whirlpool")return this._createWhirlpoolElement();const n=document.createElement("span");return n.className="ai-spinner",n.style.cssText="font-family: monospace; white-space: pre;",this.element=n,this.updateDisplay(),n}_createSineWaveElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-sinewave",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=document.createElement("canvas");s.width=50,s.height=18,s.style.cssText="display: inline-block; vertical-align: middle;";const o=document.createElement("span");return o.textContent=this.message,this._msgSpan=o,this.style==="left"?(n.appendChild(s),n.appendChild(o)):this.style==="right"?(n.appendChild(o),n.appendChild(s)):n.appendChild(o),this._canvas=s,this._ctx=s.getContext("2d"),this._waveT=0,this._wavePrev=performance.now(),this.element=n,n}_drawSineWave(){const n=this._ctx,s=this._canvas.width,o=this._canvas.height,r=o/2,i=7,l=2.5,a=3,c=s-2*a,d=.44,u=.4,g=2.5,m=performance.now(),w=(m-this._wavePrev)/1e3;this._wavePrev=m;const k=.5*l*2*Math.PI+this._waveT,E=(1+Math.sin(k))/2,p=u+(g-u)*Math.pow(E,1.3);this._waveT+=w*d*p*l*2*Math.PI,n.clearRect(0,0,s,o),n.beginPath();for(let f=0;f<=80;f++){const h=f/80,L=a+h*c,S=h*l*2*Math.PI+this._waveT,b=r+Math.sin(S)*i;f===0?n.moveTo(L,b):n.lineTo(L,b)}n.strokeStyle="rgba(156, 222, 242, 0.5)",n.lineWidth=1.5,n.stroke();const v=s/2,x=.5*l*2*Math.PI+this._waveT,y=r+Math.sin(x)*i;n.beginPath(),n.arc(v,y,1.5,0,Math.PI*2),n.fillStyle="rgba(156, 222, 242, 0.9)",n.fill(),this.isRunning&&(this.rafId=requestAnimationFrame(()=>this._drawSineWave()))}_createWhirlpoolElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-whirlpool",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=this._wpSize||18,o=document.createElement("canvas");o.width=s,o.height=s,o.style.cssText="display: inline-block; vertical-align: middle;";const r=document.createElement("span");return r.textContent=this.message,this._msgSpan=r,this.style==="left"?(n.appendChild(o),n.appendChild(r)):(this.style==="right"&&n.appendChild(r),n.appendChild(o)),this._wpCanvas=o,this._wpCtx=o.getContext("2d"),this._wpFrame=60,this.element=n,n}_drawWhirlpool(){const n=this._wpCtx,s=this._wpCanvas.width,o=this._wpCanvas.height,r=s/2,i=o/2,l=Math.min(s,o)/2-1,a=s>30?3:s>20?2:1.5,c=4,d=.45,u=.08,g=12,m=50,w=this._wpFrame;if(!this._wpColors){const f=getComputedStyle(document.documentElement);this._wpColors={fg:f.getPropertyValue("--red").trim()||f.getPropertyValue("--fg").trim()||"#9cdef2",track:f.getPropertyValue("--border").trim()||"#355a66"}}const k=this._wpColors.fg,E=this._wpColors.track;function p(f,h){const L=l*(1-f),S=f*c*Math.PI*2+h;return{x:r+Math.cos(S)*L,y:i+Math.sin(S)*L}}n.clearRect(0,0,s,o),n.beginPath(),n.arc(r,i,l-a/2,0,Math.PI*2),n.strokeStyle=E,n.lineWidth=a,n.globalAlpha=.35,n.stroke(),n.globalAlpha=1;const v=w*.008%1;n.lineCap="round",n.lineJoin="round";for(let f=g-1;f>=0;f--){const h=(f+1)/g,L=Math.ceil(m*h),S=Math.pow(1-h,2)*.7;n.beginPath();let b=!1,C=-1;for(let M=0;M<=L;M++){const T=M/m;let B=v-T*d;B<0&&(B+=1),b&&C<.3&&B>.7&&(n.stroke(),n.beginPath(),b=!1);const I=p(B,w*u);b?n.lineTo(I.x,I.y):(n.moveTo(I.x,I.y),b=!0),C=B}n.strokeStyle=k,n.lineWidth=a*.8,n.globalAlpha=S,n.stroke()}const x=p(v,w*u);if(n.beginPath(),n.arc(x.x,x.y,Math.max(1,a*.45),0,Math.PI*2),n.fillStyle=k,n.globalAlpha=.9,n.fill(),n.globalAlpha=1,this._wpFrame++,!this.isRunning)return;const y=!!(this.element&&this.element.isConnected);y&&(this._wpWasConnected=!0),y||!this._wpWasConnected?this.rafId=requestAnimationFrame(()=>this._drawWhirlpool()):this.isRunning=!1}updateDisplay(){if(!this.element)return;const n=this.frames[this.currentFrame%this.frames.length];let s="";this.style==="left"?s=`${n} ${this.message}`:this.style==="right"?s=`${this.message} ${n}`:s=this.message,this.element.innerHTML=s}start(n=150){if(!this.isRunning){if(this.isRunning=!0,this.animation==="sinewave"){this._wavePrev=performance.now(),this._drawSineWave();return}if(this.animation==="whirlpool"){this._wpFrame=60,this._drawWhirlpool();return}this.currentFrame=0,this.intervalId=setInterval(()=>{this.currentFrame++,this.updateDisplay()},n)}}stop(){this.isRunning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}updateMessage(n){this.message=n,(this.animation==="sinewave"||this.animation==="whirlpool")&&this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}updateLabel(n){this.message=n,this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}destroy(){this.stop(),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null}}function wn(t,n="right",s="wave"){return new Re(t,n,s)}function bn(t=24){const n=new Re("","clean","whirlpool");n._wpSize=t;const s=n.createElement(),o=document.createElement("div");return o.className="spinner-whirlpool",o.style.cssText=`width:${t}px;height:${t}px;margin:8px auto;`,o.appendChild(s),n.start(),{element:o,stop:()=>n.stop(),destroy:()=>n.destroy()}}function xn(t="Loading…",n=16){const s=new Re("","clean","whirlpool");s._wpSize=n;const o=s.createElement(),r=document.createElement("div");r.className="lib-loading-row";const i=document.createElement("span");return i.textContent=t,r.appendChild(i),r.appendChild(o),s.start(),r}const _t={create:wn,createWhirlpool:bn,createLoadingRow:xn,Spinner:Re},Ht="odysseus-recent-colors",kn=12;let U=null,ue=null,ce=0,me=100,re=100,xe=null,de=null;function Me(t,n,s){return Math.max(n,Math.min(s,t))}function En(t){if(t=String(t||"").replace("#",""),t.length===3&&(t=t.split("").map(s=>s+s).join("")),!/^[0-9a-f]{6}$/i.test(t))return{r:0,g:0,b:0};const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Cn(t,n,s){return"#"+[t,n,s].map(o=>Math.round(Me(o,0,255)).toString(16).padStart(2,"0")).join("")}function Ln(t,n,s){t/=255,n/=255,s/=255;const o=Math.max(t,n,s),r=Math.min(t,n,s),i=o-r;let l;const a=o===0?0:i/o,c=o;return i===0?l=0:o===t?l=(n-s)/i+(n<s?6:0):o===n?l=(s-t)/i+2:l=(t-n)/i+4,{h:l*60,s:a*100,v:c*100}}function Sn(t,n,s){t=(t%360+360)%360,t/=60,n/=100,s/=100;const o=Math.floor(t),r=t-o,i=s*(1-n),l=s*(1-r*n),a=s*(1-(1-r)*n);let c,d,u;switch(o%6){case 0:c=s,d=a,u=i;break;case 1:c=l,d=s,u=i;break;case 2:c=i,d=s,u=a;break;case 3:c=i,d=l,u=s;break;case 4:c=a,d=i,u=s;break;case 5:c=s,d=i,u=l;break}return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(u*255)}}function we(t,n,s){const{r:o,g:r,b:i}=Sn(t,n,s);return Cn(o,r,i)}function Mn(t){const{r:n,g:s,b:o}=En(t);return Ln(n,s,o)}function Ot(){try{return JSON.parse(localStorage.getItem(Ht)||"[]")}catch{return[]}}function In(t){if(!/^#[0-9a-f]{6}$/i.test(t))return;let n=Ot().filter(s=>s.toLowerCase()!==t.toLowerCase());n.unshift(t.toLowerCase()),n=n.slice(0,kn);try{localStorage.setItem(Ht,JSON.stringify(n))}catch{}}function Pn(){return[{hex:we(ce+180,me,re),label:"Complement"},{hex:we(ce+30,me,re),label:"Analogous +30°"},{hex:we(ce-30,me,re),label:"Analogous -30°"},{hex:we(ce+150,me,re),label:"Split-complement"},{hex:we(ce,me,Me(re>50?re-30:re+30,10,95)),label:"Tone shift"}]}function Tn(){const t=document.createElement("div");return t.className="cp-popover",t.innerHTML=`
|
|
1
|
+
import{i as F,l as Z,c as ie,d as cn,r as dn,W as un}from"./index-BfPp1Oup.js";function gn(){let t=document.getElementById("ge-vendor-toast-host");return t||(t=document.createElement("div"),t.id="ge-vendor-toast-host",t.style.cssText="position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:2147483000;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;",document.body.appendChild(t)),t}function Tt(t,{error:n=!1,duration:s=2600}={}){if(typeof document>"u"||!t)return;const o=gn(),r=document.createElement("div");r.textContent=String(t),r.style.cssText=`pointer-events:auto;max-width:480px;padding:8px 14px;border-radius:4px;font-family:var(--font-body,system-ui);font-size:13px;line-height:1.4;box-shadow:0 4px 18px rgba(0,0,0,0.45);opacity:0;transition:opacity .15s;background:var(--color-bg-elevated,#1a1a1a);color:${n?"var(--color-danger,#e06c75)":"var(--color-fg,#9cdef2)"};border:1px solid ${n?"var(--color-danger,#e06c75)":"var(--color-border-bright,#355a66)"};`,o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1"}),setTimeout(()=>{r.style.opacity="0",setTimeout(()=>r.remove(),200)},typeof s=="number"?s:2600)}function pn(t,n){Tt(t,typeof n=="number"?{duration:n}:n||{})}function mn(t){Tt(t,{error:!0,duration:5e3})}function hn(t){return typeof window>"u"||typeof window.confirm!="function"?Promise.resolve(!0):Promise.resolve(window.confirm(String(t)))}function fn(t,{defaultValue:n=""}={}){return typeof window>"u"||typeof window.prompt!="function"?Promise.resolve(null):Promise.resolve(window.prompt(String(t),n))}const W={showToast:pn,showError:mn,styledConfirm:hn,styledPrompt:fn},yn={getJSON(t,n=null){try{const s=localStorage.getItem(t);return s==null?n:JSON.parse(s)}catch{return n}},setJSON(t,n){try{localStorage.setItem(t,JSON.stringify(n))}catch{}},remove(t){try{localStorage.removeItem(t)}catch{}}},Be=new Map;function vn(t,n,s={}){const o=document.getElementById(t);if(!o){console.warn("[DragSort] container not found:",t);return}const r=s.instanceKey||t;Be.has(r)&&(Be.get(r).cleanup(),Be.delete(r));const i={onReorder:s.onReorder||null,handleSelector:s.handleSelector||null,excludeSelector:s.excludeSelector||null,storageKey:s.storageKey||null};let l=null,a=null,c=0,d=[];function u(){let C=Array.from(o.querySelectorAll(n));return i.excludeSelector&&(C=C.filter(M=>!M.matches(i.excludeSelector))),C}function g(C){const M=document.createElement("div");return M.className="drag-placeholder",M.style.height=C+"px",M.style.margin="4px 0",M}function m(C,M){const T=M.getBoundingClientRect(),B=o.getBoundingClientRect(),I=(T.top-B.top)/F()+o.scrollTop,_=(T.left-B.left)/F();c=C-T.top,d=u(),l=M,getComputedStyle(o).position==="static"&&(o.style.position="relative"),a=g(T.height/F()),M.parentNode.insertBefore(a,M),M.classList.add("dragging"),Object.assign(M.style,{position:"absolute",width:T.width/F()+"px",left:_+"px",top:I+"px",zIndex:"9999",pointerEvents:"none",margin:"0",boxSizing:"border-box",transition:"none"})}function w(C){if(!l)return;const M=o.getBoundingClientRect(),T=(C-c-M.top)/F()+o.scrollTop;l.style.top=T+"px";const B=d.filter(O=>O!==l),I=l.getBoundingClientRect(),_=I.top+I.height/2;let P=null;for(const O of B){const A=O.getBoundingClientRect(),D=A.top+A.height/2;if(_<D){P=O;break}}if(P)a.nextElementSibling!==P&&o.insertBefore(a,P);else if(B.length>0){const O=B[B.length-1];a!==O.nextElementSibling&&o.insertBefore(a,O.nextElementSibling)}}function k(){if(!l)return;const C=a.getBoundingClientRect(),M=o.getBoundingClientRect(),T=(C.top-M.top)/F()+o.scrollTop;l.style.transition="top 0.08s ease-out",l.style.top=T+"px",setTimeout(()=>{if(a.parentNode.insertBefore(l,a),a.remove(),l.classList.remove("dragging"),l.style.cssText="",i.storageKey){const B=u().map(I=>I.dataset.sessionId||I.dataset.modelId||I.dataset.filePath).filter(Boolean);B.length&&yn.setJSON(i.storageKey,B)}i.onReorder&&i.onReorder(u()),l=null,a=null,d=[]},80)}function E(C){if(C.button!==0||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector)||(C.preventDefault(),C.stopPropagation(),m(C.clientY,M),document.addEventListener("mousemove",p),document.addEventListener("mouseup",v))}function p(C){w(C.clientY)}function v(){document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",v),k()}let x=null,y=0,f=null;function h(C){if(C.target.closest("button, input, select, a")||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);if(!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector))return;f=M;const T=C.touches[0].clientY;y=T,x=setTimeout(()=>{x=null,f&&(navigator.vibrate&&navigator.vibrate(30),m(T,f),f.classList.add("touch-dragging"))},400)}function L(C){if(x){Math.abs(C.touches[0].clientY-y)>10&&(clearTimeout(x),x=null,f=null);return}l&&(C.preventDefault(),w(C.touches[0].clientY))}function S(){if(x){clearTimeout(x),x=null,f=null;return}l&&(l.classList.remove("touch-dragging"),k())}o.addEventListener("mousedown",E),o.addEventListener("touchstart",h,{passive:!0}),o.addEventListener("touchmove",L,{passive:!1}),o.addEventListener("touchend",S),o.addEventListener("touchcancel",S);const b={cleanup:()=>{o.removeEventListener("mousedown",E),o.removeEventListener("touchstart",h),o.removeEventListener("touchmove",L),o.removeEventListener("touchend",S),o.removeEventListener("touchcancel",S)},refresh:()=>{d=u()}};return Be.set(r,b),b}const Bt={enable:vn};window.dragSortModule=Bt;class Re{constructor(n="AI is processing",s="right",o="spinner"){this.animations={spinner:["|","/","-","\\"],wave:["▁▂▃","▂▃▄","▃▄▅","▄▅▆","▅▆▅","▆▅▄","▅▄▃","▄▃▂","▃▂▁"]},this.animation=o,this.frames=this.animations[o]||this.animations.spinner,this.message=n,this.style=s,this.isRunning=!1,this.currentFrame=0,this.intervalId=null,this.rafId=null,this.element=null}createElement(){if(this.animation==="sinewave")return this._createSineWaveElement();if(this.animation==="whirlpool")return this._createWhirlpoolElement();const n=document.createElement("span");return n.className="ai-spinner",n.style.cssText="font-family: monospace; white-space: pre;",this.element=n,this.updateDisplay(),n}_createSineWaveElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-sinewave",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=document.createElement("canvas");s.width=50,s.height=18,s.style.cssText="display: inline-block; vertical-align: middle;";const o=document.createElement("span");return o.textContent=this.message,this._msgSpan=o,this.style==="left"?(n.appendChild(s),n.appendChild(o)):this.style==="right"?(n.appendChild(o),n.appendChild(s)):n.appendChild(o),this._canvas=s,this._ctx=s.getContext("2d"),this._waveT=0,this._wavePrev=performance.now(),this.element=n,n}_drawSineWave(){const n=this._ctx,s=this._canvas.width,o=this._canvas.height,r=o/2,i=7,l=2.5,a=3,c=s-2*a,d=.44,u=.4,g=2.5,m=performance.now(),w=(m-this._wavePrev)/1e3;this._wavePrev=m;const k=.5*l*2*Math.PI+this._waveT,E=(1+Math.sin(k))/2,p=u+(g-u)*Math.pow(E,1.3);this._waveT+=w*d*p*l*2*Math.PI,n.clearRect(0,0,s,o),n.beginPath();for(let f=0;f<=80;f++){const h=f/80,L=a+h*c,S=h*l*2*Math.PI+this._waveT,b=r+Math.sin(S)*i;f===0?n.moveTo(L,b):n.lineTo(L,b)}n.strokeStyle="rgba(156, 222, 242, 0.5)",n.lineWidth=1.5,n.stroke();const v=s/2,x=.5*l*2*Math.PI+this._waveT,y=r+Math.sin(x)*i;n.beginPath(),n.arc(v,y,1.5,0,Math.PI*2),n.fillStyle="rgba(156, 222, 242, 0.9)",n.fill(),this.isRunning&&(this.rafId=requestAnimationFrame(()=>this._drawSineWave()))}_createWhirlpoolElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-whirlpool",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=this._wpSize||18,o=document.createElement("canvas");o.width=s,o.height=s,o.style.cssText="display: inline-block; vertical-align: middle;";const r=document.createElement("span");return r.textContent=this.message,this._msgSpan=r,this.style==="left"?(n.appendChild(o),n.appendChild(r)):(this.style==="right"&&n.appendChild(r),n.appendChild(o)),this._wpCanvas=o,this._wpCtx=o.getContext("2d"),this._wpFrame=60,this.element=n,n}_drawWhirlpool(){const n=this._wpCtx,s=this._wpCanvas.width,o=this._wpCanvas.height,r=s/2,i=o/2,l=Math.min(s,o)/2-1,a=s>30?3:s>20?2:1.5,c=4,d=.45,u=.08,g=12,m=50,w=this._wpFrame;if(!this._wpColors){const f=getComputedStyle(document.documentElement);this._wpColors={fg:f.getPropertyValue("--red").trim()||f.getPropertyValue("--fg").trim()||"#9cdef2",track:f.getPropertyValue("--border").trim()||"#355a66"}}const k=this._wpColors.fg,E=this._wpColors.track;function p(f,h){const L=l*(1-f),S=f*c*Math.PI*2+h;return{x:r+Math.cos(S)*L,y:i+Math.sin(S)*L}}n.clearRect(0,0,s,o),n.beginPath(),n.arc(r,i,l-a/2,0,Math.PI*2),n.strokeStyle=E,n.lineWidth=a,n.globalAlpha=.35,n.stroke(),n.globalAlpha=1;const v=w*.008%1;n.lineCap="round",n.lineJoin="round";for(let f=g-1;f>=0;f--){const h=(f+1)/g,L=Math.ceil(m*h),S=Math.pow(1-h,2)*.7;n.beginPath();let b=!1,C=-1;for(let M=0;M<=L;M++){const T=M/m;let B=v-T*d;B<0&&(B+=1),b&&C<.3&&B>.7&&(n.stroke(),n.beginPath(),b=!1);const I=p(B,w*u);b?n.lineTo(I.x,I.y):(n.moveTo(I.x,I.y),b=!0),C=B}n.strokeStyle=k,n.lineWidth=a*.8,n.globalAlpha=S,n.stroke()}const x=p(v,w*u);if(n.beginPath(),n.arc(x.x,x.y,Math.max(1,a*.45),0,Math.PI*2),n.fillStyle=k,n.globalAlpha=.9,n.fill(),n.globalAlpha=1,this._wpFrame++,!this.isRunning)return;const y=!!(this.element&&this.element.isConnected);y&&(this._wpWasConnected=!0),y||!this._wpWasConnected?this.rafId=requestAnimationFrame(()=>this._drawWhirlpool()):this.isRunning=!1}updateDisplay(){if(!this.element)return;const n=this.frames[this.currentFrame%this.frames.length];let s="";this.style==="left"?s=`${n} ${this.message}`:this.style==="right"?s=`${this.message} ${n}`:s=this.message,this.element.innerHTML=s}start(n=150){if(!this.isRunning){if(this.isRunning=!0,this.animation==="sinewave"){this._wavePrev=performance.now(),this._drawSineWave();return}if(this.animation==="whirlpool"){this._wpFrame=60,this._drawWhirlpool();return}this.currentFrame=0,this.intervalId=setInterval(()=>{this.currentFrame++,this.updateDisplay()},n)}}stop(){this.isRunning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}updateMessage(n){this.message=n,(this.animation==="sinewave"||this.animation==="whirlpool")&&this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}updateLabel(n){this.message=n,this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}destroy(){this.stop(),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null}}function wn(t,n="right",s="wave"){return new Re(t,n,s)}function bn(t=24){const n=new Re("","clean","whirlpool");n._wpSize=t;const s=n.createElement(),o=document.createElement("div");return o.className="spinner-whirlpool",o.style.cssText=`width:${t}px;height:${t}px;margin:8px auto;`,o.appendChild(s),n.start(),{element:o,stop:()=>n.stop(),destroy:()=>n.destroy()}}function xn(t="Loading…",n=16){const s=new Re("","clean","whirlpool");s._wpSize=n;const o=s.createElement(),r=document.createElement("div");r.className="lib-loading-row";const i=document.createElement("span");return i.textContent=t,r.appendChild(i),r.appendChild(o),s.start(),r}const _t={create:wn,createWhirlpool:bn,createLoadingRow:xn,Spinner:Re},Ht="odysseus-recent-colors",kn=12;let U=null,ue=null,ce=0,me=100,re=100,xe=null,de=null;function Me(t,n,s){return Math.max(n,Math.min(s,t))}function En(t){if(t=String(t||"").replace("#",""),t.length===3&&(t=t.split("").map(s=>s+s).join("")),!/^[0-9a-f]{6}$/i.test(t))return{r:0,g:0,b:0};const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Cn(t,n,s){return"#"+[t,n,s].map(o=>Math.round(Me(o,0,255)).toString(16).padStart(2,"0")).join("")}function Ln(t,n,s){t/=255,n/=255,s/=255;const o=Math.max(t,n,s),r=Math.min(t,n,s),i=o-r;let l;const a=o===0?0:i/o,c=o;return i===0?l=0:o===t?l=(n-s)/i+(n<s?6:0):o===n?l=(s-t)/i+2:l=(t-n)/i+4,{h:l*60,s:a*100,v:c*100}}function Sn(t,n,s){t=(t%360+360)%360,t/=60,n/=100,s/=100;const o=Math.floor(t),r=t-o,i=s*(1-n),l=s*(1-r*n),a=s*(1-(1-r)*n);let c,d,u;switch(o%6){case 0:c=s,d=a,u=i;break;case 1:c=l,d=s,u=i;break;case 2:c=i,d=s,u=a;break;case 3:c=i,d=l,u=s;break;case 4:c=a,d=i,u=s;break;case 5:c=s,d=i,u=l;break}return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(u*255)}}function we(t,n,s){const{r:o,g:r,b:i}=Sn(t,n,s);return Cn(o,r,i)}function Mn(t){const{r:n,g:s,b:o}=En(t);return Ln(n,s,o)}function Ot(){try{return JSON.parse(localStorage.getItem(Ht)||"[]")}catch{return[]}}function In(t){if(!/^#[0-9a-f]{6}$/i.test(t))return;let n=Ot().filter(s=>s.toLowerCase()!==t.toLowerCase());n.unshift(t.toLowerCase()),n=n.slice(0,kn);try{localStorage.setItem(Ht,JSON.stringify(n))}catch{}}function Pn(){return[{hex:we(ce+180,me,re),label:"Complement"},{hex:we(ce+30,me,re),label:"Analogous +30°"},{hex:we(ce-30,me,re),label:"Analogous -30°"},{hex:we(ce+150,me,re),label:"Split-complement"},{hex:we(ce,me,Me(re>50?re-30:re+30,10,95)),label:"Tone shift"}]}function Tn(){const t=document.createElement("div");return t.className="cp-popover",t.innerHTML=`
|
|
2
2
|
<div class="cp-sl" data-drag="sl">
|
|
3
3
|
<div class="cp-sl-white"></div>
|
|
4
4
|
<div class="cp-sl-black"></div>
|