@tehw0lf/git-portfolio 22.1.2 → 22.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"tehw0lf-git-portfolio-webmcp.mjs","sources":["../../../../libs/git-portfolio/src/lib/webmcp/git-portfolio-tools.ts","../../../../libs/git-portfolio/src/lib/webmcp/model-context.ts","../../../../libs/git-portfolio/src/lib/webmcp/tehw0lf-git-portfolio-webmcp.ts"],"sourcesContent":["import { firstValueFrom, Observable } from 'rxjs';\n\nimport { ModelContextTool } from './model-context';\n\n/**\n * Structural subset of the library's GitRepository, GitRepositories and\n * GitProviderConfig types.\n *\n * This is a secondary entry point, so it cannot reach into the main one with\n * relative imports and must not import its own package by name. Declaring only\n * the fields these tools read keeps the boundary intact and makes the surface\n * they depend on explicit; the real types remain structurally assignable.\n */\nexport interface ToolRepository {\n name?: string;\n description?: string;\n language?: string;\n fork?: boolean;\n forks_count?: number;\n stargazers_count?: number;\n star_count?: number;\n html_url?: string;\n web_url?: string;\n pushed_at?: string;\n last_activity_at?: string;\n}\n\nexport type ToolRepositoryGroups = {\n [key: string]: ToolRepository[] | undefined;\n};\n\nexport type ToolRepositories = {\n [provider: string]: ToolRepositoryGroups | undefined;\n};\n\nexport interface ToolProviderConfig {\n github?: string;\n gitlab?: string;\n}\n\n/**\n * These tools proxy the GitHub and GitLab APIs, so repeated agent calls would\n * otherwise burn the visitor's rate limit. They read through\n * GitProviderService, which already caches responses for ten minutes, and the\n * number of returned repositories is capped.\n */\nexport interface GitPortfolioToolSource {\n getRepositories(config?: ToolProviderConfig): Observable<ToolRepositories>;\n}\n\nconst DEFAULT_LIMIT = 25;\nconst MAX_LIMIT = 100;\n\ninterface RepositorySummary {\n name: string;\n provider: string;\n kind: 'own' | 'forked';\n description: string | null;\n language: string | null;\n stars: number;\n forks: number;\n url: string | null;\n updatedAt: string | null;\n}\n\nfunction repositoryUrl(repository: ToolRepository): string | null {\n return repository.html_url ?? repository.web_url ?? null;\n}\n\nfunction repositoryStars(repository: ToolRepository): number {\n return repository.stargazers_count ?? repository.star_count ?? 0;\n}\n\nfunction summarize(\n repository: ToolRepository,\n provider: string,\n kind: 'own' | 'forked'\n): RepositorySummary {\n return {\n name: repository.name ?? 'unknown',\n provider,\n kind,\n description: repository.description ?? null,\n language: repository.language ?? null,\n stars: repositoryStars(repository),\n forks: repository.forks_count ?? 0,\n url: repositoryUrl(repository),\n updatedAt: repository.pushed_at ?? repository.last_activity_at ?? null\n };\n}\n\nfunction flatten(repositories: ToolRepositories): RepositorySummary[] {\n const result: RepositorySummary[] = [];\n\n Object.entries(repositories).forEach(([provider, groups]) => {\n if (!groups) {\n return;\n }\n (groups['own'] ?? []).forEach((repository) =>\n result.push(summarize(repository, provider, 'own'))\n );\n (groups['forked'] ?? []).forEach((repository) =>\n result.push(summarize(repository, provider, 'forked'))\n );\n });\n\n return result;\n}\n\n/**\n * Creates the git portfolio tools for a concrete repository source.\n *\n * @param source usually the injected GitProviderService\n * @param config the provider user names the surrounding page renders\n */\nexport function createGitPortfolioTools(\n source: GitPortfolioToolSource,\n config?: ToolProviderConfig\n): readonly ModelContextTool<never>[] {\n const load = () => firstValueFrom(source.getRepositories(config));\n\n const listTool: ModelContextTool<{\n limit?: number;\n language?: string;\n includeForks?: boolean;\n }> = {\n name: 'git_portfolio_list',\n title: 'List portfolio repositories',\n description:\n 'Lists the public repositories shown in this portfolio, sorted by stars. Results are served from a cache and capped.',\n inputSchema: {\n type: 'object',\n properties: {\n limit: {\n type: 'number',\n minimum: 1,\n maximum: MAX_LIMIT,\n description: `Maximum number of repositories to return (default ${DEFAULT_LIMIT}).`\n },\n language: {\n type: 'string',\n description: 'Only return repositories with this primary language.'\n },\n includeForks: {\n type: 'boolean',\n description: 'Include forked repositories (default false).'\n }\n }\n },\n annotations: { readOnlyHint: true, untrustedContentHint: true },\n execute: async ({ limit, language, includeForks }) => {\n const cap = Math.min(\n Math.max(Math.floor(limit ?? DEFAULT_LIMIT), 1),\n MAX_LIMIT\n );\n\n let repositories = flatten(await load());\n\n if (!includeForks) {\n repositories = repositories.filter((repo) => repo.kind === 'own');\n }\n if (language) {\n const wanted = language.toLowerCase();\n repositories = repositories.filter(\n (repo) => repo.language?.toLowerCase() === wanted\n );\n }\n\n repositories.sort((a, b) => b.stars - a.stars);\n\n return {\n repositories: repositories.slice(0, cap),\n returned: Math.min(repositories.length, cap),\n total: repositories.length,\n truncated: repositories.length > cap\n };\n }\n };\n\n const languagesTool: ModelContextTool<Record<string, never>> = {\n name: 'git_portfolio_languages',\n title: 'Summarise portfolio languages',\n description:\n 'Reports which programming languages appear in this portfolio and how many repositories use each, so an agent can answer questions without listing every repository.',\n inputSchema: { type: 'object', properties: {} },\n annotations: { readOnlyHint: true, untrustedContentHint: true },\n execute: async () => {\n const counts = new Map<string, number>();\n\n flatten(await load())\n .filter((repo) => repo.kind === 'own' && repo.language)\n .forEach((repo) => {\n const language = repo.language as string;\n counts.set(language, (counts.get(language) ?? 0) + 1);\n });\n\n return {\n languages: [...counts.entries()]\n .map(([language, repositories]) => ({ language, repositories }))\n .sort((a, b) => b.repositories - a.repositories)\n };\n }\n };\n\n return [\n listTool as unknown as ModelContextTool<never>,\n languagesTool as unknown as ModelContextTool<never>\n ];\n}\n","/**\n * Minimal typing and access layer for the WebMCP browser API.\n *\n * WebMCP is a W3C Community Group draft (not on the standards track) and the\n * global it lives on has already moved twice: `window.agent`, then\n * `navigator.modelContext`, and since the 21 July 2026 draft\n * `document.modelContext`. Chrome 150 deprecated the navigator location but\n * still exposes it as an alias.\n *\n * Every access goes through `getModelContext()` so a further move only has to\n * be handled here instead of in each tool.\n */\n\n/** Result an agent receives back from a tool call. */\nexport type ModelContextToolResult = string | Record<string, unknown>;\n\nexport interface ModelContextToolAnnotations {\n /** The tool only reads state and is safe to call speculatively. */\n readOnlyHint?: boolean;\n /** The tool returns content that originates from outside this page. */\n untrustedContentHint?: boolean;\n}\n\nexport interface ModelContextTool<TInput = Record<string, unknown>> {\n name: string;\n title?: string;\n description: string;\n inputSchema?: Record<string, unknown>;\n annotations?: ModelContextToolAnnotations;\n execute: (input: TInput) => Promise<ModelContextToolResult>;\n}\n\nexport interface ModelContextRegisterOptions {\n /** Aborting the signal unregisters the tool again. */\n signal?: AbortSignal;\n}\n\nexport interface ModelContext {\n registerTool(\n tool: ModelContextTool<never>,\n options?: ModelContextRegisterOptions\n ): Promise<void>;\n}\n\ninterface ModelContextCarrier {\n modelContext?: ModelContext;\n}\n\n/**\n * Returns the ModelContext of the current document, or undefined when the\n * browser does not implement WebMCP. Prefers the current `document` location\n * and falls back to the deprecated `navigator` alias.\n */\nexport function getModelContext(): ModelContext | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n\n const fromDocument = (document as unknown as ModelContextCarrier)\n .modelContext;\n if (fromDocument) {\n return fromDocument;\n }\n\n if (typeof navigator === 'undefined') {\n return undefined;\n }\n\n return (navigator as unknown as ModelContextCarrier).modelContext;\n}\n\n/** True when this browser exposes the WebMCP API. */\nexport function isModelContextSupported(): boolean {\n return getModelContext() !== undefined;\n}\n\n/**\n * Registers tools if the browser supports WebMCP, otherwise resolves without\n * doing anything. Returns a function that unregisters them again.\n *\n * Registration mutates global browser state, so libraries must never call this\n * on their own; it is opt-in for the embedding application.\n */\nexport async function registerModelContextTools(\n tools: readonly ModelContextTool<never>[]\n): Promise<() => void> {\n const modelContext = getModelContext();\n if (!modelContext) {\n return () => undefined;\n }\n\n const controller = new AbortController();\n\n await Promise.all(\n tools.map((tool) =>\n modelContext\n .registerTool(tool, { signal: controller.signal })\n .catch((error: unknown) => {\n // Tool names come from the caller, so they are passed as arguments\n // rather than interpolated: a name containing a format specifier\n // would otherwise consume the error and forge the log line.\n console.warn('WebMCP: registering tool failed:', tool.name, error);\n })\n )\n );\n\n return () => controller.abort();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAkDA,MAAM,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IAAI,eAAe,EAAE;AAExC,IAAA,MAAM,OAAO,CAAC,GAAG,CACf,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KACb;SACG,YAAY,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE;AAChD,SAAA,KAAK,CAAC,CAAC,KAAc,KAAI;;;;QAIxB,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;IACpE,CAAC,CAAC,CACL,CACF;AAED,IAAA,OAAO,MAAM,UAAU,CAAC,KAAK,EAAE;AACjC;;AC3GA;;AAEG;;;;"}
1
+ {"version":3,"file":"tehw0lf-git-portfolio-webmcp.mjs","sources":["../../../../libs/git-portfolio/src/lib/webmcp/git-portfolio-tools.ts","../../../../libs/git-portfolio/src/lib/webmcp/model-context.ts","../../../../libs/git-portfolio/src/lib/webmcp/tehw0lf-git-portfolio-webmcp.ts"],"sourcesContent":["import { firstValueFrom, Observable } from 'rxjs';\n\nimport { ModelContextTool } from './model-context';\n\n/**\n * Structural subset of the library's GitRepository, GitRepositories and\n * GitProviderConfig types.\n *\n * This is a secondary entry point, so it cannot reach into the main one with\n * relative imports and must not import its own package by name. Declaring only\n * the fields these tools read keeps the boundary intact and makes the surface\n * they depend on explicit; the real types remain structurally assignable.\n */\nexport interface ToolRepository {\n name?: string;\n description?: string;\n language?: string;\n fork?: boolean;\n forks_count?: number;\n stargazers_count?: number;\n star_count?: number;\n html_url?: string;\n web_url?: string;\n pushed_at?: string;\n last_activity_at?: string;\n}\n\nexport type ToolRepositoryGroups = {\n [key: string]: ToolRepository[] | undefined;\n};\n\nexport type ToolRepositories = {\n [provider: string]: ToolRepositoryGroups | undefined;\n};\n\nexport interface ToolProviderConfig {\n github?: string;\n gitlab?: string;\n}\n\n/**\n * These tools proxy the GitHub and GitLab APIs, so repeated agent calls would\n * otherwise burn the visitor's rate limit. They read through\n * GitProviderService, which already caches responses for ten minutes, and the\n * number of returned repositories is capped.\n */\nexport interface GitPortfolioToolSource {\n getRepositories(config?: ToolProviderConfig): Observable<ToolRepositories>;\n}\n\nconst DEFAULT_LIMIT = 25;\nconst MAX_LIMIT = 100;\n\ninterface RepositorySummary {\n name: string;\n provider: string;\n kind: 'own' | 'forked';\n description: string | null;\n language: string | null;\n stars: number;\n forks: number;\n url: string | null;\n updatedAt: string | null;\n}\n\nfunction repositoryUrl(repository: ToolRepository): string | null {\n return repository.html_url ?? repository.web_url ?? null;\n}\n\nfunction repositoryStars(repository: ToolRepository): number {\n return repository.stargazers_count ?? repository.star_count ?? 0;\n}\n\nfunction summarize(\n repository: ToolRepository,\n provider: string,\n kind: 'own' | 'forked'\n): RepositorySummary {\n return {\n name: repository.name ?? 'unknown',\n provider,\n kind,\n description: repository.description ?? null,\n language: repository.language ?? null,\n stars: repositoryStars(repository),\n forks: repository.forks_count ?? 0,\n url: repositoryUrl(repository),\n updatedAt: repository.pushed_at ?? repository.last_activity_at ?? null\n };\n}\n\nfunction flatten(repositories: ToolRepositories): RepositorySummary[] {\n const result: RepositorySummary[] = [];\n\n Object.entries(repositories).forEach(([provider, groups]) => {\n if (!groups) {\n return;\n }\n (groups['own'] ?? []).forEach((repository) =>\n result.push(summarize(repository, provider, 'own'))\n );\n (groups['forked'] ?? []).forEach((repository) =>\n result.push(summarize(repository, provider, 'forked'))\n );\n });\n\n return result;\n}\n\n/**\n * Creates the git portfolio tools for a concrete repository source.\n *\n * @param source usually the injected GitProviderService\n * @param config the provider user names the surrounding page renders\n */\nexport function createGitPortfolioTools(\n source: GitPortfolioToolSource,\n config?: ToolProviderConfig\n): readonly ModelContextTool<never>[] {\n const load = () => firstValueFrom(source.getRepositories(config));\n\n const listTool: ModelContextTool<{\n limit?: number;\n language?: string;\n includeForks?: boolean;\n }> = {\n name: 'git_portfolio_list',\n title: 'List portfolio repositories',\n description:\n 'Lists the public repositories shown in this portfolio, sorted by stars. Results are served from a cache and capped.',\n inputSchema: {\n type: 'object',\n properties: {\n limit: {\n type: 'number',\n minimum: 1,\n maximum: MAX_LIMIT,\n description: `Maximum number of repositories to return (default ${DEFAULT_LIMIT}).`\n },\n language: {\n type: 'string',\n description: 'Only return repositories with this primary language.'\n },\n includeForks: {\n type: 'boolean',\n description: 'Include forked repositories (default false).'\n }\n }\n },\n annotations: { readOnlyHint: true, untrustedContentHint: true },\n execute: async ({ limit, language, includeForks }) => {\n const cap = Math.min(\n Math.max(Math.floor(limit ?? DEFAULT_LIMIT), 1),\n MAX_LIMIT\n );\n\n let repositories = flatten(await load());\n\n if (!includeForks) {\n repositories = repositories.filter((repo) => repo.kind === 'own');\n }\n if (language) {\n const wanted = language.toLowerCase();\n repositories = repositories.filter(\n (repo) => repo.language?.toLowerCase() === wanted\n );\n }\n\n repositories.sort((a, b) => b.stars - a.stars);\n\n return {\n repositories: repositories.slice(0, cap),\n returned: Math.min(repositories.length, cap),\n total: repositories.length,\n truncated: repositories.length > cap\n };\n }\n };\n\n const languagesTool: ModelContextTool<Record<string, never>> = {\n name: 'git_portfolio_languages',\n title: 'Summarise portfolio languages',\n description:\n 'Reports which programming languages appear in this portfolio and how many repositories use each, so an agent can answer questions without listing every repository.',\n inputSchema: { type: 'object', properties: {} },\n annotations: { readOnlyHint: true, untrustedContentHint: true },\n execute: async () => {\n const counts = new Map<string, number>();\n\n flatten(await load())\n .filter((repo) => repo.kind === 'own' && repo.language)\n .forEach((repo) => {\n const language = repo.language as string;\n counts.set(language, (counts.get(language) ?? 0) + 1);\n });\n\n return {\n languages: [...counts.entries()]\n .map(([language, repositories]) => ({ language, repositories }))\n .sort((a, b) => b.repositories - a.repositories)\n };\n }\n };\n\n return [\n listTool as unknown as ModelContextTool<never>,\n languagesTool as unknown as ModelContextTool<never>\n ];\n}\n","/**\n * Minimal typing and access layer for the WebMCP browser API.\n *\n * WebMCP is a W3C Community Group draft (not on the standards track) and the\n * global it lives on has already moved twice: `window.agent`, then\n * `navigator.modelContext`, and since the 21 July 2026 draft\n * `document.modelContext`. Chrome 150 deprecated the navigator location but\n * still exposes it as an alias.\n *\n * Every access goes through `getModelContext()` so a further move only has to\n * be handled here instead of in each tool.\n */\n\n/** Result an agent receives back from a tool call. */\nexport type ModelContextToolResult = string | Record<string, unknown>;\n\nexport interface ModelContextToolAnnotations {\n /** The tool only reads state and is safe to call speculatively. */\n readOnlyHint?: boolean;\n /** The tool returns content that originates from outside this page. */\n untrustedContentHint?: boolean;\n}\n\nexport interface ModelContextTool<TInput = Record<string, unknown>> {\n name: string;\n title?: string;\n description: string;\n inputSchema?: Record<string, unknown>;\n annotations?: ModelContextToolAnnotations;\n execute: (input: TInput) => Promise<ModelContextToolResult>;\n}\n\nexport interface ModelContextRegisterOptions {\n /** Aborting the signal unregisters the tool again. */\n signal?: AbortSignal;\n}\n\nexport interface ModelContext {\n registerTool(\n tool: ModelContextTool<never>,\n options?: ModelContextRegisterOptions\n ): Promise<void>;\n}\n\ninterface ModelContextCarrier {\n modelContext?: ModelContext;\n}\n\n/**\n * Returns the ModelContext of the current document, or undefined when the\n * browser does not implement WebMCP. Prefers the current `document` location\n * and falls back to the deprecated `navigator` alias.\n */\nexport function getModelContext(): ModelContext | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n\n const fromDocument = (document as unknown as ModelContextCarrier)\n .modelContext;\n if (fromDocument) {\n return fromDocument;\n }\n\n if (typeof navigator === 'undefined') {\n return undefined;\n }\n\n return (navigator as unknown as ModelContextCarrier).modelContext;\n}\n\n/** True when this browser exposes the WebMCP API. */\nexport function isModelContextSupported(): boolean {\n return getModelContext() !== undefined;\n}\n\n/**\n * Registers tools if the browser supports WebMCP, otherwise resolves without\n * doing anything. Returns a function that unregisters them again.\n *\n * Registration mutates global browser state, so libraries must never call this\n * on their own; it is opt-in for the embedding application.\n */\nexport async function registerModelContextTools(\n tools: readonly ModelContextTool<never>[]\n): Promise<() => void> {\n const modelContext = getModelContext();\n if (!modelContext) {\n return () => undefined;\n }\n\n const controller = new AbortController();\n\n await Promise.all(\n tools.map((tool) =>\n modelContext\n .registerTool(tool, { signal: controller.signal })\n .catch((error: unknown) => {\n // Tool names come from the caller, so they are passed as arguments\n // rather than interpolated: a name containing a format specifier\n // would otherwise consume the error and forge the log line.\n console.warn('WebMCP: registering tool failed:', tool.name, error);\n })\n )\n );\n\n return () => controller.abort();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAkDA,MAAM,aAAa,GAAG,EAAE;AACxB,MAAM,SAAS,GAAG,GAAG;AAcrB,SAAS,aAAa,CAAC,UAA0B,EAAA;IAC/C,OAAO,UAAU,CAAC,QAAQ,IAAI,UAAU,CAAC,OAAO,IAAI,IAAI;AAC1D;AAEA,SAAS,eAAe,CAAC,UAA0B,EAAA;IACjD,OAAO,UAAU,CAAC,gBAAgB,IAAI,UAAU,CAAC,UAAU,IAAI,CAAC;AAClE;AAEA,SAAS,SAAS,CAChB,UAA0B,EAC1B,QAAgB,EAChB,IAAsB,EAAA;IAEtB,OAAO;AACL,QAAA,IAAI,EAAE,UAAU,CAAC,IAAI,IAAI,SAAS;QAClC,QAAQ;QACR,IAAI;AACJ,QAAA,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,IAAI;AAC3C,QAAA,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,IAAI;AACrC,QAAA,KAAK,EAAE,eAAe,CAAC,UAAU,CAAC;AAClC,QAAA,KAAK,EAAE,UAAU,CAAC,WAAW,IAAI,CAAC;AAClC,QAAA,GAAG,EAAE,aAAa,CAAC,UAAU,CAAC;QAC9B,SAAS,EAAE,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,gBAAgB,IAAI;KACnE;AACH;AAEA,SAAS,OAAO,CAAC,YAA8B,EAAA;IAC7C,MAAM,MAAM,GAAwB,EAAE;AAEtC,IAAA,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAI;QAC1D,I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AEA;SACgB,uBAAuB,GAAA;AACrC,IAAA,OAAO,eAAe,EAAE,KAAK,SAAS;AACxC;AAEA;;;;;;AAMG;AACI,eAAe,yBAAyB,CAC7C,KAAyC,EAAA;AAEzC,IAAA,MAAM,YAAY,GAAG,eAAe,EAAE;IACtC,IAAI,CAAC,YAAY,EAAE;AACjB,QAAA,OAAO,MAAM,SAAS;IACxB;AAEA,IAAA,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE;AAExC,IAAA,MAAM,OAAO,CAAC,GAAG,CACf,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KACb;SACG,YAAY,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE;AAChD,SAAA,KAAK,CAAC,CAAC,KAAc,KAAI;;;;QAIxB,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;IACpE,CAAC,CAAC,CACL,CACF;AAED,IAAA,OAAO,MAAM,UAAU,CAAC,KAAK,EAAE;AACjC;;AC3GA;;AAEG;;"}
@@ -8,8 +8,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
8
8
  import * as i3$1 from '@angular/material/tabs';
9
9
  import { MatTabsModule } from '@angular/material/tabs';
10
10
  import { toSignal } from '@angular/core/rxjs-interop';
11
- import { tap, catchError, shareReplay, map, takeWhile, takeUntil } from 'rxjs/operators';
12
- import { BehaviorSubject, throwError, zip, expand, of, reduce, Subject } from 'rxjs';
11
+ import { tap, catchError, finalize, share, map, takeWhile, switchMap, takeUntil } from 'rxjs/operators';
12
+ import { BehaviorSubject, of, throwError, defer, zip, expand, reduce, Subject } from 'rxjs';
13
13
  import { HttpClient } from '@angular/common/http';
14
14
  import * as i3 from '@angular/cdk/clipboard';
15
15
  import { ClipboardModule } from '@angular/cdk/clipboard';
@@ -27,42 +27,128 @@ class GitProviderService {
27
27
  this.loadingStateSubject = new BehaviorSubject(true);
28
28
  this.repositorySubject = new BehaviorSubject({});
29
29
  this.repositoryCache = new Map();
30
+ /**
31
+ * Keyed by cache key, but each entry carries its own token. A settling
32
+ * request may only write the cache or clean up while it still *owns* the
33
+ * entry — clearCache() drops ownership, and a newer request for the same key
34
+ * takes it over. Without that, a response already on the wire would
35
+ * repopulate the cache it was just told to forget, and a late straggler
36
+ * would delete the tracking entry belonging to the request that replaced it.
37
+ */
38
+ this.inFlightRequests = new Map();
39
+ /**
40
+ * Bumped by clearCache(). The shared state needs its own generation rather
41
+ * than the ownership token above, because a request releases that token as
42
+ * its value lands — before withLoadingState() sees the same value — so by
43
+ * then ownership can no longer tell a current load from an invalidated one.
44
+ */
45
+ this.stateGeneration = 0;
30
46
  }
31
47
  get loading() {
32
48
  return this.loadingStateSubject.asObservable();
33
49
  }
34
50
  /**
35
- * A failed fetch must not settle in the cache: shareReplay(1) would replay the
36
- * error to every later subscriber for the full TTL, so a single dropped
37
- * connection would keep the portfolio broken long after the network returned.
51
+ * A failed fetch must not settle in the cache, so a single dropped
52
+ * connection cannot keep the portfolio broken long after the network
53
+ * returned. Only a successful response is stored.
38
54
  */
39
55
  evictCacheEntry(cacheKey) {
40
56
  this.repositoryCache.delete(cacheKey);
41
57
  }
58
+ /**
59
+ * The cache holds the settled response, not the observable that produced it.
60
+ *
61
+ * It used to hold the in-flight stream, kept alive by a non-ref-counted
62
+ * shareReplay(1), and that is irreconcilable with cancelling an abandoned
63
+ * load: the operator must outlive its subscribers for a later hit to replay,
64
+ * which is exactly what stops it from dying when the caller walks away. A
65
+ * superseded load therefore kept paging against a rate-limited API and still
66
+ * ran its side effects, clearing the spinner out from under the load that
67
+ * replaced it. refCount only trades the bug for a worse one — a consumer
68
+ * that takes a single value leaves before the stream completes, so the next
69
+ * hit refetches instead of replaying.
70
+ *
71
+ * Caching the value settles it. A hit is `of(value)`, which needs nothing
72
+ * kept alive; a miss is an ordinary cancellable request.
73
+ */
42
74
  getRepositories(gitProviderUserNames) {
43
75
  const cacheKey = this.createCacheKey(gitProviderUserNames);
44
76
  const cachedEntry = this.repositoryCache.get(cacheKey);
45
- // Check if cache entry exists and is still valid
46
77
  if (cachedEntry && this.isCacheValid(cachedEntry)) {
47
- return cachedEntry.data;
78
+ return this.withLoadingState(of(cachedEntry.data));
79
+ }
80
+ // An identical request already on the wire: share that one rather than
81
+ // opening a second. This stream is only ever the in-flight request, so it
82
+ // is dropped as soon as it settles and never becomes a stale cache.
83
+ const inFlight = this.inFlightRequests.get(cacheKey);
84
+ if (inFlight) {
85
+ return this.withLoadingState(inFlight.request);
48
86
  }
49
87
  // Clean up expired entries and manage cache size
50
88
  this.cleanupCache();
51
- const repositories$ = this.fetchRepositories(gitProviderUserNames).pipe(tap((repositories) => {
52
- this.repositorySubject.next(repositories);
53
- this.loadingStateSubject.next(false);
89
+ // This request's claim on the key. Every write below is guarded by it, so
90
+ // a request that has been superseded or cleared touches nothing.
91
+ const token = Symbol(cacheKey);
92
+ const owns = () => this.inFlightRequests.get(cacheKey)?.token === token;
93
+ const release = () => {
94
+ if (owns())
95
+ this.inFlightRequests.delete(cacheKey);
96
+ };
97
+ const request$ = this.fetchRepositories(gitProviderUserNames).pipe(tap((repositories) => {
98
+ // Only the owner may fill the cache: otherwise a response already on
99
+ // the wire when clearCache() ran would put back what was just dropped.
100
+ if (!owns())
101
+ return;
102
+ this.repositoryCache.set(cacheKey, {
103
+ data: repositories,
104
+ timestamp: Date.now(),
105
+ ttl: this.CACHE_TTL
106
+ });
107
+ // Released as the value lands, not in finalize: a subscriber that
108
+ // calls back into getRepositories from its own next handler must see
109
+ // the settled cache, not a request that is technically still open.
110
+ release();
54
111
  }), catchError((error) => {
55
- // Loading ends on both paths, otherwise the spinner outlives the request.
56
- this.loadingStateSubject.next(false);
57
- this.evictCacheEntry(cacheKey);
112
+ if (owns()) {
113
+ this.evictCacheEntry(cacheKey);
114
+ release();
115
+ }
58
116
  return throwError(() => error);
59
- }), shareReplay(1));
60
- this.repositoryCache.set(cacheKey, {
61
- data: repositories$,
62
- timestamp: Date.now(),
63
- ttl: this.CACHE_TTL
117
+ }),
118
+ // Covers the paths the two handlers above do not: an unsubscribe before
119
+ // the response, which would otherwise strand the entry forever.
120
+ finalize(release), share());
121
+ this.inFlightRequests.set(cacheKey, { token, request: request$ });
122
+ return this.withLoadingState(request$);
123
+ }
124
+ /**
125
+ * The shared-state writes, wrapped around the stream rather than baked into
126
+ * it, so they belong to one subscription and die with it. An abandoned load
127
+ * therefore stops touching `loading`, while a cache hit still reports the
128
+ * state its own subscriber expects.
129
+ *
130
+ * Loading ends on both paths, otherwise the spinner outlives the request.
131
+ */
132
+ withLoadingState(repositories$) {
133
+ // defer so the generation is read per subscription, at the moment this
134
+ // load actually starts, rather than once when the observable is built.
135
+ return defer(() => {
136
+ const generation = this.stateGeneration;
137
+ const current = () => generation === this.stateGeneration;
138
+ return repositories$.pipe(tap((repositories) => {
139
+ // A load invalidated by clearCache() must not report itself done:
140
+ // its replacement may still be in flight, and clearing the spinner
141
+ // on its behalf would show an empty portfolio as a finished one.
142
+ if (!current())
143
+ return;
144
+ this.repositorySubject.next(repositories);
145
+ this.loadingStateSubject.next(false);
146
+ }), catchError((error) => {
147
+ if (current())
148
+ this.loadingStateSubject.next(false);
149
+ return throwError(() => error);
150
+ }));
64
151
  });
65
- return repositories$;
66
152
  }
67
153
  createCacheKey(config) {
68
154
  if (!config)
@@ -75,7 +161,7 @@ class GitProviderService {
75
161
  return parts.join('|') || 'default';
76
162
  }
77
163
  isCacheValid(entry) {
78
- return (Date.now() - entry.timestamp) < entry.ttl;
164
+ return Date.now() - entry.timestamp < entry.ttl;
79
165
  }
80
166
  cleanupCache() {
81
167
  // Remove expired entries
@@ -86,8 +172,7 @@ class GitProviderService {
86
172
  }
87
173
  // If cache is still too large, remove oldest entries
88
174
  if (this.repositoryCache.size >= this.MAX_CACHE_SIZE) {
89
- const entries = Array.from(this.repositoryCache.entries())
90
- .sort(([, a], [, b]) => a.timestamp - b.timestamp);
175
+ const entries = Array.from(this.repositoryCache.entries()).sort(([, a], [, b]) => a.timestamp - b.timestamp);
91
176
  const toRemove = entries.slice(0, entries.length - this.MAX_CACHE_SIZE + 1);
92
177
  toRemove.forEach(([key]) => this.repositoryCache.delete(key));
93
178
  }
@@ -118,6 +203,14 @@ class GitProviderService {
118
203
  * as a real but incomplete portfolio — "no forked repositories" instead of an
119
204
  * error. Failing the whole fetch keeps a partial answer from posing as a
120
205
  * complete one.
206
+ *
207
+ * Deliberately not shared. Each call feeds exactly one zip() in
208
+ * fetchRepositories, so shareReplay bought no sharing here — but because it
209
+ * is not ref-counted it held the subscription open, and unsubscribing
210
+ * upstream then never tore the chain down. A caller that abandons a load
211
+ * (the component's switchMap, on a config change) would keep this paging
212
+ * through every remaining page against a rate-limited API. The result is
213
+ * shared once, at the level that caches it: getRepositories.
121
214
  */
122
215
  fetchAllPages(firstUrl) {
123
216
  return this.http.get(firstUrl, { observe: 'response' }).pipe(expand((response) => {
@@ -125,7 +218,7 @@ class GitProviderService {
125
218
  return next
126
219
  ? this.http.get(next, { observe: 'response' })
127
220
  : of(null);
128
- }), takeWhile((response) => response !== null), reduce((acc, response) => acc.concat(response.body ?? []), []), shareReplay(1));
221
+ }), takeWhile((response) => response !== null), reduce((acc, response) => acc.concat(response.body ?? []), []));
129
222
  }
130
223
  parseLinkHeader(header) {
131
224
  if (!header)
@@ -146,23 +239,56 @@ class GitProviderService {
146
239
  return of([]);
147
240
  }
148
241
  clearCache() {
242
+ // Invalidates both halves: the cache ownership above, and the shared
243
+ // state, so a request already on the wire can neither refill the cache
244
+ // nor report itself finished once its result is no longer wanted.
245
+ this.stateGeneration++;
149
246
  this.repositoryCache.clear();
247
+ // Otherwise a request already on the wire would still populate the cache
248
+ // it was just asked to forget.
249
+ this.inFlightRequests.clear();
150
250
  this.loadingStateSubject.next(true);
151
251
  this.repositorySubject.next({});
152
252
  }
153
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GitProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
154
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GitProviderService, providedIn: 'root' }); }
253
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GitProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
254
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GitProviderService, providedIn: 'root' }); }
155
255
  }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GitProviderService, decorators: [{
256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GitProviderService, decorators: [{
157
257
  type: Injectable,
158
258
  args: [{
159
259
  providedIn: 'root'
160
260
  }]
161
261
  }] });
162
262
 
263
+ // A navigation cancels pending fetches. Firefox rejects them after
264
+ // `beforeunload` and before `pagehide`, so the page counts as leaving from
265
+ // `beforeunload` until `pageshow` (a page restored from the back/forward
266
+ // cache is live again).
267
+ let leaving = false;
268
+ if (typeof window !== 'undefined') {
269
+ window.addEventListener('beforeunload', () => {
270
+ leaving = true;
271
+ });
272
+ window.addEventListener('pageshow', () => {
273
+ leaving = false;
274
+ });
275
+ }
276
+ function isCancelledByNavigation(err) {
277
+ // The directive never aborts a fetch itself, so an AbortError comes from
278
+ // outside. A fetch TypeError (network error) looks the same for a
279
+ // navigation and a real failure, so it is told apart by the page state.
280
+ if (err?.name === 'AbortError')
281
+ return true;
282
+ return err instanceof TypeError && leaving;
283
+ }
163
284
  const svgCache = new Map();
164
285
  const KNOWN_ICONS = new Set([
165
- 'check', 'issue-opened', 'paste', 'repo-forked', 'star', 'alert'
286
+ 'check',
287
+ 'issue-opened',
288
+ 'paste',
289
+ 'repo-forked',
290
+ 'star',
291
+ 'alert'
166
292
  ]);
167
293
  function fetchSvg(name) {
168
294
  const icon = KNOWN_ICONS.has(name) ? name : 'alert';
@@ -201,7 +327,11 @@ class OcticonDirective {
201
327
  this.renderer.setStyle(icon, 'height', this.width());
202
328
  }
203
329
  })
204
- .catch((err) => console.error(err));
330
+ .catch((err) => {
331
+ if (isCancelledByNavigation(err))
332
+ return;
333
+ console.error(err);
334
+ });
205
335
  }
206
336
  insertSvgSafely(element, svgString) {
207
337
  const range = document.createRange();
@@ -216,10 +346,10 @@ class OcticonDirective {
216
346
  }
217
347
  return svgElement;
218
348
  }
219
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: OcticonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
220
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.5", type: OcticonDirective, isStandalone: true, selector: "[octicon]", inputs: { octicon: { classPropertyName: "octicon", publicName: "octicon", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
349
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OcticonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
350
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.1", type: OcticonDirective, isStandalone: true, selector: "[octicon]", inputs: { octicon: { classPropertyName: "octicon", publicName: "octicon", isSignal: true, isRequired: true, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
221
351
  }
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: OcticonDirective, decorators: [{
352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OcticonDirective, decorators: [{
223
353
  type: Directive,
224
354
  args: [{
225
355
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -275,10 +405,10 @@ class RepoCardComponent {
275
405
  }, /* @ts-ignore */
276
406
  ...(ngDevMode ? [{ debugName: "repoUrl" }] : /* istanbul ignore next */ []));
277
407
  }
278
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: RepoCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
279
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: RepoCardComponent, isStandalone: true, selector: "repo-card", inputs: { buttonStyle: { classPropertyName: "buttonStyle", publicName: "buttonStyle", isSignal: true, isRequired: true, transformFunction: null }, cardStyle: { classPropertyName: "cardStyle", publicName: "cardStyle", isSignal: true, isRequired: true, transformFunction: null }, textStyle: { classPropertyName: "textStyle", publicName: "textStyle", isSignal: true, isRequired: true, transformFunction: null }, checkColor: { classPropertyName: "checkColor", publicName: "checkColor", isSignal: true, isRequired: true, transformFunction: null }, forkColor: { classPropertyName: "forkColor", publicName: "forkColor", isSignal: true, isRequired: true, transformFunction: null }, issueColor: { classPropertyName: "issueColor", publicName: "issueColor", isSignal: true, isRequired: true, transformFunction: null }, pasteColor: { classPropertyName: "pasteColor", publicName: "pasteColor", isSignal: true, isRequired: true, transformFunction: null }, starColor: { classPropertyName: "starColor", publicName: "starColor", isSignal: true, isRequired: true, transformFunction: null }, gitRepo: { classPropertyName: "gitRepo", publicName: "gitRepo", isSignal: true, isRequired: true, transformFunction: null }, isCopied: { classPropertyName: "isCopied", publicName: "isCopied", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { copiedToClipboard: "copiedToClipboard" }, ngImport: i0, template: "<mat-card [ngStyle]=\"cardStyle()\">\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo().owner?.avatar_url || gitRepo().namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"buttonStyle()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"repoUrl()\"\n >\n {{ gitRepo().name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle class=\"flex-row\">\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo().language !== undefined\n ? githubLanguageColors[gitRepo().language!]\n : 'transparent'\n }\"\n class=\"language-icon flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().language }}</div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div octicon=\"star\" [color]=\"starColor()\" class=\"flex-gap-5\"></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().stargazers_count || gitRepo().star_count || 0 }}\n </div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"repo-forked\"\n [color]=\"forkColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().forks_count }}</div>\n </div>\n @if (gitRepo().open_issues_count) {\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"issue-opened\"\n [color]=\"issueColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().open_issues_count }}\n </div>\n </div>\n }\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo().description }}</p>\n </mat-card-content>\n <mat-card-footer class=\"flex-row\">\n <span class=\"mat-footer-cell flex-fxflex flex-gap-12\">\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\">{{ labels().created }}{{ gitRepo().created_at | date }}</span>\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\">{{ labels().updated }}{{ gitRepo().pushed_at || gitRepo().last_activity_at | date }}</span>\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"buttonStyle()\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo().clone_url || gitRepo().http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard.emit(true)\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper flex-row\">\n @if (isCopied()) {\n <div\n octicon=\"check\"\n [color]=\"checkColor()\"\n width=\"24\"\n class=\"flex-gap-5\"\n ></div>\n }\n <div\n octicon=\"paste\"\n [color]=\"pasteColor()\"\n width=\"24px\"\n class=\"flex-gap-5\"\n ></div>\n <span>{{ labels().copyRepoUrl }}</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n", styles: [".flex-align-start{justify-content:flex-start}.flex-align-stretch{align-content:stretch;align-items:stretch}.flex-row-wrap,.flex-row,.flex-column{display:flex;box-sizing:border-box}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-row-wrap{flex-direction:row;flex-wrap:wrap}.flex-fxflex{flex:1 1 0%}.flex-fxflex-responsive{flex:0 1 calc(33.3% - 32px)}.flex-fxflex-lt-md{flex:0 1 calc(50% - 32px)}.flex-fxflex-lt-sm{flex:100%}.flex-fxflex-fill{height:100%;min-height:100%;min-width:100%;width:100%}.flex-gap-5{margin-right:5px}.flex-gap-12{margin-right:12px}.flex-gap-20{margin-right:20px}.clipboard-button{height:29px;line-height:24px!important;padding:0!important;margin-bottom:0}.clipboard-button span{font-size:20px}.mat-mdc-button{vertical-align:middle;line-height:36px;font-size:24px;margin:0 var(--tw-space-3, 12px) 0 0;padding:0 16px;text-align:center;text-decoration:none}@media screen and (max-width:519px){.mat-mdc-button{font-size:16px;padding:0 8px}}.mat-mdc-card{display:flex;flex-direction:column;width:450px;max-width:100%;box-sizing:border-box}@media screen and (max-width:519px){.mat-mdc-card{width:100%}}.mat-mdc-card-avatar{height:53px;width:53px;margin:0}.mat-mdc-card-title{margin-bottom:12px}.mat-mdc-card-subtitle{margin-top:-8px;margin-left:16px}.mat-mdc-card-header{flex-shrink:0;padding:0 0 16px}.mat-mdc-card-content{font-size:14px;height:34px;margin-bottom:16px;padding:0}.mat-mdc-card-content p{font-size:14px}.mat-mdc-card{padding:16px}.mat-mdc-card-footer{margin:0 -16px calc(-1 * var(--tw-space-3, 12px)) -16px;padding:16px;padding-bottom:var(--tw-space-3, 12px)}.footer-span{display:block;font-size:12px}.language-icon{height:12px;width:12px;border-radius:50%;margin-top:2px}.info-item{font-weight:400;letter-spacing:normal}p{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1.MatCardAvatar, selector: "[mat-card-avatar], [matCardAvatar]" }, { kind: "directive", type: i1.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i1.MatCardFooter, selector: "mat-card-footer" }, { kind: "component", type: i1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: OcticonDirective, selector: "[octicon]", inputs: ["octicon", "color", "width"] }, { kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
408
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: RepoCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
409
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: RepoCardComponent, isStandalone: true, selector: "repo-card", inputs: { buttonStyle: { classPropertyName: "buttonStyle", publicName: "buttonStyle", isSignal: true, isRequired: true, transformFunction: null }, cardStyle: { classPropertyName: "cardStyle", publicName: "cardStyle", isSignal: true, isRequired: true, transformFunction: null }, textStyle: { classPropertyName: "textStyle", publicName: "textStyle", isSignal: true, isRequired: true, transformFunction: null }, checkColor: { classPropertyName: "checkColor", publicName: "checkColor", isSignal: true, isRequired: true, transformFunction: null }, forkColor: { classPropertyName: "forkColor", publicName: "forkColor", isSignal: true, isRequired: true, transformFunction: null }, issueColor: { classPropertyName: "issueColor", publicName: "issueColor", isSignal: true, isRequired: true, transformFunction: null }, pasteColor: { classPropertyName: "pasteColor", publicName: "pasteColor", isSignal: true, isRequired: true, transformFunction: null }, starColor: { classPropertyName: "starColor", publicName: "starColor", isSignal: true, isRequired: true, transformFunction: null }, gitRepo: { classPropertyName: "gitRepo", publicName: "gitRepo", isSignal: true, isRequired: true, transformFunction: null }, isCopied: { classPropertyName: "isCopied", publicName: "isCopied", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { copiedToClipboard: "copiedToClipboard" }, ngImport: i0, template: "<mat-card [ngStyle]=\"cardStyle()\">\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo().owner?.avatar_url || gitRepo().namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"buttonStyle()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"repoUrl()\"\n >\n {{ gitRepo().name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle class=\"flex-row\">\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo().language !== undefined\n ? githubLanguageColors[gitRepo().language!]\n : 'transparent'\n }\"\n class=\"language-icon flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().language }}</div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div octicon=\"star\" [color]=\"starColor()\" class=\"flex-gap-5\"></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().stargazers_count || gitRepo().star_count || 0 }}\n </div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"repo-forked\"\n [color]=\"forkColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().forks_count }}</div>\n </div>\n @if (gitRepo().open_issues_count) {\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"issue-opened\"\n [color]=\"issueColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().open_issues_count }}\n </div>\n </div>\n }\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo().description }}</p>\n </mat-card-content>\n <mat-card-footer class=\"flex-row\">\n <span class=\"mat-footer-cell flex-fxflex flex-gap-12\">\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\"\n >{{ labels().created }}{{ gitRepo().created_at | date }}</span\n >\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\"\n >{{ labels().updated\n }}{{ gitRepo().pushed_at || gitRepo().last_activity_at | date }}</span\n >\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"buttonStyle()\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo().clone_url || gitRepo().http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard.emit(true)\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper flex-row\">\n @if (isCopied()) {\n <div\n octicon=\"check\"\n [color]=\"checkColor()\"\n width=\"24\"\n class=\"flex-gap-5\"\n ></div>\n }\n <div\n octicon=\"paste\"\n [color]=\"pasteColor()\"\n width=\"24px\"\n class=\"flex-gap-5\"\n ></div>\n <span>{{ labels().copyRepoUrl }}</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n", styles: [".flex-align-start{justify-content:flex-start}.flex-align-stretch{align-content:stretch;align-items:stretch}.flex-row-wrap,.flex-row,.flex-column{display:flex;box-sizing:border-box}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-row-wrap{flex-direction:row;flex-wrap:wrap}.flex-fxflex{flex:1 1 0%}.flex-fxflex-responsive{flex:0 1 calc(33.3% - 32px)}.flex-fxflex-lt-md{flex:0 1 calc(50% - 32px)}.flex-fxflex-lt-sm{flex:100%}.flex-fxflex-fill{height:100%;min-height:100%;min-width:100%;width:100%}.flex-gap-5{margin-right:5px}.flex-gap-12{margin-right:12px}.flex-gap-20{margin-right:20px}.clipboard-button{height:29px;line-height:24px!important;padding:0!important;margin-bottom:0}.clipboard-button span{font-size:20px}.mat-mdc-button{vertical-align:middle;line-height:36px;font-size:24px;margin:0 var(--tw-space-3, 12px) 0 0;padding:0 16px;text-align:center;text-decoration:none}@media screen and (max-width:519px){.mat-mdc-button{font-size:16px;padding:0 8px}}.mat-mdc-card{display:flex;flex-direction:column;width:450px;max-width:100%;box-sizing:border-box}@media screen and (max-width:519px){.mat-mdc-card{width:100%}}.mat-mdc-card-avatar{height:53px;width:53px;margin:0}.mat-mdc-card-title{margin-bottom:12px}.mat-mdc-card-subtitle{margin-top:-8px;margin-left:16px}.mat-mdc-card-header{flex-shrink:0;padding:0 0 16px}.mat-mdc-card-content{font-size:14px;height:34px;margin-bottom:16px;padding:0}.mat-mdc-card-content p{font-size:14px}.mat-mdc-card{padding:16px}.mat-mdc-card-footer{margin:0 -16px calc(-1 * var(--tw-space-3, 12px)) -16px;padding:16px;padding-bottom:var(--tw-space-3, 12px)}.footer-span{display:block;font-size:12px}.language-icon{height:12px;width:12px;border-radius:50%;margin-top:2px}.info-item{font-weight:400;letter-spacing:normal}p{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1.MatCardAvatar, selector: "[mat-card-avatar], [matCardAvatar]" }, { kind: "directive", type: i1.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i1.MatCardFooter, selector: "mat-card-footer" }, { kind: "component", type: i1.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i1.MatCardSubtitle, selector: "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]" }, { kind: "directive", type: i1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: OcticonDirective, selector: "[octicon]", inputs: ["octicon", "color", "width"] }, { kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i3.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
280
410
  }
281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: RepoCardComponent, decorators: [{
411
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: RepoCardComponent, decorators: [{
282
412
  type: Component,
283
413
  args: [{ selector: 'repo-card', imports: [
284
414
  MatCardModule,
@@ -287,7 +417,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImpor
287
417
  OcticonDirective,
288
418
  ClipboardModule,
289
419
  DatePipe
290
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-card [ngStyle]=\"cardStyle()\">\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo().owner?.avatar_url || gitRepo().namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"buttonStyle()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"repoUrl()\"\n >\n {{ gitRepo().name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle class=\"flex-row\">\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo().language !== undefined\n ? githubLanguageColors[gitRepo().language!]\n : 'transparent'\n }\"\n class=\"language-icon flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().language }}</div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div octicon=\"star\" [color]=\"starColor()\" class=\"flex-gap-5\"></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().stargazers_count || gitRepo().star_count || 0 }}\n </div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"repo-forked\"\n [color]=\"forkColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().forks_count }}</div>\n </div>\n @if (gitRepo().open_issues_count) {\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"issue-opened\"\n [color]=\"issueColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().open_issues_count }}\n </div>\n </div>\n }\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo().description }}</p>\n </mat-card-content>\n <mat-card-footer class=\"flex-row\">\n <span class=\"mat-footer-cell flex-fxflex flex-gap-12\">\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\">{{ labels().created }}{{ gitRepo().created_at | date }}</span>\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\">{{ labels().updated }}{{ gitRepo().pushed_at || gitRepo().last_activity_at | date }}</span>\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"buttonStyle()\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo().clone_url || gitRepo().http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard.emit(true)\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper flex-row\">\n @if (isCopied()) {\n <div\n octicon=\"check\"\n [color]=\"checkColor()\"\n width=\"24\"\n class=\"flex-gap-5\"\n ></div>\n }\n <div\n octicon=\"paste\"\n [color]=\"pasteColor()\"\n width=\"24px\"\n class=\"flex-gap-5\"\n ></div>\n <span>{{ labels().copyRepoUrl }}</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n", styles: [".flex-align-start{justify-content:flex-start}.flex-align-stretch{align-content:stretch;align-items:stretch}.flex-row-wrap,.flex-row,.flex-column{display:flex;box-sizing:border-box}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-row-wrap{flex-direction:row;flex-wrap:wrap}.flex-fxflex{flex:1 1 0%}.flex-fxflex-responsive{flex:0 1 calc(33.3% - 32px)}.flex-fxflex-lt-md{flex:0 1 calc(50% - 32px)}.flex-fxflex-lt-sm{flex:100%}.flex-fxflex-fill{height:100%;min-height:100%;min-width:100%;width:100%}.flex-gap-5{margin-right:5px}.flex-gap-12{margin-right:12px}.flex-gap-20{margin-right:20px}.clipboard-button{height:29px;line-height:24px!important;padding:0!important;margin-bottom:0}.clipboard-button span{font-size:20px}.mat-mdc-button{vertical-align:middle;line-height:36px;font-size:24px;margin:0 var(--tw-space-3, 12px) 0 0;padding:0 16px;text-align:center;text-decoration:none}@media screen and (max-width:519px){.mat-mdc-button{font-size:16px;padding:0 8px}}.mat-mdc-card{display:flex;flex-direction:column;width:450px;max-width:100%;box-sizing:border-box}@media screen and (max-width:519px){.mat-mdc-card{width:100%}}.mat-mdc-card-avatar{height:53px;width:53px;margin:0}.mat-mdc-card-title{margin-bottom:12px}.mat-mdc-card-subtitle{margin-top:-8px;margin-left:16px}.mat-mdc-card-header{flex-shrink:0;padding:0 0 16px}.mat-mdc-card-content{font-size:14px;height:34px;margin-bottom:16px;padding:0}.mat-mdc-card-content p{font-size:14px}.mat-mdc-card{padding:16px}.mat-mdc-card-footer{margin:0 -16px calc(-1 * var(--tw-space-3, 12px)) -16px;padding:16px;padding-bottom:var(--tw-space-3, 12px)}.footer-span{display:block;font-size:12px}.language-icon{height:12px;width:12px;border-radius:50%;margin-top:2px}.info-item{font-weight:400;letter-spacing:normal}p{margin:0}\n"] }]
420
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-card [ngStyle]=\"cardStyle()\">\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo().owner?.avatar_url || gitRepo().namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"buttonStyle()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"repoUrl()\"\n >\n {{ gitRepo().name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle class=\"flex-row\">\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo().language !== undefined\n ? githubLanguageColors[gitRepo().language!]\n : 'transparent'\n }\"\n class=\"language-icon flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().language }}</div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div octicon=\"star\" [color]=\"starColor()\" class=\"flex-gap-5\"></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().stargazers_count || gitRepo().star_count || 0 }}\n </div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"repo-forked\"\n [color]=\"forkColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().forks_count }}</div>\n </div>\n @if (gitRepo().open_issues_count) {\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"issue-opened\"\n [color]=\"issueColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().open_issues_count }}\n </div>\n </div>\n }\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo().description }}</p>\n </mat-card-content>\n <mat-card-footer class=\"flex-row\">\n <span class=\"mat-footer-cell flex-fxflex flex-gap-12\">\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\"\n >{{ labels().created }}{{ gitRepo().created_at | date }}</span\n >\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\"\n >{{ labels().updated\n }}{{ gitRepo().pushed_at || gitRepo().last_activity_at | date }}</span\n >\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"buttonStyle()\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo().clone_url || gitRepo().http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard.emit(true)\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper flex-row\">\n @if (isCopied()) {\n <div\n octicon=\"check\"\n [color]=\"checkColor()\"\n width=\"24\"\n class=\"flex-gap-5\"\n ></div>\n }\n <div\n octicon=\"paste\"\n [color]=\"pasteColor()\"\n width=\"24px\"\n class=\"flex-gap-5\"\n ></div>\n <span>{{ labels().copyRepoUrl }}</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n", styles: [".flex-align-start{justify-content:flex-start}.flex-align-stretch{align-content:stretch;align-items:stretch}.flex-row-wrap,.flex-row,.flex-column{display:flex;box-sizing:border-box}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-row-wrap{flex-direction:row;flex-wrap:wrap}.flex-fxflex{flex:1 1 0%}.flex-fxflex-responsive{flex:0 1 calc(33.3% - 32px)}.flex-fxflex-lt-md{flex:0 1 calc(50% - 32px)}.flex-fxflex-lt-sm{flex:100%}.flex-fxflex-fill{height:100%;min-height:100%;min-width:100%;width:100%}.flex-gap-5{margin-right:5px}.flex-gap-12{margin-right:12px}.flex-gap-20{margin-right:20px}.clipboard-button{height:29px;line-height:24px!important;padding:0!important;margin-bottom:0}.clipboard-button span{font-size:20px}.mat-mdc-button{vertical-align:middle;line-height:36px;font-size:24px;margin:0 var(--tw-space-3, 12px) 0 0;padding:0 16px;text-align:center;text-decoration:none}@media screen and (max-width:519px){.mat-mdc-button{font-size:16px;padding:0 8px}}.mat-mdc-card{display:flex;flex-direction:column;width:450px;max-width:100%;box-sizing:border-box}@media screen and (max-width:519px){.mat-mdc-card{width:100%}}.mat-mdc-card-avatar{height:53px;width:53px;margin:0}.mat-mdc-card-title{margin-bottom:12px}.mat-mdc-card-subtitle{margin-top:-8px;margin-left:16px}.mat-mdc-card-header{flex-shrink:0;padding:0 0 16px}.mat-mdc-card-content{font-size:14px;height:34px;margin-bottom:16px;padding:0}.mat-mdc-card-content p{font-size:14px}.mat-mdc-card{padding:16px}.mat-mdc-card-footer{margin:0 -16px calc(-1 * var(--tw-space-3, 12px)) -16px;padding:16px;padding-bottom:var(--tw-space-3, 12px)}.footer-span{display:block;font-size:12px}.language-icon{height:12px;width:12px;border-radius:50%;margin-top:2px}.info-item{font-weight:400;letter-spacing:normal}p{margin:0}\n"] }]
291
421
  }], propDecorators: { buttonStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonStyle", required: true }] }], cardStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardStyle", required: true }] }], textStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "textStyle", required: true }] }], checkColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkColor", required: true }] }], forkColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "forkColor", required: true }] }], issueColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "issueColor", required: true }] }], pasteColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "pasteColor", required: true }] }], starColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "starColor", required: true }] }], gitRepo: [{ type: i0.Input, args: [{ isSignal: true, alias: "gitRepo", required: true }] }], isCopied: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCopied", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], copiedToClipboard: [{ type: i0.Output, args: ["copiedToClipboard"] }] } });
292
422
 
293
423
  var GitProviders;
@@ -367,6 +497,25 @@ class GitPortfolioComponent {
367
497
  this.RETRY_COOLDOWN_MS = 3000;
368
498
  this.lastRetryAt = 0;
369
499
  this.unsubscribe$ = new Subject();
500
+ /**
501
+ * Every load goes through here, so switchMap can drop the previous one. The
502
+ * config is a reactive input: a change starts a new request while an earlier
503
+ * one may still be in flight, and the provider APIs are slow enough for that
504
+ * to happen in practice. Without the cancel, a stale response arriving second
505
+ * would overwrite the current user's repositories, or fail a request the user
506
+ * has already moved on from and show the error state over good data.
507
+ */
508
+ this.load$ = new Subject();
509
+ this.load$
510
+ .pipe(switchMap((config) => this.gitProviderService.getRepositories(config).pipe(
511
+ // Keeps a failed request from completing the outer subscription,
512
+ // which would leave later retries with nothing listening.
513
+ catchError(() => of(null)))), takeUntil(this.unsubscribe$))
514
+ .subscribe((repositories) => {
515
+ this.gitRepositories.set(repositories ?? undefined);
516
+ this.loadFailed.set(repositories === null);
517
+ this.retrying.set(false);
518
+ });
370
519
  effect(() => {
371
520
  // Reads the config so a changed user refetches; the retry signals are set
372
521
  // inside getRepositories() and must not retrigger this effect.
@@ -407,21 +556,7 @@ class GitPortfolioComponent {
407
556
  return this.currentRepo()?.id === gitRepo.id ? true : false;
408
557
  }
409
558
  getRepositories() {
410
- this.gitProviderService
411
- .getRepositories(this.gitProviderConfig())
412
- .pipe(takeUntil(this.unsubscribe$))
413
- .subscribe({
414
- next: (repositories) => {
415
- this.gitRepositories.set(repositories);
416
- this.loadFailed.set(false);
417
- this.retrying.set(false);
418
- },
419
- error: () => {
420
- this.gitRepositories.set(undefined);
421
- this.loadFailed.set(true);
422
- this.retrying.set(false);
423
- }
424
- });
559
+ this.load$.next(this.gitProviderConfig());
425
560
  }
426
561
  /**
427
562
  * Rate limits the retry button. `retrying` alone is not enough: a failing
@@ -468,10 +603,10 @@ class GitPortfolioComponent {
468
603
  gitRepositories[gitProvider]?.[type]?.length > 0) ??
469
604
  false);
470
605
  }
471
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GitPortfolioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
472
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: GitPortfolioComponent, isStandalone: true, selector: "git-portfolio", inputs: { buttonStyle: { classPropertyName: "buttonStyle", publicName: "buttonStyle", isSignal: true, isRequired: false, transformFunction: null }, cardStyle: { classPropertyName: "cardStyle", publicName: "cardStyle", isSignal: true, isRequired: false, transformFunction: null }, textStyle: { classPropertyName: "textStyle", publicName: "textStyle", isSignal: true, isRequired: false, transformFunction: null }, checkColor: { classPropertyName: "checkColor", publicName: "checkColor", isSignal: true, isRequired: false, transformFunction: null }, forkColor: { classPropertyName: "forkColor", publicName: "forkColor", isSignal: true, isRequired: false, transformFunction: null }, issueColor: { classPropertyName: "issueColor", publicName: "issueColor", isSignal: true, isRequired: false, transformFunction: null }, pasteColor: { classPropertyName: "pasteColor", publicName: "pasteColor", isSignal: true, isRequired: false, transformFunction: null }, starColor: { classPropertyName: "starColor", publicName: "starColor", isSignal: true, isRequired: false, transformFunction: null }, gitProviderConfig: { classPropertyName: "gitProviderConfig", publicName: "gitProviderConfig", isSignal: true, isRequired: false, transformFunction: null }, showForked: { classPropertyName: "showForked", publicName: "showForked", isSignal: true, isRequired: false, transformFunction: null }, showOwn: { classPropertyName: "showOwn", publicName: "showOwn", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (loadFailed()) {\n <div class=\"load-error\" role=\"alert\">\n <p [ngStyle]=\"textStyle()\">{{ labels().loadError }}</p>\n <button\n type=\"button\"\n class=\"retry-button\"\n [ngStyle]=\"buttonStyle()\"\n [disabled]=\"retryDisabled()\"\n (click)=\"retryLoad()\"\n >\n {{ retrying() ? labels().retrying : labels().retry }}\n </button>\n </div>\n}\n@if (retrying()) {\n <div class=\"retry-spinner\">\n <mat-spinner></mat-spinner>\n </div>\n}\n@if (gitRepositories(); as gitRepositories) {\n <div>\n @for (gitProvider of gitProviders | keyvalue; track gitProvider) {\n @if (hasAnyRepositories(gitRepositories, gitProvider.key)) {\n <div>\n <h1 [ngStyle]=\"textStyle()\" class=\"mat-headline\">\n {{ gitProvider.value }}\n </h1>\n <mat-tab-group class=\"repository-tabs\" [ngStyle]=\"textStyle()\">\n @if (showOwn()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().ownRepos,\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n >\n </repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noOwnRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n @if (showForked()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().forkedRepos,\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n ></repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noForkedRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n </mat-tab-group>\n </div>\n }\n }\n </div>\n}\n", styles: [".flex-align-start{justify-content:flex-start}.flex-align-stretch{align-content:stretch;align-items:stretch}.flex-row-wrap,.flex-row,.flex-column{display:flex;box-sizing:border-box}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-row-wrap{flex-direction:row;flex-wrap:wrap}.flex-fxflex{flex:1 1 0%}.flex-fxflex-responsive{flex:0 1 calc(33.3% - 32px)}.flex-fxflex-lt-md{flex:0 1 calc(50% - 32px)}.flex-fxflex-lt-sm{flex:100%}.flex-fxflex-fill{height:100%;min-height:100%;min-width:100%;width:100%}.flex-gap-5{margin-right:5px}.flex-gap-12{margin-right:12px}.flex-gap-20{margin-right:20px}.repository-card{max-width:450px;margin:0 32px 32px 0}@media screen and (max-width:519px){.repository-card{max-width:100%;width:100%;margin:0 0 16px;box-sizing:border-box}}.mat-headline{font-weight:400;line-height:32px;margin-bottom:16px;margin-top:0}.repository-tabs{--mat-tab-inactive-label-text-color: var(--tw-text, #6699bb);--mat-tab-inactive-hover-label-text-color: var(--tw-text, #6699bb);--mat-tab-inactive-focus-label-text-color: var(--tw-text, #6699bb);--mat-tab-active-label-text-color: var(--tw-accent, #cc7832);--mat-tab-active-hover-label-text-color: var(--tw-accent, #cc7832);--mat-tab-active-focus-label-text-color: var(--tw-accent, #cc7832);--mat-tab-active-indicator-color: var(--tw-accent, #cc7832);--mat-tab-active-ripple-color: var(--tw-accent, #cc7832);--mat-tab-inactive-ripple-color: var(--tw-text, #6699bb)}.tab-content{padding-top:var(--tw-space-6, 24px)}.load-error{display:flex;flex-direction:column;align-items:flex-start;gap:var(--tw-space-3, 12px);margin-bottom:var(--tw-space-4, 16px)}.retry-button{padding:var(--tw-space-2, 8px) var(--tw-space-4, 16px);border:none;border-radius:var(--tw-radius-md, 4px);cursor:pointer;font:inherit}.retry-button:disabled{cursor:not-allowed;opacity:.6}.retry-spinner{margin-bottom:var(--tw-space-4, 16px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: LayoutModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i3$1.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i3$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i3$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: RepoCardComponent, selector: "repo-card", inputs: ["buttonStyle", "cardStyle", "textStyle", "checkColor", "forkColor", "issueColor", "pasteColor", "starColor", "gitRepo", "isCopied", "labels"], outputs: ["copiedToClipboard"] }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
606
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GitPortfolioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
607
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: GitPortfolioComponent, isStandalone: true, selector: "git-portfolio", inputs: { buttonStyle: { classPropertyName: "buttonStyle", publicName: "buttonStyle", isSignal: true, isRequired: false, transformFunction: null }, cardStyle: { classPropertyName: "cardStyle", publicName: "cardStyle", isSignal: true, isRequired: false, transformFunction: null }, textStyle: { classPropertyName: "textStyle", publicName: "textStyle", isSignal: true, isRequired: false, transformFunction: null }, checkColor: { classPropertyName: "checkColor", publicName: "checkColor", isSignal: true, isRequired: false, transformFunction: null }, forkColor: { classPropertyName: "forkColor", publicName: "forkColor", isSignal: true, isRequired: false, transformFunction: null }, issueColor: { classPropertyName: "issueColor", publicName: "issueColor", isSignal: true, isRequired: false, transformFunction: null }, pasteColor: { classPropertyName: "pasteColor", publicName: "pasteColor", isSignal: true, isRequired: false, transformFunction: null }, starColor: { classPropertyName: "starColor", publicName: "starColor", isSignal: true, isRequired: false, transformFunction: null }, gitProviderConfig: { classPropertyName: "gitProviderConfig", publicName: "gitProviderConfig", isSignal: true, isRequired: false, transformFunction: null }, showForked: { classPropertyName: "showForked", publicName: "showForked", isSignal: true, isRequired: false, transformFunction: null }, showOwn: { classPropertyName: "showOwn", publicName: "showOwn", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (loadFailed()) {\n <div class=\"load-error\" role=\"alert\">\n <p [ngStyle]=\"textStyle()\">{{ labels().loadError }}</p>\n <button\n type=\"button\"\n class=\"retry-button\"\n [ngStyle]=\"buttonStyle()\"\n [disabled]=\"retryDisabled()\"\n (click)=\"retryLoad()\"\n >\n {{ retrying() ? labels().retrying : labels().retry }}\n </button>\n </div>\n}\n@if (retrying()) {\n <div class=\"retry-spinner\">\n <mat-spinner></mat-spinner>\n </div>\n}\n@if (gitRepositories(); as gitRepositories) {\n <div>\n @for (gitProvider of gitProviders | keyvalue; track gitProvider) {\n @if (hasAnyRepositories(gitRepositories, gitProvider.key)) {\n <div>\n <h1 [ngStyle]=\"textStyle()\" class=\"mat-headline\">\n {{ gitProvider.value }}\n </h1>\n <mat-tab-group class=\"repository-tabs\" [ngStyle]=\"textStyle()\">\n @if (showOwn()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().ownRepos,\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n >\n </repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noOwnRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n @if (showForked()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().forkedRepos,\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n ></repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noForkedRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n </mat-tab-group>\n </div>\n }\n }\n </div>\n}\n", styles: [".flex-align-start{justify-content:flex-start}.flex-align-stretch{align-content:stretch;align-items:stretch}.flex-row-wrap,.flex-row,.flex-column{display:flex;box-sizing:border-box}.flex-column{flex-direction:column}.flex-row{flex-direction:row}.flex-row-wrap{flex-direction:row;flex-wrap:wrap}.flex-fxflex{flex:1 1 0%}.flex-fxflex-responsive{flex:0 1 calc(33.3% - 32px)}.flex-fxflex-lt-md{flex:0 1 calc(50% - 32px)}.flex-fxflex-lt-sm{flex:100%}.flex-fxflex-fill{height:100%;min-height:100%;min-width:100%;width:100%}.flex-gap-5{margin-right:5px}.flex-gap-12{margin-right:12px}.flex-gap-20{margin-right:20px}.repository-card{max-width:450px;margin:0 32px 32px 0}@media screen and (max-width:519px){.repository-card{max-width:100%;width:100%;margin:0 0 16px;box-sizing:border-box}}.mat-headline{font-weight:400;line-height:32px;margin-bottom:16px;margin-top:0}.repository-tabs{--mat-tab-inactive-label-text-color: var(--tw-text, #6699bb);--mat-tab-inactive-hover-label-text-color: var(--tw-text, #6699bb);--mat-tab-inactive-focus-label-text-color: var(--tw-text, #6699bb);--mat-tab-active-label-text-color: var(--tw-accent, #cc7832);--mat-tab-active-hover-label-text-color: var(--tw-accent, #cc7832);--mat-tab-active-focus-label-text-color: var(--tw-accent, #cc7832);--mat-tab-active-indicator-color: var(--tw-accent, #cc7832);--mat-tab-active-ripple-color: var(--tw-accent, #cc7832);--mat-tab-inactive-ripple-color: var(--tw-text, #6699bb)}.tab-content{padding-top:var(--tw-space-6, 24px)}.load-error{display:flex;flex-direction:column;align-items:flex-start;gap:var(--tw-space-3, 12px);margin-bottom:var(--tw-space-4, 16px)}.retry-button{padding:var(--tw-space-2, 8px) var(--tw-space-4, 16px);border:none;border-radius:var(--tw-radius-md, 4px);cursor:pointer;font:inherit}.retry-button:disabled{cursor:not-allowed;opacity:.6}.retry-spinner{margin-bottom:var(--tw-space-4, 16px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: LayoutModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "directive", type: i3$1.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i3$1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i3$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "component", type: RepoCardComponent, selector: "repo-card", inputs: ["buttonStyle", "cardStyle", "textStyle", "checkColor", "forkColor", "issueColor", "pasteColor", "starColor", "gitRepo", "isCopied", "labels"], outputs: ["copiedToClipboard"] }, { kind: "pipe", type: i1$1.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
473
608
  }
474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: GitPortfolioComponent, decorators: [{
609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: GitPortfolioComponent, decorators: [{
475
610
  type: Component,
476
611
  args: [{ selector: 'git-portfolio', imports: [
477
612
  CommonModule,
@@ -1 +1 @@
1
- {"version":3,"file":"tehw0lf-git-portfolio.mjs","sources":["../../../../libs/git-portfolio/src/lib/git-provider.service.ts","../../../../libs/git-portfolio/src/lib/octicon.directive.ts","../../../../libs/git-portfolio/src/lib/repo-card/repo-card.component.ts","../../../../libs/git-portfolio/src/lib/repo-card/repo-card.component.html","../../../../libs/git-portfolio/src/lib/types/git-providers-type.ts","../../../../libs/git-portfolio/src/lib/git-portfolio.component.ts","../../../../libs/git-portfolio/src/lib/git-portfolio.component.html","../../../../libs/git-portfolio/src/lib/types/git-repository-type.ts","../../../../libs/git-portfolio/src/tehw0lf-git-portfolio.ts"],"sourcesContent":["import { HttpClient, HttpResponse } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport {\n BehaviorSubject,\n expand,\n Observable,\n of,\n reduce,\n throwError,\n zip\n} from 'rxjs';\nimport { catchError, map, tap, shareReplay, takeWhile } from 'rxjs/operators';\n\nimport { GitProviderConfig } from './types/git-provider-config-type';\nimport { GitRepositories } from './types/git-repositories-type';\nimport { GitRepository } from './types/git-repository-type';\n\ninterface CacheEntry {\n data: Observable<GitRepositories>;\n timestamp: number;\n ttl: number;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class GitProviderService {\n private http = inject(HttpClient);\n private readonly CACHE_TTL = 10 * 60 * 1000; // 10 minutes\n private readonly MAX_CACHE_SIZE = 50;\n\n private loadingStateSubject = new BehaviorSubject<boolean>(true);\n private repositorySubject = new BehaviorSubject<GitRepositories>({});\n private repositoryCache = new Map<string, CacheEntry>();\n\n get loading(): Observable<boolean> {\n return this.loadingStateSubject.asObservable();\n }\n\n /**\n * A failed fetch must not settle in the cache: shareReplay(1) would replay the\n * error to every later subscriber for the full TTL, so a single dropped\n * connection would keep the portfolio broken long after the network returned.\n */\n private evictCacheEntry(cacheKey: string): void {\n this.repositoryCache.delete(cacheKey);\n }\n\n getRepositories(\n gitProviderUserNames?: GitProviderConfig\n ): Observable<GitRepositories> {\n const cacheKey = this.createCacheKey(gitProviderUserNames);\n const cachedEntry = this.repositoryCache.get(cacheKey);\n \n // Check if cache entry exists and is still valid\n if (cachedEntry && this.isCacheValid(cachedEntry)) {\n return cachedEntry.data;\n }\n \n // Clean up expired entries and manage cache size\n this.cleanupCache();\n \n const repositories$ = this.fetchRepositories(gitProviderUserNames).pipe(\n tap((repositories: GitRepositories) => {\n this.repositorySubject.next(repositories);\n this.loadingStateSubject.next(false);\n }),\n catchError((error: unknown) => {\n // Loading ends on both paths, otherwise the spinner outlives the request.\n this.loadingStateSubject.next(false);\n this.evictCacheEntry(cacheKey);\n return throwError(() => error);\n }),\n shareReplay(1)\n );\n \n this.repositoryCache.set(cacheKey, {\n data: repositories$,\n timestamp: Date.now(),\n ttl: this.CACHE_TTL\n });\n \n return repositories$;\n }\n\n private createCacheKey(config?: GitProviderConfig): string {\n if (!config) return 'default';\n const parts: string[] = [];\n if (config.github) parts.push(`gh:${config.github}`);\n if (config.gitlab) parts.push(`gl:${config.gitlab}`);\n return parts.join('|') || 'default';\n }\n\n private isCacheValid(entry: CacheEntry): boolean {\n return (Date.now() - entry.timestamp) < entry.ttl;\n }\n\n private cleanupCache(): void {\n // Remove expired entries\n for (const [key, entry] of this.repositoryCache.entries()) {\n if (!this.isCacheValid(entry)) {\n this.repositoryCache.delete(key);\n }\n }\n \n // If cache is still too large, remove oldest entries\n if (this.repositoryCache.size >= this.MAX_CACHE_SIZE) {\n const entries = Array.from(this.repositoryCache.entries())\n .sort(([, a], [, b]) => a.timestamp - b.timestamp);\n \n const toRemove = entries.slice(0, entries.length - this.MAX_CACHE_SIZE + 1);\n toRemove.forEach(([key]) => this.repositoryCache.delete(key));\n }\n }\n\n fetchRepositories(\n gitProviderUserNames?: GitProviderConfig\n ): Observable<GitRepositories> {\n return zip(\n this.fetchGithubRepositories(gitProviderUserNames?.github ?? ''),\n this.fetchGitlabRepositories(gitProviderUserNames?.gitlab ?? '')\n ).pipe(\n map((gitRepositoryMap: GitRepository[][]) => {\n const repositories: GitRepositories = {\n github: this.filterAndSortGitRepositories(gitRepositoryMap[0]),\n gitlab: this.filterAndSortGitRepositories(gitRepositoryMap[1])\n };\n return repositories;\n })\n );\n }\n\n private filterAndSortGitRepositories(gitRepositoryArray: GitRepository[]): {\n own: GitRepository[];\n forked: GitRepository[];\n } {\n return {\n own: gitRepositoryArray\n .filter((gitRepository: GitRepository) => !gitRepository.fork)\n .sort(\n (repoA: GitRepository, repoB: GitRepository) =>\n (repoB.stargazers_count ?? 0) - (repoA.stargazers_count ?? 0)\n ),\n forked: gitRepositoryArray\n .filter((gitRepository: GitRepository) => gitRepository.fork)\n .sort(\n (repoA: GitRepository, repoB: GitRepository) =>\n (repoB.stargazers_count ?? 0) - (repoA.stargazers_count ?? 0)\n )\n };\n }\n\n /**\n * Every page must arrive before the result counts. A page that fails midway\n * would otherwise reduce to whatever was collected so far, and since the\n * providers sort by name rather than by fork flag, a truncated list renders\n * as a real but incomplete portfolio — \"no forked repositories\" instead of an\n * error. Failing the whole fetch keeps a partial answer from posing as a\n * complete one.\n */\n private fetchAllPages<T>(firstUrl: string): Observable<T[]> {\n return this.http.get<T[]>(firstUrl, { observe: 'response' }).pipe(\n expand((response) => {\n const next = this.parseLinkHeader(response.headers.get('Link'));\n return next\n ? this.http.get<T[]>(next, { observe: 'response' })\n : of(null);\n }),\n takeWhile((response): response is HttpResponse<T[]> => response !== null),\n reduce(\n (acc: T[], response) => acc.concat(response.body ?? []),\n []\n ),\n shareReplay(1)\n );\n }\n\n private parseLinkHeader(header: string | null): string | null {\n if (!header) return null;\n const match = header.match(/<([^>]+)>;\\s*rel=\"next\"/);\n return match ? match[1] : null;\n }\n\n private fetchGithubRepositories(\n githubUser: string\n ): Observable<GitRepository[]> {\n if (githubUser !== '') {\n return this.fetchAllPages<GitRepository>(\n `https://api.github.com/users/${githubUser}/repos?per_page=100`\n );\n }\n return of([]);\n }\n\n private fetchGitlabRepositories(\n gitlabUser: string\n ): Observable<GitRepository[]> {\n if (gitlabUser !== '') {\n return this.fetchAllPages<GitRepository>(\n `https://gitlab.com/api/v4/users/${gitlabUser}/projects?per_page=100`\n );\n }\n return of([]);\n }\n\n clearCache(): void {\n this.repositoryCache.clear();\n this.loadingStateSubject.next(true);\n this.repositorySubject.next({});\n }\n}\n","import { Directive, ElementRef, input, OnInit, Renderer2, inject } from '@angular/core';\n\nconst svgCache = new Map<string, Promise<string>>();\n\nconst KNOWN_ICONS = new Set([\n 'check', 'issue-opened', 'paste', 'repo-forked', 'star', 'alert'\n]);\n\nfunction fetchSvg(name: string): Promise<string> {\n const icon = KNOWN_ICONS.has(name) ? name : 'alert';\n if (!svgCache.has(icon)) {\n const promise = fetch(`/assets/icons/octicons/${icon}.svg`).then((r) => {\n if (!r.ok) throw new Error(`Failed to load octicon \"${icon}\": ${r.status}`);\n return r.text();\n });\n promise.catch(() => svgCache.delete(icon));\n svgCache.set(icon, promise);\n }\n return svgCache.get(icon)!;\n}\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[octicon]',\n standalone: true\n})\nexport class OcticonDirective implements OnInit {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n octicon = input.required<string>();\n color = input.required<string>();\n width = input<string>();\n\n ngOnInit(): void {\n fetchSvg(this.octicon())\n .then((svgText) => {\n const el: HTMLElement = this.elementRef.nativeElement;\n const icon = this.insertSvgSafely(el, svgText);\n if (this.color() && icon) {\n this.renderer.setStyle(icon, 'fill', this.color());\n }\n if (this.width() && icon) {\n this.renderer.setStyle(icon, 'width', this.width());\n this.renderer.setStyle(icon, 'height', this.width());\n }\n })\n .catch((err) => console.error(err));\n }\n\n private insertSvgSafely(element: HTMLElement, svgString: string): Element | null {\n const range = document.createRange();\n range.selectNode(element);\n const fragment = range.createContextualFragment(svgString);\n while (element.firstChild) {\n this.renderer.removeChild(element, element.firstChild);\n }\n const svgElement = fragment.querySelector('svg');\n if (svgElement) {\n this.renderer.appendChild(element, svgElement);\n }\n return svgElement;\n }\n}\n","import { ClipboardModule } from '@angular/cdk/clipboard';\nimport { DatePipe, NgStyle } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCardModule } from '@angular/material/card';\nimport * as githubLanguageColors from 'github-language-colors/colors.json';\n\nimport { OcticonDirective } from '../octicon.directive';\nimport { GitRepository } from '../types/git-repository-type';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\ninterface Dictionary {\n [id: string]: string;\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'repo-card',\n templateUrl: './repo-card.component.html',\n styleUrls: ['./repo-card.component.scss'],\n imports: [\n MatCardModule,\n NgStyle,\n MatButtonModule,\n OcticonDirective,\n ClipboardModule,\n DatePipe\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RepoCardComponent {\n buttonStyle = input.required<any>();\n cardStyle = input.required<any>();\n textStyle = input.required<any>();\n checkColor = input.required<string>();\n forkColor = input.required<string>();\n issueColor = input.required<string>();\n pasteColor = input.required<string>();\n starColor = input.required<string>();\n\n gitRepo = input.required<GitRepository>();\n\n isCopied = input(false);\n\n labels = input({\n copyRepoUrl: 'Copy repo URL',\n created: 'Created: ',\n updated: 'Updated: '\n });\n\n copiedToClipboard = output<boolean>();\n\n githubLanguageColors = githubLanguageColors as Dictionary;\n\n repoUrl = computed(() => {\n const url =\n this.gitRepo().homepage ||\n this.gitRepo().html_url ||\n this.gitRepo().web_url ||\n '';\n\n try {\n const parsed = new URL(url);\n return parsed.protocol === 'http:' || parsed.protocol === 'https:'\n ? url\n : null;\n } catch {\n return null;\n }\n });\n}\n","<mat-card [ngStyle]=\"cardStyle()\">\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo().owner?.avatar_url || gitRepo().namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"buttonStyle()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"repoUrl()\"\n >\n {{ gitRepo().name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle class=\"flex-row\">\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo().language !== undefined\n ? githubLanguageColors[gitRepo().language!]\n : 'transparent'\n }\"\n class=\"language-icon flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().language }}</div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div octicon=\"star\" [color]=\"starColor()\" class=\"flex-gap-5\"></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().stargazers_count || gitRepo().star_count || 0 }}\n </div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"repo-forked\"\n [color]=\"forkColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().forks_count }}</div>\n </div>\n @if (gitRepo().open_issues_count) {\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"issue-opened\"\n [color]=\"issueColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().open_issues_count }}\n </div>\n </div>\n }\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo().description }}</p>\n </mat-card-content>\n <mat-card-footer class=\"flex-row\">\n <span class=\"mat-footer-cell flex-fxflex flex-gap-12\">\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\">{{ labels().created }}{{ gitRepo().created_at | date }}</span>\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\">{{ labels().updated }}{{ gitRepo().pushed_at || gitRepo().last_activity_at | date }}</span>\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"buttonStyle()\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo().clone_url || gitRepo().http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard.emit(true)\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper flex-row\">\n @if (isCopied()) {\n <div\n octicon=\"check\"\n [color]=\"checkColor()\"\n width=\"24\"\n class=\"flex-gap-5\"\n ></div>\n }\n <div\n octicon=\"paste\"\n [color]=\"pasteColor()\"\n width=\"24px\"\n class=\"flex-gap-5\"\n ></div>\n <span>{{ labels().copyRepoUrl }}</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n","export enum GitProviders {\n github = 'GitHub',\n gitlab = 'GitLab'\n}\n","import {\n BreakpointObserver,\n BreakpointState,\n LayoutModule\n} from '@angular/cdk/layout';\nimport { CommonModule, KeyValuePipe, NgStyle } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n input,\n inject,\n signal,\n effect,\n computed,\n untracked,\n OnDestroy\n} from '@angular/core';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { takeUntil, tap } from 'rxjs/operators';\nimport { Subject } from 'rxjs';\n\nimport { GitProviderService } from './git-provider.service';\nimport { RepoCardComponent } from './repo-card/repo-card.component';\nimport { GitProviderConfig } from './types/git-provider-config-type';\nimport { GitProviders } from './types/git-providers-type';\nimport { GitRepositories } from './types/git-repositories-type';\nimport { GitRepository } from './types/git-repository-type';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'git-portfolio',\n templateUrl: './git-portfolio.component.html',\n styleUrls: ['./git-portfolio.component.scss'],\n imports: [\n CommonModule,\n LayoutModule,\n NgStyle,\n MatProgressSpinnerModule,\n MatTabsModule,\n RepoCardComponent,\n KeyValuePipe\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class GitPortfolioComponent implements OnDestroy {\n private gitProviderService = inject(GitProviderService);\n private breakpointObserver = inject(BreakpointObserver);\n\n buttonStyle = input({\n 'background-color': 'var(--tw-neutral-650, #424242)',\n color: 'var(--tw-accent, #cc7832)'\n });\n\n cardStyle = input({\n color: 'var(--tw-text, #6699bb)',\n 'background-color': 'var(--tw-glass-bg, rgba(34, 34, 34, 0.75))',\n 'backdrop-filter': 'var(--tw-glass-blur, blur(50px))'\n });\n\n textStyle = input({ color: 'var(--tw-text, #6699bb)' });\n\n checkColor = input('var(--tw-success, #38e038)');\n\n forkColor = input('var(--tw-text, #6699bb)');\n\n issueColor = input('var(--tw-success, #38e038)');\n\n pasteColor = input('var(--tw-accent, #cc7832)');\n\n starColor = input('gold');\n\n gitProviderConfig = input<GitProviderConfig>({});\n\n showForked = input(true);\n\n showOwn = input(true);\n\n labels = input({\n ownRepos: 'Own Repos',\n forkedRepos: 'Forked Repos',\n noOwnRepos: 'This user has not created any repositories yet',\n noForkedRepos: 'This user has not forked any repositories yet',\n copyRepoUrl: 'Copy repo URL',\n created: 'Created: ',\n updated: 'Updated: ',\n loadError: 'Repositories could not be loaded',\n retry: 'Try again',\n retrying: 'Retrying...'\n });\n\n repoCardLabels = computed(() => ({\n copyRepoUrl: this.labels().copyRepoUrl,\n created: this.labels().created,\n updated: this.labels().updated\n }));\n\n loading = toSignal(this.gitProviderService.loading, { initialValue: true });\n gitProviders = GitProviders;\n currentRepo = signal<GitRepository | undefined>(undefined);\n gitRepositories = signal<GitRepositories | undefined>(undefined);\n viewport = signal('');\n loadFailed = signal(false);\n retrying = signal(false);\n coolingDown = signal(false);\n retryDisabled = computed(() => this.retrying() || this.coolingDown());\n\n private readonly RETRY_COOLDOWN_MS = 3000;\n private lastRetryAt = 0;\n private cooldownTimer?: ReturnType<typeof setTimeout>;\n\n private unsubscribe$ = new Subject<void>();\n\n constructor() {\n effect(() => {\n // Reads the config so a changed user refetches; the retry signals are set\n // inside getRepositories() and must not retrigger this effect.\n this.gitProviderConfig();\n untracked(() => this.getRepositories());\n });\n\n this.breakpointObserver\n .observe([\n '(max-width: 599.98px)',\n '(max-width: 959.98px)',\n '(min-width: 960px)'\n ])\n .pipe(\n tap((breakpointState: BreakpointState) => {\n if (breakpointState.breakpoints['(max-width: 599.98px)']) {\n this.viewport.set('xsmall');\n } else if (breakpointState.breakpoints['(max-width: 959.98px)']) {\n this.viewport.set('small');\n } else {\n this.viewport.set('medium');\n }\n }),\n takeUntil(this.unsubscribe$)\n )\n .subscribe();\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.cooldownTimer);\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n copyToClipboard(gitRepo: GitRepository): void {\n this.currentRepo.set(gitRepo);\n }\n\n isCopiedToClipboard(gitRepo: GitRepository): boolean {\n if (!this.currentRepo()) {\n return false;\n }\n return this.currentRepo()?.id === gitRepo.id ? true : false;\n }\n\n getRepositories(): void {\n this.gitProviderService\n .getRepositories(this.gitProviderConfig())\n .pipe(takeUntil(this.unsubscribe$))\n .subscribe({\n next: (repositories) => {\n this.gitRepositories.set(repositories);\n this.loadFailed.set(false);\n this.retrying.set(false);\n },\n error: () => {\n this.gitRepositories.set(undefined);\n this.loadFailed.set(true);\n this.retrying.set(false);\n }\n });\n }\n\n /**\n * Rate limits the retry button. `retrying` alone is not enough: a failing\n * request (offline, aborted) rejects almost immediately, so the in-flight flag\n * is already back to false by the time the next click lands and a user could\n * hammer the provider APIs, which are rate limited per IP. The cooldown makes\n * the gap between two attempts the binding constraint.\n */\n retryLoad(): void {\n const now = Date.now();\n if (this.retrying() || now - this.lastRetryAt < this.RETRY_COOLDOWN_MS) {\n return;\n }\n this.lastRetryAt = now;\n this.retrying.set(true);\n this.loadFailed.set(false);\n this.startCooldown();\n this.getRepositories();\n }\n\n private startCooldown(): void {\n this.coolingDown.set(true);\n clearTimeout(this.cooldownTimer);\n this.cooldownTimer = setTimeout(\n () => this.coolingDown.set(false),\n this.RETRY_COOLDOWN_MS\n );\n }\n\n getGitRepositoriesOfType(\n gitRepositories: GitRepositories | undefined,\n gitProvider: string,\n type: 'own' | 'forked'\n ): GitRepository[] {\n return gitRepositories?.[gitProvider]?.[type] ?? [];\n }\n\n hasAnyRepositories(\n gitRepositories: GitRepositories | undefined,\n gitProvider: string\n ): boolean {\n return (\n (gitRepositories?.[gitProvider] &&\n (gitRepositories[gitProvider].own?.length > 0 ||\n gitRepositories[gitProvider].forked?.length > 0)) ??\n false\n );\n }\n\n /**\n * Appends the repository count to a tab label, so both the existence and the\n * size of each group are visible without opening the tab.\n */\n tabLabel(\n label: string,\n gitRepositories: GitRepositories | undefined,\n gitProvider: string,\n type: 'own' | 'forked'\n ): string {\n const count = this.getGitRepositoriesOfType(\n gitRepositories,\n gitProvider,\n type\n ).length;\n return `${label} (${count})`;\n }\n\n hasRepositoriesOfType(\n gitRepositories: GitRepositories | undefined,\n gitProvider: string,\n type: 'own' | 'forked'\n ): boolean {\n return (\n (gitRepositories?.[gitProvider] &&\n gitRepositories[gitProvider]?.[type]?.length > 0) ??\n false\n );\n }\n}\n","@if (loadFailed()) {\n <div class=\"load-error\" role=\"alert\">\n <p [ngStyle]=\"textStyle()\">{{ labels().loadError }}</p>\n <button\n type=\"button\"\n class=\"retry-button\"\n [ngStyle]=\"buttonStyle()\"\n [disabled]=\"retryDisabled()\"\n (click)=\"retryLoad()\"\n >\n {{ retrying() ? labels().retrying : labels().retry }}\n </button>\n </div>\n}\n@if (retrying()) {\n <div class=\"retry-spinner\">\n <mat-spinner></mat-spinner>\n </div>\n}\n@if (gitRepositories(); as gitRepositories) {\n <div>\n @for (gitProvider of gitProviders | keyvalue; track gitProvider) {\n @if (hasAnyRepositories(gitRepositories, gitProvider.key)) {\n <div>\n <h1 [ngStyle]=\"textStyle()\" class=\"mat-headline\">\n {{ gitProvider.value }}\n </h1>\n <mat-tab-group class=\"repository-tabs\" [ngStyle]=\"textStyle()\">\n @if (showOwn()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().ownRepos,\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n >\n </repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noOwnRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n @if (showForked()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().forkedRepos,\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n ></repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noForkedRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n </mat-tab-group>\n </div>\n }\n }\n </div>\n}\n","export class GitRepository {\n id: number | undefined;\n clone_url?: string;\n http_url_to_repo?: string;\n created_at: string | undefined;\n description: string | undefined;\n fork?: boolean;\n forks_count: number | undefined;\n homepage?: string;\n html_url?: string;\n web_url?: string;\n language?: string;\n license?: {\n key: string;\n name: string;\n node_id: string;\n spdx_id: string;\n url: string;\n };\n name: string | undefined;\n open_issues_count?: number;\n owner?: {\n avatar_url: string;\n };\n namespace?: {\n avatar_url: string;\n };\n pushed_at?: string;\n last_activity_at?: string;\n stargazers_count?: number;\n star_count?: number;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;MA0Ba,kBAAkB,CAAA;AAH/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EAAA,IAAA,EAAAF,IAAA,CAAA,YAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKR,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAhBjC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAGhB;wBACP,YAAY;wBACZ,YAAY;wBACZ,OAAO;wBACP,wBAAwB;wBACxB,aAAa;wBACb,iBAAiB;wBACjB;qBACD,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,6iNAAA,EAAA,MAAA,EAAA,CAAA,01DAAA,CAAA,EAAA;;;ME5CpC,aAAa,CAAA;AA+BzB;;AC/BD;;AAEG;;;;"}
1
+ {"version":3,"file":"tehw0lf-git-portfolio.mjs","sources":["../../../../libs/git-portfolio/src/lib/git-provider.service.ts","../../../../libs/git-portfolio/src/lib/octicon.directive.ts","../../../../libs/git-portfolio/src/lib/repo-card/repo-card.component.ts","../../../../libs/git-portfolio/src/lib/repo-card/repo-card.component.html","../../../../libs/git-portfolio/src/lib/types/git-providers-type.ts","../../../../libs/git-portfolio/src/lib/git-portfolio.component.ts","../../../../libs/git-portfolio/src/lib/git-portfolio.component.html","../../../../libs/git-portfolio/src/lib/types/git-repository-type.ts","../../../../libs/git-portfolio/src/tehw0lf-git-portfolio.ts"],"sourcesContent":["import { HttpClient, HttpResponse } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport {\n BehaviorSubject,\n defer,\n expand,\n Observable,\n of,\n reduce,\n throwError,\n zip\n} from 'rxjs';\nimport {\n catchError,\n finalize,\n map,\n share,\n takeWhile,\n tap\n} from 'rxjs/operators';\n\nimport { GitProviderConfig } from './types/git-provider-config-type';\nimport { GitRepositories } from './types/git-repositories-type';\nimport { GitRepository } from './types/git-repository-type';\n\ninterface CacheEntry {\n data: GitRepositories;\n timestamp: number;\n ttl: number;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class GitProviderService {\n private http = inject(HttpClient);\n private readonly CACHE_TTL = 10 * 60 * 1000; // 10 minutes\n private readonly MAX_CACHE_SIZE = 50;\n\n private loadingStateSubject = new BehaviorSubject<boolean>(true);\n private repositorySubject = new BehaviorSubject<GitRepositories>({});\n private repositoryCache = new Map<string, CacheEntry>();\n\n /**\n * Keyed by cache key, but each entry carries its own token. A settling\n * request may only write the cache or clean up while it still *owns* the\n * entry — clearCache() drops ownership, and a newer request for the same key\n * takes it over. Without that, a response already on the wire would\n * repopulate the cache it was just told to forget, and a late straggler\n * would delete the tracking entry belonging to the request that replaced it.\n */\n private inFlightRequests = new Map<\n string,\n { token: symbol; request: Observable<GitRepositories> }\n >();\n\n /**\n * Bumped by clearCache(). The shared state needs its own generation rather\n * than the ownership token above, because a request releases that token as\n * its value lands — before withLoadingState() sees the same value — so by\n * then ownership can no longer tell a current load from an invalidated one.\n */\n private stateGeneration = 0;\n\n get loading(): Observable<boolean> {\n return this.loadingStateSubject.asObservable();\n }\n\n /**\n * A failed fetch must not settle in the cache, so a single dropped\n * connection cannot keep the portfolio broken long after the network\n * returned. Only a successful response is stored.\n */\n private evictCacheEntry(cacheKey: string): void {\n this.repositoryCache.delete(cacheKey);\n }\n\n /**\n * The cache holds the settled response, not the observable that produced it.\n *\n * It used to hold the in-flight stream, kept alive by a non-ref-counted\n * shareReplay(1), and that is irreconcilable with cancelling an abandoned\n * load: the operator must outlive its subscribers for a later hit to replay,\n * which is exactly what stops it from dying when the caller walks away. A\n * superseded load therefore kept paging against a rate-limited API and still\n * ran its side effects, clearing the spinner out from under the load that\n * replaced it. refCount only trades the bug for a worse one — a consumer\n * that takes a single value leaves before the stream completes, so the next\n * hit refetches instead of replaying.\n *\n * Caching the value settles it. A hit is `of(value)`, which needs nothing\n * kept alive; a miss is an ordinary cancellable request.\n */\n getRepositories(\n gitProviderUserNames?: GitProviderConfig\n ): Observable<GitRepositories> {\n const cacheKey = this.createCacheKey(gitProviderUserNames);\n const cachedEntry = this.repositoryCache.get(cacheKey);\n\n if (cachedEntry && this.isCacheValid(cachedEntry)) {\n return this.withLoadingState(of(cachedEntry.data));\n }\n\n // An identical request already on the wire: share that one rather than\n // opening a second. This stream is only ever the in-flight request, so it\n // is dropped as soon as it settles and never becomes a stale cache.\n const inFlight = this.inFlightRequests.get(cacheKey);\n if (inFlight) {\n return this.withLoadingState(inFlight.request);\n }\n\n // Clean up expired entries and manage cache size\n this.cleanupCache();\n\n // This request's claim on the key. Every write below is guarded by it, so\n // a request that has been superseded or cleared touches nothing.\n const token = Symbol(cacheKey);\n const owns = () => this.inFlightRequests.get(cacheKey)?.token === token;\n const release = () => {\n if (owns()) this.inFlightRequests.delete(cacheKey);\n };\n\n const request$ = this.fetchRepositories(gitProviderUserNames).pipe(\n tap((repositories: GitRepositories) => {\n // Only the owner may fill the cache: otherwise a response already on\n // the wire when clearCache() ran would put back what was just dropped.\n if (!owns()) return;\n this.repositoryCache.set(cacheKey, {\n data: repositories,\n timestamp: Date.now(),\n ttl: this.CACHE_TTL\n });\n // Released as the value lands, not in finalize: a subscriber that\n // calls back into getRepositories from its own next handler must see\n // the settled cache, not a request that is technically still open.\n release();\n }),\n catchError((error: unknown) => {\n if (owns()) {\n this.evictCacheEntry(cacheKey);\n release();\n }\n return throwError(() => error);\n }),\n // Covers the paths the two handlers above do not: an unsubscribe before\n // the response, which would otherwise strand the entry forever.\n finalize(release),\n share()\n );\n\n this.inFlightRequests.set(cacheKey, { token, request: request$ });\n\n return this.withLoadingState(request$);\n }\n\n /**\n * The shared-state writes, wrapped around the stream rather than baked into\n * it, so they belong to one subscription and die with it. An abandoned load\n * therefore stops touching `loading`, while a cache hit still reports the\n * state its own subscriber expects.\n *\n * Loading ends on both paths, otherwise the spinner outlives the request.\n */\n private withLoadingState(\n repositories$: Observable<GitRepositories>\n ): Observable<GitRepositories> {\n // defer so the generation is read per subscription, at the moment this\n // load actually starts, rather than once when the observable is built.\n return defer(() => {\n const generation = this.stateGeneration;\n const current = () => generation === this.stateGeneration;\n\n return repositories$.pipe(\n tap((repositories: GitRepositories) => {\n // A load invalidated by clearCache() must not report itself done:\n // its replacement may still be in flight, and clearing the spinner\n // on its behalf would show an empty portfolio as a finished one.\n if (!current()) return;\n this.repositorySubject.next(repositories);\n this.loadingStateSubject.next(false);\n }),\n catchError((error: unknown) => {\n if (current()) this.loadingStateSubject.next(false);\n return throwError(() => error);\n })\n );\n });\n }\n\n private createCacheKey(config?: GitProviderConfig): string {\n if (!config) return 'default';\n const parts: string[] = [];\n if (config.github) parts.push(`gh:${config.github}`);\n if (config.gitlab) parts.push(`gl:${config.gitlab}`);\n return parts.join('|') || 'default';\n }\n\n private isCacheValid(entry: CacheEntry): boolean {\n return Date.now() - entry.timestamp < entry.ttl;\n }\n\n private cleanupCache(): void {\n // Remove expired entries\n for (const [key, entry] of this.repositoryCache.entries()) {\n if (!this.isCacheValid(entry)) {\n this.repositoryCache.delete(key);\n }\n }\n\n // If cache is still too large, remove oldest entries\n if (this.repositoryCache.size >= this.MAX_CACHE_SIZE) {\n const entries = Array.from(this.repositoryCache.entries()).sort(\n ([, a], [, b]) => a.timestamp - b.timestamp\n );\n\n const toRemove = entries.slice(\n 0,\n entries.length - this.MAX_CACHE_SIZE + 1\n );\n toRemove.forEach(([key]) => this.repositoryCache.delete(key));\n }\n }\n\n fetchRepositories(\n gitProviderUserNames?: GitProviderConfig\n ): Observable<GitRepositories> {\n return zip(\n this.fetchGithubRepositories(gitProviderUserNames?.github ?? ''),\n this.fetchGitlabRepositories(gitProviderUserNames?.gitlab ?? '')\n ).pipe(\n map((gitRepositoryMap: GitRepository[][]) => {\n const repositories: GitRepositories = {\n github: this.filterAndSortGitRepositories(gitRepositoryMap[0]),\n gitlab: this.filterAndSortGitRepositories(gitRepositoryMap[1])\n };\n return repositories;\n })\n );\n }\n\n private filterAndSortGitRepositories(gitRepositoryArray: GitRepository[]): {\n own: GitRepository[];\n forked: GitRepository[];\n } {\n return {\n own: gitRepositoryArray\n .filter((gitRepository: GitRepository) => !gitRepository.fork)\n .sort(\n (repoA: GitRepository, repoB: GitRepository) =>\n (repoB.stargazers_count ?? 0) - (repoA.stargazers_count ?? 0)\n ),\n forked: gitRepositoryArray\n .filter((gitRepository: GitRepository) => gitRepository.fork)\n .sort(\n (repoA: GitRepository, repoB: GitRepository) =>\n (repoB.stargazers_count ?? 0) - (repoA.stargazers_count ?? 0)\n )\n };\n }\n\n /**\n * Every page must arrive before the result counts. A page that fails midway\n * would otherwise reduce to whatever was collected so far, and since the\n * providers sort by name rather than by fork flag, a truncated list renders\n * as a real but incomplete portfolio — \"no forked repositories\" instead of an\n * error. Failing the whole fetch keeps a partial answer from posing as a\n * complete one.\n *\n * Deliberately not shared. Each call feeds exactly one zip() in\n * fetchRepositories, so shareReplay bought no sharing here — but because it\n * is not ref-counted it held the subscription open, and unsubscribing\n * upstream then never tore the chain down. A caller that abandons a load\n * (the component's switchMap, on a config change) would keep this paging\n * through every remaining page against a rate-limited API. The result is\n * shared once, at the level that caches it: getRepositories.\n */\n private fetchAllPages<T>(firstUrl: string): Observable<T[]> {\n return this.http.get<T[]>(firstUrl, { observe: 'response' }).pipe(\n expand((response) => {\n const next = this.parseLinkHeader(response.headers.get('Link'));\n return next\n ? this.http.get<T[]>(next, { observe: 'response' })\n : of(null);\n }),\n takeWhile((response): response is HttpResponse<T[]> => response !== null),\n reduce((acc: T[], response) => acc.concat(response.body ?? []), [])\n );\n }\n\n private parseLinkHeader(header: string | null): string | null {\n if (!header) return null;\n const match = header.match(/<([^>]+)>;\\s*rel=\"next\"/);\n return match ? match[1] : null;\n }\n\n private fetchGithubRepositories(\n githubUser: string\n ): Observable<GitRepository[]> {\n if (githubUser !== '') {\n return this.fetchAllPages<GitRepository>(\n `https://api.github.com/users/${githubUser}/repos?per_page=100`\n );\n }\n return of([]);\n }\n\n private fetchGitlabRepositories(\n gitlabUser: string\n ): Observable<GitRepository[]> {\n if (gitlabUser !== '') {\n return this.fetchAllPages<GitRepository>(\n `https://gitlab.com/api/v4/users/${gitlabUser}/projects?per_page=100`\n );\n }\n return of([]);\n }\n\n clearCache(): void {\n // Invalidates both halves: the cache ownership above, and the shared\n // state, so a request already on the wire can neither refill the cache\n // nor report itself finished once its result is no longer wanted.\n this.stateGeneration++;\n this.repositoryCache.clear();\n // Otherwise a request already on the wire would still populate the cache\n // it was just asked to forget.\n this.inFlightRequests.clear();\n this.loadingStateSubject.next(true);\n this.repositorySubject.next({});\n }\n}\n","import {\n Directive,\n ElementRef,\n input,\n OnInit,\n Renderer2,\n inject\n} from '@angular/core';\n\n// A navigation cancels pending fetches. Firefox rejects them after\n// `beforeunload` and before `pagehide`, so the page counts as leaving from\n// `beforeunload` until `pageshow` (a page restored from the back/forward\n// cache is live again).\nlet leaving = false;\nif (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', () => {\n leaving = true;\n });\n window.addEventListener('pageshow', () => {\n leaving = false;\n });\n}\n\nfunction isCancelledByNavigation(err: unknown): boolean {\n // The directive never aborts a fetch itself, so an AbortError comes from\n // outside. A fetch TypeError (network error) looks the same for a\n // navigation and a real failure, so it is told apart by the page state.\n if ((err as { name?: string } | null)?.name === 'AbortError') return true;\n return err instanceof TypeError && leaving;\n}\n\nconst svgCache = new Map<string, Promise<string>>();\n\nconst KNOWN_ICONS = new Set([\n 'check',\n 'issue-opened',\n 'paste',\n 'repo-forked',\n 'star',\n 'alert'\n]);\n\nfunction fetchSvg(name: string): Promise<string> {\n const icon = KNOWN_ICONS.has(name) ? name : 'alert';\n if (!svgCache.has(icon)) {\n const promise = fetch(`/assets/icons/octicons/${icon}.svg`).then((r) => {\n if (!r.ok)\n throw new Error(`Failed to load octicon \"${icon}\": ${r.status}`);\n return r.text();\n });\n promise.catch(() => svgCache.delete(icon));\n svgCache.set(icon, promise);\n }\n return svgCache.get(icon)!;\n}\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[octicon]',\n standalone: true\n})\nexport class OcticonDirective implements OnInit {\n private elementRef = inject(ElementRef);\n private renderer = inject(Renderer2);\n\n octicon = input.required<string>();\n color = input.required<string>();\n width = input<string>();\n\n ngOnInit(): void {\n fetchSvg(this.octicon())\n .then((svgText) => {\n const el: HTMLElement = this.elementRef.nativeElement;\n const icon = this.insertSvgSafely(el, svgText);\n if (this.color() && icon) {\n this.renderer.setStyle(icon, 'fill', this.color());\n }\n if (this.width() && icon) {\n this.renderer.setStyle(icon, 'width', this.width());\n this.renderer.setStyle(icon, 'height', this.width());\n }\n })\n .catch((err) => {\n if (isCancelledByNavigation(err)) return;\n console.error(err);\n });\n }\n\n private insertSvgSafely(\n element: HTMLElement,\n svgString: string\n ): Element | null {\n const range = document.createRange();\n range.selectNode(element);\n const fragment = range.createContextualFragment(svgString);\n while (element.firstChild) {\n this.renderer.removeChild(element, element.firstChild);\n }\n const svgElement = fragment.querySelector('svg');\n if (svgElement) {\n this.renderer.appendChild(element, svgElement);\n }\n return svgElement;\n }\n}\n","import { ClipboardModule } from '@angular/cdk/clipboard';\nimport { DatePipe, NgStyle } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCardModule } from '@angular/material/card';\nimport * as githubLanguageColors from 'github-language-colors/colors.json';\n\nimport { OcticonDirective } from '../octicon.directive';\nimport { GitRepository } from '../types/git-repository-type';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\ninterface Dictionary {\n [id: string]: string;\n}\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'repo-card',\n templateUrl: './repo-card.component.html',\n styleUrls: ['./repo-card.component.scss'],\n imports: [\n MatCardModule,\n NgStyle,\n MatButtonModule,\n OcticonDirective,\n ClipboardModule,\n DatePipe\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RepoCardComponent {\n buttonStyle = input.required<any>();\n cardStyle = input.required<any>();\n textStyle = input.required<any>();\n checkColor = input.required<string>();\n forkColor = input.required<string>();\n issueColor = input.required<string>();\n pasteColor = input.required<string>();\n starColor = input.required<string>();\n\n gitRepo = input.required<GitRepository>();\n\n isCopied = input(false);\n\n labels = input({\n copyRepoUrl: 'Copy repo URL',\n created: 'Created: ',\n updated: 'Updated: '\n });\n\n copiedToClipboard = output<boolean>();\n\n githubLanguageColors = githubLanguageColors as Dictionary;\n\n repoUrl = computed(() => {\n const url =\n this.gitRepo().homepage ||\n this.gitRepo().html_url ||\n this.gitRepo().web_url ||\n '';\n\n try {\n const parsed = new URL(url);\n return parsed.protocol === 'http:' || parsed.protocol === 'https:'\n ? url\n : null;\n } catch {\n return null;\n }\n });\n}\n","<mat-card [ngStyle]=\"cardStyle()\">\n <mat-card-header>\n <div\n mat-card-avatar\n [ngStyle]=\"{\n 'background-image':\n 'url(' +\n (gitRepo().owner?.avatar_url || gitRepo().namespace?.avatar_url) +\n ')',\n 'background-size': 'cover',\n 'border-radius': 0\n }\"\n ></div>\n <mat-card-title\n ><a\n mat-button\n [ngStyle]=\"buttonStyle()\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"repoUrl()\"\n >\n {{ gitRepo().name }}\n </a>\n </mat-card-title>\n <mat-card-subtitle class=\"flex-row\">\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n [ngStyle]=\"{\n 'background-color':\n gitRepo().language !== undefined\n ? githubLanguageColors[gitRepo().language!]\n : 'transparent'\n }\"\n class=\"language-icon flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().language }}</div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div octicon=\"star\" [color]=\"starColor()\" class=\"flex-gap-5\"></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().stargazers_count || gitRepo().star_count || 0 }}\n </div>\n </div>\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"repo-forked\"\n [color]=\"forkColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">{{ gitRepo().forks_count }}</div>\n </div>\n @if (gitRepo().open_issues_count) {\n <div class=\"info-item flex-row flex-gap-12\">\n <div\n octicon=\"issue-opened\"\n [color]=\"issueColor()\"\n class=\"flex-gap-5\"\n ></div>\n <div [ngStyle]=\"textStyle()\">\n {{ gitRepo().open_issues_count }}\n </div>\n </div>\n }\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content>\n <p>{{ gitRepo().description }}</p>\n </mat-card-content>\n <mat-card-footer class=\"flex-row\">\n <span class=\"mat-footer-cell flex-fxflex flex-gap-12\">\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\"\n >{{ labels().created }}{{ gitRepo().created_at | date }}</span\n >\n <span class=\"footer-span\" [ngStyle]=\"textStyle()\"\n >{{ labels().updated\n }}{{ gitRepo().pushed_at || gitRepo().last_activity_at | date }}</span\n >\n </span>\n <span class=\"mat-footer-cell\">\n <button\n [ngStyle]=\"buttonStyle()\"\n mat-button\n [cdkCopyToClipboard]=\"\n gitRepo().clone_url || gitRepo().http_url_to_repo || ''\n \"\n (cdkCopyToClipboardCopied)=\"copiedToClipboard.emit(true)\"\n class=\"clipboard-button\"\n >\n <span class=\"mat-button-wrapper flex-row\">\n @if (isCopied()) {\n <div\n octicon=\"check\"\n [color]=\"checkColor()\"\n width=\"24\"\n class=\"flex-gap-5\"\n ></div>\n }\n <div\n octicon=\"paste\"\n [color]=\"pasteColor()\"\n width=\"24px\"\n class=\"flex-gap-5\"\n ></div>\n <span>{{ labels().copyRepoUrl }}</span>\n </span>\n </button>\n </span>\n </mat-card-footer>\n</mat-card>\n","export enum GitProviders {\n github = 'GitHub',\n gitlab = 'GitLab'\n}\n","import {\n BreakpointObserver,\n BreakpointState,\n LayoutModule\n} from '@angular/cdk/layout';\nimport { CommonModule, KeyValuePipe, NgStyle } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n input,\n inject,\n signal,\n effect,\n computed,\n untracked,\n OnDestroy\n} from '@angular/core';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { catchError, switchMap, takeUntil, tap } from 'rxjs/operators';\nimport { Subject, of } from 'rxjs';\n\nimport { GitProviderService } from './git-provider.service';\nimport { RepoCardComponent } from './repo-card/repo-card.component';\nimport { GitProviderConfig } from './types/git-provider-config-type';\nimport { GitProviders } from './types/git-providers-type';\nimport { GitRepositories } from './types/git-repositories-type';\nimport { GitRepository } from './types/git-repository-type';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'git-portfolio',\n templateUrl: './git-portfolio.component.html',\n styleUrls: ['./git-portfolio.component.scss'],\n imports: [\n CommonModule,\n LayoutModule,\n NgStyle,\n MatProgressSpinnerModule,\n MatTabsModule,\n RepoCardComponent,\n KeyValuePipe\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class GitPortfolioComponent implements OnDestroy {\n private gitProviderService = inject(GitProviderService);\n private breakpointObserver = inject(BreakpointObserver);\n\n buttonStyle = input({\n 'background-color': 'var(--tw-neutral-650, #424242)',\n color: 'var(--tw-accent, #cc7832)'\n });\n\n cardStyle = input({\n color: 'var(--tw-text, #6699bb)',\n 'background-color': 'var(--tw-glass-bg, rgba(34, 34, 34, 0.75))',\n 'backdrop-filter': 'var(--tw-glass-blur, blur(50px))'\n });\n\n textStyle = input({ color: 'var(--tw-text, #6699bb)' });\n\n checkColor = input('var(--tw-success, #38e038)');\n\n forkColor = input('var(--tw-text, #6699bb)');\n\n issueColor = input('var(--tw-success, #38e038)');\n\n pasteColor = input('var(--tw-accent, #cc7832)');\n\n starColor = input('gold');\n\n gitProviderConfig = input<GitProviderConfig>({});\n\n showForked = input(true);\n\n showOwn = input(true);\n\n labels = input({\n ownRepos: 'Own Repos',\n forkedRepos: 'Forked Repos',\n noOwnRepos: 'This user has not created any repositories yet',\n noForkedRepos: 'This user has not forked any repositories yet',\n copyRepoUrl: 'Copy repo URL',\n created: 'Created: ',\n updated: 'Updated: ',\n loadError: 'Repositories could not be loaded',\n retry: 'Try again',\n retrying: 'Retrying...'\n });\n\n repoCardLabels = computed(() => ({\n copyRepoUrl: this.labels().copyRepoUrl,\n created: this.labels().created,\n updated: this.labels().updated\n }));\n\n loading = toSignal(this.gitProviderService.loading, { initialValue: true });\n gitProviders = GitProviders;\n currentRepo = signal<GitRepository | undefined>(undefined);\n gitRepositories = signal<GitRepositories | undefined>(undefined);\n viewport = signal('');\n loadFailed = signal(false);\n retrying = signal(false);\n coolingDown = signal(false);\n retryDisabled = computed(() => this.retrying() || this.coolingDown());\n\n private readonly RETRY_COOLDOWN_MS = 3000;\n private lastRetryAt = 0;\n private cooldownTimer?: ReturnType<typeof setTimeout>;\n\n private unsubscribe$ = new Subject<void>();\n\n /**\n * Every load goes through here, so switchMap can drop the previous one. The\n * config is a reactive input: a change starts a new request while an earlier\n * one may still be in flight, and the provider APIs are slow enough for that\n * to happen in practice. Without the cancel, a stale response arriving second\n * would overwrite the current user's repositories, or fail a request the user\n * has already moved on from and show the error state over good data.\n */\n private load$ = new Subject<GitProviderConfig>();\n\n constructor() {\n this.load$\n .pipe(\n switchMap((config) =>\n this.gitProviderService.getRepositories(config).pipe(\n // Keeps a failed request from completing the outer subscription,\n // which would leave later retries with nothing listening.\n catchError(() => of(null))\n )\n ),\n takeUntil(this.unsubscribe$)\n )\n .subscribe((repositories) => {\n this.gitRepositories.set(repositories ?? undefined);\n this.loadFailed.set(repositories === null);\n this.retrying.set(false);\n });\n\n effect(() => {\n // Reads the config so a changed user refetches; the retry signals are set\n // inside getRepositories() and must not retrigger this effect.\n this.gitProviderConfig();\n untracked(() => this.getRepositories());\n });\n\n this.breakpointObserver\n .observe([\n '(max-width: 599.98px)',\n '(max-width: 959.98px)',\n '(min-width: 960px)'\n ])\n .pipe(\n tap((breakpointState: BreakpointState) => {\n if (breakpointState.breakpoints['(max-width: 599.98px)']) {\n this.viewport.set('xsmall');\n } else if (breakpointState.breakpoints['(max-width: 959.98px)']) {\n this.viewport.set('small');\n } else {\n this.viewport.set('medium');\n }\n }),\n takeUntil(this.unsubscribe$)\n )\n .subscribe();\n }\n\n ngOnDestroy(): void {\n clearTimeout(this.cooldownTimer);\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n copyToClipboard(gitRepo: GitRepository): void {\n this.currentRepo.set(gitRepo);\n }\n\n isCopiedToClipboard(gitRepo: GitRepository): boolean {\n if (!this.currentRepo()) {\n return false;\n }\n return this.currentRepo()?.id === gitRepo.id ? true : false;\n }\n\n getRepositories(): void {\n this.load$.next(this.gitProviderConfig());\n }\n\n /**\n * Rate limits the retry button. `retrying` alone is not enough: a failing\n * request (offline, aborted) rejects almost immediately, so the in-flight flag\n * is already back to false by the time the next click lands and a user could\n * hammer the provider APIs, which are rate limited per IP. The cooldown makes\n * the gap between two attempts the binding constraint.\n */\n retryLoad(): void {\n const now = Date.now();\n if (this.retrying() || now - this.lastRetryAt < this.RETRY_COOLDOWN_MS) {\n return;\n }\n this.lastRetryAt = now;\n this.retrying.set(true);\n this.loadFailed.set(false);\n this.startCooldown();\n this.getRepositories();\n }\n\n private startCooldown(): void {\n this.coolingDown.set(true);\n clearTimeout(this.cooldownTimer);\n this.cooldownTimer = setTimeout(\n () => this.coolingDown.set(false),\n this.RETRY_COOLDOWN_MS\n );\n }\n\n getGitRepositoriesOfType(\n gitRepositories: GitRepositories | undefined,\n gitProvider: string,\n type: 'own' | 'forked'\n ): GitRepository[] {\n return gitRepositories?.[gitProvider]?.[type] ?? [];\n }\n\n hasAnyRepositories(\n gitRepositories: GitRepositories | undefined,\n gitProvider: string\n ): boolean {\n return (\n (gitRepositories?.[gitProvider] &&\n (gitRepositories[gitProvider].own?.length > 0 ||\n gitRepositories[gitProvider].forked?.length > 0)) ??\n false\n );\n }\n\n /**\n * Appends the repository count to a tab label, so both the existence and the\n * size of each group are visible without opening the tab.\n */\n tabLabel(\n label: string,\n gitRepositories: GitRepositories | undefined,\n gitProvider: string,\n type: 'own' | 'forked'\n ): string {\n const count = this.getGitRepositoriesOfType(\n gitRepositories,\n gitProvider,\n type\n ).length;\n return `${label} (${count})`;\n }\n\n hasRepositoriesOfType(\n gitRepositories: GitRepositories | undefined,\n gitProvider: string,\n type: 'own' | 'forked'\n ): boolean {\n return (\n (gitRepositories?.[gitProvider] &&\n gitRepositories[gitProvider]?.[type]?.length > 0) ??\n false\n );\n }\n}\n","@if (loadFailed()) {\n <div class=\"load-error\" role=\"alert\">\n <p [ngStyle]=\"textStyle()\">{{ labels().loadError }}</p>\n <button\n type=\"button\"\n class=\"retry-button\"\n [ngStyle]=\"buttonStyle()\"\n [disabled]=\"retryDisabled()\"\n (click)=\"retryLoad()\"\n >\n {{ retrying() ? labels().retrying : labels().retry }}\n </button>\n </div>\n}\n@if (retrying()) {\n <div class=\"retry-spinner\">\n <mat-spinner></mat-spinner>\n </div>\n}\n@if (gitRepositories(); as gitRepositories) {\n <div>\n @for (gitProvider of gitProviders | keyvalue; track gitProvider) {\n @if (hasAnyRepositories(gitRepositories, gitProvider.key)) {\n <div>\n <h1 [ngStyle]=\"textStyle()\" class=\"mat-headline\">\n {{ gitProvider.value }}\n </h1>\n <mat-tab-group class=\"repository-tabs\" [ngStyle]=\"textStyle()\">\n @if (showOwn()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().ownRepos,\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n >\n </repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'own'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noOwnRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n @if (showForked()) {\n <mat-tab\n [label]=\"\n tabLabel(\n labels().forkedRepos,\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n \"\n >\n <ng-template matTabContent>\n <div\n class=\"flex-align-start tab-content\"\n [ngClass]=\"{\n 'flex-row-wrap':\n viewport() === 'medium' || viewport() === 'small',\n 'flex-column': viewport() === 'xsmall'\n }\"\n >\n @if (loading() === true) {\n <div>\n <mat-spinner></mat-spinner>\n </div>\n }\n @for (\n gitRepo of getGitRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n );\n track gitRepo\n ) {\n <repo-card\n [buttonStyle]=\"buttonStyle()\"\n [cardStyle]=\"cardStyle()\"\n [textStyle]=\"textStyle()\"\n [checkColor]=\"checkColor()\"\n [forkColor]=\"forkColor()\"\n [issueColor]=\"issueColor()\"\n [pasteColor]=\"pasteColor()\"\n [starColor]=\"starColor()\"\n [gitRepo]=\"gitRepo\"\n [isCopied]=\"isCopiedToClipboard(gitRepo)\"\n [labels]=\"repoCardLabels()\"\n (copiedToClipboard)=\"copyToClipboard(gitRepo)\"\n class=\"repository-card flex-align-stretch\"\n [ngClass]=\"{\n 'flex-fxflex': viewport() === 'medium',\n 'flex-fxflex-lt-md': viewport() === 'small',\n 'flex-fxflex-lt-sm': viewport() === 'xsmall'\n }\"\n ></repo-card>\n }\n @if (\n loading() === false &&\n !hasRepositoriesOfType(\n gitRepositories,\n gitProvider.key,\n 'forked'\n )\n ) {\n <div [ngStyle]=\"textStyle()\">\n {{ labels().noForkedRepos }}\n </div>\n }\n </div>\n </ng-template>\n </mat-tab>\n }\n </mat-tab-group>\n </div>\n }\n }\n </div>\n}\n","export class GitRepository {\n id: number | undefined;\n clone_url?: string;\n http_url_to_repo?: string;\n created_at: string | undefined;\n description: string | undefined;\n fork?: boolean;\n forks_count: number | undefined;\n homepage?: string;\n html_url?: string;\n web_url?: string;\n language?: string;\n license?: {\n key: string;\n name: string;\n node_id: string;\n spdx_id: string;\n url: string;\n };\n name: string | undefined;\n open_issues_count?: number;\n owner?: {\n avatar_url: string;\n };\n namespace?: {\n avatar_url: string;\n };\n pushed_at?: string;\n last_activity_at?: string;\n stargazers_count?: number;\n star_count?: number;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAkCa,kBAAkB,CAAA;AAH/B,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;QAChB,IAAA,CAAA,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3B,IAAA,CAAA,cAAc,GAAG,EAAE;AAE5B,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AACxD,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,eAAe,CAAkB,EAAE,CAAC;AAC5D,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,GAAG,EAAsB;AAEvD;;;;;;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AAA,mBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,qBAAA,EAAA,aAAA,EAAA,eAAA,EAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACb,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,WAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,YAAA,EAAA,YAAA,EAAA,WAAA,EAAA,SAAA,EAAA,UAAA,EAAA,QAAA,CAAA,EAAA,OAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAF,IAAA,CAAA,YAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKR,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAhBjC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAGhB;wBACP,YAAY;wBACZ,YAAY;wBACZ,OAAO;wBACP,wBAAwB;wBACxB,aAAa;wBACb,iBAAiB;wBACjB;qBACD,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,6iNAAA,EAAA,MAAA,EAAA,CAAA,01DAAA,CAAA,EAAA;;;ME5CpC,aAAa,CAAA;AA+BzB;;AC/BD;;AAEG;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tehw0lf/git-portfolio",
3
- "version": "22.1.2",
3
+ "version": "22.1.3",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/tehw0lf/tehwol.fi.git",
6
6
  "repository": {
@@ -8,10 +8,10 @@
8
8
  "url": "git+https://github.com/tehw0lf/tehwol.fi.git"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/cdk": "22.1.6",
12
- "@angular/common": "22.1.5",
13
- "@angular/core": "22.1.5",
14
- "@angular/material": "22.1.6",
11
+ "@angular/cdk": "22.2.1",
12
+ "@angular/common": "22.2.1",
13
+ "@angular/core": "22.2.1",
14
+ "@angular/material": "22.2.1",
15
15
  "@tehw0lf/mvc": "0.0.11",
16
16
  "github-language-colors": "1.0.0",
17
17
  "rxjs": "7.8.2"
@@ -112,6 +112,15 @@ declare class GitPortfolioComponent implements OnDestroy {
112
112
  private lastRetryAt;
113
113
  private cooldownTimer?;
114
114
  private unsubscribe$;
115
+ /**
116
+ * Every load goes through here, so switchMap can drop the previous one. The
117
+ * config is a reactive input: a change starts a new request while an earlier
118
+ * one may still be in flight, and the provider APIs are slow enough for that
119
+ * to happen in practice. Without the cancel, a stale response arriving second
120
+ * would overwrite the current user's repositories, or fail a request the user
121
+ * has already moved on from and show the error state over good data.
122
+ */
123
+ private load$;
115
124
  constructor();
116
125
  ngOnDestroy(): void;
117
126
  copyToClipboard(gitRepo: GitRepository): void;
@@ -145,14 +154,55 @@ declare class GitProviderService {
145
154
  private loadingStateSubject;
146
155
  private repositorySubject;
147
156
  private repositoryCache;
157
+ /**
158
+ * Keyed by cache key, but each entry carries its own token. A settling
159
+ * request may only write the cache or clean up while it still *owns* the
160
+ * entry — clearCache() drops ownership, and a newer request for the same key
161
+ * takes it over. Without that, a response already on the wire would
162
+ * repopulate the cache it was just told to forget, and a late straggler
163
+ * would delete the tracking entry belonging to the request that replaced it.
164
+ */
165
+ private inFlightRequests;
166
+ /**
167
+ * Bumped by clearCache(). The shared state needs its own generation rather
168
+ * than the ownership token above, because a request releases that token as
169
+ * its value lands — before withLoadingState() sees the same value — so by
170
+ * then ownership can no longer tell a current load from an invalidated one.
171
+ */
172
+ private stateGeneration;
148
173
  get loading(): Observable<boolean>;
149
174
  /**
150
- * A failed fetch must not settle in the cache: shareReplay(1) would replay the
151
- * error to every later subscriber for the full TTL, so a single dropped
152
- * connection would keep the portfolio broken long after the network returned.
175
+ * A failed fetch must not settle in the cache, so a single dropped
176
+ * connection cannot keep the portfolio broken long after the network
177
+ * returned. Only a successful response is stored.
153
178
  */
154
179
  private evictCacheEntry;
180
+ /**
181
+ * The cache holds the settled response, not the observable that produced it.
182
+ *
183
+ * It used to hold the in-flight stream, kept alive by a non-ref-counted
184
+ * shareReplay(1), and that is irreconcilable with cancelling an abandoned
185
+ * load: the operator must outlive its subscribers for a later hit to replay,
186
+ * which is exactly what stops it from dying when the caller walks away. A
187
+ * superseded load therefore kept paging against a rate-limited API and still
188
+ * ran its side effects, clearing the spinner out from under the load that
189
+ * replaced it. refCount only trades the bug for a worse one — a consumer
190
+ * that takes a single value leaves before the stream completes, so the next
191
+ * hit refetches instead of replaying.
192
+ *
193
+ * Caching the value settles it. A hit is `of(value)`, which needs nothing
194
+ * kept alive; a miss is an ordinary cancellable request.
195
+ */
155
196
  getRepositories(gitProviderUserNames?: GitProviderConfig): Observable<GitRepositories>;
197
+ /**
198
+ * The shared-state writes, wrapped around the stream rather than baked into
199
+ * it, so they belong to one subscription and die with it. An abandoned load
200
+ * therefore stops touching `loading`, while a cache hit still reports the
201
+ * state its own subscriber expects.
202
+ *
203
+ * Loading ends on both paths, otherwise the spinner outlives the request.
204
+ */
205
+ private withLoadingState;
156
206
  private createCacheKey;
157
207
  private isCacheValid;
158
208
  private cleanupCache;
@@ -165,6 +215,14 @@ declare class GitProviderService {
165
215
  * as a real but incomplete portfolio — "no forked repositories" instead of an
166
216
  * error. Failing the whole fetch keeps a partial answer from posing as a
167
217
  * complete one.
218
+ *
219
+ * Deliberately not shared. Each call feeds exactly one zip() in
220
+ * fetchRepositories, so shareReplay bought no sharing here — but because it
221
+ * is not ref-counted it held the subscription open, and unsubscribing
222
+ * upstream then never tore the chain down. A caller that abandons a load
223
+ * (the component's switchMap, on a config change) would keep this paging
224
+ * through every remaining page against a rate-limited API. The result is
225
+ * shared once, at the level that caches it: getRepositories.
168
226
  */
169
227
  private fetchAllPages;
170
228
  private parseLinkHeader;
@@ -172,7 +230,7 @@ declare class GitProviderService {
172
230
  private fetchGitlabRepositories;
173
231
  clearCache(): void;
174
232
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GitProviderService, never>;
175
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<GitProviderService>;
233
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
176
234
  }
177
235
 
178
236
  declare class OcticonDirective implements OnInit {