copilot-usage-studio 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/README.md +46 -13
  3. package/data/github-copilot-pricing.json +34 -6
  4. package/dist/copilot-usage-studio/browser/chunk-23NLHIOR.js +1 -0
  5. package/dist/copilot-usage-studio/browser/chunk-5JYQJM5G.js +1 -0
  6. package/dist/copilot-usage-studio/browser/chunk-7I2HDBC6.js +1 -0
  7. package/dist/copilot-usage-studio/browser/{chunk-TVSYR63W.js → chunk-OS2XPCVW.js} +2 -2
  8. package/dist/copilot-usage-studio/browser/{chunk-J47KKACI.js → chunk-QMNOUQ2X.js} +1 -1
  9. package/dist/copilot-usage-studio/browser/{chunk-NXH37FKU.js → chunk-RTOXDOOI.js} +1 -1
  10. package/dist/copilot-usage-studio/browser/chunk-TICIZRSM.js +1 -0
  11. package/dist/copilot-usage-studio/browser/chunk-WOIYAEKB.js +4 -0
  12. package/dist/copilot-usage-studio/browser/{chunk-QQOFM3HF.js → chunk-WWU6QMJC.js} +1 -1
  13. package/dist/copilot-usage-studio/browser/chunk-XMVGLQQH.js +1 -0
  14. package/dist/copilot-usage-studio/browser/index.html +2 -2
  15. package/dist/copilot-usage-studio/browser/main-XFPP45VE.js +1 -0
  16. package/dist/copilot-usage-studio/browser/styles-7RDDQXQV.css +1 -0
  17. package/docs/local-deployment.md +92 -17
  18. package/docs/pricing.md +5 -3
  19. package/docs/scanner-api.md +40 -0
  20. package/lib/cli.mjs +15 -1
  21. package/lib/local-runtime.mjs +499 -19
  22. package/lib/scanner-worker.mjs +25 -0
  23. package/package.json +20 -2
  24. package/scripts/pricing-utils.mjs +5 -0
  25. package/scripts/scan-vscode-sessions.mjs +387 -1475
  26. package/scripts/scanner-customization-evidence.mjs +613 -0
  27. package/scripts/scanner-customization-inventory.mjs +1022 -0
  28. package/scripts/scanner-memory.mjs +229 -0
  29. package/scripts/scanner-session-parser.mjs +1237 -0
  30. package/scripts/scanner-traversal.mjs +203 -0
  31. package/scripts/scanner-workspace.mjs +237 -0
  32. package/dist/copilot-usage-studio/browser/chunk-CUKTUQ6W.js +0 -1
  33. package/dist/copilot-usage-studio/browser/chunk-EYAHOEVS.js +0 -1
  34. package/dist/copilot-usage-studio/browser/chunk-FXNLFSUB.js +0 -1
  35. package/dist/copilot-usage-studio/browser/chunk-HJNYITFH.js +0 -1
  36. package/dist/copilot-usage-studio/browser/chunk-KDAJN6DF.js +0 -4
  37. package/dist/copilot-usage-studio/browser/main-TL27ZSEQ.js +0 -1
  38. package/dist/copilot-usage-studio/browser/styles-GZOQ5QIH.css +0 -1
package/CHANGELOG.md CHANGED
@@ -10,13 +10,41 @@ All notable changes to Copilot Usage Studio are recorded here.
10
10
  - Show source-backed memory recall history from explicit VS Code `memory view` events, linked to the following model request without inventing memory-only cost.
11
11
  - Compact the Memory page into an IDE-style file browser with filename search, copy-content action, collapsed source view, and scope help.
12
12
  - Make startup loading a stable page state and clarify that the runtime URL shown during `npm start` is backend-only.
13
- - Add GitHub Actions CI for pull requests and pushes to `main`.
13
+ - Add GitHub Actions CI for pull requests, `main`, and pushed feature branches.
14
14
  - Add tag-driven npm Trusted Publishing with automatic provenance.
15
15
  - Create the matching GitHub Release from the same version tag.
16
16
  - Support safe workflow reruns and manual backfill of an existing tagged release.
17
+ - Add a VS Code extension preview for Usage, Sessions, Memory, Customizations preview, Compare, Insights, and Prices.
18
+ - Build and upload a VSIX artifact from CI for every pushed branch.
19
+ - Position the VS Code extension as the primary product path, with Marketplace publication planned after maintainer smoke testing.
20
+ - Generate detailed release notes from the changelog and commits for tagged releases.
21
+ - Tighten Customizations evidence wording around visible local-log text matches.
22
+ - Trust explicit VS Code customization file settings, directories, and globs for file kind while keeping scans bounded by safe file type.
23
+ - Add regression coverage for `copilot-instructions.md`, explicit configured customization files, and broad user-profile folders not being scanned by default.
24
+ - Compact global scan status so detailed workspace diagnostics stay behind `View details`.
25
+ - Report user-stopped scans as stopped while keeping the last valid snapshot visible.
26
+ - Make Customizations evidence rows quieter by keeping raw VS Code source fields inside `Proof details` and marking partial evidence as minimum counts.
27
+ - Preserve existing Customizations evidence when a normal top-right Refresh runs a quick scan that skips customization indexing.
28
+ - Mark Customizations as a preview surface in both docs and the app navigation.
29
+ - Purge public roadmap links from README and release-facing docs.
30
+ - Refresh GitHub Copilot model pricing from the July 5, 2026 GitHub Docs table, including Claude Sonnet 5, Claude Opus 4.8 fast mode, Kimi K2.7 Code, and updated model statuses.
31
+ - Add raw model-id alias support so newly observed VS Code ids can map to the matching GitHub pricing row without hidden fallback pricing.
17
32
 
18
- ## 0.1.0 - 2026-06-14
33
+ ## 0.2.2 - 2026-07-12
34
+
35
+ - Make routine refreshes incremental and report clearly when local Copilot data is already up to date.
36
+ - Add an explicit full-rescan command for recovery without making every refresh expensive.
37
+ - Separate session and memory refresh from on-demand Customizations analysis.
38
+ - Cache unchanged customization evidence and analyze only new or changed session logs.
39
+ - Require substantial distinctive text before reporting customization request evidence.
40
+ - Add conservative read, discovery, and text-match evidence states without claiming causal use.
41
+ - Improve Customizations empty states, actions, scan progress, and cancellation behavior.
42
+ - Publish one versioned VSIX automatically to the VS Code Marketplace and attach that exact artifact to the matching GitHub Release.
43
+ - Enforce matching npm, extension, tag, and release versions in CI.
44
+ - Authenticate Marketplace releases through GitHub OIDC and Microsoft Entra workload identity federation without a PAT or client secret.
19
45
 
46
+
47
+ ## 0.1.0 - 2026-06-14
20
48
  Initial local developer preview.
21
49
 
22
50
  - Scan local VS Code GitHub Copilot Chat and Agent debug logs.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Copilot Usage Studio
2
2
 
