@bendyline/gezel-service 1.0.4 → 1.0.6
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/bin/gezeld.js +16929 -6105
- package/dist/handboek-content/conceptual/connected-apps.md +64 -2
- package/dist/handboek-content/conceptual/night-shift.md +22 -2
- package/dist/handboek-content/conceptual/welcome.md +2 -0
- package/dist/handboek-content/technical/where-files-live.md +3 -1
- package/dist/handboek-content/whats-new/1.26226.md +4 -7
- package/dist/handboek-content/whats-new/1.26230.md +100 -0
- package/dist/handboek.js +19 -9
- package/dist/index-store/static-index-worker.js +116 -27
- package/dist/index.d.ts +1165 -253
- package/dist/index.js +16922 -6098
- package/dist/providers/mlx/python/gezel_mlx_server.py +126 -11
- package/dist/ui/assets/{TerminalCodeEditor-BuMcfTS4.js → TerminalCodeEditor-BUHpk3pJ.js} +2 -2
- package/dist/ui/assets/{_.contribution-CZO2XAKt.js → _.contribution-B34uMeM2.js} +1 -1
- package/dist/ui/assets/{chunk-2JJ5RFDZ-Ckbzd10a.js → chunk-2JJ5RFDZ-B2-BFNXu.js} +1 -1
- package/dist/ui/assets/{chunk-BAOV476U-yPHu-ECL.js → chunk-BAOV476U-CEOFYt8X.js} +1 -1
- package/dist/ui/assets/{chunk-GAZKTT4R-BUf32614.js → chunk-GAZKTT4R-BkP6-w3z.js} +1 -1
- package/dist/ui/assets/{chunk-USU6HTKB-B-ElCUQS.js → chunk-USU6HTKB-htGRNErW.js} +1 -1
- package/dist/ui/assets/{cpp.contribution-BJzhk0Zj.js → cpp.contribution-CvG4GFxL.js} +1 -1
- package/dist/ui/assets/{csharp.contribution-BR9K2qKj.js → csharp.contribution-DekWAPj3.js} +1 -1
- package/dist/ui/assets/{css.contribution-CfkVmdah.js → css.contribution-CDuF4Xjo.js} +1 -1
- package/dist/ui/assets/{cssMode-MMeGUmV2.js → cssMode-D848zTHU.js} +1 -1
- package/dist/ui/assets/{csv-RAgECoUg.js → csv-PublMwG8.js} +1 -1
- package/dist/ui/assets/dist-CJRsJTdk.js +222 -0
- package/dist/ui/assets/dist-Cg3Ab49q.js +2 -0
- package/dist/ui/assets/{doc-B7NXSLxH.js → doc-Bq50ED-X.js} +41 -41
- package/dist/ui/assets/{dockerfile.contribution-IZMl57B5.js → dockerfile.contribution-ChT95Kbh.js} +1 -1
- package/dist/ui/assets/{docx-BEJpkI6I.js → docx-BSDeP5Eu.js} +1 -1
- package/dist/ui/assets/{epub-00L2M424.js → epub-D8zTSe9-.js} +1 -1
- package/dist/ui/assets/{go.contribution-BxCBwhZs.js → go.contribution-D_1myt_B.js} +1 -1
- package/dist/ui/assets/{handlebars-CreIkams.js → handlebars-Mxcy9PWv.js} +1 -1
- package/dist/ui/assets/{handlebars.contribution-BGlyL-dm.js → handlebars.contribution-DYF5z0XX.js} +2 -2
- package/dist/ui/assets/{html-BSrz1IKi.js → html-HXzM-WGZ.js} +1 -1
- package/dist/ui/assets/{html-Cgejr9YM.js → html-X72kRvXT.js} +1 -1
- package/dist/ui/assets/{html.contribution-CucOMFQ_.js → html.contribution-C0xFTPDL.js} +2 -2
- package/dist/ui/assets/{htmlMode-DRG7XY5Z.js → htmlMode-BVtBWJQM.js} +1 -1
- package/dist/ui/assets/{index-Bqu-32S3.js → index-DUf4wIj5.js} +207 -200
- package/dist/ui/assets/index-udlcniNf.css +1 -0
- package/dist/ui/assets/{infer-D6e75m-s.js → infer-Be4Xn3O1.js} +1 -1
- package/dist/ui/assets/{ini.contribution-CGX5OdXM.js → ini.contribution-BqUQ8Oa0.js} +1 -1
- package/dist/ui/assets/{java.contribution-CVhfJ_us.js → java.contribution-u4QvI2UZ.js} +1 -1
- package/dist/ui/assets/{javascript-QelFp9t5.js → javascript-BVm8fvMk.js} +1 -1
- package/dist/ui/assets/javascript.contribution-BtlENuoy.js +2 -0
- package/dist/ui/assets/{jsonMode-T4Ss3lDu.js → jsonMode-DcoSB4Jg.js} +1 -1
- package/dist/ui/assets/{kotlin.contribution-DxFbGDYA.js → kotlin.contribution-D1ZfW5lW.js} +1 -1
- package/dist/ui/assets/{less.contribution-g9R8XRZf.js → less.contribution-BBWek5Gc.js} +1 -1
- package/dist/ui/assets/{lua.contribution-YqDsEy8Z.js → lua.contribution-DJEpMduq.js} +1 -1
- package/dist/ui/assets/mapTheme-4TWH25FT-C2uLgUhs.js +1 -0
- package/dist/ui/assets/{markdown.contribution-DboXnPnx.js → markdown.contribution-CsVCTE0K.js} +1 -1
- package/dist/ui/assets/{monaco-BdFw56DI.js → monaco-DcZAEsIZ.js} +3 -3
- package/dist/ui/assets/{monaco-base-DrP3D13F.js → monaco-base-C-UMfHa9.js} +1 -1
- package/dist/ui/assets/{monaco-setup-QyF22y9h.js → monaco-setup-Dy_kv6Gv.js} +1 -1
- package/dist/ui/assets/{monaco.contribution-FA_ESP-W.js → monaco.contribution-BpJqoa65.js} +2 -2
- package/dist/ui/assets/{monaco.contribution-XEpc63ty.js → monaco.contribution-BujOhotZ.js} +2 -2
- package/dist/ui/assets/{monaco.contribution-BkqIxESv.js → monaco.contribution-DW4-UIJp.js} +2 -2
- package/dist/ui/assets/{monaco.contribution-CMzPFHtO.js → monaco.contribution-ypbCAEx4.js} +2 -2
- package/dist/ui/assets/{pdf-66KslaXf.js → pdf-BZeBurJI.js} +1 -1
- package/dist/ui/assets/{php.contribution-rnpik0Kk.js → php.contribution-B6Atm_xI.js} +1 -1
- package/dist/ui/assets/{pptx-DZdEoDP9.js → pptx-BbAcnlML.js} +4 -4
- package/dist/ui/assets/{python-CF7X5t9Q.js → python-CCiWacbd.js} +1 -1
- package/dist/ui/assets/{python.contribution-CyJGCfSq.js → python.contribution-3CThbaoI.js} +2 -2
- package/dist/ui/assets/{ruby.contribution-4ZyPGu2E.js → ruby.contribution-D3g6EADN.js} +1 -1
- package/dist/ui/assets/{rust.contribution-Cl_B3X2G.js → rust.contribution-CSdjIX0R.js} +1 -1
- package/dist/ui/assets/{schemas-Drh23Boe.js → schemas-JY4jmLbC.js} +1 -1
- package/dist/ui/assets/{scss.contribution-BO02gVLZ.js → scss.contribution-mQ_vuYxE.js} +1 -1
- package/dist/ui/assets/{shell.contribution-Dn9Y0uHs.js → shell.contribution-BLQSLx3H.js} +1 -1
- package/dist/ui/assets/{sql.contribution-Bog_5Rc8.js → sql.contribution-GScL7Mrt.js} +1 -1
- package/dist/ui/assets/{swift.contribution-CfiAr7AX.js → swift.contribution-DG__yqNr.js} +1 -1
- package/dist/ui/assets/{terminal-monaco-setup-B-EnkGiy.js → terminal-monaco-setup-x6piH1Un.js} +1 -1
- package/dist/ui/assets/{transform-MBfVXq54.js → transform-ywncQECB.js} +1 -1
- package/dist/ui/assets/{tsMode-B2WuLuPL.js → tsMode-B5nM5MR7.js} +1 -1
- package/dist/ui/assets/{typescript-Bv_J1tKT.js → typescript-xiOVha1M.js} +1 -1
- package/dist/ui/assets/{typescript.contribution-CM0XQCYi.js → typescript.contribution-BU2V4Vz8.js} +2 -2
- package/dist/ui/assets/worker-BzdDEeh7.js +1 -0
- package/dist/ui/assets/{xlsx-DDBRN-IU.js → xlsx-f9AYHB2W.js} +1 -1
- package/dist/ui/assets/{xml-DMV-f4tm.js → xml-m3MSnvuD.js} +1 -1
- package/dist/ui/assets/{xml.contribution-QqmOB9gT.js → xml.contribution-bOoaS55N.js} +2 -2
- package/dist/ui/assets/{yaml-Bb6mZXY5.js → yaml-DOtMVgbb.js} +1 -1
- package/dist/ui/assets/{yaml.contribution-DCDnWhHR.js → yaml.contribution-CNCYEtwk.js} +2 -2
- package/dist/ui/index.html +14 -14
- package/package.json +13 -12
- package/dist/ui/assets/dist-8uH4DcHx.js +0 -2
- package/dist/ui/assets/dist-CFOmf7nD.js +0 -222
- package/dist/ui/assets/index-DTicLc4o.css +0 -1
- package/dist/ui/assets/javascript.contribution--no0ijCu.js +0 -2
- package/dist/ui/assets/mapTheme-4TWH25FT-B5nAKRmb.js +0 -1
|
@@ -268,6 +268,45 @@ parser.add_argument(
|
|
|
268
268
|
"limit alone."
|
|
269
269
|
),
|
|
270
270
|
)
|
|
271
|
+
parser.add_argument(
|
|
272
|
+
"--kv-bits",
|
|
273
|
+
type=int,
|
|
274
|
+
default=0,
|
|
275
|
+
help=(
|
|
276
|
+
"Quantize the KV cache to this many bits. 0 (default) = f16. Halves "
|
|
277
|
+
"(8-bit) or quarters (4-bit) the largest term in a long-context "
|
|
278
|
+
"session: a 256K window on a 16-full-attention-layer 27B is 16 GiB of "
|
|
279
|
+
"f16 KV. Applies to the SERIAL generation path only — mlx-lm's "
|
|
280
|
+
"BatchGenerator builds BatchKVCache layers, which have no "
|
|
281
|
+
"`to_quantized`, and `maybe_quantize_kv_cache` skips them silently. "
|
|
282
|
+
"The launcher therefore plans memory at f16 whenever batching is on, "
|
|
283
|
+
"so the broker never reserves a discount the engine did not take."
|
|
284
|
+
),
|
|
285
|
+
)
|
|
286
|
+
parser.add_argument(
|
|
287
|
+
"--kv-group-size",
|
|
288
|
+
type=int,
|
|
289
|
+
default=64,
|
|
290
|
+
help="Group size for KV quantization. mlx-lm's default is 64.",
|
|
291
|
+
)
|
|
292
|
+
parser.add_argument(
|
|
293
|
+
"--kv-quant-scheme",
|
|
294
|
+
default="uniform",
|
|
295
|
+
help=(
|
|
296
|
+
"Quantization scheme passed to mlx-vlm. 'uniform' is right for integer "
|
|
297
|
+
"bit values; mlx-vlm selects TurboQuant for fractional ones."
|
|
298
|
+
),
|
|
299
|
+
)
|
|
300
|
+
parser.add_argument(
|
|
301
|
+
"--quantized-kv-start",
|
|
302
|
+
type=int,
|
|
303
|
+
default=0,
|
|
304
|
+
help=(
|
|
305
|
+
"Only quantize a layer once its cache passes this many tokens. Leaves "
|
|
306
|
+
"short turns on the f16 path, where quantization costs more than the "
|
|
307
|
+
"memory it saves."
|
|
308
|
+
),
|
|
309
|
+
)
|
|
271
310
|
ARGS = parser.parse_args()
|
|
272
311
|
|
|
273
312
|
|
|
@@ -695,6 +734,28 @@ def _get_generation_lock() -> asyncio.Lock:
|
|
|
695
734
|
return _GENERATION_LOCK
|
|
696
735
|
|
|
697
736
|
|
|
737
|
+
def _kv_quant_kwargs() -> Dict[str, Any]:
|
|
738
|
+
"""KV-quantization options for the serial `stream_generate` path.
|
|
739
|
+
|
|
740
|
+
Forwarded through `stream_generate(**kwargs)` into mlx-vlm's
|
|
741
|
+
`generate_step`, which converts each layer via `to_quantized` once it
|
|
742
|
+
passes `quantized_kv_start`. Layer classes without that method
|
|
743
|
+
(BatchKVCache, ChunkedKVCache) are skipped by `maybe_quantize_kv_cache`
|
|
744
|
+
rather than raising — safe, but silent, which is why the launcher plans
|
|
745
|
+
f16 whenever the batched path is in use instead of trusting this flag.
|
|
746
|
+
|
|
747
|
+
Empty when disabled, so the default path is byte-identical to before.
|
|
748
|
+
"""
|
|
749
|
+
if ARGS.kv_bits <= 0:
|
|
750
|
+
return {}
|
|
751
|
+
return {
|
|
752
|
+
"kv_bits": ARGS.kv_bits,
|
|
753
|
+
"kv_group_size": ARGS.kv_group_size,
|
|
754
|
+
"kv_quant_scheme": ARGS.kv_quant_scheme,
|
|
755
|
+
"quantized_kv_start": ARGS.quantized_kv_start,
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
|
|
698
759
|
def _budget_bytes() -> int:
|
|
699
760
|
return ARGS.cache_budget_mb * 1024 * 1024
|
|
700
761
|
|
|
@@ -997,7 +1058,8 @@ class _Sub:
|
|
|
997
1058
|
"http_request", "uid", "queue", "cancelled", "token_ids", "emitted",
|
|
998
1059
|
"pinned_cache_ids", "prefill_total", "first_token_seen",
|
|
999
1060
|
"reused_tokens", "seed_mode", "prompt_snapshot", "snapshot_target",
|
|
1000
|
-
"saved_cache_state",
|
|
1061
|
+
"saved_cache_state", "prefill_started_at", "generation_started_at",
|
|
1062
|
+
"prompt_tps", "generation_tps",
|
|
1001
1063
|
)
|
|
1002
1064
|
|
|
1003
1065
|
def __init__(
|
|
@@ -1039,6 +1101,15 @@ class _Sub:
|
|
|
1039
1101
|
# reference for immediate persistence even if the memory-budget pass
|
|
1040
1102
|
# evicts the just-built entry from the global LRU.
|
|
1041
1103
|
self.saved_cache_state = None
|
|
1104
|
+
# BatchGenerator does not expose per-sequence timing. Track wall-clock
|
|
1105
|
+
# timing per subscription so the OpenAI-compatible usage frames retain
|
|
1106
|
+
# the same prompt/decode speed fields as the serial stream_generate
|
|
1107
|
+
# path. Values are snapshotted into queue items because the worker can
|
|
1108
|
+
# advance again before the SSE coroutine consumes them.
|
|
1109
|
+
self.prefill_started_at = None
|
|
1110
|
+
self.generation_started_at = None
|
|
1111
|
+
self.prompt_tps = 0.0
|
|
1112
|
+
self.generation_tps = 0.0
|
|
1042
1113
|
|
|
1043
1114
|
|
|
1044
1115
|
class BatchEngine:
|
|
@@ -1151,7 +1222,11 @@ class BatchEngine:
|
|
|
1151
1222
|
if grammar is not None:
|
|
1152
1223
|
# Accepts a single processor or a list (grammar + think-budget).
|
|
1153
1224
|
procs = list(procs) + (grammar if isinstance(grammar, list) else [grammar])
|
|
1154
|
-
|
|
1225
|
+
# BatchGenerator receives one processor list per sequence. A mixed
|
|
1226
|
+
# wave (for example cache warm + pi tool call) must use [] for the
|
|
1227
|
+
# unconstrained sequence: mlx_lm iterates every per-sequence entry and
|
|
1228
|
+
# crashes on None with "'NoneType' object is not iterable".
|
|
1229
|
+
return list(procs or [])
|
|
1155
1230
|
|
|
1156
1231
|
def _seed_args(self, sub):
|
|
1157
1232
|
"""Plan cache reuse for this sub: longest-common-prefix with
|
|
@@ -1321,6 +1396,7 @@ class BatchEngine:
|
|
|
1321
1396
|
continue
|
|
1322
1397
|
for uid, sub in zip(uids, batch):
|
|
1323
1398
|
sub.uid = uid
|
|
1399
|
+
sub.prefill_started_at = time.perf_counter()
|
|
1324
1400
|
self._subs[uid] = sub
|
|
1325
1401
|
# Arm prefill-liveness for the wave: total new tokens to
|
|
1326
1402
|
# prefill across its subs (authoritative — from the seed
|
|
@@ -1346,6 +1422,7 @@ class BatchEngine:
|
|
|
1346
1422
|
self._emit_prefill_liveness()
|
|
1347
1423
|
try:
|
|
1348
1424
|
prompt_responses, responses = self._gen.next()
|
|
1425
|
+
step_ended_at = time.perf_counter()
|
|
1349
1426
|
except Exception as exc: # noqa: BLE001
|
|
1350
1427
|
print(f"[batch] step failed: {exc}", flush=True)
|
|
1351
1428
|
traceback.print_exc()
|
|
@@ -1391,8 +1468,27 @@ class BatchEngine:
|
|
|
1391
1468
|
sub = self._subs.get(r.uid)
|
|
1392
1469
|
if sub is None:
|
|
1393
1470
|
continue
|
|
1471
|
+
if sub.generation_started_at is None:
|
|
1472
|
+
# The step that yields the first token is the closest
|
|
1473
|
+
# boundary BatchGenerator exposes between prefill and
|
|
1474
|
+
# decode. Count it with prefill/TTFT, then measure decode
|
|
1475
|
+
# from the inter-token intervals that follow; otherwise
|
|
1476
|
+
# a short prompt can produce a near-zero denominator and
|
|
1477
|
+
# a wildly inflated first-token rate.
|
|
1478
|
+
sub.generation_started_at = step_ended_at
|
|
1479
|
+
prefill_started_at = sub.prefill_started_at or step_ended_at
|
|
1480
|
+
prefill_seconds = max(
|
|
1481
|
+
step_ended_at - prefill_started_at,
|
|
1482
|
+
1e-9,
|
|
1483
|
+
)
|
|
1484
|
+
if sub.prefill_total > 0:
|
|
1485
|
+
sub.prompt_tps = sub.prefill_total / prefill_seconds
|
|
1394
1486
|
sub.first_token_seen = True
|
|
1395
1487
|
sub.token_ids.append(int(r.token))
|
|
1488
|
+
generated_intervals = len(sub.token_ids) - 1
|
|
1489
|
+
generation_seconds = step_ended_at - sub.generation_started_at
|
|
1490
|
+
if generated_intervals > 0 and generation_seconds > 0:
|
|
1491
|
+
sub.generation_tps = generated_intervals / generation_seconds
|
|
1396
1492
|
self._emit_delta(sub)
|
|
1397
1493
|
if r.finish_reason is not None:
|
|
1398
1494
|
self._finish(sub, r)
|
|
@@ -1459,12 +1555,28 @@ class BatchEngine:
|
|
|
1459
1555
|
if not delta:
|
|
1460
1556
|
return
|
|
1461
1557
|
sub.emitted = len(full)
|
|
1462
|
-
sub.queue.put_nowait(
|
|
1558
|
+
sub.queue.put_nowait(
|
|
1559
|
+
(
|
|
1560
|
+
"tok",
|
|
1561
|
+
delta,
|
|
1562
|
+
len(sub.token_ids),
|
|
1563
|
+
sub.prompt_tps,
|
|
1564
|
+
sub.generation_tps,
|
|
1565
|
+
)
|
|
1566
|
+
)
|
|
1463
1567
|
|
|
1464
1568
|
def _finish(self, sub, r):
|
|
1465
1569
|
full = _scrub_leaked_markers(self._tok.decode(sub.token_ids))
|
|
1466
1570
|
if len(full) > sub.emitted:
|
|
1467
|
-
sub.queue.put_nowait(
|
|
1571
|
+
sub.queue.put_nowait(
|
|
1572
|
+
(
|
|
1573
|
+
"tok",
|
|
1574
|
+
full[sub.emitted :],
|
|
1575
|
+
len(sub.token_ids),
|
|
1576
|
+
sub.prompt_tps,
|
|
1577
|
+
sub.generation_tps,
|
|
1578
|
+
)
|
|
1579
|
+
)
|
|
1468
1580
|
sub.emitted = len(full)
|
|
1469
1581
|
try:
|
|
1470
1582
|
if sub.request.cache_id:
|
|
@@ -1535,7 +1647,9 @@ class BatchEngine:
|
|
|
1535
1647
|
)
|
|
1536
1648
|
except Exception as exc: # noqa: BLE001
|
|
1537
1649
|
print(f"[batch] cache save failed: {exc}", flush=True)
|
|
1538
|
-
sub.queue.put_nowait(
|
|
1650
|
+
sub.queue.put_nowait(
|
|
1651
|
+
("done", r.finish_reason, sub.prompt_tps, sub.generation_tps)
|
|
1652
|
+
)
|
|
1539
1653
|
|
|
1540
1654
|
|
|
1541
1655
|
async def _batched_stream_iter(sub: "_Sub"):
|
|
@@ -1549,7 +1663,7 @@ async def _batched_stream_iter(sub: "_Sub"):
|
|
|
1549
1663
|
item = await sub.queue.get()
|
|
1550
1664
|
kind = item[0]
|
|
1551
1665
|
if kind == "tok":
|
|
1552
|
-
_, delta, out_count = item
|
|
1666
|
+
_, delta, out_count, prompt_tps, generation_tps = item
|
|
1553
1667
|
if await sub.http_request.is_disconnected():
|
|
1554
1668
|
sub.cancelled = True
|
|
1555
1669
|
return
|
|
@@ -1570,8 +1684,8 @@ async def _batched_stream_iter(sub: "_Sub"):
|
|
|
1570
1684
|
"input_tokens": in_toks,
|
|
1571
1685
|
"output_tokens": out_count,
|
|
1572
1686
|
"total_tokens": in_toks + out_count,
|
|
1573
|
-
"prompt_tps":
|
|
1574
|
-
"generation_tps":
|
|
1687
|
+
"prompt_tps": prompt_tps,
|
|
1688
|
+
"generation_tps": generation_tps,
|
|
1575
1689
|
# Cache tokens actually served per the seed
|
|
1576
1690
|
# plan — parity with the serial path so the
|
|
1577
1691
|
# TS session's cachedInputTokens works on
|
|
@@ -1581,7 +1695,7 @@ async def _batched_stream_iter(sub: "_Sub"):
|
|
|
1581
1695
|
}
|
|
1582
1696
|
) + "\n\n"
|
|
1583
1697
|
elif kind == "done":
|
|
1584
|
-
reason = item
|
|
1698
|
+
_, reason, prompt_tps, generation_tps = item
|
|
1585
1699
|
yield "data: " + json.dumps(
|
|
1586
1700
|
{
|
|
1587
1701
|
"id": rid,
|
|
@@ -1599,8 +1713,8 @@ async def _batched_stream_iter(sub: "_Sub"):
|
|
|
1599
1713
|
"input_tokens": in_toks,
|
|
1600
1714
|
"output_tokens": len(sub.token_ids),
|
|
1601
1715
|
"total_tokens": in_toks + len(sub.token_ids),
|
|
1602
|
-
"prompt_tps":
|
|
1603
|
-
"generation_tps":
|
|
1716
|
+
"prompt_tps": prompt_tps,
|
|
1717
|
+
"generation_tps": generation_tps,
|
|
1604
1718
|
"cached_tokens": sub.reused_tokens,
|
|
1605
1719
|
},
|
|
1606
1720
|
}
|
|
@@ -2395,6 +2509,7 @@ async def chat_completions(request: ChatRequest, http_request: Request):
|
|
|
2395
2509
|
generation_kwargs: Dict[str, Any] = {
|
|
2396
2510
|
"prompt_cache_state": cache_state,
|
|
2397
2511
|
"prefill_step_size": ARGS.prefill_step_size,
|
|
2512
|
+
**_kv_quant_kwargs(),
|
|
2398
2513
|
}
|
|
2399
2514
|
if request.max_tokens is not None:
|
|
2400
2515
|
generation_kwargs["max_tokens"] = request.max_tokens
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-monaco-setup-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./preload-helper-Czpn1I53.js";import{c as n,l as r,o as i}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/terminal-monaco-setup-x6piH1Un.js","assets/index-DUf4wIj5.js","assets/rolldown-runtime-aKtaBQYM.js","assets/dist-CJRsJTdk.js","assets/dist-Cg3Ab49q.js","assets/doc-Bq50ED-X.js","assets/chunk-O7JILDEF-CqcO1qaI.js","assets/chunk-BAOV476U-CEOFYt8X.js","assets/chunk-4VOD55SX-BFSSw0c8.js","assets/chunk-GAZKTT4R-BkP6-w3z.js","assets/chunk-6MVWWZHL-BtFOxGE8.js","assets/chunk-XRW6P7IF-BeQQgMVK.js","assets/markdown-ekej7NJt.js","assets/schemas-JY4jmLbC.js","assets/preload-helper-Czpn1I53.js","assets/pptx-BbAcnlML.js","assets/chunk-USU6HTKB-htGRNErW.js","assets/chunk-7AWFHP5U-MiVVPFTx.js","assets/jszip.min-DhiFe-R7.js","assets/chunk-JU2RHXUB-CMFDhTux.js","assets/chunk-DWNNYO5H-C9-5Gy65.js","assets/chunk-S5PCVMKU-i2wfHmvU.js","assets/chunk-ILCJ3WFD-CUnKgI_I.js","assets/chunk-IIQYS2YH-CPXng8SW.js","assets/storage-DUIC1aL6.js","assets/chunk-AONELFLA-Cv2nS9ga.js","assets/chunk-6RQOV3B3-CwvKotJw.js","assets/chunk-6N2J7C2B-BNHR_rFP.js","assets/transform-ywncQECB.js","assets/container-CKiqsJHV.js","assets/docx-BSDeP5Eu.js","assets/html-X72kRvXT.js","assets/pdf-BZeBurJI.js","assets/chunk-KXOZMWBS-BwD4KMLI.js","assets/index-udlcniNf.css","assets/monaco-DcZAEsIZ.js","assets/iconLabel-uMn49Ame.js","assets/iconLabel-Bdh_-Hrb.css","assets/codiconStyles-104B1IQ5.js","assets/codiconStyles-Bp1tMeMk.css","assets/monaco-BBUd89IN.css","assets/monaco-base-C-UMfHa9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{t}from"./preload-helper-Czpn1I53.js";import{c as n,l as r,o as i}from"./index-DUf4wIj5.js";var a=e(r(),1),o=n();function s(e,t){let n=t.getLineCount(),r={lineNumber:n,column:t.getLineMaxColumn(n)};e.setPosition(r),e.revealPosition(r)}var c=(0,a.forwardRef)(function({projectId:e,initialValue:n,placeholder:r,className:c,onChange:l,onSubmit:u,onHistoryPrev:d,onHistoryNext:f,onChatEscape:p,onReady:m},h){let g=(0,a.useRef)(null),_=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),[,b]=(0,a.useState)(!1),x=i(),S=(0,a.useRef)(l),C=(0,a.useRef)(u),w=(0,a.useRef)(d),T=(0,a.useRef)(f),E=(0,a.useRef)(p),D=(0,a.useRef)(m);(0,a.useEffect)(()=>{S.current=l,C.current=u,w.current=d,T.current=f,E.current=p,D.current=m});let O=(0,a.useRef)(n),k=(0,a.useRef)(r),A=(0,a.useRef)(n.length),j=(0,a.useRef)(x);return j.current=x,(0,a.useEffect)(()=>{let n=!1,r=[];return(async()=>{let i;try{i=await t(()=>import(`./terminal-monaco-setup-x6piH1Un.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41])),await i.ensureTerminalMonaco()}catch{return}if(n||!g.current)return;let a=i.monaco;_.current=a;let o=i.terminalModelUri(e);a.editor.getModel(o)?.dispose();let c=a.editor.createModel(O.current,`gezel-terminal`,o);y.current=c;let l=a.editor.create(g.current,{model:c,automaticLayout:!0,lineNumbers:`off`,glyphMargin:!1,folding:!1,minimap:{enabled:!1},lineDecorationsWidth:0,lineNumbersMinChars:0,renderLineHighlight:`none`,scrollBeyondLastLine:!1,overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{vertical:`auto`,horizontal:`hidden`,verticalScrollbarSize:6,useShadows:!1},wordWrap:`on`,fontSize:13.6,fontFamily:`var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)`,lineHeight:21,padding:{top:6,bottom:6},fixedOverflowWidgets:!0,quickSuggestions:{other:!0,comments:!1,strings:!0},suggestOnTriggerCharacters:!0,acceptSuggestionOnEnter:`off`,tabCompletion:`on`,contextmenu:!1,roundedSelection:!1,guides:{indentation:!1},renderWhitespace:`none`,occurrencesHighlight:`off`,matchBrackets:`never`});v.current=l,a.editor.setTheme(j.current===`dark`?`gezel-terminal-dark`:`gezel-terminal-light`),l.addCommand(a.KeyCode.Enter,()=>C.current(c.getValue())),l.addCommand(a.KeyMod.Shift|a.KeyCode.Enter,()=>l.trigger(`keyboard`,`type`,{text:`
|
|
3
3
|
`}));let u=l.createContextKey(`terminalAtFirstLine`,!0),d=l.createContextKey(`terminalAtLastLine`,!0),f=()=>{let e=l.getPosition();u.set(!e||e.lineNumber===1),d.set(!e||e.lineNumber===c.getLineCount())};f(),r.push(l.onDidChangeCursorPosition(f)),r.push(c.onDidChangeContent(f)),l.addCommand(a.KeyCode.UpArrow,()=>w.current(),`terminalAtFirstLine && !suggestWidgetVisible`),l.addCommand(a.KeyCode.DownArrow,()=>T.current(),`terminalAtLastLine && !suggestWidgetVisible`),r.push(c.onDidChangeContent(()=>{let e=c.getValue(),t=A.current;if(A.current=e.length,E.current&&t<=1&&e.startsWith(`@`)){E.current();return}S.current?.(e)}));let p=k.current;if(p){let e=document.createElement(`div`);e.className=`terminal-editor-placeholder`,e.textContent=p;let t={getId:()=>`gezel.terminal.placeholder`,getDomNode:()=>e,getPosition:()=>({position:{lineNumber:1,column:1},preference:[a.editor.ContentWidgetPositionPreference.EXACT]})},n=!1,i=()=>{let e=c.getValue()===``;e&&!n?(l.addContentWidget(t),n=!0):!e&&n&&(l.removeContentWidget(t),n=!1)};i(),r.push(c.onDidChangeContent(i)),r.push({dispose:()=>{n&&l.removeContentWidget(t)}})}l.focus(),s(l,c),b(!0),D.current?.()})(),()=>{n=!0;for(let e of r)e.dispose();v.current?.dispose(),v.current=null,y.current?.dispose(),y.current=null}},[e]),(0,a.useEffect)(()=>{_.current?.editor.setTheme(x===`dark`?`gezel-terminal-dark`:`gezel-terminal-light`)},[x]),(0,a.useImperativeHandle)(h,()=>({getValue:()=>y.current?.getValue()??``,setValue:e=>{let t=y.current,n=v.current;t&&(t.setValue(e),A.current=e.length,n&&s(n,t))},focus:()=>v.current?.focus()}),[]),(0,o.jsx)(`div`,{ref:g,className:c??`terminal-editor-host`,"data-testid":`terminal-editor`})});export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./monaco-
|
|
1
|
+
import{s as e}from"./monaco-DcZAEsIZ.js";var t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=(e,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of r(a))!i.call(e,c)&&c!==o&&t(e,c,{get:()=>a[c],enumerable:!(s=n(a,c))||s.enumerable});return e},o=(e,t,n)=>(a(e,t,`default`),n&&a(n,t,`default`)),s={};o(s,e);var c={},l={},u=class e{static getOrCreate(t){return l[t]||(l[t]=new e(t)),l[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,c[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function d(e){let t=e.id;c[t]=e,s.languages.register(e);let n=u.getOrCreate(t);s.languages.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),s.languages.onLanguageEncountered(t,async()=>{let e=await n.load();s.languages.setLanguageConfiguration(t,e.conf)})}export{d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,S as t,m as n,x as r}from"./chunk-GAZKTT4R-
|
|
1
|
+
import{D as e,S as t,m as n,x as r}from"./chunk-GAZKTT4R-BkP6-w3z.js";import{r as i,t as a}from"./schemas-JY4jmLbC.js";var o=`#3182ce`,s=1.3,c=[`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`],l={lt1:`lt2`,dk1:`dk2`,lt2:`lt1`,dk2:`dk1`};function u(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`imported`}function d(i,d={}){let f=[],{colors:p,colorMap:m,fonts:h}=i,g=d.nameHint?.trim()||i.themeName||`Imported Theme`,_={id:`custom-${u(g)}`,name:g,description:`Imported from a ${i.sourceFormat} file${i.themeName?` (theme "${i.themeName}")`:``}.`};if(p){let t=p.accent1??p.accent2;t||f.push(`theme: no usable accent colors; primary defaults to Squisq blue`);let i=p[m.bg1],u=p[m.tx1];i&&u&&Math.abs(e(i)-e(u))<.2&&(f.push(`theme: background and text colors are too close; deriving surfaces instead`),i=void 0,u=void 0),_.seedColors={primary:t??o,...p.accent2?{secondary:p.accent2}:{},...p.accent3?{accent:p.accent3}:{},...i?{background:i}:{},...u?{text:u}:{}};let d={},h=i?p[l[m.bg1]]:void 0;i&&h&&h!==i&&(d.backgroundLight=h),p.hlink&&r(p.hlink)&&(d.highlight=p.hlink),Object.keys(d).length>0&&(_.colors=d);let g={},v=new Set,y=i??p[m.bg1];for(let e of c){let t=p[e];if(!(!t||v.has(t))){if(y&&n(t,y)<s){f.push(`theme: ${e} is too close to the background; dropped from accents`);continue}v.add(t),g[e]=a(t)}}Object.keys(g).length>0&&(_.colorSchemes=g)}return(h?.majorLatin||h?.minorLatin)&&(_.typography={...h.majorLatin?{titleFont:t(h.majorLatin)}:{},...h.minorLatin?{bodyFont:t(h.minorLatin)}:{}}),{partial:_,warnings:f}}function f(e,t={}){let{partial:n,warnings:r}=d(e,t);return{theme:i(n),warnings:r}}function p(e){let{colors:t,colorMap:n}=e;if(!t)return{};let r={};for(let[e,n]of Object.entries(t))typeof n==`string`&&(r[e]=n);let i=t[n.bg1],a=t[n.tx1];return i&&(r.bg1=i),a&&(r.tx1=a),{...i?{background:i}:{},...a?{text:a}:{},schemeColors:r}}export{f as n,d as r,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={landscape:{width:1920,height:1080,name:`16:9 Landscape`},portrait:{width:1080,height:1920,name:`9:16 Portrait`},square:{width:1080,height:1080,name:`1:1 Square`},standard:{width:1440,height:1080,name:`4:3 Standard`}};function t(t){return typeof t==`string`?e[t]:t}var n=Math.sqrt(4852800);function r(e){return Math.sqrt(e.width*e.width+e.height*e.height)/n}function i(e){let t=e.width/e.height;return Math.abs(t-1)<.05?`square`:t>1?`landscape`:`portrait`}var a={landscape:{primaryY:`35%`,secondaryY:`55%`,tertiaryY:`75%`,titleScale:1,bodyScale:1,columnLeftX:`25%`,columnRightX:`75%`,columnTopY:`35%`,columnBottomY:`65%`,stackColumns:!1,maxTextWidth:`80%`,horizontalPadding:`10%`,captionY:`85%`,captionScale:1},portrait:{primaryY:`25%`,secondaryY:`42%`,tertiaryY:`58%`,titleScale:.7,bodyScale:1.5,columnLeftX:`50%`,columnRightX:`50%`,columnTopY:`30%`,columnBottomY:`55%`,stackColumns:!0,maxTextWidth:`90%`,horizontalPadding:`5%`,captionY:`75%`,captionScale:.85},square:{primaryY:`30%`,secondaryY:`50%`,tertiaryY:`70%`,titleScale:.85,bodyScale:.9,columnLeftX:`25%`,columnRightX:`75%`,columnTopY:`35%`,columnBottomY:`65%`,stackColumns:!1,maxTextWidth:`85%`,horizontalPadding:`7.5%`,captionY:`82%`,captionScale:.9}};function o(e){return a[e]}function s(e,t,n,i=!1){let a=r(t),s=o(n),c=i?s.titleScale:s.bodyScale;return Math.round(e*a*c)}function c(e){let t=o(e);return t.stackColumns?{left:{x:`50%`,y:t.columnTopY},right:{x:`50%`,y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:`50%`},right:{x:t.columnRightX,y:`50%`}}}var l=`system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`;function u(e){return`template`in e&&typeof e.template==`string`}function d(t,n,a,s=e.landscape){let c=i(s),l=t.renderStyle.layoutOverrides,u=o(c);return{theme:t,blockIndex:n,totalBlocks:a,viewport:s,fontScale:r(s),orientation:c,layout:l?{...u,...l}:u}}function f(e,t,n=!1){return s(e,t.viewport,t.orientation,n)}function p(e){return`template`in e&&typeof e.template==`string`}function m(e,t=new WeakMap){if(typeof e!=`object`||!e)return e;let n=t.get(e);if(n!==void 0)return n;let r=Object.prototype.toString.call(e);if(r===`[object ArrayBuffer]`){let t=new Uint8Array(e),n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}if(r===`[object Date]`)return new Date(Date.prototype.getTime.call(e));if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(m(r,t));return n}let i=e,a={};t.set(e,a);for(let e of Object.keys(i))Object.defineProperty(a,e,{value:m(i[e],t),enumerable:!0,configurable:!0,writable:!0});return a}function h(e,t=new WeakSet){if(typeof e!=`object`||!e||t.has(e))return e;t.add(e);for(let n of Object.keys(e))h(e[n],t);return Object.freeze(e)}function g(e){return h(m(e))}export{
|
|
1
|
+
var e={landscape:{width:1920,height:1080,name:`16:9 Landscape`},portrait:{width:1080,height:1920,name:`9:16 Portrait`},square:{width:1080,height:1080,name:`1:1 Square`},standard:{width:1440,height:1080,name:`4:3 Standard`}};function t(t){return typeof t==`string`?e[t]:t}var n=Math.sqrt(4852800);function r(e){return Math.sqrt(e.width*e.width+e.height*e.height)/n}function i(e){let t=e.width/e.height;return Math.abs(t-1)<.05?`square`:t>1?`landscape`:`portrait`}var a={landscape:{primaryY:`35%`,secondaryY:`55%`,tertiaryY:`75%`,titleScale:1,bodyScale:1,columnLeftX:`25%`,columnRightX:`75%`,columnTopY:`35%`,columnBottomY:`65%`,stackColumns:!1,maxTextWidth:`80%`,horizontalPadding:`10%`,captionY:`85%`,captionScale:1},portrait:{primaryY:`25%`,secondaryY:`42%`,tertiaryY:`58%`,titleScale:.7,bodyScale:1.5,columnLeftX:`50%`,columnRightX:`50%`,columnTopY:`30%`,columnBottomY:`55%`,stackColumns:!0,maxTextWidth:`90%`,horizontalPadding:`5%`,captionY:`75%`,captionScale:.85},square:{primaryY:`30%`,secondaryY:`50%`,tertiaryY:`70%`,titleScale:.85,bodyScale:.9,columnLeftX:`25%`,columnRightX:`75%`,columnTopY:`35%`,columnBottomY:`65%`,stackColumns:!1,maxTextWidth:`85%`,horizontalPadding:`7.5%`,captionY:`82%`,captionScale:.9}};function o(e){return a[e]}function s(e,t,n,i=!1){let a=r(t),s=o(n),c=i?s.titleScale:s.bodyScale;return Math.round(e*a*c)}function c(e){let t=o(e);return t.stackColumns?{left:{x:`50%`,y:t.columnTopY},right:{x:`50%`,y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:`50%`},right:{x:t.columnRightX,y:`50%`}}}var l=`system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`;function u(e){return`template`in e&&typeof e.template==`string`}function d(t,n,a,s=e.landscape){let c=i(s),l=t.renderStyle.layoutOverrides,u=o(c);return{theme:t,blockIndex:n,totalBlocks:a,viewport:s,fontScale:r(s),orientation:c,layout:l?{...u,...l}:u}}function f(e,t,n=!1){return s(e,t.viewport,t.orientation,n)}function p(e){return`template`in e&&typeof e.template==`string`}function m(e,t=new WeakMap){if(typeof e!=`object`||!e)return e;let n=t.get(e);if(n!==void 0)return n;let r=Object.prototype.toString.call(e);if(r===`[object ArrayBuffer]`){let t=new Uint8Array(e),n=new Uint8Array(t.byteLength);return n.set(t),n.buffer}if(r===`[object Date]`)return new Date(Date.prototype.getTime.call(e));if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(m(r,t));return n}let i=e,a={};t.set(e,a);for(let e of Object.keys(i))Object.defineProperty(a,e,{value:m(i[e],t),enumerable:!0,configurable:!0,writable:!0});return a}function h(e,t=new WeakSet){if(typeof e!=`object`||!e||t.has(e))return e;t.add(e);for(let n of Object.keys(e))h(e[n],t);return Object.freeze(e)}function g(e){return h(m(e))}export{m as a,c,p as d,u as f,g as i,t as l,e as n,d as o,f as p,r,o as s,l as t,i as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./chunk-BAOV476U-yPHu-ECL.js";import{r as t}from"./chunk-4VOD55SX-BFSSw0c8.js";var n=new Set([`image`,`text`,`shape`,`path`,`map`,`video`,`table`,`tree`,`mermaid`]),r=new Set([`none`,`fadeIn`,`fadeOut`,`slowZoom`,`zoomIn`,`zoomOut`,`panLeft`,`panRight`,`typewriter`]),i=class{constructor(){this.errors=[]}error(e,t){this.errors.push({path:e,message:t})}object(e,t){return!e||typeof e!=`object`||Array.isArray(e)?(this.error(t,`expected object`),!1):!0}string(e,t,n=!1){return typeof e!=`string`||n&&e.trim().length===0?(this.error(t,n?`expected non-empty string`:`expected string`),!1):!0}number(e,t){return typeof e!=`number`||!Number.isFinite(e)?(this.error(t,`expected finite number`),!1):!0}boolean(e,t){return typeof e==`boolean`?!0:(this.error(t,`expected boolean`),!1)}enum(e,t,n){return typeof e!=`string`||!n.has(e)?(this.error(t,`expected one of: ${Array.from(n).join(`, `)}`),!1):!0}};function a(e,t,n,r){t[n]!==void 0&&e.string(t[n],`${r}.${n}`)}function o(e,t,n,r){t[n]!==void 0&&e.number(t[n],`${r}.${n}`)}function s(e,t,n,r){t[n]!==void 0&&e.boolean(t[n],`${r}.${n}`)}function c(e,t,n,r,i){t[n]!==void 0&&e.enum(t[n],`${r}.${n}`,new Set(i))}function l(e,t,n){if(e.object(t,n)){for(let r of[`x`,`y`])u(e,t[r],`${n}.${r}`);for(let r of[`width`,`height`])t[r]!==void 0&&u(e,t[r],`${n}.${r}`);c(e,t,`anchor`,n,[`center`,`top-left`,`top-right`,`bottom-left`,`bottom-right`])}}function u(e,t,n){typeof t==`number`&&Number.isFinite(t)||typeof t==`string`&&Number.isFinite(Number.parseFloat(t))||e.error(n,`expected finite number or numeric string`)}function d(e,t,n){e.object(t,n)&&(e.enum(t.type,`${n}.type`,r),o(e,t,`duration`,n),o(e,t,`delay`,n),a(e,t,`easing`,n),c(e,t,`direction`,n,[`in`,`out`]),c(e,t,`panDirection`,n,[`left`,`right`,`up`,`down`]))}function f(e,t,n){e.object(t,n)&&(e.enum(t.source,`${n}.source`,new Set([`images`,`children`,`listItems`])),c(e,t,`direction`,n,[`row`,`column`]),o(e,t,`gap`,n),t.max!==void 0&&e.number(t.max,`${n}.max`)&&(!Number.isInteger(t.max)||t.max<0)&&e.error(`${n}.max`,`expected non-negative integer`))}function p(e,t,n){e.object(t,n)&&(e.string(t.from,`${n}.from`),e.string(t.to,`${n}.to`),o(e,t,`angle`,n))}function m(e,t,n){e.object(t,n)&&(e.number(t.fontSize,`${n}.fontSize`),e.string(t.color,`${n}.color`),a(e,t,`fontFamily`,n),c(e,t,`fontWeight`,n,[`normal`,`bold`]),c(e,t,`fontStyle`,n,[`normal`,`italic`]),c(e,t,`textAlign`,n,[`left`,`center`,`right`]),c(e,t,`verticalAlign`,n,[`top`,`middle`,`bottom`]),o(e,t,`lineHeight`,n),s(e,t,`shadow`,n),a(e,t,`background`,n),o(e,t,`backgroundOpacity`,n),t.backgroundGradient!==void 0&&p(e,t.backgroundGradient,`${n}.backgroundGradient`),a(e,t,`borderColor`,n),o(e,t,`borderWidth`,n),c(e,t,`borderStyle`,n,[`solid`,`dashed`,`dotted`]),o(e,t,`padding`,n),o(e,t,`maxLines`,n))}function h(e,t,n){if(e.object(t,n)&&(e.string(t.src,`${n}.src`),e.string(t.alt,`${n}.alt`),c(e,t,`fit`,n,[`cover`,`contain`,`fill`]),a(e,t,`credit`,n),a(e,t,`license`,n),o(e,t,`blur`,n),t.treatment!==void 0)){let r=`${n}.treatment`;e.object(t.treatment,r)&&(e.enum(t.treatment.type,`${r}.type`,new Set([`none`,`mono`,`duotone`,`warm`,`cool`])),o(e,t.treatment,`strength`,r),a(e,t.treatment,`color`,r))}}function g(e,t,n){if(e.object(t,n)){if(e.enum(t.shape,`${n}.shape`,new Set([`rect`,`circle`,`line`])),a(e,t,`fill`,n),o(e,t,`fillOpacity`,n),t.gradient!==void 0&&p(e,t.gradient,`${n}.gradient`),a(e,t,`stroke`,n),o(e,t,`strokeWidth`,n),c(e,t,`borderStyle`,n,[`solid`,`dashed`,`dotted`]),o(e,t,`borderRadius`,n),t.pattern!==void 0){let r=`${n}.pattern`;e.object(t.pattern,r)&&(e.enum(t.pattern.kind,`${r}.kind`,new Set([`dots`,`grid`,`diagonal`])),e.string(t.pattern.color,`${r}.color`),o(e,t.pattern,`size`,r),o(e,t.pattern,`opacity`,r))}if(t.filter!==void 0){let r=`${n}.filter`;e.object(t.filter,r)&&(e.enum(t.filter.type,`${r}.type`,new Set([`noise`])),o(e,t.filter,`baseFrequency`,r),o(e,t.filter,`opacity`,r))}}}function _(e,t,n){if(!e.object(t,n))return;e.string(t.d,`${n}.d`),a(e,t,`shapeKind`,n),a(e,t,`stroke`,n),o(e,t,`strokeWidth`,n),a(e,t,`fill`,n),o(e,t,`fillOpacity`,n),t.gradient!==void 0&&p(e,t.gradient,`${n}.gradient`),c(e,t,`borderStyle`,n,[`solid`,`dashed`,`dotted`]),a(e,t,`dasharray`,n);let r=[`none`,`arrow`,`open`,`diamond`,`circle`,`square`];c(e,t,`startMarker`,n,r),c(e,t,`endMarker`,n,r)}function ee(e,t,n){e.object(t,n)&&(e.object(t.center,`${n}.center`)&&(e.number(t.center.lat,`${n}.center.lat`),e.number(t.center.lng,`${n}.center.lng`)),e.number(t.zoom,`${n}.zoom`),e.enum(t.style,`${n}.style`,new Set([`terrain`,`satellite`,`road`,`toner`,`watercolor`])),a(e,t,`staticSrc`,n),s(e,t,`showAttribution`,n),t.markers!==void 0&&(Array.isArray(t.markers)?t.markers.forEach((t,r)=>{let i=`${n}.markers[${r}]`;e.object(t,i)&&(e.number(t.lat,`${i}.lat`),e.number(t.lng,`${i}.lng`),a(e,t,`label`,i),a(e,t,`color`,i),c(e,t,`icon`,i,[`pin`,`circle`,`star`]))}):e.error(`${n}.markers`,`expected array`)))}function te(e,t,n){e.object(t,n)&&(e.string(t.src,`${n}.src`),e.string(t.alt,`${n}.alt`),e.number(t.clipStart,`${n}.clipStart`),e.number(t.clipEnd,`${n}.clipEnd`),a(e,t,`posterSrc`,n),c(e,t,`fit`,n,[`cover`,`contain`,`fill`]),o(e,t,`sourceDuration`,n),o(e,t,`startAt`,n),s(e,t,`spillover`,n),a(e,t,`credit`,n),a(e,t,`license`,n))}function ne(e,t,n){if(e.object(t,n)){if(v(e,t.headers,`${n}.headers`),Array.isArray(t.rows)?t.rows.forEach((t,r)=>v(e,t,`${n}.rows[${r}]`)):e.error(`${n}.rows`,`expected array`),t.align!==void 0)if(!Array.isArray(t.align))e.error(`${n}.align`,`expected array`);else{let r=new Set([`left`,`right`,`center`]);t.align.forEach((t,i)=>{t!==null&&e.enum(t,`${n}.align[${i}]`,r)})}if(e.object(t.style,`${n}.style`)){for(let r of[`headerBackground`,`headerColor`,`cellBackground`,`cellColor`,`borderColor`])e.string(t.style[r],`${n}.style.${r}`);e.number(t.style.fontSize,`${n}.style.fontSize`),a(e,t.style,`fontFamily`,`${n}.style`),a(e,t.style,`headerFontFamily`,`${n}.style`),o(e,t.style,`borderRadius`,`${n}.style`)}}}function v(e,t,n){if(!Array.isArray(t)){e.error(n,`expected string array`);return}t.forEach((t,r)=>e.string(t,`${n}[${r}]`))}function re(e,t,n){if(e.object(t,n)&&(Array.isArray(t.items)?t.items.forEach((t,r)=>y(e,t,`${n}.items[${r}]`,0)):e.error(`${n}.items`,`expected array`),e.object(t.style,`${n}.style`))){for(let r of[`rowColor`,`dirColor`,`connectorColor`,`iconColor`,`commentColor`])e.string(t.style[r],`${n}.style.${r}`);e.number(t.style.fontSize,`${n}.style.fontSize`),e.number(t.style.indentPx,`${n}.style.indentPx`),a(e,t.style,`fontFamily`,`${n}.style`),a(e,t.style,`monoFontFamily`,`${n}.style`),a(e,t.style,`folderIcon`,`${n}.style`),a(e,t.style,`fileIcon`,`${n}.style`)}}function y(e,t,n,r){if(r>100){e.error(n,`tree nesting exceeds 100 levels`);return}e.object(t,n)&&(e.string(t.id,`${n}.id`),e.string(t.label,`${n}.label`),s(e,t,`isDir`,n),a(e,t,`comment`,n),Array.isArray(t.children)?t.children.forEach((t,i)=>y(e,t,`${n}.children[${i}]`,r+1)):e.error(`${n}.children`,`expected array`))}function ie(e,t,n){e.object(t,n)&&(e.string(t.source,`${n}.source`),a(e,t,`background`,n),a(e,t,`foreground`,n),o(e,t,`padding`,n))}function ae(e,t,r){if(!e.object(t,r)||(e.string(t.id,`${r}.id`,!0),l(e,t.position,`${r}.position`),t.animation!==void 0&&d(e,t.animation,`${r}.animation`),t.repeat!==void 0&&f(e,t.repeat,`${r}.repeat`),!e.enum(t.type,`${r}.type`,n)))return;let i=`${r}.content`;switch(t.type){case`image`:h(e,t.content,i);break;case`text`:e.object(t.content,i)&&(e.string(t.content.text,`${i}.text`),a(e,t.content,`html`,i),m(e,t.content.style,`${i}.style`));break;case`shape`:g(e,t.content,i);break;case`path`:_(e,t.content,i);break;case`map`:ee(e,t.content,i);break;case`video`:te(e,t.content,i);break;case`table`:ne(e,t.content,i);break;case`tree`:re(e,t.content,i);break;case`mermaid`:ie(e,t.content,i);break}}function b(e){let t=new i;if(!t.object(e,`$`))return{valid:!1,errors:t.errors};if(t.string(e.name,`$.name`,!0),t.string(e.label,`$.label`,!0),e.description!==void 0&&t.string(e.description,`$.description`),t.object(e.viewport,`$.viewport`)&&(t.number(e.viewport.width,`$.viewport.width`)&&e.viewport.width<=0&&t.error(`$.viewport.width`,`expected number greater than zero`),t.number(e.viewport.height,`$.viewport.height`)&&e.viewport.height<=0&&t.error(`$.viewport.height`,`expected number greater than zero`)),!Array.isArray(e.layers))t.error(`$.layers`,`expected array`);else{let n=new Set;e.layers.forEach((e,r)=>{if(ae(t,e,`$.layers[${r}]`),e&&typeof e==`object`&&!Array.isArray(e)){let i=e.id;typeof i==`string`&&(n.has(i)&&t.error(`$.layers[${r}].id`,`duplicate layer id "${i}"`),n.add(i))}})}return t.errors.length>0?{valid:!1,errors:t.errors}:{valid:!0,errors:[],template:e}}function oe(e){return b(e).valid}var se=`squisq-custom-templates`,x=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function S(e){return x.test(e)}function C(e){if(!x.test(e))return null;let t=e.slice(1);return t.length===3&&(t=t.split(``).map(e=>e+e).join(``)),[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255]}function w(e){let t=e=>Math.max(0,Math.min(255,Math.round(e*255))).toString(16).padStart(2,`0`);return`#`+t(e[0])+t(e[1])+t(e[2])}function T(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function E(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function D(e){let[t,n,r]=e,i=T(t),a=T(n),o=T(r),s=.4122214708*i+.5363325363*a+.0514459929*o,c=.2119034982*i+.6806995451*a+.1073969566*o,l=.0883024619*i+.2817188376*a+.6299787005*o,u=Math.cbrt(s),d=Math.cbrt(c),f=Math.cbrt(l),p=.2104542553*u+.793617785*d-.0040720468*f,m=1.9779984951*u-2.428592205*d+.4505937099*f,h=.0259040371*u+.7827717662*d-.808675766*f,g=Math.sqrt(m*m+h*h),_=Math.atan2(h,m)*180/Math.PI;return _<0&&(_+=360),{L:p,C:g,h:_}}function O({L:e,C:t,h:n}){let r=n*Math.PI/180,i=t*Math.cos(r),a=t*Math.sin(r),o=e+.3963377774*i+.2158037573*a,s=e-.1055613458*i-.0638541728*a,c=e-.0894841775*i-1.291485548*a,l=o*o*o,u=s*s*s,d=c*c*c,f=4.0767416621*l-3.3077115913*u+.2309699292*d,p=-1.2684380046*l+2.6097574011*u-.3413193965*d,m=-.0041960863*l-.7034186147*u+1.707614701*d;return[Math.max(0,Math.min(1,E(f))),Math.max(0,Math.min(1,E(p))),Math.max(0,Math.min(1,E(m)))]}function k(e,t){let n=C(e);if(!n)return e;let r=D(n);return r.L=Math.max(0,Math.min(1,r.L+t)),w(O(r))}function A(e,t){return k(e,-t)}function ce(e,t){let n=C(e);if(!n)return e;let r=D(n);return r.C=Math.max(0,r.C*t),w(O(r))}function j(e){let t=C(e);if(!t)return 0;let[n,r,i]=t.map(T);return .2126*n+.7152*r+.0722*i}function le(e){let t=C(e);if(!t)return 0;let[n,r,i]=t,a=Math.max(n,r,i),o=Math.min(n,r,i);if(a===o)return 0;let s=a-o,c;return c=a===n?(r-i)/s%6:a===r?(i-n)/s+2:(n-r)/s+4,Math.round((c*60+360)%360)}function ue(e,t){let n=C(e);if(!n)return e;let r=Math.max(0,Math.min(1,t)),i=e=>Math.round(e*255);return`rgba(${i(n[0])}, ${i(n[1])}, ${i(n[2])}, ${r})`}function M(e,t){let n=j(e),r=j(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function de(e,t=`#f7fafc`,n=`#1a202c`){return M(e,n)>=M(e,t)?n:t}function fe(e,t=.15){return{lighter2:k(e,t),lighter1:k(e,t/2),base:e,darker1:A(e,t/2),darker2:A(e,t)}}var N=[`hero`,`banner`,`stat-band`,`quote-band`,`feature-split`,`media-figure`,`gallery`,`callout`,`card-grid`,`item-list`,`timeline-rail`,`table-section`,`canvas-embed`,`prose`,`footer`],P=[`clean`,`editorial`,`brutalist`,`terminal`,`cinematic`,`documentary`,`organic`,`soft`],pe=[`compact`,`comfortable`,`generous`],me=[`none`,`gap-only`,`hairline`,`thick-rule`,`double-rule`,`dotted`],he=[`flat`,`alternate`,`accent-bands`,`tinted-panels`],ge=[`stacked`,`split`,`full-bleed`,`letterbox`,`oversized-type`],_e=[`none`,`kicker`,`numbered`,`mono-tag`],ve=[`regular`,`display`,`oversized`],ye=[`none`,`uppercase`],be=[`none`,`accent-bar`,`full-rule`],xe=[`flush`,`rounded`,`bordered`,`polaroid`,`letterboxed`,`circle-accent`],Se=[`none`,`soft`,`crisp`,`heavy`],Ce=[`none`,`oversized-glyph`,`accent-bar`],we=[`plain`,`oversized`,`boxed`,`mono`],F=[`none`,`dots`,`grid`,`diagonal`,`noise`],I=[`lead`,`strong`,`standard`,`quiet`],L=[`base`,`alternate`,`accent`,`media`],R=[`primary-only`,`cycle`,`alternate-two`,`none`],Te=new Set([`serif`,`sans-serif`,`monospace`,`system-ui`]),z=new Set(N),Ee=new Set(P),De=new Set(I),Oe=new Set(L),ke=new Set(R),Ae={sectionSpacing:new Set(pe),divider:new Set(me),backgroundRhythm:new Set(he),heroStyle:new Set(ge),imageFraming:new Set(xe),shadow:new Set(Se),quoteMark:new Set(Ce),numeralStyle:new Set(we)},je={eyebrow:{values:new Set(_e),required:!0},scale:{values:new Set(ve),required:!0},case:{values:new Set(ye),required:!1},underline:{values:new Set(be),required:!1}},Me=new Set([`normal`,`bold`]),B=new Set([`dark-vignette`,`radial-dark`,`warm-sunset`,`cool-blue`,`earth-tones`]),Ne=class{constructor(){this.errors=[]}err(e,t){this.errors.push({path:e,message:t})}isObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}isString(e){return typeof e==`string`}isNumber(e){return typeof e==`number`&&Number.isFinite(e)}isBoolean(e){return typeof e==`boolean`}hex(e,t){this.isString(t)?S(t)||this.err(e,`expected #rgb or #rrggbb hex color, got "${t}"`):this.err(e,`expected hex color string, got ${typeof t}`)}palette(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of[`primary`,`secondary`,`background`,`backgroundLight`,`text`,`textMuted`,`highlight`,`warning`])this.hex(`${e}.${n}`,t[n])}colorScheme(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}this.hex(`${e}.bg`,t.bg),this.hex(`${e}.text`,t.text),this.hex(`${e}.accent`,t.accent)}colorSchemes(e,t){if(!this.isObject(t)){this.err(e,`expected object map`);return}for(let n of Object.keys(t))this.colorScheme(`${e}.${n}`,t[n])}fontFamily(e,t){if(!this.isObject(t)){this.err(e,`expected FontFamily object ({ stackId } or { custom })`);return}if(`stackId`in t){(!this.isString(t.stackId)||t.stackId.length===0)&&this.err(`${e}.stackId`,`expected non-empty string`);return}if(`custom`in t){let n=t.custom;if(!this.isObject(n)){this.err(`${e}.custom`,`expected { name, fallback } object`);return}!this.isString(n.name)||n.name.length===0?this.err(`${e}.custom.name`,`expected non-empty string`):(/[<>{};]/.test(n.name)||[...n.name].some(e=>{let t=e.codePointAt(0);return t<32||t===127}))&&this.err(`${e}.custom.name`,`font name contains control characters or CSS/HTML delimiters`),(!this.isString(n.fallback)||!Te.has(n.fallback))&&this.err(`${e}.custom.fallback`,`expected one of: serif, sans-serif, monospace, system-ui`);return}this.err(e,`expected { stackId } or { custom: { name, fallback } }`)}typography(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}this.fontFamily(`${e}.bodyFont`,t.bodyFont),this.fontFamily(`${e}.titleFont`,t.titleFont),t.monoFont!==void 0&&this.fontFamily(`${e}.monoFont`,t.monoFont);for(let n of[`titleScale`,`bodyScale`,`lineHeight`,`titleLineHeight`])t[n]!==void 0&&!this.isNumber(t[n])&&this.err(`${e}.${n}`,`expected number, got ${typeof t[n]}`);t.titleWeight!==void 0&&(!this.isString(t.titleWeight)||!Me.has(t.titleWeight))&&this.err(`${e}.titleWeight`,`expected "normal" or "bold"`)}style(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.borderRadius!==void 0&&!this.isNumber(t.borderRadius)&&this.err(`${e}.borderRadius`,`expected number`),t.textShadow!==void 0&&!this.isBoolean(t.textShadow)&&this.err(`${e}.textShadow`,`expected boolean`);for(let n of[`overlayOpacity`,`animationSpeed`])t[n]!==void 0&&!this.isNumber(t[n])&&this.err(`${e}.${n}`,`expected number`);t.blockPadding!==void 0&&!this.isString(t.blockPadding)&&this.err(`${e}.blockPadding`,`expected string (percentage e.g. "5%")`),t.imageTreatment!==void 0&&this.imageTreatment(`${e}.imageTreatment`,t.imageTreatment),t.pip!==void 0&&this.pip(`${e}.pip`,t.pip)}pip(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.cornerRadius!==void 0&&!this.isNumber(t.cornerRadius)&&!this.isString(t.cornerRadius)&&this.err(`${e}.cornerRadius`,`expected number or string`),t.border!==void 0&&t.border!==`none`&&!this.isObject(t.border)&&this.err(`${e}.border`,`expected 'none' or { width?, color? }`),t.shadow!==void 0&&!this.isBoolean(t.shadow)&&!this.isString(t.shadow)&&this.err(`${e}.shadow`,`expected boolean or string`)}imageTreatment(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}let n=[`none`,`mono`,`duotone`,`warm`,`cool`];(!this.isString(t.type)||!n.includes(t.type))&&this.err(`${e}.type`,`expected one of ${n.join(`|`)}`),t.strength!==void 0&&!this.isNumber(t.strength)&&this.err(`${e}.strength`,`expected number (0..1)`),t.color!==void 0&&this.hex(`${e}.color`,t.color)}renderStyle(e,n){if(!this.isObject(n)){this.err(e,`expected object`);return}(!this.isString(n.name)||n.name.length===0)&&this.err(`${e}.name`,`expected non-empty string`),n.ambientMotion!==void 0&&!this.isBoolean(n.ambientMotion)&&this.err(`${e}.ambientMotion`,`expected boolean`);for(let t of[`defaultTextAnimation`,`defaultImageAnimation`])n[t]!==void 0&&!this.isString(n[t])&&this.err(`${e}.${t}`,`expected animation type string`);if(n.defaultTransition!==void 0){let r=n.defaultTransition;this.isObject(r)?((!this.isString(r.type)||!t(r.type))&&this.err(`${e}.defaultTransition.type`,`expected valid transition type`),r.duration!==void 0&&!this.isNumber(r.duration)&&this.err(`${e}.defaultTransition.duration`,`expected number`)):this.err(`${e}.defaultTransition`,`expected object`)}if(n.layoutOverrides!==void 0&&!this.isObject(n.layoutOverrides)&&this.err(`${e}.layoutOverrides`,`expected object`),n.templateHints!==void 0)if(!this.isObject(n.templateHints))this.err(`${e}.templateHints`,`expected object map`);else for(let t of Object.keys(n.templateHints)){let r=n.templateHints[t];if(!this.isObject(r)){this.err(`${e}.templateHints.${t}`,`expected object`);continue}for(let n of Object.keys(r)){let i=typeof r[n];i!==`string`&&i!==`number`&&i!==`boolean`&&this.err(`${e}.templateHints.${t}.${n}`,`expected string|number|boolean, got ${i}`)}}}seedColors(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.primary===void 0?this.err(`${e}.primary`,`required when seedColors is present`):this.hex(`${e}.primary`,t.primary);for(let n of[`secondary`,`accent`,`background`,`text`])t[n]!==void 0&&this.hex(`${e}.${n}`,t[n])}persistentLayer(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}if(`template`in t){if(!this.isString(t.template)){this.err(`${e}.template`,`expected string`);return}let n=t.config;if(!this.isObject(n)){this.err(`${e}.config`,`expected object`);return}if(n.type!==t.template&&this.err(`${e}.config.type`,`expected "${t.template}", got "${String(n.type)}"`),t.template===`gradientBackground`&&n.preset!==void 0&&(!this.isString(n.preset)||!B.has(n.preset))&&this.err(`${e}.config.preset`,`expected one of: ${Array.from(B).join(`, `)}`),t.template===`gradientBackground`&&`gradient`in n&&this.err(`${e}.config.gradient`,"raw CSS gradient strings are not allowed in Theme JSON; use a `preset`"),t.template===`patternBackground`){let t=[`dots`,`grid`,`diagonal`,`noise`];(!this.isString(n.pattern)||!t.includes(n.pattern))&&this.err(`${e}.config.pattern`,`expected one of ${t.join(`|`)}`);for(let t of[`opacity`,`scale`])n[t]!==void 0&&!this.isNumber(n[t])&&this.err(`${e}.config.${t}`,`expected number`);n.color!==void 0&&this.hex(`${e}.config.color`,n.color)}if(t.template===`vignette`&&(n.strength!==void 0&&!this.isNumber(n.strength)&&this.err(`${e}.config.strength`,`expected number (0..1)`),n.color!==void 0&&this.hex(`${e}.config.color`,n.color)),t.template===`ambientGradient`){n.duration!==void 0&&!this.isNumber(n.duration)&&this.err(`${e}.config.duration`,`expected number (seconds)`);for(let t of[`from`,`to`])n[t]!==void 0&&this.hex(`${e}.config.${t}`,n[t])}}}persistentLayers(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of[`bottomLayers`,`topLayers`]){let r=t[n];if(r!==void 0){if(!Array.isArray(r)){this.err(`${e}.${n}`,`expected array`);continue}r.forEach((t,r)=>this.persistentLayer(`${e}.${n}[${r}]`,t))}}}scalarHints(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of Object.keys(t)){let r=typeof t[n];r!==`string`&&r!==`number`&&r!==`boolean`&&this.err(`${e}.${n}`,`expected string|number|boolean, got ${r}`)}}pageSectionOverride(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.kind!==void 0&&(!this.isString(t.kind)||!z.has(t.kind))&&this.err(`${e}.kind`,`expected one of: ${N.join(`, `)}`),t.variant!==void 0&&!this.isString(t.variant)&&this.err(`${e}.variant`,`expected string`),t.emphasis!==void 0&&(!this.isString(t.emphasis)||!De.has(t.emphasis))&&this.err(`${e}.emphasis`,`expected one of: ${I.join(`, `)}`),t.background!==void 0&&(!this.isString(t.background)||!Oe.has(t.background))&&this.err(`${e}.background`,`expected one of: ${L.join(`, `)}`),t.hints!==void 0&&this.scalarHints(`${e}.hints`,t.hints)}pageTokens(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of[`contentMaxWidth`,`wideMaxWidth`,`cornerRadius`])this.isNumber(t[n])||this.err(`${e}.${n}`,`expected number`);for(let[n,r]of Object.entries(Ae))(!this.isString(t[n])||!r.has(t[n]))&&this.err(`${e}.${n}`,`expected one of: ${Array.from(r).join(`, `)}`);t.pattern!==void 0&&(!this.isString(t.pattern)||!F.includes(t.pattern))&&this.err(`${e}.pattern`,`expected one of: ${F.join(`, `)}`);let n=t.headingTreatment;if(!this.isObject(n)){this.err(`${e}.headingTreatment`,`expected object`);return}for(let[t,r]of Object.entries(je)){let i=n[t];if(i===void 0){r.required&&this.err(`${e}.headingTreatment.${t}`,`required`);continue}(!this.isString(i)||!r.values.has(i))&&this.err(`${e}.headingTreatment.${t}`,`expected one of: ${Array.from(r.values).join(`, `)}`)}}pageStyle(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}if((!this.isString(t.family)||!Ee.has(t.family))&&this.err(`${e}.family`,`expected one of: ${P.join(`, `)}`),t.tokens===void 0?this.err(`${e}.tokens`,`required`):this.pageTokens(`${e}.tokens`,t.tokens),t.sections!==void 0)if(!this.isObject(t.sections))this.err(`${e}.sections`,`expected object map`);else for(let n of Object.keys(t.sections)){if(!z.has(n)){this.err(`${e}.sections.${n}`,`unknown section kind`);continue}this.pageSectionOverride(`${e}.sections.${n}`,t.sections[n])}if(t.templates!==void 0)if(!this.isObject(t.templates))this.err(`${e}.templates`,`expected object map`);else for(let n of Object.keys(t.templates))this.pageSectionOverride(`${e}.templates.${n}`,t.templates[n]);if(t.accentRotation===void 0)this.err(`${e}.accentRotation`,`required`);else if(!this.isObject(t.accentRotation))this.err(`${e}.accentRotation`,`expected object`);else{let n=t.accentRotation;(!this.isString(n.strategy)||!ke.has(n.strategy))&&this.err(`${e}.accentRotation.strategy`,`expected one of: ${R.join(`, `)}`),n.schemes!==void 0&&(!Array.isArray(n.schemes)||n.schemes.some(e=>typeof e!=`string`))&&this.err(`${e}.accentRotation.schemes`,`expected array of strings`)}}};function V(e){let t=new Ne;return t.isObject(e)?(e.schemaVersion!==`1`&&t.err(`schemaVersion`,`expected "1", got "${String(e.schemaVersion)}"`),(!t.isString(e.id)||e.id.length===0)&&t.err(`id`,`expected non-empty string`),(!t.isString(e.name)||e.name.length===0)&&t.err(`name`,`expected non-empty string`),e.description!==void 0&&!t.isString(e.description)&&t.err(`description`,`expected string`),e.basedOn!==void 0&&!t.isString(e.basedOn)&&t.err(`basedOn`,`expected string`),e.seedColors!==void 0&&t.seedColors(`seedColors`,e.seedColors),e.colors===void 0?t.err(`colors`,`required`):t.palette(`colors`,e.colors),e.typography===void 0?t.err(`typography`,`required`):t.typography(`typography`,e.typography),e.style===void 0?t.err(`style`,`required`):t.style(`style`,e.style),e.renderStyle===void 0?t.err(`renderStyle`,`required`):t.renderStyle(`renderStyle`,e.renderStyle),e.colorSchemes===void 0?t.err(`colorSchemes`,`required`):t.colorSchemes(`colorSchemes`,e.colorSchemes),e.persistentLayers!==void 0&&t.persistentLayers(`persistentLayers`,e.persistentLayers),e.pageStyle!==void 0&&t.pageStyle(`pageStyle`,e.pageStyle),t.errors.length===0?{valid:!0,errors:[],theme:e}:{valid:!1,errors:t.errors}):{valid:!1,errors:[{path:``,message:`expected object`}]}}function H(e,t=`theme`){let n=V(e);if(!n.valid||!n.theme){let e=n.errors.slice(0,5).map(e=>` ${e.path||`<root>`}: ${e.message}`).join(`
|
|
1
|
+
import{i as e}from"./chunk-BAOV476U-CEOFYt8X.js";import{r as t}from"./chunk-4VOD55SX-BFSSw0c8.js";var n=new Set([`image`,`text`,`shape`,`path`,`map`,`video`,`table`,`tree`,`mermaid`]),r=new Set([`none`,`fadeIn`,`fadeOut`,`slowZoom`,`zoomIn`,`zoomOut`,`panLeft`,`panRight`,`typewriter`]),i=class{constructor(){this.errors=[]}error(e,t){this.errors.push({path:e,message:t})}object(e,t){return!e||typeof e!=`object`||Array.isArray(e)?(this.error(t,`expected object`),!1):!0}string(e,t,n=!1){return typeof e!=`string`||n&&e.trim().length===0?(this.error(t,n?`expected non-empty string`:`expected string`),!1):!0}number(e,t){return typeof e!=`number`||!Number.isFinite(e)?(this.error(t,`expected finite number`),!1):!0}boolean(e,t){return typeof e==`boolean`?!0:(this.error(t,`expected boolean`),!1)}enum(e,t,n){return typeof e!=`string`||!n.has(e)?(this.error(t,`expected one of: ${Array.from(n).join(`, `)}`),!1):!0}};function a(e,t,n,r){t[n]!==void 0&&e.string(t[n],`${r}.${n}`)}function o(e,t,n,r){t[n]!==void 0&&e.number(t[n],`${r}.${n}`)}function s(e,t,n,r){t[n]!==void 0&&e.boolean(t[n],`${r}.${n}`)}function c(e,t,n,r,i){t[n]!==void 0&&e.enum(t[n],`${r}.${n}`,new Set(i))}function l(e,t,n){if(e.object(t,n)){for(let r of[`x`,`y`])u(e,t[r],`${n}.${r}`);for(let r of[`width`,`height`])t[r]!==void 0&&u(e,t[r],`${n}.${r}`);c(e,t,`anchor`,n,[`center`,`top-left`,`top-right`,`bottom-left`,`bottom-right`])}}function u(e,t,n){typeof t==`number`&&Number.isFinite(t)||typeof t==`string`&&Number.isFinite(Number.parseFloat(t))||e.error(n,`expected finite number or numeric string`)}function d(e,t,n){e.object(t,n)&&(e.enum(t.type,`${n}.type`,r),o(e,t,`duration`,n),o(e,t,`delay`,n),a(e,t,`easing`,n),c(e,t,`direction`,n,[`in`,`out`]),c(e,t,`panDirection`,n,[`left`,`right`,`up`,`down`]))}function f(e,t,n){e.object(t,n)&&(e.enum(t.source,`${n}.source`,new Set([`images`,`children`,`listItems`])),c(e,t,`direction`,n,[`row`,`column`]),o(e,t,`gap`,n),t.max!==void 0&&e.number(t.max,`${n}.max`)&&(!Number.isInteger(t.max)||t.max<0)&&e.error(`${n}.max`,`expected non-negative integer`))}function p(e,t,n){e.object(t,n)&&(e.string(t.from,`${n}.from`),e.string(t.to,`${n}.to`),o(e,t,`angle`,n))}function m(e,t,n){e.object(t,n)&&(e.number(t.fontSize,`${n}.fontSize`),e.string(t.color,`${n}.color`),a(e,t,`fontFamily`,n),c(e,t,`fontWeight`,n,[`normal`,`bold`]),c(e,t,`fontStyle`,n,[`normal`,`italic`]),c(e,t,`textAlign`,n,[`left`,`center`,`right`]),c(e,t,`verticalAlign`,n,[`top`,`middle`,`bottom`]),o(e,t,`lineHeight`,n),s(e,t,`shadow`,n),a(e,t,`background`,n),o(e,t,`backgroundOpacity`,n),t.backgroundGradient!==void 0&&p(e,t.backgroundGradient,`${n}.backgroundGradient`),a(e,t,`borderColor`,n),o(e,t,`borderWidth`,n),c(e,t,`borderStyle`,n,[`solid`,`dashed`,`dotted`]),o(e,t,`padding`,n),o(e,t,`maxLines`,n))}function h(e,t,n){if(e.object(t,n)&&(e.string(t.src,`${n}.src`),e.string(t.alt,`${n}.alt`),c(e,t,`fit`,n,[`cover`,`contain`,`fill`]),a(e,t,`credit`,n),a(e,t,`license`,n),o(e,t,`blur`,n),t.treatment!==void 0)){let r=`${n}.treatment`;e.object(t.treatment,r)&&(e.enum(t.treatment.type,`${r}.type`,new Set([`none`,`mono`,`duotone`,`warm`,`cool`])),o(e,t.treatment,`strength`,r),a(e,t.treatment,`color`,r))}}function g(e,t,n){if(e.object(t,n)){if(e.enum(t.shape,`${n}.shape`,new Set([`rect`,`circle`,`line`])),a(e,t,`fill`,n),o(e,t,`fillOpacity`,n),t.gradient!==void 0&&p(e,t.gradient,`${n}.gradient`),a(e,t,`stroke`,n),o(e,t,`strokeWidth`,n),c(e,t,`borderStyle`,n,[`solid`,`dashed`,`dotted`]),o(e,t,`borderRadius`,n),t.pattern!==void 0){let r=`${n}.pattern`;e.object(t.pattern,r)&&(e.enum(t.pattern.kind,`${r}.kind`,new Set([`dots`,`grid`,`diagonal`])),e.string(t.pattern.color,`${r}.color`),o(e,t.pattern,`size`,r),o(e,t.pattern,`opacity`,r))}if(t.filter!==void 0){let r=`${n}.filter`;e.object(t.filter,r)&&(e.enum(t.filter.type,`${r}.type`,new Set([`noise`])),o(e,t.filter,`baseFrequency`,r),o(e,t.filter,`opacity`,r))}}}function _(e,t,n){if(!e.object(t,n))return;e.string(t.d,`${n}.d`),a(e,t,`shapeKind`,n),a(e,t,`stroke`,n),o(e,t,`strokeWidth`,n),a(e,t,`fill`,n),o(e,t,`fillOpacity`,n),t.gradient!==void 0&&p(e,t.gradient,`${n}.gradient`),c(e,t,`borderStyle`,n,[`solid`,`dashed`,`dotted`]),a(e,t,`dasharray`,n);let r=[`none`,`arrow`,`open`,`diamond`,`circle`,`square`];c(e,t,`startMarker`,n,r),c(e,t,`endMarker`,n,r)}function ee(e,t,n){e.object(t,n)&&(e.object(t.center,`${n}.center`)&&(e.number(t.center.lat,`${n}.center.lat`),e.number(t.center.lng,`${n}.center.lng`)),e.number(t.zoom,`${n}.zoom`),e.enum(t.style,`${n}.style`,new Set([`terrain`,`satellite`,`road`,`toner`,`watercolor`])),a(e,t,`staticSrc`,n),s(e,t,`showAttribution`,n),t.markers!==void 0&&(Array.isArray(t.markers)?t.markers.forEach((t,r)=>{let i=`${n}.markers[${r}]`;e.object(t,i)&&(e.number(t.lat,`${i}.lat`),e.number(t.lng,`${i}.lng`),a(e,t,`label`,i),a(e,t,`color`,i),c(e,t,`icon`,i,[`pin`,`circle`,`star`]))}):e.error(`${n}.markers`,`expected array`)))}function te(e,t,n){e.object(t,n)&&(e.string(t.src,`${n}.src`),e.string(t.alt,`${n}.alt`),e.number(t.clipStart,`${n}.clipStart`),e.number(t.clipEnd,`${n}.clipEnd`),a(e,t,`posterSrc`,n),c(e,t,`fit`,n,[`cover`,`contain`,`fill`]),o(e,t,`sourceDuration`,n),o(e,t,`startAt`,n),s(e,t,`spillover`,n),a(e,t,`credit`,n),a(e,t,`license`,n))}function ne(e,t,n){if(e.object(t,n)){if(v(e,t.headers,`${n}.headers`),Array.isArray(t.rows)?t.rows.forEach((t,r)=>v(e,t,`${n}.rows[${r}]`)):e.error(`${n}.rows`,`expected array`),t.align!==void 0)if(!Array.isArray(t.align))e.error(`${n}.align`,`expected array`);else{let r=new Set([`left`,`right`,`center`]);t.align.forEach((t,i)=>{t!==null&&e.enum(t,`${n}.align[${i}]`,r)})}if(e.object(t.style,`${n}.style`)){for(let r of[`headerBackground`,`headerColor`,`cellBackground`,`cellColor`,`borderColor`])e.string(t.style[r],`${n}.style.${r}`);e.number(t.style.fontSize,`${n}.style.fontSize`),a(e,t.style,`fontFamily`,`${n}.style`),a(e,t.style,`headerFontFamily`,`${n}.style`),o(e,t.style,`borderRadius`,`${n}.style`)}}}function v(e,t,n){if(!Array.isArray(t)){e.error(n,`expected string array`);return}t.forEach((t,r)=>e.string(t,`${n}[${r}]`))}function re(e,t,n){if(e.object(t,n)&&(Array.isArray(t.items)?t.items.forEach((t,r)=>y(e,t,`${n}.items[${r}]`,0)):e.error(`${n}.items`,`expected array`),e.object(t.style,`${n}.style`))){for(let r of[`rowColor`,`dirColor`,`connectorColor`,`iconColor`,`commentColor`])e.string(t.style[r],`${n}.style.${r}`);e.number(t.style.fontSize,`${n}.style.fontSize`),e.number(t.style.indentPx,`${n}.style.indentPx`),a(e,t.style,`fontFamily`,`${n}.style`),a(e,t.style,`monoFontFamily`,`${n}.style`),a(e,t.style,`folderIcon`,`${n}.style`),a(e,t.style,`fileIcon`,`${n}.style`)}}function y(e,t,n,r){if(r>100){e.error(n,`tree nesting exceeds 100 levels`);return}e.object(t,n)&&(e.string(t.id,`${n}.id`),e.string(t.label,`${n}.label`),s(e,t,`isDir`,n),a(e,t,`comment`,n),Array.isArray(t.children)?t.children.forEach((t,i)=>y(e,t,`${n}.children[${i}]`,r+1)):e.error(`${n}.children`,`expected array`))}function ie(e,t,n){e.object(t,n)&&(e.string(t.source,`${n}.source`),a(e,t,`background`,n),a(e,t,`foreground`,n),o(e,t,`padding`,n))}function ae(e,t,r){if(!e.object(t,r)||(e.string(t.id,`${r}.id`,!0),l(e,t.position,`${r}.position`),t.animation!==void 0&&d(e,t.animation,`${r}.animation`),t.repeat!==void 0&&f(e,t.repeat,`${r}.repeat`),!e.enum(t.type,`${r}.type`,n)))return;let i=`${r}.content`;switch(t.type){case`image`:h(e,t.content,i);break;case`text`:e.object(t.content,i)&&(e.string(t.content.text,`${i}.text`),a(e,t.content,`html`,i),m(e,t.content.style,`${i}.style`));break;case`shape`:g(e,t.content,i);break;case`path`:_(e,t.content,i);break;case`map`:ee(e,t.content,i);break;case`video`:te(e,t.content,i);break;case`table`:ne(e,t.content,i);break;case`tree`:re(e,t.content,i);break;case`mermaid`:ie(e,t.content,i);break}}function b(e){let t=new i;if(!t.object(e,`$`))return{valid:!1,errors:t.errors};if(t.string(e.name,`$.name`,!0),t.string(e.label,`$.label`,!0),e.description!==void 0&&t.string(e.description,`$.description`),t.object(e.viewport,`$.viewport`)&&(t.number(e.viewport.width,`$.viewport.width`)&&e.viewport.width<=0&&t.error(`$.viewport.width`,`expected number greater than zero`),t.number(e.viewport.height,`$.viewport.height`)&&e.viewport.height<=0&&t.error(`$.viewport.height`,`expected number greater than zero`)),!Array.isArray(e.layers))t.error(`$.layers`,`expected array`);else{let n=new Set;e.layers.forEach((e,r)=>{if(ae(t,e,`$.layers[${r}]`),e&&typeof e==`object`&&!Array.isArray(e)){let i=e.id;typeof i==`string`&&(n.has(i)&&t.error(`$.layers[${r}].id`,`duplicate layer id "${i}"`),n.add(i))}})}return t.errors.length>0?{valid:!1,errors:t.errors}:{valid:!0,errors:[],template:e}}function oe(e){return b(e).valid}var se=`squisq-custom-templates`,x=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function S(e){return x.test(e)}function C(e){if(!x.test(e))return null;let t=e.slice(1);return t.length===3&&(t=t.split(``).map(e=>e+e).join(``)),[parseInt(t.slice(0,2),16)/255,parseInt(t.slice(2,4),16)/255,parseInt(t.slice(4,6),16)/255]}function w(e){let t=e=>Math.max(0,Math.min(255,Math.round(e*255))).toString(16).padStart(2,`0`);return`#`+t(e[0])+t(e[1])+t(e[2])}function T(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function E(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function D(e){let[t,n,r]=e,i=T(t),a=T(n),o=T(r),s=.4122214708*i+.5363325363*a+.0514459929*o,c=.2119034982*i+.6806995451*a+.1073969566*o,l=.0883024619*i+.2817188376*a+.6299787005*o,u=Math.cbrt(s),d=Math.cbrt(c),f=Math.cbrt(l),p=.2104542553*u+.793617785*d-.0040720468*f,m=1.9779984951*u-2.428592205*d+.4505937099*f,h=.0259040371*u+.7827717662*d-.808675766*f,g=Math.sqrt(m*m+h*h),_=Math.atan2(h,m)*180/Math.PI;return _<0&&(_+=360),{L:p,C:g,h:_}}function O({L:e,C:t,h:n}){let r=n*Math.PI/180,i=t*Math.cos(r),a=t*Math.sin(r),o=e+.3963377774*i+.2158037573*a,s=e-.1055613458*i-.0638541728*a,c=e-.0894841775*i-1.291485548*a,l=o*o*o,u=s*s*s,d=c*c*c,f=4.0767416621*l-3.3077115913*u+.2309699292*d,p=-1.2684380046*l+2.6097574011*u-.3413193965*d,m=-.0041960863*l-.7034186147*u+1.707614701*d;return[Math.max(0,Math.min(1,E(f))),Math.max(0,Math.min(1,E(p))),Math.max(0,Math.min(1,E(m)))]}function k(e,t){let n=C(e);if(!n)return e;let r=D(n);return r.L=Math.max(0,Math.min(1,r.L+t)),w(O(r))}function A(e,t){return k(e,-t)}function ce(e,t){let n=C(e);if(!n)return e;let r=D(n);return r.C=Math.max(0,r.C*t),w(O(r))}function j(e){let t=C(e);if(!t)return 0;let[n,r,i]=t.map(T);return .2126*n+.7152*r+.0722*i}function le(e){let t=C(e);if(!t)return 0;let[n,r,i]=t,a=Math.max(n,r,i),o=Math.min(n,r,i);if(a===o)return 0;let s=a-o,c;return c=a===n?(r-i)/s%6:a===r?(i-n)/s+2:(n-r)/s+4,Math.round((c*60+360)%360)}function ue(e,t){let n=C(e);if(!n)return e;let r=Math.max(0,Math.min(1,t)),i=e=>Math.round(e*255);return`rgba(${i(n[0])}, ${i(n[1])}, ${i(n[2])}, ${r})`}function M(e,t){let n=j(e),r=j(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)}function de(e,t=`#f7fafc`,n=`#1a202c`){return M(e,n)>=M(e,t)?n:t}function fe(e,t=.15){return{lighter2:k(e,t),lighter1:k(e,t/2),base:e,darker1:A(e,t/2),darker2:A(e,t)}}var N=[`hero`,`banner`,`stat-band`,`quote-band`,`feature-split`,`media-figure`,`gallery`,`callout`,`card-grid`,`item-list`,`timeline-rail`,`table-section`,`canvas-embed`,`prose`,`footer`],P=[`clean`,`editorial`,`brutalist`,`terminal`,`cinematic`,`documentary`,`organic`,`soft`],pe=[`compact`,`comfortable`,`generous`],me=[`none`,`gap-only`,`hairline`,`thick-rule`,`double-rule`,`dotted`],he=[`flat`,`alternate`,`accent-bands`,`tinted-panels`],ge=[`stacked`,`split`,`full-bleed`,`letterbox`,`oversized-type`],_e=[`none`,`kicker`,`numbered`,`mono-tag`],ve=[`regular`,`display`,`oversized`],ye=[`none`,`uppercase`],be=[`none`,`accent-bar`,`full-rule`],xe=[`flush`,`rounded`,`bordered`,`polaroid`,`letterboxed`,`circle-accent`],Se=[`none`,`soft`,`crisp`,`heavy`],Ce=[`none`,`oversized-glyph`,`accent-bar`],we=[`plain`,`oversized`,`boxed`,`mono`],F=[`none`,`dots`,`grid`,`diagonal`,`noise`],I=[`lead`,`strong`,`standard`,`quiet`],L=[`base`,`alternate`,`accent`,`media`],R=[`primary-only`,`cycle`,`alternate-two`,`none`],Te=new Set([`serif`,`sans-serif`,`monospace`,`system-ui`]),z=new Set(N),Ee=new Set(P),De=new Set(I),Oe=new Set(L),ke=new Set(R),Ae={sectionSpacing:new Set(pe),divider:new Set(me),backgroundRhythm:new Set(he),heroStyle:new Set(ge),imageFraming:new Set(xe),shadow:new Set(Se),quoteMark:new Set(Ce),numeralStyle:new Set(we)},je={eyebrow:{values:new Set(_e),required:!0},scale:{values:new Set(ve),required:!0},case:{values:new Set(ye),required:!1},underline:{values:new Set(be),required:!1}},Me=new Set([`normal`,`bold`]),B=new Set([`dark-vignette`,`radial-dark`,`warm-sunset`,`cool-blue`,`earth-tones`]),Ne=class{constructor(){this.errors=[]}err(e,t){this.errors.push({path:e,message:t})}isObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}isString(e){return typeof e==`string`}isNumber(e){return typeof e==`number`&&Number.isFinite(e)}isBoolean(e){return typeof e==`boolean`}hex(e,t){this.isString(t)?S(t)||this.err(e,`expected #rgb or #rrggbb hex color, got "${t}"`):this.err(e,`expected hex color string, got ${typeof t}`)}palette(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of[`primary`,`secondary`,`background`,`backgroundLight`,`text`,`textMuted`,`highlight`,`warning`])this.hex(`${e}.${n}`,t[n])}colorScheme(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}this.hex(`${e}.bg`,t.bg),this.hex(`${e}.text`,t.text),this.hex(`${e}.accent`,t.accent)}colorSchemes(e,t){if(!this.isObject(t)){this.err(e,`expected object map`);return}for(let n of Object.keys(t))this.colorScheme(`${e}.${n}`,t[n])}fontFamily(e,t){if(!this.isObject(t)){this.err(e,`expected FontFamily object ({ stackId } or { custom })`);return}if(`stackId`in t){(!this.isString(t.stackId)||t.stackId.length===0)&&this.err(`${e}.stackId`,`expected non-empty string`);return}if(`custom`in t){let n=t.custom;if(!this.isObject(n)){this.err(`${e}.custom`,`expected { name, fallback } object`);return}!this.isString(n.name)||n.name.length===0?this.err(`${e}.custom.name`,`expected non-empty string`):(/[<>{};]/.test(n.name)||[...n.name].some(e=>{let t=e.codePointAt(0);return t<32||t===127}))&&this.err(`${e}.custom.name`,`font name contains control characters or CSS/HTML delimiters`),(!this.isString(n.fallback)||!Te.has(n.fallback))&&this.err(`${e}.custom.fallback`,`expected one of: serif, sans-serif, monospace, system-ui`);return}this.err(e,`expected { stackId } or { custom: { name, fallback } }`)}typography(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}this.fontFamily(`${e}.bodyFont`,t.bodyFont),this.fontFamily(`${e}.titleFont`,t.titleFont),t.monoFont!==void 0&&this.fontFamily(`${e}.monoFont`,t.monoFont);for(let n of[`titleScale`,`bodyScale`,`lineHeight`,`titleLineHeight`])t[n]!==void 0&&!this.isNumber(t[n])&&this.err(`${e}.${n}`,`expected number, got ${typeof t[n]}`);t.titleWeight!==void 0&&(!this.isString(t.titleWeight)||!Me.has(t.titleWeight))&&this.err(`${e}.titleWeight`,`expected "normal" or "bold"`)}style(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.borderRadius!==void 0&&!this.isNumber(t.borderRadius)&&this.err(`${e}.borderRadius`,`expected number`),t.textShadow!==void 0&&!this.isBoolean(t.textShadow)&&this.err(`${e}.textShadow`,`expected boolean`);for(let n of[`overlayOpacity`,`animationSpeed`])t[n]!==void 0&&!this.isNumber(t[n])&&this.err(`${e}.${n}`,`expected number`);t.blockPadding!==void 0&&!this.isString(t.blockPadding)&&this.err(`${e}.blockPadding`,`expected string (percentage e.g. "5%")`),t.imageTreatment!==void 0&&this.imageTreatment(`${e}.imageTreatment`,t.imageTreatment),t.pip!==void 0&&this.pip(`${e}.pip`,t.pip)}pip(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.cornerRadius!==void 0&&!this.isNumber(t.cornerRadius)&&!this.isString(t.cornerRadius)&&this.err(`${e}.cornerRadius`,`expected number or string`),t.border!==void 0&&t.border!==`none`&&!this.isObject(t.border)&&this.err(`${e}.border`,`expected 'none' or { width?, color? }`),t.shadow!==void 0&&!this.isBoolean(t.shadow)&&!this.isString(t.shadow)&&this.err(`${e}.shadow`,`expected boolean or string`)}imageTreatment(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}let n=[`none`,`mono`,`duotone`,`warm`,`cool`];(!this.isString(t.type)||!n.includes(t.type))&&this.err(`${e}.type`,`expected one of ${n.join(`|`)}`),t.strength!==void 0&&!this.isNumber(t.strength)&&this.err(`${e}.strength`,`expected number (0..1)`),t.color!==void 0&&this.hex(`${e}.color`,t.color)}renderStyle(e,n){if(!this.isObject(n)){this.err(e,`expected object`);return}(!this.isString(n.name)||n.name.length===0)&&this.err(`${e}.name`,`expected non-empty string`),n.ambientMotion!==void 0&&!this.isBoolean(n.ambientMotion)&&this.err(`${e}.ambientMotion`,`expected boolean`);for(let t of[`defaultTextAnimation`,`defaultImageAnimation`])n[t]!==void 0&&!this.isString(n[t])&&this.err(`${e}.${t}`,`expected animation type string`);if(n.defaultTransition!==void 0){let r=n.defaultTransition;this.isObject(r)?((!this.isString(r.type)||!t(r.type))&&this.err(`${e}.defaultTransition.type`,`expected valid transition type`),r.duration!==void 0&&!this.isNumber(r.duration)&&this.err(`${e}.defaultTransition.duration`,`expected number`)):this.err(`${e}.defaultTransition`,`expected object`)}if(n.layoutOverrides!==void 0&&!this.isObject(n.layoutOverrides)&&this.err(`${e}.layoutOverrides`,`expected object`),n.templateHints!==void 0)if(!this.isObject(n.templateHints))this.err(`${e}.templateHints`,`expected object map`);else for(let t of Object.keys(n.templateHints)){let r=n.templateHints[t];if(!this.isObject(r)){this.err(`${e}.templateHints.${t}`,`expected object`);continue}for(let n of Object.keys(r)){let i=typeof r[n];i!==`string`&&i!==`number`&&i!==`boolean`&&this.err(`${e}.templateHints.${t}.${n}`,`expected string|number|boolean, got ${i}`)}}}seedColors(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.primary===void 0?this.err(`${e}.primary`,`required when seedColors is present`):this.hex(`${e}.primary`,t.primary);for(let n of[`secondary`,`accent`,`background`,`text`])t[n]!==void 0&&this.hex(`${e}.${n}`,t[n])}persistentLayer(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}if(`template`in t){if(!this.isString(t.template)){this.err(`${e}.template`,`expected string`);return}let n=t.config;if(!this.isObject(n)){this.err(`${e}.config`,`expected object`);return}if(n.type!==t.template&&this.err(`${e}.config.type`,`expected "${t.template}", got "${String(n.type)}"`),t.template===`gradientBackground`&&n.preset!==void 0&&(!this.isString(n.preset)||!B.has(n.preset))&&this.err(`${e}.config.preset`,`expected one of: ${Array.from(B).join(`, `)}`),t.template===`gradientBackground`&&`gradient`in n&&this.err(`${e}.config.gradient`,"raw CSS gradient strings are not allowed in Theme JSON; use a `preset`"),t.template===`patternBackground`){let t=[`dots`,`grid`,`diagonal`,`noise`];(!this.isString(n.pattern)||!t.includes(n.pattern))&&this.err(`${e}.config.pattern`,`expected one of ${t.join(`|`)}`);for(let t of[`opacity`,`scale`])n[t]!==void 0&&!this.isNumber(n[t])&&this.err(`${e}.config.${t}`,`expected number`);n.color!==void 0&&this.hex(`${e}.config.color`,n.color)}if(t.template===`vignette`&&(n.strength!==void 0&&!this.isNumber(n.strength)&&this.err(`${e}.config.strength`,`expected number (0..1)`),n.color!==void 0&&this.hex(`${e}.config.color`,n.color)),t.template===`ambientGradient`){n.duration!==void 0&&!this.isNumber(n.duration)&&this.err(`${e}.config.duration`,`expected number (seconds)`);for(let t of[`from`,`to`])n[t]!==void 0&&this.hex(`${e}.config.${t}`,n[t])}}}persistentLayers(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of[`bottomLayers`,`topLayers`]){let r=t[n];if(r!==void 0){if(!Array.isArray(r)){this.err(`${e}.${n}`,`expected array`);continue}r.forEach((t,r)=>this.persistentLayer(`${e}.${n}[${r}]`,t))}}}scalarHints(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of Object.keys(t)){let r=typeof t[n];r!==`string`&&r!==`number`&&r!==`boolean`&&this.err(`${e}.${n}`,`expected string|number|boolean, got ${r}`)}}pageSectionOverride(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}t.kind!==void 0&&(!this.isString(t.kind)||!z.has(t.kind))&&this.err(`${e}.kind`,`expected one of: ${N.join(`, `)}`),t.variant!==void 0&&!this.isString(t.variant)&&this.err(`${e}.variant`,`expected string`),t.emphasis!==void 0&&(!this.isString(t.emphasis)||!De.has(t.emphasis))&&this.err(`${e}.emphasis`,`expected one of: ${I.join(`, `)}`),t.background!==void 0&&(!this.isString(t.background)||!Oe.has(t.background))&&this.err(`${e}.background`,`expected one of: ${L.join(`, `)}`),t.hints!==void 0&&this.scalarHints(`${e}.hints`,t.hints)}pageTokens(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}for(let n of[`contentMaxWidth`,`wideMaxWidth`,`cornerRadius`])this.isNumber(t[n])||this.err(`${e}.${n}`,`expected number`);for(let[n,r]of Object.entries(Ae))(!this.isString(t[n])||!r.has(t[n]))&&this.err(`${e}.${n}`,`expected one of: ${Array.from(r).join(`, `)}`);t.pattern!==void 0&&(!this.isString(t.pattern)||!F.includes(t.pattern))&&this.err(`${e}.pattern`,`expected one of: ${F.join(`, `)}`);let n=t.headingTreatment;if(!this.isObject(n)){this.err(`${e}.headingTreatment`,`expected object`);return}for(let[t,r]of Object.entries(je)){let i=n[t];if(i===void 0){r.required&&this.err(`${e}.headingTreatment.${t}`,`required`);continue}(!this.isString(i)||!r.values.has(i))&&this.err(`${e}.headingTreatment.${t}`,`expected one of: ${Array.from(r.values).join(`, `)}`)}}pageStyle(e,t){if(!this.isObject(t)){this.err(e,`expected object`);return}if((!this.isString(t.family)||!Ee.has(t.family))&&this.err(`${e}.family`,`expected one of: ${P.join(`, `)}`),t.tokens===void 0?this.err(`${e}.tokens`,`required`):this.pageTokens(`${e}.tokens`,t.tokens),t.sections!==void 0)if(!this.isObject(t.sections))this.err(`${e}.sections`,`expected object map`);else for(let n of Object.keys(t.sections)){if(!z.has(n)){this.err(`${e}.sections.${n}`,`unknown section kind`);continue}this.pageSectionOverride(`${e}.sections.${n}`,t.sections[n])}if(t.templates!==void 0)if(!this.isObject(t.templates))this.err(`${e}.templates`,`expected object map`);else for(let n of Object.keys(t.templates))this.pageSectionOverride(`${e}.templates.${n}`,t.templates[n]);if(t.accentRotation===void 0)this.err(`${e}.accentRotation`,`required`);else if(!this.isObject(t.accentRotation))this.err(`${e}.accentRotation`,`expected object`);else{let n=t.accentRotation;(!this.isString(n.strategy)||!ke.has(n.strategy))&&this.err(`${e}.accentRotation.strategy`,`expected one of: ${R.join(`, `)}`),n.schemes!==void 0&&(!Array.isArray(n.schemes)||n.schemes.some(e=>typeof e!=`string`))&&this.err(`${e}.accentRotation.schemes`,`expected array of strings`)}}};function V(e){let t=new Ne;return t.isObject(e)?(e.schemaVersion!==`1`&&t.err(`schemaVersion`,`expected "1", got "${String(e.schemaVersion)}"`),(!t.isString(e.id)||e.id.length===0)&&t.err(`id`,`expected non-empty string`),(!t.isString(e.name)||e.name.length===0)&&t.err(`name`,`expected non-empty string`),e.description!==void 0&&!t.isString(e.description)&&t.err(`description`,`expected string`),e.basedOn!==void 0&&!t.isString(e.basedOn)&&t.err(`basedOn`,`expected string`),e.seedColors!==void 0&&t.seedColors(`seedColors`,e.seedColors),e.colors===void 0?t.err(`colors`,`required`):t.palette(`colors`,e.colors),e.typography===void 0?t.err(`typography`,`required`):t.typography(`typography`,e.typography),e.style===void 0?t.err(`style`,`required`):t.style(`style`,e.style),e.renderStyle===void 0?t.err(`renderStyle`,`required`):t.renderStyle(`renderStyle`,e.renderStyle),e.colorSchemes===void 0?t.err(`colorSchemes`,`required`):t.colorSchemes(`colorSchemes`,e.colorSchemes),e.persistentLayers!==void 0&&t.persistentLayers(`persistentLayers`,e.persistentLayers),e.pageStyle!==void 0&&t.pageStyle(`pageStyle`,e.pageStyle),t.errors.length===0?{valid:!0,errors:[],theme:e}:{valid:!1,errors:t.errors}):{valid:!1,errors:[{path:``,message:`expected object`}]}}function H(e,t=`theme`){let n=V(e);if(!n.valid||!n.theme){let e=n.errors.slice(0,5).map(e=>` ${e.path||`<root>`}: ${e.message}`).join(`
|
|
2
2
|
`),r=n.errors.length>5?`
|
|
3
3
|
... and ${n.errors.length-5} more`:``;throw Error(`Invalid ${t}:
|
|
4
4
|
${e}${r}`)}return n.theme}var Pe=`squisq-custom-themes`;function U(e,t){let n={...e};for(let r of Object.keys(t)){let i=t[r],a=e[r];typeof i==`object`&&i&&!Array.isArray(i)&&typeof a==`object`&&a&&!Array.isArray(a)?n[r]=U(a,i):i!==void 0&&(n[r]=i)}return n}function Fe(e,t){let n=U(e,t);return!t.id&&n.id===e.id&&(n.id=`${e.id}-custom`),n.schemaVersion||=`1`,n}var Ie={id:`light`,background:`#ffffff`,backgroundLight:`#f5f5f5`,text:`#1a1a1a`,textMuted:`#666666`},Le={id:`dark`,background:`#1a202c`,backgroundLight:`#2d3748`,text:`#f0f0f0`,textMuted:`#a0aec0`};function Re(e,t){return{...e,colors:{...e.colors,background:t.background,backgroundLight:t.backgroundLight,text:t.text,textMuted:t.textMuted}}}var ze={standard:H({schemaVersion:`1`,id:`standard`,name:`Standard Light`,description:`Clean and safe — black-on-white, system fonts only, no external font dependencies. Default theme.`,colors:{primary:`#2563eb`,secondary:`#475569`,background:`#ffffff`,backgroundLight:`#f1f5f9`,text:`#0f172a`,textMuted:`#475569`,highlight:`#1d4ed8`,warning:`#dc2626`},typography:{bodyFont:{stackId:`system-sans`},titleFont:{stackId:`system-serif`},monoFont:{stackId:`system-mono`},titleWeight:`bold`},style:{textShadow:!1,overlayOpacity:.35,animationSpeed:1},renderStyle:{name:`standard`,defaultTextAnimation:`fadeIn`,ambientMotion:!1,defaultTransition:{type:`fade`,duration:.7}},colorSchemes:{blue:{bg:`#dbeafe`,text:`#1d4ed8`,accent:`#2563eb`},green:{bg:`#dcfce7`,text:`#166534`,accent:`#16a34a`},purple:{bg:`#ede9fe`,text:`#5b21b6`,accent:`#7c3aed`},red:{bg:`#fee2e2`,text:`#991b1b`,accent:`#dc2626`},orange:{bg:`#ffedd5`,text:`#9a3412`,accent:`#ea580c`},teal:{bg:`#ccfbf1`,text:`#115e59`,accent:`#0d9488`}},pageStyle:{family:`clean`,tokens:{contentMaxWidth:760,wideMaxWidth:1100,sectionSpacing:`comfortable`,cornerRadius:8,divider:`hairline`,backgroundRhythm:`alternate`,heroStyle:`stacked`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`none`},imageFraming:`rounded`,shadow:`soft`,quoteMark:`accent-bar`,numeralStyle:`plain`},accentRotation:{strategy:`cycle`}}},`standard.json`),"standard-dark":H({schemaVersion:`1`,id:`standard-dark`,name:`Standard Dark`,description:`Standard, dark variant. System fonts, dark navy background, light text.`,colors:{primary:`#3182ce`,secondary:`#4a5568`,background:`#1a202c`,backgroundLight:`#2d3748`,text:`#f7fafc`,textMuted:`#a0aec0`,highlight:`#4299e1`,warning:`#fc8181`},typography:{bodyFont:{stackId:`system-sans`},titleFont:{stackId:`system-serif`},monoFont:{stackId:`system-mono`},titleWeight:`bold`},style:{textShadow:!0,overlayOpacity:.45,animationSpeed:1},renderStyle:{name:`standard`,defaultTextAnimation:`fadeIn`,ambientMotion:!1,defaultTransition:{type:`fade`,duration:.7}},colorSchemes:{blue:{bg:`#1a365d`,text:`#63b3ed`,accent:`#90cdf4`},green:{bg:`#22543d`,text:`#9ae6b4`,accent:`#68d391`},purple:{bg:`#44337a`,text:`#d6bcfa`,accent:`#b794f4`},red:{bg:`#742a2a`,text:`#fc8181`,accent:`#feb2b2`},orange:{bg:`#744210`,text:`#fbd38d`,accent:`#f6ad55`},teal:{bg:`#234e52`,text:`#81e6d9`,accent:`#4fd1c5`}},persistentLayers:{bottomLayers:[{template:`gradientBackground`,config:{type:`gradientBackground`,preset:`dark-vignette`}}]},pageStyle:{family:`clean`,tokens:{contentMaxWidth:760,wideMaxWidth:1100,sectionSpacing:`comfortable`,cornerRadius:8,divider:`hairline`,backgroundRhythm:`tinted-panels`,heroStyle:`stacked`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`none`},imageFraming:`rounded`,shadow:`none`,quoteMark:`accent-bar`,numeralStyle:`oversized`},accentRotation:{strategy:`cycle`}}},`standard-dark.json`),documentary:H({schemaVersion:`1`,id:`documentary`,name:`Documentary`,description:`Classic dark cinematic look with elegant serif typography.`,colors:{primary:`#3d5a80`,secondary:`#63b3ed`,background:`#1a202c`,backgroundLight:`#2d3748`,text:`#ffffff`,textMuted:`#a0aec0`,highlight:`#63b3ed`,warning:`#fc8181`},typography:{bodyFont:{stackId:`source-serif`},titleFont:{stackId:`playfair`},titleWeight:`bold`},style:{textShadow:!0,overlayOpacity:.5,animationSpeed:1,imageTreatment:{type:`mono`,strength:.35}},renderStyle:{name:`documentary`,defaultTextAnimation:`fadeIn`,defaultImageAnimation:`slowZoom`,ambientMotion:!0,defaultTransition:{type:`fade`,duration:.8}},colorSchemes:{blue:{bg:`#22354d`,text:`#a8c3e0`,accent:`#7fa3c9`},green:{bg:`#26382e`,text:`#a9c6ae`,accent:`#82a88a`},purple:{bg:`#35304a`,text:`#beb3d6`,accent:`#9d8fc2`},red:{bg:`#45262a`,text:`#d9a2a2`,accent:`#c37f7c`},orange:{bg:`#453522`,text:`#d9bb90`,accent:`#c29a64`},teal:{bg:`#1f3a3d`,text:`#9cc4c4`,accent:`#6fa5a5`}},persistentLayers:{bottomLayers:[{template:`gradientBackground`,config:{type:`gradientBackground`,preset:`dark-vignette`}}],topLayers:[{template:`vignette`,config:{type:`vignette`,strength:.25}}]},pageStyle:{family:`documentary`,tokens:{contentMaxWidth:680,wideMaxWidth:1e3,sectionSpacing:`generous`,cornerRadius:2,divider:`thick-rule`,backgroundRhythm:`flat`,heroStyle:`letterbox`,headingTreatment:{eyebrow:`numbered`,scale:`display`,underline:`none`},imageFraming:`letterboxed`,shadow:`none`,quoteMark:`accent-bar`,numeralStyle:`boxed`},sections:{"quote-band":{variant:`editorial`}},accentRotation:{strategy:`primary-only`}}},`documentary.json`),minimalist:H({schemaVersion:`1`,id:`minimalist`,name:`Minimalist`,description:`Clean near-white background with sans-serif type and minimal animation.`,colors:{primary:`#2d3748`,secondary:`#4a5568`,background:`#f7fafc`,backgroundLight:`#edf2f7`,text:`#1a202c`,textMuted:`#718096`,highlight:`#3182ce`,warning:`#e53e3e`},typography:{bodyFont:{stackId:`inter`},titleFont:{stackId:`inter`},titleWeight:`bold`,lineHeight:1.6},style:{textShadow:!1,overlayOpacity:.3,animationSpeed:1.2,borderRadius:8},renderStyle:{name:`minimalist`,defaultTextAnimation:`fadeIn`,ambientMotion:!1,defaultTransition:{type:`fade`,duration:.6},templateHints:{title:{showAccentLine:!1}}},colorSchemes:{blue:{bg:`#ebf8ff`,text:`#2b6cb0`,accent:`#3182ce`},green:{bg:`#f0fff4`,text:`#276749`,accent:`#38a169`},purple:{bg:`#faf5ff`,text:`#553c9a`,accent:`#805ad5`},red:{bg:`#fff5f5`,text:`#c53030`,accent:`#e53e3e`},orange:{bg:`#fffaf0`,text:`#c05621`,accent:`#dd6b20`},teal:{bg:`#e6fffa`,text:`#285e61`,accent:`#319795`}},pageStyle:{family:`clean`,tokens:{contentMaxWidth:720,wideMaxWidth:1e3,sectionSpacing:`generous`,cornerRadius:8,divider:`gap-only`,backgroundRhythm:`flat`,heroStyle:`stacked`,headingTreatment:{eyebrow:`none`,scale:`display`,underline:`none`},imageFraming:`flush`,shadow:`none`,quoteMark:`none`,numeralStyle:`plain`},sections:{"quote-band":{emphasis:`quiet`}},accentRotation:{strategy:`primary-only`}}},`minimalist.json`),bold:H({schemaVersion:`1`,id:`bold`,name:`Bold`,description:`High-contrast black with vivid accents and dramatic animations.`,colors:{primary:`#e53e3e`,secondary:`#ed8936`,background:`#000000`,backgroundLight:`#1a1a1a`,text:`#ffffff`,textMuted:`#cbd5e0`,highlight:`#f6e05e`,warning:`#fc8181`},typography:{bodyFont:{stackId:`roboto`},titleFont:{stackId:`oswald`},titleWeight:`bold`,titleScale:1.15,bodyScale:1,titleLineHeight:1.1},style:{textShadow:!0,overlayOpacity:.6,animationSpeed:.8},renderStyle:{name:`bold`,defaultTextAnimation:`zoomIn`,defaultImageAnimation:`slowZoom`,ambientMotion:!0,defaultTransition:{type:`dissolve`,duration:.5},templateHints:{statHighlight:{entrance:`dramatic`},fullBleedQuote:{entrance:`dramatic`}}},colorSchemes:{blue:{bg:`#1a202c`,text:`#63b3ed`,accent:`#90cdf4`},green:{bg:`#1a202c`,text:`#48bb78`,accent:`#68d391`},purple:{bg:`#1a202c`,text:`#b794f4`,accent:`#d6bcfa`},red:{bg:`#1a202c`,text:`#fc8181`,accent:`#feb2b2`},orange:{bg:`#1a202c`,text:`#f6ad55`,accent:`#fbd38d`},teal:{bg:`#1a202c`,text:`#4fd1c5`,accent:`#81e6d9`}},pageStyle:{family:`brutalist`,tokens:{contentMaxWidth:760,wideMaxWidth:1200,sectionSpacing:`compact`,cornerRadius:0,divider:`thick-rule`,backgroundRhythm:`accent-bands`,heroStyle:`oversized-type`,headingTreatment:{eyebrow:`kicker`,scale:`oversized`,case:`uppercase`},imageFraming:`bordered`,shadow:`heavy`,quoteMark:`none`,numeralStyle:`oversized`},sections:{"quote-band":{background:`accent`}},accentRotation:{strategy:`cycle`}}},`bold.json`),"morning-light":H({schemaVersion:`1`,id:`morning-light`,name:`Morning Light`,description:`Warm light background with dark text and gentle serif typography.`,colors:{primary:`#744210`,secondary:`#975a16`,background:`#faf8f5`,backgroundLight:`#f5f0eb`,text:`#2d3748`,textMuted:`#718096`,highlight:`#dd6b20`,warning:`#c53030`},typography:{bodyFont:{stackId:`lora`},titleFont:{stackId:`merriweather`},titleWeight:`bold`,lineHeight:1.7},style:{textShadow:!1,overlayOpacity:.35,animationSpeed:1.1,borderRadius:4},renderStyle:{name:`morning-light`,defaultTextAnimation:`fadeIn`,ambientMotion:!1,defaultTransition:{type:`fade`,duration:1}},colorSchemes:{blue:{bg:`#ebf8ff`,text:`#2c5282`,accent:`#4299e1`},green:{bg:`#f0fff4`,text:`#22543d`,accent:`#48bb78`},purple:{bg:`#faf5ff`,text:`#44337a`,accent:`#9f7aea`},red:{bg:`#fff5f5`,text:`#9b2c2c`,accent:`#fc8181`},orange:{bg:`#fffaf0`,text:`#744210`,accent:`#ed8936`},teal:{bg:`#e6fffa`,text:`#234e52`,accent:`#38b2ac`}},persistentLayers:{topLayers:[{template:`patternBackground`,config:{type:`patternBackground`,pattern:`noise`,opacity:.03}}]},pageStyle:{family:`soft`,tokens:{contentMaxWidth:760,wideMaxWidth:1100,sectionSpacing:`comfortable`,cornerRadius:14,divider:`dotted`,backgroundRhythm:`tinted-panels`,heroStyle:`split`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`none`},imageFraming:`rounded`,shadow:`soft`,quoteMark:`oversized-glyph`,numeralStyle:`plain`,pattern:`noise`},sections:{callout:{hints:{framing:`circle-accent`}}},accentRotation:{strategy:`alternate-two`}}},`morning-light.json`),"tech-dark":H({schemaVersion:`1`,id:`tech-dark`,name:`Tech Dark`,description:`True black with neon cyan/green accents and monospace titles.`,colors:{primary:`#00e5ff`,secondary:`#00e676`,background:`#0a0a0a`,backgroundLight:`#1a1a2e`,text:`#e0e0e0`,textMuted:`#9e9e9e`,highlight:`#00e5ff`,warning:`#ff5252`},typography:{bodyFont:{stackId:`ibm-plex-sans`},titleFont:{stackId:`jetbrains-mono`},monoFont:{stackId:`jetbrains-mono`},titleWeight:`bold`,titleScale:.9,lineHeight:1.5},style:{textShadow:!0,overlayOpacity:.55,animationSpeed:.9,borderRadius:2,imageTreatment:{type:`cool`,strength:.45}},renderStyle:{name:`tech-dark`,defaultTextAnimation:`typewriter`,defaultImageAnimation:`slowZoom`,ambientMotion:!0,defaultTransition:{type:`dissolve`,duration:.4},templateHints:{statHighlight:{entrance:`dramatic`}}},colorSchemes:{blue:{bg:`#0d1b2a`,text:`#00b0ff`,accent:`#40c4ff`},green:{bg:`#0d1b0d`,text:`#00e676`,accent:`#69f0ae`},purple:{bg:`#1a0d2e`,text:`#d500f9`,accent:`#ea80fc`},red:{bg:`#2e0d0d`,text:`#ff5252`,accent:`#ff8a80`},orange:{bg:`#2e1a0d`,text:`#ff9100`,accent:`#ffab40`},teal:{bg:`#0d2e2e`,text:`#1de9b6`,accent:`#64ffda`}},persistentLayers:{topLayers:[{template:`patternBackground`,config:{type:`patternBackground`,pattern:`grid`,color:`#00e5ff`,opacity:.04,scale:1.5}}]},pageStyle:{family:`terminal`,tokens:{contentMaxWidth:820,wideMaxWidth:1200,sectionSpacing:`compact`,cornerRadius:2,divider:`hairline`,backgroundRhythm:`tinted-panels`,heroStyle:`stacked`,headingTreatment:{eyebrow:`mono-tag`,scale:`regular`,underline:`none`},imageFraming:`bordered`,shadow:`none`,quoteMark:`none`,numeralStyle:`mono`,pattern:`grid`},templates:{diagram:{hints:{frame:`terminal`}},tree:{hints:{frame:`terminal`}},timeline:{hints:{frame:`terminal`}}},accentRotation:{strategy:`primary-only`}}},`tech-dark.json`),magazine:H({schemaVersion:`1`,id:`magazine`,name:`Magazine`,description:`Rich editorial palette with mixed serif/sans typography and slide transitions.`,colors:{primary:`#c53030`,secondary:`#2b6cb0`,background:`#1a202c`,backgroundLight:`#2d3748`,text:`#f7fafc`,textMuted:`#cbd5e0`,highlight:`#ed8936`,warning:`#fc8181`},typography:{bodyFont:{stackId:`dm-sans`},titleFont:{stackId:`dm-serif`},titleWeight:`bold`,titleScale:1.05,lineHeight:1.5},style:{textShadow:!0,overlayOpacity:.45,animationSpeed:1,borderRadius:6},renderStyle:{name:`magazine`,defaultTextAnimation:`fadeIn`,defaultImageAnimation:`slowZoom`,ambientMotion:!0,defaultTransition:{type:`slideLeft`,duration:.7}},colorSchemes:{blue:{bg:`#1d3a6e`,text:`#a3c9f5`,accent:`#4d9de0`},green:{bg:`#14532d`,text:`#86efac`,accent:`#22c55e`},purple:{bg:`#3b2a70`,text:`#c4b5fd`,accent:`#a78bfa`},red:{bg:`#7f1d1d`,text:`#fca5a5`,accent:`#f87171`},orange:{bg:`#7c2d12`,text:`#fdba74`,accent:`#f97316`},teal:{bg:`#134e4a`,text:`#5eead4`,accent:`#14b8a6`}},persistentLayers:{topLayers:[{template:`patternBackground`,config:{type:`patternBackground`,pattern:`diagonal`,color:`#f7fafc`,opacity:.03,scale:1.2}}]},pageStyle:{family:`editorial`,tokens:{contentMaxWidth:720,wideMaxWidth:1240,sectionSpacing:`comfortable`,cornerRadius:6,divider:`double-rule`,backgroundRhythm:`flat`,heroStyle:`split`,headingTreatment:{eyebrow:`kicker`,scale:`display`,underline:`none`},imageFraming:`flush`,shadow:`none`,quoteMark:`oversized-glyph`,numeralStyle:`oversized`,pattern:`diagonal`},sections:{prose:{hints:{dropCap:!0}},"feature-split":{hints:{alternate:!0}}},accentRotation:{strategy:`alternate-two`}}},`magazine.json`),cinematic:H({schemaVersion:`1`,id:`cinematic`,name:`Cinematic`,description:`Ultra-dark with moody gradients, gold accents, and slow dissolve transitions.`,colors:{primary:`#d69e2e`,secondary:`#b7791f`,background:`#0a0f1a`,backgroundLight:`#1a202c`,text:`#f7fafc`,textMuted:`#a0aec0`,highlight:`#ecc94b`,warning:`#fc8181`},typography:{bodyFont:{stackId:`crimson`},titleFont:{stackId:`cormorant`},titleWeight:`bold`,lineHeight:1.5,titleLineHeight:1.2},style:{textShadow:!0,overlayOpacity:.55,animationSpeed:1.2,imageTreatment:{type:`warm`,strength:.5}},renderStyle:{name:`cinematic`,defaultTextAnimation:`fadeIn`,defaultImageAnimation:`slowZoom`,ambientMotion:!0,defaultTransition:{type:`dissolve`,duration:1.2},templateHints:{title:{showAccentLine:!0}}},colorSchemes:{blue:{bg:`#0f1d33`,text:`#9db8dc`,accent:`#5d84b8`},green:{bg:`#10251c`,text:`#9ecfae`,accent:`#55a878`},purple:{bg:`#1f1433`,text:`#c3aede`,accent:`#8f74c0`},red:{bg:`#2e1114`,text:`#e0959a`,accent:`#c05f66`},orange:{bg:`#2e1d0b`,text:`#e3b978`,accent:`#d69e2e`},teal:{bg:`#0d2626`,text:`#93cfc7`,accent:`#4d9e94`}},persistentLayers:{bottomLayers:[{template:`gradientBackground`,config:{type:`gradientBackground`,preset:`radial-dark`}}],topLayers:[{template:`vignette`,config:{type:`vignette`,strength:.35}},{template:`patternBackground`,config:{type:`patternBackground`,pattern:`noise`,opacity:.05}}]},pageStyle:{family:`cinematic`,tokens:{contentMaxWidth:760,wideMaxWidth:1100,sectionSpacing:`generous`,cornerRadius:0,divider:`gap-only`,backgroundRhythm:`flat`,heroStyle:`full-bleed`,headingTreatment:{eyebrow:`kicker`,scale:`display`,case:`uppercase`},imageFraming:`letterboxed`,shadow:`none`,quoteMark:`none`,numeralStyle:`oversized`,pattern:`noise`},sections:{"quote-band":{hints:{vignette:!0}}},accentRotation:{strategy:`primary-only`}}},`cinematic.json`),"warm-earth":H({schemaVersion:`1`,id:`warm-earth`,name:`Warm Earth`,description:`Natural warm tones with earthy browns and terracotta accents.`,colors:{primary:`#9c4221`,secondary:`#c05621`,background:`#1c1410`,backgroundLight:`#2d241e`,text:`#faf5f0`,textMuted:`#c4a882`,highlight:`#dd6b20`,warning:`#e53e3e`},typography:{bodyFont:{stackId:`pt-serif`},titleFont:{stackId:`pt-serif`},titleWeight:`bold`,lineHeight:1.6},style:{textShadow:!0,overlayOpacity:.5,animationSpeed:1.1},renderStyle:{name:`warm-earth`,defaultTextAnimation:`fadeIn`,defaultImageAnimation:`panLeft`,ambientMotion:!0,defaultTransition:{type:`fade`,duration:.9}},colorSchemes:{blue:{bg:`#2a1f14`,text:`#90cdf4`,accent:`#63b3ed`},green:{bg:`#1e2a14`,text:`#9ae6b4`,accent:`#68d391`},purple:{bg:`#2a142a`,text:`#d6bcfa`,accent:`#b794f4`},red:{bg:`#2a1414`,text:`#fc8181`,accent:`#feb2b2`},orange:{bg:`#2a1e0a`,text:`#fbd38d`,accent:`#f6ad55`},teal:{bg:`#142a28`,text:`#81e6d9`,accent:`#4fd1c5`}},persistentLayers:{bottomLayers:[{template:`gradientBackground`,config:{type:`gradientBackground`,preset:`earth-tones`}}]},pageStyle:{family:`organic`,tokens:{contentMaxWidth:740,wideMaxWidth:1080,sectionSpacing:`comfortable`,cornerRadius:12,divider:`thick-rule`,backgroundRhythm:`tinted-panels`,heroStyle:`stacked`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`accent-bar`},imageFraming:`polaroid`,shadow:`soft`,quoteMark:`oversized-glyph`,numeralStyle:`boxed`},accentRotation:{strategy:`alternate-two`}}},`warm-earth.json`),gezellig:H({schemaVersion:`1`,id:`gezellig`,name:`Gezellig`,description:`Cozy, warm-hued palette with a subtle orange-tinted dark background, cream text, and sage and terracotta accents.`,colors:{primary:`#b0724c`,secondary:`#667f62`,background:`#1f1a17`,backgroundLight:`#2b2420`,text:`#f3ede0`,textMuted:`#a89b85`,highlight:`#c0875d`,warning:`#e07a6b`},typography:{bodyFont:{stackId:`system-sans-emoji`},titleFont:{stackId:`system-serif-emoji`},monoFont:{stackId:`system-mono`},titleWeight:`bold`,lineHeight:1.55},style:{textShadow:!1,overlayOpacity:.4,animationSpeed:1,borderRadius:6,imageTreatment:{type:`warm`,strength:.3}},renderStyle:{name:`gezellig`,defaultTextAnimation:`fadeIn`,defaultImageAnimation:`slowZoom`,ambientMotion:!1,defaultTransition:{type:`fade`,duration:.6}},colorSchemes:{terracotta:{bg:`#3d2620`,text:`#f3ede0`,accent:`#c0875d`},sage:{bg:`#28332a`,text:`#e3ead9`,accent:`#8aa589`},amber:{bg:`#3d2e17`,text:`#fbe3a8`,accent:`#d4a149`},plum:{bg:`#2e1f2a`,text:`#e8d4e0`,accent:`#b088a5`},ink:{bg:`#1a1f26`,text:`#d5dde8`,accent:`#7b8fa8`},cream:{bg:`#f3ede0`,text:`#2b2420`,accent:`#b0724c`}},persistentLayers:{topLayers:[{template:`patternBackground`,config:{type:`patternBackground`,pattern:`noise`,opacity:.04}}]},pageStyle:{family:`soft`,tokens:{contentMaxWidth:740,wideMaxWidth:1060,sectionSpacing:`comfortable`,cornerRadius:16,divider:`dotted`,backgroundRhythm:`tinted-panels`,heroStyle:`stacked`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,case:`none`},imageFraming:`circle-accent`,shadow:`soft`,quoteMark:`oversized-glyph`,numeralStyle:`plain`,pattern:`noise`},sections:{"quote-band":{background:`alternate`}},accentRotation:{strategy:`alternate-two`}}},`gezellig.json`)},W=Object.freeze(Object.fromEntries(Object.entries(ze).map(([t,n])=>[t,e(n)]))),G=W.standard;function K(e,t){return(e?t?.get(e):void 0)||(e&&e in W?W[e]:G)}function q(e){return Array.from(new Set([...Object.keys(W),...e?.list().map(e=>e.id)??[]]))}function Be(e){return q(e).map(t=>{let n=K(t,e);return{id:t,name:n.name,description:n.description}})}var J=[{id:`system-sans`,label:`System Sans`,family:`system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`,kind:`sans`},{id:`system-serif`,label:`System Serif`,family:`Georgia, "Times New Roman", serif`,kind:`serif`},{id:`system-mono`,label:`System Mono`,family:`Consolas, "Courier New", monospace`,kind:`mono`},{id:`inter`,label:`Inter`,family:`"Inter", "Segoe UI", Roboto, sans-serif`,kind:`sans`,googleFontFamily:`Inter`},{id:`ibm-plex-sans`,label:`IBM Plex Sans`,family:`"IBM Plex Sans", "Segoe UI", Roboto, sans-serif`,kind:`sans`,googleFontFamily:`IBM Plex Sans`},{id:`roboto`,label:`Roboto`,family:`"Roboto", "Segoe UI", Arial, sans-serif`,kind:`sans`,googleFontFamily:`Roboto`},{id:`dm-sans`,label:`DM Sans`,family:`"DM Sans", "Segoe UI", Roboto, sans-serif`,kind:`sans`,googleFontFamily:`DM Sans`},{id:`oswald`,label:`Oswald`,family:`"Oswald", "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", sans-serif`,kind:`display`,googleFontFamily:`Oswald`},{id:`playfair`,label:`Playfair Display`,family:`"Playfair Display", Georgia, serif`,kind:`serif`,googleFontFamily:`Playfair Display`},{id:`source-serif`,label:`Source Serif`,family:`"Source Serif 4", "PT Serif", Georgia, serif`,kind:`serif`,googleFontFamily:`Source Serif 4`},{id:`merriweather`,label:`Merriweather`,family:`"Merriweather", Georgia, serif`,kind:`serif`,googleFontFamily:`Merriweather`},{id:`lora`,label:`Lora`,family:`"Lora", "Merriweather", Georgia, serif`,kind:`serif`,googleFontFamily:`Lora`},{id:`pt-serif`,label:`PT Serif`,family:`"PT Serif", Georgia, serif`,kind:`serif`,googleFontFamily:`PT Serif`},{id:`crimson`,label:`Crimson Text`,family:`"Crimson Text", Georgia, serif`,kind:`serif`,googleFontFamily:`Crimson Text`},{id:`cormorant`,label:`Cormorant Garamond`,family:`"Cormorant Garamond", Garamond, Georgia, serif`,kind:`serif`,googleFontFamily:`Cormorant Garamond`},{id:`dm-serif`,label:`DM Serif Display`,family:`"DM Serif Display", Georgia, serif`,kind:`display`,googleFontFamily:`DM Serif Display`},{id:`jetbrains-mono`,label:`JetBrains Mono`,family:`"JetBrains Mono", "Fira Code", Consolas, monospace`,kind:`mono`,googleFontFamily:`JetBrains Mono`},{id:`system-sans-emoji`,label:`System Sans + Emoji`,family:`system-ui, -apple-system, "Segoe UI", Roboto, "OpenMoji Color", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif`,kind:`sans`},{id:`system-serif-emoji`,label:`System Serif + Emoji`,family:`Georgia, "Times New Roman", "OpenMoji Color", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", serif`,kind:`serif`}],Y=Object.fromEntries(J.map(e=>[e.id,e])),Ve={sans:`system-ui, sans-serif`,serif:`Georgia, serif`,mono:`Consolas, monospace`,display:`"Arial Narrow", "Helvetica Neue", Arial, sans-serif`};function He(e,t){if(!e)return t;if(typeof e==`string`)return e;if(`stackId`in e){let n=Y[e.stackId];return n?n.family:t}if(`custom`in e){let{name:t,fallback:n}=e.custom,r=n===`system-ui`?`system-ui, sans-serif`:n===`serif`?`Georgia, serif`:n===`monospace`?`Consolas, monospace`:`system-ui, sans-serif`;return`${`"${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/[\n\r\f]/g,e=>`\\${e.codePointAt(0).toString(16)} `).replace(/</g,`\\3c `)}"`}, ${r}`}return t}function Ue(e){let t=new Set;for(let n of e)if(!(!n||typeof n==`string`)&&`stackId`in n){let e=Y[n.stackId];e?.googleFontFamily&&t.add(e.googleFontFamily)}return t.size===0?null:`https://fonts.googleapis.com/css2?${Array.from(t).sort().map(e=>`family=${encodeURIComponent(e).replace(/%20/g,`+`)}:wght@400;700`).join(`&`)}&display=swap`}var We=Ve;function X(e){return e.trim().replace(/^["']+|["']+$/g,``).replace(/\s+/g,` `).toLowerCase()}var Ge=(()=>{let e={};for(let t of J)e[X(t.label)]=t.id,t.googleFontFamily&&(e[X(t.googleFontFamily)]=t.id);return Object.assign(e,{playfair:`playfair`,"source serif":`source-serif`,"source serif pro":`source-serif`,"crimson pro":`crimson`,cormorant:`cormorant`,georgia:`system-serif`,"times new roman":`system-serif`,times:`system-serif`,consolas:`system-mono`,"courier new":`system-mono`,courier:`system-mono`,"segoe ui":`system-sans`,"system-ui":`system-sans`}),e})(),Ke=/\b(mono|monospace|consolas|courier|menlo|inconsolata|cascadia|fira code|source code|code)\b/,qe=/\b(georgia|times|garamond|cambria|caslon|baskerville|bodoni|didot|palatino|book antiqua|goudy|minion|charter|constantia|century schoolbook|antiqua|roman)\b/;function Je(e){let t=X(e);return Ke.test(t)?`monospace`:t.includes(`serif`)&&!t.includes(`sans`)||qe.test(t)?`serif`:`sans-serif`}function Ye(e){let t=X(e);if(!t)return{stackId:`system-sans`};let n=Ge[t];return n?{stackId:n}:{custom:{name:e.trim().replace(/^["']+|["']+$/g,``),fallback:Je(e)}}}function Z(e,t=[]){for(let n of e)t.push(n),n.children&&n.children.length>0&&Z(n.children,t);return t}function Q(e){return e.clipEnd==null?null:Math.max(0,e.clipEnd-(e.clipStart??0))}function $(e,t){if(e.clipEnd!=null||e.lockToBlock===!0)return null;let n=t?.intrinsicDuration?.(e);if(n==null||!Number.isFinite(n)||n<=0)return null;let r=n-(e.clipStart??0);return r>0?r:null}function Xe(e){let t=Z(e.blocks).reduce((e,t)=>Math.max(e,t.startTime+t.duration),0);return Math.max(e.duration??0,t)}function Ze(e,t){let n=[],r=Xe(e);for(let r of Z(e.blocks)){let e=r.startTime+r.duration;for(let i of r.media??[]){let a=r.startTime+i.startAt,o=Q(i),s;s=i.spillover?o==null?e:a+o:o==null?e:Math.min(a+o,e);let c=$(i,t);c!=null&&(s=Math.min(s,a+c)),n.push({id:i.id,src:i.src,kind:i.kind,...i.placement?{placement:i.placement}:{},...i.pipSize?{pipSize:i.pipSize}:{},...i.pipShape?{pipShape:i.pipShape}:{},...i.pipPosition?{pipPosition:i.pipPosition}:{},...i.lockToBlock==null?{}:{lockToBlock:i.lockToBlock},absoluteStart:a,absoluteEnd:Math.max(a,s),sourceIn:i.clipStart??0,anchor:`block`,blockId:r.id,...i.sourceLine==null?{}:{sourceLine:i.sourceLine}})}}for(let i of e.documentMedia??[]){let e=i.startAt,a=Q(i),o=a==null?r:e+a,s=$(i,t);s!=null&&(o=Math.min(o,e+s)),n.push({id:i.id,src:i.src,kind:i.kind,...i.placement?{placement:i.placement}:{},...i.pipSize?{pipSize:i.pipSize}:{},...i.pipShape?{pipShape:i.pipShape}:{},...i.pipPosition?{pipPosition:i.pipPosition}:{},...i.lockToBlock==null?{}:{lockToBlock:i.lockToBlock},absoluteStart:e,absoluteEnd:Math.max(e,o),sourceIn:i.clipStart??0,anchor:`document`,...i.sourceLine==null?{}:{sourceLine:i.sourceLine}})}return n}function Qe(e,t){let n=Xe(e),r=Ze(e,t).reduce((e,t)=>Math.max(e,t.absoluteEnd),0);return Math.max(n,r)}var $e={standard:`clean`,minimalist:`clean`,documentary:`documentary`,magazine:`editorial`,bold:`brutalist`,"tech-dark":`terminal`,cinematic:`cinematic`,"warm-earth":`organic`,"morning-light":`soft`,gezellig:`soft`},et={clean:{sectionSpacing:`comfortable`,divider:`hairline`,backgroundRhythm:`alternate`,heroStyle:`stacked`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`none`},quoteMark:`accent-bar`,numeralStyle:`plain`,accentStrategy:`cycle`},editorial:{sectionSpacing:`comfortable`,divider:`double-rule`,backgroundRhythm:`flat`,heroStyle:`split`,headingTreatment:{eyebrow:`kicker`,scale:`display`,underline:`none`},quoteMark:`oversized-glyph`,numeralStyle:`oversized`,accentStrategy:`alternate-two`},brutalist:{sectionSpacing:`compact`,divider:`thick-rule`,backgroundRhythm:`accent-bands`,heroStyle:`oversized-type`,headingTreatment:{eyebrow:`kicker`,scale:`oversized`,case:`uppercase`},quoteMark:`none`,numeralStyle:`oversized`,accentStrategy:`cycle`},terminal:{sectionSpacing:`compact`,divider:`hairline`,backgroundRhythm:`tinted-panels`,heroStyle:`stacked`,headingTreatment:{eyebrow:`mono-tag`,scale:`regular`,underline:`none`},quoteMark:`none`,numeralStyle:`mono`,accentStrategy:`primary-only`},cinematic:{sectionSpacing:`generous`,divider:`gap-only`,backgroundRhythm:`flat`,heroStyle:`full-bleed`,headingTreatment:{eyebrow:`kicker`,scale:`display`,case:`uppercase`},quoteMark:`none`,numeralStyle:`oversized`,accentStrategy:`primary-only`},documentary:{sectionSpacing:`generous`,divider:`thick-rule`,backgroundRhythm:`flat`,heroStyle:`letterbox`,headingTreatment:{eyebrow:`numbered`,scale:`display`,underline:`none`},quoteMark:`accent-bar`,numeralStyle:`boxed`,accentStrategy:`primary-only`},organic:{sectionSpacing:`comfortable`,divider:`thick-rule`,backgroundRhythm:`tinted-panels`,heroStyle:`stacked`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`accent-bar`},quoteMark:`oversized-glyph`,numeralStyle:`boxed`,accentStrategy:`alternate-two`},soft:{sectionSpacing:`comfortable`,divider:`dotted`,backgroundRhythm:`tinted-panels`,heroStyle:`split`,headingTreatment:{eyebrow:`kicker`,scale:`regular`,underline:`none`},quoteMark:`oversized-glyph`,numeralStyle:`plain`,accentStrategy:`alternate-two`}};function tt(e){let t=[...e.persistentLayers?.bottomLayers??[],...e.persistentLayers?.topLayers??[]];for(let e of t)if(typeof e==`object`&&e&&`template`in e&&e.template===`patternBackground`){let t=e.config?.pattern;if(t===`dots`||t===`grid`||t===`diagonal`||t===`noise`)return t}}function nt(e){let t=$e[e.renderStyle?.name??``]??`clean`,n=et[t],r=e.style?.borderRadius??6,i=e.style?.imageTreatment?.type,a=i===`mono`||i===`duotone`?`letterboxed`:r>0?`rounded`:`flush`,o={contentMaxWidth:760,wideMaxWidth:1100,sectionSpacing:n.sectionSpacing,cornerRadius:r,divider:n.divider,backgroundRhythm:n.backgroundRhythm,heroStyle:n.heroStyle,headingTreatment:{...n.headingTreatment},imageFraming:a,shadow:e.style?.textShadow?`soft`:`none`,quoteMark:n.quoteMark,numeralStyle:n.numeralStyle},s=tt(e);return s&&(o.pattern=s),{family:t,tokens:o,accentRotation:{strategy:n.accentStrategy}}}export{b as A,A as C,j as D,de as E,ue as M,He as O,Ye as S,ce as T,q as _,Le as a,oe as b,se as c,Re as d,H as f,fe as g,Fe as h,J as i,V as j,K as k,Pe as l,M as m,Qe as n,G as o,Ue as p,Ze as r,We as s,nt as t,Ie as u,Be as v,k as w,S as x,le as y};
|