@burdenoff/microfe-support 2026.819.4 → 2026.824.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/global-operations.d.ts +48 -0
- package/dist/generated/global-operations.js +134 -116
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +51 -0
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +25 -25
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.d.ts +9 -0
- package/dist/support/components/careers/BulkCandidateDialogs.js +287 -171
- package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
- package/dist/support/components/careers/BulkOperationFeedback.d.ts +4 -1
- package/dist/support/components/careers/BulkOperationFeedback.js +75 -1
- package/dist/support/components/careers/BulkOperationFeedback.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +217 -176
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/utils/bulkCandidateOperations.d.ts +19 -0
- package/dist/support/utils/bulkCandidateOperations.js +15 -1
- package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
- package/package.json +1 -1
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -56
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -54
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -54
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -46
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -12
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +0 -1
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js +0 -12
- package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulkCandidateOperations.js","names":[],"sources":["../../../src/support/utils/bulkCandidateOperations.ts"],"sourcesContent":["export const BULK_CANDIDATE_REQUEST_LIMIT = 100;\n\nexport interface CandidateRoundPreview {\n id: string;\n roundConfigId: string | null;\n name: string;\n roundType: string;\n emailLogs: ReadonlyArray<{\n emailType: string;\n }>;\n}\n\nexport interface BulkCandidateTarget {\n id: string;\n jobPostingId: string | null;\n interviewRounds: ReadonlyArray<CandidateRoundPreview>;\n}\n\nexport interface CandidateTargetPage<TTarget extends { id: string }> {\n items: ReadonlyArray<TTarget>;\n total: number;\n hasMore: boolean;\n}\n\nexport type CandidateMaterializationErrorCode =\n | 'STALE_SCOPE'\n | 'TOTAL_DRIFT'\n | 'EMPTY_PAGE_WITH_MORE'\n | 'INVALID_PAGE_LENGTH'\n | 'UNIQUE_COUNT_MISMATCH'\n | 'MEMBERSHIP_DRIFT';\n\nexport class CandidateMaterializationError extends Error {\n constructor(\n public readonly code: CandidateMaterializationErrorCode,\n message: string\n ) {\n super(message);\n this.name = 'CandidateMaterializationError';\n }\n}\n\ninterface MaterializeCandidateTargetsOptions<TTarget extends { id: string }> {\n scopeKey: string;\n expectedTotal: number;\n fetchPage: (limit: number, offset: number) => Promise<CandidateTargetPage<TTarget>>;\n getCurrentScopeKey: () => string;\n pageSize?: number;\n}\n\nfunction assertCurrentScope(scopeKey: string, currentScopeKey: string): void {\n if (scopeKey !== currentScopeKey) {\n throw new CandidateMaterializationError(\n 'STALE_SCOPE',\n 'The application filters changed while candidates were loading.'\n );\n }\n}\n\nasync function materializeCandidateTargetPass<TTarget extends { id: string }>({\n scopeKey,\n expectedTotal,\n fetchPage,\n getCurrentScopeKey,\n pageSize,\n}: Required<MaterializeCandidateTargetsOptions<TTarget>>): Promise<TTarget[]> {\n const targetsById = new Map<string, TTarget>();\n let offset = 0;\n\n while (true) {\n assertCurrentScope(scopeKey, getCurrentScopeKey());\n const page = await fetchPage(pageSize, offset);\n assertCurrentScope(scopeKey, getCurrentScopeKey());\n\n if (page.total !== expectedTotal) {\n throw new CandidateMaterializationError(\n 'TOTAL_DRIFT',\n `The matching application total changed from ${expectedTotal} to ${page.total}. Refresh and select again.`\n );\n }\n\n const rawPageLength = page.items.length;\n if (rawPageLength > pageSize) {\n throw new CandidateMaterializationError(\n 'INVALID_PAGE_LENGTH',\n `The server returned ${rawPageLength} applications for a page limited to ${pageSize}.`\n );\n }\n if (page.hasMore && rawPageLength === 0) {\n throw new CandidateMaterializationError(\n 'EMPTY_PAGE_WITH_MORE',\n 'The server reported more applications but returned an empty page.'\n );\n }\n\n for (const target of page.items) {\n if (!targetsById.has(target.id)) {\n targetsById.set(target.id, target);\n }\n }\n\n offset += rawPageLength;\n\n if (!page.hasMore) {\n if (targetsById.size !== expectedTotal) {\n throw new CandidateMaterializationError(\n 'UNIQUE_COUNT_MISMATCH',\n `Expected ${expectedTotal} unique applications but loaded ${targetsById.size}. Refresh and select again.`\n );\n }\n return [...targetsById.values()];\n }\n\n if (offset >= expectedTotal) {\n throw new CandidateMaterializationError(\n 'TOTAL_DRIFT',\n 'The server reported more applications after the frozen total had already been loaded.'\n );\n }\n }\n}\n\n/**\n * Materializes a frozen application-filter scope without trusting cached pages.\n * Two independent passes must return the same ordered target snapshots. This\n * catches offset-page membership shifts while preserving the 100-item page cap.\n */\nexport async function materializeCandidateTargets<TTarget extends { id: string }>({\n scopeKey,\n expectedTotal,\n fetchPage,\n getCurrentScopeKey,\n pageSize = BULK_CANDIDATE_REQUEST_LIMIT,\n}: MaterializeCandidateTargetsOptions<TTarget>): Promise<TTarget[]> {\n if (!Number.isInteger(expectedTotal) || expectedTotal < 0) {\n throw new CandidateMaterializationError(\n 'TOTAL_DRIFT',\n 'The application total is invalid. Refresh the list and try again.'\n );\n }\n if (!Number.isInteger(pageSize) || pageSize <= 0) {\n throw new CandidateMaterializationError(\n 'INVALID_PAGE_LENGTH',\n 'The candidate page size must be a positive integer.'\n );\n }\n\n const options = {\n scopeKey,\n expectedTotal,\n fetchPage,\n getCurrentScopeKey,\n pageSize,\n };\n const firstPass = await materializeCandidateTargetPass(options);\n const secondPass = await materializeCandidateTargetPass(options);\n\n if (JSON.stringify(firstPass) !== JSON.stringify(secondPass)) {\n throw new CandidateMaterializationError(\n 'MEMBERSHIP_DRIFT',\n 'Matching applications changed while candidates were loading. Refresh and select again.'\n );\n }\n\n return secondPass;\n}\n\ninterface MaterializeCandidateTargetsByIdsOptions<TTarget extends { id: string }> {\n scopeKey: string;\n applicationIds: ReadonlyArray<string>;\n fetchChunkPage: (\n applicationIds: ReadonlyArray<string>,\n limit: number,\n offset: number\n ) => Promise<CandidateTargetPage<TTarget>>;\n getCurrentScopeKey: () => string;\n}\n\n/**\n * Revalidates selected candidates in bounded ID chunks. Each chunk is filtered\n * by both its IDs and the frozen list filter, so earlier mutations cannot make\n * later validation rescan or reinterpret the full result set.\n */\nexport async function materializeCandidateTargetsByIds<TTarget extends { id: string }>({\n scopeKey,\n applicationIds,\n fetchChunkPage,\n getCurrentScopeKey,\n}: MaterializeCandidateTargetsByIdsOptions<TTarget>): Promise<TTarget[]> {\n if (applicationIds.length === 0) return [];\n if (new Set(applicationIds).size !== applicationIds.length) {\n throw new CandidateMaterializationError(\n 'UNIQUE_COUNT_MISMATCH',\n 'Selected applications must have unique IDs.'\n );\n }\n\n const targetsById = new Map<string, TTarget>();\n for (const applicationIdChunk of chunkCandidateRequests(applicationIds)) {\n const targets = await materializeCandidateTargets({\n scopeKey,\n expectedTotal: applicationIdChunk.length,\n getCurrentScopeKey,\n fetchPage: (limit, offset) => fetchChunkPage(applicationIdChunk, limit, offset),\n });\n for (const target of targets) targetsById.set(target.id, target);\n }\n\n return applicationIds.map((applicationId) => {\n const target = targetsById.get(applicationId);\n if (!target) {\n throw new CandidateMaterializationError(\n 'UNIQUE_COUNT_MISMATCH',\n 'A selected application was not returned by its bounded validation query.'\n );\n }\n return target;\n });\n}\n\nexport interface CandidateSelectionState {\n mode: 'explicit' | 'all';\n explicitIds: ReadonlySet<string>;\n allTargetIds: ReadonlySet<string>;\n excludedIds: ReadonlySet<string>;\n}\n\nexport function createEmptyCandidateSelection(): CandidateSelectionState {\n return {\n mode: 'explicit',\n explicitIds: new Set<string>(),\n allTargetIds: new Set<string>(),\n excludedIds: new Set<string>(),\n };\n}\n\nexport function selectAllMaterializedCandidates(\n applicationIds: ReadonlyArray<string>\n): CandidateSelectionState {\n return {\n mode: 'all',\n explicitIds: new Set<string>(),\n allTargetIds: new Set(applicationIds),\n excludedIds: new Set<string>(),\n };\n}\n\nexport function getSelectedCandidateIds(selection: CandidateSelectionState): Set<string> {\n if (selection.mode === 'explicit') {\n return new Set(selection.explicitIds);\n }\n\n const selectedIds = new Set(selection.allTargetIds);\n for (const excludedId of selection.excludedIds) {\n selectedIds.delete(excludedId);\n }\n return selectedIds;\n}\n\nexport function getCandidateSelectionCount(selection: CandidateSelectionState): number {\n return getSelectedCandidateIds(selection).size;\n}\n\nexport function toggleCandidateSelection(\n selection: CandidateSelectionState,\n applicationId: string\n): CandidateSelectionState {\n if (selection.mode === 'all') {\n if (!selection.allTargetIds.has(applicationId)) {\n return selection;\n }\n const excludedIds = new Set(selection.excludedIds);\n if (excludedIds.has(applicationId)) {\n excludedIds.delete(applicationId);\n } else {\n excludedIds.add(applicationId);\n }\n return { ...selection, excludedIds };\n }\n\n const explicitIds = new Set(selection.explicitIds);\n if (explicitIds.has(applicationId)) {\n explicitIds.delete(applicationId);\n } else {\n explicitIds.add(applicationId);\n }\n return { ...selection, explicitIds };\n}\n\nexport function setVisibleCandidateSelection(\n selection: CandidateSelectionState,\n visibleApplicationIds: ReadonlyArray<string>,\n selected: boolean\n): CandidateSelectionState {\n if (selection.mode === 'all') {\n const excludedIds = new Set(selection.excludedIds);\n for (const applicationId of visibleApplicationIds) {\n if (!selection.allTargetIds.has(applicationId)) continue;\n if (selected) {\n excludedIds.delete(applicationId);\n } else {\n excludedIds.add(applicationId);\n }\n }\n return { ...selection, excludedIds };\n }\n\n const explicitIds = new Set(selection.explicitIds);\n for (const applicationId of visibleApplicationIds) {\n if (selected) {\n explicitIds.add(applicationId);\n } else {\n explicitIds.delete(applicationId);\n }\n }\n return { ...selection, explicitIds };\n}\n\nexport function getCandidateSelectionSummary(selection: CandidateSelectionState): string | null {\n const selectedCount = getCandidateSelectionCount(selection);\n if (selectedCount === 0) return null;\n\n if (selection.mode === 'all') {\n const totalCount = selection.allTargetIds.size;\n const excludedCount = totalCount - selectedCount;\n if (excludedCount === 0) {\n return `All ${totalCount} matching applications selected`;\n }\n return `${selectedCount} of ${totalCount} matching applications selected (${excludedCount} excluded)`;\n }\n\n return `${selectedCount} ${selectedCount === 1 ? 'application' : 'applications'} selected`;\n}\n\nexport interface ExactRoundPair {\n applicationId: string;\n roundId: string;\n target: BulkCandidateTarget;\n round: CandidateRoundPreview;\n}\n\nexport interface UnresolvedCandidateRound {\n target: BulkCandidateTarget;\n reason: 'MISSING' | 'AMBIGUOUS';\n}\n\nexport interface ExactRoundResolution {\n pairs: ExactRoundPair[];\n unresolved: UnresolvedCandidateRound[];\n}\n\n/** Resolve only concrete rounds with the requested config ID; never guess by name or type. */\nexport function resolveExactCandidateRounds(\n targets: ReadonlyArray<BulkCandidateTarget>,\n roundConfigId: string\n): ExactRoundResolution {\n const pairs: ExactRoundPair[] = [];\n const unresolved: UnresolvedCandidateRound[] = [];\n\n for (const target of targets) {\n const matches = target.interviewRounds.filter((round) => round.roundConfigId === roundConfigId);\n if (matches.length !== 1) {\n unresolved.push({\n target,\n reason: matches.length === 0 ? 'MISSING' : 'AMBIGUOUS',\n });\n continue;\n }\n\n const round = matches[0];\n pairs.push({ applicationId: target.id, roundId: round.id, target, round });\n }\n\n return { pairs, unresolved };\n}\n\nexport class CandidateChunkPreconditionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'CandidateChunkPreconditionError';\n }\n}\n\nexport function assertCandidateChunkMatchesCurrentScope(\n applicationIds: ReadonlyArray<string>,\n currentTargets: ReadonlyArray<BulkCandidateTarget>,\n jobPostingId: string\n): void {\n const currentById = new Map(currentTargets.map((target) => [target.id, target]));\n\n for (const applicationId of applicationIds) {\n const target = currentById.get(applicationId);\n if (!target || target.jobPostingId !== jobPostingId) {\n throw new CandidateChunkPreconditionError(\n 'A selected application no longer matches the frozen filter and posting. No request was sent for this chunk.'\n );\n }\n }\n}\n\nexport function assertCandidateEmailChunkMatchesCurrentScope(\n items: ReadonlyArray<{ applicationId: string; roundId: string }>,\n currentTargets: ReadonlyArray<BulkCandidateTarget>,\n jobPostingId: string,\n roundConfigId: string\n): void {\n assertCandidateChunkMatchesCurrentScope(\n items.map((item) => item.applicationId),\n currentTargets,\n jobPostingId\n );\n\n const currentById = new Map(currentTargets.map((target) => [target.id, target]));\n for (const item of items) {\n const target = currentById.get(item.applicationId);\n const matchingRounds = target?.interviewRounds.filter(\n (round) => round.roundConfigId === roundConfigId\n );\n if (matchingRounds?.length !== 1 || matchingRounds[0]?.id !== item.roundId) {\n throw new CandidateChunkPreconditionError(\n 'A selected candidate round changed after preview. No request was sent for this chunk.'\n );\n }\n }\n}\n\nexport function chunkCandidateRequests<T>(\n items: ReadonlyArray<T>,\n chunkSize = BULK_CANDIDATE_REQUEST_LIMIT\n): T[][] {\n if (!Number.isInteger(chunkSize) || chunkSize <= 0) {\n throw new Error('Chunk size must be a positive integer.');\n }\n\n const chunks: T[][] = [];\n for (let index = 0; index < items.length; index += chunkSize) {\n chunks.push(items.slice(index, index + chunkSize));\n }\n return chunks;\n}\n\nexport interface SequentialExecutionProgress {\n processed: number;\n total: number;\n}\n\nexport interface SequentialExecutionResult<TItem, TAggregate> {\n aggregate: TAggregate;\n processedItems: TItem[];\n ambiguousItems: TItem[];\n notStartedItems: TItem[];\n error: unknown | null;\n}\n\ninterface ExecuteSequentialCandidateChunksOptions<TItem, TBatchResult, TAggregate> {\n items: ReadonlyArray<TItem>;\n initialAggregate: TAggregate;\n executeChunk: (chunk: ReadonlyArray<TItem>, chunkIndex: number) => Promise<TBatchResult>;\n mergeResult: (aggregate: TAggregate, result: TBatchResult) => TAggregate;\n onProgress?: (progress: SequentialExecutionProgress) => void;\n chunkSize?: number;\n}\n\n/**\n * Executes each request once and in order. A thrown transport/missing-data error\n * makes the current chunk ambiguous and prevents every later chunk from starting.\n */\nexport async function executeSequentialCandidateChunks<TItem, TBatchResult, TAggregate>({\n items,\n initialAggregate,\n executeChunk,\n mergeResult,\n onProgress,\n chunkSize = BULK_CANDIDATE_REQUEST_LIMIT,\n}: ExecuteSequentialCandidateChunksOptions<TItem, TBatchResult, TAggregate>): Promise<\n SequentialExecutionResult<TItem, TAggregate>\n> {\n const chunks = chunkCandidateRequests(items, chunkSize);\n const processedItems: TItem[] = [];\n let aggregate = initialAggregate;\n\n onProgress?.({ processed: 0, total: items.length });\n\n for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex += 1) {\n const chunk = chunks[chunkIndex];\n try {\n const result = await executeChunk(chunk, chunkIndex);\n aggregate = mergeResult(aggregate, result);\n processedItems.push(...chunk);\n onProgress?.({ processed: processedItems.length, total: items.length });\n } catch (error) {\n const failedBeforeMutation = error instanceof CandidateChunkPreconditionError;\n return {\n aggregate,\n processedItems,\n ambiguousItems: failedBeforeMutation ? [] : [...chunk],\n notStartedItems: failedBeforeMutation\n ? chunks.slice(chunkIndex).flat()\n : chunks.slice(chunkIndex + 1).flat(),\n error,\n };\n }\n }\n\n return {\n aggregate,\n processedItems,\n ambiguousItems: [],\n notStartedItems: [],\n error: null,\n };\n}\n\nexport type BulkOperationNotificationSeverity = 'success' | 'warning' | 'error';\n\nexport function getBulkOperationNotificationSeverity({\n succeeded,\n skipped,\n failed,\n ambiguous = false,\n}: {\n succeeded: number;\n skipped: number;\n failed: number;\n ambiguous?: boolean;\n}): BulkOperationNotificationSeverity {\n if (ambiguous) return 'error';\n if (failed > 0 && succeeded === 0 && skipped === 0) return 'error';\n if (failed > 0 || skipped > 0) return 'warning';\n return 'success';\n}\n\nexport interface CandidateEmailSuccess {\n applicationId: string;\n roundId: string;\n}\n\nexport interface CandidateEmailSkip {\n applicationId: string;\n roundId: string;\n reason: string;\n message: string;\n}\n\nexport interface CandidateEmailFailure {\n applicationId: string;\n roundId: string;\n message: string;\n}\n\nexport interface CandidateEmailAggregate {\n succeeded: CandidateEmailSuccess[];\n skipped: CandidateEmailSkip[];\n failed: CandidateEmailFailure[];\n}\n\nexport function createEmptyCandidateEmailAggregate(): CandidateEmailAggregate {\n return { succeeded: [], skipped: [], failed: [] };\n}\n\nfunction candidateRoundKey(applicationId: string, roundId: string): string {\n return `${applicationId}\\0${roundId}`;\n}\n\nfunction assertExactResultKeys(\n expectedKeys: ReadonlyArray<string>,\n actualKeys: ReadonlyArray<string>,\n operationLabel: string\n): void {\n const expected = new Set(expectedKeys);\n const actual = new Set(actualKeys);\n if (\n expected.size !== expectedKeys.length ||\n actual.size !== actualKeys.length ||\n expected.size !== actual.size ||\n [...expected].some((key) => !actual.has(key))\n ) {\n throw new Error(\n `${operationLabel} returned an incomplete, duplicate, or unexpected item result. The current chunk is ambiguous and later chunks were stopped.`\n );\n }\n}\n\nexport function assertCompleteCandidateEmailChunkResult(\n requested: ReadonlyArray<{ applicationId: string; roundId: string }>,\n result: CandidateEmailAggregate\n): void {\n assertExactResultKeys(\n requested.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n [\n ...result.succeeded.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n ...result.skipped.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n ...result.failed.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n ],\n 'The candidate email request'\n );\n}\n\nexport function aggregateCandidateEmailResult(\n aggregate: CandidateEmailAggregate,\n result: CandidateEmailAggregate\n): CandidateEmailAggregate {\n return {\n succeeded: [...aggregate.succeeded, ...result.succeeded],\n skipped: [...aggregate.skipped, ...result.skipped],\n failed: [...aggregate.failed, ...result.failed],\n };\n}\n\nexport interface EnsuredRoundSummary {\n id: string;\n applicationId: string;\n}\n\nexport interface EnsureRoundFailure {\n applicationId: string;\n code: string;\n message: string;\n}\n\nexport interface EnsureRoundAggregate {\n created: EnsuredRoundSummary[];\n alreadyPresent: EnsuredRoundSummary[];\n failed: EnsureRoundFailure[];\n}\n\nexport function createEmptyEnsureRoundAggregate(): EnsureRoundAggregate {\n return { created: [], alreadyPresent: [], failed: [] };\n}\n\nexport function assertCompleteEnsureRoundChunkResult(\n requestedApplicationIds: ReadonlyArray<string>,\n result: EnsureRoundAggregate\n): void {\n assertExactResultKeys(\n requestedApplicationIds,\n [\n ...result.created.map((item) => item.applicationId),\n ...result.alreadyPresent.map((item) => item.applicationId),\n ...result.failed.map((item) => item.applicationId),\n ],\n 'The add-to-round request'\n );\n}\n\nexport function aggregateEnsureRoundResult(\n aggregate: EnsureRoundAggregate,\n result: EnsureRoundAggregate\n): EnsureRoundAggregate {\n return {\n created: [...aggregate.created, ...result.created],\n alreadyPresent: [...aggregate.alreadyPresent, ...result.alreadyPresent],\n failed: [...aggregate.failed, ...result.failed],\n };\n}\n\nexport function hasCandidateEmailType(round: CandidateRoundPreview, emailType: string): boolean {\n return round.emailLogs.some((log) => log.emailType === emailType);\n}\n"],"mappings":"AAgCA,IAAa,IAAb,cAAmD,MAAM;CAErC;CADlB,YACE,GACA,GACA;EAEA,AADA,MAAM,CAAO,GAHG,KAAA,OAAA,GAIhB,KAAK,OAAO;CACd;AACF;AAUA,SAAS,EAAmB,GAAkB,GAA+B;CAC3E,IAAI,MAAa,GACf,MAAM,IAAI,EACR,eACA,gEACF;AAEJ;AAEA,eAAe,EAA+D,EAC5E,aACA,kBACA,cACA,uBACA,eAC4E;CAC5E,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AAgB,CAAC,GAAG,EAAU,gBAAgB,GAAG,EAAO,cAAc;EACtE,QAAQ,CAAC,GAAG,EAAU,QAAQ,GAAG,EAAO,MAAM;CAChD;AACF;AAEA,SAAgB,EAAsB,GAA8B,GAA4B;CAC9F,OAAO,EAAM,UAAU,MAAM,MAAQ,EAAI,cAAc,CAAS;AAClE"}
|
|
1
|
+
{"version":3,"file":"bulkCandidateOperations.js","names":[],"sources":["../../../src/support/utils/bulkCandidateOperations.ts"],"sourcesContent":["export const BULK_CANDIDATE_REQUEST_LIMIT = 100;\n\nexport interface CandidateRoundPreview {\n id: string;\n roundConfigId: string | null;\n name: string;\n roundType: string;\n emailLogs: ReadonlyArray<{\n emailType: string;\n }>;\n}\n\nexport interface BulkCandidateTarget {\n id: string;\n jobPostingId: string | null;\n interviewRounds: ReadonlyArray<CandidateRoundPreview>;\n}\n\nexport interface CandidateTargetPage<TTarget extends { id: string }> {\n items: ReadonlyArray<TTarget>;\n total: number;\n hasMore: boolean;\n}\n\nexport type CandidateMaterializationErrorCode =\n | 'STALE_SCOPE'\n | 'TOTAL_DRIFT'\n | 'EMPTY_PAGE_WITH_MORE'\n | 'INVALID_PAGE_LENGTH'\n | 'UNIQUE_COUNT_MISMATCH'\n | 'MEMBERSHIP_DRIFT';\n\nexport class CandidateMaterializationError extends Error {\n constructor(\n public readonly code: CandidateMaterializationErrorCode,\n message: string\n ) {\n super(message);\n this.name = 'CandidateMaterializationError';\n }\n}\n\ninterface MaterializeCandidateTargetsOptions<TTarget extends { id: string }> {\n scopeKey: string;\n expectedTotal: number;\n fetchPage: (limit: number, offset: number) => Promise<CandidateTargetPage<TTarget>>;\n getCurrentScopeKey: () => string;\n pageSize?: number;\n}\n\nfunction assertCurrentScope(scopeKey: string, currentScopeKey: string): void {\n if (scopeKey !== currentScopeKey) {\n throw new CandidateMaterializationError(\n 'STALE_SCOPE',\n 'The application filters changed while candidates were loading.'\n );\n }\n}\n\nasync function materializeCandidateTargetPass<TTarget extends { id: string }>({\n scopeKey,\n expectedTotal,\n fetchPage,\n getCurrentScopeKey,\n pageSize,\n}: Required<MaterializeCandidateTargetsOptions<TTarget>>): Promise<TTarget[]> {\n const targetsById = new Map<string, TTarget>();\n let offset = 0;\n\n while (true) {\n assertCurrentScope(scopeKey, getCurrentScopeKey());\n const page = await fetchPage(pageSize, offset);\n assertCurrentScope(scopeKey, getCurrentScopeKey());\n\n if (page.total !== expectedTotal) {\n throw new CandidateMaterializationError(\n 'TOTAL_DRIFT',\n `The matching application total changed from ${expectedTotal} to ${page.total}. Refresh and select again.`\n );\n }\n\n const rawPageLength = page.items.length;\n if (rawPageLength > pageSize) {\n throw new CandidateMaterializationError(\n 'INVALID_PAGE_LENGTH',\n `The server returned ${rawPageLength} applications for a page limited to ${pageSize}.`\n );\n }\n if (page.hasMore && rawPageLength === 0) {\n throw new CandidateMaterializationError(\n 'EMPTY_PAGE_WITH_MORE',\n 'The server reported more applications but returned an empty page.'\n );\n }\n\n for (const target of page.items) {\n if (!targetsById.has(target.id)) {\n targetsById.set(target.id, target);\n }\n }\n\n offset += rawPageLength;\n\n if (!page.hasMore) {\n if (targetsById.size !== expectedTotal) {\n throw new CandidateMaterializationError(\n 'UNIQUE_COUNT_MISMATCH',\n `Expected ${expectedTotal} unique applications but loaded ${targetsById.size}. Refresh and select again.`\n );\n }\n return [...targetsById.values()];\n }\n\n if (offset >= expectedTotal) {\n throw new CandidateMaterializationError(\n 'TOTAL_DRIFT',\n 'The server reported more applications after the frozen total had already been loaded.'\n );\n }\n }\n}\n\n/**\n * Materializes a frozen application-filter scope without trusting cached pages.\n * Two independent passes must return the same ordered target snapshots. This\n * catches offset-page membership shifts while preserving the 100-item page cap.\n */\nexport async function materializeCandidateTargets<TTarget extends { id: string }>({\n scopeKey,\n expectedTotal,\n fetchPage,\n getCurrentScopeKey,\n pageSize = BULK_CANDIDATE_REQUEST_LIMIT,\n}: MaterializeCandidateTargetsOptions<TTarget>): Promise<TTarget[]> {\n if (!Number.isInteger(expectedTotal) || expectedTotal < 0) {\n throw new CandidateMaterializationError(\n 'TOTAL_DRIFT',\n 'The application total is invalid. Refresh the list and try again.'\n );\n }\n if (!Number.isInteger(pageSize) || pageSize <= 0) {\n throw new CandidateMaterializationError(\n 'INVALID_PAGE_LENGTH',\n 'The candidate page size must be a positive integer.'\n );\n }\n\n const options = {\n scopeKey,\n expectedTotal,\n fetchPage,\n getCurrentScopeKey,\n pageSize,\n };\n const firstPass = await materializeCandidateTargetPass(options);\n const secondPass = await materializeCandidateTargetPass(options);\n\n if (JSON.stringify(firstPass) !== JSON.stringify(secondPass)) {\n throw new CandidateMaterializationError(\n 'MEMBERSHIP_DRIFT',\n 'Matching applications changed while candidates were loading. Refresh and select again.'\n );\n }\n\n return secondPass;\n}\n\ninterface MaterializeCandidateTargetsByIdsOptions<TTarget extends { id: string }> {\n scopeKey: string;\n applicationIds: ReadonlyArray<string>;\n fetchChunkPage: (\n applicationIds: ReadonlyArray<string>,\n limit: number,\n offset: number\n ) => Promise<CandidateTargetPage<TTarget>>;\n getCurrentScopeKey: () => string;\n}\n\n/**\n * Revalidates selected candidates in bounded ID chunks. Each chunk is filtered\n * by both its IDs and the frozen list filter, so earlier mutations cannot make\n * later validation rescan or reinterpret the full result set.\n */\nexport async function materializeCandidateTargetsByIds<TTarget extends { id: string }>({\n scopeKey,\n applicationIds,\n fetchChunkPage,\n getCurrentScopeKey,\n}: MaterializeCandidateTargetsByIdsOptions<TTarget>): Promise<TTarget[]> {\n if (applicationIds.length === 0) return [];\n if (new Set(applicationIds).size !== applicationIds.length) {\n throw new CandidateMaterializationError(\n 'UNIQUE_COUNT_MISMATCH',\n 'Selected applications must have unique IDs.'\n );\n }\n\n const targetsById = new Map<string, TTarget>();\n for (const applicationIdChunk of chunkCandidateRequests(applicationIds)) {\n const targets = await materializeCandidateTargets({\n scopeKey,\n expectedTotal: applicationIdChunk.length,\n getCurrentScopeKey,\n fetchPage: (limit, offset) => fetchChunkPage(applicationIdChunk, limit, offset),\n });\n for (const target of targets) targetsById.set(target.id, target);\n }\n\n return applicationIds.map((applicationId) => {\n const target = targetsById.get(applicationId);\n if (!target) {\n throw new CandidateMaterializationError(\n 'UNIQUE_COUNT_MISMATCH',\n 'A selected application was not returned by its bounded validation query.'\n );\n }\n return target;\n });\n}\n\nexport interface CandidateSelectionState {\n mode: 'explicit' | 'all';\n explicitIds: ReadonlySet<string>;\n allTargetIds: ReadonlySet<string>;\n excludedIds: ReadonlySet<string>;\n}\n\nexport function createEmptyCandidateSelection(): CandidateSelectionState {\n return {\n mode: 'explicit',\n explicitIds: new Set<string>(),\n allTargetIds: new Set<string>(),\n excludedIds: new Set<string>(),\n };\n}\n\nexport function selectAllMaterializedCandidates(\n applicationIds: ReadonlyArray<string>\n): CandidateSelectionState {\n return {\n mode: 'all',\n explicitIds: new Set<string>(),\n allTargetIds: new Set(applicationIds),\n excludedIds: new Set<string>(),\n };\n}\n\nexport function getSelectedCandidateIds(selection: CandidateSelectionState): Set<string> {\n if (selection.mode === 'explicit') {\n return new Set(selection.explicitIds);\n }\n\n const selectedIds = new Set(selection.allTargetIds);\n for (const excludedId of selection.excludedIds) {\n selectedIds.delete(excludedId);\n }\n return selectedIds;\n}\n\nexport function getCandidateSelectionCount(selection: CandidateSelectionState): number {\n return getSelectedCandidateIds(selection).size;\n}\n\nexport function toggleCandidateSelection(\n selection: CandidateSelectionState,\n applicationId: string\n): CandidateSelectionState {\n if (selection.mode === 'all') {\n if (!selection.allTargetIds.has(applicationId)) {\n return selection;\n }\n const excludedIds = new Set(selection.excludedIds);\n if (excludedIds.has(applicationId)) {\n excludedIds.delete(applicationId);\n } else {\n excludedIds.add(applicationId);\n }\n return { ...selection, excludedIds };\n }\n\n const explicitIds = new Set(selection.explicitIds);\n if (explicitIds.has(applicationId)) {\n explicitIds.delete(applicationId);\n } else {\n explicitIds.add(applicationId);\n }\n return { ...selection, explicitIds };\n}\n\nexport function setVisibleCandidateSelection(\n selection: CandidateSelectionState,\n visibleApplicationIds: ReadonlyArray<string>,\n selected: boolean\n): CandidateSelectionState {\n if (selection.mode === 'all') {\n const excludedIds = new Set(selection.excludedIds);\n for (const applicationId of visibleApplicationIds) {\n if (!selection.allTargetIds.has(applicationId)) continue;\n if (selected) {\n excludedIds.delete(applicationId);\n } else {\n excludedIds.add(applicationId);\n }\n }\n return { ...selection, excludedIds };\n }\n\n const explicitIds = new Set(selection.explicitIds);\n for (const applicationId of visibleApplicationIds) {\n if (selected) {\n explicitIds.add(applicationId);\n } else {\n explicitIds.delete(applicationId);\n }\n }\n return { ...selection, explicitIds };\n}\n\nexport function getCandidateSelectionSummary(selection: CandidateSelectionState): string | null {\n const selectedCount = getCandidateSelectionCount(selection);\n if (selectedCount === 0) return null;\n\n if (selection.mode === 'all') {\n const totalCount = selection.allTargetIds.size;\n const excludedCount = totalCount - selectedCount;\n if (excludedCount === 0) {\n return `All ${totalCount} matching applications selected`;\n }\n return `${selectedCount} of ${totalCount} matching applications selected (${excludedCount} excluded)`;\n }\n\n return `${selectedCount} ${selectedCount === 1 ? 'application' : 'applications'} selected`;\n}\n\nexport interface ExactRoundPair {\n applicationId: string;\n roundId: string;\n target: BulkCandidateTarget;\n round: CandidateRoundPreview;\n}\n\nexport interface UnresolvedCandidateRound {\n target: BulkCandidateTarget;\n reason: 'MISSING' | 'AMBIGUOUS';\n}\n\nexport interface ExactRoundResolution {\n pairs: ExactRoundPair[];\n unresolved: UnresolvedCandidateRound[];\n}\n\n/** Resolve only concrete rounds with the requested config ID; never guess by name or type. */\nexport function resolveExactCandidateRounds(\n targets: ReadonlyArray<BulkCandidateTarget>,\n roundConfigId: string\n): ExactRoundResolution {\n const pairs: ExactRoundPair[] = [];\n const unresolved: UnresolvedCandidateRound[] = [];\n\n for (const target of targets) {\n const matches = target.interviewRounds.filter((round) => round.roundConfigId === roundConfigId);\n if (matches.length !== 1) {\n unresolved.push({\n target,\n reason: matches.length === 0 ? 'MISSING' : 'AMBIGUOUS',\n });\n continue;\n }\n\n const round = matches[0];\n pairs.push({ applicationId: target.id, roundId: round.id, target, round });\n }\n\n return { pairs, unresolved };\n}\n\nexport class CandidateChunkPreconditionError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'CandidateChunkPreconditionError';\n }\n}\n\nexport function assertCandidateChunkMatchesCurrentScope(\n applicationIds: ReadonlyArray<string>,\n currentTargets: ReadonlyArray<BulkCandidateTarget>,\n jobPostingId: string\n): void {\n const currentById = new Map(currentTargets.map((target) => [target.id, target]));\n\n for (const applicationId of applicationIds) {\n const target = currentById.get(applicationId);\n if (!target || target.jobPostingId !== jobPostingId) {\n throw new CandidateChunkPreconditionError(\n 'A selected application no longer matches the frozen filter and posting. No request was sent for this chunk.'\n );\n }\n }\n}\n\nexport function assertCandidateEmailChunkMatchesCurrentScope(\n items: ReadonlyArray<{ applicationId: string; roundId: string }>,\n currentTargets: ReadonlyArray<BulkCandidateTarget>,\n jobPostingId: string,\n roundConfigId: string\n): void {\n assertCandidateChunkMatchesCurrentScope(\n items.map((item) => item.applicationId),\n currentTargets,\n jobPostingId\n );\n\n const currentById = new Map(currentTargets.map((target) => [target.id, target]));\n for (const item of items) {\n const target = currentById.get(item.applicationId);\n const matchingRounds = target?.interviewRounds.filter(\n (round) => round.roundConfigId === roundConfigId\n );\n if (matchingRounds?.length !== 1 || matchingRounds[0]?.id !== item.roundId) {\n throw new CandidateChunkPreconditionError(\n 'A selected candidate round changed after preview. No request was sent for this chunk.'\n );\n }\n }\n}\n\nexport function chunkCandidateRequests<T>(\n items: ReadonlyArray<T>,\n chunkSize = BULK_CANDIDATE_REQUEST_LIMIT\n): T[][] {\n if (!Number.isInteger(chunkSize) || chunkSize <= 0) {\n throw new Error('Chunk size must be a positive integer.');\n }\n\n const chunks: T[][] = [];\n for (let index = 0; index < items.length; index += chunkSize) {\n chunks.push(items.slice(index, index + chunkSize));\n }\n return chunks;\n}\n\nexport interface SequentialExecutionProgress {\n processed: number;\n total: number;\n}\n\nexport interface SequentialExecutionResult<TItem, TAggregate> {\n aggregate: TAggregate;\n processedItems: TItem[];\n ambiguousItems: TItem[];\n notStartedItems: TItem[];\n error: unknown | null;\n}\n\ninterface ExecuteSequentialCandidateChunksOptions<TItem, TBatchResult, TAggregate> {\n items: ReadonlyArray<TItem>;\n initialAggregate: TAggregate;\n executeChunk: (chunk: ReadonlyArray<TItem>, chunkIndex: number) => Promise<TBatchResult>;\n mergeResult: (aggregate: TAggregate, result: TBatchResult) => TAggregate;\n onProgress?: (progress: SequentialExecutionProgress) => void;\n chunkSize?: number;\n}\n\n/**\n * Executes each request once and in order. A thrown transport/missing-data error\n * makes the current chunk ambiguous and prevents every later chunk from starting.\n */\nexport async function executeSequentialCandidateChunks<TItem, TBatchResult, TAggregate>({\n items,\n initialAggregate,\n executeChunk,\n mergeResult,\n onProgress,\n chunkSize = BULK_CANDIDATE_REQUEST_LIMIT,\n}: ExecuteSequentialCandidateChunksOptions<TItem, TBatchResult, TAggregate>): Promise<\n SequentialExecutionResult<TItem, TAggregate>\n> {\n const chunks = chunkCandidateRequests(items, chunkSize);\n const processedItems: TItem[] = [];\n let aggregate = initialAggregate;\n\n onProgress?.({ processed: 0, total: items.length });\n\n for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex += 1) {\n const chunk = chunks[chunkIndex];\n try {\n const result = await executeChunk(chunk, chunkIndex);\n aggregate = mergeResult(aggregate, result);\n processedItems.push(...chunk);\n onProgress?.({ processed: processedItems.length, total: items.length });\n } catch (error) {\n const failedBeforeMutation = error instanceof CandidateChunkPreconditionError;\n return {\n aggregate,\n processedItems,\n ambiguousItems: failedBeforeMutation ? [] : [...chunk],\n notStartedItems: failedBeforeMutation\n ? chunks.slice(chunkIndex).flat()\n : chunks.slice(chunkIndex + 1).flat(),\n error,\n };\n }\n }\n\n return {\n aggregate,\n processedItems,\n ambiguousItems: [],\n notStartedItems: [],\n error: null,\n };\n}\n\nexport type BulkOperationNotificationSeverity = 'success' | 'warning' | 'error';\n\nexport function getBulkOperationNotificationSeverity({\n succeeded,\n skipped,\n failed,\n ambiguous = false,\n}: {\n succeeded: number;\n skipped: number;\n failed: number;\n ambiguous?: boolean;\n}): BulkOperationNotificationSeverity {\n if (ambiguous) return 'error';\n if (failed > 0 && succeeded === 0 && skipped === 0) return 'error';\n if (failed > 0 || skipped > 0) return 'warning';\n return 'success';\n}\n\nexport interface CandidateEmailSuccess {\n applicationId: string;\n roundId: string;\n}\n\nexport interface CandidateEmailSkip {\n applicationId: string;\n roundId: string;\n reason: string;\n message: string;\n}\n\nexport interface CandidateEmailFailure {\n applicationId: string;\n roundId: string;\n message: string;\n}\n\nexport interface CandidateEmailAggregate {\n succeeded: CandidateEmailSuccess[];\n skipped: CandidateEmailSkip[];\n failed: CandidateEmailFailure[];\n}\n\nexport function createEmptyCandidateEmailAggregate(): CandidateEmailAggregate {\n return { succeeded: [], skipped: [], failed: [] };\n}\n\nfunction candidateRoundKey(applicationId: string, roundId: string): string {\n return `${applicationId}\\0${roundId}`;\n}\n\nfunction assertExactResultKeys(\n expectedKeys: ReadonlyArray<string>,\n actualKeys: ReadonlyArray<string>,\n operationLabel: string\n): void {\n const expected = new Set(expectedKeys);\n const actual = new Set(actualKeys);\n if (\n expected.size !== expectedKeys.length ||\n actual.size !== actualKeys.length ||\n expected.size !== actual.size ||\n [...expected].some((key) => !actual.has(key))\n ) {\n throw new Error(\n `${operationLabel} returned an incomplete, duplicate, or unexpected item result. The current chunk is ambiguous and later chunks were stopped.`\n );\n }\n}\n\nexport function assertCompleteCandidateEmailChunkResult(\n requested: ReadonlyArray<{ applicationId: string; roundId: string }>,\n result: CandidateEmailAggregate\n): void {\n assertExactResultKeys(\n requested.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n [\n ...result.succeeded.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n ...result.skipped.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n ...result.failed.map((item) => candidateRoundKey(item.applicationId, item.roundId)),\n ],\n 'The candidate email request'\n );\n}\n\nexport function aggregateCandidateEmailResult(\n aggregate: CandidateEmailAggregate,\n result: CandidateEmailAggregate\n): CandidateEmailAggregate {\n return {\n succeeded: [...aggregate.succeeded, ...result.succeeded],\n skipped: [...aggregate.skipped, ...result.skipped],\n failed: [...aggregate.failed, ...result.failed],\n };\n}\n\nexport interface EnsuredRoundSummary {\n id: string;\n applicationId: string;\n}\n\nexport interface EnsureRoundFailure {\n applicationId: string;\n code: string;\n message: string;\n}\n\nexport interface EnsureRoundAggregate {\n created: EnsuredRoundSummary[];\n alreadyPresent: EnsuredRoundSummary[];\n failed: EnsureRoundFailure[];\n}\n\nexport function createEmptyEnsureRoundAggregate(): EnsureRoundAggregate {\n return { created: [], alreadyPresent: [], failed: [] };\n}\n\nexport function assertCompleteEnsureRoundChunkResult(\n requestedApplicationIds: ReadonlyArray<string>,\n result: EnsureRoundAggregate\n): void {\n assertExactResultKeys(\n requestedApplicationIds,\n [\n ...result.created.map((item) => item.applicationId),\n ...result.alreadyPresent.map((item) => item.applicationId),\n ...result.failed.map((item) => item.applicationId),\n ],\n 'The add-to-round request'\n );\n}\n\nexport function aggregateEnsureRoundResult(\n aggregate: EnsureRoundAggregate,\n result: EnsureRoundAggregate\n): EnsureRoundAggregate {\n return {\n created: [...aggregate.created, ...result.created],\n alreadyPresent: [...aggregate.alreadyPresent, ...result.alreadyPresent],\n failed: [...aggregate.failed, ...result.failed],\n };\n}\n\nexport function hasCandidateEmailType(round: CandidateRoundPreview, emailType: string): boolean {\n return round.emailLogs.some((log) => log.emailType === emailType);\n}\n\nexport interface DuplicateNoticeSuccess {\n email: string;\n}\n\nexport interface DuplicateNoticeSkip {\n email: string;\n reason: string;\n message: string;\n}\n\nexport interface DuplicateNoticeFailure {\n email: string;\n message: string;\n}\n\nexport interface DuplicateNoticeAggregate {\n succeeded: DuplicateNoticeSuccess[];\n skipped: DuplicateNoticeSkip[];\n failed: DuplicateNoticeFailure[];\n}\n\nexport function createEmptyDuplicateNoticeAggregate(): DuplicateNoticeAggregate {\n return { succeeded: [], skipped: [], failed: [] };\n}\n\nexport function aggregateDuplicateNoticeResult(\n aggregate: DuplicateNoticeAggregate,\n result: DuplicateNoticeAggregate\n): DuplicateNoticeAggregate {\n return {\n succeeded: [...aggregate.succeeded, ...result.succeeded],\n skipped: [...aggregate.skipped, ...result.skipped],\n failed: [...aggregate.failed, ...result.failed],\n };\n}\n"],"mappings":"AAgCA,IAAa,IAAb,cAAmD,MAAM;CAErC;CADlB,YACE,GACA,GACA;EAEA,AADA,MAAM,CAAO,GAHG,KAAA,OAAA,GAIhB,KAAK,OAAO;CACd;AACF;AAUA,SAAS,EAAmB,GAAkB,GAA+B;CAC3E,IAAI,MAAa,GACf,MAAM,IAAI,EACR,eACA,gEACF;AAEJ;AAEA,eAAe,EAA+D,EAC5E,aACA,kBACA,cACA,uBACA,eAC4E;CAC5E,IAAM,oBAAc,IAAI,IAAqB,GACzC,IAAS;CAEb,SAAa;EACX,EAAmB,GAAU,EAAmB,CAAC;EACjD,IAAM,IAAO,MAAM,EAAU,GAAU,CAAM;EAG7C,IAFA,EAAmB,GAAU,EAAmB,CAAC,GAE7C,EAAK,UAAU,GACjB,MAAM,IAAI,EACR,eACA,+CAA+C,EAAc,MAAM,EAAK,MAAM,4BAChF;EAGF,IAAM,IAAgB,EAAK,MAAM;EACjC,IAAI,IAAgB,GAClB,MAAM,IAAI,EACR,uBACA,uBAAuB,EAAc,sCAAsC,EAAS,EACtF;EAEF,IAAI,EAAK,WAAW,MAAkB,GACpC,MAAM,IAAI,EACR,wBACA,mEACF;EAGF,KAAK,IAAM,KAAU,EAAK,OACxB,AAAK,EAAY,IAAI,EAAO,EAAE,KAC5B,EAAY,IAAI,EAAO,IAAI,CAAM;EAMrC,IAFA,KAAU,GAEN,CAAC,EAAK,SAAS;GACjB,IAAI,EAAY,SAAS,GACvB,MAAM,IAAI,EACR,yBACA,YAAY,EAAc,kCAAkC,EAAY,KAAK,4BAC/E;GAEF,OAAO,CAAC,GAAG,EAAY,OAAO,CAAC;EACjC;E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EAAU,SAAS,GAAG,EAAO,OAAO;EACjD,QAAQ,CAAC,GAAG,EAAU,QAAQ,GAAG,EAAO,MAAM;CAChD;AACF;AAmBA,SAAgB,IAAwD;CACtE,OAAO;EAAE,SAAS,CAAC;EAAG,gBAAgB,CAAC;EAAG,QAAQ,CAAC;CAAE;AACvD;AAEA,SAAgB,EACd,GACA,GACM;CACN,EACE,GACA;EACE,GAAG,EAAO,QAAQ,KAAK,MAAS,EAAK,aAAa;EAClD,GAAG,EAAO,eAAe,KAAK,MAAS,EAAK,aAAa;EACzD,GAAG,EAAO,OAAO,KAAK,MAAS,EAAK,aAAa;CACnD,GACA,0BACF;AACF;AAEA,SAAgB,EACd,GACA,GACsB;CACtB,OAAO;EACL,SAAS,CAAC,GAAG,EAAU,SAAS,GAAG,EAAO,OAAO;EACjD,gBAAgB,CAAC,GAAG,EAAU,gBAAgB,GAAG,EAAO,cAAc;EACtE,QAAQ,CAAC,GAAG,EAAU,QAAQ,GAAG,EAAO,MAAM;CAChD;AACF;AAEA,SAAgB,EAAsB,GAA8B,GAA4B;CAC9F,OAAO,EAAM,UAAU,MAAM,MAAQ,EAAI,cAAc,CAAS;AAClE;AAuBA,SAAgB,IAAgE;CAC9E,OAAO;EAAE,WAAW,CAAC;EAAG,SAAS,CAAC;EAAG,QAAQ,CAAC;CAAE;AAClD;AAEA,SAAgB,EACd,GACA,GAC0B;CAC1B,OAAO;EACL,WAAW,CAAC,GAAG,EAAU,WAAW,GAAG,EAAO,SAAS;EACvD,SAAS,CAAC,GAAG,EAAU,SAAS,GAAG,EAAO,OAAO;EACjD,QAAQ,CAAC,GAAG,EAAU,QAAQ,GAAG,EAAO,MAAM;CAChD;AACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), t = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
3
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
-
});
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as __commonJSMin, t as __require };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_shim as n } from "../../shim/index.js";
|
|
3
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
|
|
4
|
-
var r = /* @__PURE__ */ e(((e) => {
|
|
5
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
6
|
-
function r(e, t) {
|
|
7
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
8
|
-
}
|
|
9
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
10
|
-
var i = t("react"), a = n(), o = typeof Object.is == "function" ? Object.is : r, s = a.useSyncExternalStore, c = i.useRef, l = i.useEffect, u = i.useMemo, d = i.useDebugValue;
|
|
11
|
-
e.useSyncExternalStoreWithSelector = function(e, t, n, r, i) {
|
|
12
|
-
var a = c(null);
|
|
13
|
-
if (a.current === null) {
|
|
14
|
-
var f = {
|
|
15
|
-
hasValue: !1,
|
|
16
|
-
value: null
|
|
17
|
-
};
|
|
18
|
-
a.current = f;
|
|
19
|
-
} else f = a.current;
|
|
20
|
-
a = u(function() {
|
|
21
|
-
function e(e) {
|
|
22
|
-
if (!a) {
|
|
23
|
-
if (a = !0, s = e, e = r(e), i !== void 0 && f.hasValue) {
|
|
24
|
-
var t = f.value;
|
|
25
|
-
if (i(t, e)) return c = t;
|
|
26
|
-
}
|
|
27
|
-
return c = e;
|
|
28
|
-
}
|
|
29
|
-
if (t = c, o(s, e)) return t;
|
|
30
|
-
var n = r(e);
|
|
31
|
-
return i !== void 0 && i(t, n) ? (s = e, t) : (s = e, c = n);
|
|
32
|
-
}
|
|
33
|
-
var a = !1, s, c, l = n === void 0 ? null : n;
|
|
34
|
-
return [function() {
|
|
35
|
-
return e(t());
|
|
36
|
-
}, l === null ? void 0 : function() {
|
|
37
|
-
return e(l());
|
|
38
|
-
}];
|
|
39
|
-
}, [
|
|
40
|
-
t,
|
|
41
|
-
n,
|
|
42
|
-
r,
|
|
43
|
-
i
|
|
44
|
-
]);
|
|
45
|
-
var p = s(e, a[0], a[1]);
|
|
46
|
-
return l(function() {
|
|
47
|
-
f.hasValue = !0, f.value = p;
|
|
48
|
-
}, [p]), d(p), p;
|
|
49
|
-
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
50
|
-
})();
|
|
51
|
-
}));
|
|
52
|
-
//#endregion
|
|
53
|
-
export default r();
|
|
54
|
-
export { r as require_with_selector_development };
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=with-selector.development.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.development.js","names":[],"sources":["../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n"],"x_google_ignoreList":[0],"mappings":";;;;CAWA,AAAA,QAAA,IAAA,aAAA,iBACG,WAAY;EACX,SAAS,EAAG,GAAG,GAAG;GAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;EACxE;EACA,AAAgB,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,+BADxC,cAEA,+BAA+B,4BAA4B,MAAM,CAAC;EACpE,IAAI,IAAA,EAAgB,OAAO,GACzB,IAAA,EAAA,GACA,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GACzD,IAAuB,EAAK,sBAC5B,IAAS,EAAM,QACf,IAAY,EAAM,WAClB,IAAU,EAAM,SAChB,IAAgB,EAAM;EAiExB,AAhEA,EAAQ,mCAAmC,SACzC,GACA,GACA,GACA,GACA,GACA;GACA,IAAI,IAAU,EAAO,IAAI;GACzB,IAAa,EAAQ,YAAjB,MAA0B;IAC5B,IAAI,IAAO;KAAE,UAAU,CAAC;KAAG,OAAO;IAAK;IACvC,EAAQ,UAAU;GACpB,OAAO,IAAO,EAAQ;GACtB,IAAU,EACR,WAAY;IACV,SAAS,EAAiB,GAAc;KACtC,IAAI,CAAC,GAAS;MAIZ,IAHA,IAAU,CAAC,GACX,IAAmB,GACnB,IAAe,EAAS,CAAY,GACrB,MAAX,KAAK,KAAiB,EAAK,UAAU;OACvC,IAAI,IAAmB,EAAK;OAC5B,IAAI,EAAQ,GAAkB,CAAY,GACxC,OAAQ,IAAoB;MAChC;MACA,OAAQ,IAAoB;KAC9B;KAEA,IADA,IAAmB,GACf,EAAS,GAAkB,CAAY,GACzC,OAAO;KACT,IAAI,IAAgB,EAAS,CAAY;KAIzC,OAHe,MAAX,KAAK,KAAiB,EAAQ,GAAkB,CAAa,KACvD,IAAmB,GAAe,MAC5C,IAAmB,GACX,IAAoB;IAC9B;IACA,IAAI,IAAU,CAAC,GACb,GACA,GACA,IACa,MAAX,KAAK,IAA0B,OAAO;IAC1C,OAAO,CACL,WAAY;KACV,OAAO,EAAiB,EAAY,CAAC;IACvC,GACS,MAAT,OACI,KAAK,IACL,WAAY;KACV,OAAO,EAAiB,EAAuB,CAAC;IAClD,CACN;GACF,GACA;IAAC;IAAa;IAAmB;IAAU;GAAO,CACpD;GACA,IAAI,IAAQ,EAAqB,GAAW,EAAQ,IAAI,EAAQ,EAAE;GASlE,OARA,EACE,WAAY;IAEV,AADA,EAAK,WAAW,CAAC,GACjB,EAAK,QAAQ;GACf,GACA,CAAC,CAAK,CACR,GACA,EAAc,CAAK,GACZ;EACT,GACgB,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,8BADxC,cAEA,+BAA+B,2BAA2B,MAAM,CAAC;CACrE,EAAA,CAAG"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_shim as n } from "../../shim/index.js";
|
|
3
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
|
|
4
|
-
var r = /* @__PURE__ */ e(((e) => {
|
|
5
|
-
var r = t("react"), i = n();
|
|
6
|
-
function a(e, t) {
|
|
7
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
8
|
-
}
|
|
9
|
-
var o = typeof Object.is == "function" ? Object.is : a, s = i.useSyncExternalStore, c = r.useRef, l = r.useEffect, u = r.useMemo, d = r.useDebugValue;
|
|
10
|
-
e.useSyncExternalStoreWithSelector = function(e, t, n, r, i) {
|
|
11
|
-
var a = c(null);
|
|
12
|
-
if (a.current === null) {
|
|
13
|
-
var f = {
|
|
14
|
-
hasValue: !1,
|
|
15
|
-
value: null
|
|
16
|
-
};
|
|
17
|
-
a.current = f;
|
|
18
|
-
} else f = a.current;
|
|
19
|
-
a = u(function() {
|
|
20
|
-
function e(e) {
|
|
21
|
-
if (!a) {
|
|
22
|
-
if (a = !0, s = e, e = r(e), i !== void 0 && f.hasValue) {
|
|
23
|
-
var t = f.value;
|
|
24
|
-
if (i(t, e)) return c = t;
|
|
25
|
-
}
|
|
26
|
-
return c = e;
|
|
27
|
-
}
|
|
28
|
-
if (t = c, o(s, e)) return t;
|
|
29
|
-
var n = r(e);
|
|
30
|
-
return i !== void 0 && i(t, n) ? (s = e, t) : (s = e, c = n);
|
|
31
|
-
}
|
|
32
|
-
var a = !1, s, c, l = n === void 0 ? null : n;
|
|
33
|
-
return [function() {
|
|
34
|
-
return e(t());
|
|
35
|
-
}, l === null ? void 0 : function() {
|
|
36
|
-
return e(l());
|
|
37
|
-
}];
|
|
38
|
-
}, [
|
|
39
|
-
t,
|
|
40
|
-
n,
|
|
41
|
-
r,
|
|
42
|
-
i
|
|
43
|
-
]);
|
|
44
|
-
var p = s(e, a[0], a[1]);
|
|
45
|
-
return l(function() {
|
|
46
|
-
f.hasValue = !0, f.value = p;
|
|
47
|
-
}, [p]), d(p), p;
|
|
48
|
-
};
|
|
49
|
-
}));
|
|
50
|
-
//#endregion
|
|
51
|
-
export default r();
|
|
52
|
-
export { r as require_with_selector_production };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=with-selector.production.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.production.js","names":[],"sources":["../../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n"],"x_google_ignoreList":[0],"mappings":";;;;CAWA,IAAI,IAAA,EAAgB,OAAO,GACzB,IAAA,EAAA;CACF,SAAS,EAAG,GAAG,GAAG;EAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;CACxE;CACA,IAAI,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GAC3D,IAAuB,EAAK,sBAC5B,IAAS,EAAM,QACf,IAAY,EAAM,WAClB,IAAU,EAAM,SAChB,IAAgB,EAAM;CACxB,EAAQ,mCAAmC,SACzC,GACA,GACA,GACA,GACA,GACA;EACA,IAAI,IAAU,EAAO,IAAI;EACzB,IAAa,EAAQ,YAAjB,MAA0B;GAC5B,IAAI,IAAO;IAAE,UAAU,CAAC;IAAG,OAAO;GAAK;GACvC,EAAQ,UAAU;EACpB,OAAO,IAAO,EAAQ;EACtB,IAAU,EACR,WAAY;GACV,SAAS,EAAiB,GAAc;IACtC,IAAI,CAAC,GAAS;KAIZ,IAHA,IAAU,CAAC,GACX,IAAmB,GACnB,IAAe,EAAS,CAAY,GACrB,MAAX,KAAK,KAAiB,EAAK,UAAU;MACvC,IAAI,IAAmB,EAAK;MAC5B,IAAI,EAAQ,GAAkB,CAAY,GACxC,OAAQ,IAAoB;KAChC;KACA,OAAQ,IAAoB;IAC9B;IAEA,IADA,IAAmB,GACf,EAAS,GAAkB,CAAY,GAAG,OAAO;IACrD,IAAI,IAAgB,EAAS,CAAY;IAIzC,OAHe,MAAX,KAAK,KAAiB,EAAQ,GAAkB,CAAa,KACvD,IAAmB,GAAe,MAC5C,IAAmB,GACX,IAAoB;GAC9B;GACA,IAAI,IAAU,CAAC,GACb,GACA,GACA,IACa,MAAX,KAAK,IAA0B,OAAO;GAC1C,OAAO,CACL,WAAY;IACV,OAAO,EAAiB,EAAY,CAAC;GACvC,GACS,MAAT,OACI,KAAK,IACL,WAAY;IACV,OAAO,EAAiB,EAAuB,CAAC;GAClD,CACN;EACF,GACA;GAAC;GAAa;GAAmB;GAAU;EAAO,CACpD;EACA,IAAI,IAAQ,EAAqB,GAAW,EAAQ,IAAI,EAAQ,EAAE;EASlE,OARA,EACE,WAAY;GAEV,AADA,EAAK,WAAW,CAAC,GACjB,EAAK,QAAQ;EACf,GACA,CAAC,CAAK,CACR,GACA,EAAc,CAAK,GACZ;CACT"}
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
3
|
-
var n = /* @__PURE__ */ e(((e) => {
|
|
4
|
-
process.env.NODE_ENV !== "production" && (function() {
|
|
5
|
-
function n(e, t) {
|
|
6
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
7
|
-
}
|
|
8
|
-
function r(e, t) {
|
|
9
|
-
f || o.startTransition === void 0 || (f = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
10
|
-
var n = t();
|
|
11
|
-
if (!p) {
|
|
12
|
-
var r = t();
|
|
13
|
-
s(n, r) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), p = !0);
|
|
14
|
-
}
|
|
15
|
-
r = c({ inst: {
|
|
16
|
-
value: n,
|
|
17
|
-
getSnapshot: t
|
|
18
|
-
} });
|
|
19
|
-
var a = r[0].inst, m = r[1];
|
|
20
|
-
return u(function() {
|
|
21
|
-
a.value = n, a.getSnapshot = t, i(a) && m({ inst: a });
|
|
22
|
-
}, [
|
|
23
|
-
e,
|
|
24
|
-
n,
|
|
25
|
-
t
|
|
26
|
-
]), l(function() {
|
|
27
|
-
return i(a) && m({ inst: a }), e(function() {
|
|
28
|
-
i(a) && m({ inst: a });
|
|
29
|
-
});
|
|
30
|
-
}, [e]), d(n), n;
|
|
31
|
-
}
|
|
32
|
-
function i(e) {
|
|
33
|
-
var t = e.getSnapshot;
|
|
34
|
-
e = e.value;
|
|
35
|
-
try {
|
|
36
|
-
var n = t();
|
|
37
|
-
return !s(e, n);
|
|
38
|
-
} catch {
|
|
39
|
-
return !0;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function a(e, t) {
|
|
43
|
-
return t();
|
|
44
|
-
}
|
|
45
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
46
|
-
var o = t("react"), s = typeof Object.is == "function" ? Object.is : n, c = o.useState, l = o.useEffect, u = o.useLayoutEffect, d = o.useDebugValue, f = !1, p = !1, m = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? a : r;
|
|
47
|
-
e.useSyncExternalStore = o.useSyncExternalStore === void 0 ? m : o.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
48
|
-
})();
|
|
49
|
-
}));
|
|
50
|
-
//#endregion
|
|
51
|
-
export default n();
|
|
52
|
-
export { n as require_use_sync_external_store_shim_development };
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=use-sync-external-store-shim.development.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.development.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n"],"x_google_ignoreList":[0],"mappings":";;;CAWA,AAAA,QAAA,IAAA,aAAA,iBACG,WAAY;EACX,SAAS,EAAG,GAAG,GAAG;GAChB,OAAQ,MAAM,MAAY,MAAN,KAAW,IAAI,KAAM,IAAI,MAAQ,MAAM,KAAK,MAAM;EACxE;EACA,SAAS,EAAuB,GAAW,GAAa;GACtD,KACa,EAAM,oBAAjB,KAAK,MACH,IAAoB,CAAC,GACvB,QAAQ,MACN,gMACF;GACF,IAAI,IAAQ,EAAY;GACxB,IAAI,CAAC,GAA4B;IAC/B,IAAI,IAAc,EAAY;IAC9B,EAAS,GAAO,CAAW,MACxB,QAAQ,MACP,sEACF,GACC,IAA6B,CAAC;GACnC;GACA,IAAc,EAAS,EACrB,MAAM;IAAS;IAAoB;GAAY,EACjD,CAAC;GACD,IAAI,IAAO,EAAY,EAAE,CAAC,MACxB,IAAc,EAAY;GAmB5B,OAlBA,EACE,WAAY;IAGV,AAFA,EAAK,QAAQ,GACb,EAAK,cAAc,GACnB,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC;GAC5D,GACA;IAAC;IAAW;IAAO;GAAW,CAChC,GACA,EACE,WAAY;IAEV,OADA,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC,GACnD,EAAU,WAAY;KAC3B,EAAuB,CAAI,KAAK,EAAY,EAAQ,QAAK,CAAC;IAC5D,CAAC;GACH,GACA,CAAC,CAAS,CACZ,GACA,EAAc,CAAK,GACZ;EACT;EACA,SAAS,EAAuB,GAAM;GACpC,IAAI,IAAoB,EAAK;GAC7B,IAAO,EAAK;GACZ,IAAI;IACF,IAAI,IAAY,EAAkB;IAClC,OAAO,CAAC,EAAS,GAAM,CAAS;GAClC,QAAgB;IACd,OAAO,CAAC;GACV;EACF;EACA,SAAS,EAAuB,GAAW,GAAa;GACtD,OAAO,EAAY;EACrB;EACA,AAAgB,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,+BADxC,cAEA,+BAA+B,4BAA4B,MAAM,CAAC;EACpE,IAAI,IAAA,EAAgB,OAAO,GACzB,IAA0B,OAAO,OAAO,MAA7B,aAAkC,OAAO,KAAK,GACzD,IAAW,EAAM,UACjB,IAAY,EAAM,WAClB,IAAkB,EAAM,iBACxB,IAAgB,EAAM,eACtB,IAAoB,CAAC,GACrB,IAA6B,CAAC,GAC9B,IACkB,OAAO,SAAvB,OACuB,OAAO,aAA9B,UACuB,OAAO,SAAS,kBAAvC,SACI,IACA;EAGR,AAFA,EAAQ,uBACK,EAAM,yBAAjB,KAAK,IAAgE,IAA7B,EAAM,sBAChC,OAAO,iCAAvB,OAEI,OAAO,+BAA+B,8BADxC,cAEA,+BAA+B,2BAA2B,MAAM,CAAC;CACrE,EAAA,CAAG"}
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e, __require as t } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
3
|
-
var n = /* @__PURE__ */ e(((e) => {
|
|
4
|
-
var n = t("react");
|
|
5
|
-
function r(e, t) {
|
|
6
|
-
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
7
|
-
}
|
|
8
|
-
var i = typeof Object.is == "function" ? Object.is : r, a = n.useState, o = n.useEffect, s = n.useLayoutEffect, c = n.useDebugValue;
|
|
9
|
-
function l(e, t) {
|
|
10
|
-
var n = t(), r = a({ inst: {
|
|
11
|
-
value: n,
|
|
12
|
-
getSnapshot: t
|
|
13
|
-
} }), i = r[0].inst, l = r[1];
|
|
14
|
-
return s(function() {
|
|
15
|
-
i.value = n, i.getSnapshot = t, u(i) && l({ inst: i });
|
|
16
|
-
}, [
|
|
17
|
-
e,
|
|
18
|
-
n,
|
|
19
|
-
t
|
|
20
|
-
]), o(function() {
|
|
21
|
-
return u(i) && l({ inst: i }), e(function() {
|
|
22
|
-
u(i) && l({ inst: i });
|
|
23
|
-
});
|
|
24
|
-
}, [e]), c(n), n;
|
|
25
|
-
}
|
|
26
|
-
function u(e) {
|
|
27
|
-
var t = e.getSnapshot;
|
|
28
|
-
e = e.value;
|
|
29
|
-
try {
|
|
30
|
-
var n = t();
|
|
31
|
-
return !i(e, n);
|
|
32
|
-
} catch {
|
|
33
|
-
return !0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function d(e, t) {
|
|
37
|
-
return t();
|
|
38
|
-
}
|
|
39
|
-
var f = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? d : l;
|
|
40
|
-
e.useSyncExternalStore = n.useSyncExternalStore === void 0 ? f : n.useSyncExternalStore;
|
|
41
|
-
}));
|
|
42
|
-
//#endregion
|
|
43
|
-
export default n();
|
|
44
|
-
export { n as require_use_sync_external_store_shim_production };
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=use-sync-external-store-shim.production.js.map
|
package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-sync-external-store-shim.production.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n"],"x_google_ignoreList":[0],"mappings":";;;CAWA,IAAI,IAAA,EAAgB,OAAO;CAC3B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own/runtime.js";
|
|
2
|
-
import { require_use_sync_external_store_shim_production as t } from "../cjs/use-sync-external-store-shim.production.js";
|
|
3
|
-
import { require_use_sync_external_store_shim_development as n } from "../cjs/use-sync-external-store-shim.development.js";
|
|
4
|
-
//#region node_modules/use-sync-external-store/shim/index.js
|
|
5
|
-
var r = /* @__PURE__ */ e(((e, r) => {
|
|
6
|
-
r.exports = process.env.NODE_ENV === "production" ? t() : n();
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default r();
|
|
10
|
-
export { r as require_shim };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/shim/index.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAEA,AAGE,EAAO,UAHT,QAAA,IAAA,aAA6B,eACpB,EAAA,IAEA,EAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin as e } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { require_with_selector_production as t } from "../cjs/use-sync-external-store-shim/with-selector.production.js";
|
|
3
|
-
import { require_with_selector_development as n } from "../cjs/use-sync-external-store-shim/with-selector.development.js";
|
|
4
|
-
//#region node_modules/use-sync-external-store/shim/with-selector.js
|
|
5
|
-
var r = /* @__PURE__ */ e(((e, r) => {
|
|
6
|
-
r.exports = process.env.NODE_ENV === "production" ? t() : n();
|
|
7
|
-
}));
|
|
8
|
-
//#endregion
|
|
9
|
-
export default r();
|
|
10
|
-
export { r as require_with_selector };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=with-selector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"with-selector.js","names":[],"sources":["../../../../node_modules/use-sync-external-store/shim/with-selector.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CAEA,AAGE,EAAO,UAHT,QAAA,IAAA,aAA6B,eACpB,EAAA,IAEA,EAAA"}
|