3
- Local-first usage, cost, and session insights for VS Code GitHub Copilot chat and agent sessions.
3
+ Extension-first usage, memory, customization, and cost insights for VS Code GitHub Copilot chat and agent sessions.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/copilot-usage-studio.svg)](https://www.npmjs.com/package/copilot-usage-studio)
6
6
  [![CI](https://github.com/fortunes-guardian/copilot-usage-studio/actions/workflows/ci.yml/badge.svg)](https://github.com/fortunes-guardian/copilot-usage-studio/actions/workflows/ci.yml)
@@ -8,31 +8,47 @@ Local-first usage, cost, and session insights for VS Code GitHub Copilot chat an
8
8
 
9
9
  Independent open-source developer tool. Not affiliated with or endorsed by GitHub or Microsoft.
10
10
 
11
- Status: early local developer preview. Version `0.1.0` is available on npm.
11
+ Status: available as a VS Code extension. The Customizations page is preview because it depends on evidence visible in local VS Code request logs.
12
12
 
13
13
  Supported scope today: VS Code GitHub Copilot Chat and Agent sessions on the local machine. This does not currently support Visual Studio, JetBrains IDEs, Copilot CLI, GitHub.com chat, or GitHub billing exports.
14
14
 
15
- Supported local VS Code storage locations:
15
+ Supported local VS Code storage locations for the standalone/npm host:
16
16
 
17
17
  - Windows: `%APPDATA%\Code\User`
18
18
  - macOS: `~/Library/Application Support/Code/User`
19
19
  - Linux: `~/.config/Code/User`
20
20
 
21
- VS Code Insiders paths are scanned too.
21
+ VS Code Insiders paths are scanned too by the standalone/npm host. The VS Code extension uses the VS Code user-data root for the VS Code installation it is running inside.
22
22
 
23
- The app helps answer two practical questions:
23
+ The app helps answer three practical questions:
24
24
 
25
25
  > How much GitHub Copilot usage did I burn today, this week, and this month?
26
26
  >
27
+ > Did Copilot actually send my local instructions, skills, prompts, hooks, or agents to the model?
28
+ >
27
29
  > Why did this Copilot run cost what it cost?
28
30
 
29
- It scans local VS Code data, uses GitHub source usage when VS Code logs it, falls back to GitHub published model prices when it has to, and shows which models, token categories, and model calls drove the usage. It also indexes Copilot's locally saved memories and plans so they are no longer hidden in VS Code storage.
31
+ It scans local VS Code data, uses GitHub source usage when VS Code logs it, falls back to GitHub published model prices when it has to, and shows which models, token categories, and model calls drove the usage. It also indexes Copilot's locally saved memories/plans. The Customizations page is a preview for inspecting local instructions, skills, prompts, hooks, and agents with evidence from visible VS Code request logs.
30
32
 
31
33
  ## Start Here
32
34
 
33
- Requirements: Node.js 22.5 or newer, npm, and local VS Code GitHub Copilot session data.
35
+ Recommended path: install the VS Code extension from the Marketplace:
36
+
37
+ https://marketplace.visualstudio.com/items?itemName=fortunes-guardian.copilot-usage-studio-vscode
38
+
39
+ Then run `Copilot Usage Studio: Open` from the VS Code command palette.
40
+
41
+ To build and install the current source locally:
42
+
43
+ Requirements for building locally: Node.js 22.5 or newer, npm, VS Code, and local VS Code GitHub Copilot session data.
44
+
45
+ ```bash
46
+ npm install
47
+ npm run vscode:package
48
+ code --install-extension tmp/copilot-usage-studio-vscode-0.2.2.vsix --force
49
+ ```
34
50
 
35
- Run the released app:
51
+ The npm/browser host remains available for development and fallback testing:
36
52
 
37
53
  ```bash
38
54
  npx copilot-usage-studio
@@ -43,7 +59,7 @@ Then open `http://127.0.0.1:4312/`.
43
59
  `npx` downloads the latest published package from npm. To run this exact release:
44
60
 
45
61
  ```bash
46
- npx copilot-usage-studio@0.1.0
62
+ npx copilot-usage-studio@0.2.2
47
63
  ```
48
64
 
49
65
  To contribute or run the current GitHub source:
@@ -67,11 +83,18 @@ Read [docs/how-to-read-the-app.md](docs/how-to-read-the-app.md) if the UI terms
67
83
 
68
84
  The packaged CLI stores its cache in the current user's application-data directory. It does not write session data into the npm installation and does not include the maintainer's generated session data in the package.
69
85
 
86
+ If startup appears stuck, keep the terminal open and check the loading screen diagnostics. The runtime now reports the current scan step, recent log lines, and a local log-file path. You can also run:
87
+
88
+ ```bash
89
+ npx copilot-usage-studio status
90
+ ```
91
+
70
92
  ## What Works Now
71
93
 
72
94
  - **Usage**: the default home for last session, today, this week, current calendar month, selected workspace/model scope, and recent daily usage in GitHub AI credits.
73
95
  - **Sessions**: selected-run debugging with Overview, Cost, Calls, and Trace views.
74
96
  - **Memory**: read-only search and inspection for global, repository, workspace, and session-scoped Copilot memories and saved plans.
97
+ - **Customizations preview**: read-only inventory and local-log text-match evidence for Copilot instructions, skills, prompts, hooks, and agents. Absence of a text match does not prove Copilot ignored a file.
75
98
  - **Cost**: source usage when VS Code logs it, fallback pricing when it does not, and separate normal input, cached input, cache write, and output buckets.
76
99
  - **Calls**: model-call timeline, context-load timeline, setup-footprint clues, and links back to the raw Trace event.
77
100
  - **Trace**: filterable raw log timeline with clickable event inspection.
@@ -95,6 +118,16 @@ npm run build
95
118
 
96
119
  See [docs/local-deployment.md](docs/local-deployment.md) for packaging options and why the app stays local-first.
97
120
 
121
+ Build the VS Code extension locally:
122
+
123
+ ```bash
124
+ npm run vscode:package
125
+ code --install-extension tmp/copilot-usage-studio-vscode-0.2.2.vsix --force
126
+ ```
127
+
128
+ The extension opens the full app inside VS Code: Usage, Sessions, Memory, Customizations preview, Compare, Insights, and Prices.
129
+ For release validation, prefer the VSIX artifact produced by CI when available. Users should normally install from the VS Code Marketplace.
130
+
98
131
  ## Releasing
99
132
 
100
133
  Releases are tag-driven. After a change is merged to `main`, the maintainer bumps the version and pushes the generated tag:
@@ -104,7 +137,7 @@ npm version patch
104
137
  git push origin main --follow-tags
105
138
  ```
106
139
 
107
- Use `minor` or `major` instead of `patch` when appropriate. GitHub Actions then tests and packages that exact tagged commit, publishes it to npm, and creates the matching GitHub Release. See [docs/local-deployment.md](docs/local-deployment.md#automated-releases) for the one-time npm Trusted Publisher setup and the full release procedure.
140
+ Use `minor` or `major` instead of `patch` when appropriate. GitHub Actions tests and packages that exact tagged commit, builds the VS Code extension artifact, and creates release notes from `CHANGELOG.md`. See [docs/local-deployment.md](docs/local-deployment.md#automated-releases) for release mechanics.
108
141
 
109
142
  ## Current Boundaries
110
143
 
@@ -118,13 +151,13 @@ The app is a local developer visibility tool. It shows what can be understood fr
118
151
 
119
152
  - [docs/how-to-read-the-app.md](docs/how-to-read-the-app.md): plain-English guide to the UI.
120
153
  - [docs/pricing.md](docs/pricing.md): GitHub price source, calculation rules, AI-credit allowances, and real-world caveats.
121
- - [docs/local-deployment.md](docs/local-deployment.md): local run, build, and future packaging options.
154
+ - [docs/local-deployment.md](docs/local-deployment.md): local run, build, and release mechanics.
155
+ - [docs/vscode-extension.md](docs/vscode-extension.md): local VSIX preview architecture, build, and smoke-test flow.
122
156
  - [docs/scanner-api.md](docs/scanner-api.md): reusable Node scanner contract for local hosts, desktop packaging, and extensions.
123
157
  - [docs/data-ingestion.md](docs/data-ingestion.md): where the data comes from and what it means.
124
158
  - [docs/copilot-memory.md](docs/copilot-memory.md): observed Copilot memory storage, normalized fields, and evidence boundaries.
159
+ - [docs/customization-evidence.md](docs/customization-evidence.md): how instruction/skill evidence is detected and what it proves.
125
160
  - [docs/debug-log-schema.md](docs/debug-log-schema.md): observed VS Code Agent Debug Log schema and generated app data contract.
126
- - [docs/schema-change-workflow.md](docs/schema-change-workflow.md): weekly VS Code/Copilot update audit, compatibility gates, and baseline procedure.
127
- - [docs/roadmap.md](docs/roadmap.md): current state, completed work, and planned build order.
128
161
 
129
162
  ## License
130
163
 
@@ -1,9 +1,9 @@
1
1
  {
2
- "version": "github-copilot-usage-pricing-2026-06-14",
2
+ "version": "github-copilot-usage-pricing-2026-07-05",
3
3
  "sourceUrl": "https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing",
4
4
  "sourceLabel": "GitHub Docs: Models and pricing for GitHub Copilot",
5
- "snapshotDate": "2026-06-14",
6
- "importedAt": "2026-06-14",
5
+ "snapshotDate": "2026-07-05",
6
+ "importedAt": "2026-07-05",
7
7
  "fallbackModel": "GPT-5.4",
8
8
  "models": {
9
9
  "GPT-5 mini": {
@@ -152,7 +152,17 @@
152
152
  "cacheWrite": 6.25,
153
153
  "output": 25
154
154
  },
155
- "Claude Fable 5": {
155
+ "Claude Sonnet 5": {
156
+ "provider": "Anthropic",
157
+ "releaseStatus": "GA",
158
+ "category": "Versatile",
159
+ "input": 2,
160
+ "cachedInput": 0.2,
161
+ "cacheWrite": 2.5,
162
+ "output": 10,
163
+ "note": "GitHub documents this promotional pricing through August 31, 2026."
164
+ },
165
+ "Claude Opus 4.8 (fast mode)": {
156
166
  "provider": "Anthropic",
157
167
  "releaseStatus": "GA",
158
168
  "category": "Powerful",
@@ -160,7 +170,17 @@
160
170
  "cachedInput": 1,
161
171
  "cacheWrite": 12.5,
162
172
  "output": 50,
163
- "note": "GitHub currently marks this model as unavailable"
173
+ "aliases": ["Claude Opus 4.8 fast", "claude-opus-4.8-fast"],
174
+ "note": "GitHub's table includes '(preview)' in the model label."
175
+ },
176
+ "Claude Fable 5": {
177
+ "provider": "Anthropic",
178
+ "releaseStatus": "GA",
179
+ "category": "Powerful",
180
+ "input": 10,
181
+ "cachedInput": 1,
182
+ "cacheWrite": 12.5,
183
+ "output": 50
164
184
  },
165
185
  "Gemini 2.5 Pro": {
166
186
  "provider": "Google",
@@ -209,7 +229,7 @@
209
229
  },
210
230
  "Raptor mini": {
211
231
  "provider": "Fine-tuned (GitHub)",
212
- "releaseStatus": "Public preview",
232
+ "releaseStatus": "GA",
213
233
  "category": "Versatile",
214
234
  "input": 0.25,
215
235
  "cachedInput": 0.025,
@@ -222,6 +242,14 @@
222
242
  "input": 0.75,
223
243
  "cachedInput": 0.075,
224
244
  "output": 4.5
245
+ },
246
+ "Kimi K2.7 Code": {
247
+ "provider": "Moonshot AI",
248
+ "releaseStatus": "GA",
249
+ "category": "Versatile",
250
+ "input": 0.95,
251
+ "cachedInput": 0.19,
252
+ "output": 4
225
253
  }
226
254
  }
227
255
  }
@@ -0,0 +1 @@
1
+ import{f as Q}from"./chunk-RTOXDOOI.js";import{i as S,r as U,s as W}from"./chunk-TICIZRSM.js";import{$a as f,Ca as P,Da as h,Ea as T,Fa as y,Ga as M,Ha as g,Ia as o,Ja as i,Ka as F,O as E,Oa as I,P as D,Qa as x,Sa as _,Ta as V,U as A,Ua as B,Va as s,Wa as m,Xa as N,Ya as w,Z as v,Za as z,_a as l,ab as b,db as C,ka as r,nb as L,ob as R,sa as $,sb as Y,ub as j,vb as H,wb as G,xb as q,yb as J,zb as K}from"./chunk-WOIYAEKB.js";var X=(n,t)=>t.id,ae=(n,t)=>t.key;function ie(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All workspaces":e)}}function oe(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e),r(),m(e==="all"?"All models":e)}}function re(n,t){if(n&1&&(o(0,"option",6),s(1),i()),n&2){let e=t.$implicit;g("value",e.id),r(),m(e.label)}}function se(n,t){if(n&1){let e=I();o(0,"button",17),x("click",function(){E(e);let p=_();return D(p.resetScope())}),s(1,"Reset scope"),i()}}function le(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function pe(n,t){if(n&1&&(o(0,"span",23),s(1),i()),n&2){let e=_().$implicit;r(),m(e.actionLabel)}}function ce(n,t){if(n&1){let e=I();o(0,"button",18),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.session))}),o(1,"span",19),s(2),i(),o(3,"strong"),s(4),l(5,"number"),i(),o(6,"em",20),s(7),i(),o(8,"em"),s(9),l(10,"number"),i(),o(11,"i",21),F(12,"b"),i(),o(13,"small",22)(14,"span"),s(15),l(16,"number"),P(17,le,2,4),i(),P(18,pe,2,1,"span",23),i()()}if(n&2){let e=t.$implicit,a=_();B("primary",e.id==="last-session")("can-open",a.canOpenSession&&e.session)("empty",!e.session),g("disabled",!a.canOpenSession||!e.session),r(2),m(e.label),r(2),N("",b(5,18,e.credits,"1.0-2")," credits"),r(3),m(e.period),r(2),w("$",b(10,21,e.usd,"1.2-4")," \xB7 ",e.detail),r(3),V("width",e.allowanceShare>100?100:e.allowanceShare,"%"),r(3),w(" ",b(16,24,e.allowanceShare,"1.0-1"),"% of ",a.selectedAllowance().shortLabel," "),r(2),h(e.fallbackCount?17:-1),r(),h(a.canOpenSession?18:-1)}}function de(n,t){if(n&1&&(o(0,"span"),s(1),l(2,"number"),l(3,"number"),i()),n&2){let e=t;r(),w("",f(2,2,e.sourceCount)," source \xB7 ",f(3,4,e.fallbackCount)," fallback")}}function ge(n,t){if(n&1&&(s(0),l(1,"number")),n&2){let e=_().$implicit;w(" \xB7 ",f(1,2,e.fallbackCount)," fallback",e.fallbackCount===1?"":"s"," ")}}function ue(n,t){if(n&1){let e=I();o(0,"button",24),x("click",function(){let p=E(e).$implicit,c=_();return D(c.emitOpenSession(p.topSession))}),o(1,"span"),s(2),l(3,"date"),i(),o(4,"strong"),s(5),l(6,"number"),i(),o(7,"em"),s(8),l(9,"number"),l(10,"number"),P(11,ge,2,4),i()()}if(n&2){let e=t.$implicit,a=_();B("can-open",a.canOpenSession&&e.topSession)("empty",!e.topSession),g("disabled",!a.canOpenSession||!e.topSession),r(2),m(b(3,11,e.date,"EEE, MMM d")),r(3),N("",b(6,14,e.credits,"1.0-2")," credits"),r(3),z(" ",f(9,17,e.count)," session",e.count===1?"":"s"," \xB7 $",b(10,19,e.usd,"1.2-4")," "),r(3),h(e.fallbackCount?11:-1)}}var Z=class n{sessionsInput=v([]);allowancePlanInput=v("business-standard");workspaceFilter=v("all");modelFilter=v("all");set sessions(t){this.sessionsInput.set(t??[])}set allowancePlan(t){this.allowancePlanInput.set(t??"business-standard")}canOpenSession=!0;allowancePlanChange=new A;openSession=new A;allowancePlans=S;help={scope:"Usage is calculated from imported local VS Code sessions. When VS Code reports Copilot usage units, the app uses those. Otherwise it estimates from token buckets and GitHub model prices.",allowance:"Compares your local imported usage with the included monthly AI credits for the selected Copilot plan."};selectedAllowance=C(()=>S.find(t=>t.id===this.allowancePlanInput())??S[0]);currentAllowancePlan=C(()=>this.selectedAllowance().id);workspaceOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.workspace).filter(Boolean))].sort()]);modelOptions=C(()=>["all",...[...new Set(this.sessionsInput().map(t=>t.model).filter(Boolean))].sort()]);scopedSessions=C(()=>this.sessionsInput().filter(t=>(this.workspaceFilter()==="all"||t.workspace===this.workspaceFilter())&&(this.modelFilter()==="all"||t.model===this.modelFilter())));scopeActive=C(()=>this.workspaceFilter()!=="all"||this.modelFilter()!=="all");usageWindows=C(()=>Q(this.scopedSessions(),this.selectedAllowance().creditsPerUserMonthly));dailyRows=C(()=>this.buildDailyRows(this.scopedSessions(),14));sourceCoverage=C(()=>{let t=this.scopedSessions(),e=t.filter(a=>a.sourceUsage).length;return{sourceCount:e,fallbackCount:t.length-e,total:t.length}});setAllowancePlan(t){if(!S.some(a=>a.id===t))return;let e=t;this.allowancePlanInput.set(e),this.allowancePlanChange.emit(e)}setWorkspaceFilter(t){this.workspaceFilter.set(t)}setModelFilter(t){this.modelFilter.set(t)}resetScope(){this.workspaceFilter.set("all"),this.modelFilter.set("all")}emitOpenSession(t){this.canOpenSession&&t&&this.openSession.emit(t)}buildDailyRows(t,e){let a=me(new Date);return Array.from({length:e},(p,c)=>{let k=ee(a,-c),te=ee(k,1),O=t.filter(d=>{let u=Date.parse(d.startedAt);return Number.isFinite(u)&&u>=k.getTime()&&u<te.getTime()}),ne=O.reduce((d,u)=>!d||U(u)>U(d)?u:d,null);return{date:k,key:Ce(k),credits:O.reduce((d,u)=>d+W(u),0),usd:O.reduce((d,u)=>d+U(u),0),count:O.length,topSession:ne,fallbackCount:O.filter(d=>!d.sourceUsage).length}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=$({type:n,selectors:[["app-usage-page"]],inputs:{sessions:"sessions",allowancePlan:"allowancePlan",canOpenSession:"canOpenSession"},outputs:{allowancePlanChange:"allowancePlanChange",openSession:"openSession"},decls:55,vars:15,consts:[[1,"usage-page"],[1,"usage-header"],[1,"eyebrow"],["label","Explain usage scope",3,"text"],[1,"usage-controls"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain allowance",3,"text"],[1,"usage-scope"],["type","button"],["aria-label","Usage answer cards",1,"usage-answer-grid"],["type","button",1,"usage-answer-card",3,"primary","can-open","empty","disabled"],[1,"usage-panels"],[1,"usage-panel"],[1,"panel-heading"],[1,"daily-usage-list"],["type","button",3,"can-open","empty","disabled"],["type","button",3,"click"],["type","button",1,"usage-answer-card",3,"click","disabled"],[1,"usage-card-label"],[1,"usage-card-period"],["aria-hidden","true"],[1,"usage-card-footer"],[1,"usage-card-action"],["type","button",3,"click","disabled"]],template:function(e,a){if(e&1&&(o(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),s(4,"Usage home"),i(),o(5,"h2"),s(6,"Your Copilot usage"),i(),o(7,"p"),s(8," Today, this week, this month, and recent activity across imported VS Code sessions. "),F(9,"app-help-popover",3),i()(),o(10,"div",4)(11,"label")(12,"span"),s(13,"Workspace"),i(),o(14,"select",5),x("ngModelChange",function(c){return a.setWorkspaceFilter(c)}),y(15,ie,2,2,"option",6,T),i()(),o(17,"label")(18,"span"),s(19,"Model"),i(),o(20,"select",5),x("ngModelChange",function(c){return a.setModelFilter(c)}),y(21,oe,2,2,"option",6,T),i()(),o(23,"label")(24,"span"),s(25," Monthly allowance "),F(26,"app-help-popover",7),i(),o(27,"select",5),x("ngModelChange",function(c){return a.setAllowancePlan(c)}),y(28,re,2,2,"option",6,X),i()()()(),o(30,"div",8)(31,"span"),s(32),l(33,"number"),l(34,"number"),i(),o(35,"span"),s(36),i(),o(37,"span"),s(38),i(),P(39,se,2,0,"button",9),i(),o(40,"section",10),y(41,ce,19,27,"button",11,X),i(),o(43,"section",12)(44,"article",13)(45,"div",14)(46,"div")(47,"h3"),s(48,"Recent days"),i(),o(49,"p"),s(50,"Last 14 local calendar days from imported VS Code sessions."),i()(),P(51,de,4,6,"span"),i(),o(52,"div",15),y(53,ue,12,22,"button",16,ae),i()()()()),e&2){let p;r(9),g("text",a.help.scope),r(5),g("ngModel",a.workspaceFilter()),r(),M(a.workspaceOptions()),r(5),g("ngModel",a.modelFilter()),r(),M(a.modelOptions()),r(5),g("text",a.help.allowance),r(),g("ngModel",a.currentAllowancePlan()),r(),M(a.allowancePlans),r(4),w("",f(33,11,a.scopedSessions().length)," of ",f(34,13,a.sessionsInput().length)," sessions"),r(4),m(a.workspaceFilter()==="all"?"All workspaces":a.workspaceFilter()),r(2),m(a.modelFilter()==="all"?"All models":a.modelFilter()),r(),h(a.scopeActive()?39:-1),r(2),M(a.usageWindows()),r(10),h((p=a.sourceCoverage())?51:-1,p),r(2),M(a.dailyRows())}},dependencies:[K,q,J,G,j,H,Y,L,R],styles:["[_nghost-%COMP%]{display:block}.usage-page[_ngcontent-%COMP%]{display:grid;gap:12px}.usage-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border:1px solid color-mix(in srgb,var(--accent-2) 24%,var(--line));border-radius:18px;padding:16px;background:var(--header-gradient);box-shadow:var(--shadow)}.eyebrow[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:3px 0 0;color:var(--text-strong);font-size:26px;font-weight:820;letter-spacing:0}.usage-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px;max-width:720px;margin:7px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.usage-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:8px;width:min(720px,58vw)}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;color:var(--muted);font-size:11px;font-weight:760}.usage-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.usage-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;min-height:34px;border:1px solid var(--line);border-radius:9px;padding:7px 10px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:13px;font-weight:760}.usage-scope[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:7px;color:var(--muted);font-size:11px}.usage-scope[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft)}.usage-scope[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--accent);font:inherit;font-weight:800;cursor:pointer}.usage-answer-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.usage-answer-card[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:var(--shadow-soft)}.usage-answer-card[_ngcontent-%COMP%]{display:grid;gap:6px;min-width:0;padding:13px;color:var(--text);text-align:left;cursor:default}.usage-answer-card.primary[_ngcontent-%COMP%]{border-color:#0c9f8347;background:linear-gradient(135deg,#0c9f831f,#6f5cff0d),var(--surface)}.usage-answer-card.empty[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.72}.usage-answer-card.can-open[_ngcontent-%COMP%]{cursor:pointer}.usage-answer-card.can-open[_ngcontent-%COMP%]:hover{border-color:color-mix(in srgb,var(--accent) 42%,var(--line));transform:translateY(-1px)}.usage-answer-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-answer-card[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .daily-usage-list[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;font-style:normal;line-height:1.35}.usage-answer-card[_ngcontent-%COMP%] .usage-card-label[_ngcontent-%COMP%]{color:var(--muted-2);font-size:10px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.usage-answer-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:21px;font-weight:820;line-height:1.05;overflow-wrap:anywhere}.usage-card-period[_ngcontent-%COMP%]{color:var(--text)!important;font-size:12px!important;font-weight:760}.usage-answer-card[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{display:block;width:100%;height:5px;overflow:hidden;border-radius:999px;background:#61708524}.usage-answer-card[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),var(--accent-2))}.usage-card-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px}.usage-card-footer[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{min-width:0}.usage-card-action[_ngcontent-%COMP%]{flex:0 0 auto;color:var(--accent-strong, var(--accent))!important;font-size:11px!important;font-weight:820}.usage-answer-card[_ngcontent-%COMP%]:disabled .usage-card-action[_ngcontent-%COMP%]{color:var(--muted-2)!important}.usage-panels[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:12px;align-items:start}.usage-panel[_ngcontent-%COMP%]{display:grid;gap:10px;padding:13px}.panel-heading[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.panel-heading[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .usage-panel[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:16px;font-weight:800}.panel-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:3px 0 0}.panel-heading[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);font-weight:760}.daily-usage-list[_ngcontent-%COMP%]{display:grid;gap:6px}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(120px,.45fr) minmax(110px,.35fr) minmax(0,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--surface-soft);color:var(--text);text-align:left;cursor:default}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{cursor:default}.daily-usage-list[_ngcontent-%COMP%] button.empty[_ngcontent-%COMP%]:disabled{opacity:.64}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]{cursor:pointer}.daily-usage-list[_ngcontent-%COMP%] button.can-open[_ngcontent-%COMP%]:hover{border-color:var(--line-strong)}.daily-usage-list[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:14px;font-weight:800}@media(max-width:1200px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:850px){.usage-header[_ngcontent-%COMP%], .panel-heading[_ngcontent-%COMP%]{display:grid}.usage-controls[_ngcontent-%COMP%]{grid-template-columns:1fr;width:100%}.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-usage-list[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{grid-template-columns:1fr;gap:4px}}@media(max-width:560px){.usage-answer-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})};function me(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function ee(n,t){let e=new Date(n);return e.setDate(e.getDate()+t),e}function Ce(n){let t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${t}-${e}-${a}`}export{Z as UsagePageComponent};
@@ -0,0 +1 @@
1
+ import{a as N,d as D}from"./chunk-OS2XPCVW.js";import{$a as _,Ca as g,Da as u,Ea as F,Fa as O,Ga as S,Ha as h,Ia as i,J as k,Ja as n,Ka as T,O as y,Oa as b,P as M,Qa as x,Sa as c,U as E,Ua as V,Va as o,Wa as p,Xa as C,Ya as P,Z as f,_a as d,ab as w,db as v,ka as l,nb as z,ob as B,sa as I,sb as j,tb as q,ub as R,vb as $,wb as A,xb as L,yb as K,zb as W}from"./chunk-WOIYAEKB.js";var Q=(r,t)=>t.id;function G(r,t){if(r&1&&(i(0,"option",15),o(1),n()),r&2){let e=t.$implicit;h("value",e),l(),p(e==="all"?"All workspaces":e)}}function U(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2);return M(s.resetFilters())}),o(1,"Reset"),n()}}function J(r,t){if(r&1&&(i(0,"em"),o(1),d(2,"number"),n()),r&2){let e=c().$implicit;l(),P(" ",_(2,2,e.recalls==null?null:e.recalls.length)," ",(e.recalls==null?null:e.recalls.length)===1?"read":"reads"," ")}}function X(r,t){if(r&1&&(i(0,"time"),o(1),d(2,"date"),n()),r&2){let e=c().$implicit;l(),p(w(2,1,e.modifiedAt,"MMM d"))}}function Y(r,t){if(r&1){let e=b();i(0,"button",24),x("click",function(){let s=y(e).$implicit,m=c(2);return M(m.selectMemory(s))}),i(1,"span",25),o(2),n(),i(3,"span",26)(4,"small"),o(5),n(),i(6,"strong"),o(7),n()(),i(8,"span",27)(9,"b"),o(10),n(),g(11,J,3,4,"em")(12,X,3,4,"time"),n()()}if(r&2){let e=t.$implicit,a=c(2);V("active",a.selectedMemory().id===e.id)("plan",e.kind==="plan"),l(2),C(" ",e.kind==="plan"?"P":"M"," "),l(3),p(a.fileName(e)),l(2),p(e.title),l(3),p(e.kind==="plan"?"Plan":a.scopeLabel(e.scope)),l(),u(e.recalls!=null&&e.recalls.length?11:12)}}function Z(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2),m=c(2);return M(m.emitOpenSession(s))}),o(1),n()}if(r&2){let e=c();l(),C(" Created in: ",e.title," ")}}function ee(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c();l(),C("Created in: ",e.title)}}function te(r,t){if(r&1&&g(0,Z,2,1,"button",20)(1,ee,2,1,"span"),r&2){let e=c(3);u(e.canOpenSession?0:1)}}function ne(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c();l(),C("Session ",e.sessionId.slice(0,8))}}function oe(r,t){if(r&1&&(i(0,"p",34),o(1),n()),r&2){let e=c(3);l(),p(e.actionStatus())}}function ie(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2).$implicit,m=c(4);return M(m.emitRecallSession(s.sessionId))}),o(1),n()}if(r&2){let e=c();l(),C(" ",e.title," ")}}function re(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c();l(),p(e.title)}}function ae(r,t){if(r&1&&g(0,ie,2,1,"button",20)(1,re,2,1,"span"),r&2){let e=c(5);u(e.canOpenSession?0:1)}}function le(r,t){if(r&1&&(i(0,"span"),o(1),n()),r&2){let e=c().$implicit;l(),C("Session ",e.sessionId.slice(0,8))}}function se(r,t){if(r&1&&(o(0),d(1,"number")),r&2){let e=c();C(" \xB7 ",_(1,1,e.cachedInputTokens)," cached ")}}function ce(r,t){if(r&1&&(i(0,"span"),o(1),d(2,"number"),g(3,se,2,3),n()),r&2){let e=t,a=c().$implicit,s=c(4);l(),P(" ",s.recallRequestLabel(a)," \xB7 ",_(2,3,e.inputTokens)," input "),l(2),u(e.cachedInputTokens?3:-1)}}function me(r,t){if(r&1&&(i(0,"article",40)(1,"div")(2,"time"),o(3),d(4,"date"),n(),g(5,ae,2,1)(6,le,2,1,"span"),n(),i(7,"div",42)(8,"span"),o(9),d(10,"number"),n(),g(11,ce,4,5,"span"),n()()),r&2){let e,a,s=t.$implicit,m=c(4);l(3),p(w(4,4,s.timestamp,"medium")),l(2),u((e=m.recallSession(s.sessionId))?5:6,e),l(4),C("",_(10,7,s.returnedCharacterCount)," characters loaded"),l(2),u((a=s.followingModelCall)?11:-1,a)}}function pe(r,t){if(r&1&&(i(0,"section",35)(1,"header")(2,"div")(3,"span",29),o(4,"Observed use"),n(),i(5,"h4"),o(6),d(7,"number"),n()(),i(8,"p"),o(9,"These are explicit memory reads recorded by VS Code."),n()(),i(10,"div",39),O(11,me,12,9,"article",40,Q),n(),i(13,"p",41),o(14," Request totals include the complete prompt and context, not only this memory. "),n()()),r&2){let e=c();l(6),P(" Read ",_(7,2,e.recalls==null?null:e.recalls.length)," ",(e.recalls==null?null:e.recalls.length)===1?"time":"times"," "),l(5),S(e.recalls)}}function de(r,t){if(r&1){let e=b();i(0,"article",22)(1,"header",28)(2,"div")(3,"span",29),o(4),n(),i(5,"h3"),o(6),n(),i(7,"p"),o(8),d(9,"date"),n()(),i(10,"div",30)(11,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.copyContent(s))}),o(12,"Copy"),n(),i(13,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.runMemoryAction(s,"open"))}),o(14,"Open file"),n(),i(15,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.runMemoryAction(s,"reveal"))}),o(16,"Show in folder"),n(),i(17,"button",23),x("click",function(){let s=y(e),m=c(2);return M(m.copyPath(s))}),o(18,"Copy path"),n()()(),i(19,"div",31)(20,"span",32)(21,"b"),o(22),n(),o(23," scope "),T(24,"app-help-popover",33),n(),i(25,"span")(26,"b"),o(27),d(28,"number"),n(),o(29," characters"),n(),i(30,"span")(31,"b"),o(32),d(33,"number"),n(),o(34," lines"),n(),i(35,"span")(36,"b"),o(37),n()(),g(38,te,2,1)(39,ne,2,1,"span"),n(),g(40,oe,2,1,"p",34),g(41,pe,15,4,"section",35),i(42,"details",36)(43,"summary")(44,"span"),o(45,"Markdown source"),n(),i(46,"small"),o(47),d(48,"number"),d(49,"number"),n()(),i(50,"pre",37),o(51),n()(),i(52,"footer",38)(53,"span"),o(54,"Local file"),n(),i(55,"code"),o(56),n()()()}if(r&2){let e,a=t,s=c(2);l(4),C(" ",a.kind==="plan"?"Saved plan":s.scopeLabel(a.scope)+" memory"," "),l(2),p(a.title),l(2),P(" ",a.workspace||"Available across workspaces"," \xB7 updated ",w(9,16,a.modifiedAt,"medium")," "),l(14),p(s.scopeLabel(a.scope)),l(2),h("text",s.scopeHelp(a.scope)),l(3),p(_(28,19,a.characterCount)),l(5),p(_(33,21,a.lineCount)),l(5),p(s.fileName(a)),l(),u((e=s.linkedSession(a))?38:a.sessionId?39:-1,e),l(2),u(s.actionStatus()?40:-1),l(),u(a.recalls!=null&&a.recalls.length?41:-1),l(6),P("",_(48,23,a.lineCount)," lines \xB7 ",_(49,25,a.characterCount)," characters"),l(4),p(a.content),l(5),p(a.sourcePath)}}function _e(r,t){if(r&1&&(i(0,"section",16)(1,"aside",18)(2,"div",19)(3,"span"),o(4),d(5,"number"),n(),g(6,U,2,0,"button",20),n(),O(7,Y,13,9,"button",21,Q),n(),g(9,de,57,27,"article",22),n()),r&2){let e,a=c();l(4),C("",_(5,3,a.filteredMemories().length)," shown"),l(2),u(a.query()||a.scopeFilter()!=="all"||a.kindFilter()!=="all"||a.workspaceFilter()!=="all"?6:-1),l(),S(a.filteredMemories()),l(2),u((e=a.selectedMemory())?9:-1,e)}}function ge(r,t){if(r&1){let e=b();i(0,"button",23),x("click",function(){y(e);let s=c(2);return M(s.resetFilters())}),o(1,"Reset filters"),n()}}function ue(r,t){if(r&1&&(i(0,"section",17)(1,"h3"),o(2),n(),i(3,"p"),o(4),n(),g(5,ge,2,0,"button",20),n()),r&2){let e=c();l(2),p(e.memoriesInput().length?"No memories match these filters":"No Copilot memories found"),l(2),C(" ",e.memoriesInput().length?"Try a broader search or reset the filters.":"Create a saved memory or plan in VS Code, then refresh the local scan."," "),l(),u(e.memoriesInput().length?5:-1)}}var H=class r{http=k(N);memoriesInput=f([]);sessionsInput=f([]);query=f("");scopeFilter=f("all");kindFilter=f("all");workspaceFilter=f("all");selectedId=f(null);actionStatus=f("");set memories(t){let e=t??[];this.memoriesInput.set(e),(!this.selectedId()||!e.some(a=>a.id===this.selectedId()))&&this.selectedId.set(e[0]?.id??null)}set sessions(t){this.sessionsInput.set(t??[])}canOpenSession=!0;openSession=new E;workspaceOptions=v(()=>["all",...[...new Set(this.memoriesInput().map(t=>t.workspace).filter(Boolean))].sort()]);filteredMemories=v(()=>{let t=this.query().trim().toLowerCase();return this.memoriesInput().filter(e=>(!t||[e.title,e.excerpt,e.content,e.relativePath,e.sourcePath,this.fileName(e),e.workspace,e.scope,e.kind].join(" ").toLowerCase().includes(t))&&(this.scopeFilter()==="all"||e.scope===this.scopeFilter())&&(this.kindFilter()==="all"||e.kind===this.kindFilter())&&(this.workspaceFilter()==="all"||e.workspace===this.workspaceFilter()))});selectedMemory=v(()=>{let t=this.filteredMemories();return t.find(e=>e.id===this.selectedId())??t[0]??null});summary=v(()=>{let t=this.memoriesInput();return{total:t.length,plans:t.filter(e=>e.kind==="plan").length,recalls:t.reduce((e,a)=>e+(a.recalls?.length??0),0),repositories:new Set(t.map(e=>e.workspace).filter(Boolean)).size}});recallSession(t){return this.sessionsInput().find(e=>e.id===t)??null}emitRecallSession(t){let e=this.recallSession(t);this.canOpenSession&&e&&this.openSession.emit(e)}recallRequestLabel(t){let e=t.followingModelCall?.number,a=e?`request ${e}`:"request";return t.sourceLog==="main.jsonl"?`Before model ${a}`:`Before subagent model ${a}`}selectMemory(t){this.selectedId.set(t.id),this.actionStatus.set("")}setScopeFilter(t){this.scopeFilter.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}setKindFilter(t){this.kindFilter.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}setWorkspaceFilter(t){this.workspaceFilter.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}setQuery(t){this.query.set(t),this.actionStatus.set(""),this.ensureVisibleSelection()}resetFilters(){this.query.set(""),this.scopeFilter.set("all"),this.kindFilter.set("all"),this.workspaceFilter.set("all"),this.ensureVisibleSelection()}fileName(t){return(t.relativePath||t.sourcePath).split(/[\\/]+/).filter(Boolean).at(-1)??t.title}scopeHelp(t){return{session:"Session-scoped memory is tied to one Copilot session. It is useful for saved plans or temporary research from that run.",repository:"Repository memory is saved for a workspace repository and can be available to future Copilot sessions in that workspace.",workspace:"Workspace memory belongs to this VS Code workspace but is not clearly tied to one repository or session.",global:"Global memory is stored in VS Code user storage and can apply across workspaces on this machine."}[t]}ensureVisibleSelection(){let t=this.filteredMemories();if(!t.length){this.selectedId.set(null);return}t.some(e=>e.id===this.selectedId())||this.selectedId.set(t[0].id)}linkedSession(t){return t.sessionId?this.sessionsInput().find(e=>e.id===t.sessionId)??null:null}emitOpenSession(t){let e=this.linkedSession(t);this.canOpenSession&&e&&this.openSession.emit(e)}runMemoryAction(t,e){this.actionStatus.set(e==="open"?"Opening file\u2026":"Showing file\u2026"),this.http.post(D(`/api/memories/${t.id}/open`),{action:e}).subscribe({next:()=>this.actionStatus.set(e==="open"?"Opened file":"Shown in folder"),error:()=>this.actionStatus.set("File actions require the local runtime")})}async copyPath(t){try{await globalThis.navigator?.clipboard?.writeText(t.sourcePath),this.actionStatus.set("Path copied")}catch{this.actionStatus.set("Could not copy the path")}}async copyContent(t){try{await globalThis.navigator?.clipboard?.writeText(t.content),this.actionStatus.set("Memory copied")}catch{this.actionStatus.set("Could not copy the memory")}}scopeLabel(t){return{global:"Global",repository:"Repository",session:"Session",workspace:"Workspace"}[t]}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=I({type:r,selectors:[["app-memory-page"]],inputs:{memories:"memories",sessions:"sessions",canOpenSession:"canOpenSession"},outputs:{openSession:"openSession"},decls:69,vars:17,consts:[[1,"memory-page"],[1,"memory-header"],[1,"eyebrow"],["aria-label","Memory summary",1,"memory-header-meta"],["aria-label","Memory filters",1,"memory-controls"],[1,"memory-search"],["type","search","placeholder","Search title, filename, content, or path",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],["value","all"],["value","memory"],["value","plan"],["value","global"],["value","repository"],["value","session"],["value","workspace"],[3,"value"],[1,"memory-workspace"],[1,"memory-empty"],["aria-label","Saved memories",1,"memory-list"],[1,"memory-list-heading"],["type","button"],["type","button",1,"memory-card",3,"active","plan"],[1,"memory-detail"],["type","button",3,"click"],["type","button",1,"memory-card",3,"click"],["aria-hidden","true",1,"memory-file-icon"],[1,"memory-card-main"],[1,"memory-card-side"],[1,"memory-detail-header"],[1,"memory-kicker"],[1,"memory-actions"],[1,"memory-facts"],[1,"scope-fact"],["label","Explain memory scope",3,"text"],["aria-live","polite",1,"memory-action-status"],["aria-label","Observed memory use",1,"memory-recalls"],[1,"memory-source"],[1,"memory-content"],[1,"memory-path"],[1,"memory-recall-list"],[1,"memory-recall-row"],[1,"memory-recall-note"],[1,"memory-recall-facts"]],template:function(e,a){e&1&&(i(0,"section",0)(1,"header",1)(2,"div")(3,"p",2),o(4,"Copilot memory"),n(),i(5,"h2"),o(6,"What Copilot remembers"),n(),i(7,"p"),o(8,"Saved plans and memories from local VS Code Copilot storage."),n()(),i(9,"div",3)(10,"span")(11,"strong"),o(12),d(13,"number"),n(),o(14," files"),n(),i(15,"span")(16,"strong"),o(17),d(18,"number"),n(),o(19," plans"),n(),i(20,"span")(21,"strong"),o(22),d(23,"number"),n(),o(24," reads"),n(),i(25,"span")(26,"strong"),o(27),d(28,"number"),n(),o(29," workspaces"),n(),i(30,"b"),o(31,"Read-only"),n()()(),i(32,"section",4)(33,"label",5)(34,"span"),o(35,"Search memories"),n(),i(36,"input",6),x("ngModelChange",function(m){return a.setQuery(m)}),n()(),i(37,"label")(38,"span"),o(39,"Type"),n(),i(40,"select",7),x("ngModelChange",function(m){return a.setKindFilter(m)}),i(41,"option",8),o(42,"Memories and plans"),n(),i(43,"option",9),o(44,"Memories"),n(),i(45,"option",10),o(46,"Plans"),n()()(),i(47,"label")(48,"span"),o(49,"Scope"),n(),i(50,"select",7),x("ngModelChange",function(m){return a.setScopeFilter(m)}),i(51,"option",8),o(52,"All scopes"),n(),i(53,"option",11),o(54,"Global"),n(),i(55,"option",12),o(56,"Repository"),n(),i(57,"option",13),o(58,"Session"),n(),i(59,"option",14),o(60,"Workspace"),n()()(),i(61,"label")(62,"span"),o(63,"Workspace"),n(),i(64,"select",7),x("ngModelChange",function(m){return a.setWorkspaceFilter(m)}),O(65,G,2,2,"option",15,F),n()()(),g(67,_e,10,5,"section",16)(68,ue,6,3,"section",17),n()),e&2&&(l(12),p(_(13,9,a.summary().total)),l(5),p(_(18,11,a.summary().plans)),l(5),p(_(23,13,a.summary().recalls)),l(5),p(_(28,15,a.summary().repositories)),l(9),h("ngModel",a.query()),l(4),h("ngModel",a.kindFilter()),l(10),h("ngModel",a.scopeFilter()),l(14),h("ngModel",a.workspaceFilter()),l(),S(a.workspaceOptions()),l(2),u(a.filteredMemories().length?67:68))},dependencies:[W,L,K,q,A,R,$,j,z,B],styles:['[_nghost-%COMP%]{display:block}.memory-page[_ngcontent-%COMP%]{display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:8px;min-height:calc(100vh - 96px)}.memory-header[_ngcontent-%COMP%], .memory-controls[_ngcontent-%COMP%], .memory-list[_ngcontent-%COMP%], .memory-detail[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%]{border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow-soft)}.memory-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:14px;border-color:color-mix(in srgb,var(--accent-2) 18%,var(--line));border-radius:14px;padding:12px 14px;background:var(--header-gradient)}.eyebrow[_ngcontent-%COMP%], .memory-kicker[_ngcontent-%COMP%]{margin:0;color:var(--muted-2);font-size:9px;font-weight:820;letter-spacing:.08em;text-transform:uppercase}.memory-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .memory-detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--text-strong);letter-spacing:0}.memory-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:21px;line-height:1.15}.memory-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .memory-detail-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.35}.memory-header-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px}.memory-header-meta[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .memory-header-meta[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{display:inline-flex;align-items:center;min-height:24px;border:1px solid var(--line);border-radius:999px;padding:3px 8px;background:color-mix(in srgb,var(--surface) 74%,transparent);color:var(--muted);font-size:11px;font-weight:720;white-space:nowrap}.memory-header-meta[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{margin-right:4px;color:var(--text-strong)}.memory-header-meta[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 28%,var(--line));color:var(--accent)}.memory-controls[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,1.8fr) repeat(3,minmax(130px,.8fr));gap:7px;border-radius:12px;padding:8px}.memory-controls[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:4px}.memory-controls[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;font-weight:760}.memory-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .memory-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;min-height:32px;border:1px solid var(--line);border-radius:8px;padding:6px 9px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:12px}.memory-workspace[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(320px,380px) minmax(0,1fr);gap:10px;align-items:start;min-height:0}.memory-list[_ngcontent-%COMP%], .memory-detail[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%]{border-radius:13px}.memory-list[_ngcontent-%COMP%]{position:sticky;top:70px;display:grid;align-content:start;gap:3px;max-height:calc(100vh - 150px);overflow:auto;padding:7px}.memory-list-heading[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;min-height:28px;padding:2px 4px 5px;background:var(--surface);color:var(--muted);font-size:11px}.memory-list-heading[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .memory-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .memory-facts[_ngcontent-%COMP%] button[_ngcontent-%COMP%], .memory-empty[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:7px;padding:5px 8px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:11px;font-weight:760;cursor:pointer}.memory-card[_ngcontent-%COMP%]{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;min-height:47px;border:1px solid transparent;border-radius:8px;padding:7px 8px;background:transparent;color:var(--text);text-align:left;cursor:pointer}.memory-card[_ngcontent-%COMP%]:hover, .memory-card.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent) 34%,var(--line));background:color-mix(in srgb,var(--accent) 6%,var(--surface-soft))}.memory-card.plan.active[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--accent-2) 42%,var(--line));background:color-mix(in srgb,var(--accent-2) 7%,var(--surface-soft))}.memory-file-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:22px;height:22px;border-radius:6px;background:color-mix(in srgb,var(--accent) 12%,var(--surface-soft));color:var(--accent);font-size:10px;font-weight:850}.memory-card.plan[_ngcontent-%COMP%] .memory-file-icon[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--accent-2) 14%,var(--surface-soft));color:var(--accent-2)}.memory-card-main[_ngcontent-%COMP%], .memory-card-side[_ngcontent-%COMP%]{display:grid;gap:2px;min-width:0}.memory-card-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{overflow:hidden;color:var(--text-strong);font-size:13px;font-weight:760;line-height:1.22;text-overflow:ellipsis;white-space:nowrap}.memory-card-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{overflow:hidden;color:var(--muted-2);font-size:10px;line-height:1.15;text-overflow:ellipsis;white-space:nowrap}.memory-card-side[_ngcontent-%COMP%]{justify-items:end;color:var(--muted-2);font-size:10px;white-space:nowrap}.memory-card-side[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--muted);font-size:10px;text-transform:uppercase}.memory-card-side[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{border-radius:999px;padding:2px 6px;background:color-mix(in srgb,var(--accent) 10%,var(--surface));color:var(--accent);font-style:normal;font-weight:760}.memory-detail[_ngcontent-%COMP%]{min-width:0;padding:14px}.memory-detail-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.memory-detail[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:20px;line-height:1.2}.memory-actions[_ngcontent-%COMP%], .memory-facts[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px}.memory-actions[_ngcontent-%COMP%]{justify-content:flex-end}.memory-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:first-child{border-color:var(--accent);background:var(--accent);color:#fff}.memory-facts[_ngcontent-%COMP%]{margin-top:10px}.memory-facts[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .memory-facts[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:5px;min-height:25px;border:1px solid var(--line);border-radius:999px;padding:4px 8px;background:var(--surface-soft);color:var(--muted);font-size:11px}.memory-facts[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{color:var(--text-strong)}.memory-facts[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:var(--accent)}.memory-action-status[_ngcontent-%COMP%]{margin:9px 0 0;color:var(--accent);font-size:11px}.memory-recalls[_ngcontent-%COMP%]{display:grid;gap:8px;margin-top:12px;border:1px solid color-mix(in srgb,var(--accent) 22%,var(--line));border-radius:10px;padding:10px;background:color-mix(in srgb,var(--accent) 4%,var(--surface-soft))}.memory-recalls[_ngcontent-%COMP%] > header[_ngcontent-%COMP%]{display:flex;align-items:end;justify-content:space-between;gap:10px}.memory-recalls[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:2px 0 0;color:var(--text-strong);font-size:14px}.memory-recalls[_ngcontent-%COMP%] > header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .memory-recall-note[_ngcontent-%COMP%]{margin:0;color:var(--muted);font-size:11px}.memory-recall-list[_ngcontent-%COMP%]{display:grid;gap:5px}.memory-recall-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(230px,1.2fr);gap:10px;border-top:1px solid var(--line);padding-top:7px}.memory-recall-row[_ngcontent-%COMP%] > div[_ngcontent-%COMP%], .memory-recall-facts[_ngcontent-%COMP%]{display:grid;gap:2px}.memory-recall-row[_ngcontent-%COMP%] time[_ngcontent-%COMP%], .memory-recall-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:11px}.memory-recall-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:fit-content;border:0;padding:0;background:none;color:var(--accent);font:inherit;font-size:12px;font-weight:760;text-align:left;cursor:pointer}.memory-source[_ngcontent-%COMP%]{margin-top:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:38px;padding:8px 11px;color:var(--text-strong);cursor:pointer;list-style:none}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]::-webkit-details-marker{display:none}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:before{content:"";flex:0 0 auto;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);transition:transform .14s ease}.memory-source[open][_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:before{transform:rotate(45deg)}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;font-size:12px;font-weight:780}.memory-source[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:var(--muted);font-size:11px}.memory-content[_ngcontent-%COMP%]{max-height:48vh;margin:0;border-top:1px solid var(--line);padding:14px;overflow:auto;color:var(--text);font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,monospace;font-size:12px;line-height:1.58;white-space:pre-wrap;overflow-wrap:anywhere}.memory-path[_ngcontent-%COMP%]{display:grid;gap:4px;margin-top:10px;color:var(--muted-2);font-size:10px;text-transform:uppercase}.memory-path[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{display:block;border:1px solid var(--line);border-radius:8px;padding:7px 9px;background:var(--surface-soft);color:var(--muted);font-size:11px;text-transform:none;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text}.memory-empty[_ngcontent-%COMP%]{display:grid;justify-items:start;padding:28px}@media(max-width:1050px){.memory-controls[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}.memory-search[_ngcontent-%COMP%]{grid-column:1 / -1}}@media(max-width:820px){.memory-page[_ngcontent-%COMP%]{min-height:auto}.memory-detail-header[_ngcontent-%COMP%]{display:grid}.memory-workspace[_ngcontent-%COMP%]{grid-template-columns:1fr}.memory-header[_ngcontent-%COMP%]{align-items:flex-start;padding:10px}.memory-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.memory-header-meta[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,max-content);justify-content:end;gap:4px}.memory-header-meta[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .memory-header-meta[_ngcontent-%COMP%] b[_ngcontent-%COMP%]{min-height:21px;padding:2px 6px;font-size:10px}.memory-controls[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}.memory-search[_ngcontent-%COMP%]{grid-column:1 / -1}.memory-list[_ngcontent-%COMP%]{position:static;max-height:420px}.memory-actions[_ngcontent-%COMP%]{justify-content:flex-start}.memory-recalls[_ngcontent-%COMP%] > header[_ngcontent-%COMP%], .memory-recall-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr}}@media(max-width:480px){.memory-header[_ngcontent-%COMP%]{display:grid}.memory-header-meta[_ngcontent-%COMP%]{justify-content:start}.memory-controls[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .memory-controls[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{padding-inline:6px;font-size:11px}.memory-controls[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:9px}}']})};export{H as MemoryPageComponent};
@@ -0,0 +1 @@
1
+ import{a as H,b as $,c as W,d as V,e as j,f as q,g as J,h as K,i as y,m as Q,r as X,s as Y}from"./chunk-TICIZRSM.js";import{$a as O,Ca as f,Da as w,Fa as M,Ga as v,Ha as c,Ia as t,Ja as n,Ka as x,O as U,Oa as F,P as D,Qa as E,Sa as C,Ta as L,U as N,Ua as z,Va as i,Wa as s,Xa as d,Ya as T,Z as S,_a as p,a as b,ab as _,b as k,db as P,ja as A,ka as o,nb as G,ob as B,sa as R,sb as Z,ub as ee,vb as te,wb as ne,xb as ie,yb as ae,zb as oe}from"./chunk-WOIYAEKB.js";var re=(l,a)=>a.id,ce=(l,a)=>a.value,se=(l,a)=>a.model+":"+a.tier;function pe(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.id),o(),s(e.label)}}function de(l,a){if(l&1&&(t(0,"option",10),i(1),n()),l&2){let e=a.$implicit;c("value",e.value),o(),s(e.label)}}function ge(l,a){if(l&1){let e=F();t(0,"button",24),E("click",function(){let g=U(e).$implicit,m=C();return D(m.setSelectedAllowancePlan(g.id))}),t(1,"span"),i(2),n(),t(3,"strong"),i(4),p(5,"number"),n(),t(6,"em"),i(7),n()()}if(l&2){let e=a.$implicit,r=C();z("active",r.selectedAllowance().id===e.id),o(2),s(e.period),o(2),s(O(5,5,e.creditsPerUserMonthly)),o(3),d("",e.label," credits/user/month")}}function me(l,a){if(l&1&&(t(0,"em"),i(1),n()),l&2){let e=C().$implicit;o(),s(e.note)}}function ue(l,a){if(l&1&&(i(0),p(1,"number")),l&2){let e=C().$implicit;d(" $",_(1,1,e.cacheWrite,"1.0-3")," ")}}function he(l,a){l&1&&i(0," - ")}function xe(l,a){if(l&1&&(t(0,"span",26),i(1," Used by imports "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function _e(l,a){if(l&1&&(t(0,"span",26),i(1," Estimate fallback "),x(2,"app-help-popover",28),n()),l&2){let e=C(3);o(2),c("text",e.help.pricingFallback)}}function Ce(l,a){l&1&&(t(0,"span",27),i(1,"Direct pricing"),n())}function Pe(l,a){if(l&1&&f(0,xe,3,1,"span",26)(1,_e,3,1,"span",26)(2,Ce,2,0,"span",27),l&2){let e=C().$implicit;w(e.usedDirectly&&e.usedAsFallback?0:e.usedAsFallback?1:2)}}function be(l,a){l&1&&(t(0,"span",25),i(1,"Not yet"),n())}function fe(l,a){if(l&1&&(t(0,"div",23)(1,"strong"),i(2),f(3,me,2,1,"em"),n(),t(4,"span"),i(5),n(),t(6,"span"),i(7),n(),t(8,"span"),i(9),n(),t(10,"span"),i(11),t(12,"em"),i(13),n()(),t(14,"span"),i(15),p(16,"number"),n(),t(17,"span"),i(18),p(19,"number"),n(),t(20,"span"),f(21,ue,2,4)(22,he,1,0),n(),t(23,"span"),i(24),p(25,"number"),n(),t(26,"span"),f(27,Pe,3,1)(28,be,2,0,"span",25),n()()),l&2){let e=a.$implicit;o(2),d(" ",e.model," "),o(),w(e.note?3:-1),o(2),s(e.provider),o(2),s(e.releaseStatus),o(2),s(e.category),o(2),d(" ",e.tier," "),o(2),s(e.threshold),o(2),d("$",_(16,12,e.input,"1.0-3")),o(3),d("$",_(19,15,e.cachedInput,"1.0-3")),o(3),w(e.cacheWrite?21:22),o(3),d("$",_(25,18,e.output,"1.0-3")),o(3),w(e.usedByImportedSessions?27:28)}}var le=class l{sessionsInput=S([]);selectedAllowancePlanInput=S("business-standard");usageTimeRange=S("all");set sessions(a){this.sessionsInput.set(a??[])}set selectedAllowancePlan(a){this.selectedAllowancePlanInput.set(a??"business-standard")}selectedAllowancePlanChange=new N;pricingVersion=H;pricingSourceLabel=W;pricingSourceUrl=$;pricingSnapshotDate=V;pricingImportedAt=j;allowanceSourceUrl=J;creditUsd=q;allowancePlans=y;usageTimeOptions=[{value:"all",label:"All imported sessions"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"90d",label:"Last 90 days"}];help={inputTokens:"Normal, non-cached input/context tokens priced at the GitHub input rate. Raw VS Code inputTokens can be higher when cachedTokens are present.",outputTokens:"Generated model response tokens.",cachedInput:"Input/context tokens VS Code reported as cachedTokens. They are part of raw input, but priced with GitHub cached-input rates instead of normal input rates.",cacheWrite:"Provider cache creation tokens when the billing source exposes them. GitHub lists this mainly for Anthropic pricing rows.",pricingFallback:"The raw model name from VS Code did not match a GitHub price row in the local pricing table, so the estimate uses the displayed fallback price row. Treat this as an explicit estimate assumption.",allowance:"Included AI credits for Copilot Business and Enterprise are monthly per assigned license, but GitHub pools them at the organization or enterprise billing entity level.",credit:"GitHub states that 1 AI credit equals $0.01 USD. When VS Code logs GitHub source usage, the app uses that first; otherwise it converts the local token estimate into credits.",usageWindow:"This only filters the imported sessions used by the allowance meter. It does not change the GitHub price table below."};selectedAllowance=P(()=>y.find(a=>a.id===this.selectedAllowancePlanInput())??y[0]);allowanceSessions=P(()=>{let a=this.usageCutoff(this.sessionsInput(),this.usageTimeRange());return this.sessionsInput().filter(e=>!a||new Date(e.startedAt).getTime()>=a)});totalEstimateUsd=P(()=>this.allowanceSessions().reduce((a,e)=>a+X(e),0));totalEstimateCredits=P(()=>this.allowanceSessions().reduce((a,e)=>a+Y(e),0));selectedAllowanceUsage=P(()=>{let a=this.selectedAllowance(),e=this.totalEstimateCredits(),r=a.creditsPerUserMonthly>0?e/a.creditsPerUserMonthly*100:0;return{credits:e,share:r,perUserCredits:a.creditsPerUserMonthly,sessions:this.allowanceSessions().length,totalSessions:this.sessionsInput().length,windowLabel:this.usageTimeOptions.find(g=>g.value===this.usageTimeRange())?.label??"All imported sessions"}});pricingRows=P(()=>Object.entries(K).flatMap(([a,e])=>{let r=u=>{let I=this.sessionsInput().flatMap(h=>h.modelBreakdown).filter(h=>h.pricingModel===a&&(h.pricingTiers?.includes(u)??u===(e.tierLabel??"Default")));return{usedByImportedSessions:I.length>0,usedDirectly:I.some(h=>!this.usesPricingFallback(h.model,h.pricingModel)),usedAsFallback:I.some(h=>this.usesPricingFallback(h.model,h.pricingModel))}},g={model:a,provider:e.provider,releaseStatus:e.releaseStatus,category:e.category,note:e.note},m=e.tierLabel??"Default";return[k(b(b({},g),r(m)),{tier:m,threshold:e.tierThresholdLabel??"All request sizes",input:e.input,cachedInput:e.cachedInput,cacheWrite:e.cacheWrite??0,output:e.output}),...(e.tiers??[]).map(u=>k(b(b({},g),r(u.label)),{tier:u.label,threshold:u.thresholdLabel,input:u.input,cachedInput:u.cachedInput,cacheWrite:u.cacheWrite??e.cacheWrite??0,output:u.output}))]}));setSelectedAllowancePlan(a){if(!y.some(r=>r.id===a))return;let e=a;this.selectedAllowancePlanInput.set(e),this.selectedAllowancePlanChange.emit(e)}setUsageTimeRange(a){this.usageTimeOptions.some(e=>e.value===a)&&this.usageTimeRange.set(a)}usesPricingFallback=Q;usageCutoff(a,e){if(e==="all"||!a.length)return null;let r=e==="7d"?7:e==="30d"?30:90,g=Math.max(...a.map(m=>new Date(m.startedAt).getTime()).filter(Number.isFinite));return Number.isFinite(g)?g-r*24*60*60*1e3:null}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-pricing-page"]],inputs:{sessions:"sessions",selectedAllowancePlan:"selectedAllowancePlan"},outputs:{selectedAllowancePlanChange:"selectedAllowancePlanChange"},decls:129,vars:46,consts:[[1,"pricing-page"],[1,"pricing-header"],[1,"eyebrow"],["target","_blank","rel","noreferrer",3,"href"],[1,"pricing-source"],["aria-label","GitHub Copilot AI credit allowance",1,"allowance-panel"],[1,"allowance-copy"],[1,"allowance-control"],["label","Explain AI credit allowance",3,"text"],[3,"ngModelChange","ngModel"],[3,"value"],["label","Explain usage window",3,"text"],[1,"allowance-meter"],["aria-hidden","true",1,"allowance-bar"],["aria-label","Available Copilot allowance plans",1,"allowance-grid"],["type","button",1,"allowance-card",3,"active"],[1,"pricing-note"],[1,"pricing-table"],[1,"pricing-row","pricing-row-heading"],["label","Explain normal input",3,"text"],["label","Explain cached input",3,"text"],["label","Explain cache write",3,"text"],["label","Explain output tokens",3,"text"],[1,"pricing-row"],["type","button",1,"allowance-card",3,"click"],[1,"muted"],[1,"used-pill","fallback-used"],[1,"used-pill"],["label","Explain fallback pricing",3,"text"]],template:function(e,r){e&1&&(t(0,"section",0)(1,"div",1)(2,"div")(3,"p",2),i(4,"Cost inputs"),n(),t(5,"h2"),i(6,"GitHub Copilot prices used by this app"),n(),t(7,"p"),i(8," Evidence page for the rate card, AI-credit conversion, source usage, and token-estimate fallback. "),n()(),t(9,"a",3),i(10,"Open GitHub source"),n()(),t(11,"section",4)(12,"div")(13,"span"),i(14,"Source"),n(),t(15,"strong"),i(16),n()(),t(17,"div")(18,"span"),i(19,"Pricing version"),n(),t(20,"strong"),i(21),n()(),t(22,"div")(23,"span"),i(24,"Source checked"),n(),t(25,"strong"),i(26),p(27,"date"),n()(),t(28,"div")(29,"span"),i(30,"Imported into app"),n(),t(31,"strong"),i(32),p(33,"date"),n()()(),t(34,"section",5)(35,"div",6)(36,"p",2),i(37,"License allowance"),n(),t(38,"h3"),i(39,"AI credits context"),n(),t(40,"p"),i(41," GitHub converts model usage into AI credits at "),t(42,"strong"),i(43),p(44,"number"),n(),i(45,". The meter below compares imported source usage, with token estimates as fallback, against the selected per-license allowance. "),n(),t(46,"a",3),i(47,"Open allowance source"),n()(),t(48,"div",7)(49,"label")(50,"span"),i(51," Selected plan "),x(52,"app-help-popover",8),n(),t(53,"select",9),E("ngModelChange",function(m){return r.setSelectedAllowancePlan(m)}),M(54,pe,2,2,"option",10,re),n()(),t(56,"label")(57,"span"),i(58," Usage window "),x(59,"app-help-popover",11),n(),t(60,"select",9),E("ngModelChange",function(m){return r.setUsageTimeRange(m)}),M(61,de,2,2,"option",10,ce),n()(),t(63,"div",12)(64,"div")(65,"span"),i(66),n(),t(67,"strong"),i(68),p(69,"number"),n(),t(70,"em"),i(71),p(72,"number"),p(73,"number"),n()(),t(74,"div")(75,"span"),i(76,"Monthly allowance"),n(),t(77,"strong"),i(78),p(79,"number"),n()(),t(80,"div")(81,"span"),i(82,"Allowance used"),n(),t(83,"strong"),i(84),p(85,"number"),n()()(),t(86,"div",13),x(87,"span"),n(),t(88,"p"),i(89),n()()(),t(90,"section",14),M(91,ge,8,7,"button",15,re),n(),t(93,"div",16)(94,"strong"),i(95,"Calculation rule"),n(),t(96,"p"),i(97," Per-1M-token GitHub rates are multiplied by imported VS Code token buckets. Normal input is "),t(98,"code"),i(99,"inputTokens - cachedTokens"),n(),i(100," when cached tokens are present. Estimates stay in USD because GitHub prices and AI credits are USD-native; cache write is only priced when a numeric cache-write field is imported. Long-context rates are selected independently for each model call from that call's normal plus cached input. "),n()(),t(101,"div",17)(102,"div",18)(103,"span"),i(104,"Model"),n(),t(105,"span"),i(106,"Provider"),n(),t(107,"span"),i(108,"Status"),n(),t(109,"span"),i(110,"Category"),n(),t(111,"span"),i(112,"Tier"),n(),t(113,"span"),i(114,"Normal input "),x(115,"app-help-popover",19),n(),t(116,"span"),i(117,"Cached input "),x(118,"app-help-popover",20),n(),t(119,"span"),i(120,"Cache write "),x(121,"app-help-popover",21),n(),t(122,"span"),i(123,"Output "),x(124,"app-help-popover",22),n(),t(125,"span"),i(126,"Used"),n()(),M(127,fe,29,21,"div",23,se),n()()),e&2&&(o(9),c("href",r.pricingSourceUrl,A),o(7),s(r.pricingSourceLabel),o(5),s(r.pricingVersion),o(5),s(_(27,25,r.pricingSnapshotDate,"MMM d, y")),o(6),s(_(33,28,r.pricingImportedAt,"MMM d, y")),o(11),d("1 credit = $",_(44,31,r.creditUsd,"1.2-2")," USD"),o(3),c("href",r.allowanceSourceUrl,A),o(6),c("text",r.help.allowance),o(),c("ngModel",r.selectedAllowance().id),o(),v(r.allowancePlans),o(5),c("text",r.help.usageWindow),o(),c("ngModel",r.usageTimeRange()),o(),v(r.usageTimeOptions),o(5),s(r.selectedAllowanceUsage().windowLabel),o(2),d("",_(69,34,r.selectedAllowanceUsage().credits,"1.0-1")," credits"),o(3),T("",O(72,37,r.selectedAllowanceUsage().sessions)," of ",O(73,39,r.selectedAllowanceUsage().totalSessions)," sessions"),o(7),d("",O(79,41,r.selectedAllowance().creditsPerUserMonthly)," credits/user"),o(6),d("",_(85,43,r.selectedAllowanceUsage().share,"1.0-1"),"%"),o(3),L("width",r.selectedAllowanceUsage().share>100?100:r.selectedAllowanceUsage().share,"%"),o(2),T("",r.selectedAllowance().period,". ",r.selectedAllowance().note),o(2),v(r.allowancePlans),o(24),c("text",r.help.inputTokens),o(3),c("text",r.help.cachedInput),o(3),c("text",r.help.cacheWrite),o(3),c("text",r.help.outputTokens),o(3),v(r.pricingRows()))},dependencies:[oe,ie,ae,ne,ee,te,Z,G,B],styles:["[_nghost-%COMP%]{display:block}.pricing-page[_ngcontent-%COMP%]{display:grid;gap:16px}.pricing-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pricing-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:22px;font-weight:760;letter-spacing:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.pricing-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:not(.eyebrow){max-width:720px;margin-top:6px;color:var(--muted);font-size:12px;line-height:1.45}.pricing-header[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{border:1px solid var(--line-strong);border-radius:999px;padding:7px 10px;color:var(--text);font-size:12px;font-weight:720;text-decoration:none;white-space:nowrap}.pricing-source[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow, 0 18px 50px rgba(0, 0, 0, .22))}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:12px;border-right:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-right:0}.pricing-source[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--muted);font-size:12px}.pricing-source[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;color:var(--text);font-weight:760}.pricing-note[_ngcontent-%COMP%]{border:1px solid var(--line);border-left:4px solid var(--accent-2);border-radius:12px;padding:12px 14px;background:var(--surface-soft)}.pricing-note[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong)}.pricing-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{max-width:940px;margin:4px 0 0;line-height:1.45}.allowance-panel[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(320px,1.15fr);gap:14px;border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--header-gradient, linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(31, 209, 165, .07)), var(--surface))}.allowance-copy[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;color:var(--text-strong);font-size:18px;font-weight:760}.allowance-copy[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-control[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] em[_ngcontent-%COMP%], .allowance-card[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--muted);font-size:12px;line-height:1.45}.allowance-copy[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;margin-top:8px;color:var(--accent-2);font-size:12px;font-weight:760;text-decoration:none}.allowance-control[_ngcontent-%COMP%]{display:grid;align-content:start;gap:12px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:grid;gap:6px}.allowance-control[_ngcontent-%COMP%] label[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;font-weight:760}.allowance-control[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line-strong);border-radius:10px;padding:8px 10px;background:var(--control-bg, rgba(5, 12, 22, .55));color:var(--text);font:inherit;font-weight:720}.allowance-meter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:10px;padding:10px;background:var(--surface-soft)}.allowance-meter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:var(--muted);font-size:11px}.allowance-meter[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--muted);font-size:11px;font-style:normal}.allowance-meter[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:3px;color:var(--text-strong);font-size:16px;font-weight:760}.allowance-bar[_ngcontent-%COMP%]{height:7px;overflow:hidden;border-radius:999px;background:#6170852e}.allowance-bar[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent-2),#ffba4a)}.allowance-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.allowance-card[_ngcontent-%COMP%]{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface);color:inherit;font:inherit;text-align:left;cursor:pointer}.allowance-card.active[_ngcontent-%COMP%]{border-color:#1fd1a570;background:#1fd1a517;box-shadow:0 0 0 1px #1fd1a51f inset}.allowance-card[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text-strong);font-size:20px;font-weight:760}.pricing-table[_ngcontent-%COMP%]{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.pricing-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(210px,1.35fr) repeat(3,minmax(100px,.65fr)) minmax(150px,.9fr) repeat(4,minmax(100px,.58fr)) minmax(124px,.7fr);min-width:1240px;border-bottom:1px solid var(--line)}.pricing-row[_ngcontent-%COMP%]:last-child{border-bottom:0}.pricing-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:10px 12px}.pricing-row-heading[_ngcontent-%COMP%]{background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:720;text-transform:uppercase}.pricing-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--text);font-size:14px;font-weight:760}.pricing-row[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{display:block;margin-top:4px;color:var(--text);font-size:12px;font-style:normal;font-weight:600}.used-pill[_ngcontent-%COMP%]{display:inline-flex;border:1px solid rgba(31,209,165,.35);border-radius:999px;padding:4px 8px;background:#1fd1a51f;color:var(--success-text, #bbfff0)!important;font-size:12px;font-weight:900;white-space:nowrap}.used-pill.fallback-used[_ngcontent-%COMP%]{border-color:#ffba4a73;background:#ffba4a1f;color:var(--warning-text, #ffe0a0)!important}.muted[_ngcontent-%COMP%]{color:var(--muted)}.eyebrow[_ngcontent-%COMP%]{color:var(--accent-2);font-size:10px;font-weight:760;letter-spacing:.08em;text-transform:uppercase}@media(max-width:900px){.pricing-header[_ngcontent-%COMP%], .pricing-source[_ngcontent-%COMP%]{display:grid}.pricing-source[_ngcontent-%COMP%], .allowance-panel[_ngcontent-%COMP%], .allowance-grid[_ngcontent-%COMP%], .allowance-meter[_ngcontent-%COMP%]{grid-template-columns:1fr}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid var(--line)}.pricing-source[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border-bottom:0}}.used-pill[_ngcontent-%COMP%]{padding:3px 7px;font-size:11px;font-weight:760}@media(max-width:1100px){.allowance-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{box-shadow:var(--shadow-soft)}.theme-light[_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-source[_ngcontent-%COMP%]{background:linear-gradient(180deg,#ffffffc2,#ffffff75),var(--surface)}.theme-light[_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-note[_ngcontent-%COMP%]{background:linear-gradient(135deg,#0c9f830b,#6f5cff05),var(--surface)}.theme-light[_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-panel[_ngcontent-%COMP%]{border-color:#bdcbdae6}.theme-light[_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-card[_ngcontent-%COMP%], .theme-light[_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .allowance-meter[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{background:#ffffffad}.theme-light[_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%], .theme-light [_nghost-%COMP%] .pricing-table[_ngcontent-%COMP%]{background:var(--surface)}"]})};export{le as PricingPageComponent};
@@ -1,2 +1,2 @@
1
- import{A as Q,D as m,F as g,H as T,I as v,J as h,K as H,M as J,N as ee,R as re,_ as te,e as W,j as X,jb as oe,n as k,na as ne,ob as se,pb as ie,s as Y,u as q,w as Z}from"./chunk-KDAJN6DF.js";var E=class t{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
2
- `).forEach(r=>{let n=r.indexOf(":");if(n>0){let o=r.slice(0,n),s=r.slice(n+1).trim();this.addHeaderEntry(o,s)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((r,n)=>{this.addHeaderEntry(n,r)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([r,n])=>{this.setHeaderEntries(r,n)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let r=this.headers.get(e.toLowerCase());return r&&r.length>0?r[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,r){return this.clone({name:e,value:r,op:"a"})}set(e,r){return this.clone({name:e,value:r,op:"s"})}delete(e,r){return this.clone({name:e,value:r,op:"d"})}maybeSetNormalizedName(e,r){this.normalizedNames.has(r)||this.normalizedNames.set(r,e)}init(){this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(r=>{this.headers.set(r,e.headers.get(r)),this.normalizedNames.set(r,e.normalizedNames.get(r))})}clone(e){let r=new t;return r.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,r.lazyUpdate=(this.lazyUpdate||[]).concat([e]),r}applyUpdate(e){let r=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(e.name,r);let o=(e.op==="a"?this.headers.get(r):void 0)||[];o.push(...n),this.headers.set(r,o);break;case"d":let s=e.value;if(!s)this.headers.delete(r),this.normalizedNames.delete(r);else{let i=this.headers.get(r);if(!i)return;i=i.filter(l=>s.indexOf(l)===-1),i.length===0?(this.headers.delete(r),this.normalizedNames.delete(r)):this.headers.set(r,i)}break}}addHeaderEntry(e,r){let n=e.toLowerCase();this.maybeSetNormalizedName(e,n),this.headers.has(n)?this.headers.get(n).push(r):this.headers.set(n,[r])}setHeaderEntries(e,r){let n=(Array.isArray(r)?r:[r]).map(s=>s.toString()),o=e.toLowerCase();this.headers.set(o,n),this.maybeSetNormalizedName(e,o)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(r=>e(this.normalizedNames.get(r),this.headers.get(r)))}};var L=class{map=new Map;set(e,r){return this.map.set(e,r),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}},S=class{encodeKey(e){return ae(e)}encodeValue(e){return ae(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function we(t,e){let r=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(o=>{let s=o.indexOf("="),[i,l]=s==-1?[e.decodeKey(o),""]:[e.decodeKey(o.slice(0,s)),e.decodeValue(o.slice(s+1))],a=r.get(i)||[];a.push(l),r.set(i,a)}),r}var be=/%(\d[a-f0-9])/gi,Re={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function ae(t){return encodeURIComponent(t).replace(be,(e,r)=>Re[r]??e)}function U(t){return`${t}`}var y=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new S,e.fromString){if(e.fromObject)throw new m(2805,!1);this.map=we(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(r=>{let n=e.fromObject[r],o=Array.isArray(n)?n.map(U):[U(n)];this.map.set(r,o)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,r){return this.clone({param:e,value:r,op:"a"})}appendAll(e){let r=[];return Object.keys(e).forEach(n=>{let o=e[n];Array.isArray(o)?o.forEach(s=>{r.push({param:n,value:s,op:"a"})}):r.push({param:n,value:o,op:"a"})}),this.clone(r)}set(e,r){return this.clone({param:e,value:r,op:"s"})}delete(e,r){return this.clone({param:e,value:r,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let r=this.encoder.encodeKey(e);return this.map.get(e).map(n=>r+"="+this.encoder.encodeValue(n)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let r=new t({encoder:this.encoder});return r.cloneFrom=this.cloneFrom||this,r.updates=(this.updates||[]).concat(e),r}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let r=(e.op==="a"?this.map.get(e.param):void 0)||[];r.push(U(e.value)),this.map.set(e.param,r);break;case"d":if(e.value!==void 0){let n=this.map.get(e.param)||[],o=n.indexOf(U(e.value));o!==-1&&n.splice(o,1),n.length>0?this.map.set(e.param,n):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};function Pe(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function ce(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function de(t){return typeof Blob<"u"&&t instanceof Blob}function le(t){return typeof FormData<"u"&&t instanceof FormData}function Me(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}var ue="Content-Type",he="Accept",fe="text/plain",pe="application/json",Ne=`${pe}, ${fe}, */*`,M=class t{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;referrerPolicy;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(e,r,n,o){this.url=r,this.method=e.toUpperCase();let s;if(Pe(this.method)||o?(this.body=n!==void 0?n:null,s=o):s=n,s){if(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,this.keepalive=!!s.keepalive,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),s.priority&&(this.priority=s.priority),s.cache&&(this.cache=s.cache),s.credentials&&(this.credentials=s.credentials),typeof s.timeout=="number"){if(s.timeout<1||!Number.isInteger(s.timeout))throw new m(2822,"");this.timeout=s.timeout}s.mode&&(this.mode=s.mode),s.redirect&&(this.redirect=s.redirect),s.integrity&&(this.integrity=s.integrity),s.referrer&&(this.referrer=s.referrer),s.referrerPolicy&&(this.referrerPolicy=s.referrerPolicy),this.transferCache=s.transferCache}if(this.headers??=new E,this.context??=new L,!this.params)this.params=new y,this.urlWithParams=r;else{let i=this.params.toString();if(i.length===0)this.urlWithParams=r;else{let l=r.indexOf("?"),a=l===-1?"?":l<r.length-1?"&":"";this.urlWithParams=r+a+i}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||ce(this.body)||de(this.body)||le(this.body)||Me(this.body)?this.body:this.body instanceof y?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||le(this.body)?null:de(this.body)?this.body.type||null:ce(this.body)?null:typeof this.body=="string"?fe:this.body instanceof y?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?pe:null}clone(e={}){let r=e.method||this.method,n=e.url||this.url,o=e.responseType||this.responseType,s=e.keepalive??this.keepalive,i=e.priority||this.priority,l=e.cache||this.cache,a=e.mode||this.mode,f=e.redirect||this.redirect,x=e.credentials||this.credentials,w=e.referrer||this.referrer,D=e.integrity||this.integrity,F=e.referrerPolicy||this.referrerPolicy,j=e.transferCache??this.transferCache,C=e.timeout??this.timeout,c=e.body!==void 0?e.body:this.body,d=e.withCredentials??this.withCredentials,p=e.reportProgress??this.reportProgress,P=e.headers||this.headers,u=e.params||this.params,I=e.context??this.context;return e.setHeaders!==void 0&&(P=Object.keys(e.setHeaders).reduce((A,b)=>A.set(b,e.setHeaders[b]),P)),e.setParams&&(u=Object.keys(e.setParams).reduce((A,b)=>A.set(b,e.setParams[b]),u)),new t(r,n,c,{params:u,headers:P,context:I,reportProgress:p,responseType:o,withCredentials:d,transferCache:j,keepalive:s,cache:l,priority:i,timeout:C,mode:a,redirect:f,credentials:x,referrer:w,integrity:D,referrerPolicy:F})}},R=(function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t})(R||{}),O=class{headers;status;statusText;url;ok;type;redirected;responseType;constructor(e,r=200,n="OK"){this.headers=e.headers||new E,this.status=e.status!==void 0?e.status:r,this.statusText=e.statusText||n,this.url=e.url||null,this.redirected=e.redirected,this.responseType=e.responseType,this.ok=this.status>=200&&this.status<300}},B=class t extends O{constructor(e={}){super(e)}type=R.ResponseHeader;clone(e={}){return new t({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},_=class t extends O{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=R.Response;clone(e={}){return new t({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0,redirected:e.redirected??this.redirected,responseType:e.responseType??this.responseType})}},N=class extends O{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},Oe=200,De=204;var Ie=new T("");var Ae=/^\)\]\}',?\n/;var V=(()=>{class t{xhrFactory;tracingService=h(ne,{optional:!0});constructor(r){this.xhrFactory=r}maybePropagateTrace(r){return this.tracingService?.propagate?this.tracingService.propagate(r):r}handle(r){if(r.method==="JSONP")throw new m(-2800,!1);let n=this.xhrFactory;return X(null).pipe(Q(()=>new W(s=>{let i=n.build();if(i.open(r.method,r.urlWithParams),r.withCredentials&&(i.withCredentials=!0),r.headers.forEach((c,d)=>i.setRequestHeader(c,d.join(","))),r.headers.has(he)||i.setRequestHeader(he,Ne),!r.headers.has(ue)){let c=r.detectContentTypeHeader();c!==null&&i.setRequestHeader(ue,c)}if(r.timeout&&(i.timeout=r.timeout),r.responseType){let c=r.responseType.toLowerCase();i.responseType=c!=="json"?c:"text"}let l=r.serializeBody(),a=null,f=()=>{if(a!==null)return a;let c=i.statusText||"OK",d=new E(i.getAllResponseHeaders()),p=i.responseURL||r.url;return a=new B({headers:d,status:i.status,statusText:c,url:p}),a},x=this.maybePropagateTrace(()=>{let{headers:c,status:d,statusText:p,url:P}=f(),u=null;d!==De&&(u=typeof i.response>"u"?i.responseText:i.response),d===0&&(d=u?Oe:0);let I=d>=200&&d<300;if(r.responseType==="json"&&typeof u=="string"){let A=u;u=u.replace(Ae,"");try{u=u!==""?JSON.parse(u):null}catch(b){u=A,I&&(I=!1,u={error:b,text:u})}}I?(s.next(new _({body:u,headers:c,status:d,statusText:p,url:P||void 0})),s.complete()):s.error(new N({error:u,headers:c,status:d,statusText:p,url:P||void 0}))}),w=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:c,status:i.status||0,statusText:i.statusText||"Unknown Error",url:d||void 0});s.error(p)}),D=w;r.timeout&&(D=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:new DOMException("Request timed out","TimeoutError"),status:i.status||0,statusText:i.statusText||"Request timeout",url:d||void 0});s.error(p)}));let F=!1,j=this.maybePropagateTrace(c=>{F||(s.next(f()),F=!0);let d={type:R.DownloadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),r.responseType==="text"&&i.responseText&&(d.partialText=i.responseText),s.next(d)}),C=this.maybePropagateTrace(c=>{let d={type:R.UploadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),s.next(d)});return i.addEventListener("load",x),i.addEventListener("error",w),i.addEventListener("timeout",D),i.addEventListener("abort",w),r.reportProgress&&(i.addEventListener("progress",j),l!==null&&i.upload&&i.upload.addEventListener("progress",C)),i.send(l),s.next({type:R.Sent}),()=>{i.removeEventListener("error",w),i.removeEventListener("abort",w),i.removeEventListener("load",x),i.removeEventListener("timeout",D),r.reportProgress&&(i.removeEventListener("progress",j),l!==null&&i.upload&&i.upload.removeEventListener("progress",C)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||t)(v(ie))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ke(t,e){return e(t)}function _e(t,e,r){return(n,o)=>ee(r,()=>e(n,s=>t(s,o)))}var ye=new T("",{factory:()=>[]}),me=new T(""),ge=new T("",{factory:()=>!0});var G=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(V),o},providedIn:"root"})}return t})();var z=(()=>{class t{backend;injector;chain=null;pendingTasks=h(te);contributeToStability=h(ge);constructor(r,n){this.backend=r,this.injector=n}handle(r){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(ye),...this.injector.get(me,[])]));this.chain=n.reduceRight((o,s)=>_e(o,s,this.injector),ke)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(r,o=>this.backend.handle(o)).pipe(Z(n))}else return this.chain(r,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||t)(v(G),v(J))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),K=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(z),o},providedIn:"root"})}return t})();function $(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials,credentials:t.credentials,transferCache:t.transferCache,timeout:t.timeout,keepalive:t.keepalive,priority:t.priority,cache:t.cache,mode:t.mode,redirect:t.redirect,integrity:t.integrity,referrer:t.referrer,referrerPolicy:t.referrerPolicy}}var Te=(()=>{class t{handler;constructor(r){this.handler=r}request(r,n,o={}){let s;if(r instanceof M)s=r;else{let a;o.headers instanceof E?a=o.headers:a=new E(o.headers);let f;o.params&&(o.params instanceof y?f=o.params:f=new y({fromObject:o.params})),s=new M(r,n,o.body!==void 0?o.body:null,{headers:a,context:o.context,params:f,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache,keepalive:o.keepalive,priority:o.priority,cache:o.cache,mode:o.mode,redirect:o.redirect,credentials:o.credentials,referrer:o.referrer,referrerPolicy:o.referrerPolicy,integrity:o.integrity,timeout:o.timeout})}let i=X(s).pipe(q(a=>this.handler.handle(a)));if(r instanceof M||o.observe==="events")return i;let l=i.pipe(Y(a=>a instanceof _));switch(o.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return l.pipe(k(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new m(2806,!1);return a.body}));case"blob":return l.pipe(k(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new m(2807,!1);return a.body}));case"text":return l.pipe(k(a=>{if(a.body!==null&&typeof a.body!="string")throw new m(2808,!1);return a.body}));default:return l.pipe(k(a=>a.body))}case"response":return l;default:throw new m(2809,!1)}}delete(r,n={}){return this.request("DELETE",r,n)}get(r,n={}){return this.request("GET",r,n)}head(r,n={}){return this.request("HEAD",r,n)}jsonp(r,n){return this.request("JSONP",r,{params:new y().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(r,n={}){return this.request("OPTIONS",r,n)}patch(r,n,o={}){return this.request("PATCH",r,$(o,n))}post(r,n,o={}){return this.request("POST",r,$(o,n))}put(r,n,o={}){return this.request("PUT",r,$(o,n))}static \u0275fac=function(n){return new(n||t)(v(K))};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var xe=new T("",{factory:()=>!0}),Fe="XSRF-TOKEN",je=new T("",{factory:()=>Fe}),Ce="X-XSRF-TOKEN",Ue=new T("",{factory:()=>Ce}),Le=(()=>{class t{cookieName=h(je);doc=h(re);lastCookieString="";lastToken=null;parseCount=0;getToken(){let r=this.doc.cookie||"";return r!==this.lastCookieString&&(this.parseCount++,this.lastToken=se(r,this.cookieName),this.lastCookieString=r),this.lastToken}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ve=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(Le),o},providedIn:"root"})}return t})();function Se(t,e){if(!h(xe)||t.method==="GET"||t.method==="HEAD")return e(t);try{let o=h(oe).href,{origin:s}=new URL(o),{origin:i}=new URL(t.url,s);if(s!==i)return e(t)}catch{return e(t)}let r=h(ve).getToken(),n=h(Ue);return r!=null&&!t.headers.has(n)&&(t=t.clone({headers:t.headers.set(n,r)})),e(t)}function Be(...t){let e=[Te,z,{provide:K,useExisting:z},{provide:G,useFactory:()=>h(Ie,{optional:!0})??h(V)},{provide:ye,useValue:Se,multi:!0}];for(let r of t)e.push(...r.\u0275providers);return H(e)}export{Te as a,Be as b};
1
+ import{A as Q,D as g,F as m,H as T,I as v,J as h,K as H,M as J,N as ee,R as re,_ as te,e as K,j as X,kb as oe,n as _,na as ne,pb as se,qb as ie,s as Y,u as q,w as Z}from"./chunk-WOIYAEKB.js";var w=class t{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(`
2
+ `).forEach(r=>{let n=r.indexOf(":");if(n>0){let o=r.slice(0,n),s=r.slice(n+1).trim();this.addHeaderEntry(o,s)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((r,n)=>{this.addHeaderEntry(n,r)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([r,n])=>{this.setHeaderEntries(r,n)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let r=this.headers.get(e.toLowerCase());return r&&r.length>0?r[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,r){return this.clone({name:e,value:r,op:"a"})}set(e,r){return this.clone({name:e,value:r,op:"s"})}delete(e,r){return this.clone({name:e,value:r,op:"d"})}maybeSetNormalizedName(e,r){this.normalizedNames.has(r)||this.normalizedNames.set(r,e)}init(){this.lazyInit&&(this.lazyInit instanceof t?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(r=>{this.headers.set(r,e.headers.get(r)),this.normalizedNames.set(r,e.normalizedNames.get(r))})}clone(e){let r=new t;return r.lazyInit=this.lazyInit&&this.lazyInit instanceof t?this.lazyInit:this,r.lazyUpdate=(this.lazyUpdate||[]).concat([e]),r}applyUpdate(e){let r=e.name.toLowerCase();switch(e.op){case"a":case"s":let n=e.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(e.name,r);let o=(e.op==="a"?this.headers.get(r):void 0)||[];o.push(...n),this.headers.set(r,o);break;case"d":let s=e.value;if(!s)this.headers.delete(r),this.normalizedNames.delete(r);else{let i=this.headers.get(r);if(!i)return;i=i.filter(l=>s.indexOf(l)===-1),i.length===0?(this.headers.delete(r),this.normalizedNames.delete(r)):this.headers.set(r,i)}break}}addHeaderEntry(e,r){let n=e.toLowerCase();this.maybeSetNormalizedName(e,n),this.headers.has(n)?this.headers.get(n).push(r):this.headers.set(n,[r])}setHeaderEntries(e,r){let n=(Array.isArray(r)?r:[r]).map(s=>s.toString()),o=e.toLowerCase();this.headers.set(o,n),this.maybeSetNormalizedName(e,o)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(r=>e(this.normalizedNames.get(r),this.headers.get(r)))}};var L=class{map=new Map;set(e,r){return this.map.set(e,r),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}},S=class{encodeKey(e){return ae(e)}encodeValue(e){return ae(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function be(t,e){let r=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(o=>{let s=o.indexOf("="),[i,l]=s==-1?[e.decodeKey(o),""]:[e.decodeKey(o.slice(0,s)),e.decodeValue(o.slice(s+1))],a=r.get(i)||[];a.push(l),r.set(i,a)}),r}var Re=/%(\d[a-f0-9])/gi,Pe={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function ae(t){return encodeURIComponent(t).replace(Re,(e,r)=>Pe[r]??e)}function j(t){return`${t}`}var y=class t{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new S,e.fromString){if(e.fromObject)throw new g(2805,!1);this.map=be(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(r=>{let n=e.fromObject[r],o=Array.isArray(n)?n.map(j):[j(n)];this.map.set(r,o)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let r=this.map.get(e);return r?r[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,r){return this.clone({param:e,value:r,op:"a"})}appendAll(e){let r=[];return Object.keys(e).forEach(n=>{let o=e[n];Array.isArray(o)?o.forEach(s=>{r.push({param:n,value:s,op:"a"})}):r.push({param:n,value:o,op:"a"})}),this.clone(r)}set(e,r){return this.clone({param:e,value:r,op:"s"})}delete(e,r){return this.clone({param:e,value:r,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let r=this.encoder.encodeKey(e);return this.map.get(e).map(n=>r+"="+this.encoder.encodeValue(n)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let r=new t({encoder:this.encoder});return r.cloneFrom=this.cloneFrom||this,r.updates=(this.updates||[]).concat(e),r}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let r=(e.op==="a"?this.map.get(e.param):void 0)||[];r.push(j(e.value)),this.map.set(e.param,r);break;case"d":if(e.value!==void 0){let n=this.map.get(e.param)||[],o=n.indexOf(j(e.value));o!==-1&&n.splice(o,1),n.length>0?this.map.set(e.param,n):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};function Me(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function ce(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function de(t){return typeof Blob<"u"&&t instanceof Blob}function le(t){return typeof FormData<"u"&&t instanceof FormData}function Ne(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}var ue="Content-Type",he="Accept",fe="text/plain",pe="application/json",Oe=`${pe}, ${fe}, */*`,M=class t{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;referrerPolicy;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(e,r,n,o){this.url=r,this.method=e.toUpperCase();let s;if(Me(this.method)||o?(this.body=n!==void 0?n:null,s=o):s=n,s){if(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,this.keepalive=!!s.keepalive,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),s.priority&&(this.priority=s.priority),s.cache&&(this.cache=s.cache),s.credentials&&(this.credentials=s.credentials),typeof s.timeout=="number"){if(s.timeout<1||!Number.isInteger(s.timeout))throw new g(2822,"");this.timeout=s.timeout}s.mode&&(this.mode=s.mode),s.redirect&&(this.redirect=s.redirect),s.integrity&&(this.integrity=s.integrity),s.referrer&&(this.referrer=s.referrer),s.referrerPolicy&&(this.referrerPolicy=s.referrerPolicy),this.transferCache=s.transferCache}if(this.headers??=new w,this.context??=new L,!this.params)this.params=new y,this.urlWithParams=r;else{let i=this.params.toString();if(i.length===0)this.urlWithParams=r;else{let l=r.indexOf("?"),a=l===-1?"?":l<r.length-1?"&":"";this.urlWithParams=r+a+i}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||ce(this.body)||de(this.body)||le(this.body)||Ne(this.body)?this.body:this.body instanceof y?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||le(this.body)?null:de(this.body)?this.body.type||null:ce(this.body)?null:typeof this.body=="string"?fe:this.body instanceof y?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?pe:null}clone(e={}){let r=e.method||this.method,n=e.url||this.url,o=e.responseType||this.responseType,s=e.keepalive??this.keepalive,i=e.priority||this.priority,l=e.cache||this.cache,a=e.mode||this.mode,f=e.redirect||this.redirect,x=e.credentials||this.credentials,E=e.referrer||this.referrer,D=e.integrity||this.integrity,F=e.referrerPolicy||this.referrerPolicy,C=e.transferCache??this.transferCache,U=e.timeout??this.timeout,c=e.body!==void 0?e.body:this.body,d=e.withCredentials??this.withCredentials,p=e.reportProgress??this.reportProgress,P=e.headers||this.headers,u=e.params||this.params,I=e.context??this.context;return e.setHeaders!==void 0&&(P=Object.keys(e.setHeaders).reduce((A,b)=>A.set(b,e.setHeaders[b]),P)),e.setParams&&(u=Object.keys(e.setParams).reduce((A,b)=>A.set(b,e.setParams[b]),u)),new t(r,n,c,{params:u,headers:P,context:I,reportProgress:p,responseType:o,withCredentials:d,transferCache:C,keepalive:s,cache:l,priority:i,timeout:U,mode:a,redirect:f,credentials:x,referrer:E,integrity:D,referrerPolicy:F})}},R=(function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t})(R||{}),O=class{headers;status;statusText;url;ok;type;redirected;responseType;constructor(e,r=200,n="OK"){this.headers=e.headers||new w,this.status=e.status!==void 0?e.status:r,this.statusText=e.statusText||n,this.url=e.url||null,this.redirected=e.redirected,this.responseType=e.responseType,this.ok=this.status>=200&&this.status<300}},B=class t extends O{constructor(e={}){super(e)}type=R.ResponseHeader;clone(e={}){return new t({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},k=class t extends O{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=R.Response;clone(e={}){return new t({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0,redirected:e.redirected??this.redirected,responseType:e.responseType??this.responseType})}},N=class extends O{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},De=200,Ie=204;var Ae=new T("");var _e=/^\)\]\}',?\n/;var V=(()=>{class t{xhrFactory;tracingService=h(ne,{optional:!0});constructor(r){this.xhrFactory=r}maybePropagateTrace(r){return this.tracingService?.propagate?this.tracingService.propagate(r):r}handle(r){if(r.method==="JSONP")throw new g(-2800,!1);let n=this.xhrFactory;return X(null).pipe(Q(()=>new K(s=>{let i=n.build();if(i.open(r.method,r.urlWithParams),r.withCredentials&&(i.withCredentials=!0),r.headers.forEach((c,d)=>i.setRequestHeader(c,d.join(","))),r.headers.has(he)||i.setRequestHeader(he,Oe),!r.headers.has(ue)){let c=r.detectContentTypeHeader();c!==null&&i.setRequestHeader(ue,c)}if(r.timeout&&(i.timeout=r.timeout),r.responseType){let c=r.responseType.toLowerCase();i.responseType=c!=="json"?c:"text"}let l=r.serializeBody(),a=null,f=()=>{if(a!==null)return a;let c=i.statusText||"OK",d=new w(i.getAllResponseHeaders()),p=i.responseURL||r.url;return a=new B({headers:d,status:i.status,statusText:c,url:p}),a},x=this.maybePropagateTrace(()=>{let{headers:c,status:d,statusText:p,url:P}=f(),u=null;d!==Ie&&(u=typeof i.response>"u"?i.responseText:i.response),d===0&&(d=u?De:0);let I=d>=200&&d<300;if(r.responseType==="json"&&typeof u=="string"){let A=u;u=u.replace(_e,"");try{u=u!==""?JSON.parse(u):null}catch(b){u=A,I&&(I=!1,u={error:b,text:u})}}I?(s.next(new k({body:u,headers:c,status:d,statusText:p,url:P||void 0})),s.complete()):s.error(new N({error:u,headers:c,status:d,statusText:p,url:P||void 0}))}),E=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:c,status:i.status||0,statusText:i.statusText||"Unknown Error",url:d||void 0});s.error(p)}),D=E;r.timeout&&(D=this.maybePropagateTrace(c=>{let{url:d}=f(),p=new N({error:new DOMException("Request timed out","TimeoutError"),status:i.status||0,statusText:i.statusText||"Request timeout",url:d||void 0});s.error(p)}));let F=!1,C=this.maybePropagateTrace(c=>{F||(s.next(f()),F=!0);let d={type:R.DownloadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),r.responseType==="text"&&i.responseText&&(d.partialText=i.responseText),s.next(d)}),U=this.maybePropagateTrace(c=>{let d={type:R.UploadProgress,loaded:c.loaded};c.lengthComputable&&(d.total=c.total),s.next(d)});return i.addEventListener("load",x),i.addEventListener("error",E),i.addEventListener("timeout",D),i.addEventListener("abort",E),r.reportProgress&&(i.addEventListener("progress",C),l!==null&&i.upload&&i.upload.addEventListener("progress",U)),i.send(l),s.next({type:R.Sent}),()=>{i.removeEventListener("error",E),i.removeEventListener("abort",E),i.removeEventListener("load",x),i.removeEventListener("timeout",D),r.reportProgress&&(i.removeEventListener("progress",C),l!==null&&i.upload&&i.upload.removeEventListener("progress",U)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||t)(v(ie))};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ke(t,e){return e(t)}function xe(t,e,r){return(n,o)=>ee(r,()=>e(n,s=>t(s,o)))}var ye=new T("",{factory:()=>[]}),ge=new T(""),me=new T("",{factory:()=>!0});var G=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(V),o},providedIn:"root"})}return t})();var z=(()=>{class t{backend;injector;chain=null;pendingTasks=h(te);contributeToStability=h(me);constructor(r,n){this.backend=r,this.injector=n}handle(r){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(ye),...this.injector.get(ge,[])]));this.chain=n.reduceRight((o,s)=>xe(o,s,this.injector),ke)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(r,o=>this.backend.handle(o)).pipe(Z(n))}else return this.chain(r,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||t)(v(G),v(J))};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),W=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(z),o},providedIn:"root"})}return t})();function $(t,e){return{body:e,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials,credentials:t.credentials,transferCache:t.transferCache,timeout:t.timeout,keepalive:t.keepalive,priority:t.priority,cache:t.cache,mode:t.mode,redirect:t.redirect,integrity:t.integrity,referrer:t.referrer,referrerPolicy:t.referrerPolicy}}var Te=(()=>{class t{handler;constructor(r){this.handler=r}request(r,n,o={}){let s;if(r instanceof M)s=r;else{let a;o.headers instanceof w?a=o.headers:a=new w(o.headers);let f;o.params&&(o.params instanceof y?f=o.params:f=new y({fromObject:o.params})),s=new M(r,n,o.body!==void 0?o.body:null,{headers:a,context:o.context,params:f,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache,keepalive:o.keepalive,priority:o.priority,cache:o.cache,mode:o.mode,redirect:o.redirect,credentials:o.credentials,referrer:o.referrer,referrerPolicy:o.referrerPolicy,integrity:o.integrity,timeout:o.timeout})}let i=X(s).pipe(q(a=>this.handler.handle(a)));if(r instanceof M||o.observe==="events")return i;let l=i.pipe(Y(a=>a instanceof k));switch(o.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return l.pipe(_(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new g(2806,!1);return a.body}));case"blob":return l.pipe(_(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new g(2807,!1);return a.body}));case"text":return l.pipe(_(a=>{if(a.body!==null&&typeof a.body!="string")throw new g(2808,!1);return a.body}));default:return l.pipe(_(a=>a.body))}case"response":return l;default:throw new g(2809,!1)}}delete(r,n={}){return this.request("DELETE",r,n)}get(r,n={}){return this.request("GET",r,n)}head(r,n={}){return this.request("HEAD",r,n)}jsonp(r,n){return this.request("JSONP",r,{params:new y().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(r,n={}){return this.request("OPTIONS",r,n)}patch(r,n,o={}){return this.request("PATCH",r,$(o,n))}post(r,n,o={}){return this.request("POST",r,$(o,n))}put(r,n,o={}){return this.request("PUT",r,$(o,n))}static \u0275fac=function(n){return new(n||t)(v(W))};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Fe=new T("",{factory:()=>!0}),Ce="XSRF-TOKEN",Ue=new T("",{factory:()=>Ce}),je="X-XSRF-TOKEN",Le=new T("",{factory:()=>je}),Se=(()=>{class t{cookieName=h(Ue);doc=h(re);lastCookieString="";lastToken=null;parseCount=0;getToken(){let r=this.doc.cookie||"";return r!==this.lastCookieString&&(this.parseCount++,this.lastToken=se(r,this.cookieName),this.lastCookieString=r),this.lastToken}static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ve=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=m({token:t,factory:function(n){let o=null;return n?o=new(n||t):o=v(Se),o},providedIn:"root"})}return t})();function Be(t,e){if(!h(Fe)||t.method==="GET"||t.method==="HEAD")return e(t);try{let o=h(oe).href,{origin:s}=new URL(o),{origin:i}=new URL(t.url,s);if(s!==i)return e(t)}catch{return e(t)}let r=h(ve).getToken(),n=h(Le);return r!=null&&!t.headers.has(n)&&(t=t.clone({headers:t.headers.set(n,r)})),e(t)}function ze(...t){let e=[Te,z,{provide:W,useExisting:z},{provide:G,useFactory:()=>h(Ae,{optional:!0})??h(V)},{provide:ye,useValue:Be,multi:!0}];for(let r of t)e.push(...r.\u0275providers);return H(e)}function we(){return globalThis.window?.__COPILOT_USAGE_STUDIO_HOST__??{}}function Ir(t){let e=we().apiBaseUrl?.replace(/\/+$/,"")??"",r=t.startsWith("/")?t:`/${t}`;return`${e}${r}`}function Ar(t){let e=we().allowedViews;return Array.isArray(e)&&e.length?e:t}export{Te as a,ze as b,we as c,Ir as d,Ar as e};