@rslsp1/fa-app-tools 10.3.3 → 10.3.4

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.js CHANGED
@@ -22,7 +22,7 @@ require('./chunk-FTLEDU6C.js');
22
22
  require('./chunk-DDH2SGZM.js');
23
23
 
24
24
  // package.json
25
- var version = "10.3.3";
25
+ var version = "10.3.4";
26
26
 
27
27
  // src/hooks/useOnClickOutside.ts
28
28
  var _react = require('react'); var _react2 = _interopRequireDefault(_react);
@@ -5465,7 +5465,7 @@ function ServerTab({ serverBaseUrl }) {
5465
5465
  function FlowWorkspacePicker({
5466
5466
  tagBase,
5467
5467
  selectedUserId,
5468
- message,
5468
+ message: message2,
5469
5469
  onSelectUser,
5470
5470
  onSelectContext
5471
5471
  }) {
@@ -5489,7 +5489,7 @@ function FlowWorkspacePicker({
5489
5489
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "FineArt Flow" }),
5490
5490
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "small", { children: step === "user" ? "Benutzer w\xE4hlen" : `Kontext f\xFCr ${_nullishCoalesce(_optionalChain([selectedUser, 'optionalAccess', _153 => _153.username]), () => ( `User ${selectedUserId}`))}` })
5491
5491
  ] }),
5492
- message && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "flow-workspace-picker__warning", children: message }),
5492
+ message2 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "flow-workspace-picker__warning", children: message2 }),
5493
5493
  step === "user" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flow-workspace-picker__choices", "aria-label": "Benutzer w\xE4hlen", children: [
5494
5494
  tagBase.users.map((user) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", onClick: () => chooseUser(user.id), children: [
5495
5495
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: user.username }),
@@ -5606,7 +5606,8 @@ function createFlowBridgeClient({
5606
5606
  },
5607
5607
  async request(request) {
5608
5608
  const started = clock();
5609
- const reply = await exchange({ op: "request", target: request.target, method: request.method, path: request.path }, requestTimeoutMs);
5609
+ const tokenSuffix = "tokenSuffix" in request && request.tokenSuffix !== void 0 ? { tokenSuffix: request.tokenSuffix } : {};
5610
+ const reply = await exchange({ op: "request", target: request.target, method: request.method, path: request.path, ...tokenSuffix }, requestTimeoutMs);
5610
5611
  const roundTripMs = Math.round(clock() - started);
5611
5612
  if (!reply) {
5612
5613
  return { ok: false, transport: null, status: null, data: null, latencyMs: null, roundTripMs, error: noBridge(requestTimeoutMs) };
@@ -5625,13 +5626,130 @@ function createFlowBridgeClient({
5625
5626
  };
5626
5627
  }
5627
5628
 
5629
+ // src/lib/flowProbeLoader.ts
5630
+ var FLOW_PROBE_REQUEST = { target: "devMcp", method: "GET", path: "/flow-app/probe-bundle" };
5631
+ var HF_TOKEN_SUFFIX_CHARS = 8;
5632
+ var FLOW_PROBE_MARKER = "__faFlowProbe";
5633
+ var FLOW_PROBE_METHOD = "script-blob";
5634
+ var FLOW_PROBE_LOAD_TIMEOUT_MS = 5e3;
5635
+ var CSP_SETTLE_MS = 100;
5636
+ function isRecord2(value) {
5637
+ return value !== null && typeof value === "object" && !Array.isArray(value);
5638
+ }
5639
+ function hfTokenSuffix(token) {
5640
+ const trimmed = (_nullishCoalesce(token, () => ( ""))).trim();
5641
+ return trimmed.length >= HF_TOKEN_SUFFIX_CHARS ? trimmed.slice(-HF_TOKEN_SUFFIX_CHARS) : null;
5642
+ }
5643
+ function readFlowProbeBundle(data) {
5644
+ if (!isRecord2(data)) return null;
5645
+ const { version: version2, sha256, source } = data;
5646
+ if (typeof version2 !== "string" || !/^probe-\d{3}$/.test(version2)) return null;
5647
+ if (typeof sha256 !== "string" || !/^[0-9a-f]{64}$/.test(sha256)) return null;
5648
+ if (typeof source !== "string" || source.length === 0) return null;
5649
+ return { version: version2, sha256, source };
5650
+ }
5651
+ function readMarker(value) {
5652
+ if (!isRecord2(value) || value.executed !== true || typeof value.version !== "string") return null;
5653
+ return { executed: true, version: value.version, executedAt: typeof value.executedAt === "string" ? value.executedAt : null };
5654
+ }
5655
+ async function sha256Hex(text) {
5656
+ if (!_optionalChain([globalThis, 'access', _154 => _154.crypto, 'optionalAccess', _155 => _155.subtle])) throw new Error("crypto.subtle ist in diesem Kontext nicht verfuegbar.");
5657
+ const digest = await globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(text));
5658
+ return [...new Uint8Array(digest)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
5659
+ }
5660
+ var message = (error) => error instanceof Error ? error.message : String(error);
5661
+ var wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5662
+ async function executeFlowProbeBundle(bundle, {
5663
+ win = window,
5664
+ doc = document,
5665
+ timeoutMs = FLOW_PROBE_LOAD_TIMEOUT_MS,
5666
+ digest = sha256Hex
5667
+ } = {}) {
5668
+ const markerHost = win;
5669
+ const result = {
5670
+ method: FLOW_PROBE_METHOD,
5671
+ pageOrigin: win.location.origin,
5672
+ hash: { expected: bundle.sha256, actual: null, matches: null, error: null },
5673
+ scriptEvent: "not-started",
5674
+ marker: null,
5675
+ executed: false,
5676
+ cspViolations: [],
5677
+ error: null
5678
+ };
5679
+ try {
5680
+ result.hash.actual = await digest(bundle.source);
5681
+ result.hash.matches = result.hash.actual === bundle.sha256;
5682
+ } catch (error) {
5683
+ result.hash.error = message(error);
5684
+ }
5685
+ if (result.hash.matches === false) {
5686
+ result.error = "SHA-256 des empfangenen Quelltexts weicht ab \u2014 Bundle nicht ausgefuehrt.";
5687
+ return result;
5688
+ }
5689
+ delete markerHost[FLOW_PROBE_MARKER];
5690
+ const onViolation = (event) => {
5691
+ const violation = event;
5692
+ result.cspViolations.push(`${violation.effectiveDirective || violation.violatedDirective}: ${violation.blockedURI || "unbekannt"}`);
5693
+ };
5694
+ doc.addEventListener("securitypolicyviolation", onViolation);
5695
+ let url = null;
5696
+ let script = null;
5697
+ try {
5698
+ url = URL.createObjectURL(new Blob([bundle.source], { type: "text/javascript" }));
5699
+ const element = doc.createElement("script");
5700
+ script = element;
5701
+ result.scriptEvent = await new Promise((resolve) => {
5702
+ const timer = setTimeout(() => resolve("timeout"), timeoutMs);
5703
+ element.addEventListener("load", () => {
5704
+ clearTimeout(timer);
5705
+ resolve("load");
5706
+ });
5707
+ element.addEventListener("error", () => {
5708
+ clearTimeout(timer);
5709
+ resolve("error");
5710
+ });
5711
+ element.src = url;
5712
+ (_nullishCoalesce(doc.head, () => ( doc.documentElement))).appendChild(element);
5713
+ });
5714
+ } catch (error) {
5715
+ result.error = `Skript nicht einfuegbar: ${message(error)}`;
5716
+ }
5717
+ result.marker = readMarker(markerHost[FLOW_PROBE_MARKER]);
5718
+ result.executed = result.marker !== null && result.marker.version === bundle.version;
5719
+ if (!result.executed) await wait(CSP_SETTLE_MS);
5720
+ doc.removeEventListener("securitypolicyviolation", onViolation);
5721
+ _optionalChain([script, 'optionalAccess', _156 => _156.remove, 'call', _157 => _157()]);
5722
+ if (url) URL.revokeObjectURL(url);
5723
+ if (!result.executed && !result.error) {
5724
+ if (result.marker) result.error = `Marker meldet Version ${result.marker.version}, erwartet ${bundle.version}.`;
5725
+ else if (result.scriptEvent === "load") result.error = "script.onload ohne Marker \u2014 Ausfuehrung nicht belegt.";
5726
+ else if (result.scriptEvent === "error") result.error = "script.onerror \u2014 Skript nicht geladen oder blockiert.";
5727
+ else result.error = `Kein Skript-Ereignis innerhalb von ${timeoutMs} ms.`;
5728
+ }
5729
+ return result;
5730
+ }
5731
+
5628
5732
  // src/components/FlowBridgePanel.tsx
5629
5733
 
5630
5734
  var STATUS_REQUEST = { target: "dev", method: "GET", path: "/api/status" };
5631
- var FlowBridgePanel = ({ appVersion, client }) => {
5735
+ function hashText(execution) {
5736
+ if (execution.hash.matches === true) return "Hash gepr\xFCft";
5737
+ if (execution.hash.matches === false) return `Hash ABWEICHEND (berechnet ${_optionalChain([execution, 'access', _158 => _158.hash, 'access', _159 => _159.actual, 'optionalAccess', _160 => _160.slice, 'call', _161 => _161(0, 12)])}\u2026)`;
5738
+ return `Hash nicht pr\xFCfbar (${execution.hash.error})`;
5739
+ }
5740
+ function probeVerdict(run) {
5741
+ if (_optionalChain([run, 'access', _162 => _162.execution, 'optionalAccess', _163 => _163.executed])) return { ok: true, text: `ERGEBNIS: ausgef\xFChrt (executed: true, ${_optionalChain([run, 'access', _164 => _164.execution, 'access', _165 => _165.marker, 'optionalAccess', _166 => _166.version])})` };
5742
+ if (!run.response.ok) {
5743
+ return { ok: false, text: `ERGEBNIS: nicht ausgef\xFChrt \u2014 ${_optionalChain([run, 'access', _167 => _167.response, 'access', _168 => _168.error, 'optionalAccess', _169 => _169.code]) === "no-hf-token" ? "kein HF-Token in FlowFA." : "Bundle nicht \xFCber die Bridge erhalten."}` };
5744
+ }
5745
+ if (!run.bundle) return { ok: false, text: "ERGEBNIS: nicht ausgef\xFChrt \u2014 Antwort ohne g\xFCltiges Bundle." };
5746
+ return { ok: false, text: `ERGEBNIS: nicht ausgef\xFChrt \u2014 ${_optionalChain([run, 'access', _170 => _170.execution, 'optionalAccess', _171 => _171.error])}` };
5747
+ }
5748
+ var FlowBridgePanel = ({ appVersion, client, hfToken }) => {
5632
5749
  const bridge = _react.useMemo.call(void 0, () => _nullishCoalesce(client, () => ( createFlowBridgeClient({ appVersion }))), [client, appVersion]);
5633
5750
  const [status, setStatus] = _react.useState.call(void 0, null);
5634
5751
  const [response, setResponse] = _react.useState.call(void 0, null);
5752
+ const [probe, setProbe] = _react.useState.call(void 0, null);
5635
5753
  const [busy, setBusy] = _react.useState.call(void 0, null);
5636
5754
  const checkStatus = async () => {
5637
5755
  setBusy("status");
@@ -5659,6 +5777,35 @@ var FlowBridgePanel = ({ appVersion, client }) => {
5659
5777
  setBusy(null);
5660
5778
  }
5661
5779
  };
5780
+ const runProbe = async () => {
5781
+ setBusy("probe");
5782
+ setProbe(null);
5783
+ try {
5784
+ const tokenSuffix = hfTokenSuffix(hfToken);
5785
+ if (!tokenSuffix) {
5786
+ setProbe({
5787
+ response: {
5788
+ ok: false,
5789
+ transport: null,
5790
+ status: null,
5791
+ data: null,
5792
+ latencyMs: null,
5793
+ roundTripMs: 0,
5794
+ error: { code: "no-hf-token", message: "Kein HF-Token in FlowFA gesetzt \u2014 ohne ihn kein Zugang zum Dev-MCP-Host." }
5795
+ },
5796
+ bundle: null,
5797
+ execution: null
5798
+ });
5799
+ return;
5800
+ }
5801
+ const response2 = await bridge.request({ ...FLOW_PROBE_REQUEST, tokenSuffix });
5802
+ const bundle = response2.ok ? readFlowProbeBundle(response2.data) : null;
5803
+ const execution = bundle ? await executeFlowProbeBundle(bundle) : null;
5804
+ setProbe({ response: response2, bundle, execution });
5805
+ } finally {
5806
+ setBusy(null);
5807
+ }
5808
+ };
5662
5809
  const buttonStyle = {
5663
5810
  height: 36,
5664
5811
  border: "1px solid rgba(255,255,255,0.12)",
@@ -5672,15 +5819,34 @@ var FlowBridgePanel = ({ appVersion, client }) => {
5672
5819
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: checkStatus, disabled: busy !== null, className: "rounded-lg text-[11px] font-bold disabled:opacity-40", style: buttonStyle, children: busy === "status" ? "Pr\xFCfe\u2026" : "Bridge pr\xFCfen" }),
5673
5820
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: runRequest, disabled: busy !== null, className: "rounded-lg text-[11px] font-bold disabled:opacity-40", style: buttonStyle, children: busy === "request" ? "L\xE4uft\u2026" : "Dev /api/status" })
5674
5821
  ] }),
5822
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: runProbe, disabled: busy !== null, className: "rounded-lg text-[11px] font-bold disabled:opacity-40", style: buttonStyle, children: busy === "probe" ? "L\xE4uft\u2026" : "Mini-Bundle laden & ausf\xFChren" }),
5675
5823
  status && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { role: "status", "data-testid": "flow-bridge-status", style: { color: status.available ? "#4ade80" : "#f87171" }, children: status.available ? `Bridge: verbunden \xB7 ${status.name} v${status.version} \xB7 Protokoll ${status.protocol} \xB7 ${status.roundTripMs} ms` : `Bridge: nicht verbunden \xB7 ${status.error.code}: ${status.error.message}` }),
5676
5824
  response && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-testid": "flow-bridge-response", className: "flex flex-col gap-1", children: [
5677
5825
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: response.ok ? "#4ade80" : "#f87171" }, children: [
5678
5826
  `${STATUS_REQUEST.method} ${STATUS_REQUEST.path} (${STATUS_REQUEST.target}) \u2192 `,
5679
5827
  response.status !== null ? `HTTP ${response.status}` : "kein HTTP-Status",
5680
- response.ok ? "" : ` \xB7 ${_optionalChain([response, 'access', _154 => _154.error, 'optionalAccess', _155 => _155.code])}: ${_optionalChain([response, 'access', _156 => _156.error, 'optionalAccess', _157 => _157.message])}`
5828
+ response.ok ? "" : ` \xB7 ${_optionalChain([response, 'access', _172 => _172.error, 'optionalAccess', _173 => _173.code])}: ${_optionalChain([response, 'access', _174 => _174.error, 'optionalAccess', _175 => _175.message])}`
5681
5829
  ] }),
5682
5830
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/40", children: `Transport: ${_nullishCoalesce(response.transport, () => ( "keiner"))} \xB7 Server ${_nullishCoalesce(response.latencyMs, () => ( "\u2014"))} ms \xB7 gesamt ${response.roundTripMs} ms` }),
5683
5831
  response.ok && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { className: "text-white/60 whitespace-pre-wrap break-all bg-black/30 rounded-lg p-2", children: JSON.stringify(response.data, null, 2) })
5832
+ ] }),
5833
+ probe && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-testid": "flow-bridge-probe", className: "flex flex-col gap-1", children: [
5834
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: probe.response.ok ? "#4ade80" : "#f87171" }, children: [
5835
+ `${FLOW_PROBE_REQUEST.method} ${FLOW_PROBE_REQUEST.path} (${FLOW_PROBE_REQUEST.target}) \u2192 `,
5836
+ probe.response.status !== null ? `HTTP ${probe.response.status}` : "kein HTTP-Status",
5837
+ probe.response.ok ? "" : ` \xB7 ${_optionalChain([probe, 'access', _176 => _176.response, 'access', _177 => _177.error, 'optionalAccess', _178 => _178.code])}: ${_optionalChain([probe, 'access', _179 => _179.response, 'access', _180 => _180.error, 'optionalAccess', _181 => _181.message])}`
5838
+ ] }),
5839
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/40", children: `Transport: ${_nullishCoalesce(probe.response.transport, () => ( "keiner"))} \xB7 Server ${_nullishCoalesce(probe.response.latencyMs, () => ( "\u2014"))} ms \xB7 gesamt ${probe.response.roundTripMs} ms` }),
5840
+ probe.bundle && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-white/60 break-all", children: [
5841
+ `Bundle ${probe.bundle.version} \xB7 ${probe.bundle.source.length} Zeichen \xB7 SHA-256 ${probe.bundle.sha256.slice(0, 12)}\u2026`,
5842
+ probe.execution ? ` \xB7 ${hashText(probe.execution)}` : ""
5843
+ ] }),
5844
+ probe.execution && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5845
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/60 break-all", children: `Ausf\xFChrung: <script src=blob:> \xB7 Ereignis ${probe.execution.scriptEvent} \xB7 Seite ${probe.execution.pageOrigin}` }),
5846
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/60 break-all", children: `Marker window.${FLOW_PROBE_MARKER}: ${probe.execution.marker ? JSON.stringify(probe.execution.marker) : "fehlt"}` }),
5847
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "break-all", style: { color: probe.execution.cspViolations.length > 0 ? "#f87171" : "rgba(255,255,255,0.4)" }, children: probe.execution.cspViolations.length > 0 ? `CSP: ${probe.execution.cspViolations.join("; ")}` : "CSP: keine Verletzung gemeldet" })
5848
+ ] }),
5849
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "data-testid": "flow-bridge-probe-verdict", className: "font-bold", style: { color: probeVerdict(probe).ok ? "#4ade80" : "#f87171" }, children: probeVerdict(probe).text })
5684
5850
  ] })
5685
5851
  ] })
5686
5852
  ] });
@@ -5886,7 +6052,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
5886
6052
  const loadThumbnailsForEntries = _react.useCallback.call(void 0, async (entries) => {
5887
6053
  await loadThumbnailsSequentially(entries, {
5888
6054
  inFlight: hfInFlightRef.current,
5889
- isAlreadyLoaded: (entry) => !!_optionalChain([galleryItemsRef, 'access', _158 => _158.current, 'access', _159 => _159.find, 'call', _160 => _160((g) => g.id === entry.id), 'optionalAccess', _161 => _161.base64]),
6055
+ isAlreadyLoaded: (entry) => !!_optionalChain([galleryItemsRef, 'access', _182 => _182.current, 'access', _183 => _183.find, 'call', _184 => _184((g) => g.id === entry.id), 'optionalAccess', _185 => _185.base64]),
5890
6056
  isKnownMissing: (entry) => hfImageNotFoundRef.current.has(entry.id),
5891
6057
  loadImage: (entry) => _chunkVSHSZEGVjs.hfLoadImageAsBase64.call(void 0, entry.id, hfToken, effectiveNamespace, entry.filename, void 0, entry.mimeType, entry.hasThumb),
5892
6058
  onLoaded: (entry, b64) => {
@@ -5905,7 +6071,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
5905
6071
  }, [hfToken, effectiveNamespace]);
5906
6072
  _react.useEffect.call(void 0, () => {
5907
6073
  if (!hfState) return;
5908
- if (_optionalChain([hfState, 'access', _162 => _162.tags, 'optionalAccess', _163 => _163.by_category])) setWorkspaceTags(hfState.tags);
6074
+ if (_optionalChain([hfState, 'access', _186 => _186.tags, 'optionalAccess', _187 => _187.by_category])) setWorkspaceTags(hfState.tags);
5909
6075
  const hfIds = new Set(hfState.metadata.map((m) => m.id));
5910
6076
  const skeletons = hfState.metadata.map((m) => ({
5911
6077
  id: m.id,
@@ -6003,14 +6169,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6003
6169
  const [zoomOffset, setZoomOffset] = _react.useState.call(void 0, { x: 0, y: 0 });
6004
6170
  const { historyVisible, galleryVisible } = computePrefetchVisibility({
6005
6171
  layoutChoice,
6006
- appShellVisible: !showStart && !requireWorkspaceSelection && !(isFullscreen && !!_optionalChain([currentResult, 'optionalAccess', _164 => _164.base64])),
6172
+ appShellVisible: !showStart && !requireWorkspaceSelection && !(isFullscreen && !!_optionalChain([currentResult, 'optionalAccess', _188 => _188.base64])),
6007
6173
  mobileTab,
6008
6174
  middlePanel,
6009
6175
  activeTab,
6010
6176
  isRightCollapsed
6011
6177
  });
6012
6178
  useThumbnailPrefetch({
6013
- metadata: _optionalChain([hfState, 'optionalAccess', _165 => _165.metadata]),
6179
+ metadata: _optionalChain([hfState, 'optionalAccess', _189 => _189.metadata]),
6014
6180
  historyVisible,
6015
6181
  galleryVisible,
6016
6182
  historyVisibleCount,
@@ -6071,7 +6237,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6071
6237
  };
6072
6238
  const handleSelectReference = async () => {
6073
6239
  const media = await onSelectMedia();
6074
- if (!_optionalChain([media, 'optionalAccess', _166 => _166.length])) return;
6240
+ if (!_optionalChain([media, 'optionalAccess', _190 => _190.length])) return;
6075
6241
  const first = media[0];
6076
6242
  if (first.mediaId) {
6077
6243
  setActiveReferenceId(first.mediaId);
@@ -6094,7 +6260,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6094
6260
  generateImage: onGenerateImage,
6095
6261
  saveResult: async (item) => {
6096
6262
  const frame = item.frames[0];
6097
- if (_optionalChain([frame, 'optionalAccess', _167 => _167.base64])) {
6263
+ if (_optionalChain([frame, 'optionalAccess', _191 => _191.base64])) {
6098
6264
  const gen = frameToGeneration(frame, item);
6099
6265
  setGalleryItems((prev) => [gen, ...prev]);
6100
6266
  setHistory((prev) => [gen, ...prev]);
@@ -6162,7 +6328,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6162
6328
  setIsScanningImage(false);
6163
6329
  }
6164
6330
  };
6165
- const currentIndex = _react.useMemo.call(void 0, () => history.findIndex((h) => h.id === _optionalChain([currentResult, 'optionalAccess', _168 => _168.id])), [history, currentResult]);
6331
+ const currentIndex = _react.useMemo.call(void 0, () => history.findIndex((h) => h.id === _optionalChain([currentResult, 'optionalAccess', _192 => _192.id])), [history, currentResult]);
6166
6332
  const goToPrev = _react.useCallback.call(void 0, () => {
6167
6333
  if (currentIndex > 0) setCurrentResult(history[currentIndex - 1]);
6168
6334
  }, [currentIndex, history]);
@@ -6176,7 +6342,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6176
6342
  _chunkVSHSZEGVjs.hfLoadImageAsBase64.call(void 0, g.id, hfToken, effectiveNamespace, g.filename, void 0, g.mimeType, false).then((b64) => {
6177
6343
  if (!b64) return;
6178
6344
  const full = `data:${g.mimeType || "image/jpeg"};base64,${b64}`;
6179
- setCurrentResult((prev) => _optionalChain([prev, 'optionalAccess', _169 => _169.id]) === g.id ? { ...prev, fullBase64: full } : prev);
6345
+ setCurrentResult((prev) => _optionalChain([prev, 'optionalAccess', _193 => _193.id]) === g.id ? { ...prev, fullBase64: full } : prev);
6180
6346
  setGalleryItems((prev) => prev.map((item) => item.id === g.id ? { ...item, fullBase64: full } : item));
6181
6347
  }).catch(() => {
6182
6348
  });
@@ -6192,13 +6358,13 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6192
6358
  }
6193
6359
  }, [hfToken, effectiveNamespace, hfWriteEvent]);
6194
6360
  const currentGroup = _react.useMemo.call(void 0, () => {
6195
- if (!_optionalChain([currentResult, 'optionalAccess', _170 => _170.prompt])) return [];
6361
+ if (!_optionalChain([currentResult, 'optionalAccess', _194 => _194.prompt])) return [];
6196
6362
  const groups = groupByPrompt(galleryItems.filter((g) => g.status === "done" && !!g.base64));
6197
6363
  const group = groups.find((gr) => gr.prompt === currentResult.prompt);
6198
6364
  return group ? group.items : [];
6199
- }, [galleryItems, _optionalChain([currentResult, 'optionalAccess', _171 => _171.prompt])]);
6365
+ }, [galleryItems, _optionalChain([currentResult, 'optionalAccess', _195 => _195.prompt])]);
6200
6366
  _react.useEffect.call(void 0, () => {
6201
- if (!_optionalChain([currentResult, 'optionalAccess', _172 => _172.prompt]) || !hfToken || !effectiveNamespace || !hfState) return;
6367
+ if (!_optionalChain([currentResult, 'optionalAccess', _196 => _196.prompt]) || !hfToken || !effectiveNamespace || !hfState) return;
6202
6368
  const siblings = galleryItemsRef.current.filter(
6203
6369
  (g) => g.prompt === currentResult.prompt && !g.base64 && !hfImageNotFoundRef.current.has(g.id)
6204
6370
  );
@@ -6221,7 +6387,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6221
6387
  }
6222
6388
  }
6223
6389
  })();
6224
- }, [_optionalChain([currentResult, 'optionalAccess', _173 => _173.id]), _optionalChain([currentResult, 'optionalAccess', _174 => _174.prompt])]);
6390
+ }, [_optionalChain([currentResult, 'optionalAccess', _197 => _197.id]), _optionalChain([currentResult, 'optionalAccess', _198 => _198.prompt])]);
6225
6391
  const hcStyle = highContrast ? { filter: "brightness(1.6) contrast(1.05)" } : void 0;
6226
6392
  const runningBadge = activeGenerationsCount > 0 ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
6227
6393
  "div",
@@ -6302,7 +6468,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6302
6468
  const errorGen = { ...newGen, status: "error", error: { message: err.message || "Unbekannter Fehler", details: err.toString() } };
6303
6469
  setHistory((prev) => prev.map((g) => g.id === genId ? errorGen : g));
6304
6470
  setGalleryItems((prev) => prev.filter((g) => g.id !== genId));
6305
- if (!options.silent || _optionalChain([currentResult, 'optionalAccess', _175 => _175.id]) === genId) setCurrentResult(errorGen);
6471
+ if (!options.silent || _optionalChain([currentResult, 'optionalAccess', _199 => _199.id]) === genId) setCurrentResult(errorGen);
6306
6472
  } finally {
6307
6473
  setActiveGenerationsCount((prev) => Math.max(0, prev - 1));
6308
6474
  }
@@ -6438,7 +6604,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6438
6604
  }
6439
6605
  };
6440
6606
  const handleDownloadSingle = async () => {
6441
- if (!_optionalChain([currentResult, 'optionalAccess', _176 => _176.base64])) return;
6607
+ if (!_optionalChain([currentResult, 'optionalAccess', _200 => _200.base64])) return;
6442
6608
  try {
6443
6609
  const downloadSrc = currentResult.fullBase64 || currentResult.base64;
6444
6610
  const base64Data = downloadSrc.split(",")[1];
@@ -6454,9 +6620,9 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6454
6620
  const reader = new FileReader();
6455
6621
  reader.onload = (ev) => {
6456
6622
  try {
6457
- const root = JSON.parse(_optionalChain([ev, 'access', _177 => _177.target, 'optionalAccess', _178 => _178.result]));
6623
+ const root = JSON.parse(_optionalChain([ev, 'access', _201 => _201.target, 'optionalAccess', _202 => _202.result]));
6458
6624
  const rawTags = root.tags || root;
6459
- if (!_optionalChain([rawTags, 'optionalAccess', _179 => _179.by_category])) return;
6625
+ if (!_optionalChain([rawTags, 'optionalAccess', _203 => _203.by_category])) return;
6460
6626
  const filtered = {};
6461
6627
  const EXCLUDED2 = ["pdf-export", "book.micro-edit-rules"];
6462
6628
  Object.entries(rawTags.by_category).forEach(([cat, items]) => {
@@ -6473,7 +6639,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6473
6639
  };
6474
6640
  const handleHfInitialSync = async (onProgress) => {
6475
6641
  if (!hfToken || !effectiveNamespace) return;
6476
- const existingIds = new Set((_optionalChain([hfState, 'optionalAccess', _180 => _180.metadata]) || []).map((m) => m.id));
6642
+ const existingIds = new Set((_optionalChain([hfState, 'optionalAccess', _204 => _204.metadata]) || []).map((m) => m.id));
6477
6643
  const gens = galleryItems.filter((g) => g.base64 && g.status === "done" && !existingIds.has(g.id));
6478
6644
  const total = gens.length;
6479
6645
  onProgress(0, total);
@@ -6499,7 +6665,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6499
6665
  }
6500
6666
  };
6501
6667
  const mergeWorkspaceTags = (local, remote) => {
6502
- if (!_optionalChain([remote, 'optionalAccess', _181 => _181.by_category])) return local;
6668
+ if (!_optionalChain([remote, 'optionalAccess', _205 => _205.by_category])) return local;
6503
6669
  const merged = {};
6504
6670
  const allCategories = /* @__PURE__ */ new Set([...Object.keys(local.by_category), ...Object.keys(remote.by_category)]);
6505
6671
  for (const cat of allCategories) {
@@ -6509,7 +6675,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6509
6675
  const localValues = new Set(localTags.map((t) => t.value));
6510
6676
  const mergedLocal = localTags.map((t) => {
6511
6677
  const remote2 = remoteMap.get(t.value);
6512
- return _optionalChain([remote2, 'optionalAccess', _182 => _182.is_deleted]) ? { ...t, is_deleted: true } : t;
6678
+ return _optionalChain([remote2, 'optionalAccess', _206 => _206.is_deleted]) ? { ...t, is_deleted: true } : t;
6513
6679
  });
6514
6680
  const onlyInRemote = remoteTags.filter((t) => !localValues.has(t.value));
6515
6681
  merged[cat] = [...mergedLocal, ...onlyInRemote];
@@ -6517,7 +6683,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6517
6683
  const all = Object.entries(merged).flatMap(([cat, tags]) => tags.map((t) => ({ ...t, category: cat })));
6518
6684
  return { by_category: merged, all };
6519
6685
  };
6520
- if (isFullscreen && _optionalChain([currentResult, 'optionalAccess', _183 => _183.base64])) {
6686
+ if (isFullscreen && _optionalChain([currentResult, 'optionalAccess', _207 => _207.base64])) {
6521
6687
  const fsRaw = currentResult.fullBase64 || currentResult.base64;
6522
6688
  const fsBase64 = fsRaw.startsWith("data:") ? fsRaw : `data:image/png;base64,${fsRaw}`;
6523
6689
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -6668,7 +6834,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6668
6834
  layoutChoice === "mobile-desktop" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/20 text-[9px] text-center", children: "Mobil-Layout skaliert f\xFCr Desktop-Modus" }),
6669
6835
  layoutChoice === "tablet-landscape" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-white/20 text-[9px] text-center", children: "2-Spalten-Layout f\xFCr Landscape-Tablet im Desktop-Mode" })
6670
6836
  ] }),
6671
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FlowBridgePanel, { appVersion: version })
6837
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FlowBridgePanel, { appVersion: version, hfToken })
6672
6838
  ] });
6673
6839
  }
6674
6840
  if (requireWorkspaceSelection) {
@@ -6732,7 +6898,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6732
6898
  }, children: [
6733
6899
  mobileTab === "labs" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col flex-1 min-h-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LabsTab, { services: labServices, onResult: (item) => {
6734
6900
  const frame = item.frames[0];
6735
- if (_optionalChain([frame, 'optionalAccess', _184 => _184.base64])) {
6901
+ if (_optionalChain([frame, 'optionalAccess', _208 => _208.base64])) {
6736
6902
  setCurrentResult(frameToGeneration(frame, item));
6737
6903
  setMobileTab("stage");
6738
6904
  }
@@ -6756,7 +6922,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6756
6922
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: selectedModel, onChange: setSelectedModel, options: [{ value: "\u{1F34C} Nano Banana Pro", label: "\u{1F34C} Nano Banana Pro" }, { value: "\u{1F34C} Nano Banana 2", label: "\u{1F34C} Nano Banana 2" }, { value: "Imagen 4", label: "Imagen 4" }] }),
6757
6923
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: String(imageCount), displayValue: `${imageCount}\xD7`, onChange: updateImageCount, options: imageCountOptions }),
6758
6924
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1" }),
6759
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _185 => _185.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
6925
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _209 => _209.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
6760
6926
  runningBadge,
6761
6927
  activeReferenceThumbnail ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1 rounded-lg border border-white/20 bg-white/5 overflow-hidden mr-2", style: { height: 28 }, children: [
6762
6928
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: activeReferenceThumbnail, className: "h-full aspect-square object-cover" }),
@@ -6807,21 +6973,21 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6807
6973
  setTouchStartX(null);
6808
6974
  },
6809
6975
  children: [
6810
- _optionalChain([currentResult, 'optionalAccess', _186 => _186.status]) === "processing" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-3 opacity-40", children: [
6976
+ _optionalChain([currentResult, 'optionalAccess', _210 => _210.status]) === "processing" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-3 opacity-40", children: [
6811
6977
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[40px]", children: "hourglass_top" }),
6812
6978
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[11px] uppercase font-bold tracking-widest", children: "Erstelle Bild..." })
6813
6979
  ] }),
6814
- _optionalChain([currentResult, 'optionalAccess', _187 => _187.status]) === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-6 text-center flex flex-col items-center gap-3", children: [
6980
+ _optionalChain([currentResult, 'optionalAccess', _211 => _211.status]) === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-6 text-center flex flex-col items-center gap-3", children: [
6815
6981
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-red-400 text-[36px]", children: "warning" }),
6816
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/50 text-[13px]", children: _optionalChain([currentResult, 'access', _188 => _188.error, 'optionalAccess', _189 => _189.message]) }),
6982
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/50 text-[13px]", children: _optionalChain([currentResult, 'access', _212 => _212.error, 'optionalAccess', _213 => _213.message]) }),
6817
6983
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => handleGenerateImage(currentResult.prompt), className: "px-4 py-2 rounded-lg border border-white/20 text-[13px] text-white/70 active:bg-white/10", children: "Erneut versuchen" })
6818
6984
  ] }),
6819
- _optionalChain([currentResult, 'optionalAccess', _190 => _190.status]) === "done" && currentResult.base64 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: currentResult.fullBase64 || currentResult.base64, className: "w-full h-full object-contain" }),
6985
+ _optionalChain([currentResult, 'optionalAccess', _214 => _214.status]) === "done" && currentResult.base64 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: currentResult.fullBase64 || currentResult.base64, className: "w-full h-full object-contain" }),
6820
6986
  !currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-2 opacity-10", children: [
6821
6987
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[64px]", children: "palette" }),
6822
6988
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[11px] font-bold uppercase tracking-[0.2em]", children: "Avatar Architect" })
6823
6989
  ] }),
6824
- _optionalChain([currentResult, 'optionalAccess', _191 => _191.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: openFullscreen, className: "absolute top-2 right-2 w-8 h-8 flex items-center justify-center rounded-full bg-black/60 border border-white/10 z-10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[18px]", children: "fullscreen" }) }),
6990
+ _optionalChain([currentResult, 'optionalAccess', _215 => _215.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: openFullscreen, className: "absolute top-2 right-2 w-8 h-8 flex items-center justify-center rounded-full bg-black/60 border border-white/10 z-10", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[18px]", children: "fullscreen" }) }),
6825
6991
  history.length > 1 && currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
6826
6992
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToPrev, disabled: currentIndex <= 0, className: "absolute left-2 top-1/2 -translate-y-1/2 w-10 h-10 flex items-center justify-center rounded-full bg-black/60 border border-white/10 disabled:opacity-0 transition-opacity", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[22px]", children: "chevron_left" }) }),
6827
6993
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToNext, disabled: currentIndex >= history.length - 1, className: "absolute right-2 top-1/2 -translate-y-1/2 w-10 h-10 flex items-center justify-center rounded-full bg-black/60 border border-white/10 disabled:opacity-0 transition-opacity", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[22px]", children: "chevron_right" }) }),
@@ -6834,7 +7000,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6834
7000
  ]
6835
7001
  }
6836
7002
  ),
6837
- _optionalChain([currentResult, 'optionalAccess', _192 => _192.status]) === "done" && currentGroup.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2 flex gap-1.5 overflow-x-auto pb-1", style: { scrollbarWidth: "none" }, children: currentGroup.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { position: "relative", flexShrink: 0 }, children: [
7003
+ _optionalChain([currentResult, 'optionalAccess', _216 => _216.status]) === "done" && currentGroup.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2 flex gap-1.5 overflow-x-auto pb-1", style: { scrollbarWidth: "none" }, children: currentGroup.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { position: "relative", flexShrink: 0 }, children: [
6838
7004
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6839
7005
  "div",
6840
7006
  {
@@ -6877,7 +7043,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6877
7043
  }
6878
7044
  )
6879
7045
  ] }, item.id)) }),
6880
- _optionalChain([currentResult, 'optionalAccess', _193 => _193.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2 mt-3", children: [
7046
+ _optionalChain([currentResult, 'optionalAccess', _217 => _217.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2 mt-3", children: [
6881
7047
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { onClick: () => setActivePrompt(currentResult.prompt || ""), className: "flex-1 flex items-center justify-center gap-1.5 rounded-xl border border-white/10 bg-white/5 active:bg-white/10 transition-colors", style: { height: 44 }, children: [
6882
7048
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[18px] text-white/60", children: "replay" }),
6883
7049
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[12px] text-white/60", children: "Prompt" })
@@ -6899,14 +7065,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
6899
7065
  hfToken && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => refreshHF(), disabled: isHfRefreshing, className: "w-12 flex items-center justify-center text-white/20 active:text-white transition-colors disabled:opacity-30", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `material-symbols-outlined text-[20px]${isHfRefreshing ? " animate-spin" : ""}`, children: "sync" }) })
6900
7066
  ] }),
6901
7067
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 overflow-hidden relative", children: [
6902
- activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _194 => _194.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }),
7068
+ activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _218 => _218.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }),
6903
7069
  activeTab === "gallery" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6904
7070
  MediaLibrary,
6905
7071
  {
6906
7072
  items: galleryItems,
6907
7073
  onImport: async () => {
6908
7074
  const media = await onSelectMedia();
6909
- if (!_optionalChain([media, 'optionalAccess', _195 => _195.length])) return;
7075
+ if (!_optionalChain([media, 'optionalAccess', _219 => _219.length])) return;
6910
7076
  setGalleryItems((prev) => [...media.map((m) => ({ id: crypto.randomUUID(), nodeId: "1", base64: `data:${m.mimeType};base64,${m.base64}`, mediaId: m.mediaId, prompt: m.name || "Importiert", timestamp: Date.now(), status: "done", tags: [], type: "import" })), ...prev]);
6911
7077
  },
6912
7078
  onDelete: (id) => setGalleryItems((g) => g.filter((x) => x.id !== id)),
@@ -7054,7 +7220,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7054
7220
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: selectedModel, onChange: setSelectedModel, options: [{ value: "\u{1F34C} Nano Banana Pro", label: "\u{1F34C} Nano Banana Pro" }, { value: "\u{1F34C} Nano Banana 2", label: "\u{1F34C} Nano Banana 2" }, { value: "Imagen 4", label: "Imagen 4" }] }),
7055
7221
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CompactDropdown, { value: String(imageCount), displayValue: `${imageCount}\xD7`, onChange: updateImageCount, options: imageCountOptions }),
7056
7222
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1 } }),
7057
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _196 => _196.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
7223
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _220 => _220.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
7058
7224
  runningBadge,
7059
7225
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: toggleContrast, style: { color: "rgba(255,255,255,0.2)", background: "none", border: "none", cursor: "pointer", padding: 4, lineHeight: 0 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: highContrast ? "light_mode" : "dark_mode" }) }),
7060
7226
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => setShowStart(true), style: { color: "rgba(255,255,255,0.2)", background: "none", border: "none", cursor: "pointer", padding: 4, lineHeight: 0 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: "apps" }) })
@@ -7083,7 +7249,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7083
7249
  ]
7084
7250
  }
7085
7251
  ) }),
7086
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1, overflow: "hidden", position: "relative" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _197 => _197.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }) })
7252
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { flex: 1, overflow: "hidden", position: "relative" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _221 => _221.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }) })
7087
7253
  ] }),
7088
7254
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { flex: 1, height: tlH, display: "flex", flexDirection: "column", background: "#0b0b0b" }, children: [
7089
7255
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -7099,21 +7265,21 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7099
7265
  setTouchStartX(null);
7100
7266
  },
7101
7267
  children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { height: "100%", width: "100%", borderRadius: 20, border: "1px solid rgba(255,255,255,0.05)", background: "rgba(0,0,0,0.4)", position: "relative", overflow: "hidden", display: "flex", alignItems: "center", justifyContent: "center" }, children: [
7102
- _optionalChain([currentResult, 'optionalAccess', _198 => _198.status]) === "processing" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 12, opacity: 0.4 }, children: [
7268
+ _optionalChain([currentResult, 'optionalAccess', _222 => _222.status]) === "processing" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 12, opacity: 0.4 }, children: [
7103
7269
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 36 }, children: "hourglass_top" }),
7104
7270
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontSize: 10, color: "rgba(255,255,255,0.6)", textTransform: "uppercase", fontWeight: "bold", letterSpacing: "0.15em" }, children: "Erstelle Bild..." })
7105
7271
  ] }),
7106
- _optionalChain([currentResult, 'optionalAccess', _199 => _199.status]) === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { padding: 24, textAlign: "center", display: "flex", flexDirection: "column", alignItems: "center", gap: 12 }, children: [
7272
+ _optionalChain([currentResult, 'optionalAccess', _223 => _223.status]) === "error" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { padding: 24, textAlign: "center", display: "flex", flexDirection: "column", alignItems: "center", gap: 12 }, children: [
7107
7273
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 32, color: "#f87171" }, children: "warning" }),
7108
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { fontSize: 11, color: "rgba(255,255,255,0.5)", margin: 0 }, children: _optionalChain([currentResult, 'access', _200 => _200.error, 'optionalAccess', _201 => _201.message]) }),
7274
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { style: { fontSize: 11, color: "rgba(255,255,255,0.5)", margin: 0 }, children: _optionalChain([currentResult, 'access', _224 => _224.error, 'optionalAccess', _225 => _225.message]) }),
7109
7275
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => handleGenerateImage(currentResult.prompt), style: { padding: "8px 16px", borderRadius: 8, border: "1px solid rgba(255,255,255,0.2)", fontSize: 11, color: "rgba(255,255,255,0.7)", background: "none", cursor: "pointer", fontFamily: "inherit" }, children: "Erneut versuchen" })
7110
7276
  ] }),
7111
- _optionalChain([currentResult, 'optionalAccess', _202 => _202.status]) === "done" && currentResult.base64 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: currentResult.fullBase64 || currentResult.base64, style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } }),
7277
+ _optionalChain([currentResult, 'optionalAccess', _226 => _226.status]) === "done" && currentResult.base64 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: currentResult.fullBase64 || currentResult.base64, style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } }),
7112
7278
  !currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 8, opacity: 0.1 }, children: [
7113
7279
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 64 }, children: "palette" }),
7114
7280
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: { fontSize: 11, fontWeight: "bold", textTransform: "uppercase", letterSpacing: "0.2em" }, children: "Avatar Architect" })
7115
7281
  ] }),
7116
- _optionalChain([currentResult, 'optionalAccess', _203 => _203.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: openFullscreen, style: { position: "absolute", top: 8, right: 8, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: "fullscreen" }) }),
7282
+ _optionalChain([currentResult, 'optionalAccess', _227 => _227.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: openFullscreen, style: { position: "absolute", top: 8, right: 8, width: 32, height: 32, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 18 }, children: "fullscreen" }) }),
7117
7283
  history.length > 1 && currentResult && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
7118
7284
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToPrev, disabled: currentIndex <= 0, style: { position: "absolute", left: 8, top: "50%", transform: "translateY(-50%)", width: 36, height: 36, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff", opacity: currentIndex <= 0 ? 0 : 1, transition: "opacity 0.2s" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 20 }, children: "chevron_left" }) }),
7119
7285
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: goToNext, disabled: currentIndex >= history.length - 1, style: { position: "absolute", right: 8, top: "50%", transform: "translateY(-50%)", width: 36, height: 36, display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "1px solid rgba(255,255,255,0.1)", cursor: "pointer", color: "#fff", opacity: currentIndex >= history.length - 1 ? 0 : 1, transition: "opacity 0.2s" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 20 }, children: "chevron_right" }) }),
@@ -7126,7 +7292,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7126
7292
  ] })
7127
7293
  }
7128
7294
  ),
7129
- _optionalChain([currentResult, 'optionalAccess', _204 => _204.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { padding: "0 16px 16px", display: "flex", gap: 8, flexShrink: 0 }, children: [
7295
+ _optionalChain([currentResult, 'optionalAccess', _228 => _228.status]) === "done" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { padding: "0 16px 16px", display: "flex", gap: 8, flexShrink: 0 }, children: [
7130
7296
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { onClick: () => setActivePrompt(currentResult.prompt || ""), style: { flex: 1, height: 40, display: "flex", alignItems: "center", justifyContent: "center", gap: 6, borderRadius: 10, border: "1px solid rgba(255,255,255,0.1)", background: "rgba(255,255,255,0.05)", color: "rgba(255,255,255,0.6)", fontSize: 11, cursor: "pointer", fontFamily: "inherit" }, children: [
7131
7297
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", style: { fontSize: 16 }, children: "replay" }),
7132
7298
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Prompt" })
@@ -7248,7 +7414,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7248
7414
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Ref" })
7249
7415
  ] }),
7250
7416
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: () => setIsPromptCollapsed(!isPromptCollapsed), className: "text-white/40 hover:text-white transition-colors", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined", children: isPromptCollapsed ? "expand_more" : "expand_less" }) }),
7251
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _205 => _205.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
7417
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TaskExecutor, { openTasks: _optionalChain([hfState, 'optionalAccess', _229 => _229.openTasks]) || {}, onExecute: handleExecuteTask, onTaskCompleted: handleTaskCompleted }),
7252
7418
  runningBadge,
7253
7419
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PillButton, { variant: "solid", icon: "bolt", disabled: !activePrompt.trim(), onClick: () => handleGenerateBatch(), children: "Generieren" })
7254
7420
  ] })
@@ -7260,7 +7426,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7260
7426
  ] }) }),
7261
7427
  middlePanel === "szenen" ? szenenPane : middlePanel === "labs" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LabsTab, { services: labServices, onResult: (item) => {
7262
7428
  const frame = item.frames[0];
7263
- if (_optionalChain([frame, 'optionalAccess', _206 => _206.base64])) setCurrentResult(frameToGeneration(frame, item));
7429
+ if (_optionalChain([frame, 'optionalAccess', _230 => _230.base64])) setCurrentResult(frameToGeneration(frame, item));
7264
7430
  } }) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 overflow-hidden flex flex-col", children: [
7265
7431
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 p-6 overflow-hidden flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full w-full max-w-4xl aspect-square rounded-3xl border border-white/5 bg-black/40 relative overflow-hidden flex items-center justify-center group shadow-2xl", children: currentResult ? currentResult.status === "processing" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-4 opacity-40", children: [
7266
7432
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[40px]", children: "hourglass_top" }),
@@ -7269,7 +7435,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7269
7435
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-16 h-16 rounded-full bg-red-500/10 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-red-500 text-[32px]", children: "warning" }) }),
7270
7436
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
7271
7437
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-[11px] font-bold uppercase tracking-widest text-red-400", children: "Generierungsfehler" }),
7272
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/60 text-[12px] leading-relaxed", children: _optionalChain([currentResult, 'access', _207 => _207.error, 'optionalAccess', _208 => _208.message]) })
7438
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-white/60 text-[12px] leading-relaxed", children: _optionalChain([currentResult, 'access', _231 => _231.error, 'optionalAccess', _232 => _232.message]) })
7273
7439
  ] }),
7274
7440
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PillButton, { variant: "outline", icon: "refresh", onClick: () => handleGenerateImage(currentResult.prompt), children: "Erneut versuchen" })
7275
7441
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "h-full w-full relative flex items-center justify-center", children: [
@@ -7283,7 +7449,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7283
7449
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[100px]", children: "palette" }),
7284
7450
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[12px] font-bold uppercase tracking-[0.2em]", children: "Avatar Architect" })
7285
7451
  ] }) }) }),
7286
- _optionalChain([currentResult, 'optionalAccess', _209 => _209.status]) === "done" && currentGroup.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-6 pb-4 shrink-0 flex gap-2 overflow-x-auto", style: { scrollbarWidth: "none" }, children: currentGroup.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { position: "relative", flexShrink: 0 }, children: [
7452
+ _optionalChain([currentResult, 'optionalAccess', _233 => _233.status]) === "done" && currentGroup.length > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-6 pb-4 shrink-0 flex gap-2 overflow-x-auto", style: { scrollbarWidth: "none" }, children: currentGroup.map((item) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { style: { position: "relative", flexShrink: 0 }, children: [
7287
7453
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7288
7454
  "div",
7289
7455
  {
@@ -7364,14 +7530,14 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
7364
7530
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "material-symbols-outlined text-[40px] text-white/10 block mb-3", children: "label_off" }),
7365
7531
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-[11px] text-white/20", children: "Erst Workspace importieren um Tags zu verwalten." })
7366
7532
  ] }) }),
7367
- activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _210 => _210.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }),
7533
+ activeTab === "history" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryPanel, { history, currentResultId: _optionalChain([currentResult, 'optionalAccess', _234 => _234.id]) || null, onSelect: handleGallerySelect, onDelete: (id) => setHistory((h) => h.filter((x) => x.id !== id)), visibleCount: historyVisibleCount, onLoadMore: () => setHistoryVisibleCount((c) => c + 20) }),
7368
7534
  activeTab === "gallery" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7369
7535
  MediaLibrary,
7370
7536
  {
7371
7537
  items: galleryItems,
7372
7538
  onImport: async () => {
7373
7539
  const media = await onSelectMedia();
7374
- if (!_optionalChain([media, 'optionalAccess', _211 => _211.length])) return;
7540
+ if (!_optionalChain([media, 'optionalAccess', _235 => _235.length])) return;
7375
7541
  setGalleryItems((prev) => [...media.map((m) => ({ id: crypto.randomUUID(), nodeId: "1", base64: `data:${m.mimeType};base64,${m.base64}`, mediaId: m.mediaId, prompt: m.name || "Importiert", timestamp: Date.now(), status: "done", tags: [], type: "import" })), ...prev]);
7376
7542
  },
7377
7543
  onDelete: (id) => setGalleryItems((g) => g.filter((x) => x.id !== id)),
@@ -7527,7 +7693,7 @@ function createFaStore({ contracts, descriptors, persistence, workspaceId }) {
7527
7693
  };
7528
7694
  };
7529
7695
  const applyWriteResult = (sliceId, result, savedData, signal) => {
7530
- if (_optionalChain([signal, 'optionalAccess', _212 => _212.aborted])) {
7696
+ if (_optionalChain([signal, 'optionalAccess', _236 => _236.aborted])) {
7531
7697
  patchMeta(sliceId, { saveState: "idle" });
7532
7698
  return result;
7533
7699
  }
@@ -7555,8 +7721,8 @@ function createFaStore({ contracts, descriptors, persistence, workspaceId }) {
7555
7721
  const requestId = _nullishCoalesce(externalRequestId, () => ( nextRequestId()));
7556
7722
  patchMeta(sliceId, { loadRequestId: requestId, saveState: "restoring" });
7557
7723
  const result = await persistence.load(workspaceId, descriptor, _nullishCoalesce(signal, () => ( new AbortController().signal)));
7558
- if (_optionalChain([signal, 'optionalAccess', _213 => _213.aborted]) || _optionalChain([get, 'call', _214 => _214(), 'access', _215 => _215.meta, 'access', _216 => _216[sliceId], 'optionalAccess', _217 => _217.loadRequestId]) !== requestId) {
7559
- if (_optionalChain([signal, 'optionalAccess', _218 => _218.aborted]) && _optionalChain([get, 'call', _219 => _219(), 'access', _220 => _220.meta, 'access', _221 => _221[sliceId], 'optionalAccess', _222 => _222.loadRequestId]) === requestId) {
7724
+ if (_optionalChain([signal, 'optionalAccess', _237 => _237.aborted]) || _optionalChain([get, 'call', _238 => _238(), 'access', _239 => _239.meta, 'access', _240 => _240[sliceId], 'optionalAccess', _241 => _241.loadRequestId]) !== requestId) {
7725
+ if (_optionalChain([signal, 'optionalAccess', _242 => _242.aborted]) && _optionalChain([get, 'call', _243 => _243(), 'access', _244 => _244.meta, 'access', _245 => _245[sliceId], 'optionalAccess', _246 => _246.loadRequestId]) === requestId) {
7560
7726
  patchMeta(sliceId, { saveState: "idle", loadRequestId: null });
7561
7727
  }
7562
7728
  return result;
@@ -7591,7 +7757,7 @@ function createFaStore({ contracts, descriptors, persistence, workspaceId }) {
7591
7757
  },
7592
7758
  async resetSlice(sliceId, signal, options) {
7593
7759
  const contract = requireContract(sliceId);
7594
- if (get().meta[sliceId].dirty && !_optionalChain([options, 'optionalAccess', _223 => _223.confirmed])) {
7760
+ if (get().meta[sliceId].dirty && !_optionalChain([options, 'optionalAccess', _247 => _247.confirmed])) {
7595
7761
  throw new Error(`Reset for slice ${sliceId} requires confirmation while unsaved changes exist`);
7596
7762
  }
7597
7763
  const defaultData = contract.createDefault();
@@ -7644,7 +7810,7 @@ function createInMemoryWorkspacePersistence(now = () => Date.now()) {
7644
7810
  }
7645
7811
  const saved = {
7646
7812
  ...clone(slice),
7647
- revision: (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _224 => _224.revision]), () => ( 0))) + 1,
7813
+ revision: (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _248 => _248.revision]), () => ( 0))) + 1,
7648
7814
  updatedAt: now(),
7649
7815
  ...resetAt !== void 0 ? { resetAt } : {}
7650
7816
  };
@@ -7725,7 +7891,7 @@ function createPersistenceCoordinator({
7725
7891
  if (disposed) return;
7726
7892
  const runtime = runtimeOf(sliceId);
7727
7893
  const meta = store.getState().meta[sliceId];
7728
- if (!_optionalChain([meta, 'optionalAccess', _225 => _225.dirty])) return;
7894
+ if (!_optionalChain([meta, 'optionalAccess', _249 => _249.dirty])) return;
7729
7895
  if (meta.saveState === "restoring" || meta.saveState === "saving") {
7730
7896
  runtime.pendingSave = true;
7731
7897
  return;
@@ -7753,7 +7919,7 @@ function createPersistenceCoordinator({
7753
7919
  return {
7754
7920
  async load(sliceId) {
7755
7921
  const runtime = runtimeOf(sliceId);
7756
- _optionalChain([runtime, 'access', _226 => _226.loadController, 'optionalAccess', _227 => _227.abort, 'call', _228 => _228()]);
7922
+ _optionalChain([runtime, 'access', _250 => _250.loadController, 'optionalAccess', _251 => _251.abort, 'call', _252 => _252()]);
7757
7923
  runtime.loadController = new AbortController();
7758
7924
  const controller = runtime.loadController;
7759
7925
  try {
@@ -7781,8 +7947,8 @@ function createPersistenceCoordinator({
7781
7947
  disposed = true;
7782
7948
  for (const runtime of runtimes.values()) {
7783
7949
  clearTimer(runtime);
7784
- _optionalChain([runtime, 'access', _229 => _229.loadController, 'optionalAccess', _230 => _230.abort, 'call', _231 => _231()]);
7785
- _optionalChain([runtime, 'access', _232 => _232.saveController, 'optionalAccess', _233 => _233.abort, 'call', _234 => _234()]);
7950
+ _optionalChain([runtime, 'access', _253 => _253.loadController, 'optionalAccess', _254 => _254.abort, 'call', _255 => _255()]);
7951
+ _optionalChain([runtime, 'access', _256 => _256.saveController, 'optionalAccess', _257 => _257.abort, 'call', _258 => _258()]);
7786
7952
  runtime.pendingSave = false;
7787
7953
  }
7788
7954
  runtimes.clear();
@@ -7936,9 +8102,9 @@ function hatNavigationsziele(zugehoerigkeit) {
7936
8102
  var kennung = (wert) => typeof wert === "string" && wert.trim().length > 0;
7937
8103
  var kurz = (id) => id.slice(0, 8);
7938
8104
  function zugehoerigkeitOf(item) {
7939
- const runId = _optionalChain([item, 'optionalAccess', _235 => _235.szenen, 'optionalAccess', _236 => _236.prompt_run_id]);
8105
+ const runId = _optionalChain([item, 'optionalAccess', _259 => _259.szenen, 'optionalAccess', _260 => _260.prompt_run_id]);
7940
8106
  if (!kennung(runId)) return null;
7941
- const links = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _237 => _237.szenen_links]), () => ( null));
8107
+ const links = _nullishCoalesce(_optionalChain([item, 'optionalAccess', _261 => _261.szenen_links]), () => ( null));
7942
8108
  if (!links || links.prompt_run_id !== runId) {
7943
8109
  return {
7944
8110
  run: null,
@@ -7969,15 +8135,15 @@ function zugehoerigkeitOf(item) {
7969
8135
  return { run, scene, hinweis: null };
7970
8136
  }
7971
8137
  function zugehoerigkeitenOf(item) {
7972
- const szenen = _optionalChain([item, 'optionalAccess', _238 => _238.szenen]);
8138
+ const szenen = _optionalChain([item, 'optionalAccess', _262 => _262.szenen]);
7973
8139
  if (!szenen) return [];
7974
8140
  const laeufe = [];
7975
8141
  const merken = (id) => {
7976
8142
  if (kennung(id) && !laeufe.includes(id)) laeufe.push(id);
7977
8143
  };
7978
8144
  merken(szenen.prompt_run_id);
7979
- for (const run of _nullishCoalesce(szenen.runs, () => ( []))) merken(_optionalChain([run, 'optionalAccess', _239 => _239.prompt_run_id]));
7980
- const linkFuer = (runId) => _nullishCoalesce((_nullishCoalesce(_optionalChain([item, 'optionalAccess', _240 => _240.szenen_run_links]), () => ( []))).find((l) => l.prompt_run_id === runId), () => ( (_optionalChain([item, 'optionalAccess', _241 => _241.szenen_links]) && item.szenen_links.prompt_run_id === runId ? item.szenen_links : null)));
8145
+ for (const run of _nullishCoalesce(szenen.runs, () => ( []))) merken(_optionalChain([run, 'optionalAccess', _263 => _263.prompt_run_id]));
8146
+ const linkFuer = (runId) => _nullishCoalesce((_nullishCoalesce(_optionalChain([item, 'optionalAccess', _264 => _264.szenen_run_links]), () => ( []))).find((l) => l.prompt_run_id === runId), () => ( (_optionalChain([item, 'optionalAccess', _265 => _265.szenen_links]) && item.szenen_links.prompt_run_id === runId ? item.szenen_links : null)));
7981
8147
  const ergebnis = [];
7982
8148
  for (const runId of laeufe) {
7983
8149
  const z = zugehoerigkeitOf({ szenen: { prompt_run_id: runId }, szenen_links: linkFuer(runId) });
@@ -8252,4 +8418,8 @@ async function runTagsLegacyImport(options) {
8252
8418
 
8253
8419
 
8254
8420
 
8255
- exports.AvatarArchitectApp = AvatarArchitectApp; exports.CURRENT_TAG_EVENT_VERSION = CURRENT_TAG_EVENT_VERSION; exports.CollapsibleCard = CollapsibleCard; exports.CompactDropdown = CompactDropdown; exports.FaApp = FaApp; exports.FaToolsBadge = FaToolsBadge; exports.FlowBridgePanel = FlowBridgePanel; exports.FlowWorkspacePicker = FlowWorkspacePicker; exports.GLOBAL_STYLES = GLOBAL_STYLES; exports.HfMediaSyncTab = HfMediaSyncTab; exports.HistoryPanel = HistoryPanel; exports.InspectPanel = InspectPanel; exports.LIBRARY_CUTOVER_MARKER = LIBRARY_CUTOVER_MARKER; exports.LIBRARY_SLICE_SCHEMA_VERSION = LIBRARY_SLICE_SCHEMA_VERSION; exports.LIB_VERSION = version; exports.LabBlend = LabBlend; exports.LabCompare = LabCompare; exports.LabFrameExtractor = LabFrameExtractor; exports.LabImagePicker = LabImagePicker; exports.LabLoop = LabLoop; exports.LabRemix = LabRemix; exports.LabsTab = LabsTab; exports.LibraryView = LibraryView; exports.ListView = ListView; exports.MediaLibrary = MediaLibrary; exports.PillButton = PillButton; exports.PromptTab = PromptTab; exports.SCOPE_MAP = SCOPE_MAP; exports.SectionLabel = SectionLabel; exports.ServerTab = ServerTab; exports.SetupPanel = SetupPanel; exports.TAGS_CUTOVER_MARKER = TAGS_CUTOVER_MARKER; exports.TAGS_SLICE_SCHEMA_VERSION = TAGS_SLICE_SCHEMA_VERSION; exports.TagBaseSection = TagBaseSection; exports.TagManager = TagManager; exports.TagManagerPanel = TagManagerPanel; exports.ZugehoerigkeitLinks = ZugehoerigkeitLinks; exports.autoLabel = autoLabel; exports.buildBlendInstruction = buildBlendInstruction; exports.buildCompareInstruction = buildCompareInstruction; exports.buildFallbackPrompt = buildFallbackPrompt; exports.buildGenerationPrompt = buildGenerationPrompt; exports.buildImageGenerationOptions = buildImageGenerationOptions; exports.buildLoopInstruction = buildLoopInstruction; exports.buildPromptTabPayload = buildPromptTabPayload; exports.buildReferenceImageMediaIds = buildReferenceImageMediaIds; exports.buildRemixInstruction = buildRemixInstruction; exports.buildScanInstruction = buildScanInstruction; exports.cleanAiResponse = cleanAiResponse; exports.createFaStore = createFaStore; exports.createFlowBridgeClient = createFlowBridgeClient; exports.createFlowServices = createFlowServices; exports.createInMemoryLibraryDataSource = createInMemoryLibraryDataSource; exports.createInMemoryWorkspacePersistence = createInMemoryWorkspacePersistence; exports.createLibraryDefault = createLibraryDefault; exports.createPersistenceCoordinator = createPersistenceCoordinator; exports.createTagCreatedEvent = createTagCreatedEvent; exports.createTagUpdatedEvent = createTagUpdatedEvent; exports.createTagsDefault = createTagsDefault; exports.deriveTagBaseWorkspaceTags = deriveTagBaseWorkspaceTags; exports.deriveTagViewModel = deriveTagViewModel; exports.formatTreeToMarkdown = formatTreeToMarkdown; exports.frameToGeneration = frameToGeneration; exports.getFormattedTimestamp = getFormattedTimestamp; exports.getHFToken = _chunkVSHSZEGVjs.getHFToken; exports.getSessionClientId = _chunkVSHSZEGVjs.getSessionClientId; exports.groupGenerationsToLabItems = groupGenerationsToLabItems; exports.hatNavigationsziele = hatNavigationsziele; exports.hfBatchArchive = _chunkVSHSZEGVjs.hfBatchArchive; exports.hfBootstrapFromLegacy = _chunkVSHSZEGVjs.hfBootstrapFromLegacy; exports.hfListDir = _chunkVSHSZEGVjs.hfListDir; exports.hfLoadImageAsBase64 = _chunkVSHSZEGVjs.hfLoadImageAsBase64; exports.hfUploadImage = _chunkVSHSZEGVjs.hfUploadImage; exports.hfUploadSmallFile = _chunkVSHSZEGVjs.hfUploadSmallFile; exports.injectXMPMetadata = injectXMPMetadata; exports.interpretSdkError = interpretSdkError; exports.libraryContract = libraryContract; exports.libraryReactDescriptor = libraryReactDescriptor; exports.listCategories = listCategories; exports.loadHFState = _chunkVSHSZEGVjs.loadHFState; exports.loadPendingEvents = _chunkVSHSZEGVjs.loadPendingEvents; exports.loadTagBase = loadTagBase; exports.parseLegacyLibraryFilters = parseLegacyLibraryFilters; exports.parseLegacyRecentTags = parseLegacyRecentTags; exports.parsePromptFile = parsePromptFile; exports.parsePromptResponse = parsePromptResponse; exports.runLegacyMigration = runLegacyMigration; exports.runLibraryLegacyImport = runLibraryLegacyImport; exports.runTagsLegacyImport = runTagsLegacyImport; exports.setHFToken = _chunkVSHSZEGVjs.setHFToken; exports.tagsContract = tagsContract; exports.tagsReactDescriptor = tagsReactDescriptor; exports.tsFromEventPath = _chunkVSHSZEGVjs.tsFromEventPath; exports.useFaSlice = useFaSlice; exports.useFaSliceMeta = useFaSliceMeta; exports.useHFState = useHFState; exports.useKeyboardNavigation = useKeyboardNavigation; exports.useOnClickOutside = useOnClickOutside; exports.useTagBase = useTagBase; exports.validateTagBaseSelection = validateTagBaseSelection; exports.writeHFEvent = _chunkVSHSZEGVjs.writeHFEvent; exports.writeTagEvent = writeTagEvent; exports.zugehoerigkeitOf = zugehoerigkeitOf; exports.zugehoerigkeitenOf = zugehoerigkeitenOf;
8421
+
8422
+
8423
+
8424
+
8425
+ exports.AvatarArchitectApp = AvatarArchitectApp; exports.CURRENT_TAG_EVENT_VERSION = CURRENT_TAG_EVENT_VERSION; exports.CollapsibleCard = CollapsibleCard; exports.CompactDropdown = CompactDropdown; exports.FLOW_PROBE_MARKER = FLOW_PROBE_MARKER; exports.FLOW_PROBE_REQUEST = FLOW_PROBE_REQUEST; exports.FaApp = FaApp; exports.FaToolsBadge = FaToolsBadge; exports.FlowBridgePanel = FlowBridgePanel; exports.FlowWorkspacePicker = FlowWorkspacePicker; exports.GLOBAL_STYLES = GLOBAL_STYLES; exports.HfMediaSyncTab = HfMediaSyncTab; exports.HistoryPanel = HistoryPanel; exports.InspectPanel = InspectPanel; exports.LIBRARY_CUTOVER_MARKER = LIBRARY_CUTOVER_MARKER; exports.LIBRARY_SLICE_SCHEMA_VERSION = LIBRARY_SLICE_SCHEMA_VERSION; exports.LIB_VERSION = version; exports.LabBlend = LabBlend; exports.LabCompare = LabCompare; exports.LabFrameExtractor = LabFrameExtractor; exports.LabImagePicker = LabImagePicker; exports.LabLoop = LabLoop; exports.LabRemix = LabRemix; exports.LabsTab = LabsTab; exports.LibraryView = LibraryView; exports.ListView = ListView; exports.MediaLibrary = MediaLibrary; exports.PillButton = PillButton; exports.PromptTab = PromptTab; exports.SCOPE_MAP = SCOPE_MAP; exports.SectionLabel = SectionLabel; exports.ServerTab = ServerTab; exports.SetupPanel = SetupPanel; exports.TAGS_CUTOVER_MARKER = TAGS_CUTOVER_MARKER; exports.TAGS_SLICE_SCHEMA_VERSION = TAGS_SLICE_SCHEMA_VERSION; exports.TagBaseSection = TagBaseSection; exports.TagManager = TagManager; exports.TagManagerPanel = TagManagerPanel; exports.ZugehoerigkeitLinks = ZugehoerigkeitLinks; exports.autoLabel = autoLabel; exports.buildBlendInstruction = buildBlendInstruction; exports.buildCompareInstruction = buildCompareInstruction; exports.buildFallbackPrompt = buildFallbackPrompt; exports.buildGenerationPrompt = buildGenerationPrompt; exports.buildImageGenerationOptions = buildImageGenerationOptions; exports.buildLoopInstruction = buildLoopInstruction; exports.buildPromptTabPayload = buildPromptTabPayload; exports.buildReferenceImageMediaIds = buildReferenceImageMediaIds; exports.buildRemixInstruction = buildRemixInstruction; exports.buildScanInstruction = buildScanInstruction; exports.cleanAiResponse = cleanAiResponse; exports.createFaStore = createFaStore; exports.createFlowBridgeClient = createFlowBridgeClient; exports.createFlowServices = createFlowServices; exports.createInMemoryLibraryDataSource = createInMemoryLibraryDataSource; exports.createInMemoryWorkspacePersistence = createInMemoryWorkspacePersistence; exports.createLibraryDefault = createLibraryDefault; exports.createPersistenceCoordinator = createPersistenceCoordinator; exports.createTagCreatedEvent = createTagCreatedEvent; exports.createTagUpdatedEvent = createTagUpdatedEvent; exports.createTagsDefault = createTagsDefault; exports.deriveTagBaseWorkspaceTags = deriveTagBaseWorkspaceTags; exports.deriveTagViewModel = deriveTagViewModel; exports.executeFlowProbeBundle = executeFlowProbeBundle; exports.formatTreeToMarkdown = formatTreeToMarkdown; exports.frameToGeneration = frameToGeneration; exports.getFormattedTimestamp = getFormattedTimestamp; exports.getHFToken = _chunkVSHSZEGVjs.getHFToken; exports.getSessionClientId = _chunkVSHSZEGVjs.getSessionClientId; exports.groupGenerationsToLabItems = groupGenerationsToLabItems; exports.hatNavigationsziele = hatNavigationsziele; exports.hfBatchArchive = _chunkVSHSZEGVjs.hfBatchArchive; exports.hfBootstrapFromLegacy = _chunkVSHSZEGVjs.hfBootstrapFromLegacy; exports.hfListDir = _chunkVSHSZEGVjs.hfListDir; exports.hfLoadImageAsBase64 = _chunkVSHSZEGVjs.hfLoadImageAsBase64; exports.hfUploadImage = _chunkVSHSZEGVjs.hfUploadImage; exports.hfUploadSmallFile = _chunkVSHSZEGVjs.hfUploadSmallFile; exports.injectXMPMetadata = injectXMPMetadata; exports.interpretSdkError = interpretSdkError; exports.libraryContract = libraryContract; exports.libraryReactDescriptor = libraryReactDescriptor; exports.listCategories = listCategories; exports.loadHFState = _chunkVSHSZEGVjs.loadHFState; exports.loadPendingEvents = _chunkVSHSZEGVjs.loadPendingEvents; exports.loadTagBase = loadTagBase; exports.parseLegacyLibraryFilters = parseLegacyLibraryFilters; exports.parseLegacyRecentTags = parseLegacyRecentTags; exports.parsePromptFile = parsePromptFile; exports.parsePromptResponse = parsePromptResponse; exports.readFlowProbeBundle = readFlowProbeBundle; exports.runLegacyMigration = runLegacyMigration; exports.runLibraryLegacyImport = runLibraryLegacyImport; exports.runTagsLegacyImport = runTagsLegacyImport; exports.setHFToken = _chunkVSHSZEGVjs.setHFToken; exports.tagsContract = tagsContract; exports.tagsReactDescriptor = tagsReactDescriptor; exports.tsFromEventPath = _chunkVSHSZEGVjs.tsFromEventPath; exports.useFaSlice = useFaSlice; exports.useFaSliceMeta = useFaSliceMeta; exports.useHFState = useHFState; exports.useKeyboardNavigation = useKeyboardNavigation; exports.useOnClickOutside = useOnClickOutside; exports.useTagBase = useTagBase; exports.validateTagBaseSelection = validateTagBaseSelection; exports.writeHFEvent = _chunkVSHSZEGVjs.writeHFEvent; exports.writeTagEvent = writeTagEvent; exports.zugehoerigkeitOf = zugehoerigkeitOf; exports.zugehoerigkeitenOf = zugehoerigkeitenOf;