@atolis-hq/wake 0.4.81 → 0.4.82

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.
@@ -62,7 +62,7 @@ export function createTriggerApplications(root, now) {
62
62
  : new CronTriggerPolicy().nextOccurrence(definition.on.cron, asOf),
63
63
  pending: Object.values(view.coalesced)
64
64
  .filter((entry) => entry.coordinationKey === coordinationKey)
65
- .map((entry) => ({
65
+ .map(({ manualRequests: _manual, automaticRequests: _automatic, ...entry }) => ({
66
66
  ...entry,
67
67
  activeWorkItemId: activeInvocation?.activeWorkItemId ?? null,
68
68
  })),
@@ -124,6 +124,6 @@ export function resolveWakeVersion(options = {}) {
124
124
  return `g${headHash.slice(0, 7)}`;
125
125
  return '0.1.0-dev';
126
126
  }
127
- export const wakeVersion = "v0.4.81";
127
+ export const wakeVersion = "v0.4.82";
128
128
  /** The registry-installable version used by packaged sandbox images. */
129
129
  export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
@@ -32,6 +32,6 @@ export declare class TriggerDiagnostics {
32
32
  reason: "paused" | "own-scope" | "removed" | "dispatch-paused" | "capacity-unavailable" | "pending-source-limit";
33
33
  }[]>;
34
34
  record(triggerId: string, source: TriggerSource, reason: SkipReason): Promise<void>;
35
- ineligibleReason(view: TriggerView, id: string, config: TriggerConfig | undefined, configured: boolean, active?: boolean): Promise<SkipReason | undefined>;
35
+ ineligibleReason(view: TriggerView, id: string, config: TriggerConfig | undefined, configured: boolean, active?: boolean, manual?: boolean): Promise<SkipReason | undefined>;
36
36
  }
37
37
  export {};
@@ -22,17 +22,20 @@ export class TriggerDiagnostics {
22
22
  ].slice(-maximumTriggerDiagnostics),
23
23
  });
24
24
  }
25
- async ineligibleReason(view, id, config, configured, active = false) {
26
- if (view.pauses[id] !== undefined)
25
+ async ineligibleReason(view, id, config, configured, active = false, manual = false) {
26
+ if (!manual && view.pauses[id] !== undefined)
27
27
  return TriggerSkipReason.Paused;
28
28
  if (config === undefined || !configured)
29
29
  return TriggerSkipReason.Removed;
30
30
  if (await this.dependencies.isDispatchPaused())
31
31
  return TriggerSkipReason.DispatchPaused;
32
32
  if (!active &&
33
- config.when?.capacityAvailable === true &&
33
+ requiresCapacity(config, manual) &&
34
34
  !(await this.dependencies.capacityAvailable(config)))
35
35
  return TriggerSkipReason.Capacity;
36
36
  return undefined;
37
37
  }
38
38
  }
39
+ function requiresCapacity(config, manual) {
40
+ return manual || config.when?.capacityAvailable === true;
41
+ }
@@ -28,5 +28,7 @@ export declare function inspectTriggers(view: TriggerView, invocations: readonly
28
28
  requests: readonly import("../index.js").ControlEventPayloads["control-plane.trigger-request-recorded"][];
29
29
  coalesced: Readonly<Record<string, import("../index.js").ControlEventPayloads["control-plane.trigger-request-recorded"] & {
30
30
  readonly sources: readonly import("../index.js").TriggerSource[];
31
+ readonly manualRequests: readonly import("../index.js").ControlEventPayloads["control-plane.trigger-request-recorded"][];
32
+ readonly automaticRequests: readonly import("../index.js").ControlEventPayloads["control-plane.trigger-request-recorded"][];
31
33
  }>>;
32
34
  };
@@ -1,6 +1,6 @@
1
1
  import { ControlEventType, ManualTriggerDisposition, selectControlEvent, TriggerRequestDisposition, TriggerSourceKind, } from '../contracts/events.js';
2
2
  import { TriggerSkipReason } from '../contracts/trigger-diagnostics.js';
3
- import { consumedTriggerRequest, sourceIdentity } from './trigger-facts.js';
3
+ import { sourceIdentity } from './trigger-facts.js';
4
4
  import { maximumTriggerSources } from './trigger-projection.js';
5
5
  import { hasActiveInvocation } from './trigger-rules.js';
6
6
  export async function requestManualTrigger(ports, triggerId, context) {
@@ -17,7 +17,7 @@ export async function requestManualTrigger(ports, triggerId, context) {
17
17
  const view = await ports.view();
18
18
  const config = ports.config;
19
19
  const active = hasActiveInvocation(view, coordinationKey);
20
- const reason = (await ports.diagnostics.ineligibleReason(view, triggerId, config, config !== undefined, active)) ??
20
+ const reason = (await ports.diagnostics.ineligibleReason(view, triggerId, config, config !== undefined, active, true)) ??
21
21
  ((view.coalesced[coordinationKey]?.sources.length ?? 0) >= maximumTriggerSources
22
22
  ? TriggerSkipReason.PendingLimit
23
23
  : undefined);
@@ -55,7 +55,6 @@ async function recoverManualOutcome(ports, triggerId, context) {
55
55
  // Command identity survives changes to the configured coordination scope.
56
56
  let position = 0;
57
57
  let request;
58
- let pauseCleared = false;
59
58
  const latest = await ports.dependencies.journal.latestGlobalPosition();
60
59
  while (position < latest) {
61
60
  const batch = await ports.dependencies.journal.readAll(position, 256);
@@ -64,15 +63,12 @@ async function recoverManualOutcome(ports, triggerId, context) {
64
63
  for (const envelope of batch) {
65
64
  const event = selectControlEvent(envelope);
66
65
  request = matchingManualRequest(event, triggerId, context.commandId) ?? request;
67
- if (event?.event.eventType === ControlEventType.TriggerPaused &&
68
- event.event.payload.coordinationKey === request?.coordinationKey)
69
- pauseCleared = true;
70
66
  position = envelope.globalPosition;
71
67
  }
72
68
  }
73
- return resolvePausedRequest(ports, request, pauseCleared, context);
69
+ return resolveManualRequest(ports, request, context);
74
70
  }
75
- async function resolvePausedRequest(ports, request, pauseCleared, context) {
71
+ async function resolveManualRequest(ports, request, context) {
76
72
  if (request?.manualOutcome === undefined)
77
73
  return undefined;
78
74
  if (settledManualOutcome(request.manualOutcome))
@@ -80,8 +76,7 @@ async function resolvePausedRequest(ports, request, pauseCleared, context) {
80
76
  const history = await ports.dependencies.history();
81
77
  const invocation = history.find((invocation) => invocation.claim.triggerId === request.triggerId &&
82
78
  invocation.claim.sources.some((source) => sourceIdentity(source) === sourceIdentity(request.source)));
83
- if (request.manualOutcome.disposition === ManualTriggerDisposition.Coalesced &&
84
- (!pauseCleared || invocation !== undefined))
79
+ if (request.manualOutcome.disposition === ManualTriggerDisposition.Coalesced)
85
80
  return request.manualOutcome;
86
81
  if (invocation?.startedAt !== undefined) {
87
82
  const outcome = {
@@ -98,13 +93,7 @@ async function resolvePausedRequest(ports, request, pauseCleared, context) {
98
93
  }, context, 'trigger:result:' + request.triggerId + ':' + sourceIdentity(request.source));
99
94
  return outcome;
100
95
  }
101
- if (!pauseCleared || invocation !== undefined)
102
- return request.manualOutcome;
103
- // Pause clears unclaimed requests, but a committed claim still recovers normally.
104
- const fact = consumedTriggerRequest(request, TriggerSkipReason.Paused);
105
- await ports.emit(fact, context, 'trigger:consume:' + request.triggerId + ':' + sourceIdentity(request.source));
106
- await ports.diagnostics.record(request.triggerId, request.source, TriggerSkipReason.Paused);
107
- return { disposition: ManualTriggerDisposition.Skipped, reason: TriggerSkipReason.Paused };
96
+ return request.manualOutcome;
108
97
  }
109
98
  function matchingManualRequest(event, triggerId, commandId) {
110
99
  if (event?.event.eventType === ControlEventType.TriggerRequestRecorded &&
@@ -0,0 +1,16 @@
1
+ import type { CommandContext } from '@atolis-hq/eventing';
2
+ import type { TriggerConfig } from '../contracts/config.js';
3
+ import type { TriggerDiagnostics } from './trigger-diagnostics.js';
4
+ import { type TriggerFactInput } from './trigger-facts.js';
5
+ import type { TriggerView } from './trigger-projection.js';
6
+ import type { TriggerServiceDependencies } from './trigger-service-ports.js';
7
+ interface PendingTriggerPorts {
8
+ readonly dependencies: TriggerServiceDependencies;
9
+ readonly diagnostics: TriggerDiagnostics;
10
+ readonly view: () => Promise<TriggerView>;
11
+ readonly configured: (id: string) => TriggerConfig | undefined;
12
+ readonly emit: (input: TriggerFactInput, context: CommandContext, id: string) => Promise<void>;
13
+ readonly recover: (context: CommandContext) => Promise<void>;
14
+ }
15
+ export declare function advancePendingTriggers(ports: PendingTriggerPorts, context: CommandContext): Promise<void>;
16
+ export {};
@@ -0,0 +1,58 @@
1
+ import { ControlEventType, TriggerSourceKind } from '../contracts/events.js';
2
+ import { TriggerSkipReason } from '../contracts/trigger-diagnostics.js';
3
+ import { consumedTriggerRequest, sourceIdentity } from './trigger-facts.js';
4
+ import { hasActiveInvocation } from './trigger-rules.js';
5
+ export async function advancePendingTriggers(ports, context) {
6
+ const initial = await ports.view();
7
+ for (const first of Object.values(initial.coalesced)) {
8
+ if (hasActiveInvocation(initial, first.coordinationKey))
9
+ continue;
10
+ // Manual admission failures consume only the manual commands; automatic work is judged separately.
11
+ for (const manual of first.manualRequests) {
12
+ const manualConfig = ports.configured(manual.triggerId);
13
+ const manualReason = await ports.diagnostics.ineligibleReason(initial, manual.triggerId, manualConfig, manualConfig !== undefined, false, true);
14
+ if (manualReason !== undefined)
15
+ await consume(ports, manual, manualReason, context);
16
+ }
17
+ const view = await ports.view();
18
+ const request = view.coalesced[first.coordinationKey];
19
+ if (request === undefined)
20
+ continue;
21
+ const config = ports.configured(request.triggerId);
22
+ const identity = `trigger:${request.triggerId}:${sourceIdentity(request.source)}`;
23
+ const reason = await pendingSkipReason(ports, view, request);
24
+ if (reason !== undefined || config === undefined) {
25
+ // Record every manual command's terminal outcome before consuming the shared slot.
26
+ for (const pending of [...request.manualRequests, request])
27
+ await consume(ports, pending, reason ?? TriggerSkipReason.Removed, context);
28
+ continue;
29
+ }
30
+ await ports.emit({
31
+ eventType: ControlEventType.TriggerInvocationClaimed,
32
+ payload: {
33
+ triggerId: config.id,
34
+ coordinationKey: request.coordinationKey,
35
+ source: request.source,
36
+ sources: request.sources,
37
+ workItemId: ports.dependencies.ids.next('work'),
38
+ workflowInstanceId: `workflow-${encodeURIComponent(identity)}`,
39
+ workflowName: config.workflow,
40
+ },
41
+ }, context, `${identity}:claim`);
42
+ await ports.recover(context);
43
+ }
44
+ }
45
+ async function consume(ports, pending, reason, context) {
46
+ await ports.diagnostics.record(pending.triggerId, pending.source, reason);
47
+ await ports.emit(consumedTriggerRequest(pending, reason), context, `trigger:consume:${pending.triggerId}:${sourceIdentity(pending.source)}`);
48
+ }
49
+ async function pendingSkipReason(ports, view, request) {
50
+ // Sibling automatic occurrences cannot erase a manual command's admission controls.
51
+ for (const pending of [request, ...request.manualRequests]) {
52
+ const config = ports.configured(pending.triggerId);
53
+ const reason = await ports.diagnostics.ineligibleReason(view, pending.triggerId, config, config !== undefined, false, pending.source.kind === TriggerSourceKind.Manual);
54
+ if (reason !== undefined)
55
+ return reason;
56
+ }
57
+ return undefined;
58
+ }
@@ -17,6 +17,9 @@ export interface TriggerView {
17
17
  readonly requests: readonly ControlEventPayloads[typeof ControlEventType.TriggerRequestRecorded][];
18
18
  readonly coalesced: Readonly<Record<string, ControlEventPayloads[typeof ControlEventType.TriggerRequestRecorded] & {
19
19
  readonly sources: readonly TriggerSource[];
20
+ readonly manualRequests: readonly ControlEventPayloads[typeof ControlEventType.TriggerRequestRecorded][];
21
+ /** Lets a skipped manual command leave automatic work claimable under its own trigger. */
22
+ readonly automaticRequests: readonly ControlEventPayloads[typeof ControlEventType.TriggerRequestRecorded][];
20
23
  }>>;
21
24
  /** Operational projections contain only active claims; explicit service inspection includes history. */
22
25
  readonly invocations: readonly TriggerInvocationView[];
@@ -1,4 +1,4 @@
1
- import { ControlEventType, TriggerRequestDisposition, selectControlEvent, } from '../contracts/events.js';
1
+ import { ControlEventType, TriggerRequestDisposition, TriggerSourceKind, selectControlEvent, } from '../contracts/events.js';
2
2
  export const triggerProjectionName = 'control-plane-triggers';
3
3
  export const maximumTriggerSources = 64;
4
4
  export const triggerProjection = {
@@ -26,13 +26,7 @@ export const triggerProjection = {
26
26
  coalesced: request.disposition === TriggerRequestDisposition.Coalesced
27
27
  ? {
28
28
  ...previous.coalesced,
29
- [request.coordinationKey]: {
30
- ...request,
31
- sources: [
32
- ...(previous.coalesced[request.coordinationKey]?.sources ?? []),
33
- request.source,
34
- ].slice(0, maximumTriggerSources),
35
- },
29
+ [request.coordinationKey]: pendingRequest(previous, request),
36
30
  }
37
31
  : request.disposition === TriggerRequestDisposition.Started
38
32
  ? previous.coalesced
@@ -71,7 +65,7 @@ export const triggerProjection = {
71
65
  ...previous,
72
66
  pauses: { ...previous.pauses, [payload.triggerId]: payload.reason },
73
67
  invocations: pausedInvocations(previous, payload),
74
- coalesced: Object.fromEntries(Object.entries(previous.coalesced).filter(([key]) => key !== payload.coordinationKey)),
68
+ coalesced: pendingAfterPause(previous.coalesced, payload.coordinationKey),
75
69
  };
76
70
  }
77
71
  case ControlEventType.TriggerResumed: {
@@ -83,12 +77,43 @@ export const triggerProjection = {
83
77
  }
84
78
  },
85
79
  };
80
+ /** A manual head is consumed alone while other manual or automatic work is still queued. */
81
+ function consumesWholeRequest(pending, request) {
82
+ if (pending?.triggerId !== request.triggerId)
83
+ return false;
84
+ if (JSON.stringify(pending.source) !== JSON.stringify(request.source))
85
+ return false;
86
+ return (request.source.kind !== TriggerSourceKind.Manual ||
87
+ (pending.automaticRequests.length === 0 && pending.manualRequests.length <= 1));
88
+ }
86
89
  function withoutCoalesced(coalesced, request) {
87
90
  const key = request.coordinationKey;
88
91
  // An ineligible new occurrence does not discard another trigger's coalesced request.
89
- if (coalesced[key]?.triggerId !== request.triggerId ||
90
- JSON.stringify(coalesced[key]?.source) !== JSON.stringify(request.source))
91
- return coalesced;
92
+ if (!consumesWholeRequest(coalesced[key], request)) {
93
+ const pending = coalesced[key];
94
+ if (pending === undefined || request.source.kind !== TriggerSourceKind.Manual)
95
+ return coalesced;
96
+ const commandId = request.source.commandId;
97
+ const retained = pending.manualRequests.filter((manual) => manual.triggerId !== request.triggerId ||
98
+ manual.source.kind !== TriggerSourceKind.Manual ||
99
+ manual.source.commandId !== commandId);
100
+ if (retained.length === pending.manualRequests.length)
101
+ return coalesced;
102
+ // Skipping a manual command must not discard other queued work; the head stays pending work.
103
+ const head = pending.automaticRequests.at(-1) ?? retained.at(-1);
104
+ const removedHead = JSON.stringify(pending.source) === JSON.stringify(request.source);
105
+ return {
106
+ ...coalesced,
107
+ [key]: {
108
+ ...pending,
109
+ ...(removedHead && head !== undefined
110
+ ? { ...head, manualOutcome: head.manualOutcome }
111
+ : {}),
112
+ manualRequests: retained,
113
+ sources: pending.sources.filter((source) => source.kind !== TriggerSourceKind.Manual || source.commandId !== commandId),
114
+ },
115
+ };
116
+ }
92
117
  const { [key]: _, ...rest } = coalesced;
93
118
  return rest;
94
119
  }
@@ -98,3 +123,38 @@ function pausedInvocations(previous, payload) {
98
123
  ? { ...invocation, failureOutcomeCount: payload.outcomeCount }
99
124
  : invocation);
100
125
  }
126
+ function pendingRequest(previous, request) {
127
+ return {
128
+ ...request,
129
+ manualRequests: [
130
+ ...(previous.coalesced[request.coordinationKey]?.manualRequests ?? []),
131
+ ...(request.source.kind === TriggerSourceKind.Manual ? [request] : []),
132
+ ].slice(0, maximumTriggerSources),
133
+ automaticRequests: [
134
+ ...(previous.coalesced[request.coordinationKey]?.automaticRequests ?? []),
135
+ ...(request.source.kind === TriggerSourceKind.Manual ? [] : [request]),
136
+ ].slice(-maximumTriggerSources),
137
+ sources: [
138
+ ...(previous.coalesced[request.coordinationKey]?.sources ?? []),
139
+ request.source,
140
+ ].slice(0, maximumTriggerSources),
141
+ };
142
+ }
143
+ function pendingAfterPause(coalesced, coordinationKey) {
144
+ const request = coalesced[coordinationKey];
145
+ if (request === undefined)
146
+ return coalesced;
147
+ const { [coordinationKey]: _, ...rest } = coalesced;
148
+ const manualRequest = request.manualRequests.at(-1);
149
+ if (manualRequest === undefined)
150
+ return rest;
151
+ return {
152
+ ...rest,
153
+ [coordinationKey]: {
154
+ ...request,
155
+ ...manualRequest,
156
+ automaticRequests: [],
157
+ sources: request.sources.filter((source) => source.kind === TriggerSourceKind.Manual),
158
+ },
159
+ };
160
+ }
@@ -32,7 +32,7 @@ export async function recoverTriggerInvocation(dependencies, invocation, context
32
32
  return;
33
33
  if (exhaustedFailures(instance) &&
34
34
  invocation.failureOutcomeCount !== instance.acceptedOutcomes.length) {
35
- // Retrying remains an explicit workflow command; an operator must resume the trigger.
35
+ // Workflow retries remain explicit; pause suppresses subsequent automatic sources.
36
36
  await dependencies.emit({
37
37
  eventType: ControlEventType.TriggerPaused,
38
38
  payload: {
@@ -3,9 +3,10 @@ import { ControlEventType, TriggerRequestDisposition, TriggerSourceKind, } from
3
3
  import { TriggerSkipReason } from '../contracts/trigger-diagnostics.js';
4
4
  import { CronTriggerPolicy } from '../domain/cron-trigger-policy.js';
5
5
  import { TriggerDiagnostics } from './trigger-diagnostics.js';
6
- import { appendTriggerFact, consumedTriggerRequest, hasTriggerRequest, sourceIdentity, } from './trigger-facts.js';
6
+ import { appendTriggerFact, hasTriggerRequest, sourceIdentity, } from './trigger-facts.js';
7
7
  import { inspectTriggers } from './trigger-inspection.js';
8
8
  import { requestManualTrigger } from './trigger-manual-request.js';
9
+ import { advancePendingTriggers } from './trigger-pending.js';
9
10
  import { maximumTriggerSources } from './trigger-projection.js';
10
11
  import { recoverTriggerInvocation } from './trigger-recovery.js';
11
12
  import { hasActiveInvocation, isOwnScopeSource } from './trigger-rules.js';
@@ -165,33 +166,14 @@ export class TriggerService {
165
166
  return eligible;
166
167
  }
167
168
  async advanceCoalesced(context) {
168
- const view = await this.reader.get();
169
- for (const request of Object.values(view.coalesced)) {
170
- if (hasActiveInvocation(view, request.coordinationKey))
171
- continue;
172
- const config = this.configured(request.triggerId);
173
- const identity = `trigger:${request.triggerId}:${sourceIdentity(request.source)}`;
174
- const reason = await this.diagnostics.ineligibleReason(view, request.triggerId, config, config !== undefined);
175
- if (reason !== undefined || config === undefined) {
176
- await this.diagnostics.record(request.triggerId, request.source, reason ?? TriggerSkipReason.Removed);
177
- // This recorded request was reconsidered and consumed; later eligibility is not a source.
178
- await this.emit(consumedTriggerRequest(request, reason ?? TriggerSkipReason.Removed), context, `trigger:consume:${request.triggerId}:${sourceIdentity(request.source)}`);
179
- continue;
180
- }
181
- await this.emit({
182
- eventType: ControlEventType.TriggerInvocationClaimed,
183
- payload: {
184
- triggerId: config.id,
185
- coordinationKey: request.coordinationKey,
186
- source: request.source,
187
- sources: request.sources,
188
- workItemId: this.dependencies.ids.next('work'),
189
- workflowInstanceId: `workflow-${encodeURIComponent(identity)}`,
190
- workflowName: config.workflow,
191
- },
192
- }, context, `${identity}:claim`);
193
- await this.recover(context);
194
- }
169
+ await advancePendingTriggers({
170
+ dependencies: this.dependencies,
171
+ diagnostics: this.diagnostics,
172
+ view: () => this.reader.get(),
173
+ configured: (id) => this.configured(id),
174
+ emit: (input, command, id) => this.emit(input, command, id),
175
+ recover: (command) => this.recover(command),
176
+ }, context);
195
177
  }
196
178
  async recover(context) {
197
179
  for (const invocation of (await this.reader.get()).invocations) {
@@ -31,7 +31,7 @@ export interface TriggerResponse {
31
31
  readonly paused: boolean;
32
32
  readonly pauseReason: string | null;
33
33
  readonly nextOccurrence: string | null;
34
- readonly pending: readonly (TriggerView['coalesced'][string] & {
34
+ readonly pending: readonly (Omit<TriggerView['coalesced'][string], 'manualRequests' | 'automaticRequests'> & {
35
35
  readonly activeWorkItemId: string | null;
36
36
  })[];
37
37
  readonly latestSkip: TriggerSkipDiagnostic | null;
@@ -71,7 +71,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
71
71
 
72
72
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ea,s=!zi.jitless,c=s&&ta.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?bs([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Cs(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ha(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ya(e,r,Bi())))}),t)}var ws=Ii(`$ZodUnion`,(e,t)=>{Lo.init(e,t),Ji(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Ji(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ji(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ji(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Gi(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Cs(t,r,e,i)):Cs(o,r,e,i)}}),Ts=Ii(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ws.init(e,t);let n=e._zod.parse;Ji(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Ui(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ea(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Es=Ii(`$ZodIntersection`,(e,t)=>{Lo.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Os(e,t,n)):Os(e,i,a)}});function Ds(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(na(e)&&na(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ds(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ds(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Os(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ha(e))return e;let o=Ds(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var ks=Ii(`$ZodEnum`,(e,t)=>{Lo.init(e,t);let n=Vi(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ia.has(typeof e)).map(e=>typeof e==`string`?aa(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),As=Ii(`$ZodLiteral`,(e,t)=>{if(Lo.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?aa(e):e?aa(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),js=Ii(`$ZodTransform`,(e,t)=>{Lo.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ri(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Li;return n.value=i,n.fallback=!0,n}});function Ms(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ns=Ii(`$ZodOptional`,(e,t)=>{Lo.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Ji(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ji(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Gi(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Ms(e,r)):Ms(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ps=Ii(`$ZodExactOptional`,(e,t)=>{Ns.init(e,t),Ji(e._zod,`values`,()=>t.innerType._zod.values),Ji(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Fs=Ii(`$ZodNullable`,(e,t)=>{Lo.init(e,t),Ji(e._zod,`optin`,()=>t.innerType._zod.optin),Ji(e._zod,`optout`,()=>t.innerType._zod.optout),Ji(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Gi(e.source)}|null)$`):void 0}),Ji(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Is=Ii(`$ZodDefault`,(e,t)=>{Lo.init(e,t),e._zod.optin=`optional`,Ji(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ls(e,t)):Ls(r,t)}});function Ls(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Rs=Ii(`$ZodPrefault`,(e,t)=>{Lo.init(e,t),e._zod.optin=`optional`,Ji(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),zs=Ii(`$ZodNonOptional`,(e,t)=>{Lo.init(e,t),Ji(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Bs(t,e)):Bs(i,e)}});function Bs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Vs=Ii(`$ZodCatch`,(e,t)=>{Lo.init(e,t),e._zod.optin=`optional`,Ji(e._zod,`optout`,()=>t.innerType._zod.optout),Ji(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ya(e,n,Bi()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ya(e,n,Bi()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Hs=Ii(`$ZodPipe`,(e,t)=>{Lo.init(e,t),Ji(e._zod,`values`,()=>t.in._zod.values),Ji(e._zod,`optin`,()=>t.in._zod.optin),Ji(e._zod,`optout`,()=>t.out._zod.optout),Ji(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Us(e,t.in,n)):Us(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Us(e,t.out,n)):Us(r,t.out,n)}});function Us(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Ws=Ii(`$ZodReadonly`,(e,t)=>{Lo.init(e,t),Ji(e._zod,`propValues`,()=>t.innerType._zod.propValues),Ji(e._zod,`values`,()=>t.innerType._zod.values),Ji(e._zod,`optin`,()=>t.innerType?._zod?.optin),Ji(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Gs):Gs(r)}});function Gs(e){return e.value=Object.freeze(e.value),e}var Ks=Ii(`$ZodCustom`,(e,t)=>{yo.init(e,t),Lo.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>qs(t,n,r,e));qs(i,n,r,e)}});function qs(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xa(e))}}var Js,Ys=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Xs(){return new Ys}(Js=globalThis).__zod_globalRegistry??(Js.__zod_globalRegistry=Xs());var Zs=globalThis.__zod_globalRegistry;function Qs(e,t){return new e({type:`string`,...sa(t)})}function $s(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...sa(t)})}function ec(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...sa(t)})}function tc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...sa(t)})}function nc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...sa(t)})}function rc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...sa(t)})}function ic(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...sa(t)})}function ac(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...sa(t)})}function oc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...sa(t)})}function sc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...sa(t)})}function cc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...sa(t)})}function lc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...sa(t)})}function uc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...sa(t)})}function dc(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...sa(t)})}function fc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...sa(t)})}function pc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...sa(t)})}function mc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...sa(t)})}function hc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...sa(t)})}function gc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...sa(t)})}function _c(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...sa(t)})}function vc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...sa(t)})}function yc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...sa(t)})}function bc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...sa(t)})}function xc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...sa(t)})}function lee(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...sa(t)})}function Sc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...sa(t)})}function Cc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...sa(t)})}function wc(e,t){return new e({type:`number`,checks:[],...sa(t)})}function Tc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...sa(t)})}function Ec(e,t){return new e({type:`boolean`,...sa(t)})}function Dc(e){return new e({type:`unknown`})}function Oc(e,t){return new e({type:`never`,...sa(t)})}function kc(e,t){return new xo({check:`less_than`,...sa(t),value:e,inclusive:!1})}function Ac(e,t){return new xo({check:`less_than`,...sa(t),value:e,inclusive:!0})}function jc(e,t){return new So({check:`greater_than`,...sa(t),value:e,inclusive:!1})}function Mc(e,t){return new So({check:`greater_than`,...sa(t),value:e,inclusive:!0})}function Nc(e,t){return new Co({check:`multiple_of`,...sa(t),value:e})}function Pc(e,t){return new To({check:`max_length`,...sa(t),maximum:e})}function Fc(e,t){return new Eo({check:`min_length`,...sa(t),minimum:e})}function Ic(e,t){return new Do({check:`length_equals`,...sa(t),length:e})}function Lc(e,t){return new ko({check:`string_format`,format:`regex`,...sa(t),pattern:e})}function Rc(e){return new Ao({check:`string_format`,format:`lowercase`,...sa(e)})}function zc(e){return new jo({check:`string_format`,format:`uppercase`,...sa(e)})}function Bc(e,t){return new Mo({check:`string_format`,format:`includes`,...sa(t),includes:e})}function Vc(e,t){return new No({check:`string_format`,format:`starts_with`,...sa(t),prefix:e})}function Hc(e,t){return new Po({check:`string_format`,format:`ends_with`,...sa(t),suffix:e})}function Uc(e){return new Fo({check:`overwrite`,tx:e})}function Wc(e){return Uc(t=>t.normalize(e))}function Gc(){return Uc(e=>e.trim())}function Kc(){return Uc(e=>e.toLowerCase())}function qc(){return Uc(e=>e.toUpperCase())}function Jc(){return Uc(e=>Qi(e))}function Yc(e,t,n){return new e({type:`array`,element:t,...sa(n)})}function Xc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...sa(n)})}function Zc(e,t){let n=Qc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(xa(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(xa(r))}},e(t.value,t)),t);return n}function Qc(e,t){let n=new yo({check:`custom`,...sa(t)});return n._zod.check=e,n}function $c(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Zs,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function el(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,el(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&rl(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function tl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
73
73
 
74
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function nl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:al(t,`input`,e.processors),output:al(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function rl(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return rl(r.element,n);if(r.type===`set`)return rl(r.valueType,n);if(r.type===`lazy`)return rl(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return rl(r.innerType,n);if(r.type===`intersection`)return rl(r.left,n)||rl(r.right,n);if(r.type===`record`||r.type===`map`)return rl(r.keyType,n)||rl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:rl(r.in,n)||rl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(rl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(rl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(rl(e,n))return!0;return!!(r.rest&&rl(r.rest,n))}return!1}var il=(e,t={})=>n=>{let r=$c({...n,processors:t});return el(e,r),tl(r,e),nl(r,e)},al=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$c({...i??{},target:a,io:t,processors:n});return el(e,o),tl(o,e),nl(o,e)},ol={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},sl=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ol[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},cl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ll=(e,t,n,r)=>{n.type=`boolean`},ul=(e,t,n,r)=>{n.not={}},dl=(e,t,n,r)=>{let i=e._zod.def,a=Vi(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},fl=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},pl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ml=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},hl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=el(a.element,t,{...r,path:[...r.path,`items`]})},gl=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=el(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=el(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},_l=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>el(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},vl=(e,t,n,r)=>{let i=e._zod.def,a=el(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=el(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},yl=(e,t,n,r)=>{let i=e._zod.def,a=el(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},bl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Sl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Cl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},wl=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;el(o,t,r);let s=t.seen.get(e);s.ref=o},Tl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},El=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Dl=Ii(`ZodISODateTime`,(e,t)=>{Zo.init(e,t),eu.init(e,t)});function Ol(e){return xc(Dl,e)}var kl=Ii(`ZodISODate`,(e,t)=>{Qo.init(e,t),eu.init(e,t)});function Al(e){return lee(kl,e)}var jl=Ii(`ZodISOTime`,(e,t)=>{$o.init(e,t),eu.init(e,t)});function Ml(e){return Sc(jl,e)}var Nl=Ii(`ZodISODuration`,(e,t)=>{es.init(e,t),eu.init(e,t)});function Pl(e){return Cc(Nl,e)}var Fl=Ii(`ZodError`,(e,t)=>{Ca.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ea(e,t)},flatten:{value:t=>Ta(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Hi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Hi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Il=Da(Fl),Ll=Oa(Fl),Rl=ka(Fl),zl=ja(Fl),Bl=Na(Fl),Vl=Pa(Fl),Hl=Fa(Fl),Ul=Ia(Fl),Wl=La(Fl),Gl=Ra(Fl),Kl=za(Fl),ql=Ba(Fl),Jl=new WeakMap;function Yl(e,t,n){let r=Object.getPrototypeOf(e),i=Jl.get(r);if(i||(i=new Set,Jl.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Xl=Ii(`ZodType`,(e,t)=>(Lo.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:al(e,`input`),output:al(e,`output`)}}),e.toJSONSchema=il(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Il(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Rl(e,t,n),e.parseAsync=async(t,n)=>Ll(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>zl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Bl(e,t,n),e.decode=(t,n)=>Vl(e,t,n),e.encodeAsync=async(t,n)=>Hl(e,t,n),e.decodeAsync=async(t,n)=>Ul(e,t,n),e.safeEncode=(t,n)=>Wl(e,t,n),e.safeDecode=(t,n)=>Gl(e,t,n),e.safeEncodeAsync=async(t,n)=>Kl(e,t,n),e.safeDecodeAsync=async(t,n)=>ql(e,t,n),Yl(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Xi(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return oa(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fee(e,t))},superRefine(e,t){return this.check(pee(e,t))},overwrite(e){return this.check(Uc(e))},optional(){return qu(this)},exactOptional(){return Yu(this)},nullable(){return Zu(this)},nullish(){return qu(Zu(this))},nonoptional(e){return rd(this,e)},array(){return ju(this)},or(e){return Fu([this,e])},and(e){return zu(this,e)},transform(e){return sd(this,Gu(e))},default(e){return $u(this,e)},prefault(e){return td(this,e)},catch(e){return ad(this,e)},pipe(e){return sd(this,e)},readonly(){return cd(this)},describe(e){let t=this.clone();return Zs.add(t,{description:e}),t},meta(...e){if(e.length===0)return Zs.get(this);let t=this.clone();return Zs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Zs.get(e)?.description},configurable:!0}),e)),Zl=Ii(`_ZodString`,(e,t)=>{Ro.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Yl(e,`_ZodString`,{regex(...e){return this.check(Lc(...e))},includes(...e){return this.check(Bc(...e))},startsWith(...e){return this.check(Vc(...e))},endsWith(...e){return this.check(Hc(...e))},min(...e){return this.check(Fc(...e))},max(...e){return this.check(Pc(...e))},length(...e){return this.check(Ic(...e))},nonempty(...e){return this.check(Fc(1,...e))},lowercase(e){return this.check(Rc(e))},uppercase(e){return this.check(zc(e))},trim(){return this.check(Gc())},normalize(...e){return this.check(Wc(...e))},toLowerCase(){return this.check(Kc())},toUpperCase(){return this.check(qc())},slugify(){return this.check(Jc())}})}),Ql=Ii(`ZodString`,(e,t)=>{Ro.init(e,t),Zl.init(e,t),e.email=t=>e.check($s(tu,t)),e.url=t=>e.check(ac(iu,t)),e.jwt=t=>e.check(bc(yu,t)),e.emoji=t=>e.check(oc(au,t)),e.guid=t=>e.check(ec(nu,t)),e.uuid=t=>e.check(tc(ru,t)),e.uuidv4=t=>e.check(nc(ru,t)),e.uuidv6=t=>e.check(rc(ru,t)),e.uuidv7=t=>e.check(ic(ru,t)),e.nanoid=t=>e.check(sc(ou,t)),e.guid=t=>e.check(ec(nu,t)),e.cuid=t=>e.check(cc(su,t)),e.cuid2=t=>e.check(lc(cu,t)),e.ulid=t=>e.check(uc(lu,t)),e.base64=t=>e.check(_c(gu,t)),e.base64url=t=>e.check(vc(_u,t)),e.xid=t=>e.check(dc(uu,t)),e.ksuid=t=>e.check(fc(du,t)),e.ipv4=t=>e.check(pc(fu,t)),e.ipv6=t=>e.check(mc(pu,t)),e.cidrv4=t=>e.check(hc(mu,t)),e.cidrv6=t=>e.check(gc(hu,t)),e.e164=t=>e.check(yc(vu,t)),e.datetime=t=>e.check(Ol(t)),e.date=t=>e.check(Al(t)),e.time=t=>e.check(Ml(t)),e.duration=t=>e.check(Pl(t))});function $l(e){return Qs(Ql,e)}var eu=Ii(`ZodStringFormat`,(e,t)=>{zo.init(e,t),Zl.init(e,t)}),tu=Ii(`ZodEmail`,(e,t)=>{Ho.init(e,t),eu.init(e,t)}),nu=Ii(`ZodGUID`,(e,t)=>{Bo.init(e,t),eu.init(e,t)}),ru=Ii(`ZodUUID`,(e,t)=>{Vo.init(e,t),eu.init(e,t)}),iu=Ii(`ZodURL`,(e,t)=>{Uo.init(e,t),eu.init(e,t)}),au=Ii(`ZodEmoji`,(e,t)=>{Wo.init(e,t),eu.init(e,t)}),ou=Ii(`ZodNanoID`,(e,t)=>{Go.init(e,t),eu.init(e,t)}),su=Ii(`ZodCUID`,(e,t)=>{Ko.init(e,t),eu.init(e,t)}),cu=Ii(`ZodCUID2`,(e,t)=>{qo.init(e,t),eu.init(e,t)}),lu=Ii(`ZodULID`,(e,t)=>{Jo.init(e,t),eu.init(e,t)}),uu=Ii(`ZodXID`,(e,t)=>{Yo.init(e,t),eu.init(e,t)}),du=Ii(`ZodKSUID`,(e,t)=>{Xo.init(e,t),eu.init(e,t)}),fu=Ii(`ZodIPv4`,(e,t)=>{ts.init(e,t),eu.init(e,t)}),pu=Ii(`ZodIPv6`,(e,t)=>{ns.init(e,t),eu.init(e,t)}),mu=Ii(`ZodCIDRv4`,(e,t)=>{rs.init(e,t),eu.init(e,t)}),hu=Ii(`ZodCIDRv6`,(e,t)=>{is.init(e,t),eu.init(e,t)}),gu=Ii(`ZodBase64`,(e,t)=>{os.init(e,t),eu.init(e,t)}),_u=Ii(`ZodBase64URL`,(e,t)=>{cs.init(e,t),eu.init(e,t)}),vu=Ii(`ZodE164`,(e,t)=>{ls.init(e,t),eu.init(e,t)}),yu=Ii(`ZodJWT`,(e,t)=>{ds.init(e,t),eu.init(e,t)}),bu=Ii(`ZodNumber`,(e,t)=>{fs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r),Yl(e,`ZodNumber`,{gt(e,t){return this.check(jc(e,t))},gte(e,t){return this.check(Mc(e,t))},min(e,t){return this.check(Mc(e,t))},lt(e,t){return this.check(kc(e,t))},lte(e,t){return this.check(Ac(e,t))},max(e,t){return this.check(Ac(e,t))},int(e){return this.check(Cu(e))},safe(e){return this.check(Cu(e))},positive(e){return this.check(jc(0,e))},nonnegative(e){return this.check(Mc(0,e))},negative(e){return this.check(kc(0,e))},nonpositive(e){return this.check(Ac(0,e))},multipleOf(e,t){return this.check(Nc(e,t))},step(e,t){return this.check(Nc(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function xu(e){return wc(bu,e)}var Su=Ii(`ZodNumberFormat`,(e,t)=>{cee.init(e,t),bu.init(e,t)});function Cu(e){return Tc(Su,e)}var wu=Ii(`ZodBoolean`,(e,t)=>{ps.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r)});function Tu(e){return Ec(wu,e)}var Eu=Ii(`ZodUnknown`,(e,t)=>{ms.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Du(){return Dc(Eu)}var Ou=Ii(`ZodNever`,(e,t)=>{hs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ul(e,t,n,r)});function ku(e){return Oc(Ou,e)}var Au=Ii(`ZodArray`,(e,t)=>{_s.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hl(e,t,n,r),e.element=t.element,Yl(e,`ZodArray`,{min(e,t){return this.check(Fc(e,t))},nonempty(e){return this.check(Fc(1,e))},max(e,t){return this.check(Pc(e,t))},length(e,t){return this.check(Ic(e,t))},unwrap(){return this.element}})});function ju(e,t){return Yc(Au,e,t)}var Mu=Ii(`ZodObject`,(e,t)=>{Ss.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gl(e,t,n,r),Ji(e,`shape`,()=>t.shape),Yl(e,`ZodObject`,{keyof(){return Vu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Du()})},loose(){return this.clone({...this._zod.def,catchall:Du()})},strict(){return this.clone({...this._zod.def,catchall:ku()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return fa(this,e)},safeExtend(e){return aee(this,e)},merge(e){return oee(this,e)},pick(e){return ua(this,e)},omit(e){return da(this,e)},partial(...e){return pa(Ku,this,e[0])},required(...e){return ma(nd,this,e[0])}})});function Nu(e,t){return new Mu({type:`object`,shape:e??{},...sa(t)})}var Pu=Ii(`ZodUnion`,(e,t)=>{ws.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r),e.options=t.options});function Fu(e,t){return new Pu({type:`union`,options:e,...sa(t)})}var Iu=Ii(`ZodDiscriminatedUnion`,(e,t)=>{Pu.init(e,t),Ts.init(e,t)});function Lu(e,t,n){return new Iu({type:`union`,options:t,discriminator:e,...sa(n)})}var Ru=Ii(`ZodIntersection`,(e,t)=>{Es.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r)});function zu(e,t){return new Ru({type:`intersection`,left:e,right:t})}var Bu=Ii(`ZodEnum`,(e,t)=>{ks.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dl(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Bu({...t,checks:[],...sa(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Bu({...t,checks:[],...sa(r),entries:i})}});function Vu(e,t){return new Bu({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...sa(t)})}var Hu=Ii(`ZodLiteral`,(e,t)=>{As.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fl(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Uu(e,t){return new Hu({type:`literal`,values:Array.isArray(e)?e:[e],...sa(t)})}var Wu=Ii(`ZodTransform`,(e,t)=>{js.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ml(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ri(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xa(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xa(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Gu(e){return new Wu({type:`transform`,transform:e})}var Ku=Ii(`ZodOptional`,(e,t)=>{Ns.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qu(e){return new Ku({type:`optional`,innerType:e})}var Ju=Ii(`ZodExactOptional`,(e,t)=>{Ps.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yu(e){return new Ju({type:`optional`,innerType:e})}var Xu=Ii(`ZodNullable`,(e,t)=>{Fs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zu(e){return new Xu({type:`nullable`,innerType:e})}var Qu=Ii(`ZodDefault`,(e,t)=>{Is.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $u(e,t){return new Qu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ra(t)}})}var ed=Ii(`ZodPrefault`,(e,t)=>{Rs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function td(e,t){return new ed({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ra(t)}})}var nd=Ii(`ZodNonOptional`,(e,t)=>{zs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rd(e,t){return new nd({type:`nonoptional`,innerType:e,...sa(t)})}var id=Ii(`ZodCatch`,(e,t)=>{Vs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ad(e,t){return new id({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var od=Ii(`ZodPipe`,(e,t)=>{Hs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.in=t.in,e.out=t.out});function sd(e,t){return new od({type:`pipe`,in:e,out:t})}var uee=Ii(`ZodReadonly`,(e,t)=>{Ws.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cd(e){return new uee({type:`readonly`,innerType:e})}var dee=Ii(`ZodCustom`,(e,t)=>{Ks.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pl(e,t,n,r)});function fee(e,t={}){return Xc(dee,e,t)}function pee(e,t){return Zc(e,t)}var ld=e=>e,ud=ld({Day:`1d`,ThreeDays:`3d`,FiveDays:`5d`,Week:`7d`}),dd=Object.keys({accepted:!0,completed:!0}),fd={Accepted:dd[0],Completed:dd[1]},pd={Active:Object.keys({active:!0})[0]},md={Adapter:Object.keys({adapter:!0})[0]},hd=Object.keys({failed:!0,succeeded:!0}),gd={Failed:hd[0],Succeeded:hd[1]},_d=Object.keys({starting:!0,started:!0}),vd={Starting:_d[0],Started:_d[1]},yd=ld({Waiting:`waiting`,Done:`done`,Rejected:`rejected`,Blocked:`blocked`,Failed:`failed`}),bd=Object.keys({ready:!0,active:!0,"needs-input":!0,error:!0,finished:!0}),xd={Ready:bd[0],Active:bd[1],NeedsInput:bd[2],Error:bd[3],Finished:bd[4]};Object.keys({stage:!0})[0];var Sd=Object.keys({input:!0,agent:!0}),Cd={Input:Sd[0],Agent:Sd[1]},wd=Object.keys({session:!0,run:!0}),Td={Session:wd[0],Run:wd[1]},Ed={Event:`event`,Cron:`cron`,Manual:`manual`},Dd={started:!0},Od={Started:Object.keys(Dd)[0],Coalesced:`coalesced`,Skipped:`skipped`},kd={OwnScope:`own-scope`,Paused:`paused`,Removed:`removed`,DispatchPaused:`dispatch-paused`,Capacity:`capacity-unavailable`,PendingLimit:`pending-source-limit`},Ad=Object.keys({completed:!0,superseded:!0}),jd={Completed:Ad[0],Superseded:Ad[1]},Md={Started:Object.keys(Dd)[0],Coalesced:Od.Coalesced,Skipped:Od.Skipped},Nd=Object.keys({pause:!0,resume:!0,run:!0}),Pd={Pause:Nd[0],Resume:Nd[1],Run:Nd[2]},Fd=ld({Active:`active`,Waiting:`waiting`,Completed:`completed`,Blocked:`blocked`,Superseded:`superseded`}),Id=Object.keys({"execution-recovery-ambiguous:":!0})[0];function Ld(e){return e?.startsWith(Id)===!0||e!==void 0&&/^run-ambiguous-after-\d+-attempts$/.test(e)}var Rd=xd,zd=ld({Unknown:`unknown`}),Bd=Object.keys({enabled:!0,paused:!0,running:!0,removed:!0}),Vd={Enabled:Bd[0],Paused:Bd[1],Running:Bd[2],Removed:Bd[3]},Hd=Object.keys({pause:!0,resume:!0,run:!0});Hd[0],Hd[1],Hd[2];var Ud=Object.keys({activity:!0,watch:!0,"watch-gate":!0,reactor:!0}),Wd={Activity:Ud[0],Watch:Ud[1],WatchGate:Ud[2],Reactor:Ud[3]},Gd=Lu(`kind`,[Nu({kind:Uu(Ed.Manual),commandId:$l(),operator:$l()}),Nu({kind:Uu(Ed.Cron),slot:$l()}),Nu({kind:Uu(Ed.Event),eventId:$l(),eventType:$l()})]),Kd=Nu({triggerId:$l(),source:Gd,occurredAt:$l(),reason:Vu(kd)}),qd=Nu({id:$l(),workflow:$l(),contextScope:$l().optional(),on:Nu({cron:$l().optional(),events:ju($l()).optional()}),when:Nu({capacityAvailable:Uu(!0)}).optional()}),Jd=Lu(`disposition`,[Nu({disposition:Uu(Md.Started),workItemId:$l().optional()}),Nu({disposition:Uu(Md.Coalesced),activeWorkItemId:$l().optional()}),Nu({disposition:Uu(Md.Skipped),reason:Vu(kd)})]),Yd=Object.keys({stage:!0})[0];function Xd(e){return(t,n=``)=>{let r=Si(t,n);return{data:e(r.data,Mi(n,`data`)),meta:xi(r.meta,Mi(n,`meta`))}}}function Zd(e){return(t,n=``)=>{let r=Si(t,n),i=Si(r.page,Mi(n,`page`));return{items:Ci(r.items,Mi(n,`items`),e),page:{nextCursor:Ti(i.nextCursor,Mi(n,`page.nextCursor`)),hasMore:Ei(i.hasMore,Mi(n,`page.hasMore`)),...ki(i,`total`,Mi(n,`page`))},meta:xi(r.meta,Mi(n,`meta`))}}}var Qd=(e,t=``)=>{let n=Si(e,t);return{dispatchPaused:Ei(n.dispatchPaused,Mi(t,`dispatchPaused`)),...Oi(n,`dispatchPausedUntil`,t),...Oi(n,`dispatchPauseReason`,t),updatedAt:wi(n.updatedAt,Mi(t,`updatedAt`)),...n.maintenanceLease===void 0?{}:{maintenanceLease:$d(n.maintenanceLease,Mi(t,`maintenanceLease`))}}};function $d(e,t){let n=Si(e,t);return{attemptId:wi(n.attemptId,Mi(t,`attemptId`)),phase:wi(n.phase,Mi(t,`phase`)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),...Oi(n,`failure`,t)}}var ef=(e,t=``)=>{let n=Si(e,t),r=wi(n.status,Mi(t,`status`));return r!==fd.Accepted&&r!==fd.Completed&&Ni(Mi(t,`status`)),{...n.triggerOutcome===void 0?{}:{triggerOutcome:Jd.parse(n.triggerOutcome)},commandId:wi(n.commandId,Mi(t,`commandId`)),idempotencyKey:wi(n.idempotencyKey,Mi(t,`idempotencyKey`)),acceptedAt:wi(n.acceptedAt,Mi(t,`acceptedAt`)),status:r}},tf=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,Mi(t,`workItemKey`)),workItemId:wi(n.workItemId,Mi(t,`workItemId`)),objective:wi(n.objective,Mi(t,`objective`)),state:wi(n.state,Mi(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),...Oi(n,`externalRef`,t),...Oi(n,`lastRunOutcome`,t),relatedWorkItems:Ci(n.relatedWorkItems,Mi(t,`relatedWorkItems`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,Mi(t??``,`workItemKey`)),relation:wi(n.relation,Mi(t??``,`relation`))}})}},nf=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,Mi(t,`workItemKey`)),workItemId:wi(n.workItemId,Mi(t,`workItemId`)),objective:wi(n.objective,Mi(t,`objective`)),condition:wi(n.condition,Mi(t,`condition`)),...Ai(n,`frozen`,t),...Ai(n,`awaitingApproval`,t),...Ai(n,`extendEligible`,t),...Oi(n,`workflowName`,t),...Oi(n,Yd,t),...Oi(n,`blockReason`,t),dwellSince:wi(n.dwellSince,Mi(t,`dwellSince`)),runCount:Di(n.runCount,Mi(t,`runCount`)),...Oi(n,`lastRunAt`,t),...Oi(n,`lastRunOutcome`,t),...ki(n,`lastRunAgeMs`,t),totalTokens:Di(n.totalTokens,Mi(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,Mi(t,`totalCostUsd`)),totalDurationMs:Di(n.totalDurationMs,Mi(t,`totalDurationMs`)),activeRuns:rf(n.activeRuns,Mi(t,`activeRuns`)),...Oi(n,`externalRef`,t)}};function rf(e,t){return e===void 0?{}:Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,af(n,Mi(t,e))]))}function af(e,t){let n=Si(e,t),r=wi(n.phase,Mi(t,`phase`));return Object.values(vd).includes(r)||Ni(Mi(t,`phase`)),{action:wi(n.action,Mi(t,`action`)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),elapsedMs:Di(n.elapsedMs,Mi(t,`elapsedMs`)),phase:r,...Oi(n,`runnerName`,t)}}var of=(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,Mi(t,`resourceId`)),adapter:wi(n[md.Adapter],Mi(t,md.Adapter)),kind:wi(n.kind,Mi(t,`kind`)),locatorLabel:wi(n.locatorLabel,Mi(t,`locatorLabel`)),capabilities:Ci(n.capabilities,Mi(t,`capabilities`),wi),...Oi(n,`title`,t),...Oi(n,`externalUrl`,t),...Oi(n,`revision`,t)}},sf=(e,t=``)=>{let n=Si(e,t),r=n.waitingFor;return{workflowInstanceId:wi(n.workflowInstanceId,Mi(t,`workflowInstanceId`)),workItemKey:wi(n.workItemKey,Mi(t,`workItemKey`)),workflowName:wi(n.workflowName,Mi(t,`workflowName`)),orchestrationGroupId:wi(n.orchestrationGroupId,Mi(t,`orchestrationGroupId`)),...Oi(n,`parentWorkflowInstanceId`,t),status:wi(n.status,Mi(t,`status`)),currentStage:wi(n.currentStage,Mi(t,`currentStage`)),...Oi(n,`blockReason`,t),...Ai(n,`retryEligible`,t),...Ai(n,`extendEligible`,t),...n.mergePolicyBlock===void 0?{}:{mergePolicyBlock:wf(n.mergePolicyBlock,Mi(t,`mergePolicyBlock`))},...r===void 0?{}:{waitingFor:{signalKind:wi(Si(r,Mi(t,`waitingFor`)).signalKind,Mi(t,`waitingFor.signalKind`))}}}},mee=(e,t=``)=>({diagrams:Ci(Si(e,t).diagrams,Mi(t,`diagrams`),cf)});function cf(e,t=``){let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),label:wi(n.label,Mi(t,`label`)),direction:`left-to-right`,stages:Ci(n.stages,Mi(t,`stages`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),label:wi(n.label,Mi(t,`label`)),children:Ci(n.children,Mi(t,`children`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),label:wi(n.label,Mi(t,`label`)),kind:lf(n.kind,Mi(t,`kind`)),...uf(n,t)}}),...uf(n,t)}}),transitions:Ci(n.transitions,Mi(t,`transitions`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`)),label:wi(n.label,Mi(t,`label`)),...Oi(n,`fromChildId`,t)}})}}function lf(e,t){let n=wi(e,t);return Object.values(Wd).includes(n)||Ni(t),n}function uf(e,t){let n=e.activeRuns;return{...Oi(e,`status`,t),...Oi(e,`lastOutcome`,t),...ki(e,`runCount`,t),...ki(e,`totalDurationMs`,t),...ki(e,`totalTokens`,t),...ki(e,`inputTokens`,t),...ki(e,`outputTokens`,t),...ki(e,`cacheReadTokens`,t),...ki(e,`cacheWriteTokens`,t),...ki(e,`totalCostUsd`,t),...n===void 0?{}:{activeRuns:Ci(n,Mi(t,`activeRuns`),(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,Mi(t,`runId`)),activity:wi(n.activity,Mi(t,`activity`)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),...Oi(n,`runnerName`,t)}})}}}var df=[`DONE`,`FAILED`,`AMBIGUOUS`];function ff(e,t){let n=Mi(t,`resolution`),r=Si(e,n),i=wi(r.sentinel,Mi(n,`sentinel`));return df.includes(i)||Ni(Mi(n,`sentinel`)),{sentinel:i,resolvedAt:wi(r.resolvedAt,Mi(n,`resolvedAt`))}}var pf=(e,t=``)=>{let n=Si(e,t),r=n.failure,i=n.resolution;return{...n.operatorInstructions===void 0?{}:{operatorInstructions:Tf(n.operatorInstructions)},runId:wi(n.runId,Mi(t,`runId`)),activationId:wi(n.activationId,Mi(t,`activationId`)),activity:wi(n.activity,Mi(t,`activity`)),workflowInstanceId:wi(n.workflowInstanceId,Mi(t,`workflowInstanceId`)),orchestrationGroupId:wi(n.orchestrationGroupId,Mi(t,`orchestrationGroupId`)),attempt:Di(n.attempt,Mi(t,`attempt`)),status:wi(n.status,Mi(t,`status`)),active:Ei(n.active,Mi(t,pd.Active)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),...Oi(n,`executionStartedAt`,t),...Oi(n,`finishedAt`,t),sentinel:wi(n.sentinel,Mi(t,`sentinel`)),...Oi(n,`runnerName`,t),...Oi(n,`runnerModel`,t),...Oi(n,`workflowName`,t),...Oi(n,Yd,t),totalTokens:Di(n.totalTokens,Mi(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,Mi(t,`totalCostUsd`)),...n.outcome===void 0?{}:{outcome:ji(n.outcome,Mi(t,`outcome`))},...r===void 0?{}:{failure:{kind:wi(Si(r,Mi(t,`failure`)).kind,Mi(t,`failure.kind`))}},...i===void 0?{}:{resolution:ff(i,t)}}},mf=(e,t=``)=>{let n=Object.keys({conversation:!0})[0],r=Object.keys({stage:!0})[0],i=Si(e,t),a=Si(i.orchestration,Mi(t,`orchestration`)),o=Si(i.execution,Mi(t,`execution`)),s=Si(i.activities,Mi(t,`activities`)),c=i.artifacts===void 0?[]:Ci(i.artifacts,Mi(t,`artifacts`),(e,t=``)=>{let n=Si(e,t);return{revisionId:wi(n.revisionId,Mi(t,`revisionId`)),producer:wi(n.producer,Mi(t,`producer`)),path:wi(n.path,Mi(t,`path`)),occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),...Oi(n,`mediaType`,t),...ki(n,`byteLength`,t),...Oi(n,`digest`,t),href:wi(n.href,Mi(t,`href`))}}),l=i.conversation===void 0?void 0:Si(i.conversation,Mi(t,n));return{...Oi(i,`triggerOrigin`,t),work:tf(i.work,Mi(t,`work`)),resources:Ci(i.resources,Mi(t,`resources`),of),orchestration:{primary:a.primary===null?null:sf(a.primary,Mi(t,`orchestration.primary`)),children:Ci(a.children,Mi(t,`orchestration.children`),sf),diagram:bf(a.diagram,Mi(t,`orchestration.diagram`))},execution:{runs:Ci(o.runs,Mi(t,`execution.runs`),pf),transcriptGroups:Ci(o.transcriptGroups,Mi(t,`execution.transcriptGroups`),(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,Mi(t,`groupId`)),kind:Sf(n.kind,Mi(t,`kind`)),...Oi(n,`cli`,t),latestAt:wi(n.latestAt,Mi(t,`latestAt`)),runIds:Ci(n.runIds,Mi(t,`runIds`),wi)}})},activities:s.pullRequest===void 0?{}:{pullRequest:Cf(s.pullRequest,Mi(t,`activities.pullRequest`))},artifacts:c,conversation:{canCreateEntries:l?.canCreateEntries===!0,canContinue:l?.canContinue===!0,entries:l===void 0?[]:Ci(l.entries,Mi(t,`${n}.entries`),(e,t=``)=>{let n=Si(e,t);return{entryId:wi(n.entryId,Mi(t,`entryId`)),body:wi(n.body,Mi(t,`body`)),occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),origin:wi(n.origin,Mi(t,`origin`)),actorId:wi(n.actorId,Mi(t,`actorId`)),...Oi(n,`runId`,t),...Oi(n,r,t),...Oi(n,`sourceAdapter`,t),...Oi(n,`sourceResourceId`,t),...Oi(n,`sourceThreadId`,t),deleted:Ei(n.deleted,Mi(t,`deleted`)),representations:Ci(n.representations,Mi(t,`representations`),(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,Mi(t,`resourceId`)),externalId:wi(n.externalId,Mi(t,`externalId`))}})}})}}},hf=(e,t=``)=>{let n=Si(e,t),r=n.stream;return{id:wi(n.id,Mi(t,`id`)),type:wi(n.type,Mi(t,`type`)),occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),position:Di(n.position,Mi(t,`position`)),...r===void 0?{}:{stream:{kind:wi(Si(r,Mi(t,`stream`)).kind,Mi(t,`stream.kind`)),id:wi(Si(r,Mi(t,`stream`)).id,Mi(t,`stream.id`))}},...Oi(n,`causationId`,t),...Oi(n,`correlationId`,t),payload:n.payload}},gf=(e,t=``)=>{let n=Si(e,t);return{runnerId:wi(n.runnerId,Mi(t,`runnerId`)),status:wi(n.status,Mi(t,`status`)),available:Ei(n.available,Mi(t,`available`)),...Oi(n,`detail`,t),updatedAt:wi(n.updatedAt,Mi(t,`updatedAt`))}},_f=(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,Mi(t,`runId`)),...Oi(n,`groupId`,t),available:Ei(n.available,Mi(t,`available`)),entries:Ci(n.entries,Mi(t,`entries`),(e,t=``)=>{let n=Si(e,t);return{occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),channel:xf(n.channel,Mi(t,`channel`)),text:wi(n.text,Mi(t,`text`)),runId:wi(n.runId,Mi(t,`runId`)),groupId:wi(n.groupId,Mi(t,`groupId`)),...ki(n,`durationMs`,t)}})}},vf=(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,Mi(t,`groupId`)),available:Ei(n.available,Mi(t,`available`)),entries:Ci(n.entries,Mi(t,`entries`),yf)}};function yf(e,t=``){let n=Si(e,t);return{occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),channel:xf(n.channel,Mi(t,`channel`)),text:wi(n.text,Mi(t,`text`)),runId:wi(n.runId,Mi(t,`runId`)),groupId:wi(n.groupId,Mi(t,`groupId`)),...ki(n,`durationMs`,t)}}function bf(e,t){return{href:wi(Si(e,t).href,Mi(t,`href`))}}function xf(e,t){let n=wi(e,t);return n!==Cd.Input&&n!==Cd.Agent&&Ni(t),n}function Sf(e,t){let n=wi(e,t);return n!==Td.Session&&n!==Td.Run&&Ni(t),n}function Cf(e,t=``){let n=Si(e,t);return{resourceId:wi(n.resourceId,Mi(t,`resourceId`)),state:wi(n.state,Mi(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),headRevision:wi(n.headRevision,Mi(t,`headRevision`)),baseRevision:wi(n.baseRevision,Mi(t,`baseRevision`)),checks:wi(n.checks,Mi(t,`checks`))}}function wf(e,t){let n=Si(e,t),r=wi(n.status,Mi(t,`status`));if(r!==`awaiting-human-merge`&&r!==`recovering`)throw Error(`${t}.status: invalid merge policy status`);let i=n.policy===void 0?void 0:Si(n.policy,Mi(t,`policy`));return{status:r,explanation:wi(n.explanation,Mi(t,`explanation`)),nextAction:wi(n.nextAction,Mi(t,`nextAction`)),...Oi(n,`href`,t),...i===void 0?{}:{policy:{...i.blockedPaths===void 0?{}:{blockedPaths:Ci(i.blockedPaths,Mi(t,`policy.blockedPaths`),wi)},...i.matchedPaths===void 0?{}:{matchedPaths:Ci(i.matchedPaths,Mi(t,`policy.matchedPaths`),wi)},...ki(i,`maxFilesChanged`,Mi(t,`policy`)),...ki(i,`filesChanged`,Mi(t,`policy`))}}}}function Tf(e){let t=Si(e,`operatorInstructions`);return{...Oi(t,`content`,`operatorInstructions`),...Oi(t,`author`,`operatorInstructions`),...Oi(t,`occurredAt`,`operatorInstructions`),contextScope:wi(t.contextScope,`operatorInstructions.contextScope`),revisionId:t.revisionId===null?null:wi(t.revisionId,`operatorInstructions.revisionId`)}}var Ef=(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),title:wi(n.title,Mi(t,`title`))}},Df=(e,t=``)=>Ci(e,t,Ef);function Of(e,t){let n=Si(e,t),r=Object.values(ud).find(e=>e===n.id);return r===void 0&&Ni(Mi(t,`id`)),{id:r,from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`)),bucketMs:Di(n.bucketMs,Mi(t,`bucketMs`))}}function kf(e,t){return Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,Di(n,Mi(t,e))]))}var Af=(e,t=``)=>{let n=Si(e,t);return`dimensions`in n?{report:Ef(n.report,Mi(t,`report`)),window:Of(n.window,Mi(t,`window`)),total:Di(n.total,Mi(t,`total`)),dimensions:Ci(n.dimensions,Mi(t,`dimensions`),(e,t=``)=>{let n=Si(e,t);return{...Ef(e,t),rows:Ci(n.rows,Mi(t,`rows`),(e,t=``)=>{let n=Si(e,t);return{value:wi(n.value,Mi(t,`value`)),count:Di(n.count,Mi(t,`count`)),share:Di(n.share,Mi(t,`share`))}})}})}:{report:Ef(n.report,Mi(t,`report`)),window:Of(n.window,Mi(t,`window`)),series:Ci(n.series,Mi(t,`series`),Ef),totals:kf(n.totals,Mi(t,`totals`)),buckets:Ci(n.buckets,Mi(t,`buckets`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`)),values:kf(n.values,Mi(t,`values`))}})}},jf=Object.keys({completed:!0,failed:!0}),Mf={Completed:jf[0],Failed:jf[1]},Nf=(e,t=``)=>{let n=Si(e,t),r=e=>Di(n[e],Mi(t,e)),i=e=>n[e]===null?null:r(e);return{window:Of(n.window,Mi(t,`window`)),runs:r(`runs`),completed:r(Mf.Completed),blockedOrAwaitingApproval:r(`blockedOrAwaitingApproval`),failed:r(Mf.Failed),totalTokens:r(`totalTokens`),totalCostUsd:r(`totalCostUsd`),medianRunDurationMs:i(`medianRunDurationMs`),workItemsDone:r(`workItemsDone`),medianEndToEndDurationMs:i(`medianEndToEndDurationMs`)}},Pf=(e,t=``)=>{let n=Si(e,t),r=Si(n.values,Mi(t,`values`));return{collectedAt:wi(n.collectedAt,Mi(t,`collectedAt`)),window:Ff(n.window,Mi(t,`window`)),values:Object.fromEntries(Object.entries(r).map(([e,n])=>[e,Di(n,Mi(t,`values.${e}`))]))}};function Ff(e,t){let n=Si(e,t);return{days:Di(n.days,Mi(t,`days`)),from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`))}}var If=(e,t=``)=>{let n=Si(e,t);return{status:Vf(n.status,Mi(t,`status`)),version:wi(n.version,Mi(t,`version`)),checkedAt:wi(n.checkedAt,Mi(t,`checkedAt`)),...n.checks===void 0?{}:{checks:Ci(n.checks,Mi(t,`checks`),(e,t=``)=>{let n=Si(e,t);return{name:wi(n.name,Mi(t,`name`)),status:Vf(n.status,Mi(t,`status`)),...Oi(n,`detail`,t)}})},...n.adapters===void 0?{}:{adapters:Ci(n.adapters,Mi(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,Mi(t,`adapterId`)),provider:wi(n.provider,Mi(t,`provider`)),scope:wi(n.scope,Mi(t,`scope`)),channel:wi(n.channel,Mi(t,`channel`)),status:Hf(n.status,Mi(t,`status`)),successCount:Di(n.successCount,Mi(t,`successCount`)),failureCount:Di(n.failureCount,Mi(t,`failureCount`)),...Oi(n,`detail`,t)}})}}},Lf=(e,t=``)=>{let n=Si(e,t),r=Mi(t,`configuration`);return{configuration:Si(ji(n.configuration,r),r)}},Rf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,Mi(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,Mi(t,`adapterId`)),provider:wi(n.provider,Mi(t,`provider`)),commands:Ci(n.commands,Mi(t,`commands`),(e,t=``)=>({syntax:wi(Si(e,t).syntax,Mi(t,`syntax`))}))}})}),zf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,Mi(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,Mi(t,`adapter`)),provider:wi(n.provider,Mi(t,`provider`)),hooks:Ci(n.hooks,Mi(t,`hooks`),(e,t=``)=>{let n=Si(e,t);return{scope:wi(n.scope,Mi(t,`scope`)),endpoint:wi(n.endpoint,Mi(t,`endpoint`)),events:Ci(n.events,Mi(t,`events`),wi),secret:wi(n.secret,Mi(t,`secret`))}})}})});function Bf(e,t){try{let t=Si(e,`problem`);return{type:wi(t.type,`problem.type`),title:wi(t.title,`problem.title`),status:Di(t.status,`problem.status`),...Oi(t,`detail`,`problem`),...Oi(t,`instance`,`problem`),...Oi(t,`code`,`problem`),...t.retryable===void 0?{}:{retryable:Ei(t.retryable,`problem.retryable`)},...t.current===void 0?{}:{current:ji(t.current,`problem.current`)},...t.violations===void 0?{}:{violations:Ci(t.violations,`problem.violations`,(e,t=``)=>{let n=Si(e,t);return{path:wi(n.path,Mi(t,`path`)),message:wi(n.message,Mi(t,`message`))}})}}}catch{return{type:`about:blank`,title:`Request failed`,status:t}}}function Vf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&Ni(t),n}function Hf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&n!==zd.Unknown&&Ni(t),n}var Uf=Nu({triggerId:$l(),coordinationKey:$l(),source:Gd,disposition:Vu(Od),sources:ju(Gd),activeWorkItemId:$l().nullable()}),Wf=Nu({claim:Nu({triggerId:$l(),coordinationKey:$l(),source:Gd,sources:ju(Gd),workItemId:$l(),workflowInstanceId:$l(),workflowName:$l()}),claimedAt:$l(),startedAt:$l().optional(),finishedAt:$l().optional(),failureOutcomeCount:xu().optional(),result:Nu({triggerId:$l(),coordinationKey:$l(),workItemId:$l(),workflowInstanceId:$l(),status:Vu([jd.Completed,jd.Superseded]),reason:$l().optional()}).optional(),workItemKey:$l()}),Gf=Nu({operatorInstructions:Nu({contextScope:$l(),revisionId:$l(),content:$l(),author:$l(),occurredAt:$l()}).nullable().optional(),activeInvocation:Nu({activeWorkItemId:$l(),workItemKey:$l(),triggerId:$l(),workflowInstanceId:$l(),workflowStatus:Vu(Fd).nullable(),blockReason:$l().nullable(),retryEligible:Tu()}).nullable(),triggerId:$l(),status:Vu(Vd),definition:qd.nullable(),paused:Tu(),pauseReason:$l().nullable(),nextOccurrence:$l().nullable(),pending:ju(Uf),latestSkip:Kd.nullable(),invocations:ju(Wf)});function Kf(e){return Gf.parse(e)}function qf(e){return ju(Gf).parse(e)}function Jf(e){return ju(Nu({contextScope:$l(),revisionId:$l(),content:$l().nullable(),author:$l(),occurredAt:$l()})).parse(e)}var Yf=class extends Error{constructor(e){super(e.detail??e.title),this.problem=e,this.name=`ApiProblem`}},Xf=class{constructor(e=fetch,t=`/api/v1`){this.fetchImplementation=e,this.baseUrl=t,this.auth={session:async()=>{let e=this.fetchImplementation;return(await e(`${this.baseUrl}/auth/session`)).ok},login:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({accessKey:e})})).ok},redeem:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/redeem`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({grant:e})})).ok}},this.triggers={list:e=>this.get(`/triggers`,e=>{let t=Xd(qf)(e),n=Si(e,`triggers`);return{...t,orphanedInstructions:Jf(n.orphanedInstructions??[])}},e),detail:(e,t)=>this.get(`/triggers/`+encodeURIComponent(e),Xd(Kf),t),saveInstructions:(e,t,n,r)=>this.request(`/triggers/`+encodeURIComponent(e)+`/commands/instructions`,Xd(ef),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({content:t,expectedRevisionId:n,idempotencyKey:r})}),command:(e,t,n,r)=>this.command(`/triggers/`+encodeURIComponent(e)+`/commands/`+t,n,ef,r)},this.board={list:(e,t)=>this.get(`/board${Zf({cursor:e})}`,Zd(nf),t)},this.status={get:e=>this.get(`/status`,Xd(e=>e),e)},this.controlPlane={status:e=>this.get(`/control-plane/status`,Xd(Qd),e),pauseDispatch:(e,t)=>this.command(`/control-plane/commands/pause-dispatch`,e,ef,t),resumeDispatch:(e,t)=>this.command(`/control-plane/commands/resume-dispatch`,e,ef,t),clearMaintenance:(e,t,n)=>this.request(`/control-plane/commands/clear-maintenance`,Xd(ef),{method:`POST`,body:JSON.stringify({attemptId:e,idempotencyKey:t}),headers:{"content-type":`application/json`},...n===void 0?{}:{signal:n}})},this.work={list:(e={},t)=>this.get(`/work-items${Zf(e)}`,Zd(tf),t),detail:(e,t)=>this.get(`/work-items/${encodeURIComponent(e)}`,Xd(mf),t),artifactText:async(e,t,n)=>{let r=this.fetchImplementation,i=await r(`${this.baseUrl}/work-items/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,{...n===void 0?{}:{signal:n}});if(!i.ok)throw Error(`Unable to load this artifact. Please try again.`);return i.text()},transcript:(e,t,n)=>this.get(`/work-items/${encodeURIComponent(e)}/transcripts/${encodeURIComponent(t)}`,Xd(vf),n),message:(e,t,n,r,i)=>this.request(`/work-items/${encodeURIComponent(e)}/commands/message`,Xd(ef),{method:`POST`,body:JSON.stringify({idempotencyKey:n,body:t,...i===void 0?{}:{continuation:i}}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),command:(e,t,n,r)=>this.command(`/work-items/${encodeURIComponent(e)}/commands/${t}`,n,ef,r)},this.resources={list:(e,t)=>this.get(`/resources${Zf({cursor:e})}`,Zd(of),t)},this.orchestration={list:(e,t)=>this.get(`/workflow-instances${Zf({cursor:e})}`,Zd(sf),t)},this.workflowDiagrams={get:(e,t)=>this.get(`/workflow-diagrams${Zf({workItemKey:e})}`,Xd(mee),t)},this.execution={runs:(e,t)=>this.get(`/runs${Zf({cursor:e})}`,Zd(pf),t),run:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}`,Xd(pf),t),transcript:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}/transcript`,Xd(_f),t),resolveAmbiguousRun:(e,t,n,r)=>this.request(`/runs/${encodeURIComponent(e)}/commands/resolve`,Xd(ef),{method:`POST`,body:JSON.stringify({idempotencyKey:n,...t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),runners:e=>this.get(`/runners`,Zd(gf),e),pauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/pause`,t,ef,n),unpauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/unpause`,t,ef,n)},this.events={list:(e,t,n)=>{let r=typeof t==`string`?t:void 0,i=typeof t==`string`?n:t;return this.get(`/events${Zf({cursor:e,workItemKey:r})}`,Zd(hf),i)}},this.observability={reports:e=>this.get(`/observability/reports`,Xd(Df),e),report:(e,t,n)=>this.get(`/observability/reports`+Zf({window:e,report:t}),Xd(Af),n),summary:(e,t)=>this.get(`/observability/summary`+Zf({window:e}),Xd(Nf),t),metrics:(e=7,t)=>this.get(`/observability/metrics${Zf({days:String(e)})}`,Xd(Pf),t)},this.system={health:e=>this.get(`/system/health`,Xd(If),e),configuration:e=>this.get(`/system/configuration`,Xd(Lf),e),commands:e=>this.get(`/system/commands`,Xd(Rf),e),webhooks:e=>this.get(`/system/webhooks`,Xd(zf),e)}}async command(e,t,n,r){return this.request(e,Xd(n),{method:`POST`,body:JSON.stringify({idempotencyKey:t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}})}get(e,t,n){return this.request(e,t,n===void 0?{}:{signal:n})}async request(e,t,n){let r=this.fetchImplementation,i=await r(`${this.baseUrl}${e}`,{...n,headers:{accept:`application/json, application/problem+json`,...n.headers}}),a=await i.json();if(!i.ok)throw new Yf(Bf(a,i.status));return t(a)}};function Zf(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&t.set(n,r);let n=t.toString();return n===``?``:`?${n}`}var Qf=(0,C.createContext)(null);function $f(){let e=(0,C.useContext)(Qf);if(e===null)throw Error(`WakeApiClient is not configured`);return e}var ep={prefix:`fas`,iconName:`filter`,icon:[512,512,[],`f0b0`,`M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z`]},tp={prefix:`fas`,iconName:`table-columns`,icon:[448,512,[`columns`],`f0db`,`M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 128 0 0-256-128 0zm320 0l-128 0 0 256 128 0 0-256z`]},hee={prefix:`fas`,iconName:`paper-plane`,icon:[576,512,[61913],`f1d8`,`M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z`]},np={prefix:`fas`,iconName:`chevron-right`,icon:[320,512,[9002],`f054`,`M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z`]},gee={prefix:`fas`,iconName:`heart-pulse`,icon:[512,512,[`heartbeat`],`f21e`,`M256 107.9L241 87.1C216 52.5 175.9 32 133.1 32 59.6 32 0 91.6 0 165.1l0 2.6c0 23.6 6.2 48 16.6 72.3l106 0c3.2 0 6.1-1.9 7.4-4.9l31.8-76.3c3.7-8.8 12.3-14.6 21.8-14.8s18.3 5.4 22.2 14.1l51.3 113.9 41.4-82.8c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3l23.2 46.3c1.4 2.7 4.1 4.4 7.2 4.4l123.6 0c10.5-24.3 16.6-48.7 16.6-72.3l0-2.6C512 91.6 452.4 32 378.9 32 336.2 32 296 52.5 271 87.1l-15 20.7zM469.6 288l-97.8 0c-21.2 0-40.6-12-50.1-31l-1.7-3.4-42.5 85.1c-4.1 8.3-12.7 13.5-22 13.3s-17.6-5.7-21.4-14.1l-49.3-109.5-10.5 25.2c-8.7 20.9-29.1 34.5-51.7 34.5l-80.2 0c47.2 73.8 123 141.7 170.4 177.9 12.4 9.4 27.6 14.1 43.1 14.1s30.8-4.6 43.1-14.1C346.6 429.7 422.4 361.8 469.6 288z`]},rp={prefix:`fas`,iconName:`chart-line`,icon:[512,512,[`line-chart`],`f201`,`M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7 262.6 153.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l73.4-73.4 57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z`]},_ee={prefix:`fas`,iconName:`play`,icon:[448,512,[9654],`f04b`,`M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z`]},ip={prefix:`fas`,iconName:`sliders`,icon:[512,512,[`sliders-h`],`f1de`,`M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 224zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384z`]},ap={prefix:`fas`,iconName:`chevron-down`,icon:[448,512,[],`f078`,`M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`]},op={prefix:`fas`,iconName:`clock-rotate-left`,icon:[576,512,[`history`],`f1da`,`M288 64c106 0 192 86 192 192S394 448 288 448c-65.2 0-122.9-32.5-157.6-82.3-10.1-14.5-30.1-18-44.6-7.9s-18 30.1-7.9 44.6C124.1 468.6 201 512 288 512 429.4 512 544 397.4 544 256S429.4 0 288 0C202.3 0 126.5 42.1 80 106.7L80 80c0-17.7-14.3-32-32-32S16 62.3 16 80l0 112c0 17.7 14.3 32 32 32l24.6 0c.5 0 1 0 1.5 0l86 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-38.3 0C154.9 102.6 217 64 288 64zm24 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1z`]},vee={prefix:`fas`,iconName:`hourglass-half`,icon:[384,512,[`hourglass-2`],`f252`,`M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z`]},sp={prefix:`fas`,iconName:`chevron-left`,icon:[320,512,[9001],`f053`,`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z`]},yee={prefix:`fas`,iconName:`arrow-down-wide-short`,icon:[576,512,[`sort-amount-asc`,`sort-amount-down`],`f160`,`M246.6 374.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z`]},cp={prefix:`fas`,iconName:`bars`,icon:[448,512,[`navicon`],`f0c9`,`M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z`]},lp={prefix:`fas`,iconName:`list-check`,icon:[512,512,[`tasks`],`f0ae`,`M133.8 36.3c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 158 47 153L7 113C-2.3 103.6-2.3 88.4 7 79S31.6 69.7 41 79l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zm0 160c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 318 47 313L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM64 376a40 40 0 1 1 0 80 40 40 0 1 1 0-80z`]};function up(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dp(e){if(Array.isArray(e))return e}function fp(e){if(Array.isArray(e))return up(e)}function pp(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Dp(r.key),r)}}function hp(e,t,n){return t&&mp(e.prototype,t),n&&mp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gp(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=kp(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
74
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function nl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:al(t,`input`,e.processors),output:al(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function rl(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return rl(r.element,n);if(r.type===`set`)return rl(r.valueType,n);if(r.type===`lazy`)return rl(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return rl(r.innerType,n);if(r.type===`intersection`)return rl(r.left,n)||rl(r.right,n);if(r.type===`record`||r.type===`map`)return rl(r.keyType,n)||rl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:rl(r.in,n)||rl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(rl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(rl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(rl(e,n))return!0;return!!(r.rest&&rl(r.rest,n))}return!1}var il=(e,t={})=>n=>{let r=$c({...n,processors:t});return el(e,r),tl(r,e),nl(r,e)},al=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=$c({...i??{},target:a,io:t,processors:n});return el(e,o),tl(o,e),nl(o,e)},ol={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},sl=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ol[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},cl=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ll=(e,t,n,r)=>{n.type=`boolean`},ul=(e,t,n,r)=>{n.not={}},dl=(e,t,n,r)=>{let i=e._zod.def,a=Vi(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},fl=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},pl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},ml=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},hl=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=el(a.element,t,{...r,path:[...r.path,`items`]})},gl=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=el(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=el(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},_l=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>el(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},vl=(e,t,n,r)=>{let i=e._zod.def,a=el(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=el(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},yl=(e,t,n,r)=>{let i=e._zod.def,a=el(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},bl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},xl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Sl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Cl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},wl=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;el(o,t,r);let s=t.seen.get(e);s.ref=o},Tl=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},El=(e,t,n,r)=>{let i=e._zod.def;el(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Dl=Ii(`ZodISODateTime`,(e,t)=>{Zo.init(e,t),eu.init(e,t)});function Ol(e){return xc(Dl,e)}var kl=Ii(`ZodISODate`,(e,t)=>{Qo.init(e,t),eu.init(e,t)});function Al(e){return lee(kl,e)}var jl=Ii(`ZodISOTime`,(e,t)=>{$o.init(e,t),eu.init(e,t)});function Ml(e){return Sc(jl,e)}var Nl=Ii(`ZodISODuration`,(e,t)=>{es.init(e,t),eu.init(e,t)});function Pl(e){return Cc(Nl,e)}var Fl=Ii(`ZodError`,(e,t)=>{Ca.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ea(e,t)},flatten:{value:t=>Ta(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Hi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Hi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Il=Da(Fl),Ll=Oa(Fl),Rl=ka(Fl),zl=ja(Fl),Bl=Na(Fl),Vl=Pa(Fl),Hl=Fa(Fl),Ul=Ia(Fl),Wl=La(Fl),Gl=Ra(Fl),Kl=za(Fl),ql=Ba(Fl),Jl=new WeakMap;function Yl(e,t,n){let r=Object.getPrototypeOf(e),i=Jl.get(r);if(i||(i=new Set,Jl.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Xl=Ii(`ZodType`,(e,t)=>(Lo.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:al(e,`input`),output:al(e,`output`)}}),e.toJSONSchema=il(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Il(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Rl(e,t,n),e.parseAsync=async(t,n)=>Ll(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>zl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Bl(e,t,n),e.decode=(t,n)=>Vl(e,t,n),e.encodeAsync=async(t,n)=>Hl(e,t,n),e.decodeAsync=async(t,n)=>Ul(e,t,n),e.safeEncode=(t,n)=>Wl(e,t,n),e.safeDecode=(t,n)=>Gl(e,t,n),e.safeEncodeAsync=async(t,n)=>Kl(e,t,n),e.safeDecodeAsync=async(t,n)=>ql(e,t,n),Yl(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Xi(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return oa(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fee(e,t))},superRefine(e,t){return this.check(pee(e,t))},overwrite(e){return this.check(Uc(e))},optional(){return qu(this)},exactOptional(){return Yu(this)},nullable(){return Zu(this)},nullish(){return qu(Zu(this))},nonoptional(e){return rd(this,e)},array(){return ju(this)},or(e){return Fu([this,e])},and(e){return zu(this,e)},transform(e){return sd(this,Gu(e))},default(e){return $u(this,e)},prefault(e){return td(this,e)},catch(e){return ad(this,e)},pipe(e){return sd(this,e)},readonly(){return cd(this)},describe(e){let t=this.clone();return Zs.add(t,{description:e}),t},meta(...e){if(e.length===0)return Zs.get(this);let t=this.clone();return Zs.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return Zs.get(e)?.description},configurable:!0}),e)),Zl=Ii(`_ZodString`,(e,t)=>{Ro.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Yl(e,`_ZodString`,{regex(...e){return this.check(Lc(...e))},includes(...e){return this.check(Bc(...e))},startsWith(...e){return this.check(Vc(...e))},endsWith(...e){return this.check(Hc(...e))},min(...e){return this.check(Fc(...e))},max(...e){return this.check(Pc(...e))},length(...e){return this.check(Ic(...e))},nonempty(...e){return this.check(Fc(1,...e))},lowercase(e){return this.check(Rc(e))},uppercase(e){return this.check(zc(e))},trim(){return this.check(Gc())},normalize(...e){return this.check(Wc(...e))},toLowerCase(){return this.check(Kc())},toUpperCase(){return this.check(qc())},slugify(){return this.check(Jc())}})}),Ql=Ii(`ZodString`,(e,t)=>{Ro.init(e,t),Zl.init(e,t),e.email=t=>e.check($s(tu,t)),e.url=t=>e.check(ac(iu,t)),e.jwt=t=>e.check(bc(yu,t)),e.emoji=t=>e.check(oc(au,t)),e.guid=t=>e.check(ec(nu,t)),e.uuid=t=>e.check(tc(ru,t)),e.uuidv4=t=>e.check(nc(ru,t)),e.uuidv6=t=>e.check(rc(ru,t)),e.uuidv7=t=>e.check(ic(ru,t)),e.nanoid=t=>e.check(sc(ou,t)),e.guid=t=>e.check(ec(nu,t)),e.cuid=t=>e.check(cc(su,t)),e.cuid2=t=>e.check(lc(cu,t)),e.ulid=t=>e.check(uc(lu,t)),e.base64=t=>e.check(_c(gu,t)),e.base64url=t=>e.check(vc(_u,t)),e.xid=t=>e.check(dc(uu,t)),e.ksuid=t=>e.check(fc(du,t)),e.ipv4=t=>e.check(pc(fu,t)),e.ipv6=t=>e.check(mc(pu,t)),e.cidrv4=t=>e.check(hc(mu,t)),e.cidrv6=t=>e.check(gc(hu,t)),e.e164=t=>e.check(yc(vu,t)),e.datetime=t=>e.check(Ol(t)),e.date=t=>e.check(Al(t)),e.time=t=>e.check(Ml(t)),e.duration=t=>e.check(Pl(t))});function $l(e){return Qs(Ql,e)}var eu=Ii(`ZodStringFormat`,(e,t)=>{zo.init(e,t),Zl.init(e,t)}),tu=Ii(`ZodEmail`,(e,t)=>{Ho.init(e,t),eu.init(e,t)}),nu=Ii(`ZodGUID`,(e,t)=>{Bo.init(e,t),eu.init(e,t)}),ru=Ii(`ZodUUID`,(e,t)=>{Vo.init(e,t),eu.init(e,t)}),iu=Ii(`ZodURL`,(e,t)=>{Uo.init(e,t),eu.init(e,t)}),au=Ii(`ZodEmoji`,(e,t)=>{Wo.init(e,t),eu.init(e,t)}),ou=Ii(`ZodNanoID`,(e,t)=>{Go.init(e,t),eu.init(e,t)}),su=Ii(`ZodCUID`,(e,t)=>{Ko.init(e,t),eu.init(e,t)}),cu=Ii(`ZodCUID2`,(e,t)=>{qo.init(e,t),eu.init(e,t)}),lu=Ii(`ZodULID`,(e,t)=>{Jo.init(e,t),eu.init(e,t)}),uu=Ii(`ZodXID`,(e,t)=>{Yo.init(e,t),eu.init(e,t)}),du=Ii(`ZodKSUID`,(e,t)=>{Xo.init(e,t),eu.init(e,t)}),fu=Ii(`ZodIPv4`,(e,t)=>{ts.init(e,t),eu.init(e,t)}),pu=Ii(`ZodIPv6`,(e,t)=>{ns.init(e,t),eu.init(e,t)}),mu=Ii(`ZodCIDRv4`,(e,t)=>{rs.init(e,t),eu.init(e,t)}),hu=Ii(`ZodCIDRv6`,(e,t)=>{is.init(e,t),eu.init(e,t)}),gu=Ii(`ZodBase64`,(e,t)=>{os.init(e,t),eu.init(e,t)}),_u=Ii(`ZodBase64URL`,(e,t)=>{cs.init(e,t),eu.init(e,t)}),vu=Ii(`ZodE164`,(e,t)=>{ls.init(e,t),eu.init(e,t)}),yu=Ii(`ZodJWT`,(e,t)=>{ds.init(e,t),eu.init(e,t)}),bu=Ii(`ZodNumber`,(e,t)=>{fs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cl(e,t,n,r),Yl(e,`ZodNumber`,{gt(e,t){return this.check(jc(e,t))},gte(e,t){return this.check(Mc(e,t))},min(e,t){return this.check(Mc(e,t))},lt(e,t){return this.check(kc(e,t))},lte(e,t){return this.check(Ac(e,t))},max(e,t){return this.check(Ac(e,t))},int(e){return this.check(Cu(e))},safe(e){return this.check(Cu(e))},positive(e){return this.check(jc(0,e))},nonnegative(e){return this.check(Mc(0,e))},negative(e){return this.check(kc(0,e))},nonpositive(e){return this.check(Ac(0,e))},multipleOf(e,t){return this.check(Nc(e,t))},step(e,t){return this.check(Nc(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function xu(e){return wc(bu,e)}var Su=Ii(`ZodNumberFormat`,(e,t)=>{cee.init(e,t),bu.init(e,t)});function Cu(e){return Tc(Su,e)}var wu=Ii(`ZodBoolean`,(e,t)=>{ps.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ll(e,t,n,r)});function Tu(e){return Ec(wu,e)}var Eu=Ii(`ZodUnknown`,(e,t)=>{ms.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Du(){return Dc(Eu)}var Ou=Ii(`ZodNever`,(e,t)=>{hs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ul(e,t,n,r)});function ku(e){return Oc(Ou,e)}var Au=Ii(`ZodArray`,(e,t)=>{_s.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hl(e,t,n,r),e.element=t.element,Yl(e,`ZodArray`,{min(e,t){return this.check(Fc(e,t))},nonempty(e){return this.check(Fc(1,e))},max(e,t){return this.check(Pc(e,t))},length(e,t){return this.check(Ic(e,t))},unwrap(){return this.element}})});function ju(e,t){return Yc(Au,e,t)}var Mu=Ii(`ZodObject`,(e,t)=>{Ss.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gl(e,t,n,r),Ji(e,`shape`,()=>t.shape),Yl(e,`ZodObject`,{keyof(){return Vu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Du()})},loose(){return this.clone({...this._zod.def,catchall:Du()})},strict(){return this.clone({...this._zod.def,catchall:ku()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return fa(this,e)},safeExtend(e){return aee(this,e)},merge(e){return oee(this,e)},pick(e){return ua(this,e)},omit(e){return da(this,e)},partial(...e){return pa(Ku,this,e[0])},required(...e){return ma(nd,this,e[0])}})});function Nu(e,t){return new Mu({type:`object`,shape:e??{},...sa(t)})}var Pu=Ii(`ZodUnion`,(e,t)=>{ws.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_l(e,t,n,r),e.options=t.options});function Fu(e,t){return new Pu({type:`union`,options:e,...sa(t)})}var Iu=Ii(`ZodDiscriminatedUnion`,(e,t)=>{Pu.init(e,t),Ts.init(e,t)});function Lu(e,t,n){return new Iu({type:`union`,options:t,discriminator:e,...sa(n)})}var Ru=Ii(`ZodIntersection`,(e,t)=>{Es.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r)});function zu(e,t){return new Ru({type:`intersection`,left:e,right:t})}var Bu=Ii(`ZodEnum`,(e,t)=>{ks.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dl(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Bu({...t,checks:[],...sa(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Bu({...t,checks:[],...sa(r),entries:i})}});function Vu(e,t){return new Bu({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...sa(t)})}var Hu=Ii(`ZodLiteral`,(e,t)=>{As.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fl(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Uu(e,t){return new Hu({type:`literal`,values:Array.isArray(e)?e:[e],...sa(t)})}var Wu=Ii(`ZodTransform`,(e,t)=>{js.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ml(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ri(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xa(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xa(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Gu(e){return new Wu({type:`transform`,transform:e})}var Ku=Ii(`ZodOptional`,(e,t)=>{Ns.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qu(e){return new Ku({type:`optional`,innerType:e})}var Ju=Ii(`ZodExactOptional`,(e,t)=>{Ps.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yu(e){return new Ju({type:`optional`,innerType:e})}var Xu=Ii(`ZodNullable`,(e,t)=>{Fs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zu(e){return new Xu({type:`nullable`,innerType:e})}var Qu=Ii(`ZodDefault`,(e,t)=>{Is.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $u(e,t){return new Qu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ra(t)}})}var ed=Ii(`ZodPrefault`,(e,t)=>{Rs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function td(e,t){return new ed({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ra(t)}})}var nd=Ii(`ZodNonOptional`,(e,t)=>{zs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rd(e,t){return new nd({type:`nonoptional`,innerType:e,...sa(t)})}var id=Ii(`ZodCatch`,(e,t)=>{Vs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ad(e,t){return new id({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var od=Ii(`ZodPipe`,(e,t)=>{Hs.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.in=t.in,e.out=t.out});function sd(e,t){return new od({type:`pipe`,in:e,out:t})}var uee=Ii(`ZodReadonly`,(e,t)=>{Ws.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function cd(e){return new uee({type:`readonly`,innerType:e})}var dee=Ii(`ZodCustom`,(e,t)=>{Ks.init(e,t),Xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pl(e,t,n,r)});function fee(e,t={}){return Xc(dee,e,t)}function pee(e,t){return Zc(e,t)}var ld=e=>e,ud=ld({Day:`1d`,ThreeDays:`3d`,FiveDays:`5d`,Week:`7d`}),dd=Object.keys({accepted:!0,completed:!0}),fd={Accepted:dd[0],Completed:dd[1]},pd={Active:Object.keys({active:!0})[0]},md={Adapter:Object.keys({adapter:!0})[0]},hd=Object.keys({failed:!0,succeeded:!0}),gd={Failed:hd[0],Succeeded:hd[1]},_d=Object.keys({starting:!0,started:!0}),vd={Starting:_d[0],Started:_d[1]},yd=ld({Waiting:`waiting`,Done:`done`,Rejected:`rejected`,Blocked:`blocked`,Failed:`failed`}),bd=Object.keys({ready:!0,active:!0,"needs-input":!0,error:!0,finished:!0}),xd={Ready:bd[0],Active:bd[1],NeedsInput:bd[2],Error:bd[3],Finished:bd[4]};Object.keys({stage:!0})[0];var Sd=Object.keys({input:!0,agent:!0}),Cd={Input:Sd[0],Agent:Sd[1]},wd=Object.keys({session:!0,run:!0}),Td={Session:wd[0],Run:wd[1]},Ed={Event:`event`,Cron:`cron`,Manual:`manual`},Dd={started:!0},Od={Started:Object.keys(Dd)[0],Coalesced:`coalesced`,Skipped:`skipped`},kd={OwnScope:`own-scope`,Paused:`paused`,Removed:`removed`,DispatchPaused:`dispatch-paused`,Capacity:`capacity-unavailable`,PendingLimit:`pending-source-limit`},Ad=Object.keys({completed:!0,superseded:!0}),jd={Completed:Ad[0],Superseded:Ad[1]},Md={Started:Object.keys(Dd)[0],Coalesced:Od.Coalesced,Skipped:Od.Skipped},Nd=Object.keys({pause:!0,resume:!0,run:!0}),Pd={Pause:Nd[0],Resume:Nd[1],Run:Nd[2]},Fd=ld({Active:`active`,Waiting:`waiting`,Completed:`completed`,Blocked:`blocked`,Superseded:`superseded`}),Id=Object.keys({"execution-recovery-ambiguous:":!0})[0];function Ld(e){return e?.startsWith(Id)===!0||e!==void 0&&/^run-ambiguous-after-\d+-attempts$/.test(e)}var Rd=xd,zd=ld({Unknown:`unknown`}),Bd=Object.keys({enabled:!0,paused:!0,running:!0,removed:!0}),Vd={Enabled:Bd[0],Paused:Bd[1],Running:Bd[2],Removed:Bd[3]},Hd=Object.keys({pause:!0,resume:!0,run:!0});Hd[0],Hd[1],Hd[2];var Ud=Object.keys({activity:!0,watch:!0,"watch-gate":!0,reactor:!0}),Wd={Activity:Ud[0],Watch:Ud[1],WatchGate:Ud[2],Reactor:Ud[3]},Gd=Lu(`kind`,[Nu({kind:Uu(Ed.Manual),commandId:$l(),operator:$l()}),Nu({kind:Uu(Ed.Cron),slot:$l()}),Nu({kind:Uu(Ed.Event),eventId:$l(),eventType:$l()})]),Kd=Nu({triggerId:$l(),source:Gd,occurredAt:$l(),reason:Vu(kd)}),qd=Nu({id:$l(),workflow:$l(),contextScope:$l().optional(),on:Nu({cron:$l().optional(),events:ju($l()).optional()}),when:Nu({capacityAvailable:Uu(!0)}).optional()}),Jd=Lu(`disposition`,[Nu({disposition:Uu(Md.Started),workItemId:$l().optional()}),Nu({disposition:Uu(Md.Coalesced),activeWorkItemId:$l().optional()}),Nu({disposition:Uu(Md.Skipped),reason:Vu(kd)})]),Yd=Object.keys({stage:!0})[0];function Xd(e){return(t,n=``)=>{let r=Si(t,n);return{data:e(r.data,Mi(n,`data`)),meta:xi(r.meta,Mi(n,`meta`))}}}function Zd(e){return(t,n=``)=>{let r=Si(t,n),i=Si(r.page,Mi(n,`page`));return{items:Ci(r.items,Mi(n,`items`),e),page:{nextCursor:Ti(i.nextCursor,Mi(n,`page.nextCursor`)),hasMore:Ei(i.hasMore,Mi(n,`page.hasMore`)),...ki(i,`total`,Mi(n,`page`))},meta:xi(r.meta,Mi(n,`meta`))}}}var Qd=(e,t=``)=>{let n=Si(e,t);return{dispatchPaused:Ei(n.dispatchPaused,Mi(t,`dispatchPaused`)),...Oi(n,`dispatchPausedUntil`,t),...Oi(n,`dispatchPauseReason`,t),updatedAt:wi(n.updatedAt,Mi(t,`updatedAt`)),...n.maintenanceLease===void 0?{}:{maintenanceLease:$d(n.maintenanceLease,Mi(t,`maintenanceLease`))}}};function $d(e,t){let n=Si(e,t);return{attemptId:wi(n.attemptId,Mi(t,`attemptId`)),phase:wi(n.phase,Mi(t,`phase`)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),...Oi(n,`failure`,t)}}var ef=(e,t=``)=>{let n=Si(e,t),r=wi(n.status,Mi(t,`status`));return r!==fd.Accepted&&r!==fd.Completed&&Ni(Mi(t,`status`)),{...n.triggerOutcome===void 0?{}:{triggerOutcome:Jd.parse(n.triggerOutcome)},commandId:wi(n.commandId,Mi(t,`commandId`)),idempotencyKey:wi(n.idempotencyKey,Mi(t,`idempotencyKey`)),acceptedAt:wi(n.acceptedAt,Mi(t,`acceptedAt`)),status:r}},tf=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,Mi(t,`workItemKey`)),workItemId:wi(n.workItemId,Mi(t,`workItemId`)),objective:wi(n.objective,Mi(t,`objective`)),state:wi(n.state,Mi(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),...Oi(n,`externalRef`,t),...Oi(n,`lastRunOutcome`,t),relatedWorkItems:Ci(n.relatedWorkItems,Mi(t,`relatedWorkItems`),(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,Mi(t??``,`workItemKey`)),relation:wi(n.relation,Mi(t??``,`relation`))}})}},nf=(e,t=``)=>{let n=Si(e,t);return{workItemKey:wi(n.workItemKey,Mi(t,`workItemKey`)),workItemId:wi(n.workItemId,Mi(t,`workItemId`)),objective:wi(n.objective,Mi(t,`objective`)),condition:wi(n.condition,Mi(t,`condition`)),...Ai(n,`frozen`,t),...Ai(n,`awaitingApproval`,t),...Ai(n,`extendEligible`,t),...Oi(n,`workflowName`,t),...Oi(n,Yd,t),...Oi(n,`blockReason`,t),dwellSince:wi(n.dwellSince,Mi(t,`dwellSince`)),runCount:Di(n.runCount,Mi(t,`runCount`)),...Oi(n,`lastRunAt`,t),...Oi(n,`lastRunOutcome`,t),...ki(n,`lastRunAgeMs`,t),totalTokens:Di(n.totalTokens,Mi(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,Mi(t,`totalCostUsd`)),totalDurationMs:Di(n.totalDurationMs,Mi(t,`totalDurationMs`)),activeRuns:rf(n.activeRuns,Mi(t,`activeRuns`)),...Oi(n,`externalRef`,t)}};function rf(e,t){return e===void 0?{}:Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,af(n,Mi(t,e))]))}function af(e,t){let n=Si(e,t),r=wi(n.phase,Mi(t,`phase`));return Object.values(vd).includes(r)||Ni(Mi(t,`phase`)),{action:wi(n.action,Mi(t,`action`)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),elapsedMs:Di(n.elapsedMs,Mi(t,`elapsedMs`)),phase:r,...Oi(n,`runnerName`,t)}}var of=(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,Mi(t,`resourceId`)),adapter:wi(n[md.Adapter],Mi(t,md.Adapter)),kind:wi(n.kind,Mi(t,`kind`)),locatorLabel:wi(n.locatorLabel,Mi(t,`locatorLabel`)),capabilities:Ci(n.capabilities,Mi(t,`capabilities`),wi),...Oi(n,`title`,t),...Oi(n,`externalUrl`,t),...Oi(n,`revision`,t)}},sf=(e,t=``)=>{let n=Si(e,t),r=n.waitingFor;return{workflowInstanceId:wi(n.workflowInstanceId,Mi(t,`workflowInstanceId`)),workItemKey:wi(n.workItemKey,Mi(t,`workItemKey`)),workflowName:wi(n.workflowName,Mi(t,`workflowName`)),orchestrationGroupId:wi(n.orchestrationGroupId,Mi(t,`orchestrationGroupId`)),...Oi(n,`parentWorkflowInstanceId`,t),status:wi(n.status,Mi(t,`status`)),currentStage:wi(n.currentStage,Mi(t,`currentStage`)),...Oi(n,`blockReason`,t),...Ai(n,`retryEligible`,t),...Ai(n,`extendEligible`,t),...n.mergePolicyBlock===void 0?{}:{mergePolicyBlock:wf(n.mergePolicyBlock,Mi(t,`mergePolicyBlock`))},...r===void 0?{}:{waitingFor:{signalKind:wi(Si(r,Mi(t,`waitingFor`)).signalKind,Mi(t,`waitingFor.signalKind`))}}}},mee=(e,t=``)=>({diagrams:Ci(Si(e,t).diagrams,Mi(t,`diagrams`),cf)});function cf(e,t=``){let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),label:wi(n.label,Mi(t,`label`)),direction:`left-to-right`,stages:Ci(n.stages,Mi(t,`stages`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),label:wi(n.label,Mi(t,`label`)),children:Ci(n.children,Mi(t,`children`),(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),label:wi(n.label,Mi(t,`label`)),kind:lf(n.kind,Mi(t,`kind`)),...uf(n,t)}}),...uf(n,t)}}),transitions:Ci(n.transitions,Mi(t,`transitions`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`)),label:wi(n.label,Mi(t,`label`)),...Oi(n,`fromChildId`,t)}})}}function lf(e,t){let n=wi(e,t);return Object.values(Wd).includes(n)||Ni(t),n}function uf(e,t){let n=e.activeRuns;return{...Oi(e,`status`,t),...Oi(e,`lastOutcome`,t),...ki(e,`runCount`,t),...ki(e,`totalDurationMs`,t),...ki(e,`totalTokens`,t),...ki(e,`inputTokens`,t),...ki(e,`outputTokens`,t),...ki(e,`cacheReadTokens`,t),...ki(e,`cacheWriteTokens`,t),...ki(e,`totalCostUsd`,t),...n===void 0?{}:{activeRuns:Ci(n,Mi(t,`activeRuns`),(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,Mi(t,`runId`)),activity:wi(n.activity,Mi(t,`activity`)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),...Oi(n,`runnerName`,t)}})}}}var df=[`DONE`,`FAILED`,`AMBIGUOUS`];function ff(e,t){let n=Mi(t,`resolution`),r=Si(e,n),i=wi(r.sentinel,Mi(n,`sentinel`));return df.includes(i)||Ni(Mi(n,`sentinel`)),{sentinel:i,resolvedAt:wi(r.resolvedAt,Mi(n,`resolvedAt`))}}var pf=(e,t=``)=>{let n=Si(e,t),r=n.failure,i=n.resolution;return{...n.operatorInstructions===void 0?{}:{operatorInstructions:Tf(n.operatorInstructions)},runId:wi(n.runId,Mi(t,`runId`)),activationId:wi(n.activationId,Mi(t,`activationId`)),activity:wi(n.activity,Mi(t,`activity`)),workflowInstanceId:wi(n.workflowInstanceId,Mi(t,`workflowInstanceId`)),orchestrationGroupId:wi(n.orchestrationGroupId,Mi(t,`orchestrationGroupId`)),attempt:Di(n.attempt,Mi(t,`attempt`)),status:wi(n.status,Mi(t,`status`)),active:Ei(n.active,Mi(t,pd.Active)),startedAt:wi(n.startedAt,Mi(t,`startedAt`)),...Oi(n,`executionStartedAt`,t),...Oi(n,`finishedAt`,t),sentinel:wi(n.sentinel,Mi(t,`sentinel`)),...Oi(n,`runnerName`,t),...Oi(n,`runnerModel`,t),...Oi(n,`workflowName`,t),...Oi(n,Yd,t),totalTokens:Di(n.totalTokens,Mi(t,`totalTokens`)),...ki(n,`inputTokens`,t),...ki(n,`outputTokens`,t),...ki(n,`cacheReadTokens`,t),...ki(n,`cacheWriteTokens`,t),totalCostUsd:Di(n.totalCostUsd,Mi(t,`totalCostUsd`)),...n.outcome===void 0?{}:{outcome:ji(n.outcome,Mi(t,`outcome`))},...r===void 0?{}:{failure:{kind:wi(Si(r,Mi(t,`failure`)).kind,Mi(t,`failure.kind`))}},...i===void 0?{}:{resolution:ff(i,t)}}},mf=(e,t=``)=>{let n=Object.keys({conversation:!0})[0],r=Object.keys({stage:!0})[0],i=Si(e,t),a=Si(i.orchestration,Mi(t,`orchestration`)),o=Si(i.execution,Mi(t,`execution`)),s=Si(i.activities,Mi(t,`activities`)),c=i.artifacts===void 0?[]:Ci(i.artifacts,Mi(t,`artifacts`),(e,t=``)=>{let n=Si(e,t);return{revisionId:wi(n.revisionId,Mi(t,`revisionId`)),producer:wi(n.producer,Mi(t,`producer`)),path:wi(n.path,Mi(t,`path`)),occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),...Oi(n,`mediaType`,t),...ki(n,`byteLength`,t),...Oi(n,`digest`,t),href:wi(n.href,Mi(t,`href`))}}),l=i.conversation===void 0?void 0:Si(i.conversation,Mi(t,n));return{...Oi(i,`triggerOrigin`,t),work:tf(i.work,Mi(t,`work`)),resources:Ci(i.resources,Mi(t,`resources`),of),orchestration:{primary:a.primary===null?null:sf(a.primary,Mi(t,`orchestration.primary`)),children:Ci(a.children,Mi(t,`orchestration.children`),sf),diagram:bf(a.diagram,Mi(t,`orchestration.diagram`))},execution:{runs:Ci(o.runs,Mi(t,`execution.runs`),pf),transcriptGroups:Ci(o.transcriptGroups,Mi(t,`execution.transcriptGroups`),(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,Mi(t,`groupId`)),kind:Sf(n.kind,Mi(t,`kind`)),...Oi(n,`cli`,t),latestAt:wi(n.latestAt,Mi(t,`latestAt`)),runIds:Ci(n.runIds,Mi(t,`runIds`),wi)}})},activities:s.pullRequest===void 0?{}:{pullRequest:Cf(s.pullRequest,Mi(t,`activities.pullRequest`))},artifacts:c,conversation:{canCreateEntries:l?.canCreateEntries===!0,canContinue:l?.canContinue===!0,entries:l===void 0?[]:Ci(l.entries,Mi(t,`${n}.entries`),(e,t=``)=>{let n=Si(e,t);return{entryId:wi(n.entryId,Mi(t,`entryId`)),body:wi(n.body,Mi(t,`body`)),occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),origin:wi(n.origin,Mi(t,`origin`)),actorId:wi(n.actorId,Mi(t,`actorId`)),...Oi(n,`runId`,t),...Oi(n,r,t),...Oi(n,`sourceAdapter`,t),...Oi(n,`sourceResourceId`,t),...Oi(n,`sourceThreadId`,t),deleted:Ei(n.deleted,Mi(t,`deleted`)),representations:Ci(n.representations,Mi(t,`representations`),(e,t=``)=>{let n=Si(e,t);return{resourceId:wi(n.resourceId,Mi(t,`resourceId`)),externalId:wi(n.externalId,Mi(t,`externalId`))}})}})}}},hf=(e,t=``)=>{let n=Si(e,t),r=n.stream;return{id:wi(n.id,Mi(t,`id`)),type:wi(n.type,Mi(t,`type`)),occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),position:Di(n.position,Mi(t,`position`)),...r===void 0?{}:{stream:{kind:wi(Si(r,Mi(t,`stream`)).kind,Mi(t,`stream.kind`)),id:wi(Si(r,Mi(t,`stream`)).id,Mi(t,`stream.id`))}},...Oi(n,`causationId`,t),...Oi(n,`correlationId`,t),payload:n.payload}},gf=(e,t=``)=>{let n=Si(e,t);return{runnerId:wi(n.runnerId,Mi(t,`runnerId`)),status:wi(n.status,Mi(t,`status`)),available:Ei(n.available,Mi(t,`available`)),...Oi(n,`detail`,t),updatedAt:wi(n.updatedAt,Mi(t,`updatedAt`))}},_f=(e,t=``)=>{let n=Si(e,t);return{runId:wi(n.runId,Mi(t,`runId`)),...Oi(n,`groupId`,t),available:Ei(n.available,Mi(t,`available`)),entries:Ci(n.entries,Mi(t,`entries`),(e,t=``)=>{let n=Si(e,t);return{occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),channel:xf(n.channel,Mi(t,`channel`)),text:wi(n.text,Mi(t,`text`)),runId:wi(n.runId,Mi(t,`runId`)),groupId:wi(n.groupId,Mi(t,`groupId`)),...ki(n,`durationMs`,t)}})}},vf=(e,t=``)=>{let n=Si(e,t);return{groupId:wi(n.groupId,Mi(t,`groupId`)),available:Ei(n.available,Mi(t,`available`)),entries:Ci(n.entries,Mi(t,`entries`),yf)}};function yf(e,t=``){let n=Si(e,t);return{occurredAt:wi(n.occurredAt,Mi(t,`occurredAt`)),channel:xf(n.channel,Mi(t,`channel`)),text:wi(n.text,Mi(t,`text`)),runId:wi(n.runId,Mi(t,`runId`)),groupId:wi(n.groupId,Mi(t,`groupId`)),...ki(n,`durationMs`,t)}}function bf(e,t){return{href:wi(Si(e,t).href,Mi(t,`href`))}}function xf(e,t){let n=wi(e,t);return n!==Cd.Input&&n!==Cd.Agent&&Ni(t),n}function Sf(e,t){let n=wi(e,t);return n!==Td.Session&&n!==Td.Run&&Ni(t),n}function Cf(e,t=``){let n=Si(e,t);return{resourceId:wi(n.resourceId,Mi(t,`resourceId`)),state:wi(n.state,Mi(t,`state`)),...Ai(n,`frozen`,t),...Ai(n,`deleted`,t),headRevision:wi(n.headRevision,Mi(t,`headRevision`)),baseRevision:wi(n.baseRevision,Mi(t,`baseRevision`)),checks:wi(n.checks,Mi(t,`checks`))}}function wf(e,t){let n=Si(e,t),r=wi(n.status,Mi(t,`status`));if(r!==`awaiting-human-merge`&&r!==`recovering`)throw Error(`${t}.status: invalid merge policy status`);let i=n.policy===void 0?void 0:Si(n.policy,Mi(t,`policy`));return{status:r,explanation:wi(n.explanation,Mi(t,`explanation`)),nextAction:wi(n.nextAction,Mi(t,`nextAction`)),...Oi(n,`href`,t),...i===void 0?{}:{policy:{...i.blockedPaths===void 0?{}:{blockedPaths:Ci(i.blockedPaths,Mi(t,`policy.blockedPaths`),wi)},...i.matchedPaths===void 0?{}:{matchedPaths:Ci(i.matchedPaths,Mi(t,`policy.matchedPaths`),wi)},...ki(i,`maxFilesChanged`,Mi(t,`policy`)),...ki(i,`filesChanged`,Mi(t,`policy`))}}}}function Tf(e){let t=Si(e,`operatorInstructions`);return{...Oi(t,`content`,`operatorInstructions`),...Oi(t,`author`,`operatorInstructions`),...Oi(t,`occurredAt`,`operatorInstructions`),contextScope:wi(t.contextScope,`operatorInstructions.contextScope`),revisionId:t.revisionId===null?null:wi(t.revisionId,`operatorInstructions.revisionId`)}}var Ef=(e,t=``)=>{let n=Si(e,t);return{id:wi(n.id,Mi(t,`id`)),title:wi(n.title,Mi(t,`title`))}},Df=(e,t=``)=>Ci(e,t,Ef);function Of(e,t){let n=Si(e,t),r=Object.values(ud).find(e=>e===n.id);return r===void 0&&Ni(Mi(t,`id`)),{id:r,from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`)),bucketMs:Di(n.bucketMs,Mi(t,`bucketMs`))}}function kf(e,t){return Object.fromEntries(Object.entries(Si(e,t)).map(([e,n])=>[e,Di(n,Mi(t,e))]))}var Af=(e,t=``)=>{let n=Si(e,t);return`dimensions`in n?{report:Ef(n.report,Mi(t,`report`)),window:Of(n.window,Mi(t,`window`)),total:Di(n.total,Mi(t,`total`)),dimensions:Ci(n.dimensions,Mi(t,`dimensions`),(e,t=``)=>{let n=Si(e,t);return{...Ef(e,t),rows:Ci(n.rows,Mi(t,`rows`),(e,t=``)=>{let n=Si(e,t);return{value:wi(n.value,Mi(t,`value`)),count:Di(n.count,Mi(t,`count`)),share:Di(n.share,Mi(t,`share`))}})}})}:{report:Ef(n.report,Mi(t,`report`)),window:Of(n.window,Mi(t,`window`)),series:Ci(n.series,Mi(t,`series`),Ef),totals:kf(n.totals,Mi(t,`totals`)),buckets:Ci(n.buckets,Mi(t,`buckets`),(e,t=``)=>{let n=Si(e,t);return{from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`)),values:kf(n.values,Mi(t,`values`))}})}},jf=Object.keys({completed:!0,failed:!0}),Mf={Completed:jf[0],Failed:jf[1]},Nf=(e,t=``)=>{let n=Si(e,t),r=e=>Di(n[e],Mi(t,e)),i=e=>n[e]===null?null:r(e);return{window:Of(n.window,Mi(t,`window`)),runs:r(`runs`),completed:r(Mf.Completed),blockedOrAwaitingApproval:r(`blockedOrAwaitingApproval`),failed:r(Mf.Failed),totalTokens:r(`totalTokens`),totalCostUsd:r(`totalCostUsd`),medianRunDurationMs:i(`medianRunDurationMs`),workItemsDone:r(`workItemsDone`),medianEndToEndDurationMs:i(`medianEndToEndDurationMs`)}},Pf=(e,t=``)=>{let n=Si(e,t),r=Si(n.values,Mi(t,`values`));return{collectedAt:wi(n.collectedAt,Mi(t,`collectedAt`)),window:Ff(n.window,Mi(t,`window`)),values:Object.fromEntries(Object.entries(r).map(([e,n])=>[e,Di(n,Mi(t,`values.${e}`))]))}};function Ff(e,t){let n=Si(e,t);return{days:Di(n.days,Mi(t,`days`)),from:wi(n.from,Mi(t,`from`)),to:wi(n.to,Mi(t,`to`))}}var If=(e,t=``)=>{let n=Si(e,t);return{status:Vf(n.status,Mi(t,`status`)),version:wi(n.version,Mi(t,`version`)),checkedAt:wi(n.checkedAt,Mi(t,`checkedAt`)),...n.checks===void 0?{}:{checks:Ci(n.checks,Mi(t,`checks`),(e,t=``)=>{let n=Si(e,t);return{name:wi(n.name,Mi(t,`name`)),status:Vf(n.status,Mi(t,`status`)),...Oi(n,`detail`,t)}})},...n.adapters===void 0?{}:{adapters:Ci(n.adapters,Mi(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,Mi(t,`adapterId`)),provider:wi(n.provider,Mi(t,`provider`)),scope:wi(n.scope,Mi(t,`scope`)),channel:wi(n.channel,Mi(t,`channel`)),status:Hf(n.status,Mi(t,`status`)),successCount:Di(n.successCount,Mi(t,`successCount`)),failureCount:Di(n.failureCount,Mi(t,`failureCount`)),...Oi(n,`detail`,t)}})}}},Lf=(e,t=``)=>{let n=Si(e,t),r=Mi(t,`configuration`);return{configuration:Si(ji(n.configuration,r),r)}},Rf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,Mi(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,Mi(t,`adapterId`)),provider:wi(n.provider,Mi(t,`provider`)),commands:Ci(n.commands,Mi(t,`commands`),(e,t=``)=>({syntax:wi(Si(e,t).syntax,Mi(t,`syntax`))}))}})}),zf=(e,t=``)=>({adapters:Ci(Si(e,t).adapters,Mi(t,`adapters`),(e,t=``)=>{let n=Si(e,t);return{adapter:wi(n.adapter,Mi(t,`adapter`)),provider:wi(n.provider,Mi(t,`provider`)),hooks:Ci(n.hooks,Mi(t,`hooks`),(e,t=``)=>{let n=Si(e,t);return{scope:wi(n.scope,Mi(t,`scope`)),endpoint:wi(n.endpoint,Mi(t,`endpoint`)),events:Ci(n.events,Mi(t,`events`),wi),secret:wi(n.secret,Mi(t,`secret`))}})}})});function Bf(e,t){try{let t=Si(e,`problem`);return{type:wi(t.type,`problem.type`),title:wi(t.title,`problem.title`),status:Di(t.status,`problem.status`),...Oi(t,`detail`,`problem`),...Oi(t,`instance`,`problem`),...Oi(t,`code`,`problem`),...t.retryable===void 0?{}:{retryable:Ei(t.retryable,`problem.retryable`)},...t.current===void 0?{}:{current:ji(t.current,`problem.current`)},...t.violations===void 0?{}:{violations:Ci(t.violations,`problem.violations`,(e,t=``)=>{let n=Si(e,t);return{path:wi(n.path,Mi(t,`path`)),message:wi(n.message,Mi(t,`message`))}})}}}catch{return{type:`about:blank`,title:`Request failed`,status:t}}}function Vf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&Ni(t),n}function Hf(e,t){let n=wi(e,t);return n!==`ok`&&n!==`degraded`&&n!==zd.Unknown&&Ni(t),n}var Uf=Nu({triggerId:$l(),coordinationKey:$l(),source:Gd,disposition:Vu(Od),sources:ju(Gd),manualOutcome:Jd.optional(),activeWorkItemId:$l().nullable()}),Wf=Nu({claim:Nu({triggerId:$l(),coordinationKey:$l(),source:Gd,sources:ju(Gd),workItemId:$l(),workflowInstanceId:$l(),workflowName:$l()}),claimedAt:$l(),startedAt:$l().optional(),finishedAt:$l().optional(),failureOutcomeCount:xu().optional(),result:Nu({triggerId:$l(),coordinationKey:$l(),workItemId:$l(),workflowInstanceId:$l(),status:Vu([jd.Completed,jd.Superseded]),reason:$l().optional()}).optional(),workItemKey:$l()}),Gf=Nu({operatorInstructions:Nu({contextScope:$l(),revisionId:$l(),content:$l(),author:$l(),occurredAt:$l()}).nullable().optional(),activeInvocation:Nu({activeWorkItemId:$l(),workItemKey:$l(),triggerId:$l(),workflowInstanceId:$l(),workflowStatus:Vu(Fd).nullable(),blockReason:$l().nullable(),retryEligible:Tu()}).nullable(),triggerId:$l(),status:Vu(Vd),definition:qd.nullable(),paused:Tu(),pauseReason:$l().nullable(),nextOccurrence:$l().nullable(),pending:ju(Uf),latestSkip:Kd.nullable(),invocations:ju(Wf)});function Kf(e){return Gf.parse(e)}function qf(e){return ju(Gf).parse(e)}function Jf(e){return ju(Nu({contextScope:$l(),revisionId:$l(),content:$l().nullable(),author:$l(),occurredAt:$l()})).parse(e)}var Yf=class extends Error{constructor(e){super(e.detail??e.title),this.problem=e,this.name=`ApiProblem`}},Xf=class{constructor(e=fetch,t=`/api/v1`){this.fetchImplementation=e,this.baseUrl=t,this.auth={session:async()=>{let e=this.fetchImplementation;return(await e(`${this.baseUrl}/auth/session`)).ok},login:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({accessKey:e})})).ok},redeem:async e=>{let t=this.fetchImplementation;return(await t(`${this.baseUrl}/auth/redeem`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({grant:e})})).ok}},this.triggers={list:e=>this.get(`/triggers`,e=>{let t=Xd(qf)(e),n=Si(e,`triggers`);return{...t,orphanedInstructions:Jf(n.orphanedInstructions??[])}},e),detail:(e,t)=>this.get(`/triggers/`+encodeURIComponent(e),Xd(Kf),t),saveInstructions:(e,t,n,r)=>this.request(`/triggers/`+encodeURIComponent(e)+`/commands/instructions`,Xd(ef),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({content:t,expectedRevisionId:n,idempotencyKey:r})}),command:(e,t,n,r)=>this.command(`/triggers/`+encodeURIComponent(e)+`/commands/`+t,n,ef,r)},this.board={list:(e,t)=>this.get(`/board${Zf({cursor:e})}`,Zd(nf),t)},this.status={get:e=>this.get(`/status`,Xd(e=>e),e)},this.controlPlane={status:e=>this.get(`/control-plane/status`,Xd(Qd),e),pauseDispatch:(e,t)=>this.command(`/control-plane/commands/pause-dispatch`,e,ef,t),resumeDispatch:(e,t)=>this.command(`/control-plane/commands/resume-dispatch`,e,ef,t),clearMaintenance:(e,t,n)=>this.request(`/control-plane/commands/clear-maintenance`,Xd(ef),{method:`POST`,body:JSON.stringify({attemptId:e,idempotencyKey:t}),headers:{"content-type":`application/json`},...n===void 0?{}:{signal:n}})},this.work={list:(e={},t)=>this.get(`/work-items${Zf(e)}`,Zd(tf),t),detail:(e,t)=>this.get(`/work-items/${encodeURIComponent(e)}`,Xd(mf),t),artifactText:async(e,t,n)=>{let r=this.fetchImplementation,i=await r(`${this.baseUrl}/work-items/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,{...n===void 0?{}:{signal:n}});if(!i.ok)throw Error(`Unable to load this artifact. Please try again.`);return i.text()},transcript:(e,t,n)=>this.get(`/work-items/${encodeURIComponent(e)}/transcripts/${encodeURIComponent(t)}`,Xd(vf),n),message:(e,t,n,r,i)=>this.request(`/work-items/${encodeURIComponent(e)}/commands/message`,Xd(ef),{method:`POST`,body:JSON.stringify({idempotencyKey:n,body:t,...i===void 0?{}:{continuation:i}}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),command:(e,t,n,r)=>this.command(`/work-items/${encodeURIComponent(e)}/commands/${t}`,n,ef,r)},this.resources={list:(e,t)=>this.get(`/resources${Zf({cursor:e})}`,Zd(of),t)},this.orchestration={list:(e,t)=>this.get(`/workflow-instances${Zf({cursor:e})}`,Zd(sf),t)},this.workflowDiagrams={get:(e,t)=>this.get(`/workflow-diagrams${Zf({workItemKey:e})}`,Xd(mee),t)},this.execution={runs:(e,t)=>this.get(`/runs${Zf({cursor:e})}`,Zd(pf),t),run:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}`,Xd(pf),t),transcript:(e,t)=>this.get(`/runs/${encodeURIComponent(e)}/transcript`,Xd(_f),t),resolveAmbiguousRun:(e,t,n,r)=>this.request(`/runs/${encodeURIComponent(e)}/commands/resolve`,Xd(ef),{method:`POST`,body:JSON.stringify({idempotencyKey:n,...t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}}),runners:e=>this.get(`/runners`,Zd(gf),e),pauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/pause`,t,ef,n),unpauseRunner:(e,t,n)=>this.command(`/runners/${encodeURIComponent(e)}/commands/unpause`,t,ef,n)},this.events={list:(e,t,n)=>{let r=typeof t==`string`?t:void 0,i=typeof t==`string`?n:t;return this.get(`/events${Zf({cursor:e,workItemKey:r})}`,Zd(hf),i)}},this.observability={reports:e=>this.get(`/observability/reports`,Xd(Df),e),report:(e,t,n)=>this.get(`/observability/reports`+Zf({window:e,report:t}),Xd(Af),n),summary:(e,t)=>this.get(`/observability/summary`+Zf({window:e}),Xd(Nf),t),metrics:(e=7,t)=>this.get(`/observability/metrics${Zf({days:String(e)})}`,Xd(Pf),t)},this.system={health:e=>this.get(`/system/health`,Xd(If),e),configuration:e=>this.get(`/system/configuration`,Xd(Lf),e),commands:e=>this.get(`/system/commands`,Xd(Rf),e),webhooks:e=>this.get(`/system/webhooks`,Xd(zf),e)}}async command(e,t,n,r){return this.request(e,Xd(n),{method:`POST`,body:JSON.stringify({idempotencyKey:t}),headers:{"content-type":`application/json`},...r===void 0?{}:{signal:r}})}get(e,t,n){return this.request(e,t,n===void 0?{}:{signal:n})}async request(e,t,n){let r=this.fetchImplementation,i=await r(`${this.baseUrl}${e}`,{...n,headers:{accept:`application/json, application/problem+json`,...n.headers}}),a=await i.json();if(!i.ok)throw new Yf(Bf(a,i.status));return t(a)}};function Zf(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&t.set(n,r);let n=t.toString();return n===``?``:`?${n}`}var Qf=(0,C.createContext)(null);function $f(){let e=(0,C.useContext)(Qf);if(e===null)throw Error(`WakeApiClient is not configured`);return e}var ep={prefix:`fas`,iconName:`filter`,icon:[512,512,[],`f0b0`,`M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z`]},tp={prefix:`fas`,iconName:`table-columns`,icon:[448,512,[`columns`],`f0db`,`M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 128 0 0-256-128 0zm320 0l-128 0 0 256 128 0 0-256z`]},hee={prefix:`fas`,iconName:`paper-plane`,icon:[576,512,[61913],`f1d8`,`M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z`]},np={prefix:`fas`,iconName:`chevron-right`,icon:[320,512,[9002],`f054`,`M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z`]},gee={prefix:`fas`,iconName:`heart-pulse`,icon:[512,512,[`heartbeat`],`f21e`,`M256 107.9L241 87.1C216 52.5 175.9 32 133.1 32 59.6 32 0 91.6 0 165.1l0 2.6c0 23.6 6.2 48 16.6 72.3l106 0c3.2 0 6.1-1.9 7.4-4.9l31.8-76.3c3.7-8.8 12.3-14.6 21.8-14.8s18.3 5.4 22.2 14.1l51.3 113.9 41.4-82.8c4.1-8.1 12.4-13.3 21.5-13.3s17.4 5.1 21.5 13.3l23.2 46.3c1.4 2.7 4.1 4.4 7.2 4.4l123.6 0c10.5-24.3 16.6-48.7 16.6-72.3l0-2.6C512 91.6 452.4 32 378.9 32 336.2 32 296 52.5 271 87.1l-15 20.7zM469.6 288l-97.8 0c-21.2 0-40.6-12-50.1-31l-1.7-3.4-42.5 85.1c-4.1 8.3-12.7 13.5-22 13.3s-17.6-5.7-21.4-14.1l-49.3-109.5-10.5 25.2c-8.7 20.9-29.1 34.5-51.7 34.5l-80.2 0c47.2 73.8 123 141.7 170.4 177.9 12.4 9.4 27.6 14.1 43.1 14.1s30.8-4.6 43.1-14.1C346.6 429.7 422.4 361.8 469.6 288z`]},rp={prefix:`fas`,iconName:`chart-line`,icon:[512,512,[`line-chart`],`f201`,`M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7 262.6 153.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l73.4-73.4 57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z`]},_ee={prefix:`fas`,iconName:`play`,icon:[448,512,[9654],`f04b`,`M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z`]},ip={prefix:`fas`,iconName:`sliders`,icon:[512,512,[`sliders-h`],`f1de`,`M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 224zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384z`]},ap={prefix:`fas`,iconName:`chevron-down`,icon:[448,512,[],`f078`,`M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`]},op={prefix:`fas`,iconName:`clock-rotate-left`,icon:[576,512,[`history`],`f1da`,`M288 64c106 0 192 86 192 192S394 448 288 448c-65.2 0-122.9-32.5-157.6-82.3-10.1-14.5-30.1-18-44.6-7.9s-18 30.1-7.9 44.6C124.1 468.6 201 512 288 512 429.4 512 544 397.4 544 256S429.4 0 288 0C202.3 0 126.5 42.1 80 106.7L80 80c0-17.7-14.3-32-32-32S16 62.3 16 80l0 112c0 17.7 14.3 32 32 32l24.6 0c.5 0 1 0 1.5 0l86 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-38.3 0C154.9 102.6 217 64 288 64zm24 88c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1z`]},vee={prefix:`fas`,iconName:`hourglass-half`,icon:[384,512,[`hourglass-2`],`f252`,`M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z`]},sp={prefix:`fas`,iconName:`chevron-left`,icon:[320,512,[9001],`f053`,`M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z`]},yee={prefix:`fas`,iconName:`arrow-down-wide-short`,icon:[576,512,[`sort-amount-asc`,`sort-amount-down`],`f160`,`M246.6 374.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0l-96-96c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L96 370.7 96 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 306.7 41.4-41.4c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-96 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-160 0zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L320 96z`]},cp={prefix:`fas`,iconName:`bars`,icon:[448,512,[`navicon`],`f0c9`,`M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z`]},lp={prefix:`fas`,iconName:`list-check`,icon:[512,512,[`tasks`],`f0ae`,`M133.8 36.3c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 158 47 153L7 113C-2.3 103.6-2.3 88.4 7 79S31.6 69.7 41 79l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zm0 160c10.9 7.6 13.5 22.6 5.9 33.4l-56 80c-4.1 5.8-10.5 9.5-17.6 10.1S52 318 47 313L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l19.8 19.8 39.6-56.6c7.6-10.9 22.6-13.5 33.4-5.9zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM64 376a40 40 0 1 1 0 80 40 40 0 1 1 0-80z`]};function up(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dp(e){if(Array.isArray(e))return e}function fp(e){if(Array.isArray(e))return up(e)}function pp(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Dp(r.key),r)}}function hp(e,t,n){return t&&mp(e.prototype,t),n&&mp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gp(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=kp(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
75
75
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function _p(e,t,n){return(t=Dp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vp(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function yp(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bp(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
76
76
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xp(){throw TypeError(`Invalid attempt to spread non-iterable instance.
77
77
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Sp(Object(n),!0).forEach(function(t){_p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wp(e,t){return dp(e)||yp(e,t)||kp(e,t)||bp()}function Tp(e){return fp(e)||vp(e)||kp(e)||xp()}function Ep(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Dp(e){var t=Ep(e,`string`);return typeof t==`symbol`?t:t+``}function Op(e){"@babel/helpers - typeof";return Op=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Op(e)}function kp(e,t){if(e){if(typeof e==`string`)return up(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?up(e,t):void 0}}var Ap=function(){},jp={},Mp={},Np=null,Pp={mark:Ap,measure:Ap};try{typeof window<`u`&&(jp=window),typeof document<`u`&&(Mp=document),typeof MutationObserver<`u`&&(Np=MutationObserver),typeof performance<`u`&&(Pp=performance)}catch{}var Fp=(jp.navigator||{}).userAgent,Ip=Fp===void 0?``:Fp,Lp=jp,Rp=Mp,zp=Np,Bp=Pp;Lp.document;var Vp=!!Rp.documentElement&&!!Rp.head&&typeof Rp.addEventListener==`function`&&typeof Rp.createElement==`function`,Hp=~Ip.indexOf(`MSIE`)||~Ip.indexOf(`Trident/`),Up,Wp=/fa(k|kd|s|r|l|t|d|dr|dl|dt|b|slr|slpr|wsb|tl|ns|nds|es|gt|jr|jfr|jdr|usb|ufsb|udsb|cr|ss|sr|sl|st|sds|sdr|sdl|sdt|sldr|slpdr|pr|ms|vs)?[\-\ ]/,Gp=/Font ?Awesome ?([567 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit|Notdog Duo|Notdog|Chisel|Etch|Graphite|Thumbprint|Jelly Fill|Jelly Duo|Jelly|Utility|Utility Fill|Utility Duo|Slab Press|Slab|Slab Duo|Slab Press Duo|Pixel|Mosaic|Vellum|Whiteboard)?.*/i,Kp={classic:{fa:`solid`,fas:`solid`,"fa-solid":`solid`,far:`regular`,"fa-regular":`regular`,fal:`light`,"fa-light":`light`,fat:`thin`,"fa-thin":`thin`,fab:`brands`,"fa-brands":`brands`},duotone:{fa:`solid`,fad:`solid`,"fa-solid":`solid`,"fa-duotone":`solid`,fadr:`regular`,"fa-regular":`regular`,fadl:`light`,"fa-light":`light`,fadt:`thin`,"fa-thin":`thin`},sharp:{fa:`solid`,fass:`solid`,"fa-solid":`solid`,fasr:`regular`,"fa-regular":`regular`,fasl:`light`,"fa-light":`light`,fast:`thin`,"fa-thin":`thin`},"sharp-duotone":{fa:`solid`,fasds:`solid`,"fa-solid":`solid`,fasdr:`regular`,"fa-regular":`regular`,fasdl:`light`,"fa-light":`light`,fasdt:`thin`,"fa-thin":`thin`},slab:{"fa-regular":`regular`,faslr:`regular`},"slab-press":{"fa-regular":`regular`,faslpr:`regular`},"slab-duo":{"fa-regular":`regular`,fasldr:`regular`},"slab-press-duo":{"fa-regular":`regular`,faslpdr:`regular`},thumbprint:{"fa-light":`light`,fatl:`light`},vellum:{"fa-solid":`solid`,favs:`solid`},pixel:{"fa-regular":`regular`,fapr:`regular`},mosaic:{"fa-solid":`solid`,fams:`solid`},whiteboard:{"fa-semibold":`semibold`,fawsb:`semibold`},notdog:{"fa-solid":`solid`,fans:`solid`},"notdog-duo":{"fa-solid":`solid`,fands:`solid`},etch:{"fa-solid":`solid`,faes:`solid`},graphite:{"fa-thin":`thin`,fagt:`thin`},jelly:{"fa-regular":`regular`,fajr:`regular`},"jelly-fill":{"fa-regular":`regular`,fajfr:`regular`},"jelly-duo":{"fa-regular":`regular`,fajdr:`regular`},chisel:{"fa-regular":`regular`,facr:`regular`},utility:{"fa-semibold":`semibold`,fausb:`semibold`},"utility-duo":{"fa-semibold":`semibold`,faudsb:`semibold`},"utility-fill":{"fa-semibold":`semibold`,faufsb:`semibold`}},qp={GROUP:`duotone-group`,SWAP_OPACITY:`swap-opacity`,PRIMARY:`primary`,SECONDARY:`secondary`},bee=[`fa-classic`,`fa-duotone`,`fa-sharp`,`fa-sharp-duotone`,`fa-thumbprint`,`fa-whiteboard`,`fa-notdog`,`fa-notdog-duo`,`fa-chisel`,`fa-etch`,`fa-graphite`,`fa-jelly`,`fa-jelly-fill`,`fa-jelly-duo`,`fa-slab`,`fa-slab-press`,`fa-slab-press-duo`,`fa-slab-duo`,`fa-mosaic`,`fa-pixel`,`fa-vellum`,`fa-utility`,`fa-utility-duo`,`fa-utility-fill`],Jp=`classic`,Yp=`duotone`,xee=`sharp`,See=`sharp-duotone`,Cee=`chisel`,wee=`etch`,Tee=`graphite`,Eee=`jelly`,Dee=`jelly-duo`,Oee=`jelly-fill`,kee=`mosaic`,Aee=`notdog`,jee=`notdog-duo`,Mee=`pixel`,Nee=`slab`,Xp=`slab-duo`,Pee=`slab-press`,Zp=`slab-press-duo`,Qp=`thumbprint`,$p=`utility`,em=`utility-duo`,Fee=`utility-fill`,tm=`vellum`,nm=`whiteboard`,rm=`Classic`,Iee=`Duotone`,im=`Sharp`,am=`Sharp Duotone`,om=`Chisel`,sm=`Etch`,cm=`Graphite`,lm=`Jelly`,um=`Jelly Duo`,dm=`Jelly Fill`,fm=`Mosaic`,Lee=`Notdog`,Ree=`Notdog Duo`,zee=`Pixel`,Bee=`Slab`,Vee=`Slab Duo`,Hee=`Slab Press`,Uee=`Slab Press Duo`,pm=`Thumbprint`,E=`Utility`,Wee=`Utility Duo`,Gee=`Utility Fill`,Kee=`Vellum`,qee=`Whiteboard`,mm=[Jp,Yp,xee,See,Cee,wee,Tee,Eee,Dee,Oee,kee,Aee,jee,Mee,Nee,Xp,Pee,Zp,Qp,$p,em,Fee,tm,nm];Up={},_p(_p(_p(_p(_p(_p(_p(_p(_p(_p(Up,Jp,rm),Yp,Iee),xee,im),See,am),Cee,om),wee,sm),Tee,cm),Eee,lm),Dee,um),Oee,dm),_p(_p(_p(_p(_p(_p(_p(_p(_p(_p(Up,kee,fm),Aee,Lee),jee,Ree),Mee,zee),Nee,Bee),Xp,Vee),Pee,Hee),Zp,Uee),Qp,pm),$p,E),_p(_p(_p(_p(Up,em,Wee),Fee,Gee),tm,Kee),nm,qee);var hm={classic:{900:`fas`,400:`far`,normal:`far`,300:`fal`,100:`fat`},duotone:{900:`fad`,400:`fadr`,300:`fadl`,100:`fadt`},sharp:{900:`fass`,400:`fasr`,300:`fasl`,100:`fast`},"sharp-duotone":{900:`fasds`,400:`fasdr`,300:`fasdl`,100:`fasdt`},slab:{400:`faslr`},"slab-press":{400:`faslpr`},"slab-duo":{400:`fasldr`},"slab-press-duo":{400:`faslpdr`},vellum:{900:`favs`},mosaic:{900:`fams`},pixel:{400:`fapr`},whiteboard:{600:`fawsb`},thumbprint:{300:`fatl`},notdog:{900:`fans`},"notdog-duo":{900:`fands`},etch:{900:`faes`},graphite:{100:`fagt`},chisel:{400:`facr`},jelly:{400:`fajr`},"jelly-fill":{400:`fajfr`},"jelly-duo":{400:`fajdr`},utility:{600:`fausb`},"utility-duo":{600:`faudsb`},"utility-fill":{600:`faufsb`}},Jee={"Font Awesome 7 Free":{900:`fas`,400:`far`},"Font Awesome 7 Pro":{900:`fas`,400:`far`,normal:`far`,300:`fal`,100:`fat`},"Font Awesome 7 Brands":{400:`fab`,normal:`fab`},"Font Awesome 7 Duotone":{900:`fad`,400:`fadr`,normal:`fadr`,300:`fadl`,100:`fadt`},"Font Awesome 7 Sharp":{900:`fass`,400:`fasr`,normal:`fasr`,300:`fasl`,100:`fast`},"Font Awesome 7 Sharp Duotone":{900:`fasds`,400:`fasdr`,normal:`fasdr`,300:`fasdl`,100:`fasdt`},"Font Awesome 7 Jelly":{400:`fajr`,normal:`fajr`},"Font Awesome 7 Jelly Fill":{400:`fajfr`,normal:`fajfr`},"Font Awesome 7 Jelly Duo":{400:`fajdr`,normal:`fajdr`},"Font Awesome 7 Slab":{400:`faslr`,normal:`faslr`},"Font Awesome 7 Slab Press":{400:`faslpr`,normal:`faslpr`},"Font Awesome 7 Slab Duo":{400:`fasldr`,normal:`fasldr`},"Font Awesome 7 Slab Press Duo":{400:`faslpdr`,normal:`faslpdr`},"Font Awesome 7 Pixel":{400:`fapr`,normal:`fapr`},"Font Awesome 7 Mosaic":{900:`fams`,normal:`fams`},"Font Awesome 7 Vellum":{900:`favs`,normal:`favs`},"Font Awesome 7 Thumbprint":{300:`fatl`,normal:`fatl`},"Font Awesome 7 Notdog":{900:`fans`,normal:`fans`},"Font Awesome 7 Notdog Duo":{900:`fands`,normal:`fands`},"Font Awesome 7 Etch":{900:`faes`,normal:`faes`},"Font Awesome 7 Graphite":{100:`fagt`,normal:`fagt`},"Font Awesome 7 Chisel":{400:`facr`,normal:`facr`},"Font Awesome 7 Whiteboard":{600:`fawsb`,normal:`fawsb`},"Font Awesome 7 Utility":{600:`fausb`,normal:`fausb`},"Font Awesome 7 Utility Duo":{600:`faudsb`,normal:`faudsb`},"Font Awesome 7 Utility Fill":{600:`faufsb`,normal:`faufsb`}},Yee=new Map([[`classic`,{defaultShortPrefixId:`fas`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`,`brands`],futureStyleIds:[],defaultFontWeight:900}],[`duotone`,{defaultShortPrefixId:`fad`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`],futureStyleIds:[],defaultFontWeight:900}],[`sharp`,{defaultShortPrefixId:`fass`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`],futureStyleIds:[],defaultFontWeight:900}],[`sharp-duotone`,{defaultShortPrefixId:`fasds`,defaultStyleId:`solid`,styleIds:[`solid`,`regular`,`light`,`thin`],futureStyleIds:[],defaultFontWeight:900}],[`chisel`,{defaultShortPrefixId:`facr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`etch`,{defaultShortPrefixId:`faes`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`graphite`,{defaultShortPrefixId:`fagt`,defaultStyleId:`thin`,styleIds:[`thin`],futureStyleIds:[],defaultFontWeight:100}],[`jelly`,{defaultShortPrefixId:`fajr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`jelly-duo`,{defaultShortPrefixId:`fajdr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`jelly-fill`,{defaultShortPrefixId:`fajfr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`mosaic`,{defaultShortPrefixId:`fams`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`notdog`,{defaultShortPrefixId:`fans`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`notdog-duo`,{defaultShortPrefixId:`fands`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`pixel`,{defaultShortPrefixId:`fapr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab`,{defaultShortPrefixId:`faslr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab-duo`,{defaultShortPrefixId:`fasldr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab-press`,{defaultShortPrefixId:`faslpr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`slab-press-duo`,{defaultShortPrefixId:`faslpdr`,defaultStyleId:`regular`,styleIds:[`regular`],futureStyleIds:[],defaultFontWeight:400}],[`thumbprint`,{defaultShortPrefixId:`fatl`,defaultStyleId:`light`,styleIds:[`light`],futureStyleIds:[],defaultFontWeight:300}],[`utility`,{defaultShortPrefixId:`fausb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}],[`utility-duo`,{defaultShortPrefixId:`faudsb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}],[`utility-fill`,{defaultShortPrefixId:`faufsb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}],[`vellum`,{defaultShortPrefixId:`favs`,defaultStyleId:`solid`,styleIds:[`solid`],futureStyleIds:[],defaultFontWeight:900}],[`whiteboard`,{defaultShortPrefixId:`fawsb`,defaultStyleId:`semibold`,styleIds:[`semibold`],futureStyleIds:[],defaultFontWeight:600}]]),gm={chisel:{regular:`facr`},classic:{brands:`fab`,light:`fal`,regular:`far`,solid:`fas`,thin:`fat`},duotone:{light:`fadl`,regular:`fadr`,solid:`fad`,thin:`fadt`},etch:{solid:`faes`},graphite:{thin:`fagt`},jelly:{regular:`fajr`},"jelly-duo":{regular:`fajdr`},"jelly-fill":{regular:`fajfr`},mosaic:{solid:`fams`},notdog:{solid:`fans`},"notdog-duo":{solid:`fands`},pixel:{regular:`fapr`},sharp:{light:`fasl`,regular:`fasr`,solid:`fass`,thin:`fast`},"sharp-duotone":{light:`fasdl`,regular:`fasdr`,solid:`fasds`,thin:`fasdt`},slab:{regular:`faslr`},"slab-duo":{regular:`fasldr`},"slab-press":{regular:`faslpr`},"slab-press-duo":{regular:`faslpdr`},thumbprint:{light:`fatl`},utility:{semibold:`fausb`},"utility-duo":{semibold:`faudsb`},"utility-fill":{semibold:`faufsb`},vellum:{solid:`favs`},whiteboard:{semibold:`fawsb`}},_m=[`fak`,`fa-kit`,`fakd`,`fa-kit-duotone`],vm={kit:{fak:`kit`,"fa-kit":`kit`},"kit-duotone":{fakd:`kit-duotone`,"fa-kit-duotone":`kit-duotone`}},Xee=[`kit`];_p(_p({},`kit`,`Kit`),`kit-duotone`,`Kit Duotone`);var Zee={kit:{"fa-kit":`fak`},"kit-duotone":{"fa-kit-duotone":`fakd`}},Qee={"Font Awesome Kit":{400:`fak`,normal:`fak`},"Font Awesome Kit Duotone":{400:`fakd`,normal:`fakd`}},$ee={kit:{fak:`fa-kit`},"kit-duotone":{fakd:`fa-kit-duotone`}},ym={kit:{kit:`fak`},"kit-duotone":{"kit-duotone":`fakd`}},bm,xm={GROUP:`duotone-group`,SWAP_OPACITY:`swap-opacity`,PRIMARY:`primary`,SECONDARY:`secondary`},ete=[`fa-classic`,`fa-duotone`,`fa-sharp`,`fa-sharp-duotone`,`fa-thumbprint`,`fa-whiteboard`,`fa-notdog`,`fa-notdog-duo`,`fa-chisel`,`fa-etch`,`fa-graphite`,`fa-jelly`,`fa-jelly-fill`,`fa-jelly-duo`,`fa-slab`,`fa-slab-press`,`fa-slab-press-duo`,`fa-slab-duo`,`fa-mosaic`,`fa-pixel`,`fa-vellum`,`fa-utility`,`fa-utility-duo`,`fa-utility-fill`];bm={},_p(_p(_p(_p(_p(_p(_p(_p(_p(_p(bm,`classic`,`Classic`),`duotone`,`Duotone`),`sharp`,`Sharp`),`sharp-duotone`,`Sharp Duotone`),`chisel`,`Chisel`),`etch`,`Etch`),`graphite`,`Graphite`),`jelly`,`Jelly`),`jelly-duo`,`Jelly Duo`),`jelly-fill`,`Jelly Fill`),_p(_p(_p(_p(_p(_p(_p(_p(_p(_p(bm,`mosaic`,`Mosaic`),`notdog`,`Notdog`),`notdog-duo`,`Notdog Duo`),`pixel`,`Pixel`),`slab`,`Slab`),`slab-duo`,`Slab Duo`),`slab-press`,`Slab Press`),`slab-press-duo`,`Slab Press Duo`),`thumbprint`,`Thumbprint`),`utility`,`Utility`),_p(_p(_p(_p(bm,`utility-duo`,`Utility Duo`),`utility-fill`,`Utility Fill`),`vellum`,`Vellum`),`whiteboard`,`Whiteboard`),_p(_p({},`kit`,`Kit`),`kit-duotone`,`Kit Duotone`);var tte={classic:{"fa-brands":`fab`,"fa-duotone":`fad`,"fa-light":`fal`,"fa-regular":`far`,"fa-solid":`fas`,"fa-thin":`fat`},duotone:{"fa-regular":`fadr`,"fa-light":`fadl`,"fa-thin":`fadt`},sharp:{"fa-solid":`fass`,"fa-regular":`fasr`,"fa-light":`fasl`,"fa-thin":`fast`},"sharp-duotone":{"fa-solid":`fasds`,"fa-regular":`fasdr`,"fa-light":`fasdl`,"fa-thin":`fasdt`},slab:{"fa-regular":`faslr`},"slab-press":{"fa-regular":`faslpr`},"slab-duo":{"fa-regular":`fasldr`},"slab-press-duo":{"fa-regular":`faslpdr`},pixel:{"fa-regular":`fapr`},mosaic:{"fa-solid":`fams`},vellum:{"fa-solid":`favs`},whiteboard:{"fa-semibold":`fawsb`},thumbprint:{"fa-light":`fatl`},notdog:{"fa-solid":`fans`},"notdog-duo":{"fa-solid":`fands`},etch:{"fa-solid":`faes`},graphite:{"fa-thin":`fagt`},jelly:{"fa-regular":`fajr`},"jelly-fill":{"fa-regular":`fajfr`},"jelly-duo":{"fa-regular":`fajdr`},chisel:{"fa-regular":`facr`},utility:{"fa-semibold":`fausb`},"utility-duo":{"fa-semibold":`faudsb`},"utility-fill":{"fa-semibold":`faufsb`}},Sm={classic:[`fas`,`far`,`fal`,`fat`,`fad`],duotone:[`fadr`,`fadl`,`fadt`],sharp:[`fass`,`fasr`,`fasl`,`fast`],"sharp-duotone":[`fasds`,`fasdr`,`fasdl`,`fasdt`],slab:[`faslr`],"slab-press":[`faslpr`],"slab-duo":[`fasldr`],"slab-press-duo":[`faslpdr`],pixel:[`fapr`],mosaic:[`fams`],vellum:[`favs`],whiteboard:[`fawsb`],thumbprint:[`fatl`],notdog:[`fans`],"notdog-duo":[`fands`],etch:[`faes`],graphite:[`fagt`],jelly:[`fajr`],"jelly-fill":[`fajfr`],"jelly-duo":[`fajdr`],chisel:[`facr`],utility:[`fausb`],"utility-duo":[`faudsb`],"utility-fill":[`faufsb`]},Cm={classic:{fab:`fa-brands`,fad:`fa-duotone`,fal:`fa-light`,far:`fa-regular`,fas:`fa-solid`,fat:`fa-thin`},duotone:{fadr:`fa-regular`,fadl:`fa-light`,fadt:`fa-thin`},sharp:{fass:`fa-solid`,fasr:`fa-regular`,fasl:`fa-light`,fast:`fa-thin`},"sharp-duotone":{fasds:`fa-solid`,fasdr:`fa-regular`,fasdl:`fa-light`,fasdt:`fa-thin`},slab:{faslr:`fa-regular`},"slab-press":{faslpr:`fa-regular`},"slab-duo":{fasldr:`fa-regular`},"slab-press-duo":{faslpdr:`fa-regular`},pixel:{fapr:`fa-regular`},mosaic:{fams:`fa-solid`},vellum:{favs:`fa-solid`},whiteboard:{fawsb:`fa-semibold`},thumbprint:{fatl:`fa-light`},notdog:{fans:`fa-solid`},"notdog-duo":{fands:`fa-solid`},etch:{faes:`fa-solid`},graphite:{fagt:`fa-thin`},jelly:{fajr:`fa-regular`},"jelly-fill":{fajfr:`fa-regular`},"jelly-duo":{fajdr:`fa-regular`},chisel:{facr:`fa-regular`},utility:{fausb:`fa-semibold`},"utility-duo":{faudsb:`fa-semibold`},"utility-fill":{faufsb:`fa-semibold`}},wm=`fa.fas.far.fal.fat.fad.fadr.fadl.fadt.fab.fass.fasr.fasl.fast.fasds.fasdr.fasdl.fasdt.faslr.faslpr.fasldr.faslpdr.fapr.fams.favs.fawsb.fatl.fans.fands.faes.fagt.fajr.fajfr.fajdr.facr.fausb.faudsb.faufsb`.split(`.`).concat(ete,[`fa-solid`,`fa-regular`,`fa-light`,`fa-thin`,`fa-duotone`,`fa-brands`,`fa-semibold`]),Tm=[`solid`,`regular`,`light`,`thin`,`duotone`,`brands`,`semibold`],Em=[1,2,3,4,5,6,7,8,9,10],nte=Em.concat([11,12,13,14,15,16,17,18,19,20]),Dm=[].concat(Tp(Object.keys(Sm)),Tm,[`aw`,`fw`,`pull-left`,`pull-right`],[`2xs`,`xs`,`sm`,`lg`,`xl`,`2xl`,`beat`,`beat-fade`,`border`,`bounce`,`buzz`,`canvas-square`,`canvas-roomy`,`fade`,`flip-360`,`flip-both`,`flip-horizontal`,`flip-vertical`,`flip`,`float`,`inverse`,`jello`,`layers`,`layers-bottom-left`,`layers-bottom-right`,`layers-counter`,`layers-text`,`layers-top-left`,`layers-top-right`,`li`,`pull-end`,`pull-start`,`pulse`,`rotate-180`,`rotate-270`,`rotate-90`,`rotate-by`,`shake`,`spin-pulse`,`spin-reverse`,`spin`,`spin-snap`,`spin-snap-4`,`spin-snap-8`,`stack-1x`,`stack-2x`,`stack`,`swing`,`ul`,`wag`,`width-auto`,`width-fixed`,xm.GROUP,xm.SWAP_OPACITY,xm.PRIMARY,xm.SECONDARY],Em.map(function(e){return`${e}x`}),nte.map(function(e){return`w-${e}`})),rte={"Font Awesome 5 Free":{900:`fas`,400:`far`},"Font Awesome 5 Pro":{900:`fas`,400:`far`,normal:`far`,300:`fal`},"Font Awesome 5 Brands":{400:`fab`,normal:`fab`},"Font Awesome 5 Duotone":{900:`fad`}},Om=`___FONT_AWESOME___`,km=16,Am=`fa`,jm=`svg-inline--fa`,Mm=`data-fa-i2svg`,Nm=`data-fa-pseudo-element`,Pm=`data-fa-pseudo-element-pending`,Fm=`data-prefix`,Im=`data-icon`,Lm=`fontawesome-i2svg`,ite=`async`,ate=[`HTML`,`HEAD`,`STYLE`,`SCRIPT`],Rm=[`::before`,`::after`,`:before`,`:after`],zm=function(){try{return!0}catch{return!1}}();function Bm(e){return new Proxy(e,{get:function(e,t){return t in e?e[t]:e[Jp]}})}var Vm=Cp({},Kp);Vm[Jp]=Cp(Cp(Cp(Cp({},{"fa-duotone":`duotone`}),Kp[Jp]),vm.kit),vm[`kit-duotone`]);var ote=Bm(Vm),Hm=Cp({},gm);Hm[Jp]=Cp(Cp(Cp(Cp({},{duotone:`fad`}),Hm[Jp]),ym.kit),ym[`kit-duotone`]);var Um=Bm(Hm),Wm=Cp({},Cm);Wm[Jp]=Cp(Cp({},Wm[Jp]),$ee.kit);var Gm=Bm(Wm),Km=Cp({},tte);Km[Jp]=Cp(Cp({},Km[Jp]),Zee.kit),Bm(Km);var ste=Wp,qm=`fa-layers-text`,cte=Gp;Bm(Cp({},hm));var lte=[`class`,`data-prefix`,`data-icon`,`data-fa-transform`,`data-fa-mask`],Jm=qp,ute=[].concat(Tp(Xee),Tp(Dm)),Ym=Lp.FontAwesomeConfig||{};function dte(e){var t=Rp.querySelector(`script[`+e+`]`);if(t)return t.getAttribute(e)}function fte(e){return e===``?!0:e===`false`?!1:e===`true`||e}Rp&&typeof Rp.querySelector==`function`&&[[`data-family-prefix`,`familyPrefix`],[`data-css-prefix`,`cssPrefix`],[`data-family-default`,`familyDefault`],[`data-style-default`,`styleDefault`],[`data-replacement-class`,`replacementClass`],[`data-auto-replace-svg`,`autoReplaceSvg`],[`data-auto-add-css`,`autoAddCss`],[`data-search-pseudo-elements`,`searchPseudoElements`],[`data-search-pseudo-elements-warnings`,`searchPseudoElementsWarnings`],[`data-search-pseudo-elements-full-scan`,`searchPseudoElementsFullScan`],[`data-observe-mutations`,`observeMutations`],[`data-mutate-approach`,`mutateApproach`],[`data-keep-original-source`,`keepOriginalSource`],[`data-measure-performance`,`measurePerformance`],[`data-show-missing-icons`,`showMissingIcons`]].forEach(function(e){var t=wp(e,2),n=t[0],r=t[1],i=fte(dte(n));i!=null&&(Ym[r]=i)});var Xm={styleDefault:`solid`,familyDefault:Jp,cssPrefix:Am,replacementClass:jm,autoReplaceSvg:!0,autoAddCss:!0,searchPseudoElements:!1,searchPseudoElementsWarnings:!0,searchPseudoElementsFullScan:!1,observeMutations:!0,mutateApproach:`async`,keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Ym.familyPrefix&&(Ym.cssPrefix=Ym.familyPrefix);var Zm=Cp(Cp({},Xm),Ym);Zm.autoReplaceSvg||(Zm.observeMutations=!1);var Qm={};Object.keys(Xm).forEach(function(e){Object.defineProperty(Qm,e,{enumerable:!0,set:function(t){Zm[e]=t,$m.forEach(function(e){return e(Qm)})},get:function(){return Zm[e]}})}),Object.defineProperty(Qm,"familyPrefix",{enumerable:!0,set:function(e){Zm.cssPrefix=e,$m.forEach(function(e){return e(Qm)})},get:function(){return Zm.cssPrefix}}),Lp.FontAwesomeConfig=Qm;var $m=[];function pte(e){return $m.push(e),function(){$m.splice($m.indexOf(e),1)}}var eh=km,th={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function mte(e){if(!(!e||!Vp)){var t=Rp.createElement(`style`);t.setAttribute(`type`,`text/css`),t.innerHTML=e;for(var n=Rp.head.childNodes,r=null,i=n.length-1;i>-1;i--){var a=n[i],o=(a.tagName||``).toUpperCase();[`STYLE`,`LINK`].indexOf(o)>-1&&(r=a)}return Rp.head.insertBefore(t,r),e}}var hte=`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`;function nh(){for(var e=12,t=``;e-->0;)t+=hte[Math.random()*62|0];return t}function rh(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function ih(e){return e.classList?rh(e.classList):(e.getAttribute(`class`)||``).split(` `).filter(function(e){return e})}function ah(e){return`${e}`.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function gte(e){return Object.keys(e||{}).reduce(function(t,n){return t+`${n}="${ah(e[n])}" `},``).trim()}function oh(e){return Object.keys(e||{}).reduce(function(t,n){return t+`${n}: ${e[n].trim()};`},``)}function sh(e){return e.size!==th.size||e.x!==th.x||e.y!==th.y||e.rotate!==th.rotate||e.flipX||e.flipY}function _te(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth;return{outer:{transform:`translate(${n/2} 256)`},inner:{transform:`${`translate(${t.x*32}, ${t.y*32}) `} ${`scale(${t.size/16*(t.flipX?-1:1)}, ${t.size/16*(t.flipY?-1:1)}) `} ${`rotate(${t.rotate} 0 0)`}`},path:{transform:`translate(${r/2*-1} -256)`}}}function vte(e){var t=e.transform,n=e.width,r=n===void 0?km:n,i=e.height,a=i===void 0?km:i,o=e.startCentered,s=o!==void 0&&o,c=``;return c+=s&&Hp?`translate(${t.x/eh-r/2}em, ${t.y/eh-a/2}em) `:s?`translate(calc(-50% + ${t.x/eh}em), calc(-50% + ${t.y/eh}em)) `:`translate(${t.x/eh}em, ${t.y/eh}em) `,c+=`scale(${t.size/eh*(t.flipX?-1:1)}, ${t.size/eh*(t.flipY?-1:1)}) `,c+=`rotate(${t.rotate}deg) `,c}var yte=`:root, :host {
@@ -1186,7 +1186,7 @@ Consider installing the package or pass your own 'workerFactory' to ELK's constr
1186
1186
  `});++r<e.length;)r&&n.push({type:`text`,value:`
1187
1187
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
1188
1188
  `}),n}function hx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gx(e,t){let n=loe(e,t),r=n.one(e,void 0),i=cx(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
1189
- `},i)),a}function moe(e,t){return e&&`run`in e?async function(n,r){let i=gx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gx(n,{file:r,...e||t})}}function _x(e){if(e)throw e}var hoe=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function vx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function goe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?yx(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function yx(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var bx={basename:_oe,dirname:voe,extname:yoe,join:boe,sep:`/`};function _oe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Cx(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function voe(e){if(Cx(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function yoe(e){Cx(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function boe(...e){let t=-1,n;for(;++t<e.length;)Cx(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:xx(n)}function xx(e){Cx(e);let t=e.codePointAt(0)===47,n=Sx(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Sx(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1)if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Cx(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var wx={cwd:Tx};function Tx(){return`/`}function Ex(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Dx(e){if(typeof e==`string`)e=new URL(e);else if(!Ex(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ox(e)}function Ox(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var kx=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ax=class{constructor(e){let t;t=e?Ex(e)?{path:e}:typeof e==`string`||Px(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:wx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<kx.length;){let e=kx[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)kx.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?bx.basename(this.path):void 0}set basename(e){Mx(e,`basename`),jx(e,`basename`),this.path=bx.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?bx.dirname(this.path):void 0}set dirname(e){Nx(this.basename,`dirname`),this.path=bx.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?bx.extname(this.path):void 0}set extname(e){if(jx(e,`extname`),Nx(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=bx.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ex(e)&&(e=Dx(e)),Mx(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?bx.basename(this.path,this.extname):void 0}set stem(e){Mx(e,`stem`),jx(e,`stem`),this.path=bx.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Zv(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function jx(e,t){if(e&&e.includes(bx.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+bx.sep+"`")}function Mx(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Nx(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Px(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Fx=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ix=l(hoe(),1),Lx={}.hasOwnProperty,Rx=new class e extends Fx{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=goe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ix.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Vx(`data`,this.frozen),this.namespace[e]=t,this):Lx.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Vx(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Wx(e),n=this.parser||this.Parser;return zx(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),zx(`process`,this.parser||this.Parser),Bx(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Wx(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);xoe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),zx(`processSync`,this.parser||this.Parser),Bx(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ux(`processSync`,`process`,t),n;function r(e,r){t=!0,_x(e),n=r}}run(e,t,n){Hx(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Wx(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Ux(`runSync`,`run`,n),r;function i(e,t){_x(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Wx(t),r=this.compiler||this.Compiler;return Bx(`stringify`,r),Hx(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Vx(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ix.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];vx(o)&&vx(r)&&(r=(0,Ix.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function zx(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Bx(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Vx(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hx(e){if(!vx(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ux(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wx(e){return Gx(e)?e:new Ax(e)}function Gx(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xoe(e){return typeof e==`string`||Soe(e)}function Soe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Coe=[],woe={allowDangerousHtml:!0},Toe=/^(https?|ircs?|mailto|xmpp)$/i,Eoe=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Kx(e){let t=Doe(e),n=Ooe(e);return koe(t.runSync(t.parse(n),n),e)}function Doe(e){let t=e.rehypePlugins||Coe,n=e.remarkPlugins||Coe,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...woe}:woe;return Rx().use(Nb).use(n).use(moe,r).use(t)}function Ooe(e){let t=e.children||``,n=new Ax;return typeof t==`string`?n.value=t:``+t,n}function koe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Aoe;for(let e of Eoe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return soe(e,l),ry(e,{Fragment:T.Fragment,components:i,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in fy)if(Object.hasOwn(fy,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=fy[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Aoe(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Toe.test(e.slice(0,t))?e:``}var qx={markdown:`_markdown_i5wt4_1`};function joe(){let e=$f(),t=Y_(),n=_i({queryKey:Ug.execution.runList(t.cursor),queryFn:({signal:n})=>e.execution.runs(t.cursor,n),refetchInterval:e=>Gg.runs(e.state.data?.items)});return(0,T.jsxs)(T.Fragment,{children:[n.isPending?(0,T.jsx)(Qg,{label:`Loading runs`}):n.error&&!n.data?(0,T.jsx)(e_,{error:n.error,retry:()=>void n.refetch()}):(n.data?.items.length??0)===0?(0,T.jsx)($g,{children:`No runs`}):(0,T.jsx)(ev,{caption:`Execution runs`,rows:n.data.items,rowKey:e=>e.runId,columns:Jx}),n.data&&(0,T.jsx)(X_,{navigation:t,nextCursor:n.data.page.nextCursor,hasMore:n.data.page.hasMore})]})}var Jx=[{label:`Run`,render:e=>(0,T.jsx)(Ln,{to:`/runs/${encodeURIComponent(e.runId)}`,children:e.runId})},{label:`Activity`,render:e=>e.activity},{label:`Workflow`,render:e=>e.workflowName??`?`},{label:`Stage`,render:e=>e.stage??`?`},{label:`Runner`,render:e=>Moe(e)},{label:`Status`,render:e=>Yx(e)},{label:`Started`,render:e=>(0,T.jsx)(Z_,{value:e.startedAt})},{label:`Duration`,render:e=>Noe(e)},{label:`Usage`,render:e=>(0,T.jsx)(__,{usage:e})},{label:`Cost`,render:e=>d_(e.totalCostUsd)}];function Moe(e){return e.runnerName===void 0?`?`:e.runnerModel===void 0?e.runnerName:`${e.runnerName} (${e.runnerModel})`}function Noe(e){let t=e.active?Date.now():e.finishedAt===void 0?void 0:Date.parse(e.finishedAt);return t===void 0?``:p_(t-Date.parse(e.startedAt))}function Yx(e){return e.status===`starting`?`Starting`:e.status===`started`?`Running`:e.resolution?.sentinel??e.sentinel}function Poe(){let{runId:e=``}=wt(),t=$f(),n=_i({queryKey:Ug.execution.run(e),queryFn:({signal:n})=>t.execution.run(e,n),refetchInterval:e=>Gg.runs(e.state.data===void 0?void 0:[e.state.data.data])}),r=_i({queryKey:Ug.execution.transcript(e),queryFn:({signal:n})=>t.execution.transcript(e,n),refetchInterval:Wg.historicalRuns,enabled:e!==``});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Run ${e}`}),n.isPending?(0,T.jsx)(Qg,{label:`Loading run`}):n.error?(0,T.jsx)(e_,{error:n.error,retry:()=>void n.refetch()}):n.data&&(0,T.jsxs)(Yg,{children:[(0,T.jsx)(Zg,{children:Yx(n.data.data)}),(0,T.jsxs)(`dl`,{className:l_.summary,children:[(0,T.jsx)(`dt`,{children:`Activity`}),(0,T.jsx)(`dd`,{children:n.data.data.activity}),n.data.data.operatorInstructions&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`dt`,{children:`Operator instructions scope`}),(0,T.jsx)(`dd`,{children:n.data.data.operatorInstructions.contextScope}),(0,T.jsx)(`dt`,{children:`Operator instructions revision`}),(0,T.jsx)(`dd`,{children:n.data.data.operatorInstructions.revisionId??`No instructions at run start`})]}),(0,T.jsx)(`dt`,{children:`Attempt`}),(0,T.jsx)(`dd`,{children:n.data.data.attempt}),(0,T.jsx)(`dt`,{children:`Started`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(Z_,{value:n.data.data.startedAt})}),n.data.data.finishedAt!==void 0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`dt`,{children:`Finished`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(Z_,{value:n.data.data.finishedAt})})]})]}),(n.data.data.outcome??n.data.data.failure)!==void 0&&(0,T.jsx)(n_,{value:n.data.data.outcome??n.data.data.failure}),n.data.data.operatorInstructions?.content!==void 0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Operator standing instructions received`}),(0,T.jsx)(`article`,{className:qx.markdown,children:(0,T.jsx)(Kx,{skipHtml:!0,children:n.data.data.operatorInstructions.content})})]}),(0,T.jsx)(`h2`,{children:`Transcript`}),r.data?.data.available?(0,T.jsx)(`ol`,{className:l_.transcript,"aria-label":`Transcript`,children:r.data.data.entries.map((e,t)=>(0,T.jsxs)(`li`,{className:l_.transcriptEntry,children:[(0,T.jsxs)(`div`,{className:l_.transcriptHead,children:[(0,T.jsx)(`span`,{children:e.channel}),(0,T.jsx)(Z_,{value:e.occurredAt})]}),(0,T.jsx)(`pre`,{className:l_.transcriptText,children:e.text})]},`${e.occurredAt}-${t}`))}):(0,T.jsx)($g,{children:`Transcript unavailable`})]})]})}function Xx(){let e=$f(),t=_i({queryKey:[`triggers`],queryFn:({signal:t})=>e.triggers.list(t),refetchInterval:Wg.status});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Jg,{title:`Triggers`}),t.data&&t.data.orphanedInstructions.length>0&&(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Orphaned operator instructions`}),(0,T.jsx)(`p`,{children:`These documents are retained but have no configured trigger using their scope. Configure a trigger with the same contextScope to use and edit them again.`}),t.data.orphanedInstructions.map(e=>(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{children:e.contextScope}),(0,T.jsxs)(`p`,{children:[`Document: instructions.md. Saved by `,e.author,` at`,` `,(0,T.jsx)(Z_,{value:e.occurredAt}),`. Revision: `,e.revisionId]}),(0,T.jsx)(`article`,{className:qx.markdown,"aria-label":`Orphaned instructions for `+e.contextScope,children:e.content===null?(0,T.jsx)(`p`,{children:`Instructions content is unavailable. The saved revision is retained.`}):(0,T.jsx)(Kx,{skipHtml:!0,children:e.content})})]},e.contextScope))]}),t.isPending?(0,T.jsx)(Qg,{label:`Loading triggers`}):t.error?(0,T.jsx)(e_,{error:t.error,retry:()=>void t.refetch()}):t.data.data.length===0?(0,T.jsx)($g,{children:`No triggers configured or recorded`}):(0,T.jsx)(ev,{caption:`Triggers`,rows:t.data.data,rowKey:e=>e.triggerId,columns:[{label:`Trigger`,render:e=>(0,T.jsx)(Ln,{to:`/triggers/`+encodeURIComponent(e.triggerId),children:e.triggerId})},{label:`Status`,render:e=>e.status},{label:`Slot holder`,render:e=>(0,T.jsx)(Qx,{trigger:e})},{label:`Workflow`,render:e=>e.definition?.workflow??e.invocations[0]?.claim.workflowName??`—`},{label:`Next cron occurrence (UTC)`,render:e=>e.nextOccurrence?(0,T.jsx)(Z_,{value:e.nextOccurrence,timeZone:`UTC`}):`—`},{label:`Latest invocation`,render:e=>(0,T.jsx)($x,{entry:e.invocations[0]})},{label:`Pause/failure reason`,render:e=>e.pauseReason??`—`},{label:`Latest skip`,render:e=>e.latestSkip?.reason??`—`},{label:`Control`,render:e=>(0,T.jsx)(eS,{trigger:e})}]})]})}function Zx(){let{triggerId:e=``}=wt(),t=$f(),n=_i({queryKey:[`triggers`,e],queryFn:({signal:n})=>t.triggers.detail(e,n),refetchInterval:Wg.status});if(n.isPending)return(0,T.jsx)(Qg,{label:`Loading trigger`});if(n.error)return(0,T.jsx)(e_,{error:n.error,retry:()=>void n.refetch()});let r=n.data.data;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Jg,{title:r.triggerId}),(0,T.jsx)(Ln,{to:`/triggers`,children:`All triggers`}),(0,T.jsxs)(Yg,{children:[(0,T.jsxs)(`p`,{children:[`Status: `,r.status]}),(0,T.jsx)(Qx,{trigger:r}),(0,T.jsx)(eS,{trigger:r}),(0,T.jsx)(`p`,{children:`Pause leaves active invocations running. Operator cancellation is not available yet. Retry resumes the same invocation; its slot remains occupied until it finishes.`}),r.pauseReason&&(0,T.jsxs)(`p`,{children:[`Pause reason: `,r.pauseReason]}),r.definition===null?(0,T.jsx)(`p`,{children:`Definition removed. Recorded invocations remain available.`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Configuration`}),(0,T.jsx)(`pre`,{children:JSON.stringify(r.definition,null,2)})]}),r.nextOccurrence&&(0,T.jsxs)(`p`,{children:[`Next cron occurrence (UTC): `,(0,T.jsx)(Z_,{value:r.nextOccurrence,timeZone:`UTC`})]})]}),(0,T.jsx)(tS,{trigger:r},r.triggerId),(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Pending requests`}),r.pending.length===0?(0,T.jsx)(`p`,{children:`No pending request`}):(0,T.jsx)(T.Fragment,{children:r.pending.map(e=>(0,T.jsxs)(`section`,{children:[(0,T.jsxs)(`p`,{children:[e.triggerId,`:`,` `,e.activeWorkItemId?`Waiting on `+e.activeWorkItemId:`Awaiting reconsideration`]}),(0,T.jsx)(`pre`,{children:JSON.stringify(e.sources,null,2)})]},e.coordinationKey))})]}),(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Latest skipped occurrence`}),r.latestSkip===null?(0,T.jsx)(`p`,{children:`No recorded skip diagnostic`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[r.latestSkip.reason,` at `,(0,T.jsx)(Z_,{value:r.latestSkip.occurredAt})]}),(0,T.jsx)(`pre`,{children:JSON.stringify(r.latestSkip.source,null,2)})]})]}),(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Invocation history`}),r.invocations.length===0?(0,T.jsx)($g,{children:`No invocations recorded`}):(0,T.jsx)(ev,{caption:`Invocation history`,rows:r.invocations,rowKey:e=>e.claim.workItemId,columns:[{label:`WorkItem`,render:e=>(0,T.jsx)($x,{entry:e})},{label:`Claimed`,render:e=>(0,T.jsx)(Z_,{value:e.claimedAt})},{label:`Started`,render:e=>e.startedAt?(0,T.jsx)(Z_,{value:e.startedAt}):`Pending recovery`},{label:`Finished`,render:e=>e.finishedAt?(0,T.jsx)(Z_,{value:e.finishedAt}):`—`},{label:`Reason`,render:e=>e.result?.reason??`—`},{label:`Sources`,render:e=>(0,T.jsx)(`pre`,{children:JSON.stringify(e.claim.sources,null,2)})}]})]})]})}function Qx({trigger:e}){let t=$f(),n=ni(),r=e.activeInvocation,i=vi({mutationFn:e=>t.work.command(e.workItemKey,`retry`,e.idempotencyKey),onSettled:()=>n.invalidateQueries({queryKey:[`triggers`]})});return r===null?(0,T.jsx)(`span`,{children:`No active invocation`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[`Slot held by`,` `,(0,T.jsx)(Ln,{to:`/work/`+encodeURIComponent(r.workItemKey),children:r.activeWorkItemId}),` `,`(`,r.workflowStatus??`Pending recovery`,`), trigger `,r.triggerId]}),r.blockReason&&(0,T.jsxs)(`p`,{children:[`Block reason: `,r.blockReason]}),r.retryEligible&&(0,T.jsx)(Xg,{disabled:i.isPending,onClick:()=>i.mutate({workItemKey:r.workItemKey,idempotencyKey:`web:retry:`+crypto.randomUUID()}),children:`Retry invocation`}),i.isSuccess&&(0,T.jsx)(`p`,{role:`status`,children:`Retry accepted. The slot remains held until this invocation finishes.`}),i.error&&(0,T.jsx)(e_,{error:i.error,retry:()=>{i.variables&&i.mutate(i.variables)}})]})}function $x({entry:e}){return e===void 0?(0,T.jsx)(T.Fragment,{children:`—`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ln,{to:`/work/`+encodeURIComponent(e.workItemKey),children:e.claim.workItemId}),` (`,e.result?.status??(e.startedAt?`running`:`claimed`),`)`]})}function eS({trigger:e}){let t=$f(),n=ni(),r=vi({mutationFn:n=>t.triggers.command(e.triggerId,n.name,n.idempotencyKey),onSettled:()=>n.invalidateQueries({queryKey:[`triggers`]})});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Xg,{type:`button`,disabled:r.isPending,onClick:()=>r.mutate({name:e.paused?Pd.Resume:Pd.Pause,idempotencyKey:`web:trigger:`+crypto.randomUUID()}),children:e.paused?`Resume`:`Pause`}),e.definition!==null&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Xg,{type:`button`,disabled:r.isPending||e.paused,onClick:()=>r.mutate({name:Pd.Run,idempotencyKey:`web:trigger:`+crypto.randomUUID()}),children:`Run now`}),e.paused&&(0,T.jsx)(`p`,{children:`Resume this trigger before running it.`}),e.status===Vd.Running&&(0,T.jsx)(`p`,{children:`A request will coalesce while this invocation is active.`})]}),r.data?.data.triggerOutcome&&(0,T.jsxs)(`p`,{role:`status`,children:[r.data.data.triggerOutcome.disposition===Md.Coalesced?`queued`:r.data.data.triggerOutcome.disposition,`workItemId`in r.data.data.triggerOutcome?`: `+r.data.data.triggerOutcome.workItemId:``,`activeWorkItemId`in r.data.data.triggerOutcome?` behind `+r.data.data.triggerOutcome.activeWorkItemId:``,`reason`in r.data.data.triggerOutcome?`: `+r.data.data.triggerOutcome.reason:``]}),r.error&&(0,T.jsx)(e_,{error:r.error,retry:()=>{r.variables!==void 0&&r.mutate(r.variables)}})]})}function tS({trigger:e}){let t=$f(),n=ni(),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),s=vi({mutationFn:()=>t.triggers.saveInstructions(e.triggerId,r??``,a,`web:instructions:`+crypto.randomUUID()),onSuccess:async()=>{await n.invalidateQueries({queryKey:[`triggers`]}),i(null)}}),c=vi({mutationFn:async()=>{let r=await t.triggers.detail(e.triggerId);n.setQueryData([`triggers`,e.triggerId],r),i(r.data.operatorInstructions?.content??``),o(r.data.operatorInstructions?.revisionId??null),s.reset()}}),l=e.definition?.contextScope;return(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Operator standing instructions`}),(0,T.jsx)(`p`,{children:`Document: instructions.md`}),l===void 0?(0,T.jsx)(`p`,{children:`This trigger has no explicit contextScope. Configure a named scope before editing instructions.`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[`Scope: `,l,`. Shared by all triggers in this scope. Saves apply to later runs; active runs keep their snapshot.`]}),e.operatorInstructions&&(0,T.jsxs)(`p`,{children:[`Last saved by `,e.operatorInstructions.author,` at`,` `,(0,T.jsx)(Z_,{value:e.operatorInstructions.occurredAt}),`. Revision:`,` `,e.operatorInstructions.revisionId]}),r===null?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`article`,{className:qx.markdown,"aria-label":`Operator standing instructions`,children:e.operatorInstructions===null||e.operatorInstructions===void 0?(0,T.jsx)(`p`,{children:`No instructions document exists yet. The first operator save creates it; no scope membership or prior invocation is required.`}):(0,T.jsx)(Kx,{skipHtml:!0,children:e.operatorInstructions.content})}),(0,T.jsx)(Xg,{onClick:()=>{i(e.operatorInstructions?.content??``),o(e.operatorInstructions?.revisionId??null),s.reset()},children:`Edit instructions`})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`label`,{children:[`Instructions (Markdown)`,(0,T.jsx)(`textarea`,{"aria-label":`Instructions (Markdown)`,placeholder:`Describe what agents should do on future invocations. These instructions apply to every trigger sharing this context scope, within fixed safety constraints.`,rows:14,value:r,disabled:s.isPending,onChange:e=>i(e.target.value)})]}),(0,T.jsx)(Xg,{disabled:s.isPending,onClick:()=>s.mutate(),children:`Save instructions`}),(0,T.jsx)(Xg,{disabled:s.isPending,onClick:()=>{i(null),s.reset()},children:`Cancel`}),s.error&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`p`,{role:`alert`,children:s.error.message}),(0,T.jsx)(Xg,{disabled:c.isPending,onClick:()=>c.mutate(),children:`Reload current instructions`})]})]})]}),c.error&&(0,T.jsx)(`p`,{role:`alert`,children:c.error.message})]})}var nS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fab`,n=`github`,r=512,i=512,a=[],o=`f09b`,s=`M216.5 362.5c-66-8-112.5-55.5-112.5-117 0-25 9-52 24-70-6.5-16.5-5.5-51.5 2-66 20-2.5 47 8 63 22.5 19-6 39-9 63.5-9s44.5 3 62.5 8.5c15.5-14 43-24.5 63-22 7 13.5 8 48.5 1.5 65.5 16 19 24.5 44.5 24.5 70.5 0 61.5-46.5 108-113.5 116.5 17 11 28.5 35 28.5 62.5l0 52C323 491.5 335.5 500 350.5 494 441 459.5 512 369 512 257 512 115.5 397 0 255.5 0S0 115.5 0 257c0 111 70.5 203 165.5 237.5 13.5 5 26.5-4 26.5-17.5l0-40c-7 3-16 5-24 5-33 0-52.5-18-66.5-51.5-5.5-13.5-11.5-21.5-23-23-6-.5-8-3-8-6 0-6 10-10.5 20-10.5 14.5 0 27 9 40 27.5 10 14.5 20.5 21 33 21s20.5-4.5 32-16c8.5-8.5 15-16 21-21z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faGithub=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),rS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`arrow-up-right-from-square`,r=512,i=512,a=[`external-link`],o=`f08e`,s=`M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0-201.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 96C35.8 96 0 131.8 0 176L0 432c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 80c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 96z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faArrowUpRightFromSquare=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),iS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`file-lines`,r=384,i=512,a=[128441,128462,61686,`file-alt`,`file-text`],o=`f15c`,s=`M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM120 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faFileLines=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),aS=nS(),oS=rS(),sS=iS();function cS({className:e}){return(0,T.jsx)(Hg,{icon:aS.faGithub,className:e,"aria-hidden":`true`})}function lS({className:e}){return(0,T.jsx)(Hg,{icon:sS.faFileLines,className:e,"aria-hidden":`true`})}function uS({className:e}){return(0,T.jsx)(Hg,{icon:oS.faArrowUpRightFromSquare,className:e,"aria-hidden":`true`})}function dS({workItemKey:e,artifact:t,onClose:n}){let r=$f(),i=_i({queryKey:[`artifact-text`,e,t.revisionId],queryFn:({signal:n})=>r.work.artifactText(e,t.revisionId,n),retry:!1});return(0,T.jsxs)(`div`,{children:[(0,T.jsx)(Xg,{variant:`secondary`,onClick:n,children:`Back to artifacts`}),(0,T.jsx)(`h2`,{children:t.path}),(0,T.jsxs)(`a`,{href:t.href,children:[`Download `,t.path]}),i.isPending?(0,T.jsx)(Qg,{label:`Loading artifact`}):i.isError?(0,T.jsx)(e_,{error:i.error,retry:()=>void i.refetch()}):(0,T.jsx)(`article`,{className:qx.markdown,"aria-label":t.path,children:(0,T.jsx)(Kx,{skipHtml:!0,children:i.data})})]})}var fS={github:cS};function pS(){let e=$f(),t=_i({queryKey:Ug.board.list(),queryFn:({signal:t})=>e.board.list(void 0,t),refetchInterval:Wg.board}),n=t.data?.items??[];return(0,T.jsx)(T.Fragment,{children:t.isPending?(0,T.jsx)(Qg,{label:`Loading work`}):t.error&&!t.data?(0,T.jsx)(e_,{error:t.error,retry:()=>void t.refetch()}):n.length===0?(0,T.jsx)($g,{children:`No matching work items`}):(0,T.jsx)(ev,{caption:`Work items`,rows:n,rowKey:e=>e.workItemKey,columns:mS})})}var mS=[{label:`Ref`,render:e=>e.externalRef??`?`},{label:`Work item`,render:e=>(0,T.jsx)(Ln,{to:`/work/${encodeURIComponent(e.workItemKey)}`,children:e.objective})},{label:`Condition`,render:e=>(0,T.jsx)(u_,{variant:`outline`,children:e.condition})},{label:`Workflow`,render:e=>e.workflowName??`?`},{label:`Stage`,render:e=>e.stage??`?`},{label:`Runs`,render:e=>e.runCount},{label:`Last run`,render:e=>e.lastRunAt===void 0?`?`:(0,T.jsx)(Z_,{value:e.lastRunAt})},{label:`Outcome`,render:e=>e.lastRunOutcome===void 0?`?`:(0,T.jsx)(g_,{outcome:e.lastRunOutcome})},{label:`Cost`,render:e=>d_(e.totalCostUsd)},{label:`Usage`,render:e=>(0,T.jsx)(__,{usage:e})}];function hS(){let{workItemKey:e=``}=wt();return(0,T.jsx)(gS,{workItemKey:e},e)}function gS({workItemKey:e}){let t=$f(),n=St(),r=ni(),i=async()=>{await Promise.all([r.invalidateQueries({queryKey:Ug.work.all}),r.invalidateQueries({queryKey:Ug.board.list()})])},a=vi({mutationFn:n=>t.work.command(e,n,`web:${n}:${globalThis.crypto.randomUUID()}`),onSuccess:async(e,t)=>{await i(),t===`delete`&&n(`/work`)}}),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),f=(0,C.useRef)(0),p=(0,C.useRef)(null);(0,C.useEffect)(()=>{c&&p.current?.focus()},[c]);let m=vi({mutationFn:n=>t.work.message(e,n,`web:conversation-message:${globalThis.crypto.randomUUID()}`,void 0,c),onSuccess:async()=>{f.current=le.filter(e=>e.origin===`agent`).length,d(!0),oe.current=!0,ce(!1),s(``),l(!1),p.current&&(p.current.style.height=``),await i()}}),h=()=>{let e=o.trim();e!==``&&!m.isPending&&m.mutate(c?`/changes\n${e}`:e)},g=_i({queryKey:Ug.work.detail(e),queryFn:({signal:n})=>t.work.detail(e,n),refetchInterval:Wg.openWork,enabled:e!==``}),_=_i({queryKey:Ug.workflowDiagrams.get(e),queryFn:({signal:n})=>t.workflowDiagrams.get(e,n),refetchInterval:Wg.workflowDiagrams,enabled:e!==``&&g.data?.data.orchestration.primary!==null}),[v,y]=(0,C.useState)(gd.Failed),[b,x]=(0,C.useState)(`Operator determined this run failed.`),[S,ee]=(0,C.useState)(`{
1189
+ `},i)),a}function moe(e,t){return e&&`run`in e?async function(n,r){let i=gx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return gx(n,{file:r,...e||t})}}function _x(e){if(e)throw e}var hoe=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function vx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function goe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?yx(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function yx(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var bx={basename:_oe,dirname:voe,extname:yoe,join:boe,sep:`/`};function _oe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Cx(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function voe(e){if(Cx(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function yoe(e){Cx(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function boe(...e){let t=-1,n;for(;++t<e.length;)Cx(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:xx(n)}function xx(e){Cx(e);let t=e.codePointAt(0)===47,n=Sx(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Sx(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1)if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Cx(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var wx={cwd:Tx};function Tx(){return`/`}function Ex(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Dx(e){if(typeof e==`string`)e=new URL(e);else if(!Ex(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ox(e)}function Ox(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var kx=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ax=class{constructor(e){let t;t=e?Ex(e)?{path:e}:typeof e==`string`||Px(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:wx.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<kx.length;){let e=kx[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)kx.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?bx.basename(this.path):void 0}set basename(e){Mx(e,`basename`),jx(e,`basename`),this.path=bx.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?bx.dirname(this.path):void 0}set dirname(e){Nx(this.basename,`dirname`),this.path=bx.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?bx.extname(this.path):void 0}set extname(e){if(jx(e,`extname`),Nx(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=bx.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ex(e)&&(e=Dx(e)),Mx(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?bx.basename(this.path,this.extname):void 0}set stem(e){Mx(e,`stem`),jx(e,`stem`),this.path=bx.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Zv(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function jx(e,t){if(e&&e.includes(bx.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+bx.sep+"`")}function Mx(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Nx(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Px(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Fx=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ix=l(hoe(),1),Lx={}.hasOwnProperty,Rx=new class e extends Fx{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=goe()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ix.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Vx(`data`,this.frozen),this.namespace[e]=t,this):Lx.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Vx(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Wx(e),n=this.parser||this.Parser;return zx(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),zx(`process`,this.parser||this.Parser),Bx(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Wx(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);xoe(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),zx(`processSync`,this.parser||this.Parser),Bx(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ux(`processSync`,`process`,t),n;function r(e,r){t=!0,_x(e),n=r}}run(e,t,n){Hx(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Wx(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Ux(`runSync`,`run`,n),r;function i(e,t){_x(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Wx(t),r=this.compiler||this.Compiler;return Bx(`stringify`,r),Hx(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Vx(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ix.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];vx(o)&&vx(r)&&(r=(0,Ix.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function zx(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Bx(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Vx(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Hx(e){if(!vx(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ux(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wx(e){return Gx(e)?e:new Ax(e)}function Gx(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xoe(e){return typeof e==`string`||Soe(e)}function Soe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Coe=[],woe={allowDangerousHtml:!0},Toe=/^(https?|ircs?|mailto|xmpp)$/i,Eoe=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Kx(e){let t=Doe(e),n=Ooe(e);return koe(t.runSync(t.parse(n),n),e)}function Doe(e){let t=e.rehypePlugins||Coe,n=e.remarkPlugins||Coe,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...woe}:woe;return Rx().use(Nb).use(n).use(moe,r).use(t)}function Ooe(e){let t=e.children||``,n=new Ax;return typeof t==`string`?n.value=t:``+t,n}function koe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Aoe;for(let e of Eoe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return soe(e,l),ry(e,{Fragment:T.Fragment,components:i,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in fy)if(Object.hasOwn(fy,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=fy[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Aoe(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Toe.test(e.slice(0,t))?e:``}var qx={markdown:`_markdown_i5wt4_1`};function joe(){let e=$f(),t=Y_(),n=_i({queryKey:Ug.execution.runList(t.cursor),queryFn:({signal:n})=>e.execution.runs(t.cursor,n),refetchInterval:e=>Gg.runs(e.state.data?.items)});return(0,T.jsxs)(T.Fragment,{children:[n.isPending?(0,T.jsx)(Qg,{label:`Loading runs`}):n.error&&!n.data?(0,T.jsx)(e_,{error:n.error,retry:()=>void n.refetch()}):(n.data?.items.length??0)===0?(0,T.jsx)($g,{children:`No runs`}):(0,T.jsx)(ev,{caption:`Execution runs`,rows:n.data.items,rowKey:e=>e.runId,columns:Jx}),n.data&&(0,T.jsx)(X_,{navigation:t,nextCursor:n.data.page.nextCursor,hasMore:n.data.page.hasMore})]})}var Jx=[{label:`Run`,render:e=>(0,T.jsx)(Ln,{to:`/runs/${encodeURIComponent(e.runId)}`,children:e.runId})},{label:`Activity`,render:e=>e.activity},{label:`Workflow`,render:e=>e.workflowName??`?`},{label:`Stage`,render:e=>e.stage??`?`},{label:`Runner`,render:e=>Moe(e)},{label:`Status`,render:e=>Yx(e)},{label:`Started`,render:e=>(0,T.jsx)(Z_,{value:e.startedAt})},{label:`Duration`,render:e=>Noe(e)},{label:`Usage`,render:e=>(0,T.jsx)(__,{usage:e})},{label:`Cost`,render:e=>d_(e.totalCostUsd)}];function Moe(e){return e.runnerName===void 0?`?`:e.runnerModel===void 0?e.runnerName:`${e.runnerName} (${e.runnerModel})`}function Noe(e){let t=e.active?Date.now():e.finishedAt===void 0?void 0:Date.parse(e.finishedAt);return t===void 0?``:p_(t-Date.parse(e.startedAt))}function Yx(e){return e.status===`starting`?`Starting`:e.status===`started`?`Running`:e.resolution?.sentinel??e.sentinel}function Poe(){let{runId:e=``}=wt(),t=$f(),n=_i({queryKey:Ug.execution.run(e),queryFn:({signal:n})=>t.execution.run(e,n),refetchInterval:e=>Gg.runs(e.state.data===void 0?void 0:[e.state.data.data])}),r=_i({queryKey:Ug.execution.transcript(e),queryFn:({signal:n})=>t.execution.transcript(e,n),refetchInterval:Wg.historicalRuns,enabled:e!==``});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Run ${e}`}),n.isPending?(0,T.jsx)(Qg,{label:`Loading run`}):n.error?(0,T.jsx)(e_,{error:n.error,retry:()=>void n.refetch()}):n.data&&(0,T.jsxs)(Yg,{children:[(0,T.jsx)(Zg,{children:Yx(n.data.data)}),(0,T.jsxs)(`dl`,{className:l_.summary,children:[(0,T.jsx)(`dt`,{children:`Activity`}),(0,T.jsx)(`dd`,{children:n.data.data.activity}),n.data.data.operatorInstructions&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`dt`,{children:`Operator instructions scope`}),(0,T.jsx)(`dd`,{children:n.data.data.operatorInstructions.contextScope}),(0,T.jsx)(`dt`,{children:`Operator instructions revision`}),(0,T.jsx)(`dd`,{children:n.data.data.operatorInstructions.revisionId??`No instructions at run start`})]}),(0,T.jsx)(`dt`,{children:`Attempt`}),(0,T.jsx)(`dd`,{children:n.data.data.attempt}),(0,T.jsx)(`dt`,{children:`Started`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(Z_,{value:n.data.data.startedAt})}),n.data.data.finishedAt!==void 0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`dt`,{children:`Finished`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(Z_,{value:n.data.data.finishedAt})})]})]}),(n.data.data.outcome??n.data.data.failure)!==void 0&&(0,T.jsx)(n_,{value:n.data.data.outcome??n.data.data.failure}),n.data.data.operatorInstructions?.content!==void 0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Operator standing instructions received`}),(0,T.jsx)(`article`,{className:qx.markdown,children:(0,T.jsx)(Kx,{skipHtml:!0,children:n.data.data.operatorInstructions.content})})]}),(0,T.jsx)(`h2`,{children:`Transcript`}),r.data?.data.available?(0,T.jsx)(`ol`,{className:l_.transcript,"aria-label":`Transcript`,children:r.data.data.entries.map((e,t)=>(0,T.jsxs)(`li`,{className:l_.transcriptEntry,children:[(0,T.jsxs)(`div`,{className:l_.transcriptHead,children:[(0,T.jsx)(`span`,{children:e.channel}),(0,T.jsx)(Z_,{value:e.occurredAt})]}),(0,T.jsx)(`pre`,{className:l_.transcriptText,children:e.text})]},`${e.occurredAt}-${t}`))}):(0,T.jsx)($g,{children:`Transcript unavailable`})]})]})}function Xx(){let e=$f(),t=_i({queryKey:[`triggers`],queryFn:({signal:t})=>e.triggers.list(t),refetchInterval:Wg.status});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Jg,{title:`Triggers`}),t.data&&t.data.orphanedInstructions.length>0&&(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Orphaned operator instructions`}),(0,T.jsx)(`p`,{children:`These documents are retained but have no configured trigger using their scope. Configure a trigger with the same contextScope to use and edit them again.`}),t.data.orphanedInstructions.map(e=>(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h3`,{children:e.contextScope}),(0,T.jsxs)(`p`,{children:[`Document: instructions.md. Saved by `,e.author,` at`,` `,(0,T.jsx)(Z_,{value:e.occurredAt}),`. Revision: `,e.revisionId]}),(0,T.jsx)(`article`,{className:qx.markdown,"aria-label":`Orphaned instructions for `+e.contextScope,children:e.content===null?(0,T.jsx)(`p`,{children:`Instructions content is unavailable. The saved revision is retained.`}):(0,T.jsx)(Kx,{skipHtml:!0,children:e.content})})]},e.contextScope))]}),t.isPending?(0,T.jsx)(Qg,{label:`Loading triggers`}):t.error?(0,T.jsx)(e_,{error:t.error,retry:()=>void t.refetch()}):t.data.data.length===0?(0,T.jsx)($g,{children:`No triggers configured or recorded`}):(0,T.jsx)(ev,{caption:`Triggers`,rows:t.data.data,rowKey:e=>e.triggerId,columns:[{label:`Trigger`,render:e=>(0,T.jsx)(Ln,{to:`/triggers/`+encodeURIComponent(e.triggerId),children:e.triggerId})},{label:`Status`,render:e=>e.status},{label:`Slot holder`,render:e=>(0,T.jsx)(Qx,{trigger:e})},{label:`Workflow`,render:e=>e.definition?.workflow??e.invocations[0]?.claim.workflowName??`—`},{label:`Next cron occurrence (UTC)`,render:e=>e.nextOccurrence?(0,T.jsx)(Z_,{value:e.nextOccurrence,timeZone:`UTC`}):`—`},{label:`Latest invocation`,render:e=>(0,T.jsx)($x,{entry:e.invocations[0]})},{label:`Pause/failure reason`,render:e=>e.pauseReason??`—`},{label:`Latest skip`,render:e=>e.latestSkip?.reason??`—`},{label:`Control`,render:e=>(0,T.jsx)(eS,{trigger:e})}]})]})}function Zx(){let{triggerId:e=``}=wt(),t=$f(),n=_i({queryKey:[`triggers`,e],queryFn:({signal:n})=>t.triggers.detail(e,n),refetchInterval:Wg.status});if(n.isPending)return(0,T.jsx)(Qg,{label:`Loading trigger`});if(n.error)return(0,T.jsx)(e_,{error:n.error,retry:()=>void n.refetch()});let r=n.data.data;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Jg,{title:r.triggerId}),(0,T.jsx)(Ln,{to:`/triggers`,children:`All triggers`}),(0,T.jsxs)(Yg,{children:[(0,T.jsxs)(`p`,{children:[`Status: `,r.status]}),(0,T.jsx)(Qx,{trigger:r}),(0,T.jsx)(eS,{trigger:r}),(0,T.jsx)(`p`,{children:`Pause leaves active invocations running. Operator cancellation is not available yet. Retry resumes the same invocation; its slot remains occupied until it finishes.`}),r.pauseReason&&(0,T.jsxs)(`p`,{children:[`Pause reason: `,r.pauseReason]}),r.definition===null?(0,T.jsx)(`p`,{children:`Definition removed. Recorded invocations remain available.`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`h2`,{children:`Configuration`}),(0,T.jsx)(`pre`,{children:JSON.stringify(r.definition,null,2)})]}),r.nextOccurrence&&(0,T.jsxs)(`p`,{children:[`Next cron occurrence (UTC): `,(0,T.jsx)(Z_,{value:r.nextOccurrence,timeZone:`UTC`})]})]}),(0,T.jsx)(tS,{trigger:r},r.triggerId),(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Pending requests`}),r.pending.length===0?(0,T.jsx)(`p`,{children:`No pending request`}):(0,T.jsx)(T.Fragment,{children:r.pending.map(e=>(0,T.jsxs)(`section`,{children:[(0,T.jsxs)(`p`,{children:[e.triggerId,`:`,` `,e.activeWorkItemId?`Waiting on `+e.activeWorkItemId:`Awaiting reconsideration`]}),(0,T.jsx)(`pre`,{children:JSON.stringify(e.sources,null,2)})]},e.coordinationKey))})]}),(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Latest skipped occurrence`}),r.latestSkip===null?(0,T.jsx)(`p`,{children:`No recorded skip diagnostic`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[r.latestSkip.reason,` at `,(0,T.jsx)(Z_,{value:r.latestSkip.occurredAt})]}),(0,T.jsx)(`pre`,{children:JSON.stringify(r.latestSkip.source,null,2)})]})]}),(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Invocation history`}),r.invocations.length===0?(0,T.jsx)($g,{children:`No invocations recorded`}):(0,T.jsx)(ev,{caption:`Invocation history`,rows:r.invocations,rowKey:e=>e.claim.workItemId,columns:[{label:`WorkItem`,render:e=>(0,T.jsx)($x,{entry:e})},{label:`Claimed`,render:e=>(0,T.jsx)(Z_,{value:e.claimedAt})},{label:`Started`,render:e=>e.startedAt?(0,T.jsx)(Z_,{value:e.startedAt}):`Pending recovery`},{label:`Finished`,render:e=>e.finishedAt?(0,T.jsx)(Z_,{value:e.finishedAt}):`—`},{label:`Reason`,render:e=>e.result?.reason??`—`},{label:`Sources`,render:e=>(0,T.jsx)(`pre`,{children:JSON.stringify(e.claim.sources,null,2)})}]})]})]})}function Qx({trigger:e}){let t=$f(),n=ni(),r=e.activeInvocation,i=vi({mutationFn:e=>t.work.command(e.workItemKey,`retry`,e.idempotencyKey),onSettled:()=>n.invalidateQueries({queryKey:[`triggers`]})});return r===null?(0,T.jsx)(`span`,{children:`No active invocation`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[`Slot held by`,` `,(0,T.jsx)(Ln,{to:`/work/`+encodeURIComponent(r.workItemKey),children:r.activeWorkItemId}),` `,`(`,r.workflowStatus??`Pending recovery`,`), trigger `,r.triggerId]}),r.blockReason&&(0,T.jsxs)(`p`,{children:[`Block reason: `,r.blockReason]}),r.retryEligible&&(0,T.jsx)(Xg,{disabled:i.isPending,onClick:()=>i.mutate({workItemKey:r.workItemKey,idempotencyKey:`web:retry:`+crypto.randomUUID()}),children:`Retry invocation`}),i.isSuccess&&(0,T.jsx)(`p`,{role:`status`,children:`Retry accepted. The slot remains held until this invocation finishes.`}),i.error&&(0,T.jsx)(e_,{error:i.error,retry:()=>{i.variables&&i.mutate(i.variables)}})]})}function $x({entry:e}){return e===void 0?(0,T.jsx)(T.Fragment,{children:`—`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ln,{to:`/work/`+encodeURIComponent(e.workItemKey),children:e.claim.workItemId}),` (`,e.result?.status??(e.startedAt?`running`:`claimed`),`)`]})}function eS({trigger:e}){let t=$f(),n=ni(),r=vi({mutationFn:n=>t.triggers.command(e.triggerId,n.name,n.idempotencyKey),onSettled:()=>n.invalidateQueries({queryKey:[`triggers`]})});return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Xg,{type:`button`,disabled:r.isPending,onClick:()=>r.mutate({name:e.paused?Pd.Resume:Pd.Pause,idempotencyKey:`web:trigger:`+crypto.randomUUID()}),children:e.paused?`Resume`:`Pause`}),e.definition!==null&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Xg,{type:`button`,disabled:r.isPending,onClick:()=>r.mutate({name:Pd.Run,idempotencyKey:`web:trigger:`+crypto.randomUUID()}),children:`Run now`}),e.paused&&(0,T.jsx)(`p`,{children:`Automatic runs paused; Run now still works.`}),e.status===Vd.Running&&(0,T.jsx)(`p`,{children:`A request will coalesce while this invocation is active.`})]}),r.data?.data.triggerOutcome&&(0,T.jsxs)(`p`,{role:`status`,children:[r.data.data.triggerOutcome.disposition===Md.Coalesced?`queued`:r.data.data.triggerOutcome.disposition,`workItemId`in r.data.data.triggerOutcome?`: `+r.data.data.triggerOutcome.workItemId:``,`activeWorkItemId`in r.data.data.triggerOutcome?` behind `+r.data.data.triggerOutcome.activeWorkItemId:``,`reason`in r.data.data.triggerOutcome?`: `+r.data.data.triggerOutcome.reason:``]}),r.error&&(0,T.jsx)(e_,{error:r.error,retry:()=>{r.variables!==void 0&&r.mutate(r.variables)}})]})}function tS({trigger:e}){let t=$f(),n=ni(),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),s=vi({mutationFn:()=>t.triggers.saveInstructions(e.triggerId,r??``,a,`web:instructions:`+crypto.randomUUID()),onSuccess:async()=>{await n.invalidateQueries({queryKey:[`triggers`]}),i(null)}}),c=vi({mutationFn:async()=>{let r=await t.triggers.detail(e.triggerId);n.setQueryData([`triggers`,e.triggerId],r),i(r.data.operatorInstructions?.content??``),o(r.data.operatorInstructions?.revisionId??null),s.reset()}}),l=e.definition?.contextScope;return(0,T.jsxs)(Yg,{children:[(0,T.jsx)(`h2`,{children:`Operator standing instructions`}),(0,T.jsx)(`p`,{children:`Document: instructions.md`}),l===void 0?(0,T.jsx)(`p`,{children:`This trigger has no explicit contextScope. Configure a named scope before editing instructions.`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`p`,{children:[`Scope: `,l,`. Shared by all triggers in this scope. Saves apply to later runs; active runs keep their snapshot.`]}),e.operatorInstructions&&(0,T.jsxs)(`p`,{children:[`Last saved by `,e.operatorInstructions.author,` at`,` `,(0,T.jsx)(Z_,{value:e.operatorInstructions.occurredAt}),`. Revision:`,` `,e.operatorInstructions.revisionId]}),r===null?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`article`,{className:qx.markdown,"aria-label":`Operator standing instructions`,children:e.operatorInstructions===null||e.operatorInstructions===void 0?(0,T.jsx)(`p`,{children:`No instructions document exists yet. The first operator save creates it; no scope membership or prior invocation is required.`}):(0,T.jsx)(Kx,{skipHtml:!0,children:e.operatorInstructions.content})}),(0,T.jsx)(Xg,{onClick:()=>{i(e.operatorInstructions?.content??``),o(e.operatorInstructions?.revisionId??null),s.reset()},children:`Edit instructions`})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`label`,{children:[`Instructions (Markdown)`,(0,T.jsx)(`textarea`,{"aria-label":`Instructions (Markdown)`,placeholder:`Describe what agents should do on future invocations. These instructions apply to every trigger sharing this context scope, within fixed safety constraints.`,rows:14,value:r,disabled:s.isPending,onChange:e=>i(e.target.value)})]}),(0,T.jsx)(Xg,{disabled:s.isPending,onClick:()=>s.mutate(),children:`Save instructions`}),(0,T.jsx)(Xg,{disabled:s.isPending,onClick:()=>{i(null),s.reset()},children:`Cancel`}),s.error&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`p`,{role:`alert`,children:s.error.message}),(0,T.jsx)(Xg,{disabled:c.isPending,onClick:()=>c.mutate(),children:`Reload current instructions`})]})]})]}),c.error&&(0,T.jsx)(`p`,{role:`alert`,children:c.error.message})]})}var nS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fab`,n=`github`,r=512,i=512,a=[],o=`f09b`,s=`M216.5 362.5c-66-8-112.5-55.5-112.5-117 0-25 9-52 24-70-6.5-16.5-5.5-51.5 2-66 20-2.5 47 8 63 22.5 19-6 39-9 63.5-9s44.5 3 62.5 8.5c15.5-14 43-24.5 63-22 7 13.5 8 48.5 1.5 65.5 16 19 24.5 44.5 24.5 70.5 0 61.5-46.5 108-113.5 116.5 17 11 28.5 35 28.5 62.5l0 52C323 491.5 335.5 500 350.5 494 441 459.5 512 369 512 257 512 115.5 397 0 255.5 0S0 115.5 0 257c0 111 70.5 203 165.5 237.5 13.5 5 26.5-4 26.5-17.5l0-40c-7 3-16 5-24 5-33 0-52.5-18-66.5-51.5-5.5-13.5-11.5-21.5-23-23-6-.5-8-3-8-6 0-6 10-10.5 20-10.5 14.5 0 27 9 40 27.5 10 14.5 20.5 21 33 21s20.5-4.5 32-16c8.5-8.5 15-16 21-21z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faGithub=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),rS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`arrow-up-right-from-square`,r=512,i=512,a=[`external-link`],o=`f08e`,s=`M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0-201.4 201.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3 448 192c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 96C35.8 96 0 131.8 0 176L0 432c0 44.2 35.8 80 80 80l256 0c44.2 0 80-35.8 80-80l0-80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 80c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l80 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 96z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faArrowUpRightFromSquare=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),iS=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=`fas`,n=`file-lines`,r=384,i=512,a=[128441,128462,61686,`file-alt`,`file-text`],o=`f15c`,s=`M0 64C0 28.7 28.7 0 64 0L213.5 0c17 0 33.3 6.7 45.3 18.7L365.3 125.3c12 12 18.7 28.3 18.7 45.3L384 448c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm208-5.5l0 93.5c0 13.3 10.7 24 24 24L325.5 176 208 58.5zM120 256c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0zm0 96c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z`;e.definition={prefix:t,iconName:n,icon:[r,i,a,o,s]},e.faFileLines=e.definition,e.prefix=t,e.iconName=n,e.width=r,e.height=i,e.ligatures=a,e.unicode=o,e.svgPathData=s,e.aliases=a})),aS=nS(),oS=rS(),sS=iS();function cS({className:e}){return(0,T.jsx)(Hg,{icon:aS.faGithub,className:e,"aria-hidden":`true`})}function lS({className:e}){return(0,T.jsx)(Hg,{icon:sS.faFileLines,className:e,"aria-hidden":`true`})}function uS({className:e}){return(0,T.jsx)(Hg,{icon:oS.faArrowUpRightFromSquare,className:e,"aria-hidden":`true`})}function dS({workItemKey:e,artifact:t,onClose:n}){let r=$f(),i=_i({queryKey:[`artifact-text`,e,t.revisionId],queryFn:({signal:n})=>r.work.artifactText(e,t.revisionId,n),retry:!1});return(0,T.jsxs)(`div`,{children:[(0,T.jsx)(Xg,{variant:`secondary`,onClick:n,children:`Back to artifacts`}),(0,T.jsx)(`h2`,{children:t.path}),(0,T.jsxs)(`a`,{href:t.href,children:[`Download `,t.path]}),i.isPending?(0,T.jsx)(Qg,{label:`Loading artifact`}):i.isError?(0,T.jsx)(e_,{error:i.error,retry:()=>void i.refetch()}):(0,T.jsx)(`article`,{className:qx.markdown,"aria-label":t.path,children:(0,T.jsx)(Kx,{skipHtml:!0,children:i.data})})]})}var fS={github:cS};function pS(){let e=$f(),t=_i({queryKey:Ug.board.list(),queryFn:({signal:t})=>e.board.list(void 0,t),refetchInterval:Wg.board}),n=t.data?.items??[];return(0,T.jsx)(T.Fragment,{children:t.isPending?(0,T.jsx)(Qg,{label:`Loading work`}):t.error&&!t.data?(0,T.jsx)(e_,{error:t.error,retry:()=>void t.refetch()}):n.length===0?(0,T.jsx)($g,{children:`No matching work items`}):(0,T.jsx)(ev,{caption:`Work items`,rows:n,rowKey:e=>e.workItemKey,columns:mS})})}var mS=[{label:`Ref`,render:e=>e.externalRef??`?`},{label:`Work item`,render:e=>(0,T.jsx)(Ln,{to:`/work/${encodeURIComponent(e.workItemKey)}`,children:e.objective})},{label:`Condition`,render:e=>(0,T.jsx)(u_,{variant:`outline`,children:e.condition})},{label:`Workflow`,render:e=>e.workflowName??`?`},{label:`Stage`,render:e=>e.stage??`?`},{label:`Runs`,render:e=>e.runCount},{label:`Last run`,render:e=>e.lastRunAt===void 0?`?`:(0,T.jsx)(Z_,{value:e.lastRunAt})},{label:`Outcome`,render:e=>e.lastRunOutcome===void 0?`?`:(0,T.jsx)(g_,{outcome:e.lastRunOutcome})},{label:`Cost`,render:e=>d_(e.totalCostUsd)},{label:`Usage`,render:e=>(0,T.jsx)(__,{usage:e})}];function hS(){let{workItemKey:e=``}=wt();return(0,T.jsx)(gS,{workItemKey:e},e)}function gS({workItemKey:e}){let t=$f(),n=St(),r=ni(),i=async()=>{await Promise.all([r.invalidateQueries({queryKey:Ug.work.all}),r.invalidateQueries({queryKey:Ug.board.list()})])},a=vi({mutationFn:n=>t.work.command(e,n,`web:${n}:${globalThis.crypto.randomUUID()}`),onSuccess:async(e,t)=>{await i(),t===`delete`&&n(`/work`)}}),[o,s]=(0,C.useState)(``),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),f=(0,C.useRef)(0),p=(0,C.useRef)(null);(0,C.useEffect)(()=>{c&&p.current?.focus()},[c]);let m=vi({mutationFn:n=>t.work.message(e,n,`web:conversation-message:${globalThis.crypto.randomUUID()}`,void 0,c),onSuccess:async()=>{f.current=le.filter(e=>e.origin===`agent`).length,d(!0),oe.current=!0,ce(!1),s(``),l(!1),p.current&&(p.current.style.height=``),await i()}}),h=()=>{let e=o.trim();e!==``&&!m.isPending&&m.mutate(c?`/changes\n${e}`:e)},g=_i({queryKey:Ug.work.detail(e),queryFn:({signal:n})=>t.work.detail(e,n),refetchInterval:Wg.openWork,enabled:e!==``}),_=_i({queryKey:Ug.workflowDiagrams.get(e),queryFn:({signal:n})=>t.workflowDiagrams.get(e,n),refetchInterval:Wg.workflowDiagrams,enabled:e!==``&&g.data?.data.orchestration.primary!==null}),[v,y]=(0,C.useState)(gd.Failed),[b,x]=(0,C.useState)(`Operator determined this run failed.`),[S,ee]=(0,C.useState)(`{
1190
1190
  "kind": "done",
1191
1191
  "data": { "status": "DONE" }
1192
1192
  }`),te=vi({mutationFn:async({runId:n,outcome:r,status:i})=>{let a=globalThis.crypto.randomUUID();if(await t.execution.resolveAmbiguousRun(n,i===gd.Failed?{status:gd.Failed,reason:b}:{status:gd.Succeeded,outcome:r},`web:resolve-ambiguous-run:${a}`),i!==gd.Succeeded)return t.work.command(e,`retry`,`web:retry-after-ambiguous-resolution:${globalThis.crypto.randomUUID()}`)},onSuccess:i}),[w,ne]=(0,C.useState)(`overview`),[re,ie]=(0,C.useState)(null),ae=(0,C.useRef)(null),oe=(0,C.useRef)(!0),[se,ce]=(0,C.useState)(!1),le=[...g.data?.data.conversation.entries??[]].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)),ue=le.at(-1),de=g.data?.data.execution.runs.find(e=>e.active);(0,C.useEffect)(()=>{let e=le.filter(e=>e.origin===`agent`).length;u&&e>f.current&&d(!1)},[u,le]),(0,C.useLayoutEffect)(()=>{oe.current=!0,ce(!1)},[w]),(0,C.useLayoutEffect)(()=>{w===`conversation`&&oe.current&&ae.current&&(ae.current.scrollTop=ae.current.scrollHeight)},[w,ue?.entryId,ue?.body]);let[fe,pe]=(0,C.useState)(),[me,he]=(0,C.useState)(!1),[ge,_e]=(0,C.useState)(),ve=_i({queryKey:Ug.events.list(``,e),queryFn:({signal:n})=>t.events.list(void 0,e,n),refetchInterval:Wg.events,enabled:e!==``}),ye=[...g.data?.data.execution.transcriptGroups??[]].sort((e,t)=>Number(e.kind===`run`)-Number(t.kind===`run`)||t.latestAt.localeCompare(e.latestAt)),be=g.data?.data.orchestration.primary,xe=[...g.data?.data.execution.runs??[]].filter(e=>e.workflowInstanceId===be?.workflowInstanceId&&e.status===`ambiguous`).sort((e,t)=>t.startedAt.localeCompare(e.startedAt))[0],Se=be!=null&&be.status===`blocked`&&bS(be.blockReason),Ce=ye.find(e=>e.groupId===fe)??ye[0],we=_i({queryKey:Ug.work.transcript(e,Ce?.groupId??``),queryFn:({signal:n})=>t.work.transcript(e,Ce.groupId,n),refetchInterval:Wg.historicalRuns,enabled:w===`transcripts`&&e!==``&&Ce!==void 0}),Te=ge!==void 0&&Ce?.runIds.includes(ge)?ge:Ce?.runIds.at(-1),Ee=[...we.data?.data.entries??[]].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)).filter(e=>!me||e.runId===Te),De=e=>{let t=ye.find(t=>t.groupId===e);pe(e),_e(t?.runIds.at(-1)),he(!1)},Oe=e=>{let t=Array.from(e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`)??[]),n=t.indexOf(e.currentTarget);if(n<0)return;let r=e.key===`ArrowRight`?(n+1)%t.length:e.key===`ArrowLeft`?(n-1+t.length)%t.length:e.key===`Home`?0:e.key===`End`?t.length-1:void 0;if(r===void 0)return;e.preventDefault();let i=t[r];if(i===void 0)return;let a=i.dataset.tab;ne(a),i.focus()};return(0,T.jsx)(`div`,{className:`${l_.detail} ${w===`conversation`?l_.detailChat:``}`,children:g.isPending?(0,T.jsx)(Qg,{label:`Loading work detail`}):g.error&&!g.data?(0,T.jsx)(e_,{error:g.error,retry:()=>void g.refetch()}):g.data?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:l_.tabs,role:`tablist`,"aria-label":`Work detail sections`,children:[`overview`,`runs`,`artifacts`,`events`,`transcripts`,`conversation`].map(e=>(0,T.jsx)(`button`,{type:`button`,role:`tab`,"data-tab":e,id:`work-detail-${e}-tab`,"aria-controls":`work-detail-${e}-panel`,"aria-selected":w===e,tabIndex:w===e?0:-1,onKeyDown:Oe,onClick:()=>ne(e),children:e===`overview`?`Overview`:e[0].toUpperCase()+e.slice(1)},e))}),(0,T.jsxs)(`h1`,{className:l_.workTitle,children:[g.data.data.work.externalRef&&(0,T.jsx)(`span`,{children:g.data.data.work.externalRef}),g.data.data.work.objective]}),g.data.data.triggerOrigin&&(0,T.jsxs)(`p`,{children:[`Trigger origin:`,` `,(0,T.jsx)(Ln,{to:`/triggers/`+encodeURIComponent(g.data.data.triggerOrigin),children:g.data.data.triggerOrigin})]}),w!==`conversation`&&w!==`transcripts`&&(0,T.jsxs)(`div`,{className:l_.workSummary,children:[(0,T.jsx)(Yg,{children:(0,T.jsxs)(`dl`,{className:l_.summary,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Work identity`}),(0,T.jsx)(`dd`,{children:g.data.data.work.workItemId})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`State`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(u_,{variant:`outline`,children:g.data.data.work.state})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Workflow`}),(0,T.jsx)(`dd`,{children:g.data.data.orchestration.primary?.workflowName??`?`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Stage`}),(0,T.jsx)(`dd`,{children:g.data.data.orchestration.primary?.currentStage??`Not started`})]}),be?.mergePolicyBlock&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Merge status`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.status===`recovering`?`PR merged; recovery pending`:`Waiting for human merge`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Merge policy`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.explanation})]}),be.mergePolicyBlock.policy?.blockedPaths&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Protected paths`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.policy.blockedPaths.join(`, `)})]}),be.mergePolicyBlock.policy?.matchedPaths&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Matching changed paths`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.policy.matchedPaths.join(`, `)})]}),be.mergePolicyBlock.policy?.maxFilesChanged!==void 0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`File-count limit`}),(0,T.jsxs)(`dd`,{children:[be.mergePolicyBlock.policy.maxFilesChanged,` (changed:`,` `,be.mergePolicyBlock.policy.filesChanged??`unknown`,`)`]})]}),be.mergePolicyBlock.href&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Pull request`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`a`,{href:be.mergePolicyBlock.href,target:`_blank`,rel:`noreferrer`,children:`View correlated PR`})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Next action`}),(0,T.jsx)(`dd`,{children:be.mergePolicyBlock.nextAction})]})]}),Se&&(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Blocked because`}),(0,T.jsx)(`dd`,{children:`Ambiguous run requires an operator decision`})]})}),g.data.data.work.lastRunOutcome!==void 0&&(0,T.jsx)(T.Fragment,{children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Last run`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(g_,{outcome:g.data.data.work.lastRunOutcome,title:`Outcome of the most recent run`})})]})})]})}),(0,T.jsxs)(`div`,{className:l_.actionBar,children:[g.data.data.conversation.canContinue===!0&&(0,T.jsx)(Xg,{type:`button`,disabled:m.isPending,onClick:()=>{l(!0),ne(`conversation`)},children:`Continue with instructions`}),g.data.data.orchestration.primary?.retryEligible===!0&&(0,T.jsx)(Xg,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(`retry`),children:`Retry`}),g.data.data.orchestration.primary?.extendEligible===!0&&(0,T.jsx)(Xg,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(`extend`),children:`Extend`}),(0,T.jsx)(Xg,{type:`button`,disabled:a.isPending,onClick:()=>a.mutate(g.data.data.work.frozen?`unfreeze`:`freeze`),children:g.data.data.work.frozen?`Unfreeze`:`Freeze`}),(0,T.jsx)(Xg,{type:`button`,className:l_.dangerButton,disabled:a.isPending,onClick:()=>{window.confirm(`Delete this work item from the board and remove its resource correlations?`)&&a.mutate(`delete`)},children:`Delete`}),(0,T.jsx)(t_,{pending:a.isPending,...a.error===null?{}:{message:a.error?.message}})]})]}),w===`runs`?(0,T.jsx)(`section`,{id:`work-detail-runs-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-runs-tab`,children:g.data.data.execution.runs.length===0?(0,T.jsx)($g,{children:`No runs`}):(0,T.jsx)(ev,{caption:`Runs`,rows:g.data.data.execution.runs,rowKey:e=>e.runId,columns:Jx})}):w===`artifacts`?(0,T.jsx)(`section`,{id:`work-detail-artifacts-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-artifacts-tab`,children:re?(0,T.jsx)(dS,{workItemKey:e,artifact:re,onClose:()=>ie(null)},`${e}:${re.revisionId}`):g.data.data.artifacts.length===0?(0,T.jsx)($g,{children:`No published artifacts`}):(0,T.jsx)(ev,{caption:`Published artifacts`,rows:g.data.data.artifacts,rowKey:e=>e.revisionId,columns:[{label:`Producer`,render:e=>e.producer},{label:`Path`,render:e=>(0,T.jsx)(`a`,{href:e.href,children:e.path})},{label:`View`,render:e=>/\.md$/i.test(e.path)?(0,T.jsx)(Xg,{variant:`secondary`,onClick:()=>ie(e),"aria-label":`View ${e.path}`,children:`View`}):null},{label:`Type`,render:e=>e.mediaType??`binary`},{label:`Bytes`,render:e=>e.byteLength?.toLocaleString()??`?`}]})}):w===`conversation`?(0,T.jsxs)(`section`,{id:`work-detail-conversation-panel`,className:l_.conversationPanel,role:`tabpanel`,"aria-labelledby":`work-detail-conversation-tab`,children:[(0,T.jsx)(`div`,{ref:ae,className:l_.conversationViewport,role:`region`,"aria-label":`Message history`,tabIndex:0,onScroll:e=>{let t=e.currentTarget;oe.current=t.scrollHeight-t.scrollTop-t.clientHeight<64,ce(!oe.current)},children:le.length===0?(0,T.jsx)($g,{children:`No conversation messages`}):(0,T.jsx)(`ol`,{className:l_.conversationTimeline,"aria-label":`Conversation`,children:le.map(e=>{let t=g.data.data.resources.find(t=>t.resourceId===e.sourceResourceId);return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`article`,{className:l_.conversationEntry,"data-origin":e.origin,children:[(0,T.jsx)(_S,{actorId:e.actorId,sourceAdapter:e.sourceAdapter}),(0,T.jsxs)(`header`,{className:l_.conversationEntryHead,children:[(0,T.jsx)(`strong`,{children:e.actorId}),(0,T.jsxs)(`span`,{className:l_.conversationSource,children:[`via `,e.sourceAdapter??e.origin]}),(0,T.jsx)(Z_,{value:e.occurredAt}),e.runId!==void 0&&(0,T.jsxs)(`span`,{children:[(0,T.jsxs)(Ln,{to:`/runs/${encodeURIComponent(e.runId)}`,children:[`run `,e.runId]}),e.stage===void 0?``:` (${e.stage})`]}),t!==void 0&&(0,T.jsx)(`span`,{children:t.externalUrl===void 0?t.locatorLabel:(0,T.jsx)(`a`,{href:t.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:t.locatorLabel})})]}),e.deleted?(0,T.jsx)(`em`,{children:`Message deleted`}):(0,T.jsx)(`div`,{className:l_.conversationBody,children:(0,T.jsx)(Kx,{skipHtml:!0,children:e.body})}),e.representations.length>0&&(0,T.jsx)(`footer`,{className:l_.conversationRepresentations,children:e.representations.map(e=>{let t=g.data.data.resources.find(t=>t.resourceId===e.resourceId),n=t?.locatorLabel??e.resourceId;return(0,T.jsxs)(`span`,{children:[`Published to`,` `,t?.externalUrl===void 0?n:(0,T.jsx)(`a`,{href:t.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:n})]},`${e.resourceId}:${e.externalId}`)})})]})},e.entryId)})})}),(0,T.jsxs)(`div`,{className:l_.conversationFooter,children:[u&&(0,T.jsxs)(`div`,{className:l_.conversationProgress,role:`status`,"aria-live":`polite`,children:[de===void 0?(0,T.jsx)(Hg,{icon:vee,className:l_.conversationWaitingIcon,"aria-hidden":`true`}):(0,T.jsx)(`span`,{className:l_.conversationProgressDot,"data-active-run":`true`}),(0,T.jsx)(`span`,{className:l_.conversationProgressTitle,children:de===void 0?`Queued for Wake`:de.activity}),de!==void 0&&(0,T.jsxs)(`span`,{className:l_.conversationProgressMeta,children:[de.stage!==void 0&&`Stage: ${de.stage}`,de.stage!==void 0&&(de.runnerName!==void 0||de.runnerModel!==void 0)&&` · `,(de.runnerName!==void 0||de.runnerModel!==void 0)&&`Runner: ${de.runnerName??de.runnerModel}`]})]}),se&&(0,T.jsx)(Xg,{className:l_.conversationLatest,onClick:()=>{oe.current=!0,ce(!1),ae.current&&(ae.current.scrollTop=ae.current.scrollHeight)},children:`Jump to latest`}),g.data.data.conversation.canCreateEntries&&(0,T.jsxs)(`form`,{className:l_.conversationComposer,onSubmit:e=>{e.preventDefault(),h()},children:[c&&(0,T.jsx)(`p`,{children:`Supply the instructions needed to continue this blocked stage.`}),(0,T.jsx)(`textarea`,{ref:p,id:`work-conversation-message`,"aria-label":c?`Continuation instructions`:`Message`,value:o,disabled:m.isPending,onChange:e=>{s(e.target.value),e.currentTarget.style.height=`auto`,e.currentTarget.style.height=`${Math.min(e.currentTarget.scrollHeight,192)}px`},placeholder:`Add context, answer a question, or direct the current work.`,rows:1}),(0,T.jsxs)(`div`,{className:l_.conversationComposerActions,children:[(0,T.jsx)(Xg,{type:`submit`,className:l_.conversationSend,"aria-label":c?`Continue`:`Send message`,disabled:m.isPending||o.trim()===``,children:(0,T.jsx)(Hg,{icon:hee,"aria-hidden":`true`})}),c&&(0,T.jsx)(Xg,{type:`button`,onClick:()=>l(!1),children:`Cancel continuation`}),(0,T.jsx)(t_,{pending:m.isPending,...m.error===null?{}:{message:m.error?.message}})]})]})]})]}):w===`transcripts`?(0,T.jsxs)(`section`,{id:`work-detail-transcripts-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-transcripts-tab`,children:[(0,T.jsx)(`h2`,{id:`work-transcripts`,children:`Transcript conversations`}),ye.length===0?(0,T.jsx)($g,{children:`No transcript conversations`}):(0,T.jsxs)(`div`,{className:l_.transcriptLayout,children:[(0,T.jsx)(`ol`,{className:l_.transcriptGroups,"aria-label":`Transcript groups`,children:ye.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,className:l_.transcriptGroup,"aria-pressed":Ce?.groupId===e.groupId,onClick:()=>De(e.groupId),children:[(0,T.jsx)(`span`,{children:e.groupId}),(0,T.jsx)(`span`,{children:e.kind===`session`?`Session`:`Run fallback`}),e.cli!==void 0&&(0,T.jsx)(`span`,{children:e.cli}),(0,T.jsx)(Z_,{value:e.latestAt}),(0,T.jsx)(`span`,{children:e.runIds.join(`, `)})]})},e.groupId))}),(0,T.jsxs)(`div`,{className:l_.transcriptConversation,children:[Ce!==void 0&&Ce.runIds.length>1&&(0,T.jsxs)(`div`,{className:l_.transcriptFilters,children:[(0,T.jsxs)(`label`,{children:[`Run`,(0,T.jsx)(`select`,{value:Te??``,onChange:e=>_e(e.target.value),children:Ce.runIds.map(e=>(0,T.jsx)(`option`,{value:e,children:e},e))})]}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`checkbox`,checked:me,onChange:e=>he(e.target.checked)}),`This run only`]})]}),we.isPending?(0,T.jsx)(Qg,{label:`Loading transcript`}):we.error?(0,T.jsx)(e_,{error:we.error,retry:()=>void we.refetch()}):we.data?.data.available===!1?(0,T.jsx)($g,{children:`Transcript unavailable`}):Ee.length===0?(0,T.jsx)($g,{children:`No transcript messages`}):(0,T.jsx)(`ol`,{className:l_.transcript,"aria-label":`Transcript conversation`,children:Ee.map((e,t)=>(0,T.jsxs)(`li`,{children:[t>0&&Ee[t-1]?.runId!==e.runId&&(0,T.jsxs)(`div`,{className:l_.transcriptRunSeparator,role:`separator`,"aria-label":`Run ${e.runId}`,children:[`Run `,e.runId]}),(0,T.jsxs)(`article`,{className:e.channel===`input`?l_.transcriptInput:l_.transcriptAgent,"aria-label":`${e.channel===`input`?`Input`:`Agent`} message from ${e.runId}`,children:[(0,T.jsxs)(`div`,{className:l_.transcriptHead,children:[(0,T.jsx)(`span`,{children:e.channel===`input`?`Input`:`Agent`}),(0,T.jsx)(Z_,{value:e.occurredAt}),(0,T.jsxs)(`span`,{children:[`Run `,e.runId]}),e.channel===`agent`&&e.durationMs!==void 0&&(0,T.jsx)(`span`,{children:p_(e.durationMs)})]}),(0,T.jsx)(`pre`,{className:l_.transcriptText,style:{whiteSpace:`pre-wrap`},children:e.text})]})]},`${e.occurredAt}-${t}`))})]})]})]}):w===`events`?(0,T.jsxs)(`section`,{id:`work-detail-events-panel`,role:`tabpanel`,"aria-labelledby":`work-detail-events-tab`,children:[(0,T.jsx)(`h2`,{id:`work-events`,children:`Events`}),ve.isPending?(0,T.jsx)(Qg,{label:`Loading events`}):ve.error?(0,T.jsx)(e_,{error:ve.error,retry:()=>void ve.refetch()}):ve.data?.items.length?(0,T.jsx)(`ol`,{className:l_.eventList,children:[...ve.data.items].sort((e,t)=>t.position-e.position).map(e=>(0,T.jsx)(Q_,{record:e},e.id))}):(0,T.jsx)($g,{children:`No events`})]}):(0,T.jsxs)(`div`,{id:`work-detail-overview-panel`,className:l_.overviewLayout,role:`tabpanel`,"aria-labelledby":`work-detail-overview-tab`,children:[(0,T.jsx)(`div`,{className:l_.overviewWorkflow,children:_.data?.data.diagrams[0]===void 0?null:(0,T.jsx)(J_,{diagram:_.data.data.diagrams[0]})}),(0,T.jsxs)(`aside`,{className:l_.overviewSidebar,children:[Se&&xe!==void 0&&(0,T.jsxs)(Yg,{labelledBy:`ambiguous-run-resolution`,children:[(0,T.jsx)(`h2`,{id:`ambiguous-run-resolution`,className:l_.sidebarSectionTitle,children:`Resolve ambiguous run`}),(0,T.jsx)(`p`,{children:`Decide what happened before retrying this work. Wake will record your decision, then retry the work item.`}),(0,T.jsxs)(`dl`,{className:l_.summary,children:[(0,T.jsx)(`dt`,{children:`Run`}),(0,T.jsx)(`dd`,{children:xe.runId}),(0,T.jsx)(`dt`,{children:`Token usage`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(__,{usage:xe})}),(0,T.jsx)(`dt`,{children:`Cost`}),(0,T.jsx)(`dd`,{children:d_(xe.totalCostUsd)}),(0,T.jsx)(`dt`,{children:`Pull request`}),(0,T.jsx)(`dd`,{children:g.data.data.activities.pullRequest===void 0?`None recorded`:`Recorded for this work item`})]}),(0,T.jsxs)(`fieldset`,{disabled:te.isPending,children:[(0,T.jsx)(`legend`,{children:`Actual outcome`}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`radio`,name:`ambiguous-run-outcome`,checked:v===gd.Failed,onChange:()=>y(gd.Failed)}),`Failed`]}),(0,T.jsxs)(`label`,{children:[(0,T.jsx)(`input`,{type:`radio`,name:`ambiguous-run-outcome`,checked:v===gd.Succeeded,onChange:()=>y(gd.Succeeded)}),`Succeeded`]}),v===gd.Failed?(0,T.jsxs)(`label`,{children:[`Reason`,(0,T.jsx)(`textarea`,{value:b,onChange:e=>x(e.target.value)})]}):(0,T.jsxs)(`label`,{children:[`Actual activity outcome (JSON)`,(0,T.jsx)(`textarea`,{value:S,onChange:e=>ee(e.target.value)})]})]}),(0,T.jsx)(Xg,{type:`button`,disabled:te.isPending||v===gd.Failed&&b.trim()===``||v===gd.Succeeded&&xS(S)===void 0,onClick:()=>{let e=v===gd.Succeeded?xS(S):void 0;(v!==gd.Succeeded||e!==void 0)&&te.mutate({runId:xe.runId,outcome:e,status:v})},children:v===gd.Failed?`Resolve and retry`:`Resolve run`}),v===gd.Succeeded&&xS(S)===void 0&&(0,T.jsx)(`p`,{role:`alert`,children:`The actual activity outcome must be an object with a supported outcome kind.`}),(0,T.jsx)(t_,{pending:te.isPending,...te.error===null?{}:{message:te.error.message}})]}),(0,T.jsxs)(`section`,{"aria-labelledby":`work-resources`,children:[(0,T.jsx)(`h2`,{id:`work-resources`,className:l_.sidebarSectionTitle,children:`Resources`}),g.data.data.resources.length===0?(0,T.jsx)($g,{children:`No correlated resources`}):(0,T.jsx)(`ul`,{className:l_.resourceList,"aria-label":`Resources`,children:g.data.data.resources.map(e=>{let t=fS[e.adapter]??lS,n=e.title??e.locatorLabel,r=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:l_.resourceCardTop,children:[(0,T.jsx)(t,{className:l_.resourceCardIcon}),(0,T.jsx)(`span`,{className:l_.resourceCardTitle,children:n}),e.externalUrl!==void 0&&(0,T.jsx)(uS,{className:l_.resourceCardExt})]}),(0,T.jsxs)(`div`,{className:l_.resourceCardMeta,children:[e.title!==void 0&&(0,T.jsx)(`span`,{className:l_.resourceId,children:e.locatorLabel}),e.capabilities.map(e=>(0,T.jsx)(u_,{variant:`outline`,children:e},e))]})]});return(0,T.jsx)(`li`,{children:e.externalUrl===void 0?(0,T.jsx)(`div`,{className:l_.resourceCard,children:r}):(0,T.jsx)(`a`,{className:l_.resourceCard,href:e.externalUrl,target:`_blank`,rel:`noopener noreferrer`,children:r})},e.resourceId)})})]})]}),(0,T.jsxs)(`section`,{className:l_.overviewMain,"aria-labelledby":`work-activity`,children:[(0,T.jsx)(`h2`,{id:`work-activity`,className:l_.sidebarSectionTitle,children:`Activity timeline`}),ve.isPending?(0,T.jsx)(Qg,{label:`Loading activity`}):ve.error?(0,T.jsx)(e_,{error:ve.error,retry:()=>void ve.refetch()}):vS(g.data.data.execution.runs,ve.data?.items??[]).length?(0,T.jsx)(`ol`,{className:l_.activityTimeline,"aria-label":`Activity timeline`,children:vS(g.data.data.execution.runs,ve.data?.items??[]).map(e=>(0,T.jsxs)(`li`,{className:l_.activityTimelineItem,children:[(0,T.jsx)(`span`,{className:l_.activityTimelineMarker,"data-kind":e.kind}),(0,T.jsx)(Z_,{value:e.occurredAt}),e.kind===`run`?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:l_.activityTimelineKind,"data-kind":`run`,children:`Run`}),(0,T.jsx)(Ln,{to:`/runs/${encodeURIComponent(e.run.runId)}`,children:e.run.activity}),(0,T.jsxs)(`span`,{className:l_.activityTimelineDetail,children:[`Stage: `,e.run.stage??`Not assigned`]}),(0,T.jsxs)(`span`,{className:l_.activityTimelineDetail,children:[`Runner:`,` `,e.run.runnerName??e.run.runnerModel??`Unassigned`]}),(0,T.jsxs)(`span`,{className:l_.activityTimelineOutcome,children:[`Outcome: `,yS(e.run)]})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`span`,{className:l_.activityTimelineKind,"data-kind":`event`,children:`Event`}),(0,T.jsx)(`span`,{children:e.event.type}),e.event.stream!==void 0&&(0,T.jsxs)(`span`,{className:l_.activityTimelineDetail,children:[`Stream: `,e.event.stream.kind]})]})]},e.id))}):(0,T.jsx)($g,{children:`No activity yet`})]})]})]}):null})}function _S({actorId:e,sourceAdapter:t}){let[n,r]=(0,C.useState)(!1),i=t===`github`&&e.trim()!==``;return(0,T.jsx)(`span`,{className:l_.conversationAvatar,"aria-label":i?`${e} GitHub avatar`:e,children:i&&!n?(0,T.jsx)(`img`,{src:`https://github.com/${encodeURIComponent(e)}.png?size=64`,alt:``,onError:()=>r(!0)}):e.slice(0,2).toUpperCase()})}function vS(e,t){return[...e.map(e=>({id:`run:${e.runId}`,kind:`run`,occurredAt:e.finishedAt??e.startedAt,run:e})),...t.map(e=>({id:`event:${e.id}`,kind:`event`,occurredAt:e.occurredAt,event:e}))].sort((e,t)=>t.occurredAt.localeCompare(e.occurredAt))}function yS(e){return e.resolution?.sentinel??e.sentinel??e.status}function bS(e){return Ld(e)}function xS(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return;let n=t.kind;return typeof n==`string`&&Object.values(yd).includes(n)?t:void 0}catch{return}}function SS({client:e=new Xf}){let[t]=(0,C.useState)(()=>new $r({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchIntervalInBackground:!1}}})),[n,r]=(0,C.useState)();return(0,C.useEffect)(()=>{let t=new URLSearchParams(globalThis.location.search).get(`grant`);(async()=>{if(t!==null){let n=await e.auth.redeem(t);if(globalThis.history.replaceState({},``,`${globalThis.location.pathname}${globalThis.location.hash}`),n)return r(!0)}return e.auth.session().then(r).catch(()=>r(!1))})()},[e]),n===void 0?null:n?(0,T.jsx)(ri,{client:t,children:(0,T.jsx)(Qf.Provider,{value:e,children:(0,T.jsx)(wS,{})})}):(0,T.jsx)(CS,{client:e,onAuthenticated:()=>r(!0)})}function CS({client:e,onAuthenticated:t}){let[n,r]=(0,C.useState)(``),[i,a]=(0,C.useState)(!1);async function o(r){r.preventDefault(),await e.auth.redeem(n)?t():a(!0)}return(0,T.jsx)(`main`,{className:`wake-login`,children:(0,T.jsxs)(`div`,{className:`wake-login-panel`,children:[(0,T.jsx)(`section`,{className:`wake-login-brand`,children:(0,T.jsx)(`img`,{className:`wake-login-logo`,src:bi,alt:`Wake logo`})}),(0,T.jsxs)(`section`,{className:`wake-login-card`,children:[(0,T.jsx)(`h1`,{children:`Login`}),(0,T.jsx)(`p`,{children:`Enter a temporary login code, or scan the code from your operator terminal.`}),(0,T.jsxs)(`form`,{onSubmit:o,children:[(0,T.jsx)(`label`,{htmlFor:`access-key`,children:`Temporary login code`}),(0,T.jsx)(`input`,{id:`access-key`,type:`password`,value:n,onChange:e=>r(e.target.value),autoFocus:!0,required:!0}),(0,T.jsx)(`button`,{className:`wake-login-submit`,type:`submit`,children:`Sign in`}),i&&(0,T.jsx)(`p`,{role:`alert`,children:`Unable to sign in.`})]})]})]})})}function wS(){return(0,T.jsx)(s_,{children:(0,T.jsxs)(Yt,{children:[(0,T.jsx)(qt,{path:`/`,element:(0,T.jsx)(Kt,{to:`/board`,replace:!0})}),(0,T.jsx)(qt,{path:`/board`,element:(0,T.jsx)(E_,{})}),(0,T.jsx)(qt,{path:`/work`,element:(0,T.jsx)(pS,{})}),(0,T.jsx)(qt,{path:`/work/:workItemKey`,element:(0,T.jsx)(hS,{})}),(0,T.jsx)(qt,{path:`/triggers`,element:(0,T.jsx)(Xx,{})}),(0,T.jsx)(qt,{path:`/triggers/:triggerId`,element:(0,T.jsx)(Zx,{})}),(0,T.jsx)(qt,{path:`/events`,element:(0,T.jsx)(xre,{})}),(0,T.jsx)(qt,{path:`/runs`,element:(0,T.jsx)(joe,{})}),(0,T.jsx)(qt,{path:`/runs/:runId`,element:(0,T.jsx)(Poe,{})}),(0,T.jsx)(qt,{path:`/observability`,element:(0,T.jsx)(wre,{})}),(0,T.jsx)(qt,{path:`/health`,element:(0,T.jsx)(tv,{})}),(0,T.jsx)(qt,{path:`/configuration`,element:(0,T.jsx)(yre,{})}),(0,T.jsx)(qt,{path:`*`,element:(0,T.jsx)(Kt,{to:`/board`,replace:!0})})]})})}(0,yi.createRoot)(document.getElementById(`root`)).render((0,T.jsx)(C.StrictMode,{children:(0,T.jsx)(In,{children:(0,T.jsx)(SS,{})})}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Wake</title>
7
- <script type="module" crossorigin src="/assets/index-QnREfUBG.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-BuVkTveW.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-EVgZ9q9N.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.4.81",
3
+ "version": "0.4.82",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {