pxengine 0.1.135 → 0.1.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -15787,10 +15787,12 @@ var NextStepCard = ({
15787
15787
  };
15788
15788
 
15789
15789
  // src/molecules/generic/PresentationJobCard/PresentationJobCard.tsx
15790
- import { useCallback as useCallback4, useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useRef as useRef9, useState as useState10 } from "react";
15790
+ import { useCallback as useCallback4, useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState10 } from "react";
15791
+ import { createPortal } from "react-dom";
15791
15792
 
15792
15793
  // src/lib/shared-poll.ts
15793
15794
  import { useEffect as useEffect6, useRef as useRef8 } from "react";
15795
+ var SSE_FALLBACK_POLL_MS = 2e4;
15794
15796
  var MAX_RETAINED = 50;
15795
15797
  var RETAIN_TTL_MS = 30 * 60 * 1e3;
15796
15798
  var entries = /* @__PURE__ */ new Map();
@@ -15917,6 +15919,12 @@ function stopSharedPoll(key) {
15917
15919
  entry.stopped = true;
15918
15920
  clearTimer(entry);
15919
15921
  }
15922
+ function refreshSharedPoll(key) {
15923
+ if (!key) return;
15924
+ const entry = entries.get(key);
15925
+ if (!entry || entry.stopped) return;
15926
+ void runPoll(key);
15927
+ }
15920
15928
  function getSharedPollLastData(key) {
15921
15929
  if (!key) return void 0;
15922
15930
  const entry = entries.get(key);
@@ -15953,6 +15961,45 @@ function useSharedPoll(config, onData, onError) {
15953
15961
  }, [key, intervalMs]);
15954
15962
  }
15955
15963
 
15964
+ // src/lib/job-signal.ts
15965
+ import { useEffect as useEffect7, useRef as useRef9 } from "react";
15966
+ var JOB_SIGNAL_EVENT = "pxengine:job-signal";
15967
+ var listeners = /* @__PURE__ */ new Set();
15968
+ var windowBridgeInstalled = false;
15969
+ function fanout(jobId) {
15970
+ if (!jobId) return;
15971
+ for (const listener of Array.from(listeners)) {
15972
+ try {
15973
+ listener(jobId);
15974
+ } catch {
15975
+ }
15976
+ }
15977
+ }
15978
+ function ensureWindowBridge() {
15979
+ if (windowBridgeInstalled || typeof window === "undefined") return;
15980
+ windowBridgeInstalled = true;
15981
+ window.addEventListener(JOB_SIGNAL_EVENT, (event) => {
15982
+ const detail = event.detail;
15983
+ const jobId = detail?.jobId;
15984
+ if (typeof jobId === "string" && jobId) fanout(jobId);
15985
+ });
15986
+ }
15987
+ function emitJobSignal(jobId) {
15988
+ fanout(jobId);
15989
+ }
15990
+ function subscribeJobSignal(listener) {
15991
+ ensureWindowBridge();
15992
+ listeners.add(listener);
15993
+ return () => {
15994
+ listeners.delete(listener);
15995
+ };
15996
+ }
15997
+ function useJobSignal(onSignal) {
15998
+ const ref = useRef9(onSignal);
15999
+ ref.current = onSignal;
16000
+ useEffect7(() => subscribeJobSignal((jobId) => ref.current(jobId)), []);
16001
+ }
16002
+
15956
16003
  // src/molecules/generic/job-card-shared/Chip.tsx
15957
16004
  import { jsx as jsx148 } from "react/jsx-runtime";
15958
16005
  var Chip = ({
@@ -16046,7 +16093,7 @@ function formatTemplateLabel(templateId) {
16046
16093
  }
16047
16094
  var DECK_CANVAS = { w: 1280, h: 720 };
16048
16095
  function useDeckFitScale(canvasW = DECK_CANVAS.w, canvasH = DECK_CANVAS.h) {
16049
- const containerRef = useRef9(null);
16096
+ const containerRef = useRef10(null);
16050
16097
  const [scale, setScale] = useState10(1);
16051
16098
  useLayoutEffect2(() => {
16052
16099
  const el = containerRef.current;
@@ -16135,55 +16182,58 @@ var ExportModal = ({ formats, title, onClose }) => {
16135
16182
  setDownloadingKey(null);
16136
16183
  }
16137
16184
  };
16138
- return /* @__PURE__ */ jsxs109("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
16139
- /* @__PURE__ */ jsx151("div", { className: "absolute inset-0 bg-black/70 backdrop-blur-sm", onClick: onClose }),
16140
- /* @__PURE__ */ jsxs109("div", { className: "relative z-10 bg-zinc-900 border border-zinc-800 rounded-2xl w-full max-w-sm p-6 shadow-2xl", children: [
16141
- /* @__PURE__ */ jsxs109("div", { className: "flex items-start justify-between mb-5", children: [
16142
- /* @__PURE__ */ jsxs109("div", { className: "min-w-0 pr-3", children: [
16143
- /* @__PURE__ */ jsx151("h3", { className: "text-sm font-semibold text-zinc-100", children: "Export Presentation" }),
16144
- /* @__PURE__ */ jsx151("p", { className: "text-xs text-zinc-500 mt-0.5 truncate", children: title })
16185
+ return createPortal(
16186
+ /* @__PURE__ */ jsxs109("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
16187
+ /* @__PURE__ */ jsx151("div", { className: "absolute inset-0 bg-black/70 backdrop-blur-sm", onClick: onClose }),
16188
+ /* @__PURE__ */ jsxs109("div", { className: "relative z-10 bg-zinc-900 border border-zinc-800 rounded-2xl w-full max-w-sm p-6 shadow-2xl", children: [
16189
+ /* @__PURE__ */ jsxs109("div", { className: "flex items-start justify-between mb-5", children: [
16190
+ /* @__PURE__ */ jsxs109("div", { className: "min-w-0 pr-3", children: [
16191
+ /* @__PURE__ */ jsx151("h3", { className: "text-sm font-semibold text-zinc-100", children: "Export Presentation" }),
16192
+ /* @__PURE__ */ jsx151("p", { className: "text-xs text-zinc-500 mt-0.5 truncate", children: title })
16193
+ ] }),
16194
+ /* @__PURE__ */ jsx151("button", { onClick: onClose, className: "text-zinc-500 hover:text-zinc-200 transition-colors flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx151(CloseIcon, {}) })
16145
16195
  ] }),
16146
- /* @__PURE__ */ jsx151("button", { onClick: onClose, className: "text-zinc-500 hover:text-zinc-200 transition-colors flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx151(CloseIcon, {}) })
16147
- ] }),
16148
- /* @__PURE__ */ jsxs109("div", { className: "space-y-2.5", children: [
16149
- available.length === 0 && /* @__PURE__ */ jsx151("p", { className: "text-sm text-zinc-500 text-center py-6", children: "No formats available yet" }),
16150
- available.map((fmt) => {
16151
- const url = formats[fmt.key];
16152
- const isDownloading = downloadingKey === fmt.key;
16153
- return /* @__PURE__ */ jsxs109(
16154
- "button",
16155
- {
16156
- type: "button",
16157
- disabled: Boolean(downloadingKey),
16158
- onClick: () => handleDownload(fmt.key, url, fmt.ext),
16159
- className: cn(
16160
- "flex w-full items-center gap-3.5 p-3.5 rounded-xl border transition-all text-left",
16161
- "hover:brightness-110 disabled:opacity-60 disabled:cursor-not-allowed",
16162
- fmt.accent.bg
16163
- ),
16164
- children: [
16165
- /* @__PURE__ */ jsx151("span", { className: "text-xl flex-shrink-0", children: fmt.emoji }),
16166
- /* @__PURE__ */ jsxs109("div", { className: "flex-1 min-w-0", children: [
16167
- /* @__PURE__ */ jsx151("p", { className: cn("text-sm font-semibold", fmt.accent.text), children: isDownloading ? `Downloading ${fmt.label}...` : fmt.label }),
16168
- /* @__PURE__ */ jsx151("p", { className: "text-xs text-zinc-500 mt-0.5 leading-relaxed", children: isDownloading ? "Please wait while the file is being prepared." : fmt.desc })
16169
- ] }),
16170
- /* @__PURE__ */ jsx151("span", { className: cn("flex-shrink-0", fmt.accent.text), children: /* @__PURE__ */ jsx151(DownloadIcon, {}) })
16171
- ]
16172
- },
16173
- fmt.key
16174
- );
16175
- })
16176
- ] }),
16177
- /* @__PURE__ */ jsx151("p", { className: "text-xs text-zinc-600 mt-4 text-center", children: "Download links expire in 90 days" })
16178
- ] })
16179
- ] });
16196
+ /* @__PURE__ */ jsxs109("div", { className: "space-y-2.5", children: [
16197
+ available.length === 0 && /* @__PURE__ */ jsx151("p", { className: "text-sm text-zinc-500 text-center py-6", children: "No formats available yet" }),
16198
+ available.map((fmt) => {
16199
+ const url = formats[fmt.key];
16200
+ const isDownloading = downloadingKey === fmt.key;
16201
+ return /* @__PURE__ */ jsxs109(
16202
+ "button",
16203
+ {
16204
+ type: "button",
16205
+ disabled: Boolean(downloadingKey),
16206
+ onClick: () => handleDownload(fmt.key, url, fmt.ext),
16207
+ className: cn(
16208
+ "flex w-full items-center gap-3.5 p-3.5 rounded-xl border transition-all text-left",
16209
+ "hover:brightness-110 disabled:opacity-60 disabled:cursor-not-allowed",
16210
+ fmt.accent.bg
16211
+ ),
16212
+ children: [
16213
+ /* @__PURE__ */ jsx151("span", { className: "text-xl flex-shrink-0", children: fmt.emoji }),
16214
+ /* @__PURE__ */ jsxs109("div", { className: "flex-1 min-w-0", children: [
16215
+ /* @__PURE__ */ jsx151("p", { className: cn("text-sm font-semibold", fmt.accent.text), children: isDownloading ? `Downloading ${fmt.label}...` : fmt.label }),
16216
+ /* @__PURE__ */ jsx151("p", { className: "text-xs text-zinc-500 mt-0.5 leading-relaxed", children: isDownloading ? "Please wait while the file is being prepared." : fmt.desc })
16217
+ ] }),
16218
+ /* @__PURE__ */ jsx151("span", { className: cn("flex-shrink-0", fmt.accent.text), children: /* @__PURE__ */ jsx151(DownloadIcon, {}) })
16219
+ ]
16220
+ },
16221
+ fmt.key
16222
+ );
16223
+ })
16224
+ ] }),
16225
+ /* @__PURE__ */ jsx151("p", { className: "text-xs text-zinc-600 mt-4 text-center", children: "Download links expire in 90 days" })
16226
+ ] })
16227
+ ] }),
16228
+ document.body
16229
+ );
16180
16230
  };
16181
16231
  var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) => {
16182
16232
  const [currentSlide, setCurrentSlide] = useState10(initialSlide);
16183
16233
  const [iframeReady, setIframeReady] = useState10(false);
16184
- const iframeRef = useRef9(null);
16234
+ const iframeRef = useRef10(null);
16185
16235
  const { containerRef, scale, canvasW, canvasH } = useDeckFitScale();
16186
- useEffect7(() => {
16236
+ useEffect8(() => {
16187
16237
  const onKey = (e) => {
16188
16238
  if (e.key === "Escape") onClose();
16189
16239
  };
@@ -16201,7 +16251,7 @@ var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) =>
16201
16251
  window.removeEventListener("message", onMsg);
16202
16252
  };
16203
16253
  }, [onClose, iframeReady]);
16204
- useEffect7(() => {
16254
+ useEffect8(() => {
16205
16255
  document.body.style.overflow = "hidden";
16206
16256
  return () => {
16207
16257
  document.body.style.overflow = "";
@@ -16220,81 +16270,84 @@ var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) =>
16220
16270
  setCurrentSlide(newSlide);
16221
16271
  iframe.contentWindow.postMessage({ type: "goToSlide", slide: newSlide }, "*");
16222
16272
  };
16223
- return /* @__PURE__ */ jsxs109("div", { className: "fixed inset-0 z-50 bg-black flex flex-col", children: [
16224
- /* @__PURE__ */ jsxs109("div", { className: "flex items-center justify-between gap-4 px-4 h-11 bg-zinc-950/90 border-b border-zinc-800/60 flex-shrink-0", children: [
16225
- /* @__PURE__ */ jsxs109("div", { className: "flex items-center gap-3 min-w-0", children: [
16226
- /* @__PURE__ */ jsx151("span", { className: "text-[#DCC99B] flex-shrink-0", children: /* @__PURE__ */ jsx151(SlidesIcon, {}) }),
16227
- /* @__PURE__ */ jsx151("span", { className: "text-sm font-medium text-zinc-300 truncate", children: title }),
16228
- slideCount > 0 && /* @__PURE__ */ jsxs109("span", { className: "text-xs text-zinc-600 flex-shrink-0", children: [
16229
- currentSlide,
16230
- " / ",
16231
- slideCount
16273
+ return createPortal(
16274
+ /* @__PURE__ */ jsxs109("div", { className: "fixed inset-0 z-[100] bg-black flex flex-col", children: [
16275
+ /* @__PURE__ */ jsxs109("div", { className: "flex items-center justify-between gap-4 px-4 h-11 bg-zinc-950/90 border-b border-zinc-800/60 flex-shrink-0", children: [
16276
+ /* @__PURE__ */ jsxs109("div", { className: "flex items-center gap-3 min-w-0", children: [
16277
+ /* @__PURE__ */ jsx151("span", { className: "text-[#DCC99B] flex-shrink-0", children: /* @__PURE__ */ jsx151(SlidesIcon, {}) }),
16278
+ /* @__PURE__ */ jsx151("span", { className: "text-sm font-medium text-zinc-300 truncate", children: title }),
16279
+ slideCount > 0 && /* @__PURE__ */ jsxs109("span", { className: "text-xs text-zinc-600 flex-shrink-0", children: [
16280
+ currentSlide,
16281
+ " / ",
16282
+ slideCount
16283
+ ] })
16284
+ ] }),
16285
+ /* @__PURE__ */ jsxs109("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
16286
+ /* @__PURE__ */ jsx151(
16287
+ "button",
16288
+ {
16289
+ onClick: () => sendSlideCommand("prevSlide"),
16290
+ disabled: !iframeReady,
16291
+ className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-[#C0AE82] hover:text-[#DCC99B] text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
16292
+ "aria-label": "Previous slide",
16293
+ children: /* @__PURE__ */ jsx151(ChevronLeft2, {})
16294
+ }
16295
+ ),
16296
+ /* @__PURE__ */ jsx151(
16297
+ "button",
16298
+ {
16299
+ onClick: () => sendSlideCommand("nextSlide"),
16300
+ disabled: !iframeReady,
16301
+ className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-[#C0AE82] hover:text-[#DCC99B] text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
16302
+ "aria-label": "Next slide",
16303
+ children: /* @__PURE__ */ jsx151(ChevronRight2, {})
16304
+ }
16305
+ ),
16306
+ /* @__PURE__ */ jsxs109(
16307
+ "button",
16308
+ {
16309
+ onClick: onClose,
16310
+ className: "flex items-center gap-1.5 px-3 h-7 rounded-lg border border-zinc-700 bg-zinc-800 hover:border-zinc-500 text-zinc-400 hover:text-zinc-200 text-xs transition-colors",
16311
+ children: [
16312
+ /* @__PURE__ */ jsx151(CloseIcon, {}),
16313
+ /* @__PURE__ */ jsx151("span", { children: "ESC" })
16314
+ ]
16315
+ }
16316
+ )
16232
16317
  ] })
16233
16318
  ] }),
16234
- /* @__PURE__ */ jsxs109("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
16235
- /* @__PURE__ */ jsx151(
16236
- "button",
16237
- {
16238
- onClick: () => sendSlideCommand("prevSlide"),
16239
- disabled: !iframeReady,
16240
- className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-[#C0AE82] hover:text-[#DCC99B] text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
16241
- "aria-label": "Previous slide",
16242
- children: /* @__PURE__ */ jsx151(ChevronLeft2, {})
16243
- }
16244
- ),
16245
- /* @__PURE__ */ jsx151(
16246
- "button",
16247
- {
16248
- onClick: () => sendSlideCommand("nextSlide"),
16249
- disabled: !iframeReady,
16250
- className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-[#C0AE82] hover:text-[#DCC99B] text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
16251
- "aria-label": "Next slide",
16252
- children: /* @__PURE__ */ jsx151(ChevronRight2, {})
16253
- }
16254
- ),
16255
- /* @__PURE__ */ jsxs109(
16256
- "button",
16257
- {
16258
- onClick: onClose,
16259
- className: "flex items-center gap-1.5 px-3 h-7 rounded-lg border border-zinc-700 bg-zinc-800 hover:border-zinc-500 text-zinc-400 hover:text-zinc-200 text-xs transition-colors",
16260
- children: [
16261
- /* @__PURE__ */ jsx151(CloseIcon, {}),
16262
- /* @__PURE__ */ jsx151("span", { children: "ESC" })
16263
- ]
16264
- }
16265
- )
16266
- ] })
16267
- ] }),
16268
- /* @__PURE__ */ jsx151("div", { ref: containerRef, className: "flex-1 relative flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsx151(
16269
- "div",
16270
- {
16271
- className: "relative",
16272
- style: { width: canvasW * scale, height: canvasH * scale },
16273
- children: /* @__PURE__ */ jsx151(
16274
- "iframe",
16275
- {
16276
- ref: iframeRef,
16277
- src: url,
16278
- title,
16279
- onLoad: () => {
16280
- setIframeReady(true);
16281
- hideDeckChrome(iframeRef.current);
16282
- iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: initialSlide }, "*");
16283
- },
16284
- sandbox: "allow-same-origin allow-scripts",
16285
- allow: "fullscreen",
16286
- className: "absolute top-0 left-0 border-0",
16287
- style: {
16288
- width: canvasW,
16289
- height: canvasH,
16290
- transform: `scale(${scale})`,
16291
- transformOrigin: "top left"
16319
+ /* @__PURE__ */ jsx151("div", { ref: containerRef, className: "flex-1 relative flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsx151(
16320
+ "div",
16321
+ {
16322
+ className: "relative",
16323
+ style: { width: canvasW * scale, height: canvasH * scale },
16324
+ children: /* @__PURE__ */ jsx151(
16325
+ "iframe",
16326
+ {
16327
+ ref: iframeRef,
16328
+ src: url,
16329
+ title,
16330
+ onLoad: () => {
16331
+ setIframeReady(true);
16332
+ hideDeckChrome(iframeRef.current);
16333
+ iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: initialSlide }, "*");
16334
+ },
16335
+ sandbox: "allow-same-origin allow-scripts",
16336
+ allow: "fullscreen",
16337
+ className: "absolute top-0 left-0 border-0",
16338
+ style: {
16339
+ width: canvasW,
16340
+ height: canvasH,
16341
+ transform: `scale(${scale})`,
16342
+ transformOrigin: "top left"
16343
+ }
16292
16344
  }
16293
- }
16294
- )
16295
- }
16296
- ) })
16297
- ] });
16345
+ )
16346
+ }
16347
+ ) })
16348
+ ] }),
16349
+ document.body
16350
+ );
16298
16351
  };
16299
16352
  var PresentationJobCard = ({
16300
16353
  job_id: _job_id,
@@ -16355,46 +16408,46 @@ var PresentationJobCard = ({
16355
16408
  const [regenPollUrl, setRegenPollUrl] = useState10(null);
16356
16409
  const [currentSlide, setCurrentSlide] = useState10(1);
16357
16410
  const [iframeReady, setIframeReady] = useState10(false);
16358
- const iframeRef = useRef9(null);
16411
+ const iframeRef = useRef10(null);
16359
16412
  const { containerRef: previewFitRef, scale: previewScale, canvasW, canvasH } = useDeckFitScale();
16360
- useEffect7(() => {
16413
+ useEffect8(() => {
16361
16414
  setStatus(initialStatus);
16362
16415
  }, [initialStatus]);
16363
16416
  const progressPct = initialProgress?.percentage;
16364
16417
  const progressStep = initialProgress?.current_step;
16365
- useEffect7(() => {
16418
+ useEffect8(() => {
16366
16419
  if (initialProgress) setProgress(initialProgress);
16367
16420
  }, [progressPct, progressStep]);
16368
- useEffect7(() => {
16421
+ useEffect8(() => {
16369
16422
  if (initialError) setError(initialError);
16370
16423
  }, [initialError]);
16371
- useEffect7(() => {
16424
+ useEffect8(() => {
16372
16425
  if (initialSlideCount !== void 0) setSlideCount(initialSlideCount);
16373
16426
  }, [initialSlideCount]);
16374
16427
  const htmlUrl = initialFormats?.html_url;
16375
- useEffect7(() => {
16428
+ useEffect8(() => {
16376
16429
  if (initialFormats) setFormats(initialFormats);
16377
16430
  }, [htmlUrl]);
16378
- useEffect7(() => {
16431
+ useEffect8(() => {
16379
16432
  if (initialTitle) setTitle(initialTitle);
16380
16433
  }, [initialTitle]);
16381
- useEffect7(() => {
16434
+ useEffect8(() => {
16382
16435
  if (initialGenerationMode) setGenerationMode(initialGenerationMode);
16383
16436
  }, [initialGenerationMode]);
16384
- useEffect7(() => {
16437
+ useEffect8(() => {
16385
16438
  if (initialTemplateId) setTemplateId(initialTemplateId);
16386
16439
  }, [initialTemplateId]);
16387
- useEffect7(() => {
16440
+ useEffect8(() => {
16388
16441
  if (initialTemplateVersionId) setTemplateVersionId(initialTemplateVersionId);
16389
16442
  }, [initialTemplateVersionId]);
16390
- useEffect7(() => {
16443
+ useEffect8(() => {
16391
16444
  if (initialReviewStatus) setReviewStatus(initialReviewStatus);
16392
16445
  }, [initialReviewStatus]);
16393
16446
  const initialOutlineSlideCount = initialOutline?.slides?.length;
16394
- useEffect7(() => {
16447
+ useEffect8(() => {
16395
16448
  if (initialOutline) setOutline(initialOutline);
16396
16449
  }, [initialOutlineSlideCount]);
16397
- useEffect7(() => {
16450
+ useEffect8(() => {
16398
16451
  if (reviewStatus !== "pending_outline_approval" || slideTemplateOptions !== null) return;
16399
16452
  let cancelled = false;
16400
16453
  (async () => {
@@ -16421,10 +16474,10 @@ var PresentationJobCard = ({
16421
16474
  cancelled = true;
16422
16475
  };
16423
16476
  }, [reviewStatus, slideTemplateOptions, templatesUrl, authToken]);
16424
- useEffect7(() => {
16477
+ useEffect8(() => {
16425
16478
  setIframeReady(false);
16426
16479
  }, [formats.html_url]);
16427
- useEffect7(() => {
16480
+ useEffect8(() => {
16428
16481
  const handler = (e) => {
16429
16482
  if (e.data?.type === "slideChanged") {
16430
16483
  setCurrentSlide(e.data.slide);
@@ -16450,15 +16503,15 @@ var PresentationJobCard = ({
16450
16503
  };
16451
16504
  const isTerminal = status === "complete" || status === "failed";
16452
16505
  const building = Boolean(outlineWritePollUrl) || approvingOutline;
16453
- const onCompleteRef = useRef9(onComplete);
16454
- const onFailedRef = useRef9(onFailed);
16455
- const hasNotifiedRef = useRef9(false);
16506
+ const onCompleteRef = useRef10(onComplete);
16507
+ const onFailedRef = useRef10(onFailed);
16508
+ const hasNotifiedRef = useRef10(false);
16456
16509
  onCompleteRef.current = onComplete;
16457
16510
  onFailedRef.current = onFailed;
16458
16511
  useSharedPoll(
16459
16512
  {
16460
16513
  key: !isTerminal && pollUrl ? pollUrl : null,
16461
- intervalMs: 3e3,
16514
+ intervalMs: SSE_FALLBACK_POLL_MS,
16462
16515
  fetcher: async () => {
16463
16516
  const headers = {};
16464
16517
  if (authToken) {
@@ -16518,7 +16571,7 @@ var PresentationJobCard = ({
16518
16571
  useSharedPoll(
16519
16572
  {
16520
16573
  key: building && pollUrl ? pollUrl : null,
16521
- intervalMs: 2e3,
16574
+ intervalMs: SSE_FALLBACK_POLL_MS,
16522
16575
  fetcher: async () => {
16523
16576
  const headers = {};
16524
16577
  if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
@@ -16568,7 +16621,7 @@ var PresentationJobCard = ({
16568
16621
  useSharedPoll(
16569
16622
  {
16570
16623
  key: outlineWritePollUrl,
16571
- intervalMs: 3e3,
16624
+ intervalMs: SSE_FALLBACK_POLL_MS,
16572
16625
  fetcher: async () => {
16573
16626
  const headers = {};
16574
16627
  if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
@@ -16593,7 +16646,7 @@ var PresentationJobCard = ({
16593
16646
  useSharedPoll(
16594
16647
  {
16595
16648
  key: regenPollUrl,
16596
- intervalMs: 3e3,
16649
+ intervalMs: SSE_FALLBACK_POLL_MS,
16597
16650
  fetcher: async () => {
16598
16651
  const headers = {};
16599
16652
  if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
@@ -16615,6 +16668,16 @@ var PresentationJobCard = ({
16615
16668
  }
16616
16669
  }
16617
16670
  );
16671
+ useJobSignal(
16672
+ useCallback4(
16673
+ (completedJobId) => {
16674
+ for (const url of [pollUrl, outlineWritePollUrl, regenPollUrl]) {
16675
+ if (url && url.includes(completedJobId)) refreshSharedPoll(url);
16676
+ }
16677
+ },
16678
+ [pollUrl, outlineWritePollUrl, regenPollUrl]
16679
+ )
16680
+ );
16618
16681
  const buildEditedOutline = () => {
16619
16682
  if (!outline || !Array.isArray(outline.slides)) return void 0;
16620
16683
  let changed = false;
@@ -17307,7 +17370,7 @@ var PresentationJobCard = ({
17307
17370
  };
17308
17371
 
17309
17372
  // src/molecules/generic/ResearchReportJobCard/ResearchReportJobCard.tsx
17310
- import { useCallback as useCallback5, useEffect as useEffect8, useRef as useRef10, useState as useState11 } from "react";
17373
+ import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef11, useState as useState11 } from "react";
17311
17374
  import { Fragment as Fragment6, jsx as jsx152, jsxs as jsxs110 } from "react/jsx-runtime";
17312
17375
  var DEFAULT_THEME = {
17313
17376
  primary: "#C0AE82",
@@ -17343,14 +17406,14 @@ function withPdfViewerParams(url) {
17343
17406
  return `${url}#toolbar=0&navpanes=0&scrollbar=0`;
17344
17407
  }
17345
17408
  var FullscreenPreviewModal = ({ url, title, onClose, isPdf }) => {
17346
- useEffect8(() => {
17409
+ useEffect9(() => {
17347
17410
  const onKey = (e) => {
17348
17411
  if (e.key === "Escape") onClose();
17349
17412
  };
17350
17413
  document.addEventListener("keydown", onKey);
17351
17414
  return () => document.removeEventListener("keydown", onKey);
17352
17415
  }, [onClose]);
17353
- useEffect8(() => {
17416
+ useEffect9(() => {
17354
17417
  document.body.style.overflow = "hidden";
17355
17418
  return () => {
17356
17419
  document.body.style.overflow = "";
@@ -17380,7 +17443,7 @@ var FullscreenPreviewModal = ({ url, title, onClose, isPdf }) => {
17380
17443
  src: url,
17381
17444
  title,
17382
17445
  className: "absolute inset-0 w-full h-full border-0",
17383
- ...isPdf ? {} : { sandbox: "allow-same-origin" }
17446
+ ...isPdf ? {} : { sandbox: "allow-same-origin allow-scripts" }
17384
17447
  }
17385
17448
  ) })
17386
17449
  ] });
@@ -17408,7 +17471,7 @@ var ReportExportModal = ({ htmlUrl, pdfUrl, title, onClose }) => {
17408
17471
  const available = REPORT_FORMATS.filter((f) => urls[f.key]);
17409
17472
  const filename = (title ?? "").replace(/[^a-z0-9]/gi, "-").toLowerCase();
17410
17473
  const [downloadingKey, setDownloadingKey] = useState11(null);
17411
- useEffect8(() => {
17474
+ useEffect9(() => {
17412
17475
  const onKey = (e) => {
17413
17476
  if (e.key === "Escape") onClose();
17414
17477
  };
@@ -17554,62 +17617,62 @@ var ResearchReportJobCard = (props) => {
17554
17617
  const [rowError, setRowError] = useState11(null);
17555
17618
  const [outlineWritePollUrl, setOutlineWritePollUrl] = useState11(null);
17556
17619
  const [regenPollUrl, setRegenPollUrl] = useState11(null);
17557
- const onCompleteRef = useRef10(onComplete);
17558
- const onFailedRef = useRef10(onFailed);
17559
- const hasNotifiedRef = useRef10(false);
17620
+ const onCompleteRef = useRef11(onComplete);
17621
+ const onFailedRef = useRef11(onFailed);
17622
+ const hasNotifiedRef = useRef11(false);
17560
17623
  onCompleteRef.current = onComplete;
17561
17624
  onFailedRef.current = onFailed;
17562
- useEffect8(() => {
17625
+ useEffect9(() => {
17563
17626
  const newStatus = initialStatus ?? (initialHtmlUrl ? "complete" : void 0);
17564
17627
  setStatus(newStatus);
17565
17628
  }, [initialStatus, initialHtmlUrl]);
17566
- useEffect8(() => {
17629
+ useEffect9(() => {
17567
17630
  if (initialTitle) setTitle(initialTitle);
17568
17631
  }, [initialTitle]);
17569
- useEffect8(() => {
17632
+ useEffect9(() => {
17570
17633
  if (initialHtmlUrl) setHtmlUrl(initialHtmlUrl);
17571
17634
  }, [initialHtmlUrl]);
17572
- useEffect8(() => {
17635
+ useEffect9(() => {
17573
17636
  if (initialGenerationMode) setGenerationMode(initialGenerationMode);
17574
17637
  }, [initialGenerationMode]);
17575
- useEffect8(() => {
17638
+ useEffect9(() => {
17576
17639
  if (initialTemplateId) setTemplateId(initialTemplateId);
17577
17640
  }, [initialTemplateId]);
17578
- useEffect8(() => {
17641
+ useEffect9(() => {
17579
17642
  if (initialTemplateVersionId) setTemplateVersionId(initialTemplateVersionId);
17580
17643
  }, [initialTemplateVersionId]);
17581
- useEffect8(() => {
17644
+ useEffect9(() => {
17582
17645
  if (initialReviewStatus) setReviewStatus(initialReviewStatus);
17583
17646
  }, [initialReviewStatus]);
17584
17647
  const initialOutlineSectionCount = initialOutline?.sections?.length;
17585
- useEffect8(() => {
17648
+ useEffect9(() => {
17586
17649
  if (initialOutline) setOutline(initialOutline);
17587
17650
  }, [initialOutlineSectionCount]);
17588
- useEffect8(() => {
17651
+ useEffect9(() => {
17589
17652
  if (initialDepth) setDepth(initialDepth);
17590
17653
  }, [initialDepth]);
17591
- useEffect8(() => {
17654
+ useEffect9(() => {
17592
17655
  if (initialSectionCount !== void 0) setSectionCount(initialSectionCount);
17593
17656
  }, [initialSectionCount]);
17594
- useEffect8(() => {
17657
+ useEffect9(() => {
17595
17658
  if (initialSourceCount !== void 0) setSourceCount(initialSourceCount);
17596
17659
  }, [initialSourceCount]);
17597
- useEffect8(() => {
17660
+ useEffect9(() => {
17598
17661
  if (initialWordCount !== void 0) setWordCount(initialWordCount);
17599
17662
  }, [initialWordCount]);
17600
- useEffect8(() => {
17663
+ useEffect9(() => {
17601
17664
  if (initialSummary) setSummary(initialSummary);
17602
17665
  }, [initialSummary]);
17603
17666
  const themePrimary = initialTheme?.primary;
17604
- useEffect8(() => {
17667
+ useEffect9(() => {
17605
17668
  if (initialTheme) setTheme(initialTheme);
17606
17669
  }, [themePrimary]);
17607
- useEffect8(() => {
17670
+ useEffect9(() => {
17608
17671
  if (initialError) setError(initialError);
17609
17672
  }, [initialError]);
17610
17673
  const progressPct = initialProgress?.percentage;
17611
17674
  const progressStep = initialProgress?.current_step;
17612
- useEffect8(() => {
17675
+ useEffect9(() => {
17613
17676
  if (initialProgress) setProgress(initialProgress);
17614
17677
  }, [progressPct, progressStep]);
17615
17678
  const isTerminal = status === "complete" || status === "failed";
@@ -17619,7 +17682,7 @@ var ResearchReportJobCard = (props) => {
17619
17682
  useSharedPoll(
17620
17683
  {
17621
17684
  key: !isTerminal && pollUrl ? pollUrl : null,
17622
- intervalMs: 3e3,
17685
+ intervalMs: SSE_FALLBACK_POLL_MS,
17623
17686
  fetcher: async () => {
17624
17687
  const headers = {};
17625
17688
  if (authToken) {
@@ -17675,7 +17738,7 @@ var ResearchReportJobCard = (props) => {
17675
17738
  useSharedPoll(
17676
17739
  {
17677
17740
  key: building && pollUrl ? pollUrl : null,
17678
- intervalMs: 2e3,
17741
+ intervalMs: SSE_FALLBACK_POLL_MS,
17679
17742
  fetcher: async () => {
17680
17743
  const headers = {};
17681
17744
  if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
@@ -17722,7 +17785,7 @@ var ResearchReportJobCard = (props) => {
17722
17785
  useSharedPoll(
17723
17786
  {
17724
17787
  key: regenPollUrl,
17725
- intervalMs: 3e3,
17788
+ intervalMs: SSE_FALLBACK_POLL_MS,
17726
17789
  fetcher: async () => {
17727
17790
  const headers = {};
17728
17791
  if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
@@ -17777,7 +17840,7 @@ var ResearchReportJobCard = (props) => {
17777
17840
  useSharedPoll(
17778
17841
  {
17779
17842
  key: outlineWritePollUrl,
17780
- intervalMs: 3e3,
17843
+ intervalMs: SSE_FALLBACK_POLL_MS,
17781
17844
  fetcher: async () => {
17782
17845
  const headers = {};
17783
17846
  if (authToken) headers["Authorization"] = `Bearer ${authToken}`;
@@ -17799,6 +17862,16 @@ var ResearchReportJobCard = (props) => {
17799
17862
  }
17800
17863
  }
17801
17864
  );
17865
+ useJobSignal(
17866
+ useCallback5(
17867
+ (completedJobId) => {
17868
+ for (const url of [pollUrl, outlineWritePollUrl, regenPollUrl]) {
17869
+ if (url && url.includes(completedJobId)) refreshSharedPoll(url);
17870
+ }
17871
+ },
17872
+ [pollUrl, outlineWritePollUrl, regenPollUrl]
17873
+ )
17874
+ );
17802
17875
  const buildEditedOutline = () => {
17803
17876
  if (!outline || !Array.isArray(outline.sections)) return void 0;
17804
17877
  let changed = false;
@@ -18412,7 +18485,7 @@ var ResearchReportJobCard = (props) => {
18412
18485
  {
18413
18486
  src: htmlUrl,
18414
18487
  title,
18415
- sandbox: "allow-same-origin",
18488
+ sandbox: "allow-same-origin allow-scripts",
18416
18489
  className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
18417
18490
  }
18418
18491
  ),
@@ -18472,7 +18545,7 @@ var ResearchReportJobCard = (props) => {
18472
18545
  };
18473
18546
 
18474
18547
  // src/molecules/generic/WebSearchJobCard/WebSearchJobCard.tsx
18475
- import { useEffect as useEffect9, useRef as useRef11, useState as useState12 } from "react";
18548
+ import { useEffect as useEffect10, useRef as useRef12, useState as useState12 } from "react";
18476
18549
  import { jsx as jsx153, jsxs as jsxs111 } from "react/jsx-runtime";
18477
18550
  var SearchIcon = () => /* @__PURE__ */ jsxs111("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
18478
18551
  /* @__PURE__ */ jsx153("circle", { cx: "11", cy: "11", r: "8" }),
@@ -18509,38 +18582,38 @@ var WebSearchJobCard = ({
18509
18582
  const [results, setResults] = useState12(initialResults || []);
18510
18583
  const [error, setError] = useState12(initialError);
18511
18584
  const [progress, setProgress] = useState12(initialProgress);
18512
- const onCompleteRef = useRef11(onComplete);
18513
- const onFailedRef = useRef11(onFailed);
18514
- const hasNotifiedRef = useRef11(false);
18585
+ const onCompleteRef = useRef12(onComplete);
18586
+ const onFailedRef = useRef12(onFailed);
18587
+ const hasNotifiedRef = useRef12(false);
18515
18588
  onCompleteRef.current = onComplete;
18516
18589
  onFailedRef.current = onFailed;
18517
- useEffect9(() => {
18590
+ useEffect10(() => {
18518
18591
  setStatus(initialStatus);
18519
18592
  }, [initialStatus]);
18520
- useEffect9(() => {
18593
+ useEffect10(() => {
18521
18594
  if (initialQuery) setQuery(initialQuery);
18522
18595
  }, [initialQuery]);
18523
- useEffect9(() => {
18596
+ useEffect10(() => {
18524
18597
  if (initialTitle && !initialQuery) setQuery(initialTitle);
18525
18598
  }, [initialTitle, initialQuery]);
18526
- useEffect9(() => {
18599
+ useEffect10(() => {
18527
18600
  if (initialResultCount !== void 0) setResultCount(initialResultCount);
18528
18601
  }, [initialResultCount]);
18529
- useEffect9(() => {
18602
+ useEffect10(() => {
18530
18603
  if (initialSearchCount !== void 0) setSearchCount(initialSearchCount);
18531
18604
  }, [initialSearchCount]);
18532
- useEffect9(() => {
18605
+ useEffect10(() => {
18533
18606
  if (initialSummary) setSummary(initialSummary);
18534
18607
  }, [initialSummary]);
18535
- useEffect9(() => {
18608
+ useEffect10(() => {
18536
18609
  if (initialResults) setResults(initialResults);
18537
18610
  }, [initialResults]);
18538
- useEffect9(() => {
18611
+ useEffect10(() => {
18539
18612
  if (initialError) setError(initialError);
18540
18613
  }, [initialError]);
18541
18614
  const progressPct = initialProgress?.percentage;
18542
18615
  const progressStep = initialProgress?.current_step;
18543
- useEffect9(() => {
18616
+ useEffect10(() => {
18544
18617
  if (initialProgress) setProgress(initialProgress);
18545
18618
  }, [progressPct, progressStep]);
18546
18619
  const isTerminal = status === "complete" || status === "failed";
@@ -18728,7 +18801,7 @@ var WebSearchJobCard = ({
18728
18801
  import React112, { useMemo as useMemo6 } from "react";
18729
18802
 
18730
18803
  // src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
18731
- import { useState as useState13, useRef as useRef12, useEffect as useEffect10, useMemo as useMemo5 } from "react";
18804
+ import { useState as useState13, useRef as useRef13, useEffect as useEffect11, useMemo as useMemo5 } from "react";
18732
18805
 
18733
18806
  // src/lib/countries.ts
18734
18807
  var countries = [
@@ -18942,8 +19015,8 @@ var CountrySelectEdit = ({
18942
19015
  }) => {
18943
19016
  const [isDropdownOpen, setIsDropdownOpen] = useState13(false);
18944
19017
  const [searchTerm, setSearchTerm] = useState13("");
18945
- const dropdownRef = useRef12(null);
18946
- useEffect10(() => {
19018
+ const dropdownRef = useRef13(null);
19019
+ useEffect11(() => {
18947
19020
  const handleClickOutside = (event) => {
18948
19021
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
18949
19022
  setIsDropdownOpen(false);
@@ -21012,11 +21085,11 @@ CampaignConceptCard.displayName = "CampaignConceptCard";
21012
21085
  import { useCallback as useCallback9, useState as useState22, memo } from "react";
21013
21086
 
21014
21087
  // src/molecules/creator-discovery/CreatorWidget/CreatorImageList.tsx
21015
- import { useEffect as useEffect11, useState as useState15 } from "react";
21088
+ import { useEffect as useEffect12, useState as useState15 } from "react";
21016
21089
  import { Fragment as Fragment7, jsx as jsx170, jsxs as jsxs127 } from "react/jsx-runtime";
21017
21090
  function useMediaQuery(query) {
21018
21091
  const [matches, setMatches] = useState15(false);
21019
- useEffect11(() => {
21092
+ useEffect12(() => {
21020
21093
  const media = window.matchMedia(query);
21021
21094
  const listener = () => setMatches(media.matches);
21022
21095
  listener();
@@ -21099,7 +21172,7 @@ function CreatorImageList({
21099
21172
  }
21100
21173
 
21101
21174
  // src/molecules/creator-discovery/CreatorWidget/CreatorProgressBar.tsx
21102
- import { useEffect as useEffect12, useState as useState16 } from "react";
21175
+ import { useEffect as useEffect13, useState as useState16 } from "react";
21103
21176
  import { motion as motion2, AnimatePresence as AnimatePresence2 } from "framer-motion";
21104
21177
  import { jsx as jsx171, jsxs as jsxs128 } from "react/jsx-runtime";
21105
21178
  function truncateName(name, maxLength) {
@@ -21108,7 +21181,7 @@ function truncateName(name, maxLength) {
21108
21181
  }
21109
21182
  function ProgressBar({ overallPercentage }) {
21110
21183
  const [showTooltip, setShowTooltip] = useState16(true);
21111
- useEffect12(() => {
21184
+ useEffect13(() => {
21112
21185
  if (overallPercentage && overallPercentage >= 100) {
21113
21186
  setShowTooltip(false);
21114
21187
  }
@@ -21269,7 +21342,7 @@ function CreatorCompactView({
21269
21342
  }
21270
21343
 
21271
21344
  // src/molecules/creator-discovery/CreatorWidget/CreatorExpandedPanel.tsx
21272
- import { useState as useState20, useEffect as useEffect14, useCallback as useCallback7 } from "react";
21345
+ import { useState as useState20, useEffect as useEffect15, useCallback as useCallback7 } from "react";
21273
21346
  import ReactDOM2 from "react-dom";
21274
21347
  import { AnimatePresence as AnimatePresence4, motion as motion5 } from "framer-motion";
21275
21348
 
@@ -22230,7 +22303,7 @@ function BrandCollaborationsList({
22230
22303
  }
22231
22304
 
22232
22305
  // src/molecules/creator-discovery/CreatorWidget/CreatorGridView.tsx
22233
- import { useState as useState19, useMemo as useMemo10, useRef as useRef13, useCallback as useCallback6, useEffect as useEffect13 } from "react";
22306
+ import { useState as useState19, useMemo as useMemo10, useRef as useRef14, useCallback as useCallback6, useEffect as useEffect14 } from "react";
22234
22307
  import { motion as motion4 } from "framer-motion";
22235
22308
  import { jsx as jsx179, jsxs as jsxs135 } from "react/jsx-runtime";
22236
22309
  var formatFollowerCount3 = (count) => {
@@ -22282,17 +22355,17 @@ function CreatorGridViewCard({ creator }) {
22282
22355
  const [isExpanded, setIsExpanded] = useState19(false);
22283
22356
  const [showFullDescription, setShowFullDescription] = useState19(false);
22284
22357
  const [isDescriptionOverflowing, setIsDescriptionOverflowing] = useState19(false);
22285
- const descriptionRef = useRef13(null);
22286
- const cardRef = useRef13(null);
22358
+ const descriptionRef = useRef14(null);
22359
+ const cardRef = useRef14(null);
22287
22360
  const checkDescriptionOverflow = useCallback6(() => {
22288
22361
  const el = descriptionRef.current;
22289
22362
  if (!el) return;
22290
22363
  setIsDescriptionOverflowing(el.scrollHeight > el.clientHeight + 1);
22291
22364
  }, []);
22292
- useEffect13(() => {
22365
+ useEffect14(() => {
22293
22366
  checkDescriptionOverflow();
22294
22367
  }, [checkDescriptionOverflow, isExpanded, showFullDescription]);
22295
- useEffect13(() => {
22368
+ useEffect14(() => {
22296
22369
  const onResize = () => checkDescriptionOverflow();
22297
22370
  window.addEventListener("resize", onResize);
22298
22371
  return () => window.removeEventListener("resize", onResize);
@@ -22984,7 +23057,7 @@ function CreatorExpandedPanel({
22984
23057
  setLoading(false);
22985
23058
  }
22986
23059
  }, [creatorIds, sessionId, version, fetcher]);
22987
- useEffect14(() => {
23060
+ useEffect15(() => {
22988
23061
  if (isOpen && creatorIds.length > 0) {
22989
23062
  loadCreators();
22990
23063
  }
@@ -23038,7 +23111,7 @@ function CreatorExpandedPanel({
23038
23111
  }
23039
23112
 
23040
23113
  // src/molecules/creator-discovery/CreatorWidget/useCreatorWidgetPolling.ts
23041
- import { useState as useState21, useEffect as useEffect15, useCallback as useCallback8, useMemo as useMemo11, useRef as useRef14 } from "react";
23114
+ import { useState as useState21, useEffect as useEffect16, useCallback as useCallback8, useMemo as useMemo11, useRef as useRef15 } from "react";
23042
23115
  var DEFAULT_POLLING_CONFIG = {
23043
23116
  pollInterval: 5e3,
23044
23117
  maxDuration: 15 * 60 * 1e3,
@@ -23116,9 +23189,9 @@ function useCreatorWidgetPolling({
23116
23189
  const [loadingStatus, setLoadingStatus] = useState21(
23117
23190
  !(hydrated.versionData && hydratedTerminal)
23118
23191
  );
23119
- const remainingTimeRef = useRef14(0);
23120
- const countdownRef = useRef14(null);
23121
- const versionDataRef = useRef14(versionData);
23192
+ const remainingTimeRef = useRef15(0);
23193
+ const countdownRef = useRef15(null);
23194
+ const versionDataRef = useRef15(versionData);
23122
23195
  versionDataRef.current = versionData;
23123
23196
  const requestedVersion = selectedVersion ?? currentVersion ?? versionData?.currentVersion;
23124
23197
  const updateStatus = useCallback8(
@@ -23159,9 +23232,9 @@ function useCreatorWidgetPolling({
23159
23232
  );
23160
23233
  const activeVersion = selectedVersion ?? requestedVersion;
23161
23234
  const statusKey = sessionId && activeVersion != null ? statusPollKey(sessionId, activeVersion) : null;
23162
- const errorCountRef = useRef14(0);
23163
- const deadlineRef = useRef14(0);
23164
- const doneRef = useRef14(hydratedTerminal);
23235
+ const errorCountRef = useRef15(0);
23236
+ const deadlineRef = useRef15(0);
23237
+ const doneRef = useRef15(hydratedTerminal);
23165
23238
  const stopCountdown = useCallback8(() => {
23166
23239
  if (countdownRef.current) {
23167
23240
  clearInterval(countdownRef.current);
@@ -23169,7 +23242,7 @@ function useCreatorWidgetPolling({
23169
23242
  }
23170
23243
  setTimeDisplay("");
23171
23244
  }, []);
23172
- useEffect15(() => {
23245
+ useEffect16(() => {
23173
23246
  if (statusKey == null) return;
23174
23247
  const cached = getSharedPollLastData(statusKey);
23175
23248
  const cachedStatus = cached?.status?.status;
@@ -23359,7 +23432,7 @@ function CreatorWidgetInner({
23359
23432
  var CreatorWidget = memo(CreatorWidgetInner);
23360
23433
 
23361
23434
  // src/molecules/analytics/AnalyticsChart.tsx
23362
- import { useEffect as useEffect16, useMemo as useMemo12, useRef as useRef15, useState as useState23 } from "react";
23435
+ import { useEffect as useEffect17, useMemo as useMemo12, useRef as useRef16, useState as useState23 } from "react";
23363
23436
 
23364
23437
  // src/molecules/analytics/buildOptions.ts
23365
23438
  function deepMerge(base, override) {
@@ -23695,8 +23768,8 @@ function AnalyticsChart({
23695
23768
  const [fetchedConfig, setFetchedConfig] = useState23(null);
23696
23769
  const [fetching, setFetching] = useState23(false);
23697
23770
  const [fetchError, setFetchError] = useState23(null);
23698
- const containerRef = useRef15(null);
23699
- const chartRef = useRef15(null);
23771
+ const containerRef = useRef16(null);
23772
+ const chartRef = useRef16(null);
23700
23773
  const declarative = useMemo12(
23701
23774
  () => resolveDeclarativeConfig({
23702
23775
  chartConfig,
@@ -23737,10 +23810,10 @@ function AnalyticsChart({
23737
23810
  const options = buildChartOptions(declarative, palette);
23738
23811
  return extraOptions ? deepMerge(options, extraOptions) : options;
23739
23812
  }, [declarative, theme, mode, extraOptions]);
23740
- useEffect16(() => {
23813
+ useEffect17(() => {
23741
23814
  setMounted(true);
23742
23815
  }, []);
23743
- useEffect16(() => {
23816
+ useEffect17(() => {
23744
23817
  if (!chartId || configProp || builtConfig) return;
23745
23818
  let cancelled = false;
23746
23819
  setFetching(true);
@@ -23762,7 +23835,7 @@ function AnalyticsChart({
23762
23835
  };
23763
23836
  }, [chartId, apiBase, authToken, configProp, builtConfig]);
23764
23837
  const activeConfig = configProp ?? builtConfig ?? fetchedConfig;
23765
- useEffect16(() => {
23838
+ useEffect17(() => {
23766
23839
  if (!mounted || !activeConfig || !containerRef.current) return;
23767
23840
  const container = containerRef.current;
23768
23841
  let cancelled = false;
@@ -23782,7 +23855,7 @@ function AnalyticsChart({
23782
23855
  cancelled = true;
23783
23856
  };
23784
23857
  }, [mounted, activeConfig]);
23785
- useEffect16(() => {
23858
+ useEffect17(() => {
23786
23859
  return () => {
23787
23860
  if (chartRef.current) {
23788
23861
  try {
@@ -23793,7 +23866,7 @@ function AnalyticsChart({
23793
23866
  }
23794
23867
  };
23795
23868
  }, []);
23796
- useEffect16(() => {
23869
+ useEffect17(() => {
23797
23870
  if (!mounted || !containerRef.current) return;
23798
23871
  const obs = new ResizeObserver(() => {
23799
23872
  try {
@@ -26069,6 +26142,7 @@ export {
26069
26142
  InputWidget,
26070
26143
  InsightDigestCard,
26071
26144
  InsightSummaryCard,
26145
+ JOB_SIGNAL_EVENT,
26072
26146
  KPIStatsCard,
26073
26147
  KbdAtom,
26074
26148
  KeywordBundlesDisplay,
@@ -26129,6 +26203,7 @@ export {
26129
26203
  ResizablePanel,
26130
26204
  ResizablePanelGroup,
26131
26205
  RiskSignalCard,
26206
+ SSE_FALLBACK_POLL_MS,
26132
26207
  ScoreBreakdownCard,
26133
26208
  ScrollArea,
26134
26209
  ScrollAreaAtom,
@@ -26199,17 +26274,21 @@ export {
26199
26274
  defaultFetchSelections,
26200
26275
  defaultPersistSelection,
26201
26276
  elementToQAField,
26277
+ emitJobSignal,
26202
26278
  formatQAMessage,
26203
26279
  generateFieldsFromData,
26204
26280
  generateFieldsFromPropDefinitions,
26205
26281
  getPxAuthToken,
26206
26282
  isInputAtom,
26207
26283
  notifyPxUnauthorized,
26284
+ refreshSharedPoll,
26208
26285
  setPxAuthTokenProvider,
26209
26286
  setPxUnauthorizedHandler,
26210
26287
  submitWidgetToAgent,
26288
+ subscribeJobSignal,
26211
26289
  th,
26212
26290
  useCreatorWidgetPolling,
26291
+ useJobSignal,
26213
26292
  useWidgetTheme,
26214
26293
  withAlpha
26215
26294
  };