@caelo-cms/provisioning 0.12.18 → 0.12.20

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.
Files changed (35) hide show
  1. package/dist/agent-db.js +1907 -1175
  2. package/dist/infra-contract.d.ts +1 -1
  3. package/dist/infra-contract.d.ts.map +1 -1
  4. package/dist/infra-contract.js +10 -1
  5. package/dist/infra-contract.js.map +1 -1
  6. package/dist/reporting-job-catalog.d.ts +25 -2
  7. package/dist/reporting-job-catalog.d.ts.map +1 -1
  8. package/dist/reporting-job-catalog.js +19 -0
  9. package/dist/reporting-job-catalog.js.map +1 -1
  10. package/dist/reporting-job-setup.d.ts.map +1 -1
  11. package/dist/reporting-job-setup.js +41 -35
  12. package/dist/reporting-job-setup.js.map +1 -1
  13. package/dist/stack-contract.d.ts +13 -10
  14. package/dist/stack-contract.d.ts.map +1 -1
  15. package/dist/stack-contract.js +12 -9
  16. package/dist/stack-contract.js.map +1 -1
  17. package/dist/upgrade/admin-image-jobs.d.ts.map +1 -1
  18. package/dist/upgrade/admin-image-jobs.js +10 -6
  19. package/dist/upgrade/admin-image-jobs.js.map +1 -1
  20. package/dist/wizards/gcp-cost.d.ts.map +1 -1
  21. package/dist/wizards/gcp-cost.js +10 -2
  22. package/dist/wizards/gcp-cost.js.map +1 -1
  23. package/package.json +2 -2
  24. package/src/admin-memory.test.ts +34 -28
  25. package/src/infra-contract.test.ts +4 -3
  26. package/src/infra-contract.ts +10 -1
  27. package/src/reporting-job-catalog.test.ts +12 -3
  28. package/src/reporting-job-catalog.ts +51 -2
  29. package/src/reporting-job-setup.test.ts +27 -0
  30. package/src/reporting-job-setup.ts +40 -34
  31. package/src/stack-contract.test.ts +8 -0
  32. package/src/stack-contract.ts +13 -10
  33. package/src/stack-converge.test.ts +1 -1
  34. package/src/upgrade/admin-image-jobs.ts +14 -6
  35. package/src/wizards/gcp-cost.ts +11 -2
package/dist/agent-db.js CHANGED
@@ -7361,6 +7361,9 @@ function pathOfEmbeddedUrl(url) {
7361
7361
  }
7362
7362
  }
7363
7363
 
7364
+ // ../shared/src/json-ld.ts
7365
+ var NODE_KEYWORDS = new Set(["@type", "@id"]);
7366
+
7364
7367
  // ../shared/src/search-feed.ts
7365
7368
  var BUILD_CHANGE_KINDS = ["baseline", "added", "changed", "moved", "removed"];
7366
7369
  var pageChangeSchema = object({
@@ -7386,7 +7389,28 @@ var ROBOTS_MAX_GROUPS = 20;
7386
7389
  var ROBOTS_MAX_USER_AGENTS = 10;
7387
7390
  var ROBOTS_MAX_PATHS = 50;
7388
7391
  var ROBOTS_PATH_MAX = 512;
7389
- var userAgentSchema = string2().trim().regex(/^(\*|[A-Za-z0-9_-]{1,64})$/, "a user agent is `*` or a crawler's product token (letters, digits, `_` and `-`, e.g. `Googlebot`, `GPTBot`)");
7392
+ var ROBOTS_USAGE_PREFERENCE_TOKENS = ["__usage_ai-training"];
7393
+ function isUsagePreferenceToken(agent) {
7394
+ return ROBOTS_USAGE_PREFERENCE_TOKENS.includes(agent);
7395
+ }
7396
+ var userAgentSchema = string2().trim().regex(/^(\*|[A-Za-z0-9_-]{1,64})$/, "a user agent is `*` or a crawler's product token (letters, digits, `_` and `-`, e.g. `Googlebot`, `GPTBot`)").transform((agent) => {
7397
+ const lower = agent.toLowerCase();
7398
+ return ROBOTS_USAGE_PREFERENCE_TOKENS.find((t) => t === lower) ?? agent;
7399
+ }).superRefine((agent, c) => {
7400
+ if (agent.startsWith("__") && !isUsagePreferenceToken(agent)) {
7401
+ c.addIssue({
7402
+ code: "custom",
7403
+ message: `\`${agent}\` is no crawler and no usage preference: the \`__usage_\` names are the IETF preference tokens, and the only one is ${ROBOTS_USAGE_PREFERENCE_TOKENS.map((t) => `\`${t}\``).join(", ")}`
7404
+ });
7405
+ }
7406
+ });
7407
+ var robotsContentSignalSchema = object({
7408
+ search: boolean2().optional(),
7409
+ aiInput: boolean2().optional(),
7410
+ aiTrain: boolean2().optional()
7411
+ }).strict().refine((s) => s.search !== undefined || s.aiInput !== undefined || s.aiTrain !== undefined, {
7412
+ message: "a Content-Signal says at least one of `search`, `aiInput` (ai-input) and `aiTrain` (ai-train)"
7413
+ });
7390
7414
  function pathProblem(path) {
7391
7415
  if (path.charAt(0) !== "/")
7392
7416
  return "starts with `/` (a path of this site)";
@@ -7411,12 +7435,13 @@ var pathSchema = string2().min(1).max(ROBOTS_PATH_MAX).superRefine((path, c) =>
7411
7435
  var robotsRuleGroupSchema = object({
7412
7436
  userAgents: array(userAgentSchema).min(1).max(ROBOTS_MAX_USER_AGENTS),
7413
7437
  allow: array(pathSchema).max(ROBOTS_MAX_PATHS).default([]),
7414
- disallow: array(pathSchema).max(ROBOTS_MAX_PATHS).default([])
7438
+ disallow: array(pathSchema).max(ROBOTS_MAX_PATHS).default([]),
7439
+ contentSignal: robotsContentSignalSchema.optional()
7415
7440
  }).strict().superRefine((g, c) => {
7416
7441
  if (g.allow.length + g.disallow.length === 0) {
7417
7442
  c.addIssue({
7418
7443
  code: "custom",
7419
- message: "a robots group lists at least one allow or disallow path"
7444
+ message: 'a robots group lists at least one allow or disallow path (a group with only a Content-Signal takes `allow: ["/"]`)'
7420
7445
  });
7421
7446
  }
7422
7447
  if (g.userAgents.includes("*") && g.userAgents.length > 1) {
@@ -7425,6 +7450,19 @@ var robotsRuleGroupSchema = object({
7425
7450
  message: "`*` stands alone in its group: a crawler follows only the most specific group that names it, so give a named crawler a group of its own"
7426
7451
  });
7427
7452
  }
7453
+ const preference = g.userAgents.find(isUsagePreferenceToken);
7454
+ if (preference && g.userAgents.length > 1) {
7455
+ c.addIssue({
7456
+ code: "custom",
7457
+ message: `\`${preference}\` stands alone in its group: it states a usage preference, and a crawler named next to it would read its paths as where it may crawl`
7458
+ });
7459
+ }
7460
+ if (preference && g.contentSignal) {
7461
+ c.addIssue({
7462
+ code: "custom",
7463
+ message: `the \`${preference}\` group takes no Content-Signal: its Allow and Disallow paths are the preference`
7464
+ });
7465
+ }
7428
7466
  });
7429
7467
  var robotsRulesSchema = array(robotsRuleGroupSchema).max(ROBOTS_MAX_GROUPS).superRefine((groups, c) => {
7430
7468
  const seen = new Set;
@@ -8346,1033 +8384,154 @@ var JOURNALED_TABLES = {
8346
8384
  plugin: "plugin_id"
8347
8385
  })
8348
8386
  };
8349
- // ../shared/src/css-scope-scan.ts
8350
- var GROUPING_AT_RULES = new Set(["media", "supports", "layer", "container", "document"]);
8351
- // ../shared/src/database-tls.ts
8352
- var DATABASE_CA_DIR = "/etc/caelo/db-ca";
8353
- var CLOUD_SQL_CA_BUNDLE = `${DATABASE_CA_DIR}/cloudsql-global.pem`;
8354
- var AWS_RDS_CA_BUNDLE = `${DATABASE_CA_DIR}/aws-rds-global.pem`;
8355
- var SELF_HOSTED_CA_FILE = `${DATABASE_CA_DIR}/self-hosted-ca.pem`;
8356
- // ../shared/src/postgres-keywords.ts
8357
- var POSTGRES_KEYWORDS_NEEDING_QUOTES = new Set([
8358
- "all",
8359
- "analyse",
8360
- "analyze",
8361
- "and",
8362
- "any",
8363
- "array",
8364
- "as",
8365
- "asc",
8366
- "asymmetric",
8367
- "authorization",
8368
- "between",
8369
- "bigint",
8370
- "binary",
8371
- "bit",
8372
- "boolean",
8373
- "both",
8374
- "case",
8375
- "cast",
8376
- "char",
8377
- "character",
8378
- "check",
8379
- "coalesce",
8380
- "collate",
8381
- "collation",
8382
- "column",
8383
- "concurrently",
8384
- "constraint",
8385
- "create",
8386
- "cross",
8387
- "current_catalog",
8388
- "current_date",
8389
- "current_role",
8390
- "current_schema",
8391
- "current_time",
8392
- "current_timestamp",
8393
- "current_user",
8394
- "dec",
8395
- "decimal",
8396
- "default",
8397
- "deferrable",
8398
- "desc",
8399
- "distinct",
8400
- "do",
8401
- "else",
8402
- "end",
8403
- "except",
8404
- "exists",
8405
- "extract",
8406
- "false",
8407
- "fetch",
8408
- "float",
8409
- "for",
8410
- "foreign",
8411
- "freeze",
8412
- "from",
8413
- "full",
8414
- "grant",
8415
- "greatest",
8416
- "group",
8417
- "grouping",
8418
- "having",
8419
- "ilike",
8420
- "in",
8421
- "initially",
8422
- "inner",
8423
- "inout",
8424
- "int",
8425
- "integer",
8426
- "intersect",
8427
- "interval",
8428
- "into",
8429
- "is",
8430
- "isnull",
8431
- "join",
8432
- "json",
8433
- "json_array",
8434
- "json_arrayagg",
8435
- "json_exists",
8436
- "json_object",
8437
- "json_objectagg",
8438
- "json_query",
8439
- "json_scalar",
8440
- "json_serialize",
8441
- "json_table",
8442
- "json_value",
8443
- "lateral",
8444
- "leading",
8445
- "least",
8446
- "left",
8447
- "like",
8448
- "limit",
8449
- "localtime",
8450
- "localtimestamp",
8451
- "merge_action",
8452
- "national",
8453
- "natural",
8454
- "nchar",
8455
- "none",
8456
- "normalize",
8457
- "not",
8458
- "notnull",
8459
- "null",
8460
- "nullif",
8461
- "numeric",
8462
- "offset",
8463
- "on",
8464
- "only",
8465
- "or",
8466
- "order",
8467
- "out",
8468
- "outer",
8469
- "overlaps",
8470
- "overlay",
8471
- "placing",
8472
- "position",
8473
- "precision",
8474
- "primary",
8475
- "real",
8476
- "references",
8477
- "returning",
8478
- "right",
8479
- "row",
8480
- "select",
8481
- "session_user",
8482
- "setof",
8483
- "similar",
8484
- "smallint",
8485
- "some",
8486
- "substring",
8487
- "symmetric",
8488
- "system_user",
8489
- "table",
8490
- "tablesample",
8491
- "then",
8492
- "time",
8493
- "timestamp",
8494
- "to",
8495
- "trailing",
8496
- "treat",
8497
- "trim",
8498
- "true",
8499
- "union",
8500
- "unique",
8501
- "user",
8502
- "using",
8503
- "values",
8504
- "varchar",
8505
- "variadic",
8506
- "verbose",
8507
- "when",
8508
- "where",
8509
- "window",
8510
- "with",
8511
- "xmlattributes",
8512
- "xmlconcat",
8513
- "xmlelement",
8514
- "xmlexists",
8515
- "xmlforest",
8516
- "xmlnamespaces",
8517
- "xmlparse",
8518
- "xmlpi",
8519
- "xmlroot",
8520
- "xmlserialize",
8521
- "xmltable"
8387
+ // ../../node_modules/parse5/dist/common/unicode.js
8388
+ var UNDEFINED_CODE_POINTS = new Set([
8389
+ 65534,
8390
+ 65535,
8391
+ 131070,
8392
+ 131071,
8393
+ 196606,
8394
+ 196607,
8395
+ 262142,
8396
+ 262143,
8397
+ 327678,
8398
+ 327679,
8399
+ 393214,
8400
+ 393215,
8401
+ 458750,
8402
+ 458751,
8403
+ 524286,
8404
+ 524287,
8405
+ 589822,
8406
+ 589823,
8407
+ 655358,
8408
+ 655359,
8409
+ 720894,
8410
+ 720895,
8411
+ 786430,
8412
+ 786431,
8413
+ 851966,
8414
+ 851967,
8415
+ 917502,
8416
+ 917503,
8417
+ 983038,
8418
+ 983039,
8419
+ 1048574,
8420
+ 1048575,
8421
+ 1114110,
8422
+ 1114111
8522
8423
  ]);
8424
+ var CODE_POINTS;
8425
+ (function(CODE_POINTS) {
8426
+ CODE_POINTS[CODE_POINTS["EOF"] = -1] = "EOF";
8427
+ CODE_POINTS[CODE_POINTS["NULL"] = 0] = "NULL";
8428
+ CODE_POINTS[CODE_POINTS["TABULATION"] = 9] = "TABULATION";
8429
+ CODE_POINTS[CODE_POINTS["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN";
8430
+ CODE_POINTS[CODE_POINTS["LINE_FEED"] = 10] = "LINE_FEED";
8431
+ CODE_POINTS[CODE_POINTS["FORM_FEED"] = 12] = "FORM_FEED";
8432
+ CODE_POINTS[CODE_POINTS["SPACE"] = 32] = "SPACE";
8433
+ CODE_POINTS[CODE_POINTS["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
8434
+ CODE_POINTS[CODE_POINTS["QUOTATION_MARK"] = 34] = "QUOTATION_MARK";
8435
+ CODE_POINTS[CODE_POINTS["AMPERSAND"] = 38] = "AMPERSAND";
8436
+ CODE_POINTS[CODE_POINTS["APOSTROPHE"] = 39] = "APOSTROPHE";
8437
+ CODE_POINTS[CODE_POINTS["HYPHEN_MINUS"] = 45] = "HYPHEN_MINUS";
8438
+ CODE_POINTS[CODE_POINTS["SOLIDUS"] = 47] = "SOLIDUS";
8439
+ CODE_POINTS[CODE_POINTS["DIGIT_0"] = 48] = "DIGIT_0";
8440
+ CODE_POINTS[CODE_POINTS["DIGIT_9"] = 57] = "DIGIT_9";
8441
+ CODE_POINTS[CODE_POINTS["SEMICOLON"] = 59] = "SEMICOLON";
8442
+ CODE_POINTS[CODE_POINTS["LESS_THAN_SIGN"] = 60] = "LESS_THAN_SIGN";
8443
+ CODE_POINTS[CODE_POINTS["EQUALS_SIGN"] = 61] = "EQUALS_SIGN";
8444
+ CODE_POINTS[CODE_POINTS["GREATER_THAN_SIGN"] = 62] = "GREATER_THAN_SIGN";
8445
+ CODE_POINTS[CODE_POINTS["QUESTION_MARK"] = 63] = "QUESTION_MARK";
8446
+ CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_A"] = 65] = "LATIN_CAPITAL_A";
8447
+ CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_Z"] = 90] = "LATIN_CAPITAL_Z";
8448
+ CODE_POINTS[CODE_POINTS["RIGHT_SQUARE_BRACKET"] = 93] = "RIGHT_SQUARE_BRACKET";
8449
+ CODE_POINTS[CODE_POINTS["GRAVE_ACCENT"] = 96] = "GRAVE_ACCENT";
8450
+ CODE_POINTS[CODE_POINTS["LATIN_SMALL_A"] = 97] = "LATIN_SMALL_A";
8451
+ CODE_POINTS[CODE_POINTS["LATIN_SMALL_Z"] = 122] = "LATIN_SMALL_Z";
8452
+ })(CODE_POINTS || (CODE_POINTS = {}));
8523
8453
 
8524
- // ../shared/src/install-names.ts
8525
- var INSTALL_NAMES_ENV = "CAELO_INSTALL_NAMES";
8526
- var MAX_IDENTIFIER_BYTES = 63;
8527
- var RESERVED_PREFIXES = ["pg_", "cloudsql", "rds_", "rdsadmin", "azure_"];
8528
- var postgresName = string2().max(MAX_IDENTIFIER_BYTES, `must be at most ${MAX_IDENTIFIER_BYTES} characters`).regex(/^[a-z_][a-z0-9_]*$/, "must be a lower-case identifier ([a-z_][a-z0-9_]*)").refine((name) => !POSTGRES_KEYWORDS_NEEDING_QUOTES.has(name), "must not be a Postgres keyword (it would need quoting in CREATE ROLE, GRANT and the migrations)").refine((name) => !RESERVED_PREFIXES.some((p) => name.startsWith(p)), `must not start with ${RESERVED_PREFIXES.join(", ")} (reserved by Postgres and the managed services)`);
8529
- var roleName = postgresName.refine((name) => name !== "public", 'must not be "public" (Postgres reserves it for the PUBLIC pseudo-role)');
8530
- var SERVER_DATABASES = Object.freeze([
8531
- "postgres",
8532
- "template0",
8533
- "template1",
8534
- "cloudsqladmin",
8535
- "rdsadmin",
8536
- "azure_maintenance",
8537
- "azure_sys"
8538
- ]);
8539
- var databaseName = postgresName.refine((name) => !SERVER_DATABASES.includes(name), `must not be one of the server's own databases (${SERVER_DATABASES.join(", ")})`);
8540
- var RoleNamesSchema = object({
8541
- admin: roleName,
8542
- public: roleName,
8543
- publicStaging: roleName,
8544
- operatorAccessReader: roleName,
8545
- platformUpdater: roleName,
8546
- formerGateway: roleName
8547
- }).strict();
8548
- var DatabaseNamesSchema = object({
8549
- admin: databaseName,
8550
- public: databaseName,
8551
- publicStaging: databaseName
8552
- }).strict();
8553
- var InstallNamesSchema = object({ roles: RoleNamesSchema, databases: DatabaseNamesSchema }).strict().superRefine((names, ctx) => {
8554
- for (const [kind, map] of [
8555
- ["roles", names.roles],
8556
- ["databases", names.databases]
8557
- ]) {
8558
- const seen = new Map;
8559
- for (const [slot, name] of Object.entries(map)) {
8560
- const other = seen.get(name);
8561
- if (other !== undefined) {
8562
- ctx.addIssue({
8563
- code: "custom",
8564
- path: [kind, slot],
8565
- message: `${kind}.${slot} and ${kind}.${other} are both "${name}" (every ${kind === "roles" ? "role" : "database"} of an install has a name of its own)`
8566
- });
8567
- }
8568
- seen.set(name, slot);
8569
- }
8570
- }
8571
- });
8572
- var DEFAULT_INSTALL_NAMES = Object.freeze({
8573
- roles: Object.freeze({
8574
- admin: "admin_role",
8575
- public: "public_role",
8576
- publicStaging: "public_staging_role",
8577
- operatorAccessReader: "operator_access_reader",
8578
- platformUpdater: "platform_updater",
8579
- formerGateway: "gateway_role"
8580
- }),
8581
- databases: Object.freeze({
8582
- admin: "cms_admin",
8583
- public: "cms_public",
8584
- publicStaging: "cms_public_staging"
8585
- })
8586
- });
8587
- var DATABASE_SLOT = {
8588
- cms_admin: "admin",
8589
- cms_public: "public",
8590
- cms_public_staging: "publicStaging"
8591
- };
8592
- function physicalDatabaseName(names, logical) {
8593
- return names.databases[DATABASE_SLOT[logical]];
8594
- }
8595
- function parseInstallNames(raw, source) {
8596
- const parsed = InstallNamesSchema.safeParse(raw);
8597
- if (parsed.success)
8598
- return parsed.data;
8599
- const problems = parsed.error.issues.map((i) => `${i.path.length > 0 ? i.path.join(".") : "(map)"}: ${i.message}`);
8600
- throw new Error(`${source} is not a complete install name map (#1689):
8601
- ${problems.map((p) => ` - ${p}`).join(`
8602
- `)}
8603
- It is JSON {"roles":{"admin","public","publicStaging","operatorAccessReader","platformUpdater","formerGateway"},"databases":{"admin","public","publicStaging"}}, every name set; leave ${INSTALL_NAMES_ENV} unset for the default names.`);
8604
- }
8605
- function installNamesFromEnv(env = process.env) {
8606
- const raw = env[INSTALL_NAMES_ENV];
8607
- if (raw === undefined || raw.trim() === "")
8608
- return DEFAULT_INSTALL_NAMES;
8609
- let json;
8610
- try {
8611
- json = JSON.parse(raw);
8612
- } catch {
8613
- throw new Error(`${INSTALL_NAMES_ENV} is not JSON (#1689); it holds the install's role and database names, e.g. the output of prefixedInstallNames("t1")`);
8614
- }
8615
- return parseInstallNames(json, INSTALL_NAMES_ENV);
8616
- }
8617
- // ../shared/src/interactions.ts
8618
- var MOBILE_NAV_CSS = ".caelo-nav-menu .caelo-nav-toggle{display:none;background:none;border:0;cursor:pointer;padding:0.5rem;color:inherit;font:inherit}" + ".caelo-nav-menu .caelo-nav-toggle .caelo-nav-bar{display:block;width:1.25em;height:2px;background:currentColor;margin:0.25em 0}" + "@media (max-width: 720px){" + ".caelo-nav-menu .caelo-nav-toggle{display:inline-block}" + ".caelo-nav-menu > ul{display:none}" + '.caelo-nav-menu[data-nav-open="true"] > ul{display:block}' + "}";
8619
- var MOBILE_NAV_JS = "(function(){" + `var S='[data-caelo-ui="mobile-nav"]';` + "function set(nav,open){nav.setAttribute('data-nav-open',String(open));" + "var b=nav.querySelector('.caelo-nav-toggle');if(b)b.setAttribute('aria-expanded',String(open));return b;}" + "document.addEventListener('click',function(e){" + "var t=e.target;if(!(t instanceof Element))return;" + "var b=t.closest('.caelo-nav-toggle');if(!b)return;var nav=b.closest(S);if(!nav)return;" + "set(nav,nav.getAttribute('data-nav-open')!=='true');});" + "document.addEventListener('keydown',function(e){" + "if(e.key!=='Escape')return;var t=e.target;if(!(t instanceof Element))return;" + `var nav=t.closest(S+'[data-nav-open="true"]');if(!nav)return;` + "var b=set(nav,false);if(b)b.focus();});" + "})();";
8620
- var ACCORDION_CSS = ':where([data-caelo-ui="accordion"] summary){cursor:pointer}';
8621
- var ACCORDION_JS = "(function(){" + `var S='[data-caelo-ui="accordion"]';` + "document.addEventListener('toggle',function(e){" + "var d=e.target;if(!(d instanceof HTMLDetailsElement)||!d.open)return;" + "var acc=d.closest(S);if(!acc||!acc.hasAttribute('data-single'))return;" + "acc.querySelectorAll('details[open]').forEach(function(o){if(o!==d&&o.closest(S)===acc)o.open=false;});" + "},true);" + "function openHash(){var id;try{id=decodeURIComponent(location.hash.slice(1));}catch(_){return;}if(!id)return;" + "var el=document.getElementById(id);if(!el)return;var d=el.closest(S+' details');" + "if(d&&!d.open){d.open=true;el.scrollIntoView();}}" + "window.addEventListener('hashchange',openHash);" + "if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',openHash);else openHash();" + "})();";
8622
- var TABS_CSS = '[data-caelo-ui="tabs"] [role="tabpanel"][hidden]{display:none}';
8623
- var TABS_JS = "(function(){" + `function tabsOf(list){return Array.prototype.filter.call(list.querySelectorAll('[role="tab"]'),function(t){return t.closest('[role="tablist"]')===list;});}` + `function select(tab,focus){var list=tab.closest('[role="tablist"]');if(!list)return;` + "tabsOf(list).forEach(function(t){var on=t===tab;" + "t.setAttribute('aria-selected',String(on));t.setAttribute('tabindex',on?'0':'-1');" + "var p=document.getElementById(t.getAttribute('aria-controls')||'');if(p){if(on)p.removeAttribute('hidden');else p.setAttribute('hidden','');}});" + "if(focus)tab.focus();}" + "function tabAt(e){var t=e.target;if(!(t instanceof Element))return null;" + `var tab=t.closest('[role="tab"]');return tab&&tab.closest('[data-caelo-ui="tabs"]')?tab:null;}` + "document.addEventListener('click',function(e){var tab=tabAt(e);if(tab)select(tab,false);});" + "document.addEventListener('keydown',function(e){var tab=tabAt(e);if(!tab)return;" + `var list=tab.closest('[role="tablist"]');if(!list)return;var all=tabsOf(list);var i=all.indexOf(tab);var n=-1;` + "if(e.key==='ArrowRight'||e.key==='ArrowDown')n=(i+1)%all.length;" + "else if(e.key==='ArrowLeft'||e.key==='ArrowUp')n=(i-1+all.length)%all.length;" + "else if(e.key==='Home')n=0;else if(e.key==='End')n=all.length-1;" + "if(n<0)return;e.preventDefault();select(all[n],true);});" + "})();";
8624
- var CAROUSEL_CSS = ':where([data-caelo-ui="carousel"] [data-caelo-carousel-track]){display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth}' + ':where([data-caelo-ui="carousel"] [data-caelo-carousel-track]>*){flex:0 0 100%;scroll-snap-align:start}' + '@media (prefers-reduced-motion: reduce){[data-caelo-ui="carousel"] [data-caelo-carousel-track]{scroll-behavior:auto}}';
8625
- var CAROUSEL_JS = "(function(){" + "document.addEventListener('click',function(e){var t=e.target;if(!(t instanceof Element))return;" + "var b=t.closest('[data-caelo-carousel-prev],[data-caelo-carousel-next]');if(!b)return;" + `var c=b.closest('[data-caelo-ui="carousel"]');if(!c)return;` + "var track=c.querySelector('[data-caelo-carousel-track]');if(!track)return;" + "var dir=b.hasAttribute('data-caelo-carousel-next')?1:-1;" + "var reduce=window.matchMedia('(prefers-reduced-motion: reduce)').matches;" + "track.scrollBy({left:dir*track.clientWidth,behavior:reduce?'auto':'smooth'});});" + "})();";
8626
- var INTERACTIONS = {
8627
- "mobile-nav": { css: MOBILE_NAV_CSS, js: MOBILE_NAV_JS },
8628
- accordion: { css: ACCORDION_CSS, js: ACCORDION_JS },
8629
- tabs: { css: TABS_CSS, js: TABS_JS },
8630
- carousel: { css: CAROUSEL_CSS, js: CAROUSEL_JS }
8631
- };
8632
- var INTERACTION_IDS = Object.keys(INTERACTIONS);
8633
- var INTERACTION_MARKUP_CONTRACT = "`data-caelo-ui` kit \u2014 use it instead of JS for these (accessible, shipped once per page, style freely in module CSS):\n" + '- `accordion` (FAQ, collapsible): `<div data-caelo-ui="accordion" data-single>` with `<details id="..."><summary>Question</summary><div>Answer</div></details>` items; `data-single` keeps one open; a link to `#<details id>` opens it.\n' + '- `tabs`: `<div data-caelo-ui="tabs"><div role="tablist" aria-label="..."><button type="button" role="tab" id="t1" aria-controls="p1" aria-selected="true">...</button><button type="button" role="tab" id="t2" aria-controls="p2" aria-selected="false" tabindex="-1">...</button></div><div role="tabpanel" id="p1" aria-labelledby="t1">...</div><div role="tabpanel" id="p2" aria-labelledby="t2" hidden>...</div></div>`; ids unique on the page.\n' + '- `carousel` (slider, testimonials): `<section data-caelo-ui="carousel" aria-roledescription="carousel" aria-label="..."><div data-caelo-carousel-track tabindex="0"><div role="group" aria-roledescription="slide" aria-label="1 of 3">...</div>...</div><button type="button" data-caelo-carousel-prev aria-label="Previous slide"><span aria-hidden="true">&lsaquo;</span></button><button type="button" data-caelo-carousel-next aria-label="Next slide"><span aria-hidden="true">&rsaquo;</span></button></section>`; icon buttons keep visible content aria-hidden, text buttons need no aria-label. One slide per view; set the slides\' `flex-basis` in module CSS to show more.\n' + '- `mobile-nav` (menu collapsing behind a toggle on small screens): `<nav class="caelo-nav-menu" data-caelo-ui="mobile-nav" data-nav-open="false"><button type="button" class="caelo-nav-toggle" aria-expanded="false" aria-label="Menu"><span class="caelo-nav-bar"></span><span class="caelo-nav-bar"></span><span class="caelo-nav-bar"></span></button><ul>{{#menu}}<li>\u2026</li>{{/menu}}</ul></nav>` around the module\'s menu `list` field.\n' + "Write module JS only for behaviour the kit does not cover.";
8454
+ // ../../node_modules/parse5/dist/common/error-codes.js
8455
+ var ERR;
8456
+ (function(ERR) {
8457
+ ERR["controlCharacterInInputStream"] = "control-character-in-input-stream";
8458
+ ERR["noncharacterInInputStream"] = "noncharacter-in-input-stream";
8459
+ ERR["surrogateInInputStream"] = "surrogate-in-input-stream";
8460
+ ERR["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus";
8461
+ ERR["endTagWithAttributes"] = "end-tag-with-attributes";
8462
+ ERR["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus";
8463
+ ERR["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag";
8464
+ ERR["unexpectedNullCharacter"] = "unexpected-null-character";
8465
+ ERR["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name";
8466
+ ERR["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name";
8467
+ ERR["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name";
8468
+ ERR["missingEndTagName"] = "missing-end-tag-name";
8469
+ ERR["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name";
8470
+ ERR["unknownNamedCharacterReference"] = "unknown-named-character-reference";
8471
+ ERR["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference";
8472
+ ERR["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier";
8473
+ ERR["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value";
8474
+ ERR["eofBeforeTagName"] = "eof-before-tag-name";
8475
+ ERR["eofInTag"] = "eof-in-tag";
8476
+ ERR["missingAttributeValue"] = "missing-attribute-value";
8477
+ ERR["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes";
8478
+ ERR["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword";
8479
+ ERR["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers";
8480
+ ERR["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword";
8481
+ ERR["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier";
8482
+ ERR["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier";
8483
+ ERR["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier";
8484
+ ERR["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier";
8485
+ ERR["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier";
8486
+ ERR["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier";
8487
+ ERR["cdataInHtmlContent"] = "cdata-in-html-content";
8488
+ ERR["incorrectlyOpenedComment"] = "incorrectly-opened-comment";
8489
+ ERR["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text";
8490
+ ERR["eofInDoctype"] = "eof-in-doctype";
8491
+ ERR["nestedComment"] = "nested-comment";
8492
+ ERR["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment";
8493
+ ERR["eofInComment"] = "eof-in-comment";
8494
+ ERR["incorrectlyClosedComment"] = "incorrectly-closed-comment";
8495
+ ERR["eofInCdata"] = "eof-in-cdata";
8496
+ ERR["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference";
8497
+ ERR["nullCharacterReference"] = "null-character-reference";
8498
+ ERR["surrogateCharacterReference"] = "surrogate-character-reference";
8499
+ ERR["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range";
8500
+ ERR["controlCharacterReference"] = "control-character-reference";
8501
+ ERR["noncharacterCharacterReference"] = "noncharacter-character-reference";
8502
+ ERR["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name";
8503
+ ERR["missingDoctypeName"] = "missing-doctype-name";
8504
+ ERR["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name";
8505
+ ERR["duplicateAttribute"] = "duplicate-attribute";
8506
+ ERR["nonConformingDoctype"] = "non-conforming-doctype";
8507
+ ERR["missingDoctype"] = "missing-doctype";
8508
+ ERR["misplacedDoctype"] = "misplaced-doctype";
8509
+ ERR["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element";
8510
+ ERR["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements";
8511
+ ERR["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head";
8512
+ ERR["openElementsLeftAfterEof"] = "open-elements-left-after-eof";
8513
+ ERR["abandonedHeadElementChild"] = "abandoned-head-element-child";
8514
+ ERR["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element";
8515
+ ERR["nestedNoscriptInHead"] = "nested-noscript-in-head";
8516
+ ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text";
8517
+ })(ERR || (ERR = {}));
8634
8518
 
8635
- // ../shared/src/media.ts
8636
- var MEDIA_ALLOWED_MIMES = [
8637
- "image/jpeg",
8638
- "image/png",
8639
- "image/webp",
8640
- "image/avif",
8641
- "image/gif",
8642
- "image/svg+xml",
8643
- "image/x-icon",
8644
- "application/pdf",
8645
- "video/mp4",
8646
- "font/woff2",
8647
- "font/woff",
8648
- "font/ttf",
8649
- "font/otf"
8650
- ];
8651
- var MEDIA_SIZE_CAPS = {
8652
- "image/jpeg": 10 * 1024 * 1024,
8653
- "image/png": 10 * 1024 * 1024,
8654
- "image/webp": 10 * 1024 * 1024,
8655
- "image/avif": 10 * 1024 * 1024,
8656
- "image/gif": 8 * 1024 * 1024,
8657
- "image/svg+xml": 1 * 1024 * 1024,
8658
- "image/x-icon": 1 * 1024 * 1024,
8659
- "application/pdf": 20 * 1024 * 1024,
8660
- "video/mp4": 50 * 1024 * 1024,
8661
- "font/woff2": 5 * 1024 * 1024,
8662
- "font/woff": 5 * 1024 * 1024,
8663
- "font/ttf": 5 * 1024 * 1024,
8664
- "font/otf": 5 * 1024 * 1024
8665
- };
8666
- var MEDIA_HARD_LIMIT_BYTES = 50 * 1024 * 1024;
8667
- var MEDIA_URL_PREFIX = "/_caelo/media";
8668
- var RASTER_IMAGE_MIMES = new Set([
8669
- "image/jpeg",
8670
- "image/png",
8671
- "image/webp",
8672
- "image/avif",
8673
- "image/gif"
8674
- ]);
8675
- var mediaUrlPattern = new RegExp(`${MEDIA_URL_PREFIX}/([a-z0-9][a-z0-9-]{0,63})(?:/([a-z][a-z0-9-]{0,63}))?`, "g");
8676
- var sha256Schema = string2().regex(/^[0-9a-f]{64}$/, "must be hex sha256");
8677
- var publishedDigestSchema = object({
8678
- contentSha256: sha256Schema,
8679
- size: number2().int().nonnegative(),
8680
- gzipSha256: sha256Schema,
8681
- gzipSize: number2().int().nonnegative(),
8682
- profile: string2().min(1).max(64)
8683
- }).strict();
8684
- var mediaVisibilitySchema = _enum(["library", "reference"]);
8685
- var mediaUploadInputSchema = object({
8686
- sha256: sha256Schema,
8687
- originalName: string2().min(1).max(512),
8688
- name: string2().max(200).optional(),
8689
- mime: _enum(MEDIA_ALLOWED_MIMES),
8690
- sizeBytes: number2().int().positive(),
8691
- width: number2().int().positive().nullable(),
8692
- height: number2().int().positive().nullable(),
8693
- alt: string2().max(2048).default(""),
8694
- storageKey: string2().min(1),
8695
- storageProvider: string2().min(1).max(64).default("local"),
8696
- sourceKind: _enum(["upload", "ai_generated", "imported", "external"]).optional(),
8697
- sourceDetail: string2().max(2048).optional(),
8698
- license: string2().max(200).optional(),
8699
- visibility: mediaVisibilitySchema.optional(),
8700
- derivedFromId: string2().uuid().optional(),
8701
- variants: array(object({
8702
- variant: string2().min(1).max(64),
8703
- format: string2().min(1).max(32),
8704
- width: number2().int().positive().nullable(),
8705
- height: number2().int().positive().nullable(),
8706
- sizeBytes: number2().int().positive(),
8707
- storageKey: string2().min(1),
8708
- digest: publishedDigestSchema
8709
- })).min(1)
8710
- }).strict();
8711
- var mediaListInputSchema = object({
8712
- query: string2().max(256).optional(),
8713
- mime: _enum(MEDIA_ALLOWED_MIMES).optional(),
8714
- sort: _enum(["recent", "most_used"]).default("recent"),
8715
- visibility: _enum(["library", "reference", "all"]).default("library"),
8716
- limit: number2().int().positive().max(200).default(60),
8717
- offset: number2().int().nonnegative().default(0)
8718
- }).strict();
8719
- var mediaUpdateAltInputSchema = object({
8720
- assetId: string2().uuid(),
8721
- alt: string2().max(2048)
8722
- }).strict();
8723
- var mediaSetSourceInputSchema = object({
8724
- assetId: string2().uuid(),
8725
- sourceKind: _enum(["upload", "ai_generated", "imported", "external"]).optional(),
8726
- sourceDetail: string2().max(2048).optional(),
8727
- license: string2().max(200).optional()
8728
- }).strict();
8729
- var mediaSetVisibilityInputSchema = object({
8730
- assetId: string2().uuid(),
8731
- visibility: mediaVisibilitySchema
8732
- }).strict();
8733
- var mediaDeleteInputSchema = object({
8734
- assetId: string2().uuid(),
8735
- force: boolean2().default(false)
8736
- }).strict();
8737
- var mediaRecordUsageInputSchema = object({
8738
- deltas: record(string2().uuid(), number2().int())
8739
- }).strict();
8740
- var mediaSetCdnInputSchema = object({
8741
- enabled: boolean2(),
8742
- threshold: number2().int().min(1).max(1e4)
8743
- }).strict();
8744
-
8745
- // ../shared/src/link-refs.ts
8746
- var UUID_SRC = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
8747
- var QUERY_SRC = "[A-Za-z0-9_\\-.~%=&;+/:@!$()*]{1,512}";
8748
- var ANCHOR_SRC = "[A-Za-z0-9_\\-.~%:]{1,256}";
8749
- var VARIANT_SRC = "[a-z][a-z0-9-]{0,63}";
8750
- var LINK_REF_PART_PATTERNS = {
8751
- query: new RegExp(`^${QUERY_SRC}$`),
8752
- anchor: new RegExp(`^${ANCHOR_SRC}$`),
8753
- variant: new RegExp(`^${VARIANT_SRC}$`)
8754
- };
8755
- var ID_END_SRC = "(?![A-Za-z0-9_/\\-])";
8756
- var PAGE_BODY_SRC = `page/(${UUID_SRC})${ID_END_SRC}(?:\\?(${QUERY_SRC}))?(?:#(${ANCHOR_SRC}))?`;
8757
- var MEDIA_BODY_SRC = `media/(${UUID_SRC})(?:/(${VARIANT_SRC}))?${ID_END_SRC}`;
8758
- var PAGE_REF_EXACT = new RegExp(`^caelo:${PAGE_BODY_SRC}$`);
8759
- var MEDIA_REF_EXACT = new RegExp(`^caelo:${MEDIA_BODY_SRC}$`);
8760
- var LINK_RESOLVER_UNAVAILABLE = "link-resolver-unavailable";
8519
+ // ../../node_modules/parse5/dist/tokenizer/preprocessor.js
8520
+ var DEFAULT_BUFFER_WATERLINE = 1 << 16;
8761
8521
 
8762
- // ../shared/src/module-id-tag.ts
8763
- var CONTENT_INSTANCE_ATTRIBUTE = "data-caelo-content-instance";
8764
- var STAMP = new RegExp(` ${CONTENT_INSTANCE_ATTRIBUTE}="[0-9a-f-]{36}"`, "g");
8765
- var NOSNIPPET_ROOTS = new Set(["div", "section", "span"]);
8766
-
8767
- // ../../node_modules/mustache/mustache.mjs
8768
- /*!
8769
- * mustache.js - Logic-less {{mustache}} templates with JavaScript
8770
- * http://github.com/janl/mustache.js
8771
- */
8772
- var objectToString = Object.prototype.toString;
8773
- var isArray = Array.isArray || function isArrayPolyfill(object) {
8774
- return objectToString.call(object) === "[object Array]";
8775
- };
8776
- function isFunction(object) {
8777
- return typeof object === "function";
8778
- }
8779
- function typeStr(obj) {
8780
- return isArray(obj) ? "array" : typeof obj;
8781
- }
8782
- function escapeRegExp(string) {
8783
- return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
8784
- }
8785
- function hasProperty(obj, propName) {
8786
- return obj != null && typeof obj === "object" && propName in obj;
8787
- }
8788
- function primitiveHasOwnProperty(primitive, propName) {
8789
- return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
8790
- }
8791
- var regExpTest = RegExp.prototype.test;
8792
- function testRegExp(re, string) {
8793
- return regExpTest.call(re, string);
8794
- }
8795
- var nonSpaceRe = /\S/;
8796
- function isWhitespace(string) {
8797
- return !testRegExp(nonSpaceRe, string);
8798
- }
8799
- var entityMap = {
8800
- "&": "&amp;",
8801
- "<": "&lt;",
8802
- ">": "&gt;",
8803
- '"': "&quot;",
8804
- "'": "&#39;",
8805
- "/": "&#x2F;",
8806
- "`": "&#x60;",
8807
- "=": "&#x3D;"
8808
- };
8809
- function escapeHtml(string) {
8810
- return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
8811
- return entityMap[s];
8812
- });
8813
- }
8814
- var whiteRe = /\s*/;
8815
- var spaceRe = /\s+/;
8816
- var equalsRe = /\s*=/;
8817
- var curlyRe = /\s*\}/;
8818
- var tagRe = /#|\^|\/|>|\{|&|=|!/;
8819
- function parseTemplate(template, tags) {
8820
- if (!template)
8821
- return [];
8822
- var lineHasNonSpace = false;
8823
- var sections = [];
8824
- var tokens = [];
8825
- var spaces = [];
8826
- var hasTag = false;
8827
- var nonSpace = false;
8828
- var indentation = "";
8829
- var tagIndex = 0;
8830
- function stripSpace() {
8831
- if (hasTag && !nonSpace) {
8832
- while (spaces.length)
8833
- delete tokens[spaces.pop()];
8834
- } else {
8835
- spaces = [];
8836
- }
8837
- hasTag = false;
8838
- nonSpace = false;
8839
- }
8840
- var openingTagRe, closingTagRe, closingCurlyRe;
8841
- function compileTags(tagsToCompile) {
8842
- if (typeof tagsToCompile === "string")
8843
- tagsToCompile = tagsToCompile.split(spaceRe, 2);
8844
- if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
8845
- throw new Error("Invalid tags: " + tagsToCompile);
8846
- openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
8847
- closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
8848
- closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
8849
- }
8850
- compileTags(tags || mustache.tags);
8851
- var scanner = new Scanner(template);
8852
- var start, type, value, chr, token, openSection;
8853
- while (!scanner.eos()) {
8854
- start = scanner.pos;
8855
- value = scanner.scanUntil(openingTagRe);
8856
- if (value) {
8857
- for (var i = 0, valueLength = value.length;i < valueLength; ++i) {
8858
- chr = value.charAt(i);
8859
- if (isWhitespace(chr)) {
8860
- spaces.push(tokens.length);
8861
- indentation += chr;
8862
- } else {
8863
- nonSpace = true;
8864
- lineHasNonSpace = true;
8865
- indentation += " ";
8866
- }
8867
- tokens.push(["text", chr, start, start + 1]);
8868
- start += 1;
8869
- if (chr === `
8870
- `) {
8871
- stripSpace();
8872
- indentation = "";
8873
- tagIndex = 0;
8874
- lineHasNonSpace = false;
8875
- }
8876
- }
8877
- }
8878
- if (!scanner.scan(openingTagRe))
8879
- break;
8880
- hasTag = true;
8881
- type = scanner.scan(tagRe) || "name";
8882
- scanner.scan(whiteRe);
8883
- if (type === "=") {
8884
- value = scanner.scanUntil(equalsRe);
8885
- scanner.scan(equalsRe);
8886
- scanner.scanUntil(closingTagRe);
8887
- } else if (type === "{") {
8888
- value = scanner.scanUntil(closingCurlyRe);
8889
- scanner.scan(curlyRe);
8890
- scanner.scanUntil(closingTagRe);
8891
- type = "&";
8892
- } else {
8893
- value = scanner.scanUntil(closingTagRe);
8894
- }
8895
- if (!scanner.scan(closingTagRe))
8896
- throw new Error("Unclosed tag at " + scanner.pos);
8897
- if (type == ">") {
8898
- token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
8899
- } else {
8900
- token = [type, value, start, scanner.pos];
8901
- }
8902
- tagIndex++;
8903
- tokens.push(token);
8904
- if (type === "#" || type === "^") {
8905
- sections.push(token);
8906
- } else if (type === "/") {
8907
- openSection = sections.pop();
8908
- if (!openSection)
8909
- throw new Error('Unopened section "' + value + '" at ' + start);
8910
- if (openSection[1] !== value)
8911
- throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
8912
- } else if (type === "name" || type === "{" || type === "&") {
8913
- nonSpace = true;
8914
- } else if (type === "=") {
8915
- compileTags(value);
8916
- }
8917
- }
8918
- stripSpace();
8919
- openSection = sections.pop();
8920
- if (openSection)
8921
- throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
8922
- return nestTokens(squashTokens(tokens));
8923
- }
8924
- function squashTokens(tokens) {
8925
- var squashedTokens = [];
8926
- var token, lastToken;
8927
- for (var i = 0, numTokens = tokens.length;i < numTokens; ++i) {
8928
- token = tokens[i];
8929
- if (token) {
8930
- if (token[0] === "text" && lastToken && lastToken[0] === "text") {
8931
- lastToken[1] += token[1];
8932
- lastToken[3] = token[3];
8933
- } else {
8934
- squashedTokens.push(token);
8935
- lastToken = token;
8936
- }
8937
- }
8938
- }
8939
- return squashedTokens;
8940
- }
8941
- function nestTokens(tokens) {
8942
- var nestedTokens = [];
8943
- var collector = nestedTokens;
8944
- var sections = [];
8945
- var token, section;
8946
- for (var i = 0, numTokens = tokens.length;i < numTokens; ++i) {
8947
- token = tokens[i];
8948
- switch (token[0]) {
8949
- case "#":
8950
- case "^":
8951
- collector.push(token);
8952
- sections.push(token);
8953
- collector = token[4] = [];
8954
- break;
8955
- case "/":
8956
- section = sections.pop();
8957
- section[5] = token[2];
8958
- collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
8959
- break;
8960
- default:
8961
- collector.push(token);
8962
- }
8963
- }
8964
- return nestedTokens;
8965
- }
8966
- function Scanner(string) {
8967
- this.string = string;
8968
- this.tail = string;
8969
- this.pos = 0;
8970
- }
8971
- Scanner.prototype.eos = function eos() {
8972
- return this.tail === "";
8973
- };
8974
- Scanner.prototype.scan = function scan(re) {
8975
- var match = this.tail.match(re);
8976
- if (!match || match.index !== 0)
8977
- return "";
8978
- var string = match[0];
8979
- this.tail = this.tail.substring(string.length);
8980
- this.pos += string.length;
8981
- return string;
8982
- };
8983
- Scanner.prototype.scanUntil = function scanUntil(re) {
8984
- var index = this.tail.search(re), match;
8985
- switch (index) {
8986
- case -1:
8987
- match = this.tail;
8988
- this.tail = "";
8989
- break;
8990
- case 0:
8991
- match = "";
8992
- break;
8993
- default:
8994
- match = this.tail.substring(0, index);
8995
- this.tail = this.tail.substring(index);
8996
- }
8997
- this.pos += match.length;
8998
- return match;
8999
- };
9000
- function Context(view, parentContext) {
9001
- this.view = view;
9002
- this.cache = { ".": this.view };
9003
- this.parent = parentContext;
9004
- }
9005
- Context.prototype.push = function push(view) {
9006
- return new Context(view, this);
9007
- };
9008
- Context.prototype.lookup = function lookup(name) {
9009
- var cache = this.cache;
9010
- var value;
9011
- if (cache.hasOwnProperty(name)) {
9012
- value = cache[name];
9013
- } else {
9014
- var context = this, intermediateValue, names, index, lookupHit = false;
9015
- while (context) {
9016
- if (name.indexOf(".") > 0) {
9017
- intermediateValue = context.view;
9018
- names = name.split(".");
9019
- index = 0;
9020
- while (intermediateValue != null && index < names.length) {
9021
- if (index === names.length - 1)
9022
- lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
9023
- intermediateValue = intermediateValue[names[index++]];
9024
- }
9025
- } else {
9026
- intermediateValue = context.view[name];
9027
- lookupHit = hasProperty(context.view, name);
9028
- }
9029
- if (lookupHit) {
9030
- value = intermediateValue;
9031
- break;
9032
- }
9033
- context = context.parent;
9034
- }
9035
- cache[name] = value;
9036
- }
9037
- if (isFunction(value))
9038
- value = value.call(this.view);
9039
- return value;
9040
- };
9041
- function Writer() {
9042
- this.templateCache = {
9043
- _cache: {},
9044
- set: function set(key, value) {
9045
- this._cache[key] = value;
9046
- },
9047
- get: function get(key) {
9048
- return this._cache[key];
9049
- },
9050
- clear: function clear() {
9051
- this._cache = {};
9052
- }
9053
- };
9054
- }
9055
- Writer.prototype.clearCache = function clearCache() {
9056
- if (typeof this.templateCache !== "undefined") {
9057
- this.templateCache.clear();
9058
- }
9059
- };
9060
- Writer.prototype.parse = function parse(template, tags) {
9061
- var cache = this.templateCache;
9062
- var cacheKey = template + ":" + (tags || mustache.tags).join(":");
9063
- var isCacheEnabled = typeof cache !== "undefined";
9064
- var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;
9065
- if (tokens == undefined) {
9066
- tokens = parseTemplate(template, tags);
9067
- isCacheEnabled && cache.set(cacheKey, tokens);
9068
- }
9069
- return tokens;
9070
- };
9071
- Writer.prototype.render = function render(template, view, partials, config) {
9072
- var tags = this.getConfigTags(config);
9073
- var tokens = this.parse(template, tags);
9074
- var context = view instanceof Context ? view : new Context(view, undefined);
9075
- return this.renderTokens(tokens, context, partials, template, config);
9076
- };
9077
- Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {
9078
- var buffer = "";
9079
- var token, symbol, value;
9080
- for (var i = 0, numTokens = tokens.length;i < numTokens; ++i) {
9081
- value = undefined;
9082
- token = tokens[i];
9083
- symbol = token[0];
9084
- if (symbol === "#")
9085
- value = this.renderSection(token, context, partials, originalTemplate, config);
9086
- else if (symbol === "^")
9087
- value = this.renderInverted(token, context, partials, originalTemplate, config);
9088
- else if (symbol === ">")
9089
- value = this.renderPartial(token, context, partials, config);
9090
- else if (symbol === "&")
9091
- value = this.unescapedValue(token, context);
9092
- else if (symbol === "name")
9093
- value = this.escapedValue(token, context, config);
9094
- else if (symbol === "text")
9095
- value = this.rawValue(token);
9096
- if (value !== undefined)
9097
- buffer += value;
9098
- }
9099
- return buffer;
9100
- };
9101
- Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {
9102
- var self = this;
9103
- var buffer = "";
9104
- var value = context.lookup(token[1]);
9105
- function subRender(template) {
9106
- return self.render(template, context, partials, config);
9107
- }
9108
- if (!value)
9109
- return;
9110
- if (isArray(value)) {
9111
- for (var j = 0, valueLength = value.length;j < valueLength; ++j) {
9112
- buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);
9113
- }
9114
- } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
9115
- buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);
9116
- } else if (isFunction(value)) {
9117
- if (typeof originalTemplate !== "string")
9118
- throw new Error("Cannot use higher-order sections without the original template");
9119
- value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
9120
- if (value != null)
9121
- buffer += value;
9122
- } else {
9123
- buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);
9124
- }
9125
- return buffer;
9126
- };
9127
- Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {
9128
- var value = context.lookup(token[1]);
9129
- if (!value || isArray(value) && value.length === 0)
9130
- return this.renderTokens(token[4], context, partials, originalTemplate, config);
9131
- };
9132
- Writer.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {
9133
- var filteredIndentation = indentation.replace(/[^ \t]/g, "");
9134
- var partialByNl = partial.split(`
9135
- `);
9136
- for (var i = 0;i < partialByNl.length; i++) {
9137
- if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {
9138
- partialByNl[i] = filteredIndentation + partialByNl[i];
9139
- }
9140
- }
9141
- return partialByNl.join(`
9142
- `);
9143
- };
9144
- Writer.prototype.renderPartial = function renderPartial(token, context, partials, config) {
9145
- if (!partials)
9146
- return;
9147
- var tags = this.getConfigTags(config);
9148
- var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
9149
- if (value != null) {
9150
- var lineHasNonSpace = token[6];
9151
- var tagIndex = token[5];
9152
- var indentation = token[4];
9153
- var indentedValue = value;
9154
- if (tagIndex == 0 && indentation) {
9155
- indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);
9156
- }
9157
- var tokens = this.parse(indentedValue, tags);
9158
- return this.renderTokens(tokens, context, partials, indentedValue, config);
9159
- }
9160
- };
9161
- Writer.prototype.unescapedValue = function unescapedValue(token, context) {
9162
- var value = context.lookup(token[1]);
9163
- if (value != null)
9164
- return value;
9165
- };
9166
- Writer.prototype.escapedValue = function escapedValue(token, context, config) {
9167
- var escape = this.getConfigEscape(config) || mustache.escape;
9168
- var value = context.lookup(token[1]);
9169
- if (value != null)
9170
- return typeof value === "number" && escape === mustache.escape ? String(value) : escape(value);
9171
- };
9172
- Writer.prototype.rawValue = function rawValue(token) {
9173
- return token[1];
9174
- };
9175
- Writer.prototype.getConfigTags = function getConfigTags(config) {
9176
- if (isArray(config)) {
9177
- return config;
9178
- } else if (config && typeof config === "object") {
9179
- return config.tags;
9180
- } else {
9181
- return;
9182
- }
9183
- };
9184
- Writer.prototype.getConfigEscape = function getConfigEscape(config) {
9185
- if (config && typeof config === "object" && !isArray(config)) {
9186
- return config.escape;
9187
- } else {
9188
- return;
9189
- }
9190
- };
9191
- var mustache = {
9192
- name: "mustache.js",
9193
- version: "4.2.0",
9194
- tags: ["{{", "}}"],
9195
- clearCache: undefined,
9196
- escape: undefined,
9197
- parse: undefined,
9198
- render: undefined,
9199
- Scanner: undefined,
9200
- Context: undefined,
9201
- Writer: undefined,
9202
- set templateCache(cache) {
9203
- defaultWriter.templateCache = cache;
9204
- },
9205
- get templateCache() {
9206
- return defaultWriter.templateCache;
9207
- }
9208
- };
9209
- var defaultWriter = new Writer;
9210
- mustache.clearCache = function clearCache() {
9211
- return defaultWriter.clearCache();
9212
- };
9213
- mustache.parse = function parse(template, tags) {
9214
- return defaultWriter.parse(template, tags);
9215
- };
9216
- mustache.render = function render(template, view, partials, config) {
9217
- if (typeof template !== "string") {
9218
- throw new TypeError('Invalid template! Template should be a "string" ' + 'but "' + typeStr(template) + '" was given as the first ' + "argument for mustache#render(template, view, partials)");
9219
- }
9220
- return defaultWriter.render(template, view, partials, config);
9221
- };
9222
- mustache.escape = escapeHtml;
9223
- mustache.Scanner = Scanner;
9224
- mustache.Context = Context;
9225
- mustache.Writer = Writer;
9226
- var mustache_default = mustache;
9227
-
9228
- // ../../node_modules/parse5/dist/common/unicode.js
9229
- var UNDEFINED_CODE_POINTS = new Set([
9230
- 65534,
9231
- 65535,
9232
- 131070,
9233
- 131071,
9234
- 196606,
9235
- 196607,
9236
- 262142,
9237
- 262143,
9238
- 327678,
9239
- 327679,
9240
- 393214,
9241
- 393215,
9242
- 458750,
9243
- 458751,
9244
- 524286,
9245
- 524287,
9246
- 589822,
9247
- 589823,
9248
- 655358,
9249
- 655359,
9250
- 720894,
9251
- 720895,
9252
- 786430,
9253
- 786431,
9254
- 851966,
9255
- 851967,
9256
- 917502,
9257
- 917503,
9258
- 983038,
9259
- 983039,
9260
- 1048574,
9261
- 1048575,
9262
- 1114110,
9263
- 1114111
9264
- ]);
9265
- var CODE_POINTS;
9266
- (function(CODE_POINTS) {
9267
- CODE_POINTS[CODE_POINTS["EOF"] = -1] = "EOF";
9268
- CODE_POINTS[CODE_POINTS["NULL"] = 0] = "NULL";
9269
- CODE_POINTS[CODE_POINTS["TABULATION"] = 9] = "TABULATION";
9270
- CODE_POINTS[CODE_POINTS["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN";
9271
- CODE_POINTS[CODE_POINTS["LINE_FEED"] = 10] = "LINE_FEED";
9272
- CODE_POINTS[CODE_POINTS["FORM_FEED"] = 12] = "FORM_FEED";
9273
- CODE_POINTS[CODE_POINTS["SPACE"] = 32] = "SPACE";
9274
- CODE_POINTS[CODE_POINTS["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
9275
- CODE_POINTS[CODE_POINTS["QUOTATION_MARK"] = 34] = "QUOTATION_MARK";
9276
- CODE_POINTS[CODE_POINTS["AMPERSAND"] = 38] = "AMPERSAND";
9277
- CODE_POINTS[CODE_POINTS["APOSTROPHE"] = 39] = "APOSTROPHE";
9278
- CODE_POINTS[CODE_POINTS["HYPHEN_MINUS"] = 45] = "HYPHEN_MINUS";
9279
- CODE_POINTS[CODE_POINTS["SOLIDUS"] = 47] = "SOLIDUS";
9280
- CODE_POINTS[CODE_POINTS["DIGIT_0"] = 48] = "DIGIT_0";
9281
- CODE_POINTS[CODE_POINTS["DIGIT_9"] = 57] = "DIGIT_9";
9282
- CODE_POINTS[CODE_POINTS["SEMICOLON"] = 59] = "SEMICOLON";
9283
- CODE_POINTS[CODE_POINTS["LESS_THAN_SIGN"] = 60] = "LESS_THAN_SIGN";
9284
- CODE_POINTS[CODE_POINTS["EQUALS_SIGN"] = 61] = "EQUALS_SIGN";
9285
- CODE_POINTS[CODE_POINTS["GREATER_THAN_SIGN"] = 62] = "GREATER_THAN_SIGN";
9286
- CODE_POINTS[CODE_POINTS["QUESTION_MARK"] = 63] = "QUESTION_MARK";
9287
- CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_A"] = 65] = "LATIN_CAPITAL_A";
9288
- CODE_POINTS[CODE_POINTS["LATIN_CAPITAL_Z"] = 90] = "LATIN_CAPITAL_Z";
9289
- CODE_POINTS[CODE_POINTS["RIGHT_SQUARE_BRACKET"] = 93] = "RIGHT_SQUARE_BRACKET";
9290
- CODE_POINTS[CODE_POINTS["GRAVE_ACCENT"] = 96] = "GRAVE_ACCENT";
9291
- CODE_POINTS[CODE_POINTS["LATIN_SMALL_A"] = 97] = "LATIN_SMALL_A";
9292
- CODE_POINTS[CODE_POINTS["LATIN_SMALL_Z"] = 122] = "LATIN_SMALL_Z";
9293
- })(CODE_POINTS || (CODE_POINTS = {}));
9294
-
9295
- // ../../node_modules/parse5/dist/common/error-codes.js
9296
- var ERR;
9297
- (function(ERR) {
9298
- ERR["controlCharacterInInputStream"] = "control-character-in-input-stream";
9299
- ERR["noncharacterInInputStream"] = "noncharacter-in-input-stream";
9300
- ERR["surrogateInInputStream"] = "surrogate-in-input-stream";
9301
- ERR["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus";
9302
- ERR["endTagWithAttributes"] = "end-tag-with-attributes";
9303
- ERR["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus";
9304
- ERR["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag";
9305
- ERR["unexpectedNullCharacter"] = "unexpected-null-character";
9306
- ERR["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name";
9307
- ERR["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name";
9308
- ERR["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name";
9309
- ERR["missingEndTagName"] = "missing-end-tag-name";
9310
- ERR["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name";
9311
- ERR["unknownNamedCharacterReference"] = "unknown-named-character-reference";
9312
- ERR["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference";
9313
- ERR["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier";
9314
- ERR["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value";
9315
- ERR["eofBeforeTagName"] = "eof-before-tag-name";
9316
- ERR["eofInTag"] = "eof-in-tag";
9317
- ERR["missingAttributeValue"] = "missing-attribute-value";
9318
- ERR["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes";
9319
- ERR["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword";
9320
- ERR["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers";
9321
- ERR["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword";
9322
- ERR["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier";
9323
- ERR["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier";
9324
- ERR["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier";
9325
- ERR["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier";
9326
- ERR["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier";
9327
- ERR["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier";
9328
- ERR["cdataInHtmlContent"] = "cdata-in-html-content";
9329
- ERR["incorrectlyOpenedComment"] = "incorrectly-opened-comment";
9330
- ERR["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text";
9331
- ERR["eofInDoctype"] = "eof-in-doctype";
9332
- ERR["nestedComment"] = "nested-comment";
9333
- ERR["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment";
9334
- ERR["eofInComment"] = "eof-in-comment";
9335
- ERR["incorrectlyClosedComment"] = "incorrectly-closed-comment";
9336
- ERR["eofInCdata"] = "eof-in-cdata";
9337
- ERR["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference";
9338
- ERR["nullCharacterReference"] = "null-character-reference";
9339
- ERR["surrogateCharacterReference"] = "surrogate-character-reference";
9340
- ERR["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range";
9341
- ERR["controlCharacterReference"] = "control-character-reference";
9342
- ERR["noncharacterCharacterReference"] = "noncharacter-character-reference";
9343
- ERR["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name";
9344
- ERR["missingDoctypeName"] = "missing-doctype-name";
9345
- ERR["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name";
9346
- ERR["duplicateAttribute"] = "duplicate-attribute";
9347
- ERR["nonConformingDoctype"] = "non-conforming-doctype";
9348
- ERR["missingDoctype"] = "missing-doctype";
9349
- ERR["misplacedDoctype"] = "misplaced-doctype";
9350
- ERR["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element";
9351
- ERR["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements";
9352
- ERR["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head";
9353
- ERR["openElementsLeftAfterEof"] = "open-elements-left-after-eof";
9354
- ERR["abandonedHeadElementChild"] = "abandoned-head-element-child";
9355
- ERR["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element";
9356
- ERR["nestedNoscriptInHead"] = "nested-noscript-in-head";
9357
- ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text";
9358
- })(ERR || (ERR = {}));
9359
-
9360
- // ../../node_modules/parse5/dist/tokenizer/preprocessor.js
9361
- var DEFAULT_BUFFER_WATERLINE = 1 << 16;
9362
-
9363
- // ../../node_modules/parse5/dist/common/token.js
9364
- var TokenType;
9365
- (function(TokenType) {
9366
- TokenType[TokenType["CHARACTER"] = 0] = "CHARACTER";
9367
- TokenType[TokenType["NULL_CHARACTER"] = 1] = "NULL_CHARACTER";
9368
- TokenType[TokenType["WHITESPACE_CHARACTER"] = 2] = "WHITESPACE_CHARACTER";
9369
- TokenType[TokenType["START_TAG"] = 3] = "START_TAG";
9370
- TokenType[TokenType["END_TAG"] = 4] = "END_TAG";
9371
- TokenType[TokenType["COMMENT"] = 5] = "COMMENT";
9372
- TokenType[TokenType["DOCTYPE"] = 6] = "DOCTYPE";
9373
- TokenType[TokenType["EOF"] = 7] = "EOF";
9374
- TokenType[TokenType["HIBERNATION"] = 8] = "HIBERNATION";
9375
- })(TokenType || (TokenType = {}));
8522
+ // ../../node_modules/parse5/dist/common/token.js
8523
+ var TokenType;
8524
+ (function(TokenType) {
8525
+ TokenType[TokenType["CHARACTER"] = 0] = "CHARACTER";
8526
+ TokenType[TokenType["NULL_CHARACTER"] = 1] = "NULL_CHARACTER";
8527
+ TokenType[TokenType["WHITESPACE_CHARACTER"] = 2] = "WHITESPACE_CHARACTER";
8528
+ TokenType[TokenType["START_TAG"] = 3] = "START_TAG";
8529
+ TokenType[TokenType["END_TAG"] = 4] = "END_TAG";
8530
+ TokenType[TokenType["COMMENT"] = 5] = "COMMENT";
8531
+ TokenType[TokenType["DOCTYPE"] = 6] = "DOCTYPE";
8532
+ TokenType[TokenType["EOF"] = 7] = "EOF";
8533
+ TokenType[TokenType["HIBERNATION"] = 8] = "HIBERNATION";
8534
+ })(TokenType || (TokenType = {}));
9376
8535
 
9377
8536
  // ../../node_modules/parse5/dist/common/html.js
9378
8537
  var NS;
@@ -10281,152 +9440,1247 @@ var EXITS_FOREIGN_CONTENT = new Set([
10281
9440
  TAG_ID.VAR
10282
9441
  ]);
10283
9442
 
10284
- // ../../node_modules/parse5/dist/parser/index.js
10285
- var INSERTION_MODE_TAGS = [
10286
- TAG_ID.TR,
10287
- TAG_ID.TBODY,
10288
- TAG_ID.THEAD,
10289
- TAG_ID.TFOOT,
10290
- TAG_ID.CAPTION,
10291
- TAG_ID.COLGROUP,
10292
- TAG_ID.TABLE,
10293
- TAG_ID.FRAMESET,
10294
- TAG_ID.SELECT,
10295
- TAG_ID.TEMPLATE,
10296
- TAG_ID.TD,
10297
- TAG_ID.TH,
10298
- TAG_ID.HEAD,
10299
- TAG_ID.BODY,
10300
- TAG_ID.HTML
10301
- ];
10302
- var InsertionMode;
10303
- (function(InsertionMode) {
10304
- InsertionMode[InsertionMode["INITIAL"] = 0] = "INITIAL";
10305
- InsertionMode[InsertionMode["BEFORE_HTML"] = 1] = "BEFORE_HTML";
10306
- InsertionMode[InsertionMode["BEFORE_HEAD"] = 2] = "BEFORE_HEAD";
10307
- InsertionMode[InsertionMode["IN_HEAD"] = 3] = "IN_HEAD";
10308
- InsertionMode[InsertionMode["IN_HEAD_NO_SCRIPT"] = 4] = "IN_HEAD_NO_SCRIPT";
10309
- InsertionMode[InsertionMode["AFTER_HEAD"] = 5] = "AFTER_HEAD";
10310
- InsertionMode[InsertionMode["IN_BODY"] = 6] = "IN_BODY";
10311
- InsertionMode[InsertionMode["TEXT"] = 7] = "TEXT";
10312
- InsertionMode[InsertionMode["IN_TABLE"] = 8] = "IN_TABLE";
10313
- InsertionMode[InsertionMode["IN_TABLE_TEXT"] = 9] = "IN_TABLE_TEXT";
10314
- InsertionMode[InsertionMode["IN_CAPTION"] = 10] = "IN_CAPTION";
10315
- InsertionMode[InsertionMode["IN_COLUMN_GROUP"] = 11] = "IN_COLUMN_GROUP";
10316
- InsertionMode[InsertionMode["IN_TABLE_BODY"] = 12] = "IN_TABLE_BODY";
10317
- InsertionMode[InsertionMode["IN_ROW"] = 13] = "IN_ROW";
10318
- InsertionMode[InsertionMode["IN_CELL"] = 14] = "IN_CELL";
10319
- InsertionMode[InsertionMode["IN_SELECT"] = 15] = "IN_SELECT";
10320
- InsertionMode[InsertionMode["IN_SELECT_IN_TABLE"] = 16] = "IN_SELECT_IN_TABLE";
10321
- InsertionMode[InsertionMode["IN_TEMPLATE"] = 17] = "IN_TEMPLATE";
10322
- InsertionMode[InsertionMode["AFTER_BODY"] = 18] = "AFTER_BODY";
10323
- InsertionMode[InsertionMode["IN_FRAMESET"] = 19] = "IN_FRAMESET";
10324
- InsertionMode[InsertionMode["AFTER_FRAMESET"] = 20] = "AFTER_FRAMESET";
10325
- InsertionMode[InsertionMode["AFTER_AFTER_BODY"] = 21] = "AFTER_AFTER_BODY";
10326
- InsertionMode[InsertionMode["AFTER_AFTER_FRAMESET"] = 22] = "AFTER_AFTER_FRAMESET";
10327
- })(InsertionMode || (InsertionMode = {}));
10328
- var TABLE_STRUCTURE_TAGS = new Set([TAG_ID.TABLE, TAG_ID.TBODY, TAG_ID.TFOOT, TAG_ID.THEAD, TAG_ID.TR]);
10329
- var TABLE_VOID_ELEMENTS = new Set([TAG_ID.CAPTION, TAG_ID.COL, TAG_ID.COLGROUP, TAG_ID.TBODY, TAG_ID.TD, TAG_ID.TFOOT, TAG_ID.TH, TAG_ID.THEAD, TAG_ID.TR]);
10330
- // ../../node_modules/parse5/dist/serializer/index.js
10331
- var VOID_ELEMENTS = new Set([
10332
- TAG_NAMES.AREA,
10333
- TAG_NAMES.BASE,
10334
- TAG_NAMES.BASEFONT,
10335
- TAG_NAMES.BGSOUND,
10336
- TAG_NAMES.BR,
10337
- TAG_NAMES.COL,
10338
- TAG_NAMES.EMBED,
10339
- TAG_NAMES.FRAME,
10340
- TAG_NAMES.HR,
10341
- TAG_NAMES.IMG,
10342
- TAG_NAMES.INPUT,
10343
- TAG_NAMES.KEYGEN,
10344
- TAG_NAMES.LINK,
10345
- TAG_NAMES.META,
10346
- TAG_NAMES.PARAM,
10347
- TAG_NAMES.SOURCE,
10348
- TAG_NAMES.TRACK,
10349
- TAG_NAMES.WBR
10350
- ]);
10351
- // ../shared/src/lists/plugin-values.ts
10352
- var PROSE_ELEMENTS = new Set([
10353
- "p",
10354
- "a",
10355
- "strong",
10356
- "em",
10357
- "ul",
10358
- "ol",
10359
- "li",
10360
- "h2",
10361
- "h3",
10362
- "h4",
10363
- "h5",
10364
- "h6",
10365
- "blockquote",
10366
- "code",
10367
- "br",
10368
- "span"
10369
- ]);
10370
- var URL_ATTRIBUTES = new Set([
10371
- "href",
10372
- "src",
10373
- "srcset",
10374
- "cite",
10375
- "action",
10376
- "formaction",
10377
- "poster",
10378
- "background",
10379
- "xlink:href"
9443
+ // ../../node_modules/parse5/dist/parser/index.js
9444
+ var INSERTION_MODE_TAGS = [
9445
+ TAG_ID.TR,
9446
+ TAG_ID.TBODY,
9447
+ TAG_ID.THEAD,
9448
+ TAG_ID.TFOOT,
9449
+ TAG_ID.CAPTION,
9450
+ TAG_ID.COLGROUP,
9451
+ TAG_ID.TABLE,
9452
+ TAG_ID.FRAMESET,
9453
+ TAG_ID.SELECT,
9454
+ TAG_ID.TEMPLATE,
9455
+ TAG_ID.TD,
9456
+ TAG_ID.TH,
9457
+ TAG_ID.HEAD,
9458
+ TAG_ID.BODY,
9459
+ TAG_ID.HTML
9460
+ ];
9461
+ var InsertionMode;
9462
+ (function(InsertionMode) {
9463
+ InsertionMode[InsertionMode["INITIAL"] = 0] = "INITIAL";
9464
+ InsertionMode[InsertionMode["BEFORE_HTML"] = 1] = "BEFORE_HTML";
9465
+ InsertionMode[InsertionMode["BEFORE_HEAD"] = 2] = "BEFORE_HEAD";
9466
+ InsertionMode[InsertionMode["IN_HEAD"] = 3] = "IN_HEAD";
9467
+ InsertionMode[InsertionMode["IN_HEAD_NO_SCRIPT"] = 4] = "IN_HEAD_NO_SCRIPT";
9468
+ InsertionMode[InsertionMode["AFTER_HEAD"] = 5] = "AFTER_HEAD";
9469
+ InsertionMode[InsertionMode["IN_BODY"] = 6] = "IN_BODY";
9470
+ InsertionMode[InsertionMode["TEXT"] = 7] = "TEXT";
9471
+ InsertionMode[InsertionMode["IN_TABLE"] = 8] = "IN_TABLE";
9472
+ InsertionMode[InsertionMode["IN_TABLE_TEXT"] = 9] = "IN_TABLE_TEXT";
9473
+ InsertionMode[InsertionMode["IN_CAPTION"] = 10] = "IN_CAPTION";
9474
+ InsertionMode[InsertionMode["IN_COLUMN_GROUP"] = 11] = "IN_COLUMN_GROUP";
9475
+ InsertionMode[InsertionMode["IN_TABLE_BODY"] = 12] = "IN_TABLE_BODY";
9476
+ InsertionMode[InsertionMode["IN_ROW"] = 13] = "IN_ROW";
9477
+ InsertionMode[InsertionMode["IN_CELL"] = 14] = "IN_CELL";
9478
+ InsertionMode[InsertionMode["IN_SELECT"] = 15] = "IN_SELECT";
9479
+ InsertionMode[InsertionMode["IN_SELECT_IN_TABLE"] = 16] = "IN_SELECT_IN_TABLE";
9480
+ InsertionMode[InsertionMode["IN_TEMPLATE"] = 17] = "IN_TEMPLATE";
9481
+ InsertionMode[InsertionMode["AFTER_BODY"] = 18] = "AFTER_BODY";
9482
+ InsertionMode[InsertionMode["IN_FRAMESET"] = 19] = "IN_FRAMESET";
9483
+ InsertionMode[InsertionMode["AFTER_FRAMESET"] = 20] = "AFTER_FRAMESET";
9484
+ InsertionMode[InsertionMode["AFTER_AFTER_BODY"] = 21] = "AFTER_AFTER_BODY";
9485
+ InsertionMode[InsertionMode["AFTER_AFTER_FRAMESET"] = 22] = "AFTER_AFTER_FRAMESET";
9486
+ })(InsertionMode || (InsertionMode = {}));
9487
+ var TABLE_STRUCTURE_TAGS = new Set([TAG_ID.TABLE, TAG_ID.TBODY, TAG_ID.TFOOT, TAG_ID.THEAD, TAG_ID.TR]);
9488
+ var TABLE_VOID_ELEMENTS = new Set([TAG_ID.CAPTION, TAG_ID.COL, TAG_ID.COLGROUP, TAG_ID.TBODY, TAG_ID.TD, TAG_ID.TFOOT, TAG_ID.TH, TAG_ID.THEAD, TAG_ID.TR]);
9489
+ // ../../node_modules/parse5/dist/serializer/index.js
9490
+ var VOID_ELEMENTS = new Set([
9491
+ TAG_NAMES.AREA,
9492
+ TAG_NAMES.BASE,
9493
+ TAG_NAMES.BASEFONT,
9494
+ TAG_NAMES.BGSOUND,
9495
+ TAG_NAMES.BR,
9496
+ TAG_NAMES.COL,
9497
+ TAG_NAMES.EMBED,
9498
+ TAG_NAMES.FRAME,
9499
+ TAG_NAMES.HR,
9500
+ TAG_NAMES.IMG,
9501
+ TAG_NAMES.INPUT,
9502
+ TAG_NAMES.KEYGEN,
9503
+ TAG_NAMES.LINK,
9504
+ TAG_NAMES.META,
9505
+ TAG_NAMES.PARAM,
9506
+ TAG_NAMES.SOURCE,
9507
+ TAG_NAMES.TRACK,
9508
+ TAG_NAMES.WBR
9509
+ ]);
9510
+ // ../shared/src/html-tokens.ts
9511
+ var TEXT_STATES = {
9512
+ title: TokenizerMode.RCDATA,
9513
+ textarea: TokenizerMode.RCDATA,
9514
+ style: TokenizerMode.RAWTEXT,
9515
+ xmp: TokenizerMode.RAWTEXT,
9516
+ iframe: TokenizerMode.RAWTEXT,
9517
+ noembed: TokenizerMode.RAWTEXT,
9518
+ noframes: TokenizerMode.RAWTEXT,
9519
+ noscript: TokenizerMode.RAWTEXT,
9520
+ script: TokenizerMode.SCRIPT_DATA,
9521
+ plaintext: TokenizerMode.PLAINTEXT
9522
+ };
9523
+ var INTEGRATION_POINTS = new Set([
9524
+ "foreignobject",
9525
+ "desc",
9526
+ "title",
9527
+ "mi",
9528
+ "mo",
9529
+ "mn",
9530
+ "ms",
9531
+ "mtext",
9532
+ "annotation-xml"
9533
+ ]);
9534
+ var FOREIGN_BREAKOUT = new Set([
9535
+ "b",
9536
+ "big",
9537
+ "blockquote",
9538
+ "body",
9539
+ "br",
9540
+ "center",
9541
+ "code",
9542
+ "dd",
9543
+ "div",
9544
+ "dl",
9545
+ "dt",
9546
+ "em",
9547
+ "embed",
9548
+ "h1",
9549
+ "h2",
9550
+ "h3",
9551
+ "h4",
9552
+ "h5",
9553
+ "h6",
9554
+ "head",
9555
+ "hr",
9556
+ "i",
9557
+ "img",
9558
+ "li",
9559
+ "listing",
9560
+ "menu",
9561
+ "meta",
9562
+ "nobr",
9563
+ "ol",
9564
+ "p",
9565
+ "pre",
9566
+ "ruby",
9567
+ "s",
9568
+ "small",
9569
+ "span",
9570
+ "strong",
9571
+ "strike",
9572
+ "sub",
9573
+ "sup",
9574
+ "table",
9575
+ "tt",
9576
+ "u",
9577
+ "ul",
9578
+ "var"
9579
+ ]);
9580
+
9581
+ // ../shared/src/lists/plugin-values.ts
9582
+ var PROSE_ELEMENTS = new Set([
9583
+ "p",
9584
+ "a",
9585
+ "strong",
9586
+ "em",
9587
+ "ul",
9588
+ "ol",
9589
+ "li",
9590
+ "h2",
9591
+ "h3",
9592
+ "h4",
9593
+ "h5",
9594
+ "h6",
9595
+ "blockquote",
9596
+ "code",
9597
+ "br",
9598
+ "span"
9599
+ ]);
9600
+ var URL_ATTRIBUTES = new Set([
9601
+ "href",
9602
+ "src",
9603
+ "srcset",
9604
+ "cite",
9605
+ "action",
9606
+ "formaction",
9607
+ "poster",
9608
+ "background",
9609
+ "xlink:href"
9610
+ ]);
9611
+ var ALLOWED_SCHEMES = new Set(["https:", "http:", "mailto:", "tel:"]);
9612
+ var VOID_PROSE = new Set(["br"]);
9613
+ var PLUGIN_VALUE_REFUSED = "plugin-value-refused";
9614
+
9615
+ // ../shared/src/template-contexts.ts
9616
+ var URL_ATTRIBUTES2 = new Set([
9617
+ "href",
9618
+ "src",
9619
+ "srcset",
9620
+ "imagesrcset",
9621
+ "cite",
9622
+ "action",
9623
+ "formaction",
9624
+ "poster",
9625
+ "background",
9626
+ "xlink:href",
9627
+ "data",
9628
+ "ping",
9629
+ "longdesc",
9630
+ "usemap",
9631
+ "manifest",
9632
+ "codebase",
9633
+ "archive",
9634
+ "classid",
9635
+ "lowsrc",
9636
+ "dynsrc",
9637
+ "icon",
9638
+ "profile"
9639
+ ]);
9640
+ var SVG_ANIMATION = new Set(["set", "animate", "animatetransform", "animatemotion"]);
9641
+ var SVG_ANIMATION_ATTRIBUTES = new Set(["to", "from", "values", "by", "attributename"]);
9642
+ var TEXT_ONLY_ELEMENTS = new Set([
9643
+ "title",
9644
+ "textarea",
9645
+ "xmp",
9646
+ "iframe",
9647
+ "noembed",
9648
+ "noframes",
9649
+ "noscript",
9650
+ "plaintext"
9651
+ ]);
9652
+ var READING_ELEMENTS = [...TEXT_ONLY_ELEMENTS, "script", "style", "svg", "math", "select"];
9653
+ var READING_ATTRIBUTE_ELEMENTS = new Set(["font", "annotation-xml"]);
9654
+ var cache = new Map;
9655
+ var TABLE_STRUCTURE = new Set(["table", "tbody", "thead", "tfoot", "tr"]);
9656
+ var SELECT_CONTENT = new Set(["option", "optgroup", "hr"]);
9657
+
9658
+ // ../shared/src/core-value-structure.ts
9659
+ var VOID_ELEMENTS2 = new Set([
9660
+ "area",
9661
+ "base",
9662
+ "br",
9663
+ "col",
9664
+ "embed",
9665
+ "hr",
9666
+ "img",
9667
+ "input",
9668
+ "keygen",
9669
+ "link",
9670
+ "meta",
9671
+ "param",
9672
+ "source",
9673
+ "track",
9674
+ "wbr"
9675
+ ]);
9676
+ var NESTING_ONLY = new Set([
9677
+ "abbr",
9678
+ "b",
9679
+ "bdi",
9680
+ "bdo",
9681
+ "big",
9682
+ "br",
9683
+ "cite",
9684
+ "code",
9685
+ "data",
9686
+ "dfn",
9687
+ "em",
9688
+ "i",
9689
+ "img",
9690
+ "kbd",
9691
+ "label",
9692
+ "mark",
9693
+ "q",
9694
+ "s",
9695
+ "samp",
9696
+ "small",
9697
+ "span",
9698
+ "strike",
9699
+ "strong",
9700
+ "sub",
9701
+ "sup",
9702
+ "time",
9703
+ "tt",
9704
+ "u",
9705
+ "var",
9706
+ "wbr"
9707
+ ]);
9708
+ var frameHolds = new Map;
9709
+ // ../shared/src/media.ts
9710
+ var MEDIA_ALLOWED_MIMES = [
9711
+ "image/jpeg",
9712
+ "image/png",
9713
+ "image/webp",
9714
+ "image/avif",
9715
+ "image/gif",
9716
+ "image/svg+xml",
9717
+ "image/x-icon",
9718
+ "application/pdf",
9719
+ "video/mp4",
9720
+ "font/woff2",
9721
+ "font/woff",
9722
+ "font/ttf",
9723
+ "font/otf"
9724
+ ];
9725
+ var MEDIA_SIZE_CAPS = {
9726
+ "image/jpeg": 10 * 1024 * 1024,
9727
+ "image/png": 10 * 1024 * 1024,
9728
+ "image/webp": 10 * 1024 * 1024,
9729
+ "image/avif": 10 * 1024 * 1024,
9730
+ "image/gif": 8 * 1024 * 1024,
9731
+ "image/svg+xml": 1 * 1024 * 1024,
9732
+ "image/x-icon": 1 * 1024 * 1024,
9733
+ "application/pdf": 20 * 1024 * 1024,
9734
+ "video/mp4": 50 * 1024 * 1024,
9735
+ "font/woff2": 5 * 1024 * 1024,
9736
+ "font/woff": 5 * 1024 * 1024,
9737
+ "font/ttf": 5 * 1024 * 1024,
9738
+ "font/otf": 5 * 1024 * 1024
9739
+ };
9740
+ var MEDIA_HARD_LIMIT_BYTES = 50 * 1024 * 1024;
9741
+ var SHARE_IMAGE_ORIG_MAX_BYTES = 5 * 1024 * 1024;
9742
+ var MEDIA_URL_PREFIX = "/_caelo/media";
9743
+ var RASTER_IMAGE_MIMES = new Set([
9744
+ "image/jpeg",
9745
+ "image/png",
9746
+ "image/webp",
9747
+ "image/avif",
9748
+ "image/gif"
9749
+ ]);
9750
+ var mediaUrlPattern = new RegExp(`${MEDIA_URL_PREFIX}/([a-z0-9][a-z0-9-]{0,63})(?:/([a-z][a-z0-9-]{0,63}))?`, "g");
9751
+ var sha256Schema = string2().regex(/^[0-9a-f]{64}$/, "must be hex sha256");
9752
+ var publishedDigestSchema = object({
9753
+ contentSha256: sha256Schema,
9754
+ size: number2().int().nonnegative(),
9755
+ gzipSha256: sha256Schema,
9756
+ gzipSize: number2().int().nonnegative(),
9757
+ profile: string2().min(1).max(64)
9758
+ }).strict();
9759
+ var mediaVisibilitySchema = _enum(["library", "reference"]);
9760
+ var mediaUploadInputSchema = object({
9761
+ sha256: sha256Schema,
9762
+ originalName: string2().min(1).max(512),
9763
+ name: string2().max(200).optional(),
9764
+ mime: _enum(MEDIA_ALLOWED_MIMES),
9765
+ sizeBytes: number2().int().positive(),
9766
+ width: number2().int().positive().nullable(),
9767
+ height: number2().int().positive().nullable(),
9768
+ alt: string2().max(2048).default(""),
9769
+ storageKey: string2().min(1),
9770
+ storageProvider: string2().min(1).max(64).default("local"),
9771
+ sourceKind: _enum(["upload", "ai_generated", "imported", "external"]).optional(),
9772
+ sourceDetail: string2().max(2048).optional(),
9773
+ license: string2().max(200).optional(),
9774
+ visibility: mediaVisibilitySchema.optional(),
9775
+ derivedFromId: string2().uuid().optional(),
9776
+ variants: array(object({
9777
+ variant: string2().min(1).max(64),
9778
+ format: string2().min(1).max(32),
9779
+ width: number2().int().positive().nullable(),
9780
+ height: number2().int().positive().nullable(),
9781
+ sizeBytes: number2().int().positive(),
9782
+ storageKey: string2().min(1),
9783
+ digest: publishedDigestSchema
9784
+ })).min(1)
9785
+ }).strict();
9786
+ var mediaListInputSchema = object({
9787
+ query: string2().max(256).optional(),
9788
+ mime: _enum(MEDIA_ALLOWED_MIMES).optional(),
9789
+ sort: _enum(["recent", "most_used"]).default("recent"),
9790
+ visibility: _enum(["library", "reference", "all"]).default("library"),
9791
+ limit: number2().int().positive().max(200).default(60),
9792
+ offset: number2().int().nonnegative().default(0)
9793
+ }).strict();
9794
+ var mediaUpdateAltInputSchema = object({
9795
+ assetId: string2().uuid(),
9796
+ alt: string2().max(2048)
9797
+ }).strict();
9798
+ var mediaSetSourceInputSchema = object({
9799
+ assetId: string2().uuid(),
9800
+ sourceKind: _enum(["upload", "ai_generated", "imported", "external"]).optional(),
9801
+ sourceDetail: string2().max(2048).optional(),
9802
+ license: string2().max(200).optional()
9803
+ }).strict();
9804
+ var mediaSetVisibilityInputSchema = object({
9805
+ assetId: string2().uuid(),
9806
+ visibility: mediaVisibilitySchema
9807
+ }).strict();
9808
+ var mediaDeleteInputSchema = object({
9809
+ assetId: string2().uuid(),
9810
+ force: boolean2().default(false)
9811
+ }).strict();
9812
+ var mediaRecordUsageInputSchema = object({
9813
+ deltas: record(string2().uuid(), number2().int())
9814
+ }).strict();
9815
+ var mediaSetCdnInputSchema = object({
9816
+ enabled: boolean2(),
9817
+ threshold: number2().int().min(1).max(1e4)
9818
+ }).strict();
9819
+
9820
+ // ../shared/src/link-refs.ts
9821
+ var UUID_SRC = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
9822
+ var QUERY_SRC = "[A-Za-z0-9_\\-.~%=&;+/:@!$()*]{1,512}";
9823
+ var ANCHOR_SRC = "[A-Za-z0-9_\\-.~%:]{1,256}";
9824
+ var VARIANT_SRC = "[a-z][a-z0-9-]{0,63}";
9825
+ var LINK_REF_PART_PATTERNS = {
9826
+ query: new RegExp(`^${QUERY_SRC}$`),
9827
+ anchor: new RegExp(`^${ANCHOR_SRC}$`),
9828
+ variant: new RegExp(`^${VARIANT_SRC}$`)
9829
+ };
9830
+ var ID_END_SRC = "(?![A-Za-z0-9_/\\-])";
9831
+ var PAGE_BODY_SRC = `page/(${UUID_SRC})${ID_END_SRC}(?:\\?(${QUERY_SRC}))?(?:#(${ANCHOR_SRC}))?`;
9832
+ var MEDIA_BODY_SRC = `media/(${UUID_SRC})(?:/(${VARIANT_SRC}))?${ID_END_SRC}`;
9833
+ var PAGE_REF_EXACT = new RegExp(`^caelo:${PAGE_BODY_SRC}$`);
9834
+ var MEDIA_REF_EXACT = new RegExp(`^caelo:${MEDIA_BODY_SRC}$`);
9835
+ var LINK_RESOLVER_UNAVAILABLE = "link-resolver-unavailable";
9836
+
9837
+ // ../shared/src/template-sections.ts
9838
+ var CONTEXT_HEADS = new Set(["page", "site_text"]);
9839
+ var ENTRY_SCOPE_KINDS = new Set(["list", "module-list"]);
9840
+ // ../shared/src/css-scope-scan.ts
9841
+ var GROUPING_AT_RULES = new Set(["media", "supports", "layer", "container", "document"]);
9842
+ // ../shared/src/data-import/fields.ts
9843
+ var IMPORT_FIELD_TYPES = [
9844
+ "string",
9845
+ "text",
9846
+ "int",
9847
+ "number",
9848
+ "bool",
9849
+ "datetime",
9850
+ "enum",
9851
+ "pageRef",
9852
+ "path",
9853
+ "url"
9854
+ ];
9855
+ var IMPORT_RESERVED_FIELDS = ["sourceKey", "parentKey"];
9856
+ var FIELD_NAME = /^[a-z][a-zA-Z0-9]{0,47}$/;
9857
+ var importFieldDeclaration = object({
9858
+ type: _enum(IMPORT_FIELD_TYPES),
9859
+ description: string2().min(1).max(300).optional(),
9860
+ optional: boolean2().optional(),
9861
+ maxLength: number2().int().min(1).max(1e5).optional(),
9862
+ min: number2().finite().optional(),
9863
+ max: number2().finite().optional(),
9864
+ values: array(string2().min(1).max(64)).min(1).max(50).optional()
9865
+ }).strict().superRefine((f, ctx) => {
9866
+ const lengthTyped = f.type === "string" || f.type === "text";
9867
+ if (lengthTyped !== (f.maxLength !== undefined))
9868
+ ctx.addIssue({
9869
+ code: "custom",
9870
+ path: ["maxLength"],
9871
+ message: "`maxLength` is set exactly on `string` and `text` fields"
9872
+ });
9873
+ const numeric = f.type === "int" || f.type === "number";
9874
+ if (!numeric && (f.min !== undefined || f.max !== undefined))
9875
+ ctx.addIssue({
9876
+ code: "custom",
9877
+ path: ["min"],
9878
+ message: "`min` and `max` apply only to `int` and `number` fields"
9879
+ });
9880
+ if (f.min !== undefined && f.max !== undefined && f.min > f.max)
9881
+ ctx.addIssue({ code: "custom", path: ["min"], message: "`min` is above `max`" });
9882
+ if (f.type === "enum" !== (f.values !== undefined))
9883
+ ctx.addIssue({
9884
+ code: "custom",
9885
+ path: ["values"],
9886
+ message: "`values` is set exactly on `enum` fields"
9887
+ });
9888
+ if (f.values && new Set(f.values).size !== f.values.length)
9889
+ ctx.addIssue({ code: "custom", path: ["values"], message: "a value is listed twice" });
9890
+ });
9891
+ var importFieldMap = record(string2(), importFieldDeclaration).superRefine((fields, ctx) => {
9892
+ const names = Object.keys(fields);
9893
+ if (names.length === 0)
9894
+ ctx.addIssue({ code: "custom", message: "a kind has at least one field" });
9895
+ if (names.length > 40)
9896
+ ctx.addIssue({ code: "custom", message: "a kind has at most 40 fields" });
9897
+ if (Object.values(fields).filter((f) => f.type === "pageRef").length > 1)
9898
+ ctx.addIssue({ code: "custom", message: "a kind has at most one `pageRef` field" });
9899
+ for (const name of names) {
9900
+ if (!FIELD_NAME.test(name))
9901
+ ctx.addIssue({
9902
+ code: "custom",
9903
+ path: [name],
9904
+ message: `field name "${name}" must be camelCase letters and digits (e.g. authorName)`
9905
+ });
9906
+ if (IMPORT_RESERVED_FIELDS.includes(name))
9907
+ ctx.addIssue({
9908
+ code: "custom",
9909
+ path: [name],
9910
+ message: `"${name}" is provided by the import itself; do not declare it`
9911
+ });
9912
+ }
9913
+ });
9914
+ // ../shared/src/data-import/formats.ts
9915
+ var MAX_DATA_FILE_BYTES = 10 * 1024 * 1024;
9916
+ // ../shared/src/data-import/kind.ts
9917
+ var IMPORT_KIND_NAME = /^[a-z][a-z0-9_]{1,39}$/;
9918
+ var IMPORT_RELEASE_MODES = ["stage", "target"];
9919
+ var importKindBase = object({
9920
+ kind: string2().regex(IMPORT_KIND_NAME, "a kind name is lowercase letters, digits and `_` (e.g. comments)"),
9921
+ label: string2().min(1).max(60),
9922
+ description: string2().min(1).max(600),
9923
+ sources: string2().min(1).max(600).optional(),
9924
+ fields: importFieldMap,
9925
+ parents: boolean2().optional(),
9926
+ release: _enum(IMPORT_RELEASE_MODES)
9927
+ }).strict();
9928
+ // ../shared/src/database-tls.ts
9929
+ var DATABASE_CA_DIR = "/etc/caelo/db-ca";
9930
+ var CLOUD_SQL_CA_BUNDLE = `${DATABASE_CA_DIR}/cloudsql-global.pem`;
9931
+ var AWS_RDS_CA_BUNDLE = `${DATABASE_CA_DIR}/aws-rds-global.pem`;
9932
+ var SELF_HOSTED_CA_FILE = `${DATABASE_CA_DIR}/self-hosted-ca.pem`;
9933
+ // ../shared/src/postgres-keywords.ts
9934
+ var POSTGRES_KEYWORDS_NEEDING_QUOTES = new Set([
9935
+ "all",
9936
+ "analyse",
9937
+ "analyze",
9938
+ "and",
9939
+ "any",
9940
+ "array",
9941
+ "as",
9942
+ "asc",
9943
+ "asymmetric",
9944
+ "authorization",
9945
+ "between",
9946
+ "bigint",
9947
+ "binary",
9948
+ "bit",
9949
+ "boolean",
9950
+ "both",
9951
+ "case",
9952
+ "cast",
9953
+ "char",
9954
+ "character",
9955
+ "check",
9956
+ "coalesce",
9957
+ "collate",
9958
+ "collation",
9959
+ "column",
9960
+ "concurrently",
9961
+ "constraint",
9962
+ "create",
9963
+ "cross",
9964
+ "current_catalog",
9965
+ "current_date",
9966
+ "current_role",
9967
+ "current_schema",
9968
+ "current_time",
9969
+ "current_timestamp",
9970
+ "current_user",
9971
+ "dec",
9972
+ "decimal",
9973
+ "default",
9974
+ "deferrable",
9975
+ "desc",
9976
+ "distinct",
9977
+ "do",
9978
+ "else",
9979
+ "end",
9980
+ "except",
9981
+ "exists",
9982
+ "extract",
9983
+ "false",
9984
+ "fetch",
9985
+ "float",
9986
+ "for",
9987
+ "foreign",
9988
+ "freeze",
9989
+ "from",
9990
+ "full",
9991
+ "grant",
9992
+ "greatest",
9993
+ "group",
9994
+ "grouping",
9995
+ "having",
9996
+ "ilike",
9997
+ "in",
9998
+ "initially",
9999
+ "inner",
10000
+ "inout",
10001
+ "int",
10002
+ "integer",
10003
+ "intersect",
10004
+ "interval",
10005
+ "into",
10006
+ "is",
10007
+ "isnull",
10008
+ "join",
10009
+ "json",
10010
+ "json_array",
10011
+ "json_arrayagg",
10012
+ "json_exists",
10013
+ "json_object",
10014
+ "json_objectagg",
10015
+ "json_query",
10016
+ "json_scalar",
10017
+ "json_serialize",
10018
+ "json_table",
10019
+ "json_value",
10020
+ "lateral",
10021
+ "leading",
10022
+ "least",
10023
+ "left",
10024
+ "like",
10025
+ "limit",
10026
+ "localtime",
10027
+ "localtimestamp",
10028
+ "merge_action",
10029
+ "national",
10030
+ "natural",
10031
+ "nchar",
10032
+ "none",
10033
+ "normalize",
10034
+ "not",
10035
+ "notnull",
10036
+ "null",
10037
+ "nullif",
10038
+ "numeric",
10039
+ "offset",
10040
+ "on",
10041
+ "only",
10042
+ "or",
10043
+ "order",
10044
+ "out",
10045
+ "outer",
10046
+ "overlaps",
10047
+ "overlay",
10048
+ "placing",
10049
+ "position",
10050
+ "precision",
10051
+ "primary",
10052
+ "real",
10053
+ "references",
10054
+ "returning",
10055
+ "right",
10056
+ "row",
10057
+ "select",
10058
+ "session_user",
10059
+ "setof",
10060
+ "similar",
10061
+ "smallint",
10062
+ "some",
10063
+ "substring",
10064
+ "symmetric",
10065
+ "system_user",
10066
+ "table",
10067
+ "tablesample",
10068
+ "then",
10069
+ "time",
10070
+ "timestamp",
10071
+ "to",
10072
+ "trailing",
10073
+ "treat",
10074
+ "trim",
10075
+ "true",
10076
+ "union",
10077
+ "unique",
10078
+ "user",
10079
+ "using",
10080
+ "values",
10081
+ "varchar",
10082
+ "variadic",
10083
+ "verbose",
10084
+ "when",
10085
+ "where",
10086
+ "window",
10087
+ "with",
10088
+ "xmlattributes",
10089
+ "xmlconcat",
10090
+ "xmlelement",
10091
+ "xmlexists",
10092
+ "xmlforest",
10093
+ "xmlnamespaces",
10094
+ "xmlparse",
10095
+ "xmlpi",
10096
+ "xmlroot",
10097
+ "xmlserialize",
10098
+ "xmltable"
10099
+ ]);
10100
+
10101
+ // ../shared/src/install-names.ts
10102
+ var INSTALL_NAMES_ENV = "CAELO_INSTALL_NAMES";
10103
+ var MAX_IDENTIFIER_BYTES = 63;
10104
+ var RESERVED_PREFIXES = ["pg_", "cloudsql", "rds_", "rdsadmin", "azure_"];
10105
+ var postgresName = string2().max(MAX_IDENTIFIER_BYTES, `must be at most ${MAX_IDENTIFIER_BYTES} characters`).regex(/^[a-z_][a-z0-9_]*$/, "must be a lower-case identifier ([a-z_][a-z0-9_]*)").refine((name) => !POSTGRES_KEYWORDS_NEEDING_QUOTES.has(name), "must not be a Postgres keyword (it would need quoting in CREATE ROLE, GRANT and the migrations)").refine((name) => !RESERVED_PREFIXES.some((p) => name.startsWith(p)), `must not start with ${RESERVED_PREFIXES.join(", ")} (reserved by Postgres and the managed services)`);
10106
+ var roleName = postgresName.refine((name) => name !== "public", 'must not be "public" (Postgres reserves it for the PUBLIC pseudo-role)');
10107
+ var SERVER_DATABASES = Object.freeze([
10108
+ "postgres",
10109
+ "template0",
10110
+ "template1",
10111
+ "cloudsqladmin",
10112
+ "rdsadmin",
10113
+ "azure_maintenance",
10114
+ "azure_sys"
10380
10115
  ]);
10381
- var ALLOWED_SCHEMES = new Set(["https:", "http:", "mailto:", "tel:"]);
10382
- var VOID_PROSE = new Set(["br"]);
10383
- var PLUGIN_VALUE_REFUSED = "plugin-value-refused";
10116
+ var databaseName = postgresName.refine((name) => !SERVER_DATABASES.includes(name), `must not be one of the server's own databases (${SERVER_DATABASES.join(", ")})`);
10117
+ var RoleNamesSchema = object({
10118
+ admin: roleName,
10119
+ public: roleName,
10120
+ publicStaging: roleName,
10121
+ operatorAccessReader: roleName,
10122
+ platformUpdater: roleName,
10123
+ formerGateway: roleName
10124
+ }).strict();
10125
+ var DatabaseNamesSchema = object({
10126
+ admin: databaseName,
10127
+ public: databaseName,
10128
+ publicStaging: databaseName
10129
+ }).strict();
10130
+ var InstallNamesSchema = object({ roles: RoleNamesSchema, databases: DatabaseNamesSchema }).strict().superRefine((names, ctx) => {
10131
+ for (const [kind, map] of [
10132
+ ["roles", names.roles],
10133
+ ["databases", names.databases]
10134
+ ]) {
10135
+ const seen = new Map;
10136
+ for (const [slot, name] of Object.entries(map)) {
10137
+ const other = seen.get(name);
10138
+ if (other !== undefined) {
10139
+ ctx.addIssue({
10140
+ code: "custom",
10141
+ path: [kind, slot],
10142
+ message: `${kind}.${slot} and ${kind}.${other} are both "${name}" (every ${kind === "roles" ? "role" : "database"} of an install has a name of its own)`
10143
+ });
10144
+ }
10145
+ seen.set(name, slot);
10146
+ }
10147
+ }
10148
+ });
10149
+ var DEFAULT_INSTALL_NAMES = Object.freeze({
10150
+ roles: Object.freeze({
10151
+ admin: "admin_role",
10152
+ public: "public_role",
10153
+ publicStaging: "public_staging_role",
10154
+ operatorAccessReader: "operator_access_reader",
10155
+ platformUpdater: "platform_updater",
10156
+ formerGateway: "gateway_role"
10157
+ }),
10158
+ databases: Object.freeze({
10159
+ admin: "cms_admin",
10160
+ public: "cms_public",
10161
+ publicStaging: "cms_public_staging"
10162
+ })
10163
+ });
10164
+ var DATABASE_SLOT = {
10165
+ cms_admin: "admin",
10166
+ cms_public: "public",
10167
+ cms_public_staging: "publicStaging"
10168
+ };
10169
+ function physicalDatabaseName(names, logical) {
10170
+ return names.databases[DATABASE_SLOT[logical]];
10171
+ }
10172
+ function parseInstallNames(raw, source) {
10173
+ const parsed = InstallNamesSchema.safeParse(raw);
10174
+ if (parsed.success)
10175
+ return parsed.data;
10176
+ const problems = parsed.error.issues.map((i) => `${i.path.length > 0 ? i.path.join(".") : "(map)"}: ${i.message}`);
10177
+ throw new Error(`${source} is not a complete install name map (#1689):
10178
+ ${problems.map((p) => ` - ${p}`).join(`
10179
+ `)}
10180
+ It is JSON {"roles":{"admin","public","publicStaging","operatorAccessReader","platformUpdater","formerGateway"},"databases":{"admin","public","publicStaging"}}, every name set; leave ${INSTALL_NAMES_ENV} unset for the default names.`);
10181
+ }
10182
+ function installNamesFromEnv(env = process.env) {
10183
+ const raw = env[INSTALL_NAMES_ENV];
10184
+ if (raw === undefined || raw.trim() === "")
10185
+ return DEFAULT_INSTALL_NAMES;
10186
+ let json;
10187
+ try {
10188
+ json = JSON.parse(raw);
10189
+ } catch {
10190
+ throw new Error(`${INSTALL_NAMES_ENV} is not JSON (#1689); it holds the install's role and database names, e.g. the output of prefixedInstallNames("t1")`);
10191
+ }
10192
+ return parseInstallNames(json, INSTALL_NAMES_ENV);
10193
+ }
10194
+ // ../shared/src/interactions.ts
10195
+ var MOBILE_NAV_CSS = ".caelo-nav-menu .caelo-nav-toggle{display:none;background:none;border:0;cursor:pointer;padding:0.5rem;color:inherit;font:inherit}" + ".caelo-nav-menu .caelo-nav-toggle .caelo-nav-bar{display:block;width:1.25em;height:2px;background:currentColor;margin:0.25em 0}" + "@media (max-width: 720px){" + ".caelo-nav-menu .caelo-nav-toggle{display:inline-block}" + ".caelo-nav-menu > ul{display:none}" + '.caelo-nav-menu[data-nav-open="true"] > ul{display:block}' + "}";
10196
+ var MOBILE_NAV_JS = "(function(){" + `var S='[data-caelo-ui="mobile-nav"]';` + "function set(nav,open){nav.setAttribute('data-nav-open',String(open));" + "var b=nav.querySelector('.caelo-nav-toggle');if(b)b.setAttribute('aria-expanded',String(open));return b;}" + "document.addEventListener('click',function(e){" + "var t=e.target;if(!(t instanceof Element))return;" + "var b=t.closest('.caelo-nav-toggle');if(!b)return;var nav=b.closest(S);if(!nav)return;" + "set(nav,nav.getAttribute('data-nav-open')!=='true');});" + "document.addEventListener('keydown',function(e){" + "if(e.key!=='Escape')return;var t=e.target;if(!(t instanceof Element))return;" + `var nav=t.closest(S+'[data-nav-open="true"]');if(!nav)return;` + "var b=set(nav,false);if(b)b.focus();});" + "})();";
10197
+ var ACCORDION_CSS = ':where([data-caelo-ui="accordion"] summary){cursor:pointer}';
10198
+ var ACCORDION_JS = "(function(){" + `var S='[data-caelo-ui="accordion"]';` + "document.addEventListener('toggle',function(e){" + "var d=e.target;if(!(d instanceof HTMLDetailsElement)||!d.open)return;" + "var acc=d.closest(S);if(!acc||!acc.hasAttribute('data-single'))return;" + "acc.querySelectorAll('details[open]').forEach(function(o){if(o!==d&&o.closest(S)===acc)o.open=false;});" + "},true);" + "function openHash(){var id;try{id=decodeURIComponent(location.hash.slice(1));}catch(_){return;}if(!id)return;" + "var el=document.getElementById(id);if(!el)return;var d=el.closest(S+' details');" + "if(d&&!d.open){d.open=true;el.scrollIntoView();}}" + "window.addEventListener('hashchange',openHash);" + "if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',openHash);else openHash();" + "})();";
10199
+ var TABS_CSS = '[data-caelo-ui="tabs"] [role="tabpanel"][hidden]{display:none}';
10200
+ var TABS_JS = "(function(){" + `function tabsOf(list){return Array.prototype.filter.call(list.querySelectorAll('[role="tab"]'),function(t){return t.closest('[role="tablist"]')===list;});}` + `function select(tab,focus){var list=tab.closest('[role="tablist"]');if(!list)return;` + "tabsOf(list).forEach(function(t){var on=t===tab;" + "t.setAttribute('aria-selected',String(on));t.setAttribute('tabindex',on?'0':'-1');" + "var p=document.getElementById(t.getAttribute('aria-controls')||'');if(p){if(on)p.removeAttribute('hidden');else p.setAttribute('hidden','');}});" + "if(focus)tab.focus();}" + "function tabAt(e){var t=e.target;if(!(t instanceof Element))return null;" + `var tab=t.closest('[role="tab"]');return tab&&tab.closest('[data-caelo-ui="tabs"]')?tab:null;}` + "document.addEventListener('click',function(e){var tab=tabAt(e);if(tab)select(tab,false);});" + "document.addEventListener('keydown',function(e){var tab=tabAt(e);if(!tab)return;" + `var list=tab.closest('[role="tablist"]');if(!list)return;var all=tabsOf(list);var i=all.indexOf(tab);var n=-1;` + "if(e.key==='ArrowRight'||e.key==='ArrowDown')n=(i+1)%all.length;" + "else if(e.key==='ArrowLeft'||e.key==='ArrowUp')n=(i-1+all.length)%all.length;" + "else if(e.key==='Home')n=0;else if(e.key==='End')n=all.length-1;" + "if(n<0)return;e.preventDefault();select(all[n],true);});" + "})();";
10201
+ var CAROUSEL_CSS = ':where([data-caelo-ui="carousel"] [data-caelo-carousel-track]){display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth}' + ':where([data-caelo-ui="carousel"] [data-caelo-carousel-track]>*){flex:0 0 100%;scroll-snap-align:start}' + '@media (prefers-reduced-motion: reduce){[data-caelo-ui="carousel"] [data-caelo-carousel-track]{scroll-behavior:auto}}';
10202
+ var CAROUSEL_JS = "(function(){" + "document.addEventListener('click',function(e){var t=e.target;if(!(t instanceof Element))return;" + "var b=t.closest('[data-caelo-carousel-prev],[data-caelo-carousel-next]');if(!b)return;" + `var c=b.closest('[data-caelo-ui="carousel"]');if(!c)return;` + "var track=c.querySelector('[data-caelo-carousel-track]');if(!track)return;" + "var dir=b.hasAttribute('data-caelo-carousel-next')?1:-1;" + "var reduce=window.matchMedia('(prefers-reduced-motion: reduce)').matches;" + "track.scrollBy({left:dir*track.clientWidth,behavior:reduce?'auto':'smooth'});});" + "})();";
10203
+ var INTERACTIONS = {
10204
+ "mobile-nav": { css: MOBILE_NAV_CSS, js: MOBILE_NAV_JS },
10205
+ accordion: { css: ACCORDION_CSS, js: ACCORDION_JS },
10206
+ tabs: { css: TABS_CSS, js: TABS_JS },
10207
+ carousel: { css: CAROUSEL_CSS, js: CAROUSEL_JS }
10208
+ };
10209
+ var INTERACTION_IDS = Object.keys(INTERACTIONS);
10210
+ var INTERACTION_MARKUP_CONTRACT = "`data-caelo-ui` kit \u2014 use it instead of JS for these (accessible, shipped once per page, style freely in module CSS):\n" + '- `accordion` (FAQ, collapsible): `<div data-caelo-ui="accordion" data-single>` with `<details id="..."><summary>Question</summary><div>Answer</div></details>` items; `data-single` keeps one open; a link to `#<details id>` opens it.\n' + '- `tabs`: `<div data-caelo-ui="tabs"><div role="tablist" aria-label="..."><button type="button" role="tab" id="t1" aria-controls="p1" aria-selected="true">...</button><button type="button" role="tab" id="t2" aria-controls="p2" aria-selected="false" tabindex="-1">...</button></div><div role="tabpanel" id="p1" aria-labelledby="t1">...</div><div role="tabpanel" id="p2" aria-labelledby="t2" hidden>...</div></div>`; ids unique on the page.\n' + '- `carousel` (slider, testimonials): `<section data-caelo-ui="carousel" aria-roledescription="carousel" aria-label="..."><div data-caelo-carousel-track tabindex="0"><div role="group" aria-roledescription="slide" aria-label="1 of 3">...</div>...</div><button type="button" data-caelo-carousel-prev aria-label="Previous slide"><span aria-hidden="true">&lsaquo;</span></button><button type="button" data-caelo-carousel-next aria-label="Next slide"><span aria-hidden="true">&rsaquo;</span></button></section>`; icon buttons keep visible content aria-hidden, text buttons need no aria-label. One slide per view; set the slides\' `flex-basis` in module CSS to show more.\n' + '- `mobile-nav` (menu collapsing behind a toggle on small screens): `<nav class="caelo-nav-menu" data-caelo-ui="mobile-nav" data-nav-open="false"><button type="button" class="caelo-nav-toggle" aria-expanded="false" aria-label="Menu"><span class="caelo-nav-bar"></span><span class="caelo-nav-bar"></span><span class="caelo-nav-bar"></span></button><ul>{{#menu}}<li>\u2026</li>{{/menu}}</ul></nav>` around the module\'s menu `list` field.\n' + "Write module JS only for behaviour the kit does not cover.";
10384
10211
 
10385
- // ../shared/src/template-contexts.ts
10386
- var URL_ATTRIBUTES2 = new Set([
10387
- "href",
10388
- "src",
10389
- "srcset",
10390
- "imagesrcset",
10391
- "cite",
10392
- "action",
10393
- "formaction",
10394
- "poster",
10395
- "background",
10396
- "xlink:href",
10397
- "data",
10398
- "ping",
10399
- "longdesc",
10400
- "usemap",
10401
- "manifest",
10402
- "codebase",
10403
- "archive",
10404
- "classid",
10405
- "lowsrc",
10406
- "dynsrc",
10407
- "icon",
10408
- "profile"
10409
- ]);
10410
- var SVG_ANIMATION = new Set(["set", "animate", "animatetransform", "animatemotion"]);
10411
- var SVG_ANIMATION_ATTRIBUTES = new Set(["to", "from", "values", "by", "attributename"]);
10412
- var TEXT_ONLY_ELEMENTS = new Set([
10413
- "title",
10414
- "textarea",
10415
- "xmp",
10416
- "iframe",
10417
- "noembed",
10418
- "noframes",
10419
- "noscript",
10420
- "plaintext"
10421
- ]);
10422
- var READING_ELEMENTS = [...TEXT_ONLY_ELEMENTS, "script", "style", "svg", "math", "select"];
10423
- var READING_ATTRIBUTE_ELEMENTS = new Set(["font", "annotation-xml"]);
10424
- var cache = new Map;
10425
- var SELECT_CONTENT = new Set(["option", "optgroup", "hr"]);
10212
+ // ../shared/src/module-id-tag.ts
10213
+ var CONTENT_INSTANCE_ATTRIBUTE = "data-caelo-content-instance";
10214
+ var STAMP = new RegExp(` ${CONTENT_INSTANCE_ATTRIBUTE}="[0-9a-f-]{36}"`, "g");
10215
+ var NOSNIPPET_ROOTS = new Set(["div", "section", "span"]);
10216
+
10217
+ // ../shared/src/render-failure-markers.ts
10218
+ var CAELO_FAULT_PREFIXES = [
10219
+ `${LINK_RESOLVER_UNAVAILABLE}:`,
10220
+ "nested-renderer-unavailable:",
10221
+ "list-context-unavailable:"
10222
+ ];
10426
10223
 
10427
- // ../shared/src/template-sections.ts
10428
- var CONTEXT_HEADS = new Set(["page", "site_text"]);
10429
- var ENTRY_SCOPE_KINDS = new Set(["list", "module-list"]);
10224
+ // ../../node_modules/mustache/mustache.mjs
10225
+ /*!
10226
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
10227
+ * http://github.com/janl/mustache.js
10228
+ */
10229
+ var objectToString = Object.prototype.toString;
10230
+ var isArray = Array.isArray || function isArrayPolyfill(object) {
10231
+ return objectToString.call(object) === "[object Array]";
10232
+ };
10233
+ function isFunction(object) {
10234
+ return typeof object === "function";
10235
+ }
10236
+ function typeStr(obj) {
10237
+ return isArray(obj) ? "array" : typeof obj;
10238
+ }
10239
+ function escapeRegExp(string) {
10240
+ return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
10241
+ }
10242
+ function hasProperty(obj, propName) {
10243
+ return obj != null && typeof obj === "object" && propName in obj;
10244
+ }
10245
+ function primitiveHasOwnProperty(primitive, propName) {
10246
+ return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
10247
+ }
10248
+ var regExpTest = RegExp.prototype.test;
10249
+ function testRegExp(re, string) {
10250
+ return regExpTest.call(re, string);
10251
+ }
10252
+ var nonSpaceRe = /\S/;
10253
+ function isWhitespace(string) {
10254
+ return !testRegExp(nonSpaceRe, string);
10255
+ }
10256
+ var entityMap = {
10257
+ "&": "&amp;",
10258
+ "<": "&lt;",
10259
+ ">": "&gt;",
10260
+ '"': "&quot;",
10261
+ "'": "&#39;",
10262
+ "/": "&#x2F;",
10263
+ "`": "&#x60;",
10264
+ "=": "&#x3D;"
10265
+ };
10266
+ function escapeHtml(string) {
10267
+ return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
10268
+ return entityMap[s];
10269
+ });
10270
+ }
10271
+ var whiteRe = /\s*/;
10272
+ var spaceRe = /\s+/;
10273
+ var equalsRe = /\s*=/;
10274
+ var curlyRe = /\s*\}/;
10275
+ var tagRe = /#|\^|\/|>|\{|&|=|!/;
10276
+ function parseTemplate(template, tags) {
10277
+ if (!template)
10278
+ return [];
10279
+ var lineHasNonSpace = false;
10280
+ var sections = [];
10281
+ var tokens = [];
10282
+ var spaces = [];
10283
+ var hasTag = false;
10284
+ var nonSpace = false;
10285
+ var indentation = "";
10286
+ var tagIndex = 0;
10287
+ function stripSpace() {
10288
+ if (hasTag && !nonSpace) {
10289
+ while (spaces.length)
10290
+ delete tokens[spaces.pop()];
10291
+ } else {
10292
+ spaces = [];
10293
+ }
10294
+ hasTag = false;
10295
+ nonSpace = false;
10296
+ }
10297
+ var openingTagRe, closingTagRe, closingCurlyRe;
10298
+ function compileTags(tagsToCompile) {
10299
+ if (typeof tagsToCompile === "string")
10300
+ tagsToCompile = tagsToCompile.split(spaceRe, 2);
10301
+ if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)
10302
+ throw new Error("Invalid tags: " + tagsToCompile);
10303
+ openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
10304
+ closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
10305
+ closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
10306
+ }
10307
+ compileTags(tags || mustache.tags);
10308
+ var scanner = new Scanner(template);
10309
+ var start, type, value, chr, token, openSection;
10310
+ while (!scanner.eos()) {
10311
+ start = scanner.pos;
10312
+ value = scanner.scanUntil(openingTagRe);
10313
+ if (value) {
10314
+ for (var i = 0, valueLength = value.length;i < valueLength; ++i) {
10315
+ chr = value.charAt(i);
10316
+ if (isWhitespace(chr)) {
10317
+ spaces.push(tokens.length);
10318
+ indentation += chr;
10319
+ } else {
10320
+ nonSpace = true;
10321
+ lineHasNonSpace = true;
10322
+ indentation += " ";
10323
+ }
10324
+ tokens.push(["text", chr, start, start + 1]);
10325
+ start += 1;
10326
+ if (chr === `
10327
+ `) {
10328
+ stripSpace();
10329
+ indentation = "";
10330
+ tagIndex = 0;
10331
+ lineHasNonSpace = false;
10332
+ }
10333
+ }
10334
+ }
10335
+ if (!scanner.scan(openingTagRe))
10336
+ break;
10337
+ hasTag = true;
10338
+ type = scanner.scan(tagRe) || "name";
10339
+ scanner.scan(whiteRe);
10340
+ if (type === "=") {
10341
+ value = scanner.scanUntil(equalsRe);
10342
+ scanner.scan(equalsRe);
10343
+ scanner.scanUntil(closingTagRe);
10344
+ } else if (type === "{") {
10345
+ value = scanner.scanUntil(closingCurlyRe);
10346
+ scanner.scan(curlyRe);
10347
+ scanner.scanUntil(closingTagRe);
10348
+ type = "&";
10349
+ } else {
10350
+ value = scanner.scanUntil(closingTagRe);
10351
+ }
10352
+ if (!scanner.scan(closingTagRe))
10353
+ throw new Error("Unclosed tag at " + scanner.pos);
10354
+ if (type == ">") {
10355
+ token = [type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
10356
+ } else {
10357
+ token = [type, value, start, scanner.pos];
10358
+ }
10359
+ tagIndex++;
10360
+ tokens.push(token);
10361
+ if (type === "#" || type === "^") {
10362
+ sections.push(token);
10363
+ } else if (type === "/") {
10364
+ openSection = sections.pop();
10365
+ if (!openSection)
10366
+ throw new Error('Unopened section "' + value + '" at ' + start);
10367
+ if (openSection[1] !== value)
10368
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
10369
+ } else if (type === "name" || type === "{" || type === "&") {
10370
+ nonSpace = true;
10371
+ } else if (type === "=") {
10372
+ compileTags(value);
10373
+ }
10374
+ }
10375
+ stripSpace();
10376
+ openSection = sections.pop();
10377
+ if (openSection)
10378
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
10379
+ return nestTokens(squashTokens(tokens));
10380
+ }
10381
+ function squashTokens(tokens) {
10382
+ var squashedTokens = [];
10383
+ var token, lastToken;
10384
+ for (var i = 0, numTokens = tokens.length;i < numTokens; ++i) {
10385
+ token = tokens[i];
10386
+ if (token) {
10387
+ if (token[0] === "text" && lastToken && lastToken[0] === "text") {
10388
+ lastToken[1] += token[1];
10389
+ lastToken[3] = token[3];
10390
+ } else {
10391
+ squashedTokens.push(token);
10392
+ lastToken = token;
10393
+ }
10394
+ }
10395
+ }
10396
+ return squashedTokens;
10397
+ }
10398
+ function nestTokens(tokens) {
10399
+ var nestedTokens = [];
10400
+ var collector = nestedTokens;
10401
+ var sections = [];
10402
+ var token, section;
10403
+ for (var i = 0, numTokens = tokens.length;i < numTokens; ++i) {
10404
+ token = tokens[i];
10405
+ switch (token[0]) {
10406
+ case "#":
10407
+ case "^":
10408
+ collector.push(token);
10409
+ sections.push(token);
10410
+ collector = token[4] = [];
10411
+ break;
10412
+ case "/":
10413
+ section = sections.pop();
10414
+ section[5] = token[2];
10415
+ collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
10416
+ break;
10417
+ default:
10418
+ collector.push(token);
10419
+ }
10420
+ }
10421
+ return nestedTokens;
10422
+ }
10423
+ function Scanner(string) {
10424
+ this.string = string;
10425
+ this.tail = string;
10426
+ this.pos = 0;
10427
+ }
10428
+ Scanner.prototype.eos = function eos() {
10429
+ return this.tail === "";
10430
+ };
10431
+ Scanner.prototype.scan = function scan(re) {
10432
+ var match = this.tail.match(re);
10433
+ if (!match || match.index !== 0)
10434
+ return "";
10435
+ var string = match[0];
10436
+ this.tail = this.tail.substring(string.length);
10437
+ this.pos += string.length;
10438
+ return string;
10439
+ };
10440
+ Scanner.prototype.scanUntil = function scanUntil(re) {
10441
+ var index = this.tail.search(re), match;
10442
+ switch (index) {
10443
+ case -1:
10444
+ match = this.tail;
10445
+ this.tail = "";
10446
+ break;
10447
+ case 0:
10448
+ match = "";
10449
+ break;
10450
+ default:
10451
+ match = this.tail.substring(0, index);
10452
+ this.tail = this.tail.substring(index);
10453
+ }
10454
+ this.pos += match.length;
10455
+ return match;
10456
+ };
10457
+ function Context(view, parentContext) {
10458
+ this.view = view;
10459
+ this.cache = { ".": this.view };
10460
+ this.parent = parentContext;
10461
+ }
10462
+ Context.prototype.push = function push(view) {
10463
+ return new Context(view, this);
10464
+ };
10465
+ Context.prototype.lookup = function lookup(name) {
10466
+ var cache = this.cache;
10467
+ var value;
10468
+ if (cache.hasOwnProperty(name)) {
10469
+ value = cache[name];
10470
+ } else {
10471
+ var context = this, intermediateValue, names, index, lookupHit = false;
10472
+ while (context) {
10473
+ if (name.indexOf(".") > 0) {
10474
+ intermediateValue = context.view;
10475
+ names = name.split(".");
10476
+ index = 0;
10477
+ while (intermediateValue != null && index < names.length) {
10478
+ if (index === names.length - 1)
10479
+ lookupHit = hasProperty(intermediateValue, names[index]) || primitiveHasOwnProperty(intermediateValue, names[index]);
10480
+ intermediateValue = intermediateValue[names[index++]];
10481
+ }
10482
+ } else {
10483
+ intermediateValue = context.view[name];
10484
+ lookupHit = hasProperty(context.view, name);
10485
+ }
10486
+ if (lookupHit) {
10487
+ value = intermediateValue;
10488
+ break;
10489
+ }
10490
+ context = context.parent;
10491
+ }
10492
+ cache[name] = value;
10493
+ }
10494
+ if (isFunction(value))
10495
+ value = value.call(this.view);
10496
+ return value;
10497
+ };
10498
+ function Writer() {
10499
+ this.templateCache = {
10500
+ _cache: {},
10501
+ set: function set(key, value) {
10502
+ this._cache[key] = value;
10503
+ },
10504
+ get: function get(key) {
10505
+ return this._cache[key];
10506
+ },
10507
+ clear: function clear() {
10508
+ this._cache = {};
10509
+ }
10510
+ };
10511
+ }
10512
+ Writer.prototype.clearCache = function clearCache() {
10513
+ if (typeof this.templateCache !== "undefined") {
10514
+ this.templateCache.clear();
10515
+ }
10516
+ };
10517
+ Writer.prototype.parse = function parse(template, tags) {
10518
+ var cache = this.templateCache;
10519
+ var cacheKey = template + ":" + (tags || mustache.tags).join(":");
10520
+ var isCacheEnabled = typeof cache !== "undefined";
10521
+ var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;
10522
+ if (tokens == undefined) {
10523
+ tokens = parseTemplate(template, tags);
10524
+ isCacheEnabled && cache.set(cacheKey, tokens);
10525
+ }
10526
+ return tokens;
10527
+ };
10528
+ Writer.prototype.render = function render(template, view, partials, config) {
10529
+ var tags = this.getConfigTags(config);
10530
+ var tokens = this.parse(template, tags);
10531
+ var context = view instanceof Context ? view : new Context(view, undefined);
10532
+ return this.renderTokens(tokens, context, partials, template, config);
10533
+ };
10534
+ Writer.prototype.renderTokens = function renderTokens(tokens, context, partials, originalTemplate, config) {
10535
+ var buffer = "";
10536
+ var token, symbol, value;
10537
+ for (var i = 0, numTokens = tokens.length;i < numTokens; ++i) {
10538
+ value = undefined;
10539
+ token = tokens[i];
10540
+ symbol = token[0];
10541
+ if (symbol === "#")
10542
+ value = this.renderSection(token, context, partials, originalTemplate, config);
10543
+ else if (symbol === "^")
10544
+ value = this.renderInverted(token, context, partials, originalTemplate, config);
10545
+ else if (symbol === ">")
10546
+ value = this.renderPartial(token, context, partials, config);
10547
+ else if (symbol === "&")
10548
+ value = this.unescapedValue(token, context);
10549
+ else if (symbol === "name")
10550
+ value = this.escapedValue(token, context, config);
10551
+ else if (symbol === "text")
10552
+ value = this.rawValue(token);
10553
+ if (value !== undefined)
10554
+ buffer += value;
10555
+ }
10556
+ return buffer;
10557
+ };
10558
+ Writer.prototype.renderSection = function renderSection(token, context, partials, originalTemplate, config) {
10559
+ var self = this;
10560
+ var buffer = "";
10561
+ var value = context.lookup(token[1]);
10562
+ function subRender(template) {
10563
+ return self.render(template, context, partials, config);
10564
+ }
10565
+ if (!value)
10566
+ return;
10567
+ if (isArray(value)) {
10568
+ for (var j = 0, valueLength = value.length;j < valueLength; ++j) {
10569
+ buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate, config);
10570
+ }
10571
+ } else if (typeof value === "object" || typeof value === "string" || typeof value === "number") {
10572
+ buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate, config);
10573
+ } else if (isFunction(value)) {
10574
+ if (typeof originalTemplate !== "string")
10575
+ throw new Error("Cannot use higher-order sections without the original template");
10576
+ value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);
10577
+ if (value != null)
10578
+ buffer += value;
10579
+ } else {
10580
+ buffer += this.renderTokens(token[4], context, partials, originalTemplate, config);
10581
+ }
10582
+ return buffer;
10583
+ };
10584
+ Writer.prototype.renderInverted = function renderInverted(token, context, partials, originalTemplate, config) {
10585
+ var value = context.lookup(token[1]);
10586
+ if (!value || isArray(value) && value.length === 0)
10587
+ return this.renderTokens(token[4], context, partials, originalTemplate, config);
10588
+ };
10589
+ Writer.prototype.indentPartial = function indentPartial(partial, indentation, lineHasNonSpace) {
10590
+ var filteredIndentation = indentation.replace(/[^ \t]/g, "");
10591
+ var partialByNl = partial.split(`
10592
+ `);
10593
+ for (var i = 0;i < partialByNl.length; i++) {
10594
+ if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {
10595
+ partialByNl[i] = filteredIndentation + partialByNl[i];
10596
+ }
10597
+ }
10598
+ return partialByNl.join(`
10599
+ `);
10600
+ };
10601
+ Writer.prototype.renderPartial = function renderPartial(token, context, partials, config) {
10602
+ if (!partials)
10603
+ return;
10604
+ var tags = this.getConfigTags(config);
10605
+ var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];
10606
+ if (value != null) {
10607
+ var lineHasNonSpace = token[6];
10608
+ var tagIndex = token[5];
10609
+ var indentation = token[4];
10610
+ var indentedValue = value;
10611
+ if (tagIndex == 0 && indentation) {
10612
+ indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);
10613
+ }
10614
+ var tokens = this.parse(indentedValue, tags);
10615
+ return this.renderTokens(tokens, context, partials, indentedValue, config);
10616
+ }
10617
+ };
10618
+ Writer.prototype.unescapedValue = function unescapedValue(token, context) {
10619
+ var value = context.lookup(token[1]);
10620
+ if (value != null)
10621
+ return value;
10622
+ };
10623
+ Writer.prototype.escapedValue = function escapedValue(token, context, config) {
10624
+ var escape = this.getConfigEscape(config) || mustache.escape;
10625
+ var value = context.lookup(token[1]);
10626
+ if (value != null)
10627
+ return typeof value === "number" && escape === mustache.escape ? String(value) : escape(value);
10628
+ };
10629
+ Writer.prototype.rawValue = function rawValue(token) {
10630
+ return token[1];
10631
+ };
10632
+ Writer.prototype.getConfigTags = function getConfigTags(config) {
10633
+ if (isArray(config)) {
10634
+ return config;
10635
+ } else if (config && typeof config === "object") {
10636
+ return config.tags;
10637
+ } else {
10638
+ return;
10639
+ }
10640
+ };
10641
+ Writer.prototype.getConfigEscape = function getConfigEscape(config) {
10642
+ if (config && typeof config === "object" && !isArray(config)) {
10643
+ return config.escape;
10644
+ } else {
10645
+ return;
10646
+ }
10647
+ };
10648
+ var mustache = {
10649
+ name: "mustache.js",
10650
+ version: "4.2.0",
10651
+ tags: ["{{", "}}"],
10652
+ clearCache: undefined,
10653
+ escape: undefined,
10654
+ parse: undefined,
10655
+ render: undefined,
10656
+ Scanner: undefined,
10657
+ Context: undefined,
10658
+ Writer: undefined,
10659
+ set templateCache(cache) {
10660
+ defaultWriter.templateCache = cache;
10661
+ },
10662
+ get templateCache() {
10663
+ return defaultWriter.templateCache;
10664
+ }
10665
+ };
10666
+ var defaultWriter = new Writer;
10667
+ mustache.clearCache = function clearCache() {
10668
+ return defaultWriter.clearCache();
10669
+ };
10670
+ mustache.parse = function parse(template, tags) {
10671
+ return defaultWriter.parse(template, tags);
10672
+ };
10673
+ mustache.render = function render(template, view, partials, config) {
10674
+ if (typeof template !== "string") {
10675
+ throw new TypeError('Invalid template! Template should be a "string" ' + 'but "' + typeStr(template) + '" was given as the first ' + "argument for mustache#render(template, view, partials)");
10676
+ }
10677
+ return defaultWriter.render(template, view, partials, config);
10678
+ };
10679
+ mustache.escape = escapeHtml;
10680
+ mustache.Scanner = Scanner;
10681
+ mustache.Context = Context;
10682
+ mustache.Writer = Writer;
10683
+ var mustache_default = mustache;
10430
10684
 
10431
10685
  // ../shared/src/template-engine.ts
10432
10686
  mustache_default.escape = (s) => s === null || s === undefined ? "" : String(s);
@@ -10794,6 +11048,32 @@ var GRANITE_97M_R2 = {
10794
11048
  bytes: 25301672
10795
11049
  }
10796
11050
  },
11051
+ derived: {
11052
+ gather: "/embeddings/tok_embeddings/Gather",
11053
+ tableInput: "/embeddings/tok_embeddings/Gather_output_0_quantized",
11054
+ rows: 180000,
11055
+ width: 384,
11056
+ elementType: "uint8",
11057
+ graph: {
11058
+ name: "graph.onnx",
11059
+ sha256: "08ab16deaea2daa89309a43ff5d8d1aaafea6aea63902b8f15930829361950d9",
11060
+ bytes: 29127762
11061
+ },
11062
+ table: {
11063
+ name: "tokens.bin",
11064
+ sha256: "dfa0d1fe4626efce6187ae9dfc7f39336af75fda0e07b2290cca4a3157d7da3b",
11065
+ bytes: 69120000
11066
+ },
11067
+ tokenizer: {
11068
+ name: "tokenizer.bin",
11069
+ sha256: "f91682d3b56ce49d18682b60c80dd57f9a360c3a3b202eeb8b5188e37f7c30ed",
11070
+ bytes: 6888959
11071
+ },
11072
+ splitPattern: {
11073
+ source: "[^\\r\\n\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]*[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]+(?:'[sS]|'[tT]|'[rR][eE]|'[vV][eE]|'[mM]|'[lL][lL]|'[dD])?|[^\\r\\n\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?:'[sS]|'[tT]|'[rR][eE]|'[vV][eE]|'[mM]|'[lL][lL]|'[dD])?|\\p{N}{1,3}| ?[^\\p{White_Space}\\p{L}\\p{N}]+[\\r\\n/]*|\\p{White_Space}*[\\r\\n]+|\\p{White_Space}+(?!\\P{White_Space})|\\p{White_Space}+",
11074
+ flags: "gu"
11075
+ }
11076
+ },
10797
11077
  dims: 384,
10798
11078
  maxTokens: 512,
10799
11079
  pooling: "cls",
@@ -10979,6 +11259,43 @@ var SOURCE_ENTRY = "[A-Za-z0-9_.:-]{1,128}";
10979
11259
  var ADDRESS_RE = new RegExp(`^(?:list/(${SEG})/item/(${SEG})/(${SEG})` + `|instance/(${SEG})/(${SEG})/item/(${SEG})/(${SEG})` + `|page/(${SEG})/props/(${SEG})` + `|list_type/(${SEG})/node/(${SEG})/(${SEG})` + `|source/(${SEG})/item/(${SOURCE_ENTRY})/(${SEG}))$`);
10980
11260
  // ../shared/src/lists/overlay-scope.ts
10981
11261
  var groupMembers = new WeakMap;
11262
+ // ../shared/src/markup-segments.ts
11263
+ var TEXT_ATTRIBUTES = new Set([
11264
+ "alt",
11265
+ "title",
11266
+ "aria-label",
11267
+ "aria-description",
11268
+ "placeholder"
11269
+ ]);
11270
+ var SVG_TEXT_ELEMENTS = new Set([
11271
+ "title",
11272
+ "desc",
11273
+ "text",
11274
+ "tspan",
11275
+ "textpath"
11276
+ ]);
11277
+ var NO_TEXT_ANCESTORS = new Set([
11278
+ "script",
11279
+ "style",
11280
+ "xmp",
11281
+ "iframe",
11282
+ "noembed",
11283
+ "noframes",
11284
+ "noscript",
11285
+ "plaintext",
11286
+ "template"
11287
+ ]);
11288
+ var RAW_TEXT_ELEMENTS4 = new Set([
11289
+ "script",
11290
+ "style",
11291
+ "xmp",
11292
+ "iframe",
11293
+ "noembed",
11294
+ "noframes",
11295
+ "noscript",
11296
+ "plaintext"
11297
+ ]);
11298
+
10982
11299
  // ../shared/src/lists/resolve.ts
10983
11300
  var LIST_MARKER_PREFIXES = [
10984
11301
  "list-unbound:",
@@ -11160,12 +11477,6 @@ var OciManifestSchema = object({
11160
11477
  artifactType: string2().optional(),
11161
11478
  layers: array(object({ mediaType: string2(), digest: string2().regex(IMAGE_DIGEST) }))
11162
11479
  });
11163
- // ../shared/src/render-failure-markers.ts
11164
- var CAELO_FAULT_PREFIXES = [
11165
- `${LINK_RESOLVER_UNAVAILABLE}:`,
11166
- "nested-renderer-unavailable:",
11167
- "list-context-unavailable:"
11168
- ];
11169
11480
  // ../shared/src/result.ts
11170
11481
  function ok(value) {
11171
11482
  return { ok: true, value };
@@ -11176,6 +11487,426 @@ function err(error) {
11176
11487
  function isErr(result) {
11177
11488
  return !result.ok;
11178
11489
  }
11490
+ // ../shared/src/schema-org-types.ts
11491
+ var CREATIVE_WORKS = [
11492
+ "CreativeWork",
11493
+ "Article",
11494
+ "AdvertiserContentArticle",
11495
+ "NewsArticle",
11496
+ "AnalysisNewsArticle",
11497
+ "AskPublicNewsArticle",
11498
+ "BackgroundNewsArticle",
11499
+ "OpinionNewsArticle",
11500
+ "ReportageNewsArticle",
11501
+ "ReviewNewsArticle",
11502
+ "Report",
11503
+ "SatiricalArticle",
11504
+ "ScholarlyArticle",
11505
+ "SocialMediaPosting",
11506
+ "BlogPosting",
11507
+ "LiveBlogPosting",
11508
+ "DiscussionForumPosting",
11509
+ "TechArticle",
11510
+ "APIReference",
11511
+ "Blog",
11512
+ "Book",
11513
+ "Chapter",
11514
+ "Clip",
11515
+ "Collection",
11516
+ "Comment",
11517
+ "Answer",
11518
+ "Course",
11519
+ "CreativeWorkSeason",
11520
+ "CreativeWorkSeries",
11521
+ "BookSeries",
11522
+ "Periodical",
11523
+ "PodcastSeries",
11524
+ "TVSeries",
11525
+ "Dataset",
11526
+ "DefinedTermSet",
11527
+ "CategoryCodeSet",
11528
+ "DigitalDocument",
11529
+ "Episode",
11530
+ "PodcastEpisode",
11531
+ "TVEpisode",
11532
+ "Guide",
11533
+ "HowTo",
11534
+ "Recipe",
11535
+ "HowToDirection",
11536
+ "HowToSection",
11537
+ "HowToStep",
11538
+ "HowToTip",
11539
+ "Legislation",
11540
+ "Manuscript",
11541
+ "Map",
11542
+ "MathSolver",
11543
+ "MediaObject",
11544
+ "AudioObject",
11545
+ "DataDownload",
11546
+ "ImageObject",
11547
+ "MusicVideoObject",
11548
+ "VideoObject",
11549
+ "Menu",
11550
+ "MenuSection",
11551
+ "Message",
11552
+ "EmailMessage",
11553
+ "Movie",
11554
+ "MusicAlbum",
11555
+ "MusicComposition",
11556
+ "MusicPlaylist",
11557
+ "MusicRecording",
11558
+ "Painting",
11559
+ "Photograph",
11560
+ "Play",
11561
+ "Poster",
11562
+ "PublicationIssue",
11563
+ "PublicationVolume",
11564
+ "Question",
11565
+ "Quotation",
11566
+ "Review",
11567
+ "ClaimReview",
11568
+ "CriticReview",
11569
+ "EmployerReview",
11570
+ "UserReview",
11571
+ "Claim",
11572
+ "Sculpture",
11573
+ "ShortStory",
11574
+ "SoftwareApplication",
11575
+ "MobileApplication",
11576
+ "VideoGame",
11577
+ "WebApplication",
11578
+ "SoftwareSourceCode",
11579
+ "SpecialAnnouncement",
11580
+ "Thesis",
11581
+ "VisualArtwork",
11582
+ "WebContent",
11583
+ "WebPage",
11584
+ "AboutPage",
11585
+ "CheckoutPage",
11586
+ "CollectionPage",
11587
+ "MediaGallery",
11588
+ "ImageGallery",
11589
+ "VideoGallery",
11590
+ "ContactPage",
11591
+ "FAQPage",
11592
+ "ItemPage",
11593
+ "MedicalWebPage",
11594
+ "ProfilePage",
11595
+ "QAPage",
11596
+ "RealEstateListing",
11597
+ "SearchResultsPage",
11598
+ "WebPageElement",
11599
+ "SiteNavigationElement",
11600
+ "Table",
11601
+ "WPFooter",
11602
+ "WPHeader",
11603
+ "WPSideBar",
11604
+ "WebSite"
11605
+ ];
11606
+ var EVENTS = [
11607
+ "Event",
11608
+ "BusinessEvent",
11609
+ "ChildrensEvent",
11610
+ "ComedyEvent",
11611
+ "CourseInstance",
11612
+ "DanceEvent",
11613
+ "EducationEvent",
11614
+ "EventSeries",
11615
+ "ExhibitionEvent",
11616
+ "Festival",
11617
+ "FoodEvent",
11618
+ "Hackathon",
11619
+ "LiteraryEvent",
11620
+ "MusicEvent",
11621
+ "PublicationEvent",
11622
+ "BroadcastEvent",
11623
+ "SaleEvent",
11624
+ "ScreeningEvent",
11625
+ "SocialEvent",
11626
+ "SportsEvent",
11627
+ "TheaterEvent",
11628
+ "VisualArtsEvent"
11629
+ ];
11630
+ var ORGANIZATIONS = [
11631
+ "Organization",
11632
+ "Airline",
11633
+ "Consortium",
11634
+ "Corporation",
11635
+ "EducationalOrganization",
11636
+ "CollegeOrUniversity",
11637
+ "ElementarySchool",
11638
+ "HighSchool",
11639
+ "MiddleSchool",
11640
+ "Preschool",
11641
+ "School",
11642
+ "FundingScheme",
11643
+ "GovernmentOrganization",
11644
+ "LibrarySystem",
11645
+ "MedicalOrganization",
11646
+ "NGO",
11647
+ "NewsMediaOrganization",
11648
+ "OnlineBusiness",
11649
+ "OnlineStore",
11650
+ "PerformingGroup",
11651
+ "MusicGroup",
11652
+ "TheaterGroup",
11653
+ "Project",
11654
+ "ResearchProject",
11655
+ "ResearchOrganization",
11656
+ "SportsOrganization",
11657
+ "SportsTeam",
11658
+ "WorkersUnion"
11659
+ ];
11660
+ var LOCAL_BUSINESSES = [
11661
+ "LocalBusiness",
11662
+ "AnimalShelter",
11663
+ "ArchiveOrganization",
11664
+ "AutomotiveBusiness",
11665
+ "AutoDealer",
11666
+ "AutoRepair",
11667
+ "ChildCare",
11668
+ "Dentist",
11669
+ "DryCleaningOrLaundry",
11670
+ "EmergencyService",
11671
+ "EmploymentAgency",
11672
+ "EntertainmentBusiness",
11673
+ "FinancialService",
11674
+ "AccountingService",
11675
+ "BankOrCreditUnion",
11676
+ "InsuranceAgency",
11677
+ "FoodEstablishment",
11678
+ "Bakery",
11679
+ "BarOrPub",
11680
+ "Brewery",
11681
+ "CafeOrCoffeeShop",
11682
+ "Distillery",
11683
+ "FastFoodRestaurant",
11684
+ "IceCreamShop",
11685
+ "Restaurant",
11686
+ "Winery",
11687
+ "GovernmentOffice",
11688
+ "HealthAndBeautyBusiness",
11689
+ "BeautySalon",
11690
+ "DaySpa",
11691
+ "HairSalon",
11692
+ "HealthClub",
11693
+ "NailSalon",
11694
+ "TattooParlor",
11695
+ "HomeAndConstructionBusiness",
11696
+ "Electrician",
11697
+ "GeneralContractor",
11698
+ "HVACBusiness",
11699
+ "HousePainter",
11700
+ "Locksmith",
11701
+ "MovingCompany",
11702
+ "Plumber",
11703
+ "RoofingContractor",
11704
+ "InternetCafe",
11705
+ "LegalService",
11706
+ "Attorney",
11707
+ "Notary",
11708
+ "Library",
11709
+ "LodgingBusiness",
11710
+ "BedAndBreakfast",
11711
+ "Campground",
11712
+ "Hostel",
11713
+ "Hotel",
11714
+ "Motel",
11715
+ "Resort",
11716
+ "MedicalBusiness",
11717
+ "MedicalClinic",
11718
+ "Optician",
11719
+ "Pharmacy",
11720
+ "Physician",
11721
+ "ProfessionalService",
11722
+ "RadioStation",
11723
+ "RealEstateAgent",
11724
+ "RecyclingCenter",
11725
+ "SelfStorage",
11726
+ "ShoppingCenter",
11727
+ "SportsActivityLocation",
11728
+ "ExerciseGym",
11729
+ "GolfCourse",
11730
+ "SkiResort",
11731
+ "SportsClub",
11732
+ "StadiumOrArena",
11733
+ "Store",
11734
+ "BikeStore",
11735
+ "BookStore",
11736
+ "ClothingStore",
11737
+ "ComputerStore",
11738
+ "ConvenienceStore",
11739
+ "DepartmentStore",
11740
+ "ElectronicsStore",
11741
+ "Florist",
11742
+ "FurnitureStore",
11743
+ "GardenStore",
11744
+ "GroceryStore",
11745
+ "HardwareStore",
11746
+ "HobbyShop",
11747
+ "HomeGoodsStore",
11748
+ "JewelryStore",
11749
+ "LiquorStore",
11750
+ "MensClothingStore",
11751
+ "MobilePhoneStore",
11752
+ "MusicStore",
11753
+ "OfficeEquipmentStore",
11754
+ "OutletStore",
11755
+ "PawnShop",
11756
+ "PetStore",
11757
+ "ShoeStore",
11758
+ "SportingGoodsStore",
11759
+ "TireShop",
11760
+ "ToyStore",
11761
+ "WholesaleStore",
11762
+ "TelevisionStation",
11763
+ "TouristInformationCenter",
11764
+ "TravelAgency"
11765
+ ];
11766
+ var PLACES = [
11767
+ "Place",
11768
+ "Accommodation",
11769
+ "Apartment",
11770
+ "House",
11771
+ "Room",
11772
+ "AdministrativeArea",
11773
+ "City",
11774
+ "Country",
11775
+ "State",
11776
+ "CivicStructure",
11777
+ "Airport",
11778
+ "Aquarium",
11779
+ "Beach",
11780
+ "BusStation",
11781
+ "Cemetery",
11782
+ "EventVenue",
11783
+ "MovieTheater",
11784
+ "Museum",
11785
+ "MusicVenue",
11786
+ "Park",
11787
+ "PerformingArtsTheater",
11788
+ "PlaceOfWorship",
11789
+ "Church",
11790
+ "Mosque",
11791
+ "Synagogue",
11792
+ "BuddhistTemple",
11793
+ "HinduTemple",
11794
+ "TrainStation",
11795
+ "Zoo",
11796
+ "Landform",
11797
+ "Mountain",
11798
+ "LandmarksOrHistoricalBuildings",
11799
+ "Residence",
11800
+ "TouristAttraction",
11801
+ "TouristDestination"
11802
+ ];
11803
+ var PRODUCTS = [
11804
+ "Product",
11805
+ "IndividualProduct",
11806
+ "ProductCollection",
11807
+ "ProductGroup",
11808
+ "ProductModel",
11809
+ "SomeProducts",
11810
+ "Vehicle",
11811
+ "Car",
11812
+ "Motorcycle"
11813
+ ];
11814
+ var INTANGIBLES = [
11815
+ "Thing",
11816
+ "Person",
11817
+ "Intangible",
11818
+ "AggregateOffer",
11819
+ "AggregateRating",
11820
+ "EmployerAggregateRating",
11821
+ "AlignmentObject",
11822
+ "Audience",
11823
+ "BusinessAudience",
11824
+ "EducationalAudience",
11825
+ "PeopleAudience",
11826
+ "Brand",
11827
+ "BreadcrumbList",
11828
+ "BroadcastService",
11829
+ "ContactPoint",
11830
+ "PostalAddress",
11831
+ "DefinedRegion",
11832
+ "DefinedTerm",
11833
+ "CategoryCode",
11834
+ "Demand",
11835
+ "EducationalOccupationalCredential",
11836
+ "EducationalOccupationalProgram",
11837
+ "EntryPoint",
11838
+ "FinancialProduct",
11839
+ "GeoCircle",
11840
+ "GeoCoordinates",
11841
+ "GeoShape",
11842
+ "Grant",
11843
+ "InteractionCounter",
11844
+ "ItemList",
11845
+ "HowToSupply",
11846
+ "HowToTool",
11847
+ "HowToItem",
11848
+ "ListItem",
11849
+ "Language",
11850
+ "LocationFeatureSpecification",
11851
+ "MemberProgram",
11852
+ "MemberProgramTier",
11853
+ "MerchantReturnPolicy",
11854
+ "MonetaryAmount",
11855
+ "MonetaryAmountDistribution",
11856
+ "NutritionInformation",
11857
+ "Occupation",
11858
+ "OccupationalExperienceRequirements",
11859
+ "Offer",
11860
+ "OfferCatalog",
11861
+ "OfferShippingDetails",
11862
+ "OpeningHoursSpecification",
11863
+ "EmployeeRole",
11864
+ "OrganizationRole",
11865
+ "PerformanceRole",
11866
+ "Role",
11867
+ "PriceSpecification",
11868
+ "UnitPriceSpecification",
11869
+ "DeliveryChargeSpecification",
11870
+ "ProgramMembership",
11871
+ "PropertyValue",
11872
+ "QuantitativeValue",
11873
+ "QuantitativeValueDistribution",
11874
+ "Rating",
11875
+ "Reservation",
11876
+ "Schedule",
11877
+ "Service",
11878
+ "FoodService",
11879
+ "GovernmentService",
11880
+ "ServiceChannel",
11881
+ "ShippingDeliveryTime",
11882
+ "SpeakableSpecification",
11883
+ "Ticket",
11884
+ "Trip",
11885
+ "VirtualLocation",
11886
+ "JobPosting",
11887
+ "Action",
11888
+ "BuyAction",
11889
+ "CommentAction",
11890
+ "ListenAction",
11891
+ "OrderAction",
11892
+ "ReadAction",
11893
+ "RegisterAction",
11894
+ "ReserveAction",
11895
+ "SearchAction",
11896
+ "ShareAction",
11897
+ "SubscribeAction",
11898
+ "ViewAction",
11899
+ "WatchAction"
11900
+ ];
11901
+ var SCHEMA_ORG_TYPES = new Set([
11902
+ ...CREATIVE_WORKS,
11903
+ ...EVENTS,
11904
+ ...ORGANIZATIONS,
11905
+ ...LOCAL_BUSINESSES,
11906
+ ...PLACES,
11907
+ ...PRODUCTS,
11908
+ ...INTANGIBLES
11909
+ ]);
11179
11910
  // ../shared/src/session-cookie.ts
11180
11911
  var SESSION_ENTRY = {
11181
11912
  visitorId: "vid",
@@ -11351,6 +12082,7 @@ var stageStatusRunSchema = object({
11351
12082
  collection: string2(),
11352
12083
  state: _enum(["pending", "ready", "failed"]),
11353
12084
  error: string2().nullable(),
12085
+ waitingForCpu: string2().optional(),
11354
12086
  progress: object({
11355
12087
  embedded: number2().int().nonnegative(),
11356
12088
  toEmbed: number2().int().nonnegative(),