@cardenelabs/dragon 0.45.2 → 0.45.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +3 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +3 -3
- package/dist/export.cjs.map +1 -1
- package/dist/export.js +3 -3
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/light/chunk-5OQV42W3.cjs.map +1 -1
- package/dist/light/chunk-CLS6JVKK.cjs.map +1 -1
- package/dist/light/chunk-JCEKXALJ.cjs.map +1 -1
- package/dist/light/git-K3KAAAWW.cjs.map +1 -1
- package/dist/light/index.cjs +3 -3
- package/dist/light/index.cjs.map +1 -1
- package/dist/light/index.js +3 -3
- package/dist/light/index.js.map +1 -1
- package/dist/light/lineup-623J25LU.cjs.map +1 -1
- package/dist/light/state-OZVCHX7H.cjs.map +1 -1
- package/dist/light/time-PQCPVQOE.cjs.map +1 -1
- package/dist/light/tree-6D7KI57H.cjs.map +1 -1
- package/dist/player.global.js +1 -1
- package/package.json +1 -1
- package/src/render/draw.ts +7 -5
package/dist/light/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/cardene/Desktop/projects/dragon-3272-release-0-45-2/packages/dragon/dist/light/index.cjs","../../src/kinds/registry.ts","../../src/markdown.ts","../../src/field-messages.ts","../../src/schemas/validate-diagram.js","../../src/schema.ts","../../src/messages.ts","../../src/tokenize.ts","../../src/version.ts","../../src/parser.ts","../../src/printer.ts","../../src/layout/architecture.ts","../../src/layout/sequence.ts","../../src/timeline.ts","../../src/render/motion.ts","../../src/render/draw.ts","../../src/view.ts","../../src/player.ts","../../src/light.ts"],"names":["key","value","name","field","line","list","attrs","strip","side","row","edge","label","contentBottom","band","event","action","shown","badge","k","f","r","text","step","markup"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACtEO,IAAM,YAAA,EAAoC,CAAC,KAAA,EAAO,QAAA,EAAU,OAAA,EAAS,MAAA,EAAQ,MAAM,CAAA;AAE1F,IAAM,WAAA,EAAkC,CAAC,CAAA;AAElC,SAAS,YAAA,CAAkC,IAAA,EAAS,KAAA,EAA4B;AACrF,EAAA,UAAA,CAAW,IAAI,EAAA,EAAI,KAAA;AACrB;AAGO,SAAS,UAAA,CAAW,IAAA,EAAmC;AAC5D,EAAA,OAAO,CAAE,WAAA,CAAgD,QAAA,CAAS,IAAI,EAAA,GAAK,UAAA,CAAW,IAAiB,EAAA,IAAM,KAAA,CAAA;AAC/G;AAGO,SAAS,SAAA,CAA+B,IAAA,EAAS,KAAA,EAAqB,IAAA,EAAqB;AAChG,EAAA,MAAM,MAAA,EAAQ,UAAA,CAAW,IAAI,CAAA;AAC7B,EAAA,GAAA,CAAI,MAAA,IAAU,KAAA,CAAA,EAAW,MAAM,IAAI,KAAA,CAAM,6BAAA,CAAY,IAAI,CAAA,CAAE,aAAA,CAAc,IAAI,CAAC,CAAA;AAC9E,EAAA,OAAO,KAAA;AACT;ADkEA;A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AA;AACiB,IAAA;AACP,IAAA;AACH,IAAA;AACP,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACE,IAAA;AACM,IAAA;AACC,IAAA;AACP,IAAA;AACH,IAAA;AACO,IAAA;AACM,IAAA;AACC,IAAA;AACA,IAAA;AACZ,IAAA;AACA,IAAA;AACK,IAAA;AACA,IAAA;AACO,IAAA;AACP,IAAA;AACP,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACG,IAAA;AACH,IAAA;AACE,IAAA;AACY,IAAA;AACDD,IAAAA;AACFA,IAAAA;AACR,IAAA;AACM,IAAA;AACF,IAAA;AACE,IAAA;AACF,IAAA;AACI,IAAA;AACX,IAAA;AACa,IAAA;AACd,IAAA;AACE,IAAA;AACA,IAAA;AACa,IAAA;AACd,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACF,IAAA;AACe,IAAA;AACA,IAAA;AACH,IAAA;AACG,IAAA;AACF,IAAA;AACA,IAAA;AACf,IAAA;AACkB,IAAA;AACA,IAAA;AACd,IAAA;AACH,IAAA;AACC,IAAA;AACA,IAAA;AACe,IAAA;AACD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACV,IAAA;AACD,IAAA;AACD,IAAA;AACJ,IAAA;AACE,IAAA;AACA,IAAA;AACa,IAAA;AACZ,IAAA;AACa,IAAA;AACA,IAAA;AACD,IAAA;AACG,IAAA;AACA,IAAA;AACH,IAAA;AACG,IAAA;AACH,IAAA;AACf,IAAA;AACD,IAAA;AACI,IAAA;AACC,IAAA;AACH,IAAA;AACE,IAAA;AACD,IAAA;AACD,IAAA;AACC,IAAA;AACA,IAAA;AACA,IAAA;AACgB,IAAA;AACD,IAAA;AACH,IAAA;AACE,IAAA;AACjB,IAAA;AACM,IAAA;AACE,IAAA;AACD,IAAA;AACJ,IAAA;AACe,IAAA;AACC,IAAA;AACDE,IAAAA;AACN,IAAA;AACC,IAAA;AACX,IAAA;AACgBC,IAAAA;AAC5B,EAAA;AACF;AAE2B;AACa,EAAA;AAC1B,IAAA;AACI,IAAA;AACP,IAAA;AACF,IAAA;AACE,IAAA;AACD,IAAA;AACA,IAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACP,EAAA;AACO,EAAA;AACG,IAAA;AACC,IAAA;AACiB,IAAA;AACH,IAAA;AACC,IAAA;AACL,IAAA;AACC,IAAA;AACX,IAAA;AACc,IAAA;AACJ,IAAA;AACH,IAAA;AACP,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACE,IAAA;AACM,IAAA;AACC,IAAA;AACP,IAAA;AACH,IAAA;AACO,IAAA;AACM,IAAA;AACC,IAAA;AACA,IAAA;AACZ,IAAA;AACA,IAAA;AACK,IAAA;AACA,IAAA;AACO,IAAA;AACP,IAAA;AACP,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACG,IAAA;AACH,IAAA;AACE,IAAA;AACY,IAAA;AACJ,IAAA;AACF,IAAA;AACL,IAAA;AACL,IAAA;AACiB,IAAA;AACjB,IAAA;AACiB,IAAA;AACV,IAAA;AACL,IAAA;AACa,IAAA;AACd,IAAA;AACE,IAAA;AACA,IAAA;AACa,IAAA;AACd,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACF,IAAA;AACe,IAAA;AACH,IAAA;AACL,IAAA;AACG,IAAA;AACG,IAAA;AACA,IAAA;AACf,IAAA;AACkB,IAAA;AACA,IAAA;AACd,IAAA;AACH,IAAA;AACC,IAAA;AACA,IAAA;AACU,IAAA;AACI,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACV,IAAA;AACD,IAAA;AACD,IAAA;AACJ,IAAA;AACE,IAAA;AACA,IAAA;AACU,IAAA;AACT,IAAA;AACa,IAAA;AACL,IAAA;AACI,IAAA;AACG,IAAA;AACH,IAAA;AACH,IAAA;AACG,IAAA;AACH,IAAA;AACZ,IAAA;AACD,IA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AACD,IAAA;AACA,IAAA;AACE,IAAA;AACE,IAAA;AACL,MAAA;AACE,MAAA;AACxB,IAAA;AACc,IAAA;AACP,MAAA;AACa,QAAA;AAChB,QAAA;AACG,MAAA;AACgB,QAAA;AACI,QAAA;AACf,QAAA;AACR,QAAA;AACG,MAAA;AACW,QAAA;AACd,QAAA;AACG,MAAA;AACa,QAAA;AAChB,QAAA;AACW,MAAA;AACW,QAAA;AACf,QAAA;AACA,QAAA;AACgB,QAAA;AACD,QAAA;AACD,QAAA;AACrB,QAAA;AACF,MAAA;AACK,MAAA;AACkB,QAAA;AACrB,QAAA;AACW,MAAA;AACS,QAAA;AACF,QAAA;AACG,QAAA;AACD,QAAA;AACR,QAAA;AACZ,QAAA;AACF,MAAA;AACK,MAAA;AACoB,QAAA;AACvB,QAAA;AACU,MAAA;AACU,QAAA;AACA,QAAA;AACC,QAAA;AACF,QAAA;AACnB,QAAA;AACF,MAAA;AACa,MAAA;AACS,QAAA;AACR,QAAA;AACO,UAAA;AACjB,UAAA;AACF,QAAA;AACqB,QAAA;AACF,QAAA;AACnB,QAAA;AACF,MAAA;AACK,MAAA;AACmB,QAAA;AACtB,QAAA;AACG,MAAA;AACc,QAAA;AACjB,QAAA;AACa,MAAA;AACO,QAAA;AACH,QAAA;AACjB,QAAA;AACF,MAAA;AACK,MAAA;AACa,QAAA;AAChB,QAAA;AACG,MAAA;AACc,QAAA;AACjB,QAAA;AACG,MAAA;AACW,QAAA;AACd,QAAA;AACG,MAAA;AACa,QAAA;AAChB,QAAA;AACG,MAAA;AACY,QAAA;AACf,QAAA;AACG,MAAA;AACmB,QAAA;AACtB,QAAA;AACG,MAAA;AACmB,QAAA;AACtB,QAAA;AACW,MAAA;AACS,QAAA;AACH,QAAA;AACjB,QAAA;AACF,MAAA;AACa,MAAA;AACS,QAAA;AACH,QAAA;AACjB,QAAA;AACF,MAAA;AACK,MAAA;AACY,QAAA;AACf,QAAA;AACW,MAAA;AACS,QAAA;AACH,QAAA;AACjB,Q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A;AACJ,IAAA;AACS,IAAA;AAEhB,EAAA;AACmB,kBAAA;AAEhB,EAAA;AACM,IAAA;AACF,MAAA;AACT,IAAA;AACc,IAAA;AACL,MAAA;AACT,IAAA;AACM,IAAA;AACA,IAAA;AACM,IAAA;AACW,MAAA;AACvB,IAAA;AACa,IAAA;AACc,MAAA;AAC3B,IAAA;AAC0B,IAAA;AACd,MAAA;AACD,MAAA;AACX,IAAA;AACkC,IAAA;AACvB,MAAA;AACC,MAAA;AACZ,IAAA;AACe,IAAA;AACY,MAAA;AACJ,sBAAA;AACV,MAAA;AACA,MAAA;AACE,MAAA;AACP,MAAA;AACM,MAAA;AACd,IAAA;AACF,EAAA;AACF;AjB0tS+B;AACA;AkBtnTqC;AAChD,EAAA;AACG,EAAA;AACD,EAAA;AACD,EAAA;AACA,EAAA;AACrB;AAEkE;AAGM;AAChD,EAAA;AACH,EAAA;AACrB;AAEqE;AAC1C,EAAA;AAC3B;AlBonT+B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/cardene/Desktop/projects/dragon-3272-release-0-45-2/packages/dragon/dist/light/index.cjs","sourcesContent":[null,"/**\n * 図の種類ごとの描く部品の登録簿 (#3248)。\n *\n * 描く所 (`render/draw.ts`) は git、lineup、state、time、tree の部品をここから引く。\n * 全部入りの入口は読み込みの時に全ての種類を登録し (`all.ts`)、軽い入口は `loadKind` が種類を読んだ時に登録する (`light.ts`)。\n * 時系列図と構成図の部品は登録せず、描く所が直に読む。\n */\nimport { FIGURE_TEXT } from \"../figure-text\";\nimport type { NotationLang } from \"../words\";\nimport type * as git from \"./git\";\nimport type * as lineup from \"./lineup\";\nimport type * as state from \"./state\";\nimport type * as time from \"./time\";\nimport type * as tree from \"./tree\";\n\n/** 後から読む種類の名前。部品の型から導くと、部品の型が軽い入口の型の file へ漏れるので字で書く */\nexport type LaterKind = \"git\" | \"lineup\" | \"state\" | \"time\" | \"tree\";\n\nexport interface LaterKinds {\n git: typeof git;\n lineup: typeof lineup;\n state: typeof state;\n time: typeof time;\n tree: typeof tree;\n}\n\n/** 後から読む種類 */\nexport const LATER_KINDS: readonly LaterKind[] = [\"git\", \"lineup\", \"state\", \"time\", \"tree\"];\n\nconst registered: Partial<LaterKinds> = {};\n\nexport function registerKind<K extends LaterKind>(kind: K, parts: LaterKinds[K]): void {\n registered[kind] = parts;\n}\n\n/** 種類の部品を今すぐ描ける形で持っているか。時系列図と構成図は常に持つ */\nexport function kindLoaded(kind: string | undefined): boolean {\n return !(LATER_KINDS as readonly (string | undefined)[]).includes(kind) || registered[kind as LaterKind] !== undefined;\n}\n\n/** 種類の部品。読んでいない時は、種類の名前を含む誤りで止まる */\nexport function kindParts<K extends LaterKind>(kind: K, lang: NotationLang = \"ja\"): LaterKinds[K] {\n const parts = registered[kind];\n if (parts === undefined) throw new Error(FIGURE_TEXT[lang].kindNotLoaded(kind));\n return parts;\n}\n","/**\n * Markdown の中の dragon の囲み (```dragon) を、囲みごとに取り出す。\n *\n * 囲みの開き方と閉じ方は CommonMark に従う。` か ~ を 3 つ以上並べて開き、同じ字を開いた数以上\n * 並べて閉じる。閉じていない囲みは文書の終わりまでを中身にする。dragon 以外の言語の囲みの中は読まない。\n */\nexport interface Fence {\n /** 囲みの中身 (記法) */\n source: string;\n /** 中身の 1 行目が文書の何行目か。記法の誤りの行を文書の行に直す時に足す */\n line: number;\n}\n\nexport function extractDiagrams(markdown: string): Fence[] {\n const lines = markdown.split(/\\r?\\n/);\n if (lines[lines.length - 1] === \"\") lines.pop();\n const fences: Fence[] = [];\n let open: { mark: string; dragon: boolean; start: number; body: string[] } | undefined;\n lines.forEach((text, index) => {\n if (!open) {\n const found = /^ {0,3}(`{3,}|~{3,})\\s*([^\\s`]*)/.exec(text);\n if (found) open = { mark: found[1] ?? \"\", dragon: found[2] === \"dragon\", start: index + 2, body: [] };\n return;\n }\n const close = /^ {0,3}(`{3,}|~{3,})\\s*$/.exec(text)?.[1];\n if (close !== undefined && close[0] === open.mark[0] && close.length >= open.mark.length) {\n if (open.dragon) fences.push({ source: open.body.join(\"\\n\"), line: open.start });\n open = undefined;\n return;\n }\n open.body.push(text);\n });\n if (open?.dragon) fences.push({ source: open.body.join(\"\\n\"), line: open.start });\n return fences;\n}\n","/**\n * 原本の JSON の誤りの文 (#2999)。\n *\n * JSON は語を持たず file から言葉を決められないので、呼ぶ側 (頁なら頁の言葉) が言葉を渡す。\n * 文は schema が使う決まり (JSON Schema の keyword) ごとに持ち、ajv の英語の文はそのまま出さない。\n * schema に決まりを足して文が無い時は、`every-schema-keyword-has-messages` の検査が落ちる。\n */\nimport type { NotationLang } from \"./words\";\n\n/** `^[^…]+$` の形の決まりが書けないとする字。`space` は空白 (`\\s`) */\nexport interface Forbidden {\n space: boolean;\n chars: string[];\n}\n\n/** 書けない組み合わせ (`not`) の欄と、その欄を書ける時の `kind` の値 */\nexport interface Allowed {\n field: string;\n kind: string;\n}\n\nexport interface FieldMessages {\n additionalProperties: (key: string) => string;\n required: (key: string) => string;\n enum: (values: readonly string[]) => string;\n type: (type: string) => string;\n minLength: (limit: number) => string;\n maxLength: (limit: number) => string;\n /** 書けない字を読めない形の決まりでは `undefined` */\n pattern: (forbidden: Forbidden | undefined) => string;\n minItems: (limit: number) => string;\n maxItems: (limit: number) => string;\n minimum: (limit: number) => string;\n const: (value: string) => string;\n /** どの欄の組み合わせか判らない場所では `undefined` */\n not: (allowed: Allowed | undefined) => string;\n /** 状態遷移図の箱の名札に、始まりと終わりの印の名前 (`names`) を書いた */\n reserved: (names: readonly string[]) => string;\n /** `kind` の図だけが書ける出来事の種類 (`types`) を、別の種類の図に書いた (#3164) */\n kindOnly: (types: readonly string[], kind: string) => string;\n /** 16 進の字を `min` から `max` 字で書く決まり (commit の hash、#3164) */\n hex: (min: number, max: number) => string;\n /** 数と単位 (`units`) の組で書く決まり (時間軸の図の目盛りの長さ、#3165) */\n duration: (units: readonly string[]) => string;\n /** 分数か百分率で書く決まり (物差しの線、#3165) */\n ratio: string;\n /** 頁を移る形だけを書ける決まり (箱の飛び先と段の出典の URL、#3199) */\n url: string;\n /** 選べる決まりがどれも欄が足りない時の、足りない欄。それ以外の時は空 */\n anyOf: (fields: readonly string[]) => string;\n oneOf: string;\n discriminator: (tag: string, values: readonly string[]) => string;\n /** 道具より新しい版の図 */\n newer: (version: number, tool: number) => string;\n}\n\nconst TYPES_JA: Record<string, string> = {\n string: \"文字列にする\",\n integer: \"整数にする\",\n number: \"数にする\",\n object: \"オブジェクトにする\",\n array: \"配列にする\",\n boolean: \"true か false にする\",\n null: \"null にする\",\n};\n\nconst TYPES_EN: Record<string, string> = {\n string: \"Use a string\",\n integer: \"Use an integer\",\n number: \"Use a number\",\n object: \"Use an object\",\n array: \"Use an array\",\n boolean: \"Use true or false\",\n null: \"Use null\",\n};\n\nconst plural = (count: number, word: string): string => `${count} ${word}${count === 1 ? \"\" : \"s\"}`;\n\nconst ja: FieldMessages = {\n additionalProperties: (key) => `${key} という欄は書けない`,\n required: (key) => `${key} の欄が要る`,\n enum: (values) => `${values.join(\" / \")} のどれかにする`,\n type: (type) => TYPES_JA[type] ?? `${type} にする`,\n minLength: (limit) => `${limit} 字以上書く`,\n maxLength: (limit) => `${limit} 字までにする`,\n pattern: (forbidden) =>\n forbidden ? `${forbidden.space ? \"空白と \" : \"\"}${forbidden.chars.join(\" \")} は使えない` : \"使えない字が入っている\",\n minItems: (limit) => `${limit} つ以上書く`,\n maxItems: (limit) => `${limit} つまでにする`,\n minimum: (limit) => `${limit} 以上にする`,\n const: (value) => `${value} にする`,\n not: (allowed) => (allowed ? `${allowed.field} の欄は kind が ${allowed.kind} の時だけ書ける` : \"この欄の組み合わせは書けない\"),\n reserved: (names) => `${names.join(\" と \")} は状態遷移図の始まりと終わりの印の名前で、箱の名札に使えない`,\n kindOnly: (types, kind) => `${types.join(\" と \")} の出来事は kind が ${kind} の時だけ書ける`,\n hex: (min, max) => `0 から 9 と a から f の字で ${min} から ${max} 字にする`,\n duration: (units) => `数と単位 (${units.join(\" / \")}) の組で書く (12s など)`,\n ratio: \"分数 (2/3) か百分率 (97%) で書く\",\n url: \"/ で始まる path か、http:// か https:// で始まる URL にする\",\n anyOf: (fields) =>\n fields.length > 0 ? `${fields.join(\" か \")} の${fields.length === 2 ? \"どちらか\" : \"どれか\"}の欄が要る` : \"書ける形のどれにも合わない\",\n oneOf: \"書ける形のどれか 1 つだけに合わせる\",\n discriminator: (tag, values) => `${tag} は ${values.join(\" / \")} のどれかにする`,\n newer: (version, tool) => `版 ${version} の図は、この道具 (版 ${tool}) より新しいので読めない。道具を新しくする`,\n};\n\nconst en: FieldMessages = {\n additionalProperties: (key) => `The ${key} field is not allowed`,\n required: (key) => `The ${key} field is required`,\n enum: (values) => `Use one of ${values.join(\" / \")}`,\n type: (type) => TYPES_EN[type] ?? `Use ${type}`,\n minLength: (limit) => `Write at least ${plural(limit, \"character\")}`,\n maxLength: (limit) => `Write at most ${plural(limit, \"character\")}`,\n pattern: (forbidden) =>\n forbidden\n ? `Cannot contain ${forbidden.space ? \"spaces or \" : \"\"}${forbidden.chars.join(\" \")}`\n : \"Contains characters that are not allowed\",\n minItems: (limit) => `Write at least ${plural(limit, \"item\")}`,\n maxItems: (limit) => `Write at most ${plural(limit, \"item\")}`,\n minimum: (limit) => `Use ${limit} or greater`,\n const: (value) => `Use ${value}`,\n not: (allowed) => (allowed ? `The ${allowed.field} field is allowed only when kind is ${allowed.kind}` : \"This combination of fields is not allowed\"),\n reserved: (names) => `${names.join(\" and \")} name the start and end marks of a state diagram and cannot be box ids`,\n kindOnly: (types, kind) => `${types.join(\" and \")} events are allowed only when kind is ${kind}`,\n hex: (min, max) => `Use ${min} to ${max} characters of 0-9 and a-f`,\n duration: (units) => `Write a number and a unit (${units.join(\" / \")}), such as 12s`,\n ratio: \"Write a fraction (2/3) or a percentage (97%)\",\n url: \"Use a path that starts with / or a URL that starts with http:// or https://\",\n anyOf: (fields) => (fields.length > 0 ? `Write one of the ${fields.join(\" or \")} fields` : \"Does not match any of the allowed shapes\"),\n oneOf: \"Match exactly one of the allowed shapes\",\n discriminator: (tag, values) => `${tag} is one of ${values.join(\" / \")}`,\n newer: (version, tool) => `Version ${version} diagrams are newer than this tool (version ${tool}) and cannot be read. Update the tool`,\n};\n\nexport const FIELD_MESSAGES: Record<NotationLang, FieldMessages> = { ja, en };\n","/* eslint-disable */\n// packages/dragon/scripts/build-validator.mjs が diagram.schema.json から書き出した。手で直さない\nfunction ucs2length(str) {\n let length = 0;\n for (const _ of str) length++;\n return length;\n}\nexport const validate = validate10;export default validate10;const schema11 = {\"title\":\"dragon の図の原本\",\"description\":\"区画、箱、線、運ぶ物、段、中身の帯の 6 部品を共通の骨組みに置き、図の種類だけの物は種類の欄に置く。座標は持たない。箱は枝分かれの図と時間軸の図と木の図だけが持たなくてよい。列の図の箱は列になる。\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"version\",\"kind\",\"title\",\"boxes\",\"steps\"],\"properties\":{\"version\":{\"description\":\"形式の版\",\"type\":\"integer\",\"minimum\":1},\"kind\":{\"description\":\"図の種類\",\"enum\":[\"sequence\",\"architecture\",\"state\",\"git\",\"time\",\"tree\",\"lineup\"]},\"title\":{\"$ref\":\"#/definitions/text\"},\"view\":{\"description\":\"見せ方。書かなければ字の大きさで選ぶ。fixed は全体を止めて中だけ動かし、follow は寄って動かし全体図で今どこかを示す\",\"enum\":[\"fixed\",\"follow\"]},\"regions\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/region\"}},\"boxes\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/box\"}},\"strip\":{\"$ref\":\"#/definitions/strip\"},\"steps\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/step\"}},\"sequence\":{\"$ref\":\"#/definitions/sequence\"},\"state\":{\"$ref\":\"#/definitions/state\"},\"git\":{\"$ref\":\"#/definitions/git\"},\"time\":{\"$ref\":\"#/definitions/time\"},\"lineup\":{\"$ref\":\"#/definitions/lineup\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"sequence\"}}},\"then\":{\"required\":[\"sequence\"],\"properties\":{\"boxes\":{\"minItems\":1},\"steps\":{\"$ref\":\"#/definitions/plainSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"properties\":{\"sequence\":{\"$ref\":\"#/definitions/absent\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"state\"}}},\"then\":{\"properties\":{\"boxes\":{\"minItems\":1,\"items\":{\"properties\":{\"id\":{\"description\":\"始まりと終わりの印の名前は箱の名札に使えない\",\"not\":{\"enum\":[\"start\",\"finish\"]}}}}},\"steps\":{\"$ref\":\"#/definitions/plainSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"git\"}}},\"then\":{\"required\":[\"git\"],\"properties\":{\"steps\":{\"$ref\":\"#/definitions/gitSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"time\"}}},\"then\":{\"required\":[\"time\"],\"properties\":{\"steps\":{\"$ref\":\"#/definitions/timeSteps\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"tree\"}}},\"then\":{\"properties\":{\"steps\":{\"$ref\":\"#/definitions/treeSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"lineup\"}}},\"then\":{\"required\":[\"lineup\"],\"properties\":{\"boxes\":{\"minItems\":1,\"items\":{\"properties\":{\"icon\":{\"$ref\":\"#/definitions/absent\"},\"link\":{\"$ref\":\"#/definitions/absent\"},\"region\":{\"$ref\":\"#/definitions/absent\"}}}},\"steps\":{\"$ref\":\"#/definitions/lineupSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"properties\":{\"boxes\":{\"minItems\":1},\"steps\":{\"$ref\":\"#/definitions/plainSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}}}}}}},\"definitions\":{\"text\":{\"type\":\"string\",\"minLength\":1},\"absent\":{\"description\":\"この図の種類では書けない欄\",\"not\":{}},\"plainSteps\":{\"description\":\"枝分かれの図でも時間軸の図でも木の図でも列の図でもない図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"gitSteps\":{\"description\":\"枝分かれの図の段。時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"timeSteps\":{\"description\":\"時間軸の図の段。枝分かれの図だけの出来事 (commit と branch) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}}}}}}}},\"treeSteps\":{\"description\":\"木の図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"lineupSteps\":{\"description\":\"列の図の段。線と処理と、枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (color) と、木の図だけの出来事 (leaf と node) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notWiredEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"treeEvent\":{\"description\":\"木の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"leaf\",\"node\"]}}},\"notLineupEvent\":{\"description\":\"列の図だけが書ける出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"line\",\"seal\",\"open\",\"pick\",\"stamp\"]}}}},\"notWiredEvent\":{\"description\":\"箱と線の図の出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"edge\",\"action\"]}}}},\"timeEvent\":{\"description\":\"時間軸の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"now\",\"mark\",\"span\"]}}},\"plainStrip\":{\"description\":\"時間軸の図でない図の中身の帯。物差しを書けない\",\"properties\":{\"meters\":{\"$ref\":\"#/definitions/absent\"}}},\"id\":{\"type\":\"string\",\"pattern\":\"^[^\\\\s\\\\[\\\\]「」=:]+$\"},\"color\":{\"enum\":[\"blue\",\"amber\",\"green\",\"violet\",\"rose\",\"slate\",\"coin\"]},\"region\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"note\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"}}},\"box\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"sub\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"},\"region\":{\"$ref\":\"#/definitions/id\"},\"link\":{\"description\":\"飛び先。描いた図ではこの箱がここへの link になる\",\"$ref\":\"#/definitions/url\"}}},\"strip\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"fields\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"fields\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/text\"}},\"meters\":{\"description\":\"物差しにする欄。時間軸の図だけが書ける\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/meter\"}}}},\"meter\":{\"description\":\"物差しの欄。line の割合の所に線を引き、set の値まで針と一緒に満ちる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"field\",\"line\"],\"properties\":{\"field\":{\"$ref\":\"#/definitions/text\"},\"line\":{\"$ref\":\"#/definitions/ratio\"}}},\"ratio\":{\"description\":\"割合。分数 (2/3) か百分率 (97%)\",\"type\":\"string\",\"pattern\":\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"},\"step\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"body\",\"events\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"body\":{\"$ref\":\"#/definitions/text\"},\"code\":{\"$ref\":\"#/definitions/text\"},\"sources\":{\"description\":\"段の出典。読み上げの段の一覧に、名前を URL への link にして書いた順に出す\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/source\"}},\"events\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/event\"}}}},\"source\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"url\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"url\":{\"$ref\":\"#/definitions/url\"}}},\"url\":{\"description\":\"頁を移る形。/ で始まる path か、http:// か https:// で始まる URL\",\"type\":\"string\",\"pattern\":\"^(/|https?://)\"},\"event\":{\"description\":\"段の中で起きること。起きる順に並べる\",\"type\":\"object\",\"required\":[\"type\"],\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"description\":\"線。運ぶ物を載せて送る側から受ける側へ走る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"carry\"],\"properties\":{\"type\":{\"const\":\"edge\"},\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"},\"carry\":{\"$ref\":\"#/definitions/carry\"},\"labelSide\":{\"description\":\"線の名前を置く側 (寄せの指示)\",\"enum\":[\"above\",\"below\",\"left\",\"right\"]},\"at\":{\"description\":\"時間軸の図の拡大の帯で、線を引く列の目盛り\",\"$ref\":\"#/definitions/unit\"},\"into\":{\"description\":\"時間軸の図の拡大の帯で、受ける箱を選ぶ列の目盛り。書かなければ at の列\",\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"箱の中の処理\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"label\"],\"properties\":{\"type\":{\"const\":\"action\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"箱の下の小さな字の書き換え\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"swap\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"description\":\"時間軸の図の節目の丸の色\",\"$ref\":\"#/definitions/color\"}}},{\"description\":\"commit を積む。枝分かれの図だけが書ける。積んだ枝の札と、その枝を指す HEAD が進む。当て直し (copy) は枝の札を動かさず、merge commit (merge) は取り込む枝の先端も親に持つ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"branch\"],\"properties\":{\"type\":{\"const\":\"commit\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"copy\":{\"$ref\":\"#/definitions/id\"},\"merge\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"},\"note\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"枝を切る。枝分かれの図だけが書ける。枝の札を from の commit へ置き、HEAD をその枝へ移す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"branch\",\"from\"],\"properties\":{\"type\":{\"const\":\"branch\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"時間軸の図の今の時刻の針を、to の目盛りの終わりまで進める\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"to\"],\"properties\":{\"type\":{\"const\":\"now\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"時間軸の図の印の列 row の、from から to の目盛りの印の色を変える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"row\",\"from\",\"to\",\"color\"],\"properties\":{\"type\":{\"const\":\"mark\"},\"row\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"時間軸の図の from から to の目盛りに、括弧と字を出す。shape が box なら印の列を囲み、字を縁の札にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"text\"],\"properties\":{\"type\":{\"const\":\"span\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"shape\":{\"enum\":[\"box\"]},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"葉を出す。木の図だけが書ける。書いた段で葉の箱が現れる。hash を書くと箱に値を出し、名札を葉の下の札に出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\"],\"properties\":{\"type\":{\"const\":\"leaf\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"1 つ以上の子から親を組む。木の図だけが書ける。書いた段で親の箱と、子から親への木の線が現れる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"children\"],\"properties\":{\"type\":{\"const\":\"node\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"children\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"列の box の並びを items に書き換える。列の図だけが書ける。チップは前に居た列から滑り、どの列にも居なかったチップは弾んで現れ、列から外れたチップは消える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"items\"],\"properties\":{\"type\":{\"const\":\"line\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"items\":{\"type\":\"array\",\"minItems\":1,\"maxItems\":12,\"items\":{\"$ref\":\"#/definitions/id\"}}}},{\"description\":\"列 box に封をして、チップを隠す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"seal\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の封を開ける。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"open\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box を選ぶ。列の図だけが書ける。列の縁に色が付き、ほかの列が薄くなる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"pick\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の右に text の札を押す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"stamp\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"中身の帯の欄の値と札\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"field\"],\"anyOf\":[{\"required\":[\"value\"]},{\"required\":[\"tag\"]}],\"properties\":{\"type\":{\"const\":\"strip\"},\"field\":{\"$ref\":\"#/definitions/text\"},\"value\":{\"$ref\":\"#/definitions/text\"},\"tag\":{\"$ref\":\"#/definitions/text\"}}}]},\"carry\":{\"description\":\"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"kind\"],\"properties\":{\"kind\":{\"enum\":[\"envelope\",\"tag\",\"coin\",\"none\"]},\"text\":{\"$ref\":\"#/definitions/text\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"tag\"}}},\"then\":{\"required\":[\"text\"]},\"else\":{\"not\":{\"required\":[\"text\"]}}},\"sequence\":{\"description\":\"時系列図の種類の欄。生存線を左から並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"lifelines\"],\"properties\":{\"lifelines\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}}}},\"state\":{\"description\":\"状態遷移図の種類の欄。最初の段より前に書いた、移れるが段で通るとは限らない線\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"paths\"],\"properties\":{\"paths\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/path\"}}}},\"git\":{\"description\":\"枝分かれの図の種類の欄。枝を上から帯に並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"branches\"],\"properties\":{\"branches\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/branch\"}}}},\"branch\":{\"description\":\"枝。帯の左に名札と添え書きを置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"note\":{\"$ref\":\"#/definitions/text\"}}},\"hash\":{\"description\":\"commit と木の箱の hash。16 進の字で 4 から 40 字\",\"type\":\"string\",\"pattern\":\"^[0-9a-f]{4,40}$\"},\"lineup\":{\"description\":\"列の図の種類の欄。列に並べるチップ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"items\"],\"properties\":{\"items\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/item\"}}}},\"item\":{\"description\":\"チップ。color を書かないチップは薄い色で、label を書かないチップは色だけで出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"label\":{\"description\":\"チップに載せる字\",\"type\":\"string\",\"minLength\":1,\"maxLength\":4}}},\"time\":{\"description\":\"時間軸の図の種類の欄。目盛り、区切り、印の列、節目、拡大の範囲\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"scale\",\"rows\"],\"properties\":{\"scale\":{\"$ref\":\"#/definitions/scale\"},\"period\":{\"$ref\":\"#/definitions/period\"},\"rows\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/row\"}},\"points\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/point\"}},\"zoom\":{\"$ref\":\"#/definitions/zoom\"}}},\"scale\":{\"description\":\"目盛り。unit の名前の目盛りを length の長さで count 個並べ、最初の目盛りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"unit\",\"length\",\"count\"],\"properties\":{\"unit\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"$ref\":\"#/definitions/duration\"},\"count\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}},\"duration\":{\"description\":\"長さ。数と単位 (ms、s、min、h、d) の組\",\"type\":\"string\",\"pattern\":\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"},\"unit\":{\"description\":\"目盛りの位置。0 から数える\",\"type\":\"integer\",\"minimum\":0},\"period\":{\"description\":\"区切り。目盛り length 個ごとに name の区切りを置き、最初の区切りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"length\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}},\"row\":{\"description\":\"印の列。目盛りごとに印を 1 つ置き、empty の目盛りは空きの印にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"empty\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/unit\"}}}},\"point\":{\"description\":\"節目。at の目盛りの印の下に旗の丸と名札を置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"at\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"at\":{\"$ref\":\"#/definitions/unit\"}}},\"zoom\":{\"description\":\"拡大の範囲。from から to の目盛りごとに拡大の帯に列を作る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}},\"path\":{\"description\":\"移れる道。送る側に始まりの印 start、受ける側に終わりの印 finish を書ける。どの段にも出ない道は点線で描き、運ぶ物を走らせない\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}}}};const schema16 = {\"description\":\"この図の種類では書けない欄\",\"not\":{}};const schema74 = {\"type\":\"string\",\"minLength\":1};const schema12 = {\"description\":\"枝分かれの図でも時間軸の図でも木の図でも列の図でもない図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};const schema13 = {\"description\":\"時間軸の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"now\",\"mark\",\"span\"]}}};const schema14 = {\"description\":\"木の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"leaf\",\"node\"]}}};const schema15 = {\"description\":\"列の図だけが書ける出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"line\",\"seal\",\"open\",\"pick\",\"stamp\"]}}}};function validate11(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs8 = errors;const _errs9 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!((data4 === \"leaf\") || (data4 === \"node\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid9 = _errs9 === errors;if(valid9){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs14 = errors;const _errs15 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing2;if((data2.type === undefined) && (missing2 = \"type\")){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {if(data2.type !== undefined){let data5 = data2.type;if(!(((((data5 === \"line\") || (data5 === \"seal\")) || (data5 === \"open\")) || (data5 === \"pick\")) || (data5 === \"stamp\"))){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}}var valid13 = _errs15 === errors;if(valid13){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data6 = data2.type;const _errs18 = errors;const _errs19 = errors;if(!((data6 === \"commit\") || (data6 === \"branch\"))){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var valid16 = _errs19 === errors;if(valid16){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data2.at !== undefined){const err11 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/at\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data2.into !== undefined){const err12 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/into\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data2.color !== undefined){const err13 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}}}}}}validate11.errors = vErrors;return errors === 0;}const schema19 = {\"description\":\"時間軸の図でない図の中身の帯。物差しを書けない\",\"properties\":{\"meters\":{\"$ref\":\"#/definitions/absent\"}}};function validate13(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.meters !== undefined){const err0 = {instancePath:instancePath+\"/meters\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}validate13.errors = vErrors;return errors === 0;}const schema28 = {\"description\":\"枝分かれの図の段。時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};function validate17(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs8 = errors;const _errs9 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!((data4 === \"leaf\") || (data4 === \"node\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid9 = _errs9 === errors;if(valid9){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs14 = errors;const _errs15 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing2;if((data2.type === undefined) && (missing2 = \"type\")){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {if(data2.type !== undefined){let data5 = data2.type;if(!(((((data5 === \"line\") || (data5 === \"seal\")) || (data5 === \"open\")) || (data5 === \"pick\")) || (data5 === \"stamp\"))){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}}var valid13 = _errs15 === errors;if(valid13){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.at !== undefined){const err9 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/at\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.into !== undefined){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/into\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data2.color !== undefined){const err11 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}}}}}}validate17.errors = vErrors;return errors === 0;}const schema39 = {\"description\":\"時間軸の図の段。枝分かれの図だけの出来事 (commit と branch) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}}}}}}}};function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs4 = errors;const _errs5 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!((data3 === \"leaf\") || (data3 === \"node\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid6 = _errs5 === errors;if(valid6){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs4;if(vErrors !== null){if(_errs4){vErrors.length = _errs4;}else {vErrors = null;}}}const _errs10 = errors;const _errs11 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!(((((data4 === \"line\") || (data4 === \"seal\")) || (data4 === \"open\")) || (data4 === \"pick\")) || (data4 === \"stamp\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid10 = _errs11 === errors;if(valid10){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data5 = data2.type;const _errs14 = errors;const _errs15 = errors;if(!((data5 === \"commit\") || (data5 === \"branch\"))){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid13 = _errs15 === errors;if(valid13){const err7 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}}}}}}}}}validate20.errors = vErrors;return errors === 0;}const schema46 = {\"description\":\"木の図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs9 = errors;const _errs10 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!(((((data4 === \"line\") || (data4 === \"seal\")) || (data4 === \"open\")) || (data4 === \"pick\")) || (data4 === \"stamp\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid10 = _errs10 === errors;if(valid10){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data5 = data2.type;const _errs13 = errors;const _errs14 = errors;if(!((data5 === \"commit\") || (data5 === \"branch\"))){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid13 = _errs14 === errors;if(valid13){const err7 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {errors = _errs13;if(vErrors !== null){if(_errs13){vErrors.length = _errs13;}else {vErrors = null;}}}}if(data2.at !== undefined){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/at\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.into !== undefined){const err9 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/into\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.color !== undefined){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}}}}}}validate22.errors = vErrors;return errors === 0;}const schema60 = {\"description\":\"列の図の段。線と処理と、枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (color) と、木の図だけの出来事 (leaf と node) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notWiredEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};const schema63 = {\"description\":\"箱と線の図の出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"edge\",\"action\"]}}}};function validate25(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs8 = errors;const _errs9 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!((data4 === \"leaf\") || (data4 === \"node\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid9 = _errs9 === errors;if(valid9){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs14 = errors;const _errs15 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing2;if((data2.type === undefined) && (missing2 = \"type\")){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {if(data2.type !== undefined){let data5 = data2.type;if(!((data5 === \"edge\") || (data5 === \"action\"))){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}}var valid13 = _errs15 === errors;if(valid13){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notWiredEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data6 = data2.type;const _errs18 = errors;const _errs19 = errors;if(!((data6 === \"commit\") || (data6 === \"branch\"))){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var valid16 = _errs19 === errors;if(valid16){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data2.color !== undefined){const err11 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}}}}}}validate25.errors = vErrors;return errors === 0;}const schema75 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"note\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"}}};const schema76 = {\"type\":\"string\",\"pattern\":\"^[^\\\\s\\\\[\\\\]「」=:]+$\"};const schema79 = {\"enum\":[\"blue\",\"amber\",\"green\",\"violet\",\"rose\",\"slate\",\"coin\"]};const pattern0 = new RegExp(\"^[^\\\\s\\\\[\\\\]「」=:]+$\", \"u\");const func3 = ucs2length;function validate30(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((key0 === \"id\") || (key0 === \"name\")) || (key0 === \"note\")) || (key0 === \"color\")) || (key0 === \"icon\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.note !== undefined){let data2 = data.note;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === \"blue\") || (data3 === \"amber\")) || (data3 === \"green\")) || (data3 === \"violet\")) || (data3 === \"rose\")) || (data3 === \"slate\")) || (data3 === \"coin\"))){const err9 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === \"string\"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate30.errors = vErrors;return errors === 0;}const schema81 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"sub\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"},\"region\":{\"$ref\":\"#/definitions/id\"},\"link\":{\"description\":\"飛び先。描いた図ではこの箱がここへの link になる\",\"$ref\":\"#/definitions/url\"}}};const schema88 = {\"description\":\"頁を移る形。/ で始まる path か、http:// か https:// で始まる URL\",\"type\":\"string\",\"pattern\":\"^(/|https?://)\"};const pattern3 = new RegExp(\"^(/|https?://)\", \"u\");function validate32(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((((key0 === \"id\") || (key0 === \"name\")) || (key0 === \"sub\")) || (key0 === \"color\")) || (key0 === \"icon\")) || (key0 === \"region\")) || (key0 === \"link\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.sub !== undefined){let data2 = data.sub;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+\"/sub\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/sub\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === \"blue\") || (data3 === \"amber\")) || (data3 === \"green\")) || (data3 === \"violet\")) || (data3 === \"rose\")) || (data3 === \"slate\")) || (data3 === \"coin\"))){const err9 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === \"string\"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.region !== undefined){let data5 = data.region;if(typeof data5 === \"string\"){if(!pattern0.test(data5)){const err12 = {instancePath:instancePath+\"/region\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+\"/region\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.link !== undefined){let data6 = data.link;if(typeof data6 === \"string\"){if(!pattern3.test(data6)){const err14 = {instancePath:instancePath+\"/link\",schemaPath:\"#/definitions/url/pattern\",keyword:\"pattern\",params:{pattern: \"^(/|https?://)\"},message:\"must match pattern \\\"\"+\"^(/|https?://)\"+\"\\\"\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+\"/link\",schemaPath:\"#/definitions/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate32.errors = vErrors;return errors === 0;}const schema89 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"fields\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"fields\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/text\"}},\"meters\":{\"description\":\"物差しにする欄。時間軸の図だけが書ける\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/meter\"}}}};const schema92 = {\"description\":\"物差しの欄。line の割合の所に線を引き、set の値まで針と一緒に満ちる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"field\",\"line\"],\"properties\":{\"field\":{\"$ref\":\"#/definitions/text\"},\"line\":{\"$ref\":\"#/definitions/ratio\"}}};const schema94 = {\"description\":\"割合。分数 (2/3) か百分率 (97%)\",\"type\":\"string\",\"pattern\":\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"};const pattern4 = new RegExp(\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\", \"u\");function validate35(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.field === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"field\"},message:\"must have required property '\"+\"field\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.line === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"line\"},message:\"must have required property '\"+\"line\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"field\") || (key0 === \"line\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.field !== undefined){let data0 = data.field;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.line !== undefined){let data1 = data.line;if(typeof data1 === \"string\"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+\"/line\",schemaPath:\"#/definitions/ratio/pattern\",keyword:\"pattern\",params:{pattern: \"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"},message:\"must match pattern \\\"\"+\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/line\",schemaPath:\"#/definitions/ratio/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate35.errors = vErrors;return errors === 0;}function validate34(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.fields === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"fields\"},message:\"must have required property '\"+\"fields\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === \"title\") || (key0 === \"fields\")) || (key0 === \"meters\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.title !== undefined){let data0 = data.title;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fields !== undefined){let data1 = data.fields;if(Array.isArray(data1)){if(data1.length < 1){const err5 = {instancePath:instancePath+\"/fields\",schemaPath:\"#/properties/fields/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(typeof data2 === \"string\"){if(func3(data2) < 1){const err6 = {instancePath:instancePath+\"/fields/\" + i0,schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/fields/\" + i0,schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath:instancePath+\"/fields\",schemaPath:\"#/properties/fields/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meters !== undefined){let data3 = data.meters;if(Array.isArray(data3)){if(data3.length < 1){const err9 = {instancePath:instancePath+\"/meters\",schemaPath:\"#/properties/meters/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){if(!(validate35(data3[i1], {instancePath:instancePath+\"/meters/\" + i1,parentData:data3,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+\"/meters\",schemaPath:\"#/properties/meters/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate34.errors = vErrors;return errors === 0;}const schema95 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"body\",\"events\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"body\":{\"$ref\":\"#/definitions/text\"},\"code\":{\"$ref\":\"#/definitions/text\"},\"sources\":{\"description\":\"段の出典。読み上げの段の一覧に、名前を URL への link にして書いた順に出す\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/source\"}},\"events\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/event\"}}}};const schema99 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"url\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"url\":{\"$ref\":\"#/definitions/url\"}}};function validate39(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.url === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"url\"},message:\"must have required property '\"+\"url\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"name\") || (key0 === \"url\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.name !== undefined){let data0 = data.name;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.url !== undefined){let data1 = data.url;if(typeof data1 === \"string\"){if(!pattern3.test(data1)){const err5 = {instancePath:instancePath+\"/url\",schemaPath:\"#/definitions/url/pattern\",keyword:\"pattern\",params:{pattern: \"^(/|https?://)\"},message:\"must match pattern \\\"\"+\"^(/|https?://)\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/url\",schemaPath:\"#/definitions/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate39.errors = vErrors;return errors === 0;}const schema102 = {\"description\":\"段の中で起きること。起きる順に並べる\",\"type\":\"object\",\"required\":[\"type\"],\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"description\":\"線。運ぶ物を載せて送る側から受ける側へ走る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"carry\"],\"properties\":{\"type\":{\"const\":\"edge\"},\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"},\"carry\":{\"$ref\":\"#/definitions/carry\"},\"labelSide\":{\"description\":\"線の名前を置く側 (寄せの指示)\",\"enum\":[\"above\",\"below\",\"left\",\"right\"]},\"at\":{\"description\":\"時間軸の図の拡大の帯で、線を引く列の目盛り\",\"$ref\":\"#/definitions/unit\"},\"into\":{\"description\":\"時間軸の図の拡大の帯で、受ける箱を選ぶ列の目盛り。書かなければ at の列\",\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"箱の中の処理\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"label\"],\"properties\":{\"type\":{\"const\":\"action\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"箱の下の小さな字の書き換え\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"swap\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"description\":\"時間軸の図の節目の丸の色\",\"$ref\":\"#/definitions/color\"}}},{\"description\":\"commit を積む。枝分かれの図だけが書ける。積んだ枝の札と、その枝を指す HEAD が進む。当て直し (copy) は枝の札を動かさず、merge commit (merge) は取り込む枝の先端も親に持つ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"branch\"],\"properties\":{\"type\":{\"const\":\"commit\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"copy\":{\"$ref\":\"#/definitions/id\"},\"merge\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"},\"note\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"枝を切る。枝分かれの図だけが書ける。枝の札を from の commit へ置き、HEAD をその枝へ移す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"branch\",\"from\"],\"properties\":{\"type\":{\"const\":\"branch\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"時間軸の図の今の時刻の針を、to の目盛りの終わりまで進める\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"to\"],\"properties\":{\"type\":{\"const\":\"now\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"時間軸の図の印の列 row の、from から to の目盛りの印の色を変える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"row\",\"from\",\"to\",\"color\"],\"properties\":{\"type\":{\"const\":\"mark\"},\"row\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"時間軸の図の from から to の目盛りに、括弧と字を出す。shape が box なら印の列を囲み、字を縁の札にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"text\"],\"properties\":{\"type\":{\"const\":\"span\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"shape\":{\"enum\":[\"box\"]},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"葉を出す。木の図だけが書ける。書いた段で葉の箱が現れる。hash を書くと箱に値を出し、名札を葉の下の札に出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\"],\"properties\":{\"type\":{\"const\":\"leaf\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"1 つ以上の子から親を組む。木の図だけが書ける。書いた段で親の箱と、子から親への木の線が現れる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"children\"],\"properties\":{\"type\":{\"const\":\"node\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"children\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"列の box の並びを items に書き換える。列の図だけが書ける。チップは前に居た列から滑り、どの列にも居なかったチップは弾んで現れ、列から外れたチップは消える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"items\"],\"properties\":{\"type\":{\"const\":\"line\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"items\":{\"type\":\"array\",\"minItems\":1,\"maxItems\":12,\"items\":{\"$ref\":\"#/definitions/id\"}}}},{\"description\":\"列 box に封をして、チップを隠す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"seal\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の封を開ける。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"open\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box を選ぶ。列の図だけが書ける。列の縁に色が付き、ほかの列が薄くなる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"pick\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の右に text の札を押す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"stamp\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"中身の帯の欄の値と札\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"field\"],\"anyOf\":[{\"required\":[\"value\"]},{\"required\":[\"tag\"]}],\"properties\":{\"type\":{\"const\":\"strip\"},\"field\":{\"$ref\":\"#/definitions/text\"},\"value\":{\"$ref\":\"#/definitions/text\"},\"tag\":{\"$ref\":\"#/definitions/text\"}}}]};const schema108 = {\"description\":\"目盛りの位置。0 から数える\",\"type\":\"integer\",\"minimum\":0};const schema119 = {\"description\":\"commit と木の箱の hash。16 進の字で 4 から 40 字\",\"type\":\"string\",\"pattern\":\"^[0-9a-f]{4,40}$\"};const pattern14 = new RegExp(\"^[0-9a-f]{4,40}$\", \"u\");const schema106 = {\"description\":\"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"kind\"],\"properties\":{\"kind\":{\"enum\":[\"envelope\",\"tag\",\"coin\",\"none\"]},\"text\":{\"$ref\":\"#/definitions/text\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"tag\"}}},\"then\":{\"required\":[\"text\"]},\"else\":{\"not\":{\"required\":[\"text\"]}}};function validate42(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = \"kind\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if(\"tag\" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.text === undefined){const err2 = {instancePath,schemaPath:\"#/then/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = \"then\";}else {const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing1;if((data.text === undefined) && (missing1 = \"text\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var valid2 = _errs7 === errors;if(valid2){const err4 = {instancePath,schemaPath:\"#/else/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid0 = _valid0;ifClause0 = \"else\";}if(!valid0){const err5 = {instancePath,schemaPath:\"#/if\",keyword:\"if\",params:{failingKeyword: ifClause0},message:\"must match \\\"\"+ifClause0+\"\\\" schema\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.kind === undefined){const err6 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind\"},message:\"must have required property '\"+\"kind\"+\"'\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!((key0 === \"kind\") || (key0 === \"text\"))){const err7 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.kind !== undefined){let data1 = data.kind;if(!((((data1 === \"envelope\") || (data1 === \"tag\")) || (data1 === \"coin\")) || (data1 === \"none\"))){const err8 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/enum\",keyword:\"enum\",params:{allowedValues: schema106.properties.kind.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.text !== undefined){let data2 = data.text;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err9 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate42.errors = vErrors;return errors === 0;}function validate41(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const tag0 = data.type;if(typeof tag0 == \"string\"){if(tag0 === \"edge\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err1 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.from === undefined){const err2 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.to === undefined){const err3 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.carry === undefined){const err4 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"carry\"},message:\"must have required property '\"+\"carry\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === \"type\") || (key0 === \"from\")) || (key0 === \"to\")) || (key0 === \"label\")) || (key0 === \"carry\")) || (key0 === \"labelSide\")) || (key0 === \"at\")) || (key0 === \"into\"))){const err5 = {instancePath,schemaPath:\"#/oneOf/0/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.type !== undefined){if(\"edge\" !== data.type){const err6 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/0/properties/type/const\",keyword:\"const\",params:{allowedValue: \"edge\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.from !== undefined){let data1 = data.from;if(typeof data1 === \"string\"){if(!pattern0.test(data1)){const err7 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.to !== undefined){let data2 = data.to;if(typeof data2 === \"string\"){if(!pattern0.test(data2)){const err9 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.label !== undefined){let data3 = data.label;if(typeof data3 === \"string\"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.carry !== undefined){if(!(validate42(data.carry, {instancePath:instancePath+\"/carry\",parentData:data,parentDataProperty:\"carry\",rootData}))){vErrors = vErrors === null ? validate42.errors : vErrors.concat(validate42.errors);errors = vErrors.length;}}if(data.labelSide !== undefined){let data5 = data.labelSide;if(!((((data5 === \"above\") || (data5 === \"below\")) || (data5 === \"left\")) || (data5 === \"right\"))){const err13 = {instancePath:instancePath+\"/labelSide\",schemaPath:\"#/oneOf/0/properties/labelSide/enum\",keyword:\"enum\",params:{allowedValues: schema102.oneOf[0].properties.labelSide.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.at !== undefined){let data6 = data.at;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err14 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if((typeof data6 == \"number\") && (isFinite(data6))){if(data6 < 0 || isNaN(data6)){const err15 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}if(data.into !== undefined){let data7 = data.into;if(!(((typeof data7 == \"number\") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))){const err16 = {instancePath:instancePath+\"/into\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if((typeof data7 == \"number\") && (isFinite(data7))){if(data7 < 0 || isNaN(data7)){const err17 = {instancePath:instancePath+\"/into\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}}else {const err18 = {instancePath,schemaPath:\"#/oneOf/0/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}else if(tag0 === \"action\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err19 = {instancePath,schemaPath:\"#/oneOf/1/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data.box === undefined){const err20 = {instancePath,schemaPath:\"#/oneOf/1/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data.label === undefined){const err21 = {instancePath,schemaPath:\"#/oneOf/1/required\",keyword:\"required\",params:{missingProperty: \"label\"},message:\"must have required property '\"+\"label\"+\"'\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}for(const key1 in data){if(!(((key1 === \"type\") || (key1 === \"box\")) || (key1 === \"label\"))){const err22 = {instancePath,schemaPath:\"#/oneOf/1/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key1},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.type !== undefined){if(\"action\" !== data.type){const err23 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/1/properties/type/const\",keyword:\"const\",params:{allowedValue: \"action\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.box !== undefined){let data9 = data.box;if(typeof data9 === \"string\"){if(!pattern0.test(data9)){const err24 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.label !== undefined){let data10 = data.label;if(typeof data10 === \"string\"){if(func3(data10) < 1){const err26 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}else {const err27 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath,schemaPath:\"#/oneOf/1/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else if(tag0 === \"swap\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err29 = {instancePath,schemaPath:\"#/oneOf/2/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(data.box === undefined){const err30 = {instancePath,schemaPath:\"#/oneOf/2/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(data.text === undefined){const err31 = {instancePath,schemaPath:\"#/oneOf/2/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}for(const key2 in data){if(!((((key2 === \"type\") || (key2 === \"box\")) || (key2 === \"text\")) || (key2 === \"color\"))){const err32 = {instancePath,schemaPath:\"#/oneOf/2/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key2},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data.type !== undefined){if(\"swap\" !== data.type){const err33 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/2/properties/type/const\",keyword:\"const\",params:{allowedValue: \"swap\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data.box !== undefined){let data12 = data.box;if(typeof data12 === \"string\"){if(!pattern0.test(data12)){const err34 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data.text !== undefined){let data13 = data.text;if(typeof data13 === \"string\"){if(func3(data13) < 1){const err36 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.color !== undefined){let data14 = data.color;if(!(((((((data14 === \"blue\") || (data14 === \"amber\")) || (data14 === \"green\")) || (data14 === \"violet\")) || (data14 === \"rose\")) || (data14 === \"slate\")) || (data14 === \"coin\"))){const err38 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}else {const err39 = {instancePath,schemaPath:\"#/oneOf/2/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else if(tag0 === \"commit\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err40 = {instancePath,schemaPath:\"#/oneOf/3/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}if(data.id === undefined){const err41 = {instancePath,schemaPath:\"#/oneOf/3/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(data.branch === undefined){const err42 = {instancePath,schemaPath:\"#/oneOf/3/required\",keyword:\"required\",params:{missingProperty: \"branch\"},message:\"must have required property '\"+\"branch\"+\"'\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}for(const key3 in data){if(!(((((((key3 === \"type\") || (key3 === \"id\")) || (key3 === \"branch\")) || (key3 === \"copy\")) || (key3 === \"merge\")) || (key3 === \"hash\")) || (key3 === \"note\"))){const err43 = {instancePath,schemaPath:\"#/oneOf/3/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key3},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data.type !== undefined){if(\"commit\" !== data.type){const err44 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/3/properties/type/const\",keyword:\"const\",params:{allowedValue: \"commit\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data.id !== undefined){let data16 = data.id;if(typeof data16 === \"string\"){if(!pattern0.test(data16)){const err45 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}else {const err46 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data.branch !== undefined){let data17 = data.branch;if(typeof data17 === \"string\"){if(!pattern0.test(data17)){const err47 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data.copy !== undefined){let data18 = data.copy;if(typeof data18 === \"string\"){if(!pattern0.test(data18)){const err49 = {instancePath:instancePath+\"/copy\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+\"/copy\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data.merge !== undefined){let data19 = data.merge;if(typeof data19 === \"string\"){if(!pattern0.test(data19)){const err51 = {instancePath:instancePath+\"/merge\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+\"/merge\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}if(data.hash !== undefined){let data20 = data.hash;if(typeof data20 === \"string\"){if(!pattern14.test(data20)){const err53 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{4,40}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{4,40}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data.note !== undefined){let data21 = data.note;if(typeof data21 === \"string\"){if(func3(data21) < 1){const err55 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}else {const err56 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath,schemaPath:\"#/oneOf/3/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}else if(tag0 === \"branch\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err58 = {instancePath,schemaPath:\"#/oneOf/4/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(data.branch === undefined){const err59 = {instancePath,schemaPath:\"#/oneOf/4/required\",keyword:\"required\",params:{missingProperty: \"branch\"},message:\"must have required property '\"+\"branch\"+\"'\"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data.from === undefined){const err60 = {instancePath,schemaPath:\"#/oneOf/4/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}for(const key4 in data){if(!(((key4 === \"type\") || (key4 === \"branch\")) || (key4 === \"from\"))){const err61 = {instancePath,schemaPath:\"#/oneOf/4/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key4},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data.type !== undefined){if(\"branch\" !== data.type){const err62 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/4/properties/type/const\",keyword:\"const\",params:{allowedValue: \"branch\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data.branch !== undefined){let data23 = data.branch;if(typeof data23 === \"string\"){if(!pattern0.test(data23)){const err63 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}else {const err64 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data.from !== undefined){let data24 = data.from;if(typeof data24 === \"string\"){if(!pattern0.test(data24)){const err65 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}}else {const err67 = {instancePath,schemaPath:\"#/oneOf/4/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else if(tag0 === \"now\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err68 = {instancePath,schemaPath:\"#/oneOf/5/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}if(data.to === undefined){const err69 = {instancePath,schemaPath:\"#/oneOf/5/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}for(const key5 in data){if(!((key5 === \"type\") || (key5 === \"to\"))){const err70 = {instancePath,schemaPath:\"#/oneOf/5/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key5},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data.type !== undefined){if(\"now\" !== data.type){const err71 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/5/properties/type/const\",keyword:\"const\",params:{allowedValue: \"now\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data.to !== undefined){let data26 = data.to;if(!(((typeof data26 == \"number\") && (!(data26 % 1) && !isNaN(data26))) && (isFinite(data26)))){const err72 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if((typeof data26 == \"number\") && (isFinite(data26))){if(data26 < 0 || isNaN(data26)){const err73 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}}}else {const err74 = {instancePath,schemaPath:\"#/oneOf/5/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else if(tag0 === \"mark\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err75 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}if(data.row === undefined){const err76 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"row\"},message:\"must have required property '\"+\"row\"+\"'\"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}if(data.from === undefined){const err77 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}if(data.to === undefined){const err78 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(data.color === undefined){const err79 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"color\"},message:\"must have required property '\"+\"color\"+\"'\"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}for(const key6 in data){if(!(((((key6 === \"type\") || (key6 === \"row\")) || (key6 === \"from\")) || (key6 === \"to\")) || (key6 === \"color\"))){const err80 = {instancePath,schemaPath:\"#/oneOf/6/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key6},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}if(data.type !== undefined){if(\"mark\" !== data.type){const err81 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/6/properties/type/const\",keyword:\"const\",params:{allowedValue: \"mark\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data.row !== undefined){let data28 = data.row;if(typeof data28 === \"string\"){if(!pattern0.test(data28)){const err82 = {instancePath:instancePath+\"/row\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}else {const err83 = {instancePath:instancePath+\"/row\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(data.from !== undefined){let data29 = data.from;if(!(((typeof data29 == \"number\") && (!(data29 % 1) && !isNaN(data29))) && (isFinite(data29)))){const err84 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}if((typeof data29 == \"number\") && (isFinite(data29))){if(data29 < 0 || isNaN(data29)){const err85 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}}if(data.to !== undefined){let data30 = data.to;if(!(((typeof data30 == \"number\") && (!(data30 % 1) && !isNaN(data30))) && (isFinite(data30)))){const err86 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if((typeof data30 == \"number\") && (isFinite(data30))){if(data30 < 0 || isNaN(data30)){const err87 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}}if(data.color !== undefined){let data31 = data.color;if(!(((((((data31 === \"blue\") || (data31 === \"amber\")) || (data31 === \"green\")) || (data31 === \"violet\")) || (data31 === \"rose\")) || (data31 === \"slate\")) || (data31 === \"coin\"))){const err88 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}}else {const err89 = {instancePath,schemaPath:\"#/oneOf/6/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else if(tag0 === \"span\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err90 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(data.from === undefined){const err91 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}if(data.to === undefined){const err92 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}if(data.text === undefined){const err93 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}for(const key7 in data){if(!((((((key7 === \"type\") || (key7 === \"from\")) || (key7 === \"to\")) || (key7 === \"text\")) || (key7 === \"shape\")) || (key7 === \"color\"))){const err94 = {instancePath,schemaPath:\"#/oneOf/7/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key7},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data.type !== undefined){if(\"span\" !== data.type){const err95 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/7/properties/type/const\",keyword:\"const\",params:{allowedValue: \"span\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data.from !== undefined){let data33 = data.from;if(!(((typeof data33 == \"number\") && (!(data33 % 1) && !isNaN(data33))) && (isFinite(data33)))){const err96 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if((typeof data33 == \"number\") && (isFinite(data33))){if(data33 < 0 || isNaN(data33)){const err97 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}if(data.to !== undefined){let data34 = data.to;if(!(((typeof data34 == \"number\") && (!(data34 % 1) && !isNaN(data34))) && (isFinite(data34)))){const err98 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}if((typeof data34 == \"number\") && (isFinite(data34))){if(data34 < 0 || isNaN(data34)){const err99 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}}if(data.text !== undefined){let data35 = data.text;if(typeof data35 === \"string\"){if(func3(data35) < 1){const err100 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}else {const err101 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data.shape !== undefined){if(!(data.shape === \"box\")){const err102 = {instancePath:instancePath+\"/shape\",schemaPath:\"#/oneOf/7/properties/shape/enum\",keyword:\"enum\",params:{allowedValues: schema102.oneOf[7].properties.shape.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data.color !== undefined){let data37 = data.color;if(!(((((((data37 === \"blue\") || (data37 === \"amber\")) || (data37 === \"green\")) || (data37 === \"violet\")) || (data37 === \"rose\")) || (data37 === \"slate\")) || (data37 === \"coin\"))){const err103 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}}else {const err104 = {instancePath,schemaPath:\"#/oneOf/7/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else if(tag0 === \"leaf\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err105 = {instancePath,schemaPath:\"#/oneOf/8/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if(data.id === undefined){const err106 = {instancePath,schemaPath:\"#/oneOf/8/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}for(const key8 in data){if(!(((key8 === \"type\") || (key8 === \"id\")) || (key8 === \"hash\"))){const err107 = {instancePath,schemaPath:\"#/oneOf/8/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key8},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data.type !== undefined){if(\"leaf\" !== data.type){const err108 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/8/properties/type/const\",keyword:\"const\",params:{allowedValue: \"leaf\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data.id !== undefined){let data39 = data.id;if(typeof data39 === \"string\"){if(!pattern0.test(data39)){const err109 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}else {const err110 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data.hash !== undefined){let data40 = data.hash;if(typeof data40 === \"string\"){if(!pattern14.test(data40)){const err111 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{4,40}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{4,40}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}else {const err112 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}}else {const err113 = {instancePath,schemaPath:\"#/oneOf/8/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}else if(tag0 === \"node\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err114 = {instancePath,schemaPath:\"#/oneOf/9/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(data.id === undefined){const err115 = {instancePath,schemaPath:\"#/oneOf/9/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}if(data.children === undefined){const err116 = {instancePath,schemaPath:\"#/oneOf/9/required\",keyword:\"required\",params:{missingProperty: \"children\"},message:\"must have required property '\"+\"children\"+\"'\"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}for(const key9 in data){if(!((((key9 === \"type\") || (key9 === \"id\")) || (key9 === \"children\")) || (key9 === \"hash\"))){const err117 = {instancePath,schemaPath:\"#/oneOf/9/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key9},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data.type !== undefined){if(\"node\" !== data.type){const err118 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/9/properties/type/const\",keyword:\"const\",params:{allowedValue: \"node\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data.id !== undefined){let data42 = data.id;if(typeof data42 === \"string\"){if(!pattern0.test(data42)){const err119 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data.children !== undefined){let data43 = data.children;if(Array.isArray(data43)){if(data43.length < 1){const err121 = {instancePath:instancePath+\"/children\",schemaPath:\"#/oneOf/9/properties/children/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}const len0 = data43.length;for(let i0=0; i0<len0; i0++){let data44 = data43[i0];if(typeof data44 === \"string\"){if(!pattern0.test(data44)){const err122 = {instancePath:instancePath+\"/children/\" + i0,schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}else {const err123 = {instancePath:instancePath+\"/children/\" + i0,schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}}else {const err124 = {instancePath:instancePath+\"/children\",schemaPath:\"#/oneOf/9/properties/children/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data.hash !== undefined){let data45 = data.hash;if(typeof data45 === \"string\"){if(!pattern14.test(data45)){const err125 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{4,40}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{4,40}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}}else {const err127 = {instancePath,schemaPath:\"#/oneOf/9/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else if(tag0 === \"line\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err128 = {instancePath,schemaPath:\"#/oneOf/10/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}if(data.box === undefined){const err129 = {instancePath,schemaPath:\"#/oneOf/10/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data.items === undefined){const err130 = {instancePath,schemaPath:\"#/oneOf/10/required\",keyword:\"required\",params:{missingProperty: \"items\"},message:\"must have required property '\"+\"items\"+\"'\"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}for(const key10 in data){if(!(((key10 === \"type\") || (key10 === \"box\")) || (key10 === \"items\"))){const err131 = {instancePath,schemaPath:\"#/oneOf/10/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key10},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data.type !== undefined){if(\"line\" !== data.type){const err132 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/10/properties/type/const\",keyword:\"const\",params:{allowedValue: \"line\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data.box !== undefined){let data47 = data.box;if(typeof data47 === \"string\"){if(!pattern0.test(data47)){const err133 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data.items !== undefined){let data48 = data.items;if(Array.isArray(data48)){if(data48.length > 12){const err135 = {instancePath:instancePath+\"/items\",schemaPath:\"#/oneOf/10/properties/items/maxItems\",keyword:\"maxItems\",params:{limit: 12},message:\"must NOT have more than 12 items\"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}if(data48.length < 1){const err136 = {instancePath:instancePath+\"/items\",schemaPath:\"#/oneOf/10/properties/items/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}const len1 = data48.length;for(let i1=0; i1<len1; i1++){let data49 = data48[i1];if(typeof data49 === \"string\"){if(!pattern0.test(data49)){const err137 = {instancePath:instancePath+\"/items/\" + i1,schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}else {const err138 = {instancePath:instancePath+\"/items/\" + i1,schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {instancePath:instancePath+\"/items\",schemaPath:\"#/oneOf/10/properties/items/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}}else {const err140 = {instancePath,schemaPath:\"#/oneOf/10/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}else if(tag0 === \"seal\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err141 = {instancePath,schemaPath:\"#/oneOf/11/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(data.box === undefined){const err142 = {instancePath,schemaPath:\"#/oneOf/11/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key11 in data){if(!((key11 === \"type\") || (key11 === \"box\"))){const err143 = {instancePath,schemaPath:\"#/oneOf/11/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key11},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data.type !== undefined){if(\"seal\" !== data.type){const err144 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/11/properties/type/const\",keyword:\"const\",params:{allowedValue: \"seal\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data.box !== undefined){let data51 = data.box;if(typeof data51 === \"string\"){if(!pattern0.test(data51)){const err145 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}}else {const err147 = {instancePath,schemaPath:\"#/oneOf/11/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}else if(tag0 === \"open\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err148 = {instancePath,schemaPath:\"#/oneOf/12/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data.box === undefined){const err149 = {instancePath,schemaPath:\"#/oneOf/12/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}for(const key12 in data){if(!((key12 === \"type\") || (key12 === \"box\"))){const err150 = {instancePath,schemaPath:\"#/oneOf/12/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key12},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data.type !== undefined){if(\"open\" !== data.type){const err151 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/12/properties/type/const\",keyword:\"const\",params:{allowedValue: \"open\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data.box !== undefined){let data53 = data.box;if(typeof data53 === \"string\"){if(!pattern0.test(data53)){const err152 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}else {const err154 = {instancePath,schemaPath:\"#/oneOf/12/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}else if(tag0 === \"pick\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err155 = {instancePath,schemaPath:\"#/oneOf/13/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(data.box === undefined){const err156 = {instancePath,schemaPath:\"#/oneOf/13/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}for(const key13 in data){if(!((key13 === \"type\") || (key13 === \"box\"))){const err157 = {instancePath,schemaPath:\"#/oneOf/13/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key13},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}if(data.type !== undefined){if(\"pick\" !== data.type){const err158 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/13/properties/type/const\",keyword:\"const\",params:{allowedValue: \"pick\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data.box !== undefined){let data55 = data.box;if(typeof data55 === \"string\"){if(!pattern0.test(data55)){const err159 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}else {const err160 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}}else {const err161 = {instancePath,schemaPath:\"#/oneOf/13/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}else if(tag0 === \"stamp\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err162 = {instancePath,schemaPath:\"#/oneOf/14/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}if(data.box === undefined){const err163 = {instancePath,schemaPath:\"#/oneOf/14/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}if(data.text === undefined){const err164 = {instancePath,schemaPath:\"#/oneOf/14/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}for(const key14 in data){if(!(((key14 === \"type\") || (key14 === \"box\")) || (key14 === \"text\"))){const err165 = {instancePath,schemaPath:\"#/oneOf/14/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key14},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data.type !== undefined){if(\"stamp\" !== data.type){const err166 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/14/properties/type/const\",keyword:\"const\",params:{allowedValue: \"stamp\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(data.box !== undefined){let data57 = data.box;if(typeof data57 === \"string\"){if(!pattern0.test(data57)){const err167 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}else {const err168 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data.text !== undefined){let data58 = data.text;if(typeof data58 === \"string\"){if(func3(data58) < 1){const err169 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath,schemaPath:\"#/oneOf/14/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}else if(tag0 === \"strip\"){const _errs185 = errors;let valid75 = false;const _errs186 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.value === undefined){const err172 = {instancePath,schemaPath:\"#/oneOf/15/anyOf/0/required\",keyword:\"required\",params:{missingProperty: \"value\"},message:\"must have required property '\"+\"value\"+\"'\"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}var _valid0 = _errs186 === errors;valid75 = valid75 || _valid0;if(!valid75){const _errs187 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.tag === undefined){const err173 = {instancePath,schemaPath:\"#/oneOf/15/anyOf/1/required\",keyword:\"required\",params:{missingProperty: \"tag\"},message:\"must have required property '\"+\"tag\"+\"'\"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}var _valid0 = _errs187 === errors;valid75 = valid75 || _valid0;}if(!valid75){const err174 = {instancePath,schemaPath:\"#/oneOf/15/anyOf\",keyword:\"anyOf\",params:{},message:\"must match a schema in anyOf\"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}else {errors = _errs185;if(vErrors !== null){if(_errs185){vErrors.length = _errs185;}else {vErrors = null;}}}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err175 = {instancePath,schemaPath:\"#/oneOf/15/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}if(data.field === undefined){const err176 = {instancePath,schemaPath:\"#/oneOf/15/required\",keyword:\"required\",params:{missingProperty: \"field\"},message:\"must have required property '\"+\"field\"+\"'\"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}for(const key15 in data){if(!((((key15 === \"type\") || (key15 === \"field\")) || (key15 === \"value\")) || (key15 === \"tag\"))){const err177 = {instancePath,schemaPath:\"#/oneOf/15/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key15},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}if(data.type !== undefined){if(\"strip\" !== data.type){const err178 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/15/properties/type/const\",keyword:\"const\",params:{allowedValue: \"strip\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data.field !== undefined){let data60 = data.field;if(typeof data60 === \"string\"){if(func3(data60) < 1){const err179 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}else {const err180 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data.value !== undefined){let data61 = data.value;if(typeof data61 === \"string\"){if(func3(data61) < 1){const err181 = {instancePath:instancePath+\"/value\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+\"/value\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data.tag !== undefined){let data62 = data.tag;if(typeof data62 === \"string\"){if(func3(data62) < 1){const err183 = {instancePath:instancePath+\"/tag\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+\"/tag\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}}else {const err185 = {instancePath,schemaPath:\"#/oneOf/15/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}else {const err186 = {instancePath,schemaPath:\"#/discriminator\",keyword:\"discriminator\",params:{error: \"mapping\", tag: \"type\", tagValue: tag0},message:\"value of tag \\\"type\\\" must be in oneOf\"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}else {const err187 = {instancePath,schemaPath:\"#/discriminator\",keyword:\"discriminator\",params:{error: \"tag\", tag: \"type\", tagValue: tag0},message:\"tag \\\"type\\\" must be string\"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}validate41.errors = vErrors;return errors === 0;}function validate38(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.body === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"body\"},message:\"must have required property '\"+\"body\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.events === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"events\"},message:\"must have required property '\"+\"events\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((((key0 === \"title\") || (key0 === \"body\")) || (key0 === \"code\")) || (key0 === \"sources\")) || (key0 === \"events\"))){const err3 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.title !== undefined){let data0 = data.title;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err4 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.body !== undefined){let data1 = data.body;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err6 = {instancePath:instancePath+\"/body\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/body\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.code !== undefined){let data2 = data.code;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err8 = {instancePath:instancePath+\"/code\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+\"/code\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.sources !== undefined){let data3 = data.sources;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+\"/sources\",schemaPath:\"#/properties/sources/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data3.length;for(let i0=0; i0<len0; i0++){if(!(validate39(data3[i0], {instancePath:instancePath+\"/sources/\" + i0,parentData:data3,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);errors = vErrors.length;}}}else {const err11 = {instancePath:instancePath+\"/sources\",schemaPath:\"#/properties/sources/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.events !== undefined){let data5 = data.events;if(Array.isArray(data5)){const len1 = data5.length;for(let i1=0; i1<len1; i1++){if(!(validate41(data5[i1], {instancePath:instancePath+\"/events/\" + i1,parentData:data5,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate41.errors : vErrors.concat(validate41.errors);errors = vErrors.length;}}}else {const err12 = {instancePath:instancePath+\"/events\",schemaPath:\"#/properties/events/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate38.errors = vErrors;return errors === 0;}const schema147 = {\"description\":\"時系列図の種類の欄。生存線を左から並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"lifelines\"],\"properties\":{\"lifelines\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}}}};function validate46(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.lifelines === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"lifelines\"},message:\"must have required property '\"+\"lifelines\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"lifelines\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.lifelines !== undefined){let data0 = data.lifelines;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/lifelines\",schemaPath:\"#/properties/lifelines/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){let data1 = data0[i0];if(typeof data1 === \"string\"){if(!pattern0.test(data1)){const err3 = {instancePath:instancePath+\"/lifelines/\" + i0,schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/lifelines/\" + i0,schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath:instancePath+\"/lifelines\",schemaPath:\"#/properties/lifelines/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate46.errors = vErrors;return errors === 0;}const schema149 = {\"description\":\"状態遷移図の種類の欄。最初の段より前に書いた、移れるが段で通るとは限らない線\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"paths\"],\"properties\":{\"paths\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/path\"}}}};const schema150 = {\"description\":\"移れる道。送る側に始まりの印 start、受ける側に終わりの印 finish を書ける。どの段にも出ない道は点線で描き、運ぶ物を走らせない\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}};function validate49(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === \"from\") || (key0 === \"to\")) || (key0 === \"label\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 === \"string\"){if(!pattern0.test(data1)){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.label !== undefined){let data2 = data.label;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate49.errors = vErrors;return errors === 0;}function validate48(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.paths === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"paths\"},message:\"must have required property '\"+\"paths\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"paths\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.paths !== undefined){let data0 = data.paths;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/paths\",schemaPath:\"#/properties/paths/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate49(data0[i0], {instancePath:instancePath+\"/paths/\" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+\"/paths\",schemaPath:\"#/properties/paths/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate48.errors = vErrors;return errors === 0;}const schema154 = {\"description\":\"枝分かれの図の種類の欄。枝を上から帯に並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"branches\"],\"properties\":{\"branches\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/branch\"}}}};const schema155 = {\"description\":\"枝。帯の左に名札と添え書きを置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"note\":{\"$ref\":\"#/definitions/text\"}}};function validate53(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((key0 === \"id\") || (key0 === \"note\"))){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.note !== undefined){let data1 = data.note;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err4 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate53.errors = vErrors;return errors === 0;}function validate52(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.branches === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"branches\"},message:\"must have required property '\"+\"branches\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"branches\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.branches !== undefined){let data0 = data.branches;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/branches\",schemaPath:\"#/properties/branches/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate53(data0[i0], {instancePath:instancePath+\"/branches/\" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+\"/branches\",schemaPath:\"#/properties/branches/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate52.errors = vErrors;return errors === 0;}const schema158 = {\"description\":\"時間軸の図の種類の欄。目盛り、区切り、印の列、節目、拡大の範囲\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"scale\",\"rows\"],\"properties\":{\"scale\":{\"$ref\":\"#/definitions/scale\"},\"period\":{\"$ref\":\"#/definitions/period\"},\"rows\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/row\"}},\"points\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/point\"}},\"zoom\":{\"$ref\":\"#/definitions/zoom\"}}};const schema159 = {\"description\":\"目盛り。unit の名前の目盛りを length の長さで count 個並べ、最初の目盛りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"unit\",\"length\",\"count\"],\"properties\":{\"unit\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"$ref\":\"#/definitions/duration\"},\"count\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}};const schema161 = {\"description\":\"長さ。数と単位 (ms、s、min、h、d) の組\",\"type\":\"string\",\"pattern\":\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"};const pattern33 = new RegExp(\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\", \"u\");function validate57(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.unit === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"unit\"},message:\"must have required property '\"+\"unit\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"length\"},message:\"must have required property '\"+\"length\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.count === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"count\"},message:\"must have required property '\"+\"count\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === \"unit\") || (key0 === \"length\")) || (key0 === \"count\")) || (key0 === \"from\"))){const err3 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.unit !== undefined){let data0 = data.unit;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err4 = {instancePath:instancePath+\"/unit\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+\"/unit\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.length !== undefined){let data1 = data.length;if(typeof data1 === \"string\"){if(!pattern33.test(data1)){const err6 = {instancePath:instancePath+\"/length\",schemaPath:\"#/definitions/duration/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"},message:\"must match pattern \\\"\"+\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/length\",schemaPath:\"#/definitions/duration/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.count !== undefined){let data2 = data.count;if(!(((typeof data2 == \"number\") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){const err8 = {instancePath:instancePath+\"/count\",schemaPath:\"#/properties/count/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 < 1 || isNaN(data2)){const err9 = {instancePath:instancePath+\"/count\",schemaPath:\"#/properties/count/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}if(data.from !== undefined){let data3 = data.from;if(!(((typeof data3 == \"number\") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))){const err10 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if((typeof data3 == \"number\") && (isFinite(data3))){if(data3 < 0 || isNaN(data3)){const err11 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}}else {const err12 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate57.errors = vErrors;return errors === 0;}const schema162 = {\"description\":\"区切り。目盛り length 個ごとに name の区切りを置き、最初の区切りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"length\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}};function validate59(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"length\"},message:\"must have required property '\"+\"length\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === \"name\") || (key0 === \"length\")) || (key0 === \"from\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.name !== undefined){let data0 = data.name;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.length !== undefined){let data1 = data.length;if(!(((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err5 = {instancePath:instancePath+\"/length\",schemaPath:\"#/properties/length/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 < 1 || isNaN(data1)){const err6 = {instancePath:instancePath+\"/length\",schemaPath:\"#/properties/length/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}if(data.from !== undefined){let data2 = data.from;if(!(((typeof data2 == \"number\") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){const err7 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 < 0 || isNaN(data2)){const err8 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate59.errors = vErrors;return errors === 0;}const schema164 = {\"description\":\"印の列。目盛りごとに印を 1 つ置き、empty の目盛りは空きの印にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"empty\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/unit\"}}}};function validate61(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((key0 === \"id\") || (key0 === \"name\")) || (key0 === \"color\")) || (key0 === \"empty\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.color !== undefined){let data2 = data.color;if(!(((((((data2 === \"blue\") || (data2 === \"amber\")) || (data2 === \"green\")) || (data2 === \"violet\")) || (data2 === \"rose\")) || (data2 === \"slate\")) || (data2 === \"coin\"))){const err7 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.empty !== undefined){let data3 = data.empty;if(Array.isArray(data3)){const len0 = data3.length;for(let i0=0; i0<len0; i0++){let data4 = data3[i0];if(!(((typeof data4 == \"number\") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){const err8 = {instancePath:instancePath+\"/empty/\" + i0,schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if((typeof data4 == \"number\") && (isFinite(data4))){if(data4 < 0 || isNaN(data4)){const err9 = {instancePath:instancePath+\"/empty/\" + i0,schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}}else {const err10 = {instancePath:instancePath+\"/empty\",schemaPath:\"#/properties/empty/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate61.errors = vErrors;return errors === 0;}const schema169 = {\"description\":\"節目。at の目盛りの印の下に旗の丸と名札を置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"at\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"at\":{\"$ref\":\"#/definitions/unit\"}}};function validate63(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.at === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"at\"},message:\"must have required property '\"+\"at\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"id\") || (key0 === \"at\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.at !== undefined){let data1 = data.at;if(!(((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err5 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){const err6 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate63.errors = vErrors;return errors === 0;}const schema172 = {\"description\":\"拡大の範囲。from から to の目盛りごとに拡大の帯に列を作る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}};function validate65(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"from\") || (key0 === \"to\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(!(((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0))) && (isFinite(data0)))){const err3 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if((typeof data0 == \"number\") && (isFinite(data0))){if(data0 < 0 || isNaN(data0)){const err4 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.to !== undefined){let data1 = data.to;if(!(((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){const err6 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate65.errors = vErrors;return errors === 0;}function validate56(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.scale === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"scale\"},message:\"must have required property '\"+\"scale\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.rows === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"rows\"},message:\"must have required property '\"+\"rows\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((key0 === \"scale\") || (key0 === \"period\")) || (key0 === \"rows\")) || (key0 === \"points\")) || (key0 === \"zoom\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.scale !== undefined){if(!(validate57(data.scale, {instancePath:instancePath+\"/scale\",parentData:data,parentDataProperty:\"scale\",rootData}))){vErrors = vErrors === null ? validate57.errors : vErrors.concat(validate57.errors);errors = vErrors.length;}}if(data.period !== undefined){if(!(validate59(data.period, {instancePath:instancePath+\"/period\",parentData:data,parentDataProperty:\"period\",rootData}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.rows !== undefined){let data2 = data.rows;if(Array.isArray(data2)){if(data2.length < 1){const err3 = {instancePath:instancePath+\"/rows\",schemaPath:\"#/properties/rows/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}const len0 = data2.length;for(let i0=0; i0<len0; i0++){if(!(validate61(data2[i0], {instancePath:instancePath+\"/rows/\" + i0,parentData:data2,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate61.errors : vErrors.concat(validate61.errors);errors = vErrors.length;}}}else {const err4 = {instancePath:instancePath+\"/rows\",schemaPath:\"#/properties/rows/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.points !== undefined){let data4 = data.points;if(Array.isArray(data4)){const len1 = data4.length;for(let i1=0; i1<len1; i1++){if(!(validate63(data4[i1], {instancePath:instancePath+\"/points/\" + i1,parentData:data4,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err5 = {instancePath:instancePath+\"/points\",schemaPath:\"#/properties/points/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.zoom !== undefined){if(!(validate65(data.zoom, {instancePath:instancePath+\"/zoom\",parentData:data,parentDataProperty:\"zoom\",rootData}))){vErrors = vErrors === null ? validate65.errors : vErrors.concat(validate65.errors);errors = vErrors.length;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate56.errors = vErrors;return errors === 0;}const schema175 = {\"description\":\"列の図の種類の欄。列に並べるチップ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"items\"],\"properties\":{\"items\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/item\"}}}};const schema176 = {\"description\":\"チップ。color を書かないチップは薄い色で、label を書かないチップは色だけで出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"label\":{\"description\":\"チップに載せる字\",\"type\":\"string\",\"minLength\":1,\"maxLength\":4}}};function validate69(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((key0 === \"id\") || (key0 === \"color\")) || (key0 === \"label\"))){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.color !== undefined){let data1 = data.color;if(!(((((((data1 === \"blue\") || (data1 === \"amber\")) || (data1 === \"green\")) || (data1 === \"violet\")) || (data1 === \"rose\")) || (data1 === \"slate\")) || (data1 === \"coin\"))){const err4 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.label !== undefined){let data2 = data.label;if(typeof data2 === \"string\"){if(func3(data2) > 4){const err5 = {instancePath:instancePath+\"/label\",schemaPath:\"#/properties/label/maxLength\",keyword:\"maxLength\",params:{limit: 4},message:\"must NOT have more than 4 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func3(data2) < 1){const err6 = {instancePath:instancePath+\"/label\",schemaPath:\"#/properties/label/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/label\",schemaPath:\"#/properties/label/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate69.errors = vErrors;return errors === 0;}function validate68(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.items === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"items\"},message:\"must have required property '\"+\"items\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"items\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.items !== undefined){let data0 = data.items;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/items\",schemaPath:\"#/properties/items/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate69(data0[i0], {instancePath:instancePath+\"/items/\" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate69.errors : vErrors.concat(validate69.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+\"/items\",schemaPath:\"#/properties/items/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate68.errors = vErrors;return errors === 0;}const func2 = Object.prototype.hasOwnProperty;function validate10(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = \"kind\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if(\"sequence\" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.sequence === undefined){const err2 = {instancePath,schemaPath:\"#/then/required\",keyword:\"required\",params:{missingProperty: \"sequence\"},message:\"must have required property '\"+\"sequence\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.boxes !== undefined){let data1 = data.boxes;if(Array.isArray(data1)){if(data1.length < 1){const err3 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/then/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}if(data.steps !== undefined){if(!(validate11(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err4 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.git !== undefined){const err5 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.time !== undefined){const err6 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.lineup !== undefined){const err7 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = \"then\";}else {const _errs20 = errors;const _errs21 = errors;let valid7 = true;const _errs22 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing1;if((data.kind === undefined) && (missing1 = \"kind\")){const err8 = {};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {if(data.kind !== undefined){if(\"state\" !== data.kind){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}}var _valid1 = _errs22 === errors;errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}let ifClause1;if(_valid1){const _errs24 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.boxes !== undefined){let data9 = data.boxes;if(Array.isArray(data9)){if(data9.length < 1){const err10 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/else/then/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data9.length;for(let i0=0; i0<len0; i0++){let data10 = data9[i0];if(data10 && typeof data10 == \"object\" && !Array.isArray(data10)){if(data10.id !== undefined){let data11 = data10.id;const _errs28 = errors;const _errs29 = errors;if(!((data11 === \"start\") || (data11 === \"finish\"))){const err11 = {};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var valid13 = _errs29 === errors;if(valid13){const err12 = {instancePath:instancePath+\"/boxes/\" + i0+\"/id\",schemaPath:\"#/else/then/properties/boxes/items/properties/id/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs28;if(vErrors !== null){if(_errs28){vErrors.length = _errs28;}else {vErrors = null;}}}}}}}}if(data.steps !== undefined){if(!(validate11(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.git !== undefined){const err13 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.time !== undefined){const err14 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.lineup !== undefined){const err15 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var _valid1 = _errs24 === errors;valid7 = _valid1;ifClause1 = \"then\";}else {const _errs41 = errors;const _errs42 = errors;let valid17 = true;const _errs43 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing2;if((data.kind === undefined) && (missing2 = \"kind\")){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {if(data.kind !== undefined){if(\"git\" !== data.kind){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}}var _valid2 = _errs43 === errors;errors = _errs42;if(vErrors !== null){if(_errs42){vErrors.length = _errs42;}else {vErrors = null;}}let ifClause2;if(_valid2){const _errs45 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.git === undefined){const err18 = {instancePath,schemaPath:\"#/else/else/then/required\",keyword:\"required\",params:{missingProperty: \"git\"},message:\"must have required property '\"+\"git\"+\"'\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(data.steps !== undefined){if(!(validate17(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate17.errors : vErrors.concat(validate17.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err19 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data.regions !== undefined){const err20 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data.time !== undefined){const err21 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data.lineup !== undefined){const err22 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var _valid2 = _errs45 === errors;valid17 = _valid2;ifClause2 = \"then\";}else {const _errs60 = errors;const _errs61 = errors;let valid24 = true;const _errs62 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing3;if((data.kind === undefined) && (missing3 = \"kind\")){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {if(data.kind !== undefined){if(\"time\" !== data.kind){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}}var _valid3 = _errs62 === errors;errors = _errs61;if(vErrors !== null){if(_errs61){vErrors.length = _errs61;}else {vErrors = null;}}let ifClause3;if(_valid3){const _errs64 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.time === undefined){const err25 = {instancePath,schemaPath:\"#/else/else/else/then/required\",keyword:\"required\",params:{missingProperty: \"time\"},message:\"must have required property '\"+\"time\"+\"'\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data.steps !== undefined){if(!(validate20(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);errors = vErrors.length;}}if(data.state !== undefined){const err26 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data.git !== undefined){const err27 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(data.regions !== undefined){const err28 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(data.lineup !== undefined){const err29 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}var _valid3 = _errs64 === errors;valid24 = _valid3;ifClause3 = \"then\";}else {const _errs78 = errors;const _errs79 = errors;let valid31 = true;const _errs80 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing4;if((data.kind === undefined) && (missing4 = \"kind\")){const err30 = {};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}else {if(data.kind !== undefined){if(\"tree\" !== data.kind){const err31 = {};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}}}var _valid4 = _errs80 === errors;errors = _errs79;if(vErrors !== null){if(_errs79){vErrors.length = _errs79;}else {vErrors = null;}}let ifClause4;if(_valid4){const _errs82 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.steps !== undefined){if(!(validate22(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err32 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data.git !== undefined){const err33 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(data.time !== undefined){const err34 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(data.regions !== undefined){const err35 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data.lineup !== undefined){const err36 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}var _valid4 = _errs82 === errors;valid31 = _valid4;ifClause4 = \"then\";}else {const _errs100 = errors;const _errs101 = errors;let valid39 = true;const _errs102 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing5;if((data.kind === undefined) && (missing5 = \"kind\")){const err37 = {};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}else {if(data.kind !== undefined){if(\"lineup\" !== data.kind){const err38 = {};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}}var _valid5 = _errs102 === errors;errors = _errs101;if(vErrors !== null){if(_errs101){vErrors.length = _errs101;}else {vErrors = null;}}let ifClause5;if(_valid5){const _errs104 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.lineup === undefined){const err39 = {instancePath,schemaPath:\"#/else/else/else/else/else/then/required\",keyword:\"required\",params:{missingProperty: \"lineup\"},message:\"must have required property '\"+\"lineup\"+\"'\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}if(data.boxes !== undefined){let data39 = data.boxes;if(Array.isArray(data39)){if(data39.length < 1){const err40 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/else/else/else/else/else/then/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}const len1 = data39.length;for(let i1=0; i1<len1; i1++){let data40 = data39[i1];if(data40 && typeof data40 == \"object\" && !Array.isArray(data40)){if(data40.icon !== undefined){const err41 = {instancePath:instancePath+\"/boxes/\" + i1+\"/icon\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(data40.link !== undefined){const err42 = {instancePath:instancePath+\"/boxes/\" + i1+\"/link\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}if(data40.region !== undefined){const err43 = {instancePath:instancePath+\"/boxes/\" + i1+\"/region\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}}}}if(data.steps !== undefined){if(!(validate25(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err44 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}if(data.git !== undefined){const err45 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(data.time !== undefined){const err46 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(data.regions !== undefined){const err47 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}var _valid5 = _errs104 === errors;valid39 = _valid5;ifClause5 = \"then\";}else {const _errs130 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.boxes !== undefined){let data50 = data.boxes;if(Array.isArray(data50)){if(data50.length < 1){const err48 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/else/else/else/else/else/else/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}if(data.steps !== undefined){if(!(validate11(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err49 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}if(data.git !== undefined){const err50 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(data.time !== undefined){const err51 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(data.lineup !== undefined){const err52 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}var _valid5 = _errs130 === errors;valid39 = _valid5;ifClause5 = \"else\";}if(!valid39){const err53 = {instancePath,schemaPath:\"#/else/else/else/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause5},message:\"must match \\\"\"+ifClause5+\"\\\" schema\"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var _valid4 = _errs100 === errors;valid31 = _valid4;ifClause4 = \"else\";}if(!valid31){const err54 = {instancePath,schemaPath:\"#/else/else/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause4},message:\"must match \\\"\"+ifClause4+\"\\\" schema\"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}var _valid3 = _errs78 === errors;valid24 = _valid3;ifClause3 = \"else\";}if(!valid24){const err55 = {instancePath,schemaPath:\"#/else/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause3},message:\"must match \\\"\"+ifClause3+\"\\\" schema\"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}var _valid2 = _errs60 === errors;valid17 = _valid2;ifClause2 = \"else\";}if(!valid17){const err56 = {instancePath,schemaPath:\"#/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause2},message:\"must match \\\"\"+ifClause2+\"\\\" schema\"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}var _valid1 = _errs41 === errors;valid7 = _valid1;ifClause1 = \"else\";}if(!valid7){const err57 = {instancePath,schemaPath:\"#/else/if\",keyword:\"if\",params:{failingKeyword: ifClause1},message:\"must match \\\"\"+ifClause1+\"\\\" schema\"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.sequence !== undefined){const err58 = {instancePath:instancePath+\"/sequence\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}var _valid0 = _errs20 === errors;valid0 = _valid0;ifClause0 = \"else\";}if(!valid0){const err59 = {instancePath,schemaPath:\"#/if\",keyword:\"if\",params:{failingKeyword: ifClause0},message:\"must match \\\"\"+ifClause0+\"\\\" schema\"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.version === undefined){const err60 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}if(data.kind === undefined){const err61 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind\"},message:\"must have required property '\"+\"kind\"+\"'\"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}if(data.title === undefined){const err62 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}if(data.boxes === undefined){const err63 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"boxes\"},message:\"must have required property '\"+\"boxes\"+\"'\"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}if(data.steps === undefined){const err64 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"steps\"},message:\"must have required property '\"+\"steps\"+\"'\"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key0 in data){if(!(func2.call(schema11.properties, key0))){const err65 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data.version !== undefined){let data58 = data.version;if(!(((typeof data58 == \"number\") && (!(data58 % 1) && !isNaN(data58))) && (isFinite(data58)))){const err66 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if((typeof data58 == \"number\") && (isFinite(data58))){if(data58 < 1 || isNaN(data58)){const err67 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}}if(data.kind !== undefined){let data59 = data.kind;if(!(((((((data59 === \"sequence\") || (data59 === \"architecture\")) || (data59 === \"state\")) || (data59 === \"git\")) || (data59 === \"time\")) || (data59 === \"tree\")) || (data59 === \"lineup\"))){const err68 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/enum\",keyword:\"enum\",params:{allowedValues: schema11.properties.kind.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data.title !== undefined){let data60 = data.title;if(typeof data60 === \"string\"){if(func3(data60) < 1){const err69 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}else {const err70 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data.view !== undefined){let data61 = data.view;if(!((data61 === \"fixed\") || (data61 === \"follow\"))){const err71 = {instancePath:instancePath+\"/view\",schemaPath:\"#/properties/view/enum\",keyword:\"enum\",params:{allowedValues: schema11.properties.view.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data.regions !== undefined){let data62 = data.regions;if(Array.isArray(data62)){const len2 = data62.length;for(let i2=0; i2<len2; i2++){if(!(validate30(data62[i2], {instancePath:instancePath+\"/regions/\" + i2,parentData:data62,parentDataProperty:i2,rootData}))){vErrors = vErrors === null ? validate30.errors : vErrors.concat(validate30.errors);errors = vErrors.length;}}}else {const err72 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/properties/regions/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data.boxes !== undefined){let data64 = data.boxes;if(Array.isArray(data64)){const len3 = data64.length;for(let i3=0; i3<len3; i3++){if(!(validate32(data64[i3], {instancePath:instancePath+\"/boxes/\" + i3,parentData:data64,parentDataProperty:i3,rootData}))){vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);errors = vErrors.length;}}}else {const err73 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/properties/boxes/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}if(data.strip !== undefined){if(!(validate34(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data.steps !== undefined){let data67 = data.steps;if(Array.isArray(data67)){if(data67.length < 1){const err74 = {instancePath:instancePath+\"/steps\",schemaPath:\"#/properties/steps/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}const len4 = data67.length;for(let i4=0; i4<len4; i4++){if(!(validate38(data67[i4], {instancePath:instancePath+\"/steps/\" + i4,parentData:data67,parentDataProperty:i4,rootData}))){vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);errors = vErrors.length;}}}else {const err75 = {instancePath:instancePath+\"/steps\",schemaPath:\"#/properties/steps/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data.sequence !== undefined){if(!(validate46(data.sequence, {instancePath:instancePath+\"/sequence\",parentData:data,parentDataProperty:\"sequence\",rootData}))){vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);errors = vErrors.length;}}if(data.state !== undefined){if(!(validate48(data.state, {instancePath:instancePath+\"/state\",parentData:data,parentDataProperty:\"state\",rootData}))){vErrors = vErrors === null ? validate48.errors : vErrors.concat(validate48.errors);errors = vErrors.length;}}if(data.git !== undefined){if(!(validate52(data.git, {instancePath:instancePath+\"/git\",parentData:data,parentDataProperty:\"git\",rootData}))){vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);errors = vErrors.length;}}if(data.time !== undefined){if(!(validate56(data.time, {instancePath:instancePath+\"/time\",parentData:data,parentDataProperty:\"time\",rootData}))){vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);errors = vErrors.length;}}if(data.lineup !== undefined){if(!(validate68(data.lineup, {instancePath:instancePath+\"/lineup\",parentData:data,parentDataProperty:\"lineup\",rootData}))){vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);errors = vErrors.length;}}}else {const err76 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}validate10.errors = vErrors;return errors === 0;}\n","/**\n * 図の原本の形と、原本を JSON Schema で検査する命令。\n *\n * 形の正は `schemas/diagram.schema.json` の 1 本で、下の型はその写し。\n * 誤りは JSON Pointer で場所を示す。欄が足りない時と知らない欄がある時は、その欄の場所まで示す。\n * 誤りの文は呼ぶ側が渡した言葉 (渡さなければ日本語) で出す。文の表は `field-messages.ts` が持つ (#2999)。\n *\n * 検査の関数は schema から前もって書き出した物 (`schemas/validate-diagram.js`) を使う。\n * ajv に schema をその場で組み立てさせると `new Function` を使い、`eval` を許さない頁の CSP で止まる。\n * 書き出しは `scripts/build-validator.mjs` が ajv の設定 `{ allErrors: true, discriminator: true, strictTypes: false }` で行う。\n */\nimport type { ErrorObject } from \"ajv\";\nimport { type Allowed, FIELD_MESSAGES, type FieldMessages, type Forbidden } from \"./field-messages\";\nimport validate from \"./schemas/validate-diagram.js\";\nimport { type NotationLang, STATE_ENDS } from \"./words\";\n\nexport type Color = \"blue\" | \"amber\" | \"green\" | \"violet\" | \"rose\" | \"slate\" | \"coin\";\n/** 色の役の一覧。記法の `color:` に書ける値と、誤りの文に並べる値 */\nexport const COLORS: readonly Color[] = [\"blue\", \"amber\", \"green\", \"violet\", \"rose\", \"slate\", \"coin\"];\n\nexport interface Region {\n id: string;\n name: string;\n note?: string;\n color?: Color;\n icon?: string;\n}\n\nexport interface Box {\n id: string;\n name: string;\n sub?: string;\n color?: Color;\n icon?: string;\n region?: string;\n /** 飛び先。描いた図ではこの箱がここへの link になる。`/` で始まる path か、http:// か https:// で始まる URL (#3199) */\n link?: string;\n}\n\nexport type Carry = { kind: \"envelope\" } | { kind: \"tag\"; text: string } | { kind: \"coin\" } | { kind: \"none\" };\n\nexport type LabelSide = \"above\" | \"below\" | \"left\" | \"right\";\n\n/** 見せ方。`fixed` は全体を止めて中だけ動かし、`follow` は寄って動かし全体図で今どこかを示す。 */\nexport type ViewMode = \"fixed\" | \"follow\";\n\nexport type DiagramEvent =\n | { type: \"edge\"; from: string; to: string; label?: string; carry: Carry; labelSide?: LabelSide; at?: number; into?: number }\n | { type: \"action\"; box: string; label: string }\n | { type: \"swap\"; box: string; text: string; color?: Color }\n | { type: \"strip\"; field: string; value?: string; tag?: string }\n | GitCommit\n | { type: \"branch\"; branch: string; from: string }\n | { type: \"now\"; to: number }\n | TimeMarkEvent\n | TimeSpanEvent\n | TreeLeaf\n | TreeNode\n | LineupOrder\n | { type: \"seal\" | \"open\" | \"pick\"; box: string }\n | LineupStamp;\n\n/** 時間軸の図 (#3165) の、印の列 `row` の `from` から `to` の目盛りの印の色を変える出来事 */\nexport interface TimeMarkEvent {\n type: \"mark\";\n row: string;\n from: number;\n to: number;\n color: Color;\n}\n\n/** 時間軸の図の、`from` から `to` の目盛りの括弧と字。`shape` が `box` なら印の列を囲み、字を縁の札にする */\nexport interface TimeSpanEvent {\n type: \"span\";\n from: number;\n to: number;\n text: string;\n shape?: \"box\";\n color?: Color;\n}\n\n/** 時間軸の図の目盛り。`unit` の名前の目盛りを `length` の長さ (`12s` など) で `count` 個並べ、最初の目盛りの番号を `from` にする */\nexport interface TimeScale {\n unit: string;\n length: string;\n count: number;\n from?: number;\n}\n\n/** 時間軸の図の区切り。目盛り `length` 個ごとに `name` の区切りを置き、最初の区切りの番号を `from` にする */\nexport interface TimePeriod {\n name: string;\n length: number;\n from?: number;\n}\n\n/** 時間軸の図の印の列。目盛りごとに印を 1 つ置き、`empty` の目盛りは空きの印にする */\nexport interface TimeRow {\n id: string;\n name: string;\n color?: Color;\n empty?: number[];\n}\n\n/** 時間軸の図の節目。`at` の目盛りの印の下に旗の丸と名札を置く */\nexport interface TimePoint {\n id: string;\n at: number;\n}\n\n/** 時間軸の図の種類の欄 */\nexport interface TimeSpec {\n scale: TimeScale;\n period?: TimePeriod;\n rows: TimeRow[];\n points?: TimePoint[];\n /** 拡大の帯に列を作る目盛りの範囲 */\n zoom?: { from: number; to: number };\n}\n\n/** 中身の帯の物差しの欄。`line` の割合 (`2/3` か `97%`) の所に線を引く */\nexport interface StripMeter {\n field: string;\n line: string;\n}\n\n/**\n * 枝分かれの図 (#3164) の commit を積む出来事。積んだ枝の札と、その枝を指す HEAD が新しい commit へ進む。\n * 当て直し (`copy`) は枝の札を動かさず、merge commit (`merge`) は取り込む枝の先端も親に持つ\n */\nexport interface GitCommit {\n type: \"commit\";\n id: string;\n branch: string;\n copy?: string;\n merge?: string;\n hash?: string;\n note?: string;\n}\n\n/**\n * 木の図 (#3233) の葉を出す出来事。書いた段で葉の箱が現れる。`hash` を書くと箱に値を出し、名札を葉の下の札に出す\n */\nexport interface TreeLeaf {\n type: \"leaf\";\n id: string;\n hash?: string;\n}\n\n/** 木の図の、1 つ以上の子から親を組む出来事。書いた段で親の箱と、子から親への木の線が現れる */\nexport interface TreeNode {\n type: \"node\";\n id: string;\n children: string[];\n hash?: string;\n}\n\n/** 列の図 (#3239) の、列 `box` の並びを `items` に書き換える出来事。前の段との差分を描く部品が滑る動きに変える */\nexport interface LineupOrder {\n type: \"line\";\n box: string;\n items: string[];\n}\n\n/** 列の図の、列 `box` の右に `text` の札を押す出来事 */\nexport interface LineupStamp {\n type: \"stamp\";\n box: string;\n text: string;\n}\n\n/** 列の図のチップ。`color` を書かないチップは薄い色で、`label` を書かないチップは色だけで出す */\nexport interface LineupItem {\n id: string;\n color?: Color;\n label?: string;\n}\n\n/** 枝分かれの図の枝。上から宣言した順に帯を並べる */\nexport interface GitBranch {\n id: string;\n note?: string;\n}\n\n/** 状態遷移図の、最初の段より前に書いた移れる道。`from` に `start`、`to` に `finish` を書ける */\nexport interface StatePath {\n from: string;\n to: string;\n label?: string;\n}\n\n/** 段の出典。読み上げの段の一覧に、名前を URL への link にして出す。URL の形は箱の飛び先と同じ (#3199) */\nexport interface StepSource {\n name: string;\n url: string;\n}\n\nexport interface Step {\n title: string;\n body: string;\n code?: string;\n /** 書いた順の出典。書かない段は欄を持たない */\n sources?: StepSource[];\n events: DiagramEvent[];\n}\n\nexport interface Diagram {\n version: number;\n kind: \"sequence\" | \"architecture\" | \"state\" | \"git\" | \"time\" | \"tree\" | \"lineup\";\n title: string;\n view?: ViewMode;\n regions?: Region[];\n boxes: Box[];\n strip?: { title: string; fields: string[]; meters?: StripMeter[] };\n steps: Step[];\n sequence?: { lifelines: string[] };\n state?: { paths: StatePath[] };\n git?: { branches: GitBranch[] };\n time?: TimeSpec;\n lineup?: { items: LineupItem[] };\n}\n\nexport interface FieldError {\n /** 誤った欄の場所 (JSON Pointer) */\n pointer: string;\n message: string;\n}\n\nexport type Checked = { ok: true } | { ok: false; errors: FieldError[] };\n\nexport interface CheckOptions {\n /** 誤りの文の言葉。渡さなければ日本語 */\n lang?: NotationLang;\n}\n\n/** 段の中で起きることの種類。schema の event の `discriminator` が見る `type` の値 */\nconst EVENT_TYPES = [\"edge\", \"action\", \"swap\", \"strip\", \"commit\", \"branch\", \"now\", \"mark\", \"span\", \"leaf\", \"node\", \"line\", \"seal\", \"open\", \"pick\", \"stamp\"] as const satisfies readonly DiagramEvent[\"type\"][];\n\n/**\n * その種類の図に書けない根の欄を書いた時の決まりの場所 (#3164)。根の欄に `not: {}` を置く決まり (`absent`) を指し、\n * 誤りの場所の最後の欄が書いた欄になる。種類の欄は、その欄と同じ名前の図の種類だけが書ける\n */\nconst ABSENT = \"#/definitions/absent/not\";\n/**\n * 種類の欄でない欄を書ける図の種類。区画は枝分かれの図と時間軸の図に書けない。\n * 線の列 (`at` と `into`)、節目の丸の色 (`color`)、物差し (`meters`) は時間軸の図だけが書ける (#3165)\n */\nconst ABSENT_KINDS: Record<string, string> = {\n regions: \"sequence / architecture / state\",\n at: \"time\",\n into: \"time\",\n color: \"time\",\n meters: \"time\",\n region: \"sequence / architecture / state\",\n icon: \"sequence / architecture / state / git / time / tree\",\n link: \"sequence / architecture / state / git / time / tree\",\n};\n/** 運ぶ物の書けない組み合わせ (`not: { required: [欄] }`)。誤りの場所の最後の欄で引く */\nconst NOT_ALLOWED: Record<string, Allowed> = {\n carry: { field: \"text\", kind: \"tag\" },\n};\n\n/** 状態遷移図の箱の名札に予約の名前を書いた時の決まりの場所 */\nconst RESERVED_ID = /\\/boxes\\/items\\/properties\\/id\\/not$/u;\n/** 枝分かれの図でない図に、枝分かれの図だけの出来事を書いた時の決まりの場所 (#3164) */\nconst GIT_EVENT = /\\/events\\/items\\/properties\\/type\\/not$/u;\n/** 枝分かれの図だけが書ける出来事 */\nconst GIT_EVENTS = [\"commit\", \"branch\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 時間軸の図でない図に、時間軸の図だけの出来事を書いた時の決まりの場所 (#3165)。出来事に `not` を置く */\nconst TIME_EVENT = /\\/events\\/items\\/not$/u;\n/** 時間軸の図だけが書ける出来事 */\nconst TIME_EVENTS = [\"now\", \"mark\", \"span\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 木の図でない図に、木の図だけの出来事を書いた時の決まりの場所 (#3233)。出来事の `allOf` の中に `not` を置く */\nconst TREE_EVENT = /\\/events\\/items\\/allOf\\/0\\/not$/u;\n/** 木の図だけが書ける出来事 */\nconst TREE_EVENTS = [\"leaf\", \"node\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 列の図でない図に、列の図だけの出来事を書いた時の決まりの場所 (#3239) */\nconst LINEUP_EVENT = \"#/definitions/notLineupEvent/not\";\n/** 列の図だけが書ける出来事 */\nconst LINEUP_EVENTS = [\"line\", \"seal\", \"open\", \"pick\", \"stamp\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 列の図に、線と処理の出来事を書いた時の決まりの場所 (#3239) */\nconst WIRED_EVENT = \"#/definitions/notWiredEvent/not\";\n/** 列の図が書けない、箱と線の図の出来事 */\nconst WIRED_EVENTS = [\"edge\", \"action\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 時間軸の図の目盛りの長さの決まり (`^[0-9]+(\\.[0-9]+)?(<単位>|<単位>)$`)。書ける単位を読む */\nconst DURATION = /^\\^\\[0-9\\]\\+\\(\\\\\\.\\[0-9\\]\\+\\)\\?\\(([a-z|]+)\\)\\$$/u;\n/** 割合の決まり。百分率の `%` を持つ */\nconst RATIO = /%\\)\\$$/u;\n\nconst escape = (key: string): string => key.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\");\n\n/** 箱の飛び先と段の出典の URL の決まりの場所 (#3199) */\nconst URL_RULE = \"#/definitions/url/pattern\";\n\n/** commit の hash の決まり (`^[0-9a-f]{<最小>,<最大>}$`)。字の数の幅を読む */\nconst HEX = /^\\^\\[0-9a-f\\]\\{(\\d+),(\\d+)\\}\\$$/u;\n\n/** `^[^…]+$` の形の決まりから書けない字を読む。違う形の決まりでは `undefined` */\nfunction forbiddenOf(pattern: string): Forbidden | undefined {\n const inside = /^\\^\\[\\^(.+)\\]\\+\\$$/u.exec(pattern)?.[1];\n if (inside === undefined) return undefined;\n const chars: string[] = inside.match(/\\\\.|[^\\\\]/gu) ?? [];\n return { space: chars.includes(\"\\\\s\"), chars: chars.filter((char) => char !== \"\\\\s\").map((char) => char.replace(/^\\\\/u, \"\")) };\n}\n\n/** `anyOf` の中の決まりが出した誤り。`anyOf` の誤り 1 つにまとめて出す */\nconst branchesOf = (anyOf: ErrorObject, errors: readonly ErrorObject[]): ErrorObject[] =>\n errors.filter(\n (error) =>\n error !== anyOf &&\n error.schemaPath.startsWith(`${anyOf.schemaPath}/`) &&\n (error.instancePath === anyOf.instancePath || error.instancePath.startsWith(`${anyOf.instancePath}/`)),\n );\n\nfunction toFieldError(error: ErrorObject, errors: readonly ErrorObject[], m: FieldMessages): FieldError {\n const params = error.params as Record<string, unknown>;\n const at = error.instancePath;\n switch (error.keyword) {\n case \"additionalProperties\": {\n const key = String(params.additionalProperty);\n return { pointer: `${at}/${escape(key)}`, message: m.additionalProperties(key) };\n }\n case \"required\": {\n const key = String(params.missingProperty);\n return { pointer: `${at}/${escape(key)}`, message: m.required(key) };\n }\n case \"not\": {\n if (RESERVED_ID.test(error.schemaPath)) return { pointer: at, message: m.reserved(STATE_ENDS) };\n if (GIT_EVENT.test(error.schemaPath)) return { pointer: at, message: m.kindOnly(GIT_EVENTS, \"git\") };\n if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TIME_EVENTS, \"time\") };\n if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TREE_EVENTS, \"tree\") };\n if (error.schemaPath === LINEUP_EVENT) return { pointer: `${at}/type`, message: m.kindOnly(LINEUP_EVENTS, \"lineup\") };\n if (error.schemaPath === WIRED_EVENT) return { pointer: `${at}/type`, message: m.kindOnly(WIRED_EVENTS, \"sequence / architecture / state / git / time / tree\") };\n const last = at.slice(at.lastIndexOf(\"/\") + 1);\n if (error.schemaPath === ABSENT) return { pointer: at, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };\n const allowed = NOT_ALLOWED[last];\n return { pointer: allowed ? `${at}/${allowed.field}` : at, message: m.not(allowed) };\n }\n case \"anyOf\": {\n const branches = branchesOf(error, errors);\n const missing = branches.every((branch) => branch.keyword === \"required\") ? branches.map((branch) => String(branch.params.missingProperty)) : [];\n return { pointer: at, message: m.anyOf(missing) };\n }\n case \"discriminator\": {\n const tag = String(params.tag);\n return { pointer: `${at}/${escape(tag)}`, message: m.discriminator(tag, EVENT_TYPES) };\n }\n case \"enum\":\n return { pointer: at, message: m.enum((params.allowedValues as unknown[]).map(String)) };\n case \"type\":\n return { pointer: at, message: m.type(String(params.type)) };\n case \"minLength\":\n return { pointer: at, message: m.minLength(Number(params.limit)) };\n case \"maxLength\":\n return { pointer: at, message: m.maxLength(Number(params.limit)) };\n case \"pattern\": {\n if (error.schemaPath === URL_RULE) return { pointer: at, message: m.url };\n const pattern = String(params.pattern);\n const hex = HEX.exec(pattern);\n if (hex) return { pointer: at, message: m.hex(Number(hex[1]), Number(hex[2])) };\n const duration = DURATION.exec(pattern);\n if (duration) return { pointer: at, message: m.duration((duration[1] ?? \"\").split(\"|\")) };\n if (RATIO.test(pattern)) return { pointer: at, message: m.ratio };\n return { pointer: at, message: m.pattern(forbiddenOf(pattern)) };\n }\n case \"minItems\":\n return { pointer: at, message: m.minItems(Number(params.limit)) };\n case \"maxItems\":\n return { pointer: at, message: m.maxItems(Number(params.limit)) };\n case \"minimum\":\n return { pointer: at, message: m.minimum(Number(params.limit)) };\n case \"const\":\n return { pointer: at, message: m.const(String(params.allowedValue)) };\n case \"oneOf\":\n return { pointer: at, message: m.oneOf };\n default:\n return { pointer: at, message: error.message ?? error.keyword };\n }\n}\n\n/** 原本の JSON を検査する。版が道具より新しいかは見ない (`readDiagram` が見る)。 */\nexport function validateDiagram(input: unknown, options: CheckOptions = {}): Checked {\n if (validate(input)) return { ok: true };\n const all = validate.errors ?? [];\n const inBranch = new Set(all.filter((error) => error.keyword === \"anyOf\").flatMap((anyOf) => branchesOf(anyOf, all)));\n const m = FIELD_MESSAGES[options.lang ?? \"ja\"];\n // 条件付きの決まり (if / then) は中で落ちた決まりの誤りを別に出すので、包む側の if の誤りは出さない\n const errors = all.filter((error) => error.keyword !== \"if\" && !inBranch.has(error)).map((error) => toFieldError(error, all, m));\n return { ok: false, errors };\n}\n","/**\n * dragon記法の誤りの文 (#2997、#3137)。\n *\n * 記法の語は英語だけで file から言葉が決まらないため、誤りの文は呼ぶ側が渡した言葉\n * (渡さなければ日本語) で出す。文の中の記法の語は語の表から引き、表と文で語が食い違わないようにする。\n */\nimport { COLORS } from \"./schema\";\nimport { CARRIES, DURATION_UNITS, HEADS, KINDS, type NotationLang, SIDES, SPAN_SHAPES, VIEWS } from \"./words\";\n\n/** 新しい形のどの行の書き方を示すか。前の形の行に当たった時に、誤りの文が書き方を示す */\nexport type Shape = \"sequence\" | \"architecture\" | \"group\" | \"box\" | \"strip\" | \"view\" | \"step\" | \"say\" | \"code\" | \"act\" | \"note\" | \"set\";\n\nexport interface Messages {\n noHead: string;\n badHead: string;\n /** 前の形の `word` を書いた行。`shape` の行の書き方を示す */\n oldForm: (word: string, shape: Shape) => string;\n unknownHead: (word: string) => string;\n duplicate: (id: string) => string;\n needsId: (word: string) => string;\n badId: (id: string) => string;\n afterId: string;\n undeclaredBox: (id: string) => string;\n noBody: (title: string) => string;\n emptyStepTitle: string;\n noBoxes: string;\n noSteps: string;\n emptySay: string;\n sayTwice: string;\n codeTwice: string;\n emptyCode: string;\n /** 段の出典の行の形 (#3199) */\n sourceShape: string;\n declarationInStep: string;\n stepLineBeforeStep: string;\n nestedGroup: string;\n strayEnd: string;\n endTakesNothing: string;\n unclosedGroup: (id: string) => string;\n regionReopened: (id: string) => string;\n emptyName: (id: string) => string;\n stripTwice: string;\n stripShape: string;\n emptyStripField: string;\n stripUndeclared: string;\n noSuchField: (field: string) => string;\n stripNeedsValue: string;\n actShape: string;\n noteShape: string;\n edgeShape: string;\n emptyLabel: string;\n quoteUnclosed: string;\n afterQuote: string;\n attrUnclosed: string;\n attrNoColon: (raw: string) => string;\n attrNoValue: (key: string) => string;\n attrTwice: (key: string) => string;\n badAttr: (key: string, allowed: readonly string[]) => string;\n badColor: string;\n badView: string;\n badCarry: string;\n badSide: string;\n /** 箱の飛び先 (`link`) か段の出典 (`url`) に、頁を移る形でない URL を書いた (#3199) */\n badUrl: (key: string) => string;\n carryTwice: string;\n /** 状態遷移図の箱の名札に、始まりか終わりの印の名前を書いた */\n reservedId: (id: string) => string;\n intoStart: string;\n outOfFinish: string;\n /** 状態遷移図の最初の step より前の線に、属性を書いた */\n pathNoAttrs: string;\n /** 枝分かれの図だけの行 (`branch` と `commit`) を、別の種類の図に書いた (#3164) */\n gitOnly: (word: string) => string;\n gitNoGroup: string;\n noBranches: string;\n branchShape: string;\n commitShape: string;\n fromShape: string;\n undeclaredBranch: (id: string) => string;\n /** 札を動かす線の送る側が、枝の名札でも HEAD でもない */\n undeclaredRef: (id: string) => string;\n noCommit: (id: string) => string;\n /** 取り込む枝が、まだどの commit も指していない */\n emptyBranch: (id: string) => string;\n mergeSelf: (id: string) => string;\n /** 枝分かれの図で、今いる場所の札の名前 (`name`) を名札にした */\n headReserved: (name: string) => string;\n badHash: string;\n /** 時間軸の図だけの行か属性 (`word`) を、別の種類の図に書いた (#3165) */\n timeOnly: (word: string) => string;\n /** 木の図だけの行 (`leaf` と `node`) を、別の種類の図に書いた (#3233) */\n treeOnly: (word: string) => string;\n treeNoGroup: string;\n noLeaves: string;\n leafShape: string;\n nodeShape: string;\n /** 親の子に、まだ書いていない名札を書いた */\n noTreeChild: (id: string) => string;\n /** 親の子に、木の箱でない箱 (`box`) を書いた */\n notTreeBox: (id: string) => string;\n /** もう親を持つ箱を、別の親の子にした */\n twoParents: (id: string) => string;\n /** 最後の段を終えて、親を持たない箱が根の外に残った */\n manyRoots: (id: string, root: string) => string;\n /** 列の図だけの行 (`item`、`line`、`seal`、`open`、`pick`、`stamp`) を、別の種類の図に書いた (#3239) */\n lineupOnly: (word: string) => string;\n lineupNoGroup: string;\n lineupNoEdge: string;\n lineupNoAct: string;\n noItems: string;\n itemShape: string;\n lineShape: string;\n /** `seal`、`open`、`pick` の行の形 */\n laneShape: (word: string) => string;\n stampShape: string;\n /** チップの字が上限の字数を超えた */\n labelTooLong: (limit: number) => string;\n /** `line` の行に、宣言していないチップを書いた */\n noSuchItem: (id: string) => string;\n /** 同じ `line` の行に、同じチップを 2 度書いた */\n itemTwice: (id: string) => string;\n /** `line` の行のチップが、1 列の上限を超えた */\n laneFull: (lane: string, limit: number) => string;\n lineOnSealed: (lane: string) => string;\n sealTwice: (lane: string) => string;\n openUnsealed: (lane: string) => string;\n /** 時間軸の図の宣言の行を 2 つ書いた */\n timeTwice: (word: string) => string;\n noScale: string;\n noRows: string;\n scaleShape: string;\n periodShape: string;\n rowShape: string;\n pointShape: string;\n zoomShape: string;\n nowShape: string;\n markShape: string;\n spanShape: string;\n badLength: string;\n badCount: (word: string) => string;\n /** 目盛りの位置か範囲 (`text`) が、0 から `count - 1` の外か、範囲の形でない */\n badUnit: (text: string, count: number) => string;\n /** 針を前の時刻 (`at` の目盛りの終わり) より先へ進めない `now` */\n nowBack: (text: string, at: number) => string;\n /** 拡大の帯の外の列 */\n outOfZoom: (from: number, to: number) => string;\n noZoom: string;\n /** 時間軸の図の箱を宣言したのに、拡大の帯 (`zoom`) が無い */\n boxNeedsZoom: string;\n boxLineNeedsAt: string;\n pointLineNoAt: string;\n mixedLine: string;\n undeclaredRow: (id: string) => string;\n /** 時間軸の図の note の行の名札が、箱でも節目でもない */\n undeclaredNote: (id: string) => string;\n nowReserved: (name: string) => string;\n noteColorPointOnly: string;\n badShape: string;\n badRatio: string;\n /** 物差しの欄 `field` の値が割合でない */\n meterValue: (field: string) => string;\n}\n\nconst list = (words: readonly string[]): string => words.join(\" / \");\n\nconst ja = (): Messages => {\n const shapes: Record<Shape, string> = {\n sequence: \"sequence <題>\",\n architecture: \"architecture <題>\",\n group: \"group <名札> as <名前> [note: <添え書き>] から end まで\",\n box: \"box <名札> as <名前> [note: <下の小さな字>]\",\n strip: \"strip <題>: <欄>, <欄>\",\n view: \"sequence <題> [view: follow]\",\n step: \"step <段の題>\",\n say: \"say <段の本文>\",\n code: \"code <命令>\",\n act: \"act <名札>: <処理の名前>\",\n note: \"note <名札>: <下の小さな字>\",\n set: \"set <欄>: <値> [tag: <札>]\",\n };\n return {\n noHead: `最初の行に図の種類 (${list(KINDS)}) と題を書く`,\n badHead: `最初の行は ${KINDS.join(\" か \")} で始め、続けて題を書く`,\n oldForm: (word, shape) => `${word} は前の形の書き方。新しい形では ${shapes[shape]} と書く`,\n unknownHead: (word) => `${word} は行の頭に書けない。行は ${list(HEADS)} か、<名札> -> <名札> で始める`,\n duplicate: (id) => `${id} は既に宣言した名札`,\n needsId: (word) => `${word} の後ろに名札を書く`,\n badId: (id) => `${id} は名札に使えない。名札には空白と [ ] 「 」 = : を含めない`,\n afterId: \"名札の後ろには as <名前> か属性を書く\",\n undeclaredBox: (id) => `${id} という箱は宣言していない`,\n noBody: (title) => `段「${title}」に本文 (say の行) が要る`,\n emptyStepTitle: \"step の後ろに段の題を書く\",\n noBoxes: \"箱を 1 つ以上宣言する\",\n noSteps: \"段 (step の行) を 1 つ以上書く\",\n emptySay: \"say の後ろか、その下に字下げした行に段の本文を書く\",\n sayTwice: \"1 つの段に say は 1 つまで。長い本文は say の下に字下げして続ける\",\n codeTwice: \"1 つの段に code は 1 行まで\",\n emptyCode: \"code の後ろに命令を書く\",\n sourceShape: \"source は source <名前> [url: <URL>] の形で書く\",\n declarationInStep: \"group と box と strip と branch と、scale と period と row と point と zoom は最初の step より前に書く\",\n stepLineBeforeStep: \"線と say と code と source と act と note と set と commit と枝を切る行と、now と mark と span と、leaf と node の行は step の下に書く\",\n nestedGroup: \"group の中に group は書けない。先に end で閉じる\",\n strayEnd: \"end の前に、閉じる group が無い\",\n endTakesNothing: \"end の後ろには何も書かない\",\n unclosedGroup: (id) => `group ${id} を end で閉じていない`,\n regionReopened: (id) => `group ${id} は宣言済み。もう一度開く時は group ${id} だけを書き、名前と属性は最初の宣言に書く`,\n emptyName: (id) => `${id} の名前が空`,\n stripTwice: \"strip は 1 つだけ宣言する\",\n stripShape: \"strip は strip <題>: <欄>, <欄> の形で書く\",\n emptyStripField: \"strip の欄の名前が空\",\n stripUndeclared: \"set を書く前に、strip <題>: <欄>, <欄> で帯を宣言する\",\n noSuchField: (field) => `${field} という欄は strip に無い`,\n stripNeedsValue: \"set は set <欄>: <値> か set <欄> [tag: <札>] の形で書く\",\n actShape: \"act は act <名札>: <処理の名前> の形で書く\",\n noteShape: \"note は note <名札>: <下の小さな字> の形で書く\",\n edgeShape: \"線は <名札> -> <名札>: <線の名前> [<属性>] の形で書く\",\n emptyLabel: \"線の : の後ろに線の名前を書く。名前を書かない時は : も書かない\",\n quoteUnclosed: '\" で始めた字を \" で閉じていない',\n afterQuote: '\" で閉じた字の後ろには、属性か次の , だけを書く',\n attrUnclosed: \"属性は [ で始めて ] で閉じ、行の終わりに置く\",\n attrNoColon: (raw) => `[${raw}] は書けない。属性は [<鍵>: <値>] の形で書く`,\n attrNoValue: (key) => `${key}: の後ろに値を書く`,\n attrTwice: (key) => `${key} は 1 つの行に 1 つまで`,\n badAttr: (key, allowed) => `${key} はこの行に書けない属性。書けるのは ${list(allowed)}`,\n badColor: `color は ${list(COLORS)} のどれか`,\n badView: `view は ${list(VIEWS)} のどれか`,\n badCarry: `carry は ${list(CARRIES)} のどれか。札は tag: <値> で書く`,\n badSide: `side は ${list(SIDES)} のどれか`,\n badUrl: (key) => `${key} には / で始まる path か、http:// か https:// で始まる URL を書く`,\n carryTwice: \"運ぶ物は 1 本の線に 1 つまで。carry と tag は一緒に書かない\",\n reservedId: (id) => `${id} は状態遷移図の始まりと終わりの印の名前で、箱の名札に使えない`,\n intoStart: \"start へ入る線は書けない。start は始まりの印で、線は start から出る\",\n outOfFinish: \"finish から出る線は書けない。finish は終わりの印で、線は finish へ入る\",\n pathNoAttrs: \"最初の step より前の線は今回は通らない道なので、属性 (carry と tag と side) を書けない\",\n gitOnly: (word) => `${word} の行は git (枝分かれの図) でだけ書ける`,\n gitNoGroup: \"git (枝分かれの図) には group を書けない。枝は branch の行で宣言する\",\n noBranches: \"branch の行で枝を 1 つ以上宣言する\",\n branchShape: \"branch は branch <名札> [note: <添え書き>] の形で書く\",\n commitShape: \"commit は commit <名札> on <枝> [hash: <hash>, note: <一言>] の形で書く。当て直しは copy <commit> を、取り込みは merge <枝> を on <枝> の後ろに書く\",\n fromShape: \"枝を切る行は <枝> from <commit> の形で書く\",\n undeclaredBranch: (id) => `${id} という枝は宣言していない`,\n undeclaredRef: (id) => `${id} という枝は宣言していない。札を動かす線は枝の名札か HEAD から引く`,\n noCommit: (id) => `${id} という commit はまだ積んでいない`,\n emptyBranch: (id) => `${id} の枝はまだどの commit も指していないので取り込めない`,\n mergeSelf: (id) => `${id} は積む枝なので、取り込む枝にできない`,\n headReserved: (name) => `${name} は枝分かれの図で今いる場所の札の名前で、名札に使えない`,\n badHash: \"hash は 0 から 9 と a から f の字で 4 から 40 字にする\",\n timeOnly: (word) => `${word} は time (時間軸の図) でだけ書ける`,\n treeOnly: (word) => `${word} の行は tree (木の図) でだけ書ける`,\n treeNoGroup: \"tree (木の図) には group を書けない。木の箱は leaf と node の行で書く\",\n noLeaves: \"leaf の行で葉を 1 つ以上書く\",\n leafShape: \"leaf は leaf <名札> [hash: <hash>] の形で書く\",\n nodeShape: \"node は node <名札> of <子>, <子> [hash: <hash>] の形で書く\",\n noTreeChild: (id) => `${id} という葉か親はまだ書いていない。子は前に leaf か node で書いた名札にする`,\n notTreeBox: (id) => `${id} は box の行で置いた箱で、木の箱でない。子は leaf か node で書いた名札にする`,\n twoParents: (id) => `${id} はもう別の親の子になっている。木の箱の親は 1 つだけ`,\n manyRoots: (id, root) => `${id} が親を持たないまま残る。木の根は 1 つだけで、${id} も ${root} も最後に 1 つの根へ組む`,\n lineupOnly: (word) => `${word} の行は lineup (列の図) でだけ書ける`,\n lineupNoGroup: \"lineup (列の図) には group を書けない。列は box の行で宣言する\",\n lineupNoEdge: \"lineup (列の図) には線の行を書けない。チップは line の行で列の並びを書くと動く\",\n lineupNoAct: \"lineup (列の図) には act の行を書けない。列の右上の字は note の行で書き換える\",\n noItems: \"item の行でチップを 1 つ以上宣言する\",\n itemShape: \"item は item <名札>, <名札> [color: <色>, label: <字>] の形で書く\",\n lineShape: \"line は line <列>: <チップ>, <チップ> の形で書く\",\n laneShape: (word) => `${word} は ${word} <列> の形で書く`,\n stampShape: \"stamp は stamp <列>: <字> の形で書く\",\n labelTooLong: (limit) => `label は ${limit} 字までにする`,\n noSuchItem: (id) => `${id} というチップは宣言していない`,\n itemTwice: (id) => `${id} はこの行に 2 度書いている。同じ列に同じチップは 1 枚だけ`,\n laneFull: (lane, limit) => `${lane} の列に並べられるチップは ${limit} 枚まで`,\n lineOnSealed: (lane) => `${lane} の列は封をしているので並びを書けない。先に open で開ける`,\n sealTwice: (lane) => `${lane} の列にはもう封をしている`,\n openUnsealed: (lane) => `${lane} の列には封をしていない`,\n timeTwice: (word) => `${word} は 1 つだけ宣言する`,\n noScale: \"scale の行で目盛りを宣言する\",\n noRows: \"row の行で印の列を 1 つ以上宣言する\",\n scaleShape: \"scale は scale <単位> <長さ> <数> [from: <番号>] の形で書く\",\n periodShape: \"period は period <名前> <目盛りの数> [from: <番号>] の形で書く\",\n rowShape: \"row は row <名札> as <名前> [color: <色>, empty: <目盛り> <目盛り>] の形で書く\",\n pointShape: \"point は point <名札> at <目盛り> の形で書く\",\n zoomShape: \"zoom は zoom <目盛り>-<目盛り> の形で書く\",\n nowShape: \"針を進める行は now -> <目盛り> の形で書く\",\n markShape: \"mark は mark <列> <目盛り>-<目盛り> [color: <色>] の形で書く\",\n spanShape: `span は span <目盛り>-<目盛り>: <字> [shape: ${list(SPAN_SHAPES)}, color: <色>] の形で書く`,\n badLength: `長さは数と単位 (${list(DURATION_UNITS)}) の組で書く (12s など)`,\n badCount: (word) => `${word} の目盛りの数は 1 以上の整数にする`,\n badUnit: (text, count) => `${text} は目盛りの位置にできない。0 から ${count - 1} の数か、その範囲 (0-3 など) を書く`,\n nowBack: (text, at) => `now -> ${text} は針を進めない。前の now (${at}) より後の目盛りを書く`,\n outOfZoom: (from, to) => `拡大の帯の列は ${from} から ${to} の目盛りから選ぶ`,\n noZoom: \"at と into は、zoom で拡大の帯を宣言した図の箱どうしの線にだけ書ける\",\n boxNeedsZoom: \"時間軸の図の箱は拡大の帯に置く。zoom <目盛り>-<目盛り> で拡大の範囲を書く\",\n boxLineNeedsAt: \"拡大の帯の箱どうしの線には [at: <目盛り>] で列を書く\",\n pointLineNoAt: \"節目どうしの線は軸の上に引くので、at と into を書けない\",\n mixedLine: \"線は箱どうしか、節目どうしで引く\",\n undeclaredRow: (id) => `${id} という印の列は宣言していない`,\n undeclaredNote: (id) => `${id} という箱か節目は宣言していない`,\n nowReserved: (name) => `${name} は時間軸の図で針を進める行の語で、名札に使えない`,\n noteColorPointOnly: \"note の color は節目の丸の色で、節目の note にだけ書ける\",\n badShape: `shape は ${list(SPAN_SHAPES)} だけ書ける。括弧は shape を書かない`,\n badRatio: \"物差しの線は分数 (2/3) か百分率 (97%) で書く\",\n meterValue: (field) => `${field} は物差しの欄なので、値を分数 (2/3) か百分率 (97%) で書く`,\n };\n};\n\nconst en = (): Messages => {\n const shapes: Record<Shape, string> = {\n sequence: \"sequence <title>\",\n architecture: \"architecture <title>\",\n group: \"group <id> as <name> [note: <note>] through end\",\n box: \"box <id> as <name> [note: <caption>]\",\n strip: \"strip <title>: <field>, <field>\",\n view: \"sequence <title> [view: follow]\",\n step: \"step <step title>\",\n say: \"say <step body>\",\n code: \"code <command>\",\n act: \"act <id>: <action>\",\n note: \"note <id>: <caption>\",\n set: \"set <field>: <value> [tag: <tag>]\",\n };\n return {\n noHead: `Write the diagram kind (${list(KINDS)}) and a title on the first line`,\n badHead: `Start the first line with ${KINDS.join(\" or \")}, followed by the title`,\n oldForm: (word, shape) => `${word} is the old notation. Write ${shapes[shape]} instead`,\n unknownHead: (word) => `A line cannot start with ${word}. Start a line with ${list(HEADS)}, or <id> -> <id>`,\n duplicate: (id) => `${id} is already declared`,\n needsId: (word) => `Write an id after ${word}`,\n badId: (id) => `${id} cannot be an id. An id has no spaces and none of [ ] 「 」 = :`,\n afterId: \"Write as <name> or attributes after the id\",\n undeclaredBox: (id) => `No box named ${id} is declared`,\n noBody: (title) => `Step \"${title}\" needs a body (a say line)`,\n emptyStepTitle: \"Write a title after step\",\n noBoxes: \"Declare at least one box\",\n noSteps: \"Write at least one step (a step line)\",\n emptySay: \"Write the step body after say, or on indented lines below it\",\n sayTwice: \"A step takes one say. Continue a long body on indented lines below it\",\n codeTwice: \"A step takes at most one code line\",\n emptyCode: \"Write the command after code\",\n sourceShape: \"Write a source as source <name> [url: <URL>]\",\n declarationInStep: \"Write group, box, strip, branch, scale, period, row, point and zoom before the first step\",\n stepLineBeforeStep: \"Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark, span, leaf and node under a step\",\n nestedGroup: \"A group cannot hold another group. Close it with end first\",\n strayEnd: \"There is no group for this end to close\",\n endTakesNothing: \"Write nothing after end\",\n unclosedGroup: (id) => `group ${id} is not closed with end`,\n regionReopened: (id) => `group ${id} is already declared. To open it again, write only group ${id}; put the name and attributes on the first one`,\n emptyName: (id) => `${id} has an empty name`,\n stripTwice: \"Declare only one strip\",\n stripShape: \"Write a strip as strip <title>: <field>, <field>\",\n emptyStripField: \"A strip field name is empty\",\n stripUndeclared: \"Declare the strip as strip <title>: <field>, <field> before writing set\",\n noSuchField: (field) => `The strip has no field named ${field}`,\n stripNeedsValue: \"Write set as set <field>: <value> or set <field> [tag: <tag>]\",\n actShape: \"Write act as act <id>: <action>\",\n noteShape: \"Write note as note <id>: <caption>\",\n edgeShape: \"Write a line as <id> -> <id>: <label> [<attributes>]\",\n emptyLabel: \"Write the label after the : of a line, or leave out the : as well\",\n quoteUnclosed: 'A value that starts with \" is not closed with \"',\n afterQuote: 'After a value closed with \", write only attributes or the next ,',\n attrUnclosed: \"Start attributes with [, close them with ], and put them at the end of the line\",\n attrNoColon: (raw) => `[${raw}] cannot be read. Write an attribute as [<key>: <value>]`,\n attrNoValue: (key) => `Write a value after ${key}:`,\n attrTwice: (key) => `Write ${key} only once on a line`,\n badAttr: (key, allowed) => `${key} cannot be written on this line. Write ${list(allowed)}`,\n badColor: `color is one of ${list(COLORS)}`,\n badView: `view is one of ${list(VIEWS)}`,\n badCarry: `carry is one of ${list(CARRIES)}. Write a tag as tag: <value>`,\n badSide: `side is one of ${list(SIDES)}`,\n badUrl: (key) => `Write a path that starts with / or a URL that starts with http:// or https:// for ${key}`,\n carryTwice: \"A line carries one thing. Do not write carry and tag together\",\n reservedId: (id) => `${id} names the start or end mark of a state diagram and cannot be a box id`,\n intoStart: \"A line cannot go into start. start is the start mark, and lines leave it\",\n outOfFinish: \"A line cannot leave finish. finish is the end mark, and lines go into it\",\n pathNoAttrs: \"A line before the first step is a path not taken, so it takes no attributes (carry, tag, side)\",\n gitOnly: (word) => `${word} lines can be written only in git diagrams`,\n gitNoGroup: \"A git diagram takes no group. Declare branches with branch lines\",\n noBranches: \"Declare at least one branch with a branch line\",\n branchShape: \"Write a branch as branch <id> [note: <note>]\",\n commitShape: \"Write a commit as commit <id> on <branch> [hash: <hash>, note: <note>]. For a replayed commit add copy <commit>, and for a merge commit add merge <branch>, after on <branch>\",\n fromShape: \"Write a branch cut as <branch> from <commit>\",\n undeclaredBranch: (id) => `No branch named ${id} is declared`,\n undeclaredRef: (id) => `No branch named ${id} is declared. A line that moves a ref starts from a branch id or HEAD`,\n noCommit: (id) => `No commit named ${id} has been made yet`,\n emptyBranch: (id) => `Branch ${id} does not point at any commit yet, so it cannot be merged`,\n mergeSelf: (id) => `${id} is the branch being committed to, so it cannot be the branch merged in`,\n headReserved: (name) => `${name} names where you are in a git diagram and cannot be an id`,\n badHash: \"Write a hash as 4 to 40 characters of 0-9 and a-f\",\n timeOnly: (word) => `${word} can be written only in time diagrams`,\n treeOnly: (word) => `${word} lines can be written only in tree diagrams`,\n treeNoGroup: \"A tree diagram takes no group. Write the tree boxes with leaf and node lines\",\n noLeaves: \"Write at least one leaf with a leaf line\",\n leafShape: \"Write a leaf as leaf <id> [hash: <hash>]\",\n nodeShape: \"Write a node as node <id> of <child>, <child> [hash: <hash>]\",\n noTreeChild: (id) => `No leaf or node named ${id} has been written yet. A child must be an id written earlier with leaf or node`,\n notTreeBox: (id) => `${id} is a box from a box line, not a tree box. A child must be an id written with leaf or node`,\n twoParents: (id) => `${id} is already a child of another node. A tree box has only one parent`,\n manyRoots: (id, root) => `${id} is left without a parent. A tree has one root, so join ${id} and ${root} under one root by the end`,\n lineupOnly: (word) => `${word} lines can be written only in lineup diagrams`,\n lineupNoGroup: \"A lineup diagram takes no group. Declare the lanes with box lines\",\n lineupNoEdge: \"A lineup diagram takes no edge lines. Chips move when a line line rewrites a lane\",\n lineupNoAct: \"A lineup diagram takes no act lines. Rewrite the text at the top right of a lane with a note line\",\n noItems: \"Declare at least one chip with an item line\",\n itemShape: \"Write an item as item <id>, <id> [color: <color>, label: <text>]\",\n lineShape: \"Write a line as line <lane>: <chip>, <chip>\",\n laneShape: (word) => `Write ${word} as ${word} <lane>`,\n stampShape: \"Write a stamp as stamp <lane>: <text>\",\n labelTooLong: (limit) => `A label is at most ${limit} characters`,\n noSuchItem: (id) => `The chip ${id} is not declared`,\n itemTwice: (id) => `${id} is written twice on this line. A lane holds one of each chip`,\n laneFull: (lane, limit) => `The lane ${lane} holds at most ${limit} chips`,\n lineOnSealed: (lane) => `The lane ${lane} is sealed, so its order cannot be written. Open it first`,\n sealTwice: (lane) => `The lane ${lane} is already sealed`,\n openUnsealed: (lane) => `The lane ${lane} is not sealed`,\n timeTwice: (word) => `Declare only one ${word}`,\n noScale: \"Declare the scale with a scale line\",\n noRows: \"Declare at least one row with a row line\",\n scaleShape: \"Write a scale as scale <unit> <length> <count> [from: <number>]\",\n periodShape: \"Write a period as period <name> <units> [from: <number>]\",\n rowShape: \"Write a row as row <id> as <name> [color: <color>, empty: <unit> <unit>]\",\n pointShape: \"Write a point as point <id> at <unit>\",\n zoomShape: \"Write a zoom as zoom <unit>-<unit>\",\n nowShape: \"Write a needle line as now -> <unit>\",\n markShape: \"Write a mark as mark <row> <unit>-<unit> [color: <color>]\",\n spanShape: `Write a span as span <unit>-<unit>: <text> [shape: ${list(SPAN_SHAPES)}, color: <color>]`,\n badLength: `Write a length as a number and a unit (${list(DURATION_UNITS)}), such as 12s`,\n badCount: (word) => `The unit count of ${word} is a whole number of 1 or more`,\n badUnit: (text, count) => `${text} cannot be a unit. Write a number from 0 to ${count - 1}, or a range such as 0-3`,\n nowBack: (text, at) => `now -> ${text} does not move the needle forward. Write a unit after the previous now (${at})`,\n outOfZoom: (from, to) => `Pick a zoom column from units ${from} to ${to}`,\n noZoom: \"at and into are allowed only on lines between boxes in a diagram that declares a zoom\",\n boxNeedsZoom: \"Boxes of a time diagram sit in the zoom band. Write the zoom range as zoom <unit>-<unit>\",\n boxLineNeedsAt: \"Write the column of a line between zoom boxes as [at: <unit>]\",\n pointLineNoAt: \"A line between points runs along the axis, so it takes no at or into\",\n mixedLine: \"Draw a line between two boxes or between two points\",\n undeclaredRow: (id) => `No row named ${id} is declared`,\n undeclaredNote: (id) => `No box or point named ${id} is declared`,\n nowReserved: (name) => `${name} starts the needle line of a time diagram and cannot be an id`,\n noteColorPointOnly: \"The color of a note colors the circle of a point, so write it only on the note of a point\",\n badShape: `shape takes only ${list(SPAN_SHAPES)}. A bracket takes no shape`,\n badRatio: \"Write the meter line as a fraction (2/3) or a percentage (97%)\",\n meterValue: (field) => `${field} is a meter, so write its value as a fraction (2/3) or a percentage (97%)`,\n };\n};\n\nconst MESSAGES: Record<NotationLang, Messages> = { ja: ja(), en: en() };\n\nexport const messagesFor = (lang: NotationLang): Messages => MESSAGES[lang];\n","/**\n * 記法を 1 行ずつに切る。\n *\n * 空行とコメントの行 (`//` で始まる行) も捨てずに返す。`say` の下に字下げして続けた本文では、\n * 空行も `//` で始まる行も本文の字になるため、捨てるかは読む側が行の場所で決める (#3137)。\n * 行の頭と終わりの空白は落とし、頭の空白の字の数を `indent` に残す。\n * 誤りを示すために元の行の番号と、残した字が始まる列を持たせる。\n * 行と列は 1 から数え、列は字の数で数える (UTF-16 の単位では数えない)。\n */\nexport interface SourceLine {\n line: number;\n column: number;\n /** 行の頭の空白の字の数。`say` の続きの行を見分ける */\n indent: number;\n text: string;\n}\n\n/** 空行かコメントの行 */\nexport const isBlankOrComment = (source: SourceLine): boolean => source.text === \"\" || source.text.startsWith(\"//\");\n\n/** `text` の `index` 番目 (UTF-16 の位置) にある字が、行の何列目かを返す。 */\nexport function columnOf(source: SourceLine, index: number): number {\n return source.column + Array.from(source.text.slice(0, index)).length;\n}\n\nexport function tokenize(notation: string): SourceLine[] {\n return notation.split(/\\r?\\n/).map((raw, index) => {\n const indent = Array.from(raw.slice(0, raw.length - raw.trimStart().length)).length;\n return { line: index + 1, column: indent + 1, indent, text: raw.trim() };\n });\n}\n","/**\n * 原本の形式の版。\n *\n * 道具より新しい版の図は描かずに断る。古い版の図は、版を 1 つずつ上げる変換を通して読み、\n * 原本の file を書き換えるのは移行の命令 (`migrateFile`、Node でだけ動く入口 `node.ts`) だけにする。\n * 今は版 1 しか無いため、版を上げる変換はまだ持たない。版 2 を作る時に、版 1 から 2 への変換と\n * 古い版を読んだ時の警告をここに足す。\n */\nimport { FIELD_MESSAGES } from \"./field-messages\";\nimport { type CheckOptions, type Diagram, type FieldError, validateDiagram } from \"./schema\";\nimport type { NotationLang } from \"./words\";\n\n/** この道具が読める原本の版 */\nexport const FORMAT_VERSION = 1;\n\nexport type Read = { ok: true; diagram: Diagram; warnings: string[] } | { ok: false; errors: FieldError[] };\n\nfunction newerThanTool(input: unknown): number | undefined {\n if (typeof input !== \"object\" || input === null) return undefined;\n const version = (input as { version?: unknown }).version;\n return typeof version === \"number\" && version > FORMAT_VERSION ? version : undefined;\n}\n\nconst newerError = (version: number, lang: NotationLang): FieldError => ({\n pointer: \"/version\",\n message: FIELD_MESSAGES[lang].newer(version, FORMAT_VERSION),\n});\n\n/** 原本を読む。道具より新しい版は描かずに断り、形の誤りは検査の誤りとして返す。誤りの文は `options.lang` (渡さなければ日本語) で出す。 */\nexport function readDiagram(input: unknown, options: CheckOptions = {}): Read {\n const newer = newerThanTool(input);\n if (newer !== undefined) return { ok: false, errors: [newerError(newer, options.lang ?? \"ja\")] };\n const checked = validateDiagram(input, options);\n if (!checked.ok) return checked;\n return { ok: true, diagram: input as Diagram, warnings: [] };\n}\n","/**\n * 人が書く dragon記法を、図の原本の JSON へ変える (#3137)。\n *\n * 行の種類は行の頭の英語の語で決まり、線の行だけは箱の名札から始まる。最初の `step` より前に\n * 図の種類と題と区画と箱と帯を宣言し、`step` ごとに、その段で起きることを起きる順に並べる。\n *\n * sequence <題> [view: fixed か follow] 書かなければ字の大きさで選ぶ。図の種類は sequence と architecture と state\n * group <名札> as <名前> [note: <添え書き>, color: <色>, icon: <印>]\n * box <名札> as <名前> [note: <下の小さな字>, color: <色>, icon: <印>, link: <飛び先>]\n * end 同じ名札の group はもう一度開ける\n * box <名札> as <名前> [...] as が無ければ名札を名前にする\n * strip <題>: <欄>, <欄>\n * step <段の題>\n * say <段の本文> say の下に字下げした行は本文の続き\n * code <段で打つ命令>\n * source <出典の名前> [url: <URL>] 1 つの段に何行でも書ける\n * <名札> -> <名札>: <線の名前> [carry: <運ぶ物>, tag: <値>, side: <側>]\n * act <名札>: <処理の名前> 箱の中の処理\n * note <名札>: <字> 箱の下の小さな字の書き換え\n * set <欄>: <値> [tag: <札>] 中身の帯の値\n *\n * 鍵と値はコロンで区切り、属性は `[ ]` の中に `,` で並べて行の終わりに置く。\n * 空白を含む名前と文は行の終わりか `[` の前に置き、`[` を含む名前と `,` か `]` を含む属性の値だけを\n * `\"` で囲む。囲みの中では `\\\"` が `\"`、`\\\\` が `\\` になる。字下げは `say` の続きの行を見分ける時だけ意味を持つ。\n *\n * 箱の飛び先 (`link`) と段の出典の `url` は描いた図と段の一覧の link にそのまま入るため、頁を移る形\n * (`/` で始まる path か、`http://` か `https://` で始まる URL) だけを受ける (#3199)。\n *\n * 状態遷移図 (`state`) では、線の送る側に始まりの印 `start`、受ける側に終わりの印 `finish` を書ける。\n * 最初の `step` より前に書いた線は、移れるが段で通るとは限らない道 (`state.paths`) になり、属性を持たない (#3163)。\n * 状態遷移図の `start` と `finish` は箱の名札に使えない。時系列図と構成図では宣言して使う普通の名札のまま。\n *\n * 枝分かれの図 (`git`、#3164) は、最初の `step` より前に `branch <名札> [note: <添え書き>]` で枝を上から順に宣言し、\n * 段の中に `commit <名札> on <枝> [hash: <hash>, note: <一言>]` で commit を積み、`<枝> from <commit>` で枝を切る。\n * 当て直しは `on <枝>` の後ろに `copy <commit>` を、merge commit は `merge <枝>` を続ける。\n * 線の行は札を動かす行になり、送る側に枝の名札か `HEAD`、受ける側に積んだ commit を書く。運ぶ物は書かなければ送る側の名前の札。\n * 枝分かれの図では `HEAD` を名札に使えず、区画 (`group`) は書けない。`branch` と `commit` の行は枝分かれの図でだけ書ける。\n *\n * 時間軸の図 (`time`、#3165) は、最初の `step` より前に目盛りと区切りと印の列と節目と拡大の範囲を宣言する。\n *\n * scale <単位> <長さ> <数> [from: <最初の番号>] 長さは数と単位 (ms、s、min、h、d) の組 (`12s`)\n * period <名前> <目盛りの数> [from: <最初の番号>]\n * row <名札> as <名前> [color: <色>, empty: <目盛り> <目盛り>]\n * point <名札> at <目盛り>\n * zoom <目盛り>-<目盛り>\n *\n * 段の中では `now -> <目盛り>` で針をその目盛りの終わりまで進め、`mark <列> <範囲> [color: <色>]` で印の色を変え、\n * `span <範囲>: <字> [shape: box, color: <色>]` で範囲に括弧か囲みを出す。目盛りは 0 から数え、範囲は `0-31` か `0` と書く。\n * 箱は拡大の帯に置き、箱どうしの線は `[at: <目盛り>]` で列を選び、受ける箱を別の列から選ぶ時は `[into: <目盛り>]` を足す。\n * 節目どうしの線は軸の上に引き、`note <節目>: <状態> [color: <色>]` で節目の状態と丸の色を変える。\n * 中身の帯の欄の名前の後ろに `[meter: <割合>]` を書くと物差しになり、`set` の値を割合 (`97%` か `2/3`) で書く。\n * 印の列と箱は同じ名札を持てる (空いた目盛りの列でその箱を空きの枠にするため)。時間軸の図では `now` を名札に使えない。\n *\n * 木の図 (`tree`、#3233) は、段の中に `leaf <名札> [hash: <hash>]` で葉を出し、`node <名札> of <子>, <子> [hash: <hash>]` で\n * 前に書いた葉か親を子にして親を組む。箱は書いた段で現れ、親は 1 つだけ持てる。最後の段を終えた時に親を持たない木の箱は根の 1 つだけ。\n * 線の端には木の箱も `box` の箱も書ける。木の図に区画 (`group`) は書けず、`leaf` と `node` の行は木の図でだけ書ける。\n *\n * 列の図 (`lineup`、#3239) は、`box` の行が列になり、最初の `step` より前に `item <名札>, <名札> [color: <色>, label: <字>]` でチップを宣言する。\n * 段の中で `line <列>: <チップ>, <チップ>` と書くと列の並びが替わり、`seal <列>` で封をし、`open <列>` で開け、`pick <列>` で列を選び、\n * `stamp <列>: <字>` で札を押す。列の図に区画 (`group`) と線と `act` の行は書けない。封をした列の並びは、開けるまで書けない。\n * `item`、`line`、`seal`、`open`、`pick`、`stamp` の行は列の図でだけ書ける。\n *\n * 行の頭の語と同じ綴りの名札 (`end` や `step`) も書ける。名札の次に `->` が来る行は線と読む。\n * 誤りは最初の 1 つで止め、行と列を示す。誤りの文の言葉は呼ぶ側が渡す。\n */\nimport { type Messages, messagesFor, type Shape } from \"./messages\";\nimport {\n type Box,\n type Carry,\n type Color,\n COLORS,\n type Diagram,\n type DiagramEvent,\n type GitBranch,\n type GitCommit,\n type LabelSide,\n type LineupItem,\n type Region,\n type StatePath,\n type Step,\n type StepSource,\n type StripMeter,\n type TimePeriod,\n type TimePoint,\n type TimeRow,\n type TimeScale,\n type ViewMode,\n} from \"./schema\";\nimport { columnOf, isBlankOrComment, type SourceLine, tokenize } from \"./tokenize\";\nimport { FORMAT_VERSION } from \"./version\";\nimport {\n AS,\n AT,\n ATTRS,\n CARRIES,\n COPY,\n FROM,\n HEAD,\n HEADS,\n KINDS,\n LABEL_MOST,\n LANE_ATTRS,\n LANE_MOST,\n LINEUP_HEADS,\n MERGE,\n type NotationLang,\n NOW,\n OF,\n OLD_HEADS,\n ON,\n SIDES,\n SPAN_SHAPES,\n STATE_ENDS,\n TIME_EDGE_ATTRS,\n TIME_HEADS,\n TREE_HEADS,\n VIEWS,\n} from \"./words\";\n\nexport interface LineError {\n line: number;\n column: number;\n message: string;\n}\n\nexport type Parsed = { ok: true; diagram: Diagram } | { ok: false; errors: LineError[] };\n\nexport interface ParseOptions {\n /** 誤りの文の言葉。既定は日本語 */\n lang?: NotationLang;\n}\n\nclass NotationError extends Error {\n constructor(\n readonly line: number,\n readonly column: number,\n message: string,\n ) {\n super(message);\n }\n}\n\nconst fail = (source: SourceLine, index: number, message: string): NotationError =>\n new NotationError(source.line, columnOf(source, index), message);\n\n/** 名札に使える字。原本の JSON の名札の形と同じ */\nconst ID = /^[^\\s[\\]「」=:]+$/u;\n/** 線の行。名札、`->`、名札 */\nconst EDGE = /^([^\\s:[\\]]+?)\\s*->\\s*([^\\s:[\\]]+)/du;\n/** 枝分かれの図の `commit` の行。名札と、`on` の枝と、`copy` の当て直しの元と、`merge` の取り込む枝 */\nconst COMMIT = new RegExp(`^commit\\\\s+([^\\\\s[]+)(?:\\\\s+${ON}\\\\s+([^\\\\s[]+))?(?:\\\\s+${COPY}\\\\s+([^\\\\s[]+))?(?:\\\\s+${MERGE}\\\\s+([^\\\\s[]+))?`, \"du\");\n/** 枝分かれの図の、枝を切る行。枝と `from` と切る commit */\nconst CUT = new RegExp(`^([^\\\\s[]+)\\\\s+${FROM}(?:\\\\s+([^\\\\s[]+))?\\\\s*$`, \"du\");\n/** 木の図の `leaf` の行の名札と、`node` の行の名札と `of` */\nconst LEAF = /^leaf\\s+([^\\s[]+)/du;\nconst NODE = new RegExp(`^node\\\\s+([^\\\\s[]+)\\\\s+${OF}\\\\s+`, \"du\");\n/** 列の図の、`line <列>:` と `stamp <列>:` の行の列と、`seal`、`open`、`pick` の行の列 */\nconst ORDER = /^line\\s+([^\\s:[]+)\\s*:/du;\nconst STAMP = /^stamp\\s+([^\\s:[]+)\\s*:/du;\nconst ON_LANE = /^(?:seal|open|pick)\\s+(\\S+)\\s*$/du;\n/** commit の hash。原本の JSON の hash の形と同じ */\nconst HASH = /^[0-9a-f]{4,40}$/u;\n/** 箱の飛び先と段の出典の URL。原本の JSON の URL の形と同じ */\nconst URL_FORM = /^(\\/|https?:\\/\\/)/u;\n/** 時間軸の図の宣言の行。`scale <単位> <長さ> <数>`、`period <名前> <数>`、`point <名札> at <目盛り>`、`zoom <範囲>` */\nconst SCALE = /^scale\\s+(\\S+)\\s+(\\S+)\\s+([^\\s[]+)/du;\nconst PERIOD = /^period\\s+(\\S+)\\s+([^\\s[]+)/du;\nconst POINT = new RegExp(`^point\\\\s+(\\\\S+)\\\\s+${AT}\\\\s+(\\\\S+)\\\\s*$`, \"du\");\nconst ZOOM = /^zoom\\s+(\\S+)\\s*$/du;\n/** 時間軸の図の段の中の行。`now -> <目盛り>`、`mark <列> <範囲>`、`span <範囲>:` */\nconst NEEDLE = new RegExp(`^${NOW}\\\\s*->`, \"u\");\nconst NOW_LINE = new RegExp(`^${NOW}\\\\s*->\\\\s*(\\\\S+)\\\\s*$`, \"du\");\nconst MARK = /^mark\\s+([^\\s[]+)\\s+([^\\s[]+)/du;\nconst SPAN = /^span\\s+([^\\s:[]+)\\s*:/du;\n/** 目盛りの長さ。原本の JSON の長さの形と同じ */\nconst LENGTH = /^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$/u;\n/** 割合。原本の JSON の割合の形と同じ */\nconst RATIO = /^([0-9]+\\/[0-9]+|[0-9]+(\\.[0-9]+)?%)$/u;\n/** 1 以上の整数と、0 以上の整数 */\nconst COUNT = /^[1-9][0-9]*$/u;\nconst NUMBER = /^(0|[1-9][0-9]*)$/u;\n/** 目盛りの範囲。`0-31` か `0` */\nconst RANGE = /^(0|[1-9][0-9]*)(?:-(0|[1-9][0-9]*))?$/u;\n\nconst isOneOf = <T extends string>(list: readonly T[], word: string): word is T => (list as readonly string[]).includes(word);\n\n/** `at` から空白を飛ばした位置 */\nfunction skipSpaces(text: string, at: number): number {\n let i = at;\n while (i < text.length && /\\s/u.test(text[i] ?? \"\")) i++;\n return i;\n}\n\n/** `[<鍵>: <値>]` の 1 つ。`at` は鍵の位置 */\ninterface Attr {\n value: string;\n at: number;\n}\n\n/** `at` の `\"` から閉じる `\"` までを読む。`end` は閉じた `\"` の次 */\nfunction readQuoted(source: SourceLine, at: number, m: Messages): { value: string; end: number } {\n const text = source.text;\n let value = \"\";\n for (let i = at + 1; i < text.length; i++) {\n const c = text[i] ?? \"\";\n const next = text[i + 1] ?? \"\";\n if (c === \"\\\\\" && (next === '\"' || next === \"\\\\\")) {\n value += next;\n i++;\n } else if (c === '\"') {\n return { value, end: i + 1 };\n } else {\n value += c;\n }\n }\n throw fail(source, at, m.quoteUnclosed);\n}\n\n/**\n * `at` から名前か文を読む。`\"` で始まれば囲みの中、そうでなければ `[` の前か行の終わりまで。\n * `rest` は名前の後ろの位置で、行の終わりか属性の `[` を指す。\n */\nfunction readName(source: SourceLine, at: number, m: Messages): { value: string; rest: number } {\n const text = source.text;\n const start = skipSpaces(text, at);\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n const rest = skipSpaces(text, quoted.end);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.afterQuote);\n return { value: quoted.value, rest };\n }\n const open = text.indexOf(\"[\", start);\n const rest = open < 0 ? text.length : open;\n return { value: text.slice(start, rest).trim(), rest };\n}\n\n/** `at` の `[` から行の終わりの `]` までの属性を読む。`allowed` に無い鍵は誤り */\nfunction readAttrs(source: SourceLine, at: number, allowed: readonly string[], m: Messages): Map<string, Attr> {\n const text = source.text;\n if (!text.endsWith(\"]\")) throw fail(source, at, m.attrUnclosed);\n const close = text.length - 1;\n const attrs = new Map<string, Attr>();\n for (let i = at + 1; ; ) {\n const start = skipSpaces(text, i);\n let colon = start;\n while (colon < close && text[colon] !== \":\" && text[colon] !== \",\") colon++;\n if (colon >= close || text[colon] !== \":\") throw fail(source, start, m.attrNoColon(text.slice(start, colon).trim()));\n const key = text.slice(start, colon).trim();\n if (!allowed.includes(key)) throw fail(source, start, m.badAttr(key, allowed));\n if (attrs.has(key)) throw fail(source, start, m.attrTwice(key));\n let end = skipSpaces(text, colon + 1);\n let value: string;\n if (text[end] === '\"') {\n const quoted = readQuoted(source, end, m);\n value = quoted.value;\n end = skipSpaces(text, quoted.end);\n if (end < close && text[end] !== \",\") throw fail(source, end, m.afterQuote);\n } else {\n const comma = text.indexOf(\",\", end);\n const stop = comma < 0 || comma > close ? close : comma;\n value = text.slice(end, stop).trim();\n end = stop;\n }\n if (value === \"\") throw fail(source, start, m.attrNoValue(key));\n attrs.set(key, { value, at: start });\n if (end >= close) return attrs;\n i = end + 1;\n }\n}\n\n/** `at` から `,` で区切った字の並びを行の終わりまで読む */\nfunction readList(source: SourceLine, at: number, m: Messages): string[] {\n const text = source.text;\n const items: string[] = [];\n for (let i = at; ; ) {\n const start = skipSpaces(text, i);\n let value: string;\n let end: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n value = quoted.value;\n end = skipSpaces(text, quoted.end);\n if (end < text.length && text[end] !== \",\") throw fail(source, end, m.afterQuote);\n } else {\n const comma = text.indexOf(\",\", start);\n end = comma < 0 ? text.length : comma;\n value = text.slice(start, end).trim();\n }\n if (value === \"\") throw fail(source, start, m.emptyStripField);\n items.push(value);\n if (end >= text.length) return items;\n i = end + 1;\n }\n}\n\n/** `group` と `box` の行の、名札と `as` の後ろの名前と属性 */\ninterface Declared {\n id: string;\n idAt: number;\n name?: string;\n attrs: Map<string, Attr>;\n}\n\nfunction readDeclared(source: SourceLine, word: string, allowed: readonly string[], m: Messages): Declared {\n const text = source.text;\n const start = skipSpaces(text, word.length);\n const id = /^[^\\s[]+/u.exec(text.slice(start))?.[0];\n if (id === undefined) throw fail(source, 0, m.needsId(word));\n if (!ID.test(id)) throw fail(source, start, m.badId(id));\n let rest = skipSpaces(text, start + id.length);\n let name: string | undefined;\n if (text.startsWith(AS, rest) && /^(\\s|$)/u.test(text.slice(rest + AS.length, rest + AS.length + 1))) {\n const named = readName(source, rest + AS.length, m);\n if (named.value === \"\") throw fail(source, rest, m.emptyName(id));\n name = named.value;\n rest = named.rest;\n }\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.afterId);\n const attrs = rest < text.length ? readAttrs(source, rest, allowed, m) : new Map<string, Attr>();\n return { id, idAt: start, ...(name !== undefined ? { name } : {}), attrs };\n}\n\n/** 区画と箱の属性 (`note` と `color` と `icon`) */\nfunction lookOf(source: SourceLine, attrs: Map<string, Attr>, m: Messages): { note?: string; color?: Color; icon?: string } {\n const color = attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n const note = attrs.get(\"note\")?.value;\n const icon = attrs.get(\"icon\")?.value;\n return {\n ...(note !== undefined ? { note } : {}),\n ...(color ? { color: color.value as Color } : {}),\n ...(icon !== undefined ? { icon } : {}),\n };\n}\n\n/**\n * 前の形 (#2997 まで) の行なら、その印と、新しい形で書く行の形。`inStep` は段の中の行か。\n * 新しい形で読めない行の誤りの文で、書き直し方を示すために引く。\n */\nfunction oldForm(text: string, inStep: boolean): { word: string; shape: Shape } | undefined {\n const first = text.split(/\\s/u)[0] ?? \"\";\n if (first === \"帯\") return { word: first, shape: inStep ? \"set\" : \"strip\" };\n if (Object.hasOwn(OLD_HEADS, first)) return { word: first, shape: OLD_HEADS[first as keyof typeof OLD_HEADS] };\n if (text.startsWith(\"#\")) return { word: \"#\", shape: \"step\" };\n if (text.startsWith(\">\")) return { word: \">\", shape: \"say\" };\n if (text.startsWith(\"`\")) return { word: \"`\", shape: \"code\" };\n if (text.includes(\"「\")) return { word: \"「」\", shape: inStep ? \"note\" : \"box\" };\n if (/^[^\\s=:]+\\s*=(?!>)/u.test(text)) return { word: \"=\", shape: \"box\" };\n if (inStep && /^[^\\s:]+\\s*:/u.test(text)) return { word: \":\", shape: \"act\" };\n return undefined;\n}\n\n/** 読んでいる段。`body` は `say` を読むまで無い */\ninterface Building {\n source: SourceLine;\n title: string;\n body?: string[];\n code?: string;\n sources: StepSource[];\n events: DiagramEvent[];\n}\n\nfunction parseLines(lines: SourceLine[], m: Messages): Diagram {\n const headAt = lines.findIndex((source) => !isBlankOrComment(source));\n const head = lines[headAt];\n if (!head) throw new NotationError(1, 1, m.noHead);\n const kind = head.text.split(/\\s/u)[0] ?? \"\";\n if (!isOneOf(KINDS, kind)) {\n const old = oldForm(head.text, false);\n throw fail(head, 0, old ? m.oldForm(old.word, old.shape) : m.badHead);\n }\n const titled = readName(head, kind.length, m);\n if (titled.value === \"\") throw fail(head, 0, m.badHead);\n const title = titled.value;\n const shown = titled.rest < head.text.length ? readAttrs(head, titled.rest, ATTRS.diagram, m).get(\"view\") : undefined;\n if (shown && !isOneOf(VIEWS, shown.value)) throw fail(head, shown.at, m.badView);\n const view = shown?.value as ViewMode | undefined;\n\n const isState = kind === \"state\";\n const isGit = kind === \"git\";\n const isTime = kind === \"time\";\n const isTree = kind === \"tree\";\n const isLineup = kind === \"lineup\";\n /** 列の図で宣言したチップと、今封をしている列 (#3239) */\n const items: LineupItem[] = [];\n const sealed = new Set<string>();\n /** 木の図で書いた木の箱と、書いた行と名札の位置。子の箱から親の名札 */\n const trees = new Map<string, { source: SourceLine; at: number }>();\n const parents = new Map<string, string>();\n /** 時間軸の図の目盛りと区切りと印の列と節目と拡大の範囲 (#3165) */\n let scale: TimeScale | undefined;\n let period: TimePeriod | undefined;\n const rows: TimeRow[] = [];\n const points: TimePoint[] = [];\n let zoom: { from: number; to: number } | undefined;\n const meters: StripMeter[] = [];\n /** 目盛りの数が決まってから確かめる、宣言の行の目盛り。最初の step で確かめる */\n const pending: (() => void)[] = [];\n let settled = false;\n /** 最初に宣言した箱の行。時間軸の図で拡大の範囲が無い時に名指す */\n let firstBox: SourceLine | undefined;\n /** 針が今いる目盛りの境 (0 から数える) */\n let needle = 0;\n const branches: GitBranch[] = [];\n /** 枝分かれの図で積んだ commit と、枝の札が今指す commit (まだ何も指さない枝は `null`) */\n const commits = new Set<string>();\n const tips = new Map<string, string | null>();\n const regions: Region[] = [];\n const boxes: Box[] = [];\n const paths: StatePath[] = [];\n const ids = new Set<string>();\n let strip: { title: string; fields: string[] } | undefined;\n const steps: Step[] = [];\n let building: Building | undefined;\n /** 開いている `group` */\n let group: { source: SourceLine; id: string } | undefined;\n\n const declare = (source: SourceLine, id: string, at: number): void => {\n if (ids.has(id)) throw fail(source, at, m.duplicate(id));\n ids.add(id);\n };\n const boxAt = (source: SourceLine, id: string, at: number): string => {\n if (!boxes.some((box) => box.id === id)) throw fail(source, at, m.undeclaredBox(id));\n return id;\n };\n const branchAt = (source: SourceLine, id: string, at: number): string => {\n if (!tips.has(id)) throw fail(source, at, m.undeclaredBranch(id));\n return id;\n };\n const commitAt = (source: SourceLine, id: string, at: number): string => {\n if (!commits.has(id)) throw fail(source, at, m.noCommit(id));\n return id;\n };\n /**\n * 線の端。状態遷移図では送る側に `start`、受ける側に `finish` を書ける。\n * 枝分かれの図では送る側が枝の名札か `HEAD`、受ける側が積んだ commit\n */\n const endAt = (source: SourceLine, id: string, at: number, side: \"from\" | \"to\"): string => {\n if (isGit) {\n if (side === \"to\") return commitAt(source, id, at);\n if (id !== HEAD && !tips.has(id)) throw fail(source, at, m.undeclaredRef(id));\n return id;\n }\n if (isTime) {\n if (!boxes.some((box) => box.id === id) && !points.some((point) => point.id === id)) throw fail(source, at, m.undeclaredNote(id));\n return id;\n }\n if (isTree && trees.has(id)) return id;\n if (!isState || !isOneOf(STATE_ENDS, id)) return boxAt(source, id, at);\n if ((id === \"start\") !== (side === \"from\")) throw fail(source, at, id === \"start\" ? m.intoStart : m.outOfFinish);\n return id;\n };\n /** 状態遷移図の箱と区画の名札に、始まりと終わりの印の名前は使えない。枝分かれの図の名札に、今いる場所の札の名前は使えない */\n const notReserved = (source: SourceLine, id: string, at: number): void => {\n if (isState && isOneOf(STATE_ENDS, id)) throw fail(source, at, m.reservedId(id));\n if (isGit && id === HEAD) throw fail(source, at, m.headReserved(id));\n if (isTime && id === NOW) throw fail(source, at, m.nowReserved(id));\n };\n /** 段の中に書く行の、書き先の段。最初の `step` より前なら誤り */\n const inStep = (source: SourceLine): Building => {\n if (!building) throw fail(source, 0, m.stepLineBeforeStep);\n return building;\n };\n /** 宣言の行。最初の `step` より後なら誤り */\n const beforeSteps = (source: SourceLine): void => {\n if (building) throw fail(source, 0, m.declarationInStep);\n };\n const finish = (): void => {\n if (!building) return;\n if (building.body === undefined) throw fail(building.source, 0, m.noBody(building.title));\n steps.push({\n title: building.title,\n body: building.body.join(\"\\n\"),\n ...(building.code !== undefined ? { code: building.code } : {}),\n ...(building.sources.length > 0 ? { sources: building.sources } : {}),\n events: building.events,\n });\n };\n\n const rest = lines.slice(headAt + 1);\n for (let i = 0; i < rest.length; i++) {\n const source = rest[i];\n if (!source || isBlankOrComment(source)) continue;\n const text = source.text;\n // 時間軸の図の `now -> <目盛り>` は針を進める行で、線と同じ形でも箱どうしの線と読まない\n if (isTime && NEEDLE.test(text)) {\n inStep(source).events.push(readNow(source));\n continue;\n }\n // 名札の次に `->` が来る行は、名札が行の頭の語と同じ綴りでも線と読む\n const edge = EDGE.exec(text);\n if (edge) {\n if (isLineup) throw fail(source, 0, m.lineupNoEdge);\n // 状態遷移図の最初の step より前の線は、移れる道の地図\n if (isState && !building) paths.push(readPath(source, edge));\n else inStep(source).events.push(readEdge(source, edge));\n continue;\n }\n const [word = \"\", second] = text.split(/\\s+/u);\n // 枝分かれの図で、宣言した枝の名札の次に `from` が来る行は、枝を切る行\n if (isGit && tips.has(word) && second === FROM) {\n const step = inStep(source);\n step.events.push(readCut(source));\n continue;\n }\n if (!isGit && (word === \"branch\" || word === \"commit\")) throw fail(source, 0, m.gitOnly(word));\n if (!isTime && isOneOf(TIME_HEADS, word)) throw fail(source, 0, m.timeOnly(word));\n if (!isTree && isOneOf(TREE_HEADS, word)) throw fail(source, 0, m.treeOnly(word));\n if (!isLineup && isOneOf(LINEUP_HEADS, word)) throw fail(source, 0, m.lineupOnly(word));\n if (!isOneOf(HEADS, word)) {\n const old = oldForm(text, building !== undefined);\n throw fail(source, 0, old ? m.oldForm(old.word, old.shape) : m.unknownHead(word));\n }\n switch (word) {\n case \"group\":\n readGroup(source);\n break;\n case \"end\":\n if (text !== word) throw fail(source, word.length, m.endTakesNothing);\n if (!group) throw fail(source, 0, m.strayEnd);\n group = undefined;\n break;\n case \"box\":\n readBox(source);\n break;\n case \"strip\":\n readStrip(source);\n break;\n case \"step\": {\n if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));\n settle();\n finish();\n const stepTitle = text.slice(word.length).trim();\n if (stepTitle === \"\") throw fail(source, 0, m.emptyStepTitle);\n building = { source, title: stepTitle, sources: [], events: [] };\n break;\n }\n case \"say\":\n i = readSay(source, i);\n break;\n case \"code\": {\n const step = inStep(source);\n if (step.code !== undefined) throw fail(source, 0, m.codeTwice);\n const command = text.slice(word.length).trim();\n if (command === \"\") throw fail(source, 0, m.emptyCode);\n step.code = command;\n break;\n }\n case \"source\":\n inStep(source).sources.push(readSource(source));\n break;\n case \"act\": {\n if (isLineup) throw fail(source, 0, m.lineupNoAct);\n const step = inStep(source);\n const on = readOnBox(source, word, m.actShape);\n step.events.push({ type: \"action\", box: on.box, label: on.text });\n break;\n }\n case \"note\": {\n const step = inStep(source);\n if (isTime) {\n step.events.push(readTimeNote(source));\n break;\n }\n const on = readOnBox(source, word, m.noteShape);\n step.events.push({ type: \"swap\", box: on.box, text: on.text });\n break;\n }\n case \"set\":\n inStep(source).events.push(readSet(source));\n break;\n case \"branch\":\n readBranch(source);\n break;\n case \"commit\": {\n const step = inStep(source);\n step.events.push(readCommit(source));\n break;\n }\n case \"scale\":\n readScale(source);\n break;\n case \"period\":\n readPeriod(source);\n break;\n case \"row\":\n readRow(source);\n break;\n case \"point\":\n readPoint(source);\n break;\n case \"zoom\":\n readZoom(source);\n break;\n case \"mark\":\n inStep(source).events.push(readMark(source));\n break;\n case \"span\":\n inStep(source).events.push(readSpan(source));\n break;\n case \"leaf\": {\n const step = inStep(source);\n step.events.push(readLeaf(source));\n break;\n }\n case \"node\": {\n const step = inStep(source);\n step.events.push(readNode(source));\n break;\n }\n case \"item\":\n readItem(source);\n break;\n case \"line\": {\n const step = inStep(source);\n step.events.push(readOrder(source));\n break;\n }\n case \"seal\":\n case \"open\":\n case \"pick\": {\n const step = inStep(source);\n step.events.push(readOnLane(source, word));\n break;\n }\n case \"stamp\": {\n const step = inStep(source);\n step.events.push(readStamp(source));\n break;\n }\n }\n }\n if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));\n settle();\n finish();\n\n if (isGit && branches.length === 0) throw fail(head, 0, m.noBranches);\n if (isTree && trees.size === 0) throw fail(head, 0, m.noLeaves);\n if (isLineup && items.length === 0) throw fail(head, 0, m.noItems);\n if (boxes.length === 0 && !isGit && !isTime && !isTree) throw fail(head, 0, m.noBoxes);\n if (steps.length === 0) throw fail(head, 0, m.noSteps);\n // 木の形は全ての行を読んでから確かめる。親を持たない木の箱が 2 つ以上なら、書いた順で 2 つ目を示す\n const roots = [...trees.keys()].filter((id) => !parents.has(id));\n const [root, stray] = roots;\n const strayAt = stray === undefined ? undefined : trees.get(stray);\n if (root !== undefined && stray !== undefined && strayAt) throw fail(strayAt.source, strayAt.at, m.manyRoots(stray, root));\n\n return {\n version: FORMAT_VERSION,\n kind,\n title,\n ...(view ? { view } : {}),\n ...(regions.length > 0 ? { regions } : {}),\n boxes,\n ...(strip ? { strip: meters.length > 0 ? { ...strip, meters } : strip } : {}),\n steps,\n ...(kind === \"sequence\" ? { sequence: { lifelines: boxes.map((box) => box.id) } } : {}),\n ...(paths.length > 0 ? { state: { paths } } : {}),\n ...(isGit ? { git: { branches } } : {}),\n ...(isLineup ? { lineup: { items } } : {}),\n ...(isTime && scale\n ? {\n time: {\n scale,\n ...(period ? { period } : {}),\n rows,\n ...(points.length > 0 ? { points } : {}),\n ...(zoom ? { zoom } : {}),\n },\n }\n : {}),\n };\n\n /**\n * 時間軸の図の宣言を、目盛りの数が決まってから確かめる。最初の step と記法の終わりで 1 度だけ呼ぶ。\n * 目盛りと印の列が無い図と、拡大の範囲の無い図の箱は誤り\n */\n function settle(): void {\n if (!isTime || settled) return;\n settled = true;\n if (!scale) throw fail(head as SourceLine, 0, m.noScale);\n if (rows.length === 0) throw fail(head as SourceLine, 0, m.noRows);\n for (const check of pending) check();\n if (firstBox && !zoom) throw fail(firstBox, 0, m.boxNeedsZoom);\n }\n\n /** 目盛りの数。目盛りを宣言する前は 0 */\n function countOf(): number {\n return scale?.count ?? 0;\n }\n\n /** `text` を目盛りの位置として読む。0 から目盛りの数より 1 小さい数まで */\n function unitAt(source: SourceLine, at: number, text: string): number {\n if (!NUMBER.test(text) || Number(text) >= countOf()) throw fail(source, at, m.badUnit(text, countOf()));\n return Number(text);\n }\n\n /** `text` を目盛りの範囲として読む。`0-31` か `0` */\n function rangeAt(source: SourceLine, at: number, text: string): { from: number; to: number } {\n const found = RANGE.exec(text);\n const from = Number(found?.[1]);\n const to = Number(found?.[2] ?? found?.[1]);\n if (!found || from > to || to >= countOf()) throw fail(source, at, m.badUnit(text, countOf()));\n return { from, to };\n }\n\n /** `scale <単位> <長さ> <数> [from: <最初の番号>]` の行 */\n function readScale(source: SourceLine): void {\n beforeSteps(source);\n if (scale) throw fail(source, 0, m.timeTwice(\"scale\"));\n const text = source.text;\n const found = SCALE.exec(text);\n const at = (k: number): number => found?.indices?.[k]?.[0] ?? 0;\n if (!found) throw fail(source, 0, m.scaleShape);\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.scaleShape);\n const length = found[2] ?? \"\";\n if (!LENGTH.test(length)) throw fail(source, at(2), m.badLength);\n const count = found[3] ?? \"\";\n if (!COUNT.test(count)) throw fail(source, at(3), m.badCount(\"scale\"));\n const first = rest < text.length ? readAttrs(source, rest, ATTRS.scale, m).get(\"from\") : undefined;\n if (first && !NUMBER.test(first.value)) throw fail(source, first.at, m.scaleShape);\n scale = { unit: found[1] ?? \"\", length, count: Number(count), ...(first ? { from: Number(first.value) } : {}) };\n }\n\n /** `period <名前> <目盛りの数> [from: <最初の番号>]` の行 */\n function readPeriod(source: SourceLine): void {\n beforeSteps(source);\n if (period) throw fail(source, 0, m.timeTwice(\"period\"));\n const text = source.text;\n const found = PERIOD.exec(text);\n if (!found) throw fail(source, 0, m.periodShape);\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.periodShape);\n const length = found[2] ?? \"\";\n if (!COUNT.test(length)) throw fail(source, found.indices?.[2]?.[0] ?? 0, m.badCount(\"period\"));\n const first = rest < text.length ? readAttrs(source, rest, ATTRS.period, m).get(\"from\") : undefined;\n if (first && !NUMBER.test(first.value)) throw fail(source, first.at, m.periodShape);\n period = { name: found[1] ?? \"\", length: Number(length), ...(first ? { from: Number(first.value) } : {}) };\n }\n\n /** `row <名札> as <名前> [color: <色>, empty: <目盛り> <目盛り>]` の行。箱と同じ名札を持てる */\n function readRow(source: SourceLine): void {\n beforeSteps(source);\n const declared = readDeclared(source, \"row\", ATTRS.row, m);\n notReserved(source, declared.id, declared.idAt);\n if (rows.some((row) => row.id === declared.id) || points.some((point) => point.id === declared.id)) throw fail(source, declared.idAt, m.duplicate(declared.id));\n const color = declared.attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n const empty = declared.attrs.get(\"empty\");\n const row: TimeRow = { id: declared.id, name: declared.name ?? declared.id, ...(color ? { color: color.value as Color } : {}) };\n rows.push(row);\n if (empty) {\n const words = empty.value.split(/\\s+/u);\n // 目盛りの数が決まってから確かめる。欄の並びを宣言の形で残すため、先に空の並びを置く\n row.empty = [];\n pending.push(() => {\n row.empty = words.map((word) => unitAt(source, empty.at, word));\n });\n }\n }\n\n /** `point <名札> at <目盛り>` の行。箱と印の列と同じ名札は持てない */\n function readPoint(source: SourceLine): void {\n beforeSteps(source);\n const found = POINT.exec(source.text);\n const id = found?.[1];\n const unit = found?.[2];\n if (!found || id === undefined || unit === undefined) throw fail(source, 0, m.pointShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n const unitStart = found.indices?.[2]?.[0] ?? 0;\n if (!ID.test(id)) throw fail(source, idAt, m.badId(id));\n notReserved(source, id, idAt);\n if (rows.some((row) => row.id === id)) throw fail(source, idAt, m.duplicate(id));\n declare(source, id, idAt);\n const point: TimePoint = { id, at: 0 };\n points.push(point);\n pending.push(() => {\n point.at = unitAt(source, unitStart, unit);\n });\n }\n\n /** `zoom <目盛り>-<目盛り>` の行 */\n function readZoom(source: SourceLine): void {\n beforeSteps(source);\n if (zoom) throw fail(source, 0, m.timeTwice(\"zoom\"));\n const found = ZOOM.exec(source.text);\n const range = found?.[1];\n if (!found || range === undefined) throw fail(source, 0, m.zoomShape);\n const rangeStart = found.indices?.[1]?.[0] ?? 0;\n const placed = { from: 0, to: 0 };\n zoom = placed;\n pending.push(() => {\n Object.assign(placed, rangeAt(source, rangeStart, range));\n });\n }\n\n /** `now -> <目盛り>` の行。針をその目盛りの終わりまで進める。前の針より後の目盛りに限る */\n function readNow(source: SourceLine): DiagramEvent {\n const found = NOW_LINE.exec(source.text);\n const unit = found?.[1];\n if (!found || unit === undefined) throw fail(source, 0, m.nowShape);\n const at = found.indices?.[1]?.[0] ?? 0;\n const to = unitAt(source, at, unit);\n if (to + 1 <= needle) throw fail(source, at, m.nowBack(unit, needle - 1));\n needle = to + 1;\n return { type: \"now\", to };\n }\n\n /** `mark <列> <範囲> [color: <色>]` の行 */\n function readMark(source: SourceLine): DiagramEvent {\n const text = source.text;\n const found = MARK.exec(text);\n const row = found?.[1];\n const range = found?.[2];\n if (!found || row === undefined || range === undefined) throw fail(source, 0, m.markShape);\n if (!rows.some((r) => r.id === row)) throw fail(source, found.indices?.[1]?.[0] ?? 0, m.undeclaredRow(row));\n const { from, to } = rangeAt(source, found.indices?.[2]?.[0] ?? 0, range);\n const rest = skipSpaces(text, found[0].length);\n if (rest >= text.length || text[rest] !== \"[\") throw fail(source, rest, m.markShape);\n const color = readAttrs(source, rest, ATTRS.mark, m).get(\"color\");\n if (!color) throw fail(source, rest, m.markShape);\n if (!isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n return { type: \"mark\", row, from, to, color: color.value };\n }\n\n /** `span <範囲>: <字> [shape: box, color: <色>]` の行 */\n function readSpan(source: SourceLine): DiagramEvent {\n const found = SPAN.exec(source.text);\n const range = found?.[1];\n if (!found || range === undefined) throw fail(source, 0, m.spanShape);\n const { from, to } = rangeAt(source, found.indices?.[1]?.[0] ?? 0, range);\n const named = readName(source, found[0].length, m);\n if (named.value === \"\") throw fail(source, 0, m.spanShape);\n const attrs = named.rest < source.text.length ? readAttrs(source, named.rest, ATTRS.span, m) : new Map<string, Attr>();\n const shape = attrs.get(\"shape\");\n if (shape && !isOneOf(SPAN_SHAPES, shape.value)) throw fail(source, shape.at, m.badShape);\n const color = attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n return { type: \"span\", from, to, text: named.value, ...(shape ? { shape: \"box\" as const } : {}), ...(color ? { color: color.value as Color } : {}) };\n }\n\n /** 時間軸の図の `note <箱か節目>: <字> [color: <色>]` の行。色は節目の丸の色 */\n function readTimeNote(source: SourceLine): DiagramEvent {\n const found = /^note\\s+([^\\s:]+)\\s*:/du.exec(source.text);\n const id = found?.[1];\n if (!found || id === undefined) throw fail(source, 0, m.noteShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n const isPoint = points.some((point) => point.id === id);\n if (!isPoint && !boxes.some((box) => box.id === id)) throw fail(source, idAt, m.undeclaredNote(id));\n const named = readName(source, found[0].length, m);\n if (named.value === \"\") throw fail(source, 0, m.noteShape);\n const color = named.rest < source.text.length ? readAttrs(source, named.rest, ATTRS.note, m).get(\"color\") : undefined;\n if (color && !isPoint) throw fail(source, color.at, m.noteColorPointOnly);\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n return { type: \"swap\", box: id, text: named.value, ...(color ? { color: color.value as Color } : {}) };\n }\n\n /** `group` の行。同じ名札をもう一度開いた時は、名前も属性も書かない */\n function readGroup(source: SourceLine): void {\n beforeSteps(source);\n if (isGit) throw fail(source, 0, m.gitNoGroup);\n if (isTree) throw fail(source, 0, m.treeNoGroup);\n if (isLineup) throw fail(source, 0, m.lineupNoGroup);\n if (group) throw fail(source, 0, m.nestedGroup);\n const declared = readDeclared(source, \"group\", ATTRS.group, m);\n if (regions.some((region) => region.id === declared.id)) {\n if (declared.name !== undefined || declared.attrs.size > 0) throw fail(source, 0, m.regionReopened(declared.id));\n } else {\n notReserved(source, declared.id, declared.idAt);\n declare(source, declared.id, declared.idAt);\n regions.push({ id: declared.id, name: declared.name ?? declared.id, ...lookOf(source, declared.attrs, m) });\n }\n group = { source, id: declared.id };\n }\n\n /** `box` の行。開いている `group` の中なら、その区画に置く */\n function readBox(source: SourceLine): void {\n beforeSteps(source);\n const declared = readDeclared(source, \"box\", isLineup ? LANE_ATTRS : ATTRS.box, m);\n notReserved(source, declared.id, declared.idAt);\n declare(source, declared.id, declared.idAt);\n firstBox ??= source;\n const { note, ...look } = lookOf(source, declared.attrs, m);\n const link = declared.attrs.get(\"link\");\n boxes.push({\n id: declared.id,\n name: declared.name ?? declared.id,\n ...(note !== undefined ? { sub: note } : {}),\n ...look,\n ...(group ? { region: group.id } : {}),\n ...(link ? { link: urlOf(source, \"link\", link) } : {}),\n });\n }\n\n /** `source <名前> [url: <URL>]` の行 */\n function readSource(source: SourceLine): StepSource {\n const named = readName(source, \"source\".length, m);\n const url = named.rest < source.text.length ? readAttrs(source, named.rest, ATTRS.source, m).get(\"url\") : undefined;\n if (named.value === \"\" || !url) throw fail(source, 0, m.sourceShape);\n return { name: named.value, url: urlOf(source, \"url\", url) };\n }\n\n /** 頁を移る形の URL。ほかの形 (`javascript:` など) は、その属性の位置を示して断る */\n function urlOf(source: SourceLine, key: string, attr: Attr): string {\n if (!URL_FORM.test(attr.value)) throw fail(source, attr.at, m.badUrl(key));\n return attr.value;\n }\n\n /** 枝分かれの図の `branch <名札> [note: <添え書き>]` の行。枝は宣言した順に上から帯に並ぶ */\n function readBranch(source: SourceLine): void {\n beforeSteps(source);\n const declared = readDeclared(source, \"branch\", ATTRS.branch, m);\n if (declared.name !== undefined) throw fail(source, 0, m.branchShape);\n notReserved(source, declared.id, declared.idAt);\n declare(source, declared.id, declared.idAt);\n const note = declared.attrs.get(\"note\")?.value;\n branches.push({ id: declared.id, ...(note !== undefined ? { note } : {}) });\n tips.set(declared.id, null);\n }\n\n /**\n * 枝分かれの図の `commit <名札> on <枝> [copy <commit>] [merge <枝>] [hash: <hash>, note: <一言>]` の行。\n * 積んだ枝の札は新しい commit へ進む。当て直しは枝の札を動かさない\n */\n function readCommit(source: SourceLine): GitCommit {\n const text = source.text;\n const found = COMMIT.exec(text);\n const at = (k: number): number => found?.indices?.[k]?.[0] ?? 0;\n const id = found?.[1];\n const on = found?.[2];\n if (!found || id === undefined || on === undefined) throw fail(source, 0, m.commitShape);\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.commitShape);\n if (!ID.test(id)) throw fail(source, at(1), m.badId(id));\n notReserved(source, id, at(1));\n declare(source, id, at(1));\n const branch = branchAt(source, on, at(2));\n const copy = found[3] === undefined ? undefined : commitAt(source, found[3], at(3));\n const merge = found[4] === undefined ? undefined : mergedAt(source, found[4], at(4), branch);\n const attrs = rest < text.length ? readAttrs(source, rest, ATTRS.commit, m) : new Map<string, Attr>();\n const hash = attrs.get(\"hash\");\n if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);\n const note = attrs.get(\"note\")?.value;\n commits.add(id);\n if (copy === undefined) tips.set(branch, id);\n return {\n type: \"commit\",\n id,\n branch,\n ...(copy !== undefined ? { copy } : {}),\n ...(merge !== undefined ? { merge } : {}),\n ...(hash ? { hash: hash.value } : {}),\n ...(note !== undefined ? { note } : {}),\n };\n }\n\n /** merge commit が取り込む枝。積む枝と別の、もう commit を指している枝 */\n function mergedAt(source: SourceLine, id: string, at: number, into: string): string {\n branchAt(source, id, at);\n if (id === into) throw fail(source, at, m.mergeSelf(id));\n if (tips.get(id) === null) throw fail(source, at, m.emptyBranch(id));\n return id;\n }\n\n /** 枝分かれの図の `<枝> from <commit>` の行。枝の札を commit へ置く */\n function readCut(source: SourceLine): DiagramEvent {\n const found = CUT.exec(source.text);\n const branch = found?.[1];\n const from = found?.[2];\n if (!found || branch === undefined || from === undefined) throw fail(source, 0, m.fromShape);\n commitAt(source, from, found.indices?.[2]?.[0] ?? 0);\n tips.set(branch, from);\n return { type: \"branch\", branch, from };\n }\n\n /** 木の図の `leaf <名札> [hash: <hash>]` の行 */\n function readLeaf(source: SourceLine): DiagramEvent {\n const text = source.text;\n const found = LEAF.exec(text);\n const id = found?.[1];\n if (!found || id === undefined) throw fail(source, 0, m.leafShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n if (!ID.test(id)) throw fail(source, idAt, m.badId(id));\n declare(source, id, idAt);\n trees.set(id, { source, at: idAt });\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.leafShape);\n const hash = treeHash(source, rest, ATTRS.leaf);\n return { type: \"leaf\", id, ...(hash !== undefined ? { hash } : {}) };\n }\n\n /**\n * 木の図の `node <名札> of <子>, <子> [hash: <hash>]` の行。子は前に書いた葉か親で、まだ親を持たない箱に限る。\n * 子は `,` で区切り、`[` か行の終わりで終わる\n */\n function readNode(source: SourceLine): DiagramEvent {\n const text = source.text;\n const found = NODE.exec(text);\n const id = found?.[1];\n if (!found || id === undefined) throw fail(source, 0, m.nodeShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n if (!ID.test(id)) throw fail(source, idAt, m.badId(id));\n declare(source, id, idAt);\n const children: string[] = [];\n let end = found[0].length;\n for (;;) {\n const start = skipSpaces(text, end);\n end = start;\n while (end < text.length && text[end] !== \",\" && text[end] !== \"[\") end++;\n const child = text.slice(start, end).trim();\n if (child === \"\" || !ID.test(child)) throw fail(source, start, m.nodeShape);\n if (!trees.has(child)) throw fail(source, start, ids.has(child) && child !== id ? m.notTreeBox(child) : m.noTreeChild(child));\n if (parents.has(child)) throw fail(source, start, m.twoParents(child));\n parents.set(child, id);\n children.push(child);\n if (text[end] !== \",\") break;\n end++;\n }\n const hash = treeHash(source, end, ATTRS.node);\n trees.set(id, { source, at: idAt });\n return { type: \"node\", id, children, ...(hash !== undefined ? { hash } : {}) };\n }\n\n /** 葉と親の行の名札の後ろの `[hash: <hash>]`。`at` は `[` か行の終わり */\n function treeHash(source: SourceLine, at: number, keys: readonly string[]): string | undefined {\n if (at >= source.text.length) return undefined;\n const hash = readAttrs(source, at, keys, m).get(\"hash\");\n if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);\n return hash?.value;\n }\n\n /** `from` から `to` の前までの、`,` で区切った名札と、それぞれの位置 */\n function namesAt(source: SourceLine, from: number, to: number, shape: string): { value: string; at: number }[] {\n const text = source.text;\n const names: { value: string; at: number }[] = [];\n for (let i = from; ; ) {\n const start = skipSpaces(text, i);\n const comma = text.indexOf(\",\", start);\n const end = comma < 0 || comma > to ? to : comma;\n const value = text.slice(start, end).trim();\n if (value === \"\") throw fail(source, start, shape);\n if (!ID.test(value)) throw fail(source, start, m.badId(value));\n names.push({ value, at: start });\n if (end >= to) return names;\n i = end + 1;\n }\n }\n\n /** 列の図の `item <名札>, <名札> [color: <色>, label: <字>]` の行。並べた名札ごとに、同じ色と字のチップを宣言する */\n function readItem(source: SourceLine): void {\n beforeSteps(source);\n const open = source.text.indexOf(\"[\");\n const end = open < 0 ? source.text.length : open;\n const attrs = open < 0 ? new Map<string, Attr>() : readAttrs(source, open, ATTRS.item, m);\n const color = attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n const label = attrs.get(\"label\");\n if (label && [...label.value].length > LABEL_MOST) throw fail(source, label.at, m.labelTooLong(LABEL_MOST));\n for (const { value, at } of namesAt(source, \"item\".length, end, m.itemShape)) {\n declare(source, value, at);\n items.push({ id: value, ...(color ? { color: color.value as Color } : {}), ...(label ? { label: label.value } : {}) });\n }\n }\n\n /** 列の図の `line <列>: <チップ>, <チップ>` の行。チップは宣言したチップで、列に 1 枚ずつ、上限まで。封をした列には書けない */\n function readOrder(source: SourceLine): DiagramEvent {\n const found = ORDER.exec(source.text);\n const lane = found?.[1];\n if (!found || lane === undefined) throw fail(source, 0, m.lineShape);\n const at = found.indices?.[1]?.[0] ?? 0;\n const box = boxAt(source, lane, at);\n if (sealed.has(box)) throw fail(source, at, m.lineOnSealed(box));\n const chips = namesAt(source, found[0].length, source.text.length, m.lineShape);\n const seen = new Set<string>();\n chips.forEach(({ value, at: chipAt }, k) => {\n if (!items.some((item) => item.id === value)) throw fail(source, chipAt, m.noSuchItem(value));\n if (seen.has(value)) throw fail(source, chipAt, m.itemTwice(value));\n if (k >= LANE_MOST) throw fail(source, chipAt, m.laneFull(box, LANE_MOST));\n seen.add(value);\n });\n return { type: \"line\", box, items: chips.map((chip) => chip.value) };\n }\n\n /** 列の図の `seal <列>`、`open <列>`、`pick <列>` の行。封は 1 列に 1 つで、封をした列だけを開けられる */\n function readOnLane(source: SourceLine, word: \"seal\" | \"open\" | \"pick\"): DiagramEvent {\n const found = ON_LANE.exec(source.text);\n const lane = found?.[1];\n if (!found || lane === undefined) throw fail(source, 0, m.laneShape(word));\n const at = found.indices?.[1]?.[0] ?? 0;\n const box = boxAt(source, lane, at);\n if (word === \"seal\") {\n if (sealed.has(box)) throw fail(source, at, m.sealTwice(box));\n sealed.add(box);\n }\n if (word === \"open\" && !sealed.delete(box)) throw fail(source, at, m.openUnsealed(box));\n return { type: word, box };\n }\n\n /** 列の図の `stamp <列>: <字>` の行 */\n function readStamp(source: SourceLine): DiagramEvent {\n const found = STAMP.exec(source.text);\n const lane = found?.[1];\n if (!found || lane === undefined) throw fail(source, 0, m.stampShape);\n const box = boxAt(source, lane, found.indices?.[1]?.[0] ?? 0);\n const named = readName(source, found[0].length, m);\n if (named.value === \"\" || named.rest < source.text.length) throw fail(source, 0, m.stampShape);\n return { type: \"stamp\", box, text: named.value };\n }\n\n /** `strip <題>: <欄>, <欄>` の行 */\n function readStrip(source: SourceLine): void {\n beforeSteps(source);\n if (strip) throw fail(source, 0, m.stripTwice);\n const text = source.text;\n const start = skipSpaces(text, \"strip\".length);\n let stripTitle: string;\n let colon: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n stripTitle = quoted.value;\n colon = skipSpaces(text, quoted.end);\n } else {\n colon = text.indexOf(\":\", start);\n stripTitle = colon < 0 ? \"\" : text.slice(start, colon).trim();\n }\n if (stripTitle === \"\" || text[colon] !== \":\") throw fail(source, 0, m.stripShape);\n if (isTime) {\n strip = { title: stripTitle, fields: readFields(source, colon + 1) };\n return;\n }\n const fields = readList(source, colon + 1, m);\n // 物差しは時間軸の図だけが書ける。ほかの図では欄の名前の一部として読んでいた形なので、欄が属性の形で終わる時だけ断る\n const metered = /\\[\\s*meter\\s*:/u.exec(text);\n if (metered && fields.some((f) => /\\[\\s*meter\\s*:[^\\]]*\\]$/u.test(f))) throw fail(source, metered.index + 1, m.timeOnly(\"meter\"));\n strip = { title: stripTitle, fields };\n }\n\n /**\n * 時間軸の図の `strip` の行の欄。`,` で区切り、欄の名前の後ろに `[meter: <割合>]` を書いた欄は物差しにする。\n * `[` を含む名前は `\"` で囲む\n */\n function readFields(source: SourceLine, at: number): string[] {\n const text = source.text;\n const items: string[] = [];\n for (let i = at; ; ) {\n const start = skipSpaces(text, i);\n let value: string;\n let end: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n value = quoted.value;\n end = skipSpaces(text, quoted.end);\n } else {\n end = start;\n while (end < text.length && text[end] !== \",\" && text[end] !== \"[\") end++;\n value = text.slice(start, end).trim();\n }\n if (value === \"\") throw fail(source, start, m.emptyStripField);\n if (text[end] === \"[\") {\n const close = text.indexOf(\"]\", end);\n if (close < 0) throw fail(source, end, m.attrUnclosed);\n const inside = text.slice(end + 1, close);\n const inner = /^\\s*([a-z]*)\\s*:\\s*(.*?)\\s*$/u.exec(inside);\n if (!inner) throw fail(source, end + 1, m.attrNoColon(inside.trim()));\n const key = inner[1] ?? \"\";\n if (!(ATTRS.strip as readonly string[]).includes(key)) throw fail(source, end + 1, m.badAttr(key, ATTRS.strip));\n if (!RATIO.test(inner[2] ?? \"\")) throw fail(source, end + 1, m.badRatio);\n meters.push({ field: value, line: inner[2] ?? \"\" });\n end = skipSpaces(text, close + 1);\n }\n if (end < text.length && text[end] !== \",\") throw fail(source, end, m.afterQuote);\n items.push(value);\n if (end >= text.length) return items;\n i = end + 1;\n }\n }\n\n /**\n * `say` の行と、その下に `say` より深く字下げして続けた行を段の本文にする。\n * 続きの行の間の空行は本文の空の行になる。返すのは読み終えた最後の行の番号。\n */\n function readSay(source: SourceLine, index: number): number {\n const step = inStep(source);\n if (step.body !== undefined) throw fail(source, 0, m.sayTwice);\n const inline = source.text.slice(\"say\".length).trim();\n const body = inline === \"\" ? [] : [inline];\n let blanks = 0;\n let last = index;\n for (let j = index + 1; j < rest.length; j++) {\n const next = rest[j];\n if (!next) break;\n if (next.text === \"\") {\n blanks++;\n continue;\n }\n if (next.indent <= source.indent) break;\n body.push(...Array.from({ length: blanks }, () => \"\"), next.text);\n blanks = 0;\n last = j;\n }\n if (body.length === 0) throw fail(source, 0, m.emptySay);\n step.body = body;\n return last;\n }\n\n /** `act <名札>: <字>` と `note <名札>: <字>` の行の、箱と字 */\n function readOnBox(source: SourceLine, word: \"act\" | \"note\", shape: string): { box: string; text: string } {\n const found = new RegExp(`^${word}\\\\s+([^\\\\s:]+)\\\\s*:\\\\s*(.*)$`, \"du\").exec(source.text);\n const idAt = found?.indices?.[1]?.[0];\n if (!found || idAt === undefined || (found[2] ?? \"\") === \"\") throw fail(source, 0, shape);\n return { box: boxAt(source, found[1] ?? \"\", idAt), text: found[2] ?? \"\" };\n }\n\n /** 線の行の両端と、`:` の後ろの線の名前。`at` は名前の後ろの位置 */\n function readLine(source: SourceLine, edge: RegExpExecArray): { from: string; to: string; label?: string; at: number } {\n const text = source.text;\n const from = endAt(source, edge[1] ?? \"\", edge.indices?.[1]?.[0] ?? 0, \"from\");\n const to = endAt(source, edge[2] ?? \"\", edge.indices?.[2]?.[0] ?? 0, \"to\");\n const at = skipSpaces(text, edge[0].length);\n if (text[at] !== \":\") return { from, to, at };\n const named = readName(source, at + 1, m);\n if (named.value === \"\") throw fail(source, at, m.emptyLabel);\n return { from, to, label: named.value, at: named.rest };\n }\n\n /** 状態遷移図の最初の `step` より前の `<名札> -> <名札>: <線の名前>` の行。属性は書けない */\n function readPath(source: SourceLine, edge: RegExpExecArray): StatePath {\n const { from, to, label, at } = readLine(source, edge);\n if (at < source.text.length) throw fail(source, at, source.text[at] === \"[\" ? m.pathNoAttrs : m.edgeShape);\n return { from, to, ...(label !== undefined ? { label } : {}) };\n }\n\n /** `<名札> -> <名札>: <線の名前> [<属性>]` の行 */\n function readEdge(source: SourceLine, edge: RegExpExecArray): DiagramEvent {\n const text = source.text;\n const { from, to, label, at } = readLine(source, edge);\n if (at < text.length && text[at] !== \"[\") throw fail(source, at, m.edgeShape);\n const attrs = at < text.length ? readAttrs(source, at, ATTRS.edge, m) : new Map<string, Attr>();\n const tag = attrs.get(\"tag\");\n const carried = attrs.get(\"carry\");\n if (tag && carried) throw fail(source, Math.max(tag.at, carried.at), m.carryTwice);\n if (carried && !isOneOf(CARRIES, carried.value)) throw fail(source, carried.at, m.badCarry);\n const side = attrs.get(\"side\");\n if (side && !isOneOf(SIDES, side.value)) throw fail(source, side.at, m.badSide);\n const columns = readColumns(source, from, to, attrs, at);\n // 枝分かれの図の線は札を動かす線で、書かなければ送る側の名前の札を運ぶ\n let carry: Carry = isGit ? { kind: \"tag\", text: from } : { kind: \"envelope\" };\n if (tag) carry = { kind: \"tag\", text: tag.value };\n else if (carried) carry = carried.value === \"coin\" ? { kind: \"coin\" } : { kind: \"none\" };\n if (isGit && from !== HEAD) tips.set(from, to);\n return {\n type: \"edge\",\n from,\n to,\n ...(label !== undefined ? { label } : {}),\n carry,\n ...(side ? { labelSide: side.value as LabelSide } : {}),\n ...columns,\n };\n }\n\n /**\n * 線の列 (`at` と `into`)。時間軸の図の箱どうしの線は `at` で拡大の帯の列を選び、節目どうしの線は列を持たない。\n * ほかの図の種類には書けない\n */\n function readColumns(source: SourceLine, from: string, to: string, attrs: Map<string, Attr>, end: number): { at?: number; into?: number } {\n const given = TIME_EDGE_ATTRS.flatMap((key) => {\n const attr = attrs.get(key);\n return attr ? [{ key, attr }] : [];\n });\n const first = given[0];\n if (!isTime) {\n if (first) throw fail(source, first.attr.at, m.timeOnly(first.key));\n return {};\n }\n const isBox = (id: string): boolean => boxes.some((box) => box.id === id);\n if (isBox(from) !== isBox(to)) throw fail(source, 0, m.mixedLine);\n if (!isBox(from)) {\n if (first) throw fail(source, first.attr.at, zoom ? m.pointLineNoAt : m.noZoom);\n return {};\n }\n const column = (attr: Attr | undefined): number | undefined => {\n if (!attr) return undefined;\n const unit = unitAt(source, attr.at, attr.value);\n if (!zoom || unit < zoom.from || unit > zoom.to) throw fail(source, attr.at, zoom ? m.outOfZoom(zoom.from, zoom.to) : m.noZoom);\n return unit;\n };\n const at = column(attrs.get(\"at\"));\n if (at === undefined) throw fail(source, end, m.boxLineNeedsAt);\n const into = column(attrs.get(\"into\"));\n return { at, ...(into !== undefined ? { into } : {}) };\n }\n\n /** `set <欄>: <値> [tag: <札>]` か `set <欄> [tag: <札>]` の行 */\n function readSet(source: SourceLine): DiagramEvent {\n const declared = strip;\n if (!declared) throw fail(source, 0, m.stripUndeclared);\n const text = source.text;\n const start = skipSpaces(text, \"set\".length);\n let field: string;\n let at: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n field = quoted.value;\n at = skipSpaces(text, quoted.end);\n } else {\n at = start;\n while (at < text.length && text[at] !== \":\" && text[at] !== \"[\") at++;\n field = text.slice(start, at).trim();\n }\n if (!declared.fields.includes(field)) throw fail(source, start, m.noSuchField(field));\n let value: string | undefined;\n if (text[at] === \":\") {\n const named = readName(source, at + 1, m);\n if (named.value === \"\") throw fail(source, at, m.stripNeedsValue);\n value = named.value;\n at = named.rest;\n }\n if (at < text.length && text[at] !== \"[\") throw fail(source, at, m.stripNeedsValue);\n const tag = at < text.length ? readAttrs(source, at, ATTRS.set, m).get(\"tag\")?.value : undefined;\n if (value === undefined && tag === undefined) throw fail(source, 0, m.stripNeedsValue);\n if (value !== undefined && meters.some((meter) => meter.field === field) && !RATIO.test(value)) throw fail(source, start, m.meterValue(field));\n return {\n type: \"strip\",\n field,\n ...(value !== undefined ? { value } : {}),\n ...(tag !== undefined ? { tag } : {}),\n };\n }\n}\n\nexport function parseNotation(notation: string, options: ParseOptions = {}): Parsed {\n try {\n return { ok: true, diagram: parseLines(tokenize(notation), messagesFor(options.lang ?? \"ja\")) };\n } catch (error) {\n if (!(error instanceof NotationError)) throw error;\n return { ok: false, errors: [{ line: error.line, column: error.column, message: error.message }] };\n }\n}\n","/**\n * 図の原本の JSON を、人が書く dragon記法へ書き戻す (#3137)。\n *\n * 並べ方は決まった形に整える。JSON の欄の並び順は見ず、欄の名前で読むので、\n * 同じ内容の JSON からは毎回同じ文字列になる。書き手の行の並べ方とコメントは保たない。\n * 段の中で起きることは JSON の並び順 (起きる順) のまま書く。\n * 状態遷移図の移れる道 (`state.paths`) は、帯の宣言の後、最初の `step` より前に JSON の並びのまま書く (#3163)。\n *\n * `\"` で囲むのは要る時だけにする。`[` を含む名前と、`,` か `]` を含む属性の値と、`\"` で始まる字を囲む。\n * 箱は JSON の並びのまま書き、同じ区画の箱が続く所を 1 つの `group … end` にする。\n * 区画の箱が飛び飛びの時は同じ `group` を開き直す。区画の並びが箱の現れる順と違う時と、\n * 箱の無い区画がある時は、先に全ての区画を中の無い `group … end` で宣言してから開き直す。\n * 枝分かれの図 (#3164) は、枝の `branch` の行を箱より前に書き、札を動かす線の運ぶ物が送る側の名前の札なら書かない。\n * 時間軸の図 (#3165) は、目盛りと区切りと印の列と節目と拡大の範囲の行を箱より前に書き、物差しの欄の後ろに `[meter: <割合>]` を書く。\n * 時間軸の図の `note` は属性を持てるので、`[` を含む字を `\"` で囲む。\n * 木の図 (#3233) の葉と親は、段の中に `leaf` と `node … of …` の行で書く。\n * 列の図 (#3239) のチップは箱の後ろに `item` の行で書き、色が同じで字を持たないチップが続く所は 1 行に並べる。\n * 段の出典 (#3199) は `say` と `code` の後ろ、段の中で起きることより前に、JSON の並びのまま 1 つずつ `source` の行に書く。\n */\nimport type { Box, Diagram, DiagramEvent, LineupItem, Region, TimeSpec } from \"./schema\";\nimport { AT, COPY, FROM, MERGE, NOW, OF, ON } from \"./words\";\n\nconst quote = (text: string): string => `\"${text.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"')}\"`;\n/** 行の終わりか `[` の前に置く名前と文 */\nconst name = (text: string): string => (text.includes(\"[\") || text.startsWith('\"') ? quote(text) : text);\n/** `:` の前に置く字 (帯の題と、`set` の欄) */\nconst key = (text: string): string => (text.includes(\":\") || text.includes(\"[\") || text.startsWith('\"') ? quote(text) : text);\n/** `strip` の行に `,` で並べる欄。時間軸の図の欄は後ろに物差しの属性を書けるので、`[` を含む名前も囲む */\nconst field = (text: string, time: boolean): string => (text.includes(\",\") || text.startsWith('\"') || (time && text.includes(\"[\")) ? quote(text) : text);\n/** 属性の値 */\nconst value = (text: string): string => (text.includes(\",\") || text.includes(\"]\") || text.startsWith('\"') ? quote(text) : text);\n\n/** 属性の並び。値の無い鍵は書かず、1 つも無ければ何も付けない */\nconst attrs = (pairs: [string, string | undefined][]): string => {\n const written = pairs.filter((pair): pair is [string, string] => pair[1] !== undefined);\n return written.length === 0 ? \"\" : ` [${written.map(([k, v]) => `${k}: ${value(v)}`).join(\", \")}]`;\n};\n\n/** 名札と違う名前だけを `as` の後ろに書く */\nconst shown = (id: string, text: string): string => (text === id ? \"\" : ` as ${name(text)}`);\n\nconst declareRegion = (r: Region): string =>\n `group ${r.id}${shown(r.id, r.name)}${attrs([\n [\"note\", r.note],\n [\"color\", r.color],\n [\"icon\", r.icon],\n ])}`;\nconst declareBox = (b: Box): string =>\n `box ${b.id}${shown(b.id, b.name)}${attrs([\n [\"note\", b.sub],\n [\"color\", b.color],\n [\"icon\", b.icon],\n [\"link\", b.link],\n ])}`;\n\n/** 線の行の両端と名前 */\nconst line = (from: string, to: string, label: string | undefined): string => `${from} -> ${to}${label === undefined ? \"\" : `: ${name(label)}`}`;\n\n/** 目盛りの範囲。1 つの目盛りは番号だけを書く */\nconst range = (from: number, to: number): string => (from === to ? `${from}` : `${from}-${to}`);\n/** 数の属性の値 */\nconst num = (n: number | undefined): string | undefined => (n === undefined ? undefined : `${n}`);\n\n/** 段の中の 1 行。`kind` は図の種類。枝分かれの図の線は、送る側の名前の札を書かない時の運ぶ物にする */\nfunction event(e: DiagramEvent, kind: Diagram[\"kind\"]): string {\n switch (e.type) {\n case \"edge\": {\n const plain = kind === \"git\" ? e.carry.kind === \"tag\" && e.carry.text === e.from : e.carry.kind === \"envelope\";\n const carry: [string, string][] = plain ? [] : e.carry.kind === \"tag\" ? [[\"tag\", e.carry.text]] : [[\"carry\", e.carry.kind]];\n return `${line(e.from, e.to, e.label)}${attrs([...carry, [\"side\", e.labelSide], [\"at\", num(e.at)], [\"into\", num(e.into)]])}`;\n }\n case \"action\":\n return `act ${e.box}: ${e.label}`;\n case \"swap\":\n return kind === \"time\" ? `note ${e.box}: ${name(e.text)}${attrs([[\"color\", e.color]])}` : `note ${e.box}: ${e.text}`;\n case \"now\":\n return `${NOW} -> ${e.to}`;\n case \"mark\":\n return `mark ${e.row} ${range(e.from, e.to)}${attrs([[\"color\", e.color]])}`;\n case \"span\":\n return `span ${range(e.from, e.to)}: ${name(e.text)}${attrs([\n [\"shape\", e.shape],\n [\"color\", e.color],\n ])}`;\n case \"strip\":\n return `set ${key(e.field)}${e.value === undefined ? \"\" : `: ${name(e.value)}`}${attrs([[\"tag\", e.tag]])}`;\n case \"commit\":\n return `commit ${e.id} ${ON} ${e.branch}${e.copy === undefined ? \"\" : ` ${COPY} ${e.copy}`}${e.merge === undefined ? \"\" : ` ${MERGE} ${e.merge}`}${attrs([\n [\"hash\", e.hash],\n [\"note\", e.note],\n ])}`;\n case \"branch\":\n return `${e.branch} ${FROM} ${e.from}`;\n case \"leaf\":\n return `leaf ${e.id}${attrs([[\"hash\", e.hash]])}`;\n case \"node\":\n return `node ${e.id} ${OF} ${e.children.join(\", \")}${attrs([[\"hash\", e.hash]])}`;\n case \"line\":\n return `line ${e.box}: ${e.items.join(\", \")}`;\n case \"seal\":\n case \"open\":\n case \"pick\":\n return `${e.type} ${e.box}`;\n case \"stamp\":\n return `stamp ${e.box}: ${name(e.text)}`;\n }\n}\n\n/** 列の図のチップの宣言の行。色が同じで字を持たないチップが続く所は 1 行に並べる */\nfunction itemLines(items: LineupItem[]): string {\n const rows: LineupItem[][] = [];\n for (const item of items) {\n const row = rows.at(-1);\n if (row && item.label === undefined && row[0]?.label === undefined && row[0]?.color === item.color) row.push(item);\n else rows.push([item]);\n }\n return rows\n .map(\n (row) =>\n `item ${row.map((item) => item.id).join(\", \")}${attrs([\n [\"color\", row[0]?.color],\n [\"label\", row[0]?.label],\n ])}`,\n )\n .join(\"\\n\");\n}\n\n/** 時間軸の図の目盛りと区切りと印の列と節目と拡大の範囲の宣言の塊 */\nfunction timeBlocks(time: TimeSpec): string[] {\n const head = [\n `scale ${time.scale.unit} ${time.scale.length} ${time.scale.count}${attrs([[\"from\", num(time.scale.from)]])}`,\n ...(time.period ? [`period ${time.period.name} ${time.period.length}${attrs([[\"from\", num(time.period.from)]])}`] : []),\n ];\n const rows = time.rows.map(\n (r) =>\n `row ${r.id}${shown(r.id, r.name)}${attrs([\n [\"color\", r.color],\n [\"empty\", r.empty && r.empty.length > 0 ? r.empty.join(\" \") : undefined],\n ])}`,\n );\n const points = (time.points ?? []).map((p) => `point ${p.id} ${AT} ${p.at}`);\n return [head.join(\"\\n\"), rows.join(\"\\n\"), ...(points.length > 0 ? [points.join(\"\\n\")] : []), ...(time.zoom ? [`zoom ${range(time.zoom.from, time.zoom.to)}`] : [])];\n}\n\n/** 区画と箱の宣言の塊。塊どうしは空行で区切る */\nfunction declarations(diagram: Diagram): string[] {\n const regions = diagram.regions ?? [];\n const runs: { region?: string; boxes: Box[] }[] = [];\n for (const b of diagram.boxes) {\n const last = runs.at(-1);\n if (last && last.region === b.region) last.boxes.push(b);\n else runs.push({ ...(b.region !== undefined ? { region: b.region } : {}), boxes: [b] });\n }\n const opened = [...new Set(runs.flatMap((run) => (run.region === undefined ? [] : [run.region])))];\n const inOrder = opened.length === regions.length && opened.every((id, i) => regions[i]?.id === id);\n const declared = new Set<string>();\n const blocks: string[] = [];\n if (!inOrder) {\n for (const r of regions) {\n blocks.push(`${declareRegion(r)}\\nend`);\n declared.add(r.id);\n }\n }\n for (const run of runs) {\n const lines = run.boxes.map(declareBox);\n if (run.region === undefined) {\n blocks.push(lines.join(\"\\n\"));\n continue;\n }\n const region = regions.find((r) => r.id === run.region);\n const open = declared.has(run.region) || !region ? `group ${run.region}` : declareRegion(region);\n declared.add(run.region);\n blocks.push([open, ...lines.map((line) => ` ${line}`), \"end\"].join(\"\\n\"));\n }\n return blocks;\n}\n\nexport function printNotation(diagram: Diagram): string {\n const branches = (diagram.git?.branches ?? []).map((b) => `branch ${b.id}${attrs([[\"note\", b.note]])}`);\n const time = diagram.kind === \"time\";\n const blocks = [\n `${diagram.kind} ${name(diagram.title)}${attrs([[\"view\", diagram.view]])}`,\n ...(branches.length > 0 ? [branches.join(\"\\n\")] : []),\n ...(diagram.time ? timeBlocks(diagram.time) : []),\n ...declarations(diagram),\n ...(diagram.lineup && diagram.lineup.items.length > 0 ? [itemLines(diagram.lineup.items)] : []),\n ];\n if (diagram.strip) {\n const meters = new Map((diagram.strip.meters ?? []).map((m) => [m.field, m.line]));\n const fields = diagram.strip.fields.map((f) => `${field(f, time)}${attrs([[\"meter\", meters.get(f)]])}`);\n blocks.push(`strip ${key(diagram.strip.title)}: ${fields.join(\", \")}`);\n }\n if (diagram.state) blocks.push(diagram.state.paths.map((p) => line(p.from, p.to, p.label)).join(\"\\n\"));\n for (const step of diagram.steps) {\n const body = step.body.split(\"\\n\");\n const say = body.length === 1 ? [` say ${step.body}`] : [\" say\", ...body.map((line) => (line === \"\" ? \"\" : ` ${line}`))];\n blocks.push(\n [\n `step ${step.title}`,\n ...say,\n ...(step.code === undefined ? [] : [` code ${step.code}`]),\n ...(step.sources ?? []).map((s) => ` source ${name(s.name)}${attrs([[\"url\", s.url]])}`),\n ...step.events.map((e) => ` ${event(e, diagram.kind)}`),\n ].join(\"\\n\"),\n );\n }\n return `${blocks.join(\"\\n\\n\")}\\n`;\n}\n","/**\n * 構成図の置き場所。\n *\n * 区画を上から帯に積み、帯の左に区画の名前を置く。箱は全ての帯で共通の列に並べるので、\n * 区画をまたぐ線は縦にまっすぐ走る。箱の並びは線を辿って決める。前の区画の箱から線が来る箱を\n * その箱の列に置き、そこから線で繋がる箱を隣の列へ (寄せの指示が左か右なら下の行へ) 置いていく。\n * 線は縦と横の折れ線で、間にある箱を避ける。名前が箱に掛かる時は帯を広げて名前の場所を空ける。\n */\nimport { LOOK, TYPE } from \"../look/values\";\nimport type { Diagram, LabelSide, Region } from \"../schema\";\nimport { textWidth } from \"./measure\";\nimport {\n badgeOnPath,\n badgeRect,\n boxColors,\n boxWidth,\n cornerBadge,\n edgeColor,\n edgesOf,\n labelStyle,\n type Layout,\n lineBadges,\n LOOP_ROOM,\n loopBadge,\n loopLabelBase,\n loopUnder,\n replaceSameSpot,\n layoutStrip,\n type Point,\n placeLabel,\n placeSlot,\n type Rect,\n regionColors,\n type SceneBox,\n type SceneEdge,\n type SceneLabel,\n type SceneRegion,\n seatCarriers,\n shiftContent,\n slotBoxWidth,\n slotRooms,\n stripNeed,\n} from \"./scene\";\n\ninterface Group {\n region?: Region;\n members: string[];\n}\n\ninterface Slot {\n group: number;\n col: number;\n row: number;\n}\n\ninterface Room {\n top: number;\n bottom: number;\n}\n\nexport function layoutArchitecture(diagram: Diagram): Layout {\n const groups = groupsOf(diagram);\n const slots = placeBoxes(diagram, groups);\n const rooms = groups.map(() => ({ top: 0, bottom: 0 }));\n let layout = arrange(diagram, groups, slots, rooms);\n // 名前を置く場所が帯の外へ出たら、その帯を広げて置き直す\n for (let pass = 0; pass < 3 && grow(layout, groups, slots, rooms); pass++) layout = arrange(diagram, groups, slots, rooms);\n return layout;\n}\n\nfunction groupsOf(diagram: Diagram): Group[] {\n const regions = diagram.regions ?? [];\n const known = new Set(regions.map((r) => r.id));\n const groups: Group[] = regions.map((region) => ({ region, members: diagram.boxes.filter((b) => b.region === region.id).map((b) => b.id) }));\n const loose = diagram.boxes.filter((b) => b.region === undefined || !known.has(b.region)).map((b) => b.id);\n if (loose.length > 0) groups.push({ members: loose });\n return groups;\n}\n\nconst vertical = (side: LabelSide | undefined): boolean => side === \"left\" || side === \"right\";\n\n/** 箱を列と行へ置く。列は全ての区画で共通。 */\nfunction placeBoxes(diagram: Diagram, groups: Group[]): Map<string, Slot> {\n const columns = LOOK.architecture.columns;\n const edges = edgesOf(diagram).map((e) => e.edge);\n const slots = new Map<string, Slot>();\n groups.forEach((group, g) => {\n const inGroup = new Set(group.members);\n const taken = new Set<string>();\n const free = (col: number, row: number): boolean => col >= 0 && col < columns && !taken.has(`${col},${row}`);\n const near = (col: number, row: number): [number, number] => {\n const start = Math.min(columns - 1, Math.max(0, col));\n for (let r = row; ; r++) {\n for (let d = 0; d < columns; d++) {\n for (const c of [start + d, start - d]) if (free(c, r)) return [c, r];\n }\n }\n };\n const put = (id: string, col: number, row: number): void => {\n slots.set(id, { group: g, col, row });\n taken.add(`${col},${row}`);\n };\n let dir = 1;\n const visit = (id: string): void => {\n for (const edge of edges) {\n const partner = edge.from === id ? edge.to : edge.to === id ? edge.from : undefined;\n if (partner === undefined || !inGroup.has(partner) || slots.has(partner)) continue;\n const me = slots.get(id) as Slot;\n const [c, r] = vertical(edge.labelSide) ? near(me.col, me.row + 1) : free(me.col + dir, me.row) ? [me.col + dir, me.row] : near(me.col + dir, me.row);\n put(partner, c, r);\n visit(partner);\n }\n };\n // 前の区画の箱と線で繋がる箱 (起きる順に早い線から) をその箱の列に置き、そこから辿る\n const anchorOf = (id: string): { order: number; col: number } | undefined => {\n for (let i = 0; i < edges.length; i++) {\n const edge = edges[i];\n const partner = edge?.from === id ? edge.to : edge?.to === id ? edge.from : undefined;\n const slot = partner === undefined ? undefined : slots.get(partner);\n if (slot && slot.group < g) return { order: i, col: slot.col };\n }\n return undefined;\n };\n let placed = 0;\n for (;;) {\n const rest = group.members.filter((id) => !slots.has(id));\n if (rest.length === 0) break;\n const anchored = rest.map((id) => ({ id, anchor: anchorOf(id) })).filter((a) => a.anchor !== undefined);\n anchored.sort((a, b) => (a.anchor?.order ?? 0) - (b.anchor?.order ?? 0));\n const pick = anchored[0] ?? { id: rest[0] as string, anchor: undefined };\n const want = pick.anchor?.col ?? 0;\n if (placed === 0) dir = want >= (columns - 1) / 2 ? -1 : 1;\n const [c, r] = free(want, 0) ? [want, 0] : near(want, 0);\n put(pick.id, c, r);\n visit(pick.id);\n placed++;\n }\n });\n // 使っていない列を詰める\n const used = [...new Set([...slots.values()].map((s) => s.col))].sort((a, b) => a - b);\n for (const slot of slots.values()) slot.col = used.indexOf(slot.col);\n return slots;\n}\n\n/** 区画の名前の行。空白があれば真ん中に近い空白で 2 行に折る。 */\nfunction nameLines(name: string): string[] {\n const spaces = [...name.matchAll(/ /g)].map((m) => m.index);\n if (spaces.length === 0) return [name];\n const at = spaces.reduce((best, i) => (Math.abs(i - name.length / 2) < Math.abs(best - name.length / 2) ? i : best));\n return [name.slice(0, at), name.slice(at + 1)];\n}\n\nfunction headerSize(region: Region): { w: number; h: number; lines: string[] } {\n const { icon, nameY, line, inset } = LOOK.region;\n const lines = nameLines(region.name);\n const w = Math.max(icon, ...lines.map((l) => textWidth(l, TYPE.regionName)), textWidth(region.note ?? \"\", TYPE.regionNote));\n // 名前の最後の行の下と、添え書きの下まで\n const h = nameY - inset + (lines.length - 1) * line + (region.note ? line : 0) + LOOK.gap / 2;\n return { w, h, lines };\n}\n\nfunction arrange(diagram: Diagram, groups: Group[], slots: Map<string, Slot>, rooms: Room[]): Layout {\n const { box: B, region: R, architecture: A, margin, gap } = LOOK;\n const colors = boxColors(diagram);\n const regionColor = regionColors(diagram);\n const edges = edgesOf(diagram);\n\n // 列の幅と列の間。隣の列を横に結ぶ名前のある線は、名前が収まるまで間を広げる (広げすぎる時は脇へ寄せる)\n const columnCount = Math.max(1, ...[...slots.values()].map((s) => s.col + 1));\n // 運ぶ物を出し入れする箱は、絵柄の横に置き場を並べられる幅にする (#3176)\n const carriedIn = slotRooms(diagram);\n const widths = new Map(diagram.boxes.map((b) => [b.id, Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(carriedIn.get(b.id), b.icon !== undefined, B.padX))]));\n const colW = Array.from({ length: columnCount }, (_, c) => Math.max(B.minW, ...[...slots].filter(([, s]) => s.col === c).map(([id]) => widths.get(id) ?? B.minW)));\n const between = Array.from({ length: Math.max(0, columnCount - 1) }, () => A.columnGap as number);\n for (const { edge } of edges) {\n const a = slots.get(edge.from);\n const b = slots.get(edge.to);\n if (!a || !b || edge.label === undefined || a.group !== b.group || a.row !== b.row || Math.abs(a.col - b.col) !== 1 || vertical(edge.labelSide)) continue;\n const need = textWidth(edge.label, labelStyle(edge.label)) + LOOK.label.padX * 2 + A.labelRoom * 2;\n const i = Math.min(a.col, b.col);\n if (need <= A.maxColumnGap) between[i] = Math.max(between[i] ?? 0, need);\n }\n const headers = groups.map((g) => (g.region ? headerSize(g.region) : undefined));\n const headerW = Math.max(0, ...headers.map((h) => (h ? h.w + R.inset * 2 : 0)));\n const colLeft: number[] = [];\n for (let c = 0; c < columnCount; c++) colLeft.push(c === 0 ? margin + (headerW > 0 ? headerW : R.pad) : (colLeft[c - 1] as number) + (colW[c - 1] as number) + (between[c - 1] as number));\n const center = (c: number): number => (colLeft[c] as number) + (colW[c] as number) / 2;\n\n // 同じ箱へ戻る線は箱の下の輪で描くので、輪を持つ箱の行の下は、輪とその下の名前が収まるだけ空ける (#3186)\n const looped = new Set(edges.filter(({ edge }) => edge.from === edge.to).map(({ edge }) => edge.from));\n const loopRows = new Set([...looped].flatMap((id) => {\n const slot = slots.get(id);\n return slot ? [`${slot.group}:${slot.row}`] : [];\n }));\n const loopRoom = (g: number, row: number): number => (loopRows.has(`${g}:${row}`) ? LOOP_ROOM : 0);\n\n // 帯を上から積む\n const boxes: SceneBox[] = [];\n const bands: { group: number; y: number; h: number; rows: number }[] = [];\n let cursor = margin;\n groups.forEach((group, g) => {\n const rows = Math.max(1, ...group.members.map((id) => (slots.get(id)?.row ?? 0) + 1));\n const room = rooms[g] as Room;\n const top = cursor + R.pad + room.top;\n // 行の上端。輪を持つ行の下は、行の間に輪の分を足す\n const rowTop: number[] = [0];\n for (let r = 1; r < rows; r++) rowTop.push((rowTop[r - 1] as number) + B.h + A.rowGap + loopRoom(g, r - 1));\n for (const id of group.members) {\n const slot = slots.get(id) as Slot;\n const source = diagram.boxes.find((b) => b.id === id);\n const w = widths.get(id) ?? B.minW;\n const cx = center(slot.col);\n const y = top + (rowTop[slot.row] as number);\n boxes.push({\n id,\n name: source?.name ?? id,\n ...(source?.sub !== undefined ? { sub: source.sub } : {}),\n ...(source?.icon !== undefined ? { icon: source.icon } : {}),\n color: colors.get(id) ?? \"slate\",\n x: cx - w / 2,\n y,\n w,\n h: B.h,\n cx,\n cy: y + B.h / 2,\n });\n }\n const contentBottom = top + (rowTop[rows - 1] as number) + B.h + loopRoom(g, rows - 1);\n const header = headers[g];\n const h = Math.max(contentBottom + R.pad + room.bottom - cursor, header ? header.h + R.inset * 2 : 0, group.region ? R.minH : 0);\n bands.push({ group: g, y: cursor, h, rows });\n cursor += h + R.gap;\n });\n const bandsBottom = cursor - R.gap;\n for (const box of boxes) placeSlot(box, carriedIn.get(box.id));\n\n const byId = new Map(boxes.map((b) => [b.id, b]));\n const bandOf = (id: string) => bands[slots.get(id)?.group ?? 0] as (typeof bands)[number];\n /** 折れ線のどれかの区間が、四角を `pad` だけ広げた所に掛かる */\n const crosses = (points: Point[], rect: Rect, pad: number): boolean => {\n for (let i = 1; i < points.length; i++) {\n const [x1, y1] = points[i - 1] as Point;\n const [x2, y2] = points[i] as Point;\n if (Math.min(x1, x2) <= rect.x + rect.w + pad && Math.max(x1, x2) >= rect.x - pad && Math.min(y1, y2) <= rect.y + rect.h + pad && Math.max(y1, y2) >= rect.y - pad) return true;\n }\n return false;\n };\n // 輪を持つ箱の下の、輪と名前の置き場。ほかの線は、その箱から出る線と入る線も含めてここを通さない (#3186)\n const loopZones: Rect[] = [...looped].flatMap((id) => {\n const box = byId.get(id);\n return box ? [{ x: box.x, y: box.y + box.h, w: box.w, h: LOOP_ROOM }] : [];\n });\n const onLoop = (points: Point[]): boolean => loopZones.some((zone) => crosses(points, zone, 0));\n const blocked = (points: Point[], a: string, b: string): boolean =>\n boxes.some((box) => box.id !== a && box.id !== b && crosses(points, box, LOOK.label.search)) || onLoop(points);\n // 箱の下 (上) の、次の行か次の帯との間の真ん中。箱の下に輪が在る時は、輪と名前の下を通す (#3186)\n const laneBelow = (id: string): number => {\n const box = byId.get(id) as SceneBox;\n const band = bandOf(id);\n const slot = slots.get(id);\n const under = box.y + box.h + (slot ? loopRoom(slot.group, slot.row) : 0);\n return (slot?.row ?? 0) < band.rows - 1 ? under + A.rowGap / 2 : Math.min(under + R.pad / 2, band.y + band.h - LOOK.edge.inset);\n };\n const laneAbove = (id: string): number => {\n const box = byId.get(id) as SceneBox;\n const band = bandOf(id);\n return (slots.get(id)?.row ?? 0) > 0 ? box.y - A.rowGap / 2 : Math.max(box.y - R.pad / 2, band.y + LOOK.edge.inset);\n };\n const inset = LOOK.edge.inset;\n /** 列 `col` の右 (左) の、隣の列との間の真ん中。同じ列の箱は幅が違うので、箱ではなく列の端から測る (幅の広い箱の中を通さない) */\n const gapX = (col: number, toRight: boolean): number =>\n toRight ? (colLeft[col] as number) + (colW[col] as number) + (between[col] ?? A.columnGap) / 2 : (colLeft[col] as number) - (between[col - 1] ?? A.columnGap) / 2;\n const route = (from: string, to: string): Point[] => {\n const a = byId.get(from) as SceneBox;\n const b = byId.get(to) as SceneBox;\n // 同じ箱へ戻る線は、状態遷移図と同じ箱の下の輪で描く (#3186)\n if (from === to) return loopUnder(a);\n const sa = slots.get(from) as Slot;\n const sb = slots.get(to) as Slot;\n if (sa.group === sb.group && sa.row === sb.row) {\n const right = b.cx > a.cx;\n const straight: Point[] = [\n [right ? a.x + a.w : a.x, a.cy],\n [right ? b.x - inset : b.x + b.w + inset, b.cy],\n ];\n if (!blocked(straight, from, to)) return straight;\n const below = laneBelow(from);\n const under: Point[] = [\n [a.cx, a.y + a.h],\n [a.cx, below],\n [b.cx, below],\n [b.cx, b.y + b.h + inset],\n ];\n if (!onLoop(under)) return under;\n // 下を回ると輪を横切る時は、上を回る\n const above = laneAbove(from);\n const over: Point[] = [\n [a.cx, a.y],\n [a.cx, above],\n [b.cx, above],\n [b.cx, b.y - inset],\n ];\n return onLoop(over) ? under : over;\n }\n const down = b.cy > a.cy;\n const leave: Point = [a.cx, down ? a.y + a.h : a.y];\n const enter: Point = [b.cx, down ? b.y - inset : b.y + b.h + inset];\n if (sa.col === sb.col) {\n const straight: Point[] = [leave, enter];\n if (!blocked(straight, from, to)) return straight;\n const x = gapX(sa.col, true);\n return [\n [a.x + a.w, a.cy],\n [x, a.cy],\n [x, b.cy],\n [b.x + b.w + inset, b.cy],\n ];\n }\n const right = b.cx > a.cx;\n const lane = down ? laneBelow(from) : laneAbove(from);\n const candidates: Point[][] = [\n [leave, [a.cx, b.cy], [right ? b.x - inset : b.x + b.w + inset, b.cy]],\n [[right ? a.x + a.w : a.x, a.cy], [b.cx, a.cy], enter],\n [leave, [a.cx, lane], [b.cx, lane], enter],\n ];\n // 輪を持つ箱の下からは出入りしない。箱の脇から列の間へ出て、列の間を縦に走る (#3186)\n if (looped.has(from) || looped.has(to)) {\n const ax = gapX(sa.col, right);\n const bx = gapX(sb.col, !right);\n const out: Point[] = [\n [right ? a.x + a.w : a.x, a.cy],\n [ax, a.cy],\n ];\n const side: Point = [right ? b.x - inset : b.x + b.w + inset, b.cy];\n candidates.push(\n [...out, [ax, b.cy], side],\n [...out, [ax, lane], [b.cx, lane], enter],\n [leave, [a.cx, lane], [bx, lane], [bx, b.cy], side],\n [...out, [ax, lane], [bx, lane], [bx, b.cy], side],\n );\n }\n return candidates.find((points) => !blocked(points, from, to)) ?? (candidates[2] as Point[]);\n };\n\n const sceneEdges: SceneEdge[] = edges.map(({ step, event, edge }) => ({\n step,\n event,\n from: edge.from,\n to: edge.to,\n points: route(edge.from, edge.to),\n color: edgeColor(edge, colors),\n carry: edge.carry,\n }));\n // 運ぶ物は着いた箱の置き場に留まり、出る箱の置き場で走り出しを待つ (#3176)\n seatCarriers(sceneEdges, byId, carriedIn);\n // 同じ 2 つの箱を行きと帰りで結ぶまっすぐな線は、少しずらして重ならないようにする。\n // ずらした線の名前は、ずらした側 (もう一方の線の反対側) に置き、どちらの線の名前かを取り違えないようにする (#3175)\n const outward = new Map<SceneEdge, LabelSide>();\n for (const edge of sceneEdges) {\n if (edge.points.length !== 2) continue;\n const back = sceneEdges.some((other) => other.from === edge.to && other.to === edge.from && other.points.length === 2);\n if (!back) continue;\n const [p, q] = edge.points as [Point, Point];\n const flat = Math.abs(q[1] - p[1]) < Math.abs(q[0] - p[0]);\n const d = (edge.from < edge.to ? 1 : -1) * LOOK.edge.parallel;\n edge.points = edge.points.map(([x, y]) => (flat ? [x, y + d] : [x + d, y]));\n outward.set(edge, flat ? (d > 0 ? \"below\" : \"above\") : d > 0 ? \"right\" : \"left\");\n }\n\n const regions: SceneRegion[] = [];\n groups.forEach((group, g) => {\n const band = bands[g] as (typeof bands)[number];\n const header = headers[g];\n if (!group.region || !header) return;\n regions.push({\n id: group.region.id,\n lines: header.lines,\n ...(group.region.note !== undefined ? { note: group.region.note } : {}),\n ...(group.region.icon !== undefined ? { icon: group.region.icon } : {}),\n color: regionColor.get(group.region.id) ?? \"slate\",\n x: margin,\n y: band.y,\n w: 0,\n h: band.h,\n header: { x: margin + R.inset, y: band.y + R.inset, w: header.w, h: header.h },\n });\n });\n\n // 線の名前は、同じ時刻に見えている段の番号 (その段とそれより前の段の番号) も避ける (#3175)\n // 輪の番号は弧に重ねず弧の右に置く (#3186)\n const badgeAt = (edge: SceneEdge, taken: Point[], lines: Point[][]): Point => (edge.from === edge.to ? loopBadge(edge.points) : badgeOnPath(edge.points, taken, lines));\n const early = lineBadges(sceneEdges, diagram.steps.length, badgeAt);\n const labels: SceneLabel[] = [];\n for (const edge of sceneEdges) {\n const source = diagram.steps[edge.step]?.events[edge.event];\n if (source?.type !== \"edge\" || source.label === undefined) continue;\n const seen = [...early].filter(([s]) => s <= edge.step).map(([, b]) => badgeRect(b.point));\n const soft: Rect[] = [...regions.map((r) => r.header), ...labels.filter((l) => l.step === edge.step)];\n // 指示の無い線の名前は、空いていなければ反対の側も探す。ずらした線は自分の側だけを探す\n const side = source.labelSide ?? outward.get(edge);\n // 輪の名前は輪の下から探す (#3186)\n const below = edge.from === edge.to ? { side: \"below\" as const, base: loopLabelBase(edge.points, textWidth(source.label, labelStyle(source.label)) + LOOK.label.padX * 2) } : undefined;\n labels.push(\n placeLabel(\n { step: edge.step, event: edge.event, text: source.label, points: edge.points, color: edge.color, ...(below ?? (side ? { side } : { flip: true })) },\n { hard: boxes, soft, touch: seen },\n ),\n );\n }\n\n const layout: Layout = { kind: \"architecture\", width: 0, height: 0, regions, boxes, lifelines: [], edges: sceneEdges, labels, actions: [], badges: [], paths: [], ends: [] };\n // 名前が左へ出たら、帯の中身を右へ寄せる。帯は図の幅いっぱいに引き直す\n const shift = labels.length > 0 ? Math.max(0, margin + LOOK.label.soft - Math.min(...labels.map((l) => l.x))) : 0;\n if (shift > 0) shiftContent(layout, shift, 0);\n const contentRight = Math.max(...boxes.map((b) => b.x + b.w + R.pad), ...labels.map((l) => l.x + l.w + LOOK.label.soft), ...sceneEdges.flatMap((e) => e.points.map((p) => p[0] + R.pad)));\n const width = Math.max(contentRight + margin, stripNeed(diagram) + margin * 2);\n for (const region of regions) region.w = width - margin * 2;\n // 箱の下を回る線の名前は帯の下へ出ることがあるので、名前の下端まで図に入れる (#3176)\n const contentBottom = Math.max(bandsBottom, ...labels.map((l) => l.y + l.h));\n const strip = layoutStrip(diagram, margin, contentBottom + gap, width - margin * 2);\n layout.width = width;\n layout.height = (strip ? strip.y + strip.h : contentBottom) + margin;\n if (strip) layout.strip = strip;\n const lines = lineBadges(sceneEdges, diagram.steps.length, badgeAt);\n // 同じ所に置いた番号は、後の段が始まると入れ替える (#3184)\n layout.badges = replaceSameSpot(\n diagram.steps.map((step, s) => {\n const line = lines.get(s);\n if (!line) return cornerBadge(step.events, s, layout);\n return { step: s, x: line.point[0], y: line.point[1], color: line.edge.color };\n }),\n );\n return layout;\n}\n\n/** 区画の中を結ぶ線の名前が帯の外へ出ていたら、その分だけ帯の上か下を広げる。広げたら true。 */\nfunction grow(layout: Layout, groups: Group[], slots: Map<string, Slot>, rooms: Room[]): boolean {\n let grown = false;\n const soft = LOOK.label.soft;\n for (const label of layout.labels) {\n const edge = layout.edges.find((e) => e.step === label.step && e.event === label.event);\n const a = edge && slots.get(edge.from);\n const b = edge && slots.get(edge.to);\n if (!a || !b || a.group !== b.group || !groups[a.group]?.region) continue;\n const region = layout.regions.find((r) => r.id === groups[a.group]?.region?.id);\n const room = rooms[a.group];\n if (!region || !room) continue;\n const over = region.y + soft - label.y;\n const under = label.y + label.h - (region.y + region.h - soft);\n if (over > 0) {\n room.top += over;\n grown = true;\n }\n if (under > 0) {\n room.bottom += under;\n grown = true;\n }\n }\n return grown;\n}\n","/**\n * 時系列図の置き場所。\n *\n * 生存線の頭の箱を上に横 1 列に並べ、段で起きる線と処理を起きる順に 1 行ずつ下へ積む。\n * 生存線の間は、箱の幅と、その間を走る線の名前が収まる幅を取る。中身の帯は一番下に置く。\n */\nimport { LOOK, TYPE } from \"../look/values\";\nimport type { Diagram } from \"../schema\";\nimport { textWidth } from \"./measure\";\nimport {\n carrierHalf,\n badgeRect,\n boxColors,\n cornerBadge,\n boxWidth,\n edgeColor,\n labelStyle,\n type Layout,\n lineBadges,\n replaceSameSpot,\n layoutStrip,\n type Point,\n placeLabel,\n type SceneAction,\n type SceneBadge,\n type SceneBox,\n type SceneEdge,\n type SceneLabel,\n shiftContent,\n stripNeed,\n} from \"./scene\";\n\nexport function layoutSequence(diagram: Diagram): Layout {\n const { box: B, sequence: Q, label: L, margin, gap } = LOOK;\n const colors = boxColors(diagram);\n const listed = diagram.sequence?.lifelines ?? [];\n const order = [...listed, ...diagram.boxes.map((b) => b.id).filter((id) => !listed.includes(id))];\n const column = new Map(order.map((id, i) => [id, i]));\n const widths = order.map((id) => boxWidth(diagram, id, false));\n\n // 生存線の間。隣の箱どうしの隙間を取り、名前のある線が走る間は名前が収まるまで広げる\n const spacing = widths.slice(1).map((w, i) => (widths[i] as number) / 2 + w / 2 + Q.columnGap);\n const needs: { from: number; to: number; need: number }[] = [];\n for (const step of diagram.steps) {\n for (const event of step.events) {\n if (event.type !== \"edge\" || event.label === undefined) continue;\n const a = column.get(event.from) ?? 0;\n const b = column.get(event.to) ?? 0;\n const w = textWidth(event.label, labelStyle(event.label)) + L.padX * 2;\n if (a === b) {\n // 自分へ戻る線は名前を右に置くので、右の生存線までに輪と名前が収まる幅を取る\n if (a < spacing.length) needs.push({ from: a, to: a + 1, need: Q.selfW + L.side + w + Q.labelRoom });\n } else {\n needs.push({ from: Math.min(a, b), to: Math.max(a, b), need: w + Q.labelRoom * 2 });\n }\n }\n }\n needs.sort((x, y) => x.to - x.from - (y.to - y.from));\n for (const { from, to, need } of needs) {\n let have = 0;\n for (let i = from; i < to; i++) have += spacing[i] ?? 0;\n if (have >= need) continue;\n const add = (need - have) / (to - from);\n for (let i = from; i < to; i++) spacing[i] = (spacing[i] ?? 0) + add;\n }\n const xs: number[] = [];\n order.forEach((_, i) => xs.push(i === 0 ? margin + (widths[0] as number) / 2 : (xs[i - 1] as number) + (spacing[i - 1] as number)));\n\n const boxes: SceneBox[] = order.map((id, i) => {\n const source = diagram.boxes.find((b) => b.id === id);\n const w = widths[i] as number;\n const cx = xs[i] as number;\n return {\n id,\n name: source?.name ?? id,\n ...(source?.sub !== undefined ? { sub: source.sub } : {}),\n ...(source?.icon !== undefined ? { icon: source.icon } : {}),\n color: colors.get(id) ?? \"slate\",\n x: cx - w / 2,\n y: margin,\n w,\n h: B.h,\n cx,\n cy: margin + B.h / 2,\n };\n });\n const headBottom = margin + B.h;\n\n // 行を積む。線は上か下に名前を、処理は札を持つので、行ごとに上下に要る高さが違う\n const edges: SceneEdge[] = [];\n const actions: SceneAction[] = [];\n const requests: Parameters<typeof placeLabel>[0][] = [];\n let y = headBottom + Q.firstRow;\n let below = 0;\n let first = true;\n diagram.steps.forEach((step, s) => {\n step.events.forEach((event, e) => {\n if (event.type !== \"edge\" && event.type !== \"action\") return;\n let above: number;\n let under: number;\n if (event.type === \"edge\") {\n const side = event.labelSide ?? \"above\";\n const self = event.from === event.to;\n const named = event.label !== undefined;\n above = named && side === \"above\" ? Q.labelOffset + L.h / 2 : gap;\n under = self ? Q.selfH + gap : named && side === \"below\" ? Q.labelOffset + L.h / 2 : gap;\n } else {\n above = LOOK.action.h / 2;\n under = LOOK.action.h / 2;\n }\n y = first ? y + above : y + Math.max(Q.minPitch, below + Q.rowGap + above) + (e === 0 && s > 0 ? Q.stepGap : 0);\n first = false;\n below = under;\n\n if (event.type === \"edge\") {\n const xf = xs[column.get(event.from) ?? 0] as number;\n const xt = xs[column.get(event.to) ?? 0] as number;\n const dir = Math.sign(xt - xf) || 1;\n const points: Point[] =\n xf === xt\n ? [\n [xf, y],\n [xf + Q.selfW, y],\n [xf + Q.selfW, y + Q.selfH],\n [xf + LOOK.edge.inset, y + Q.selfH],\n ]\n : [\n [xf, y],\n [xt - dir * LOOK.edge.inset, y],\n ];\n const color = edgeColor(event, colors);\n // 運ぶ物は着いた生存線の向こう側に留まって矢印の先を隠さず、出る生存線の手前側で走り出しを待って段の番号を隠さない (#3176)\n const seats: Pick<SceneEdge, \"settle\" | \"wait\"> = {};\n if (event.carry.kind !== \"none\") {\n const reach = LOOK.slot.lifeline + carrierHalf(event.carry)[0];\n const [p0, p1] = points as [Point, Point];\n const [q0, q1] = points.slice(-2) as [Point, Point];\n const out = Math.sign(p1[0] - p0[0]) || 1;\n const into = Math.sign(q1[0] - q0[0]) || -1;\n seats.wait = [xf - out * reach, p0[1]];\n seats.settle = [xt + into * reach, q1[1]];\n }\n edges.push({ step: s, event: e, from: event.from, to: event.to, points, color, carry: event.carry, ...seats });\n if (event.label !== undefined) {\n requests.push({\n step: s,\n event: e,\n text: event.label,\n points,\n color,\n ...(event.labelSide ? { side: event.labelSide } : xf === xt ? { side: \"right\" as const } : {}),\n offset: Q.labelOffset,\n });\n }\n } else {\n // 札は生存線の上の番号の丸を隠さないよう、丸の右に出す (#3017)\n const x = xs[column.get(event.box) ?? 0] as number;\n const w = textWidth(event.label, TYPE.action) + LOOK.action.padX * 2;\n actions.push({ step: s, event: e, box: event.box, text: event.label, color: colors.get(event.box) ?? \"slate\", x: x + LOOK.badge.r + 4, y: y - LOOK.action.h / 2, w, h: LOOK.action.h });\n }\n });\n });\n const bottom = (first ? headBottom : y + below) + Q.tail;\n const lifelines = order.map((id, i) => ({ id, x: xs[i] as number, y1: headBottom, y2: bottom }));\n\n // 線の名前は、同じ時刻に見えている段の番号 (その段とそれより前の段の番号) も避ける (#3175)\n const early = lineBadges(edges, diagram.steps.length);\n const labels: SceneLabel[] = [];\n for (const request of requests) {\n const seen = [...early].filter(([s]) => s <= request.step).map(([, b]) => badgeRect(b.point));\n const soft = [...labels.filter((l) => l.step === request.step), ...actions];\n labels.push(placeLabel(request, { hard: boxes, soft, touch: seen }));\n }\n\n const layout: Layout = { kind: \"sequence\", width: 0, height: 0, regions: [], boxes, lifelines, edges, labels, actions, badges: [], paths: [], ends: [] };\n\n // 図の幅。名前が左に出たら全体を右へ寄せ、右端は一番右の物に余白を足した所\n const lefts = [...boxes.map((b) => b.x), ...labels.map((l) => l.x), ...actions.map((a) => a.x)];\n const shift = Math.max(0, margin - Math.min(...lefts));\n if (shift > 0) shiftContent(layout, shift, 0);\n const rights = [...boxes.map((b) => b.x + b.w), ...labels.map((l) => l.x + l.w), ...actions.map((a) => a.x + a.w), ...edges.flatMap((edge) => edge.points.map((p) => p[0]))];\n const width = Math.max(Math.max(...rights) + margin, stripNeed(diagram) + margin * 2);\n const strip = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);\n layout.width = width;\n layout.height = (strip ? strip.y + strip.h : bottom) + margin;\n if (strip) layout.strip = strip;\n layout.badges = badges(diagram, layout);\n return layout;\n}\n\n/**\n * 段の番号。その段の最初の線の始まりに置き、線が無ければ処理する箱の生存線の上、無ければ書き換わる箱の角。\n * 処理の札はその段の終わりに消えるので、札に付けると止め絵で丸だけが浮く (#3017)。\n */\nfunction badges(diagram: Diagram, layout: Layout): SceneBadge[] {\n const lines = lineBadges(layout.edges, diagram.steps.length);\n const placed = diagram.steps.map((step, s): SceneBadge => {\n const line = lines.get(s);\n if (line) return { step: s, x: line.point[0], y: line.point[1], color: line.edge.color };\n const action = layout.actions.find((a) => a.step === s);\n const lifeline = action && layout.lifelines.find((l) => l.id === action.box);\n if (action && lifeline) return { step: s, x: lifeline.x, y: action.y + action.h / 2, color: action.color };\n return cornerBadge(step.events, s, layout);\n });\n // 同じ所に置いた番号は、後の段が始まると入れ替える (#3184)\n return replaceSameSpot(placed);\n}\n","/**\n * 段ごとの始まりと長さと、線、運ぶ物、線の名前、段の番号が見える時刻の表。SVG の動きはこの表から組む。\n *\n * 段の長さは本文の字数で決め、段で起きることが全部済んでから少し留まる長さを下限にする。\n * 運ぶ物は主役 (封筒と札は 1 つ、硬貨は別の 1 つ) ごとに途切れず見え続ける。着いた後は\n * 次の同じ主役が出発するまで着いた先に留まり、次が無ければ終わりまで留まる。\n * 線の名前はその段の間だけ出し、同じ段に何本あっても同時に見えるのは 2 つまでにする。\n * 状態遷移図では、段が終わった後も線の名前を最後の段まで薄く残す (#3171)。薄い名前は 2 つまでの数に入れない。\n * 止め絵を選んだ図では、最後の段で起きることが済んでから繰り返す前まで (`whole`)、全ての段の線の名前を最後の段と同じ濃さで出す (#3200)。\n * その間に見えている名前は繰り返す前まで延ばし、見えていない名前は同じ間に出し直す (`again`)。状態遷移図の薄い名前はその間の前で消す。\n * 状態遷移図では、主役の運ぶ物が乗っている状態を光らせ、運ぶ物が出た状態には少し後に済んだ印を出す (#3163)。\n * 枝分かれの図では、commit を積む出来事と枝を切る出来事も線と同じ間で引く (#3164)。\n * 時間軸の図では、針を進める出来事 (`now`) で針を目盛り 1 つずつ決まった秒数で進める (#3165)。針が進む目盛りの列の線は、\n * 段の中の書いた順に依らず、針がその目盛りに入った時に引き、線を引き終えるまで針は次の目盛りへ進まない。\n * 針を進める出来事より後に書いた出来事は、針が止まってから起こす。物差しの欄は、針が進む段では針の進みに比例して満ち、\n * 区切りの境から進む時は 0 から満ち直す。針が進まない段では値を書いた時に変わる。\n * 列の図 (#3239) の列の並びを書く出来事と、封と札の出来事も線と同じ表に載せ、並びは滑り終えるまで、封は覆い終えるまでを引く間にする。\n * 札を動かす線が運ぶ枝の札は運ぶ物の表に載せない。札は同じ時刻にいくつも出ていて、どの札も主役ではないので、\n * 枝分かれの図を描く部品が札ごとに動かす。線に書いた運ぶ物 (`tag` と `carry`) だけを表に載せる。\n */\nimport { ratioOf } from \"./layout/scene\";\nimport { MOTION } from \"./look/values\";\nimport type { Diagram } from \"./schema\";\nimport { STATE_ENDS } from \"./words\";\n\n/** 秒で表した、見えている間。`end` の時刻は含まない。 */\nexport interface Span {\n start: number;\n end: number;\n}\n\n/** 線を引いている間。`start` で引き始め、`drawn` で引き終わり、`end` (段の終わり) まで濃く残す。枝分かれの図では commit を積む出来事と枝を切る出来事も持つ */\nexport interface EdgeTime extends Span {\n step: number;\n event: number;\n drawn: number;\n}\n\n/** 運ぶ物が見えている間。`depart` に出発し `arrive` に着く。出発を待つ間と、着いた先で留まる間も含む。 */\nexport interface CarrierTime extends Span {\n step: number;\n event: number;\n who: \"main\" | \"coin\";\n depart: number;\n arrive: number;\n}\n\nexport interface LabelTime extends Span {\n step: number;\n event: number;\n /** 状態遷移図だけが持つ。段が終わった後に薄く残す間 */\n after?: Span;\n /** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから、最後の段と同じ濃さで出し直す間 (#3200) */\n again?: Span;\n}\n\n/** 処理、箱の字の書き換え、中身の帯の値が起きる時刻。 */\nexport interface EventTime {\n step: number;\n event: number;\n at: number;\n}\n\n/** 状態遷移図の状態ごとの、光っている間と、済んだ印が出る時刻。運ぶ物が出ていない状態は `done` を持たない */\nexport interface StateTime {\n box: string;\n lit: Span[];\n done?: number;\n}\n\nexport interface Timeline {\n /** 1 周の長さ */\n total: number;\n /** 繰り返す前に消えていく所の始まり */\n last: number;\n steps: Span[];\n edges: EdgeTime[];\n carriers: CarrierTime[];\n labels: LabelTime[];\n badges: { step: number; appears: number }[];\n events: EventTime[];\n /** 段ごとの止め絵の時刻。その段で起きることが全部見えている */\n stills: number[];\n /** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから繰り返す前まで、全ての段の線の名前と箱の中の処理を出す間 (#3200) */\n whole?: Span;\n /** 状態遷移図だけが持つ */\n states?: StateTime[];\n /** 時間軸の図だけが持つ (#3165)。針の動き。[時刻, 目盛りの境の位置] の並びで、間は真っ直ぐ進む */\n needle?: [number, number][];\n /** 時間軸の図だけが持つ。針が目盛りを過ぎた (右の境に着いた) 時刻 */\n units?: { unit: number; passed: number }[];\n /** 時間軸の図だけが持つ。物差しの欄の満ち具合の動き。[時刻, 割合] の並びで、間は真っ直ぐ変わる */\n meters?: { field: string; keys: [number, number][] }[];\n}\n\ninterface Planned {\n edges: { event: number; a: number; b: number; carries: boolean; coin: boolean; named: boolean }[];\n events: { event: number; at: number }[];\n busy: number;\n /** 時間軸の図の、針の動き ([段の始まりからの時刻, 境の位置]) と、針が目盛りを過ぎた時刻 */\n sweep?: { keys: [number, number][]; passed: { unit: number; at: number }[] };\n}\n\ntype EdgeEvent = Extract<Diagram[\"steps\"][number][\"events\"][number], { type: \"edge\" }>;\n\n/** 列の図の出来事の長さ */\nconst LINEUP_LENGTH = { line: MOTION.lineup.slide, seal: MOTION.lineup.seal, open: MOTION.fade, pick: MOTION.fade, stamp: MOTION.popFade } as const;\n\n/** 時間軸の図の段を組む時に渡す、段の始まりの針の位置と、目盛り 1 つを進む秒数 */\ninterface Needle {\n from: number;\n speed: number;\n}\n\n/**\n * 段の中で起きることの時刻 (段の始まりから)。線は少しずつずらして引き、書き換えは直前の線が着いてから起こす。\n * 時間軸の図では `needle` を渡し、針を進める出来事の所で針を目盛り 1 つずつ進める。針が進む目盛りの列の線はその目盛りに入った時に引く\n */\nfunction plan(step: Diagram[\"steps\"][number], needle?: Needle): Planned {\n const out: Planned = { edges: [], events: [], busy: 0 };\n let cursor = MOTION.edgeAt;\n let arrived: number | undefined;\n let changes = 0;\n let settled = Number.NEGATIVE_INFINITY;\n const line = (e: number, event: EdgeEvent, a: number): number => {\n const carries = event.carry.kind !== \"none\";\n const b = a + (carries ? MOTION.drawCarry : MOTION.draw);\n out.edges.push({ event: e, a, b, carries, coin: event.carry.kind === \"coin\", named: event.label !== undefined });\n out.busy = Math.max(out.busy, b);\n return b;\n };\n const nows = needle ? step.events.flatMap((event, e) => (event.type === \"now\" ? [{ e, to: event.to }] : [])) : [];\n const p0 = needle?.from ?? 0;\n const p1 = Math.max(p0, ...nows.map((n) => n.to + 1));\n const pulled = (event: Diagram[\"steps\"][number][\"events\"][number]): event is EdgeEvent => event.type === \"edge\" && event.at !== undefined && event.at >= p0 && event.at < p1;\n step.events.forEach((event, e) => {\n if (needle && e === nows[0]?.e) {\n // 針は、前に書いた書き換えが起きてから動き出す\n let t = Math.max(cursor, settled + MOTION.change);\n const keys: [number, number][] = [[t, p0]];\n const passed: { unit: number; at: number }[] = [];\n for (let u = p0; u < p1; u++) {\n const entry = t;\n const lines = step.events.flatMap((ev, k) => (pulled(ev) && ev.at === u ? [{ k, ev }] : []));\n const done = lines.reduce((latest, l, j) => Math.max(latest, line(l.k, l.ev, entry + MOTION.stagger * j)), entry);\n const end = Math.max(entry + needle.speed, lines.length > 0 ? done + MOTION.time.wait : entry);\n if (end - needle.speed > entry + 1e-9) keys.push([end - needle.speed, u]);\n keys.push([end, u + 1]);\n passed.push({ unit: u, at: end });\n t = end;\n }\n out.sweep = { keys, passed };\n out.busy = Math.max(out.busy, t);\n cursor = t + MOTION.time.after;\n arrived = t;\n changes = 0;\n return;\n }\n if (event.type === \"now\" || (needle && pulled(event))) return;\n if (event.type === \"line\" || event.type === \"seal\" || event.type === \"open\" || event.type === \"pick\" || event.type === \"stamp\") {\n const a = cursor;\n const b = a + LINEUP_LENGTH[event.type];\n out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });\n cursor = a + MOTION.lineup.stagger;\n arrived = b;\n changes = 0;\n out.busy = Math.max(out.busy, b);\n return;\n }\n // 枝分かれの図の commit を積む出来事と枝を切る出来事と、木の図の葉と親を出す出来事は、親から引く線と同じ間で引く\n if (event.type === \"commit\" || event.type === \"branch\" || event.type === \"leaf\" || event.type === \"node\") {\n const a = cursor;\n const b = a + MOTION.draw;\n out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });\n cursor = a + MOTION.stagger;\n arrived = b;\n changes = 0;\n out.busy = Math.max(out.busy, b);\n } else if (event.type === \"edge\") {\n const a = cursor;\n arrived = line(e, event, a);\n cursor = a + MOTION.stagger;\n changes = 0;\n } else if (event.type === \"action\") {\n out.events.push({ event: e, at: cursor });\n out.busy = Math.max(out.busy, cursor + MOTION.action);\n cursor += MOTION.action;\n changes = 0;\n } else {\n const at = (arrived ?? cursor) + MOTION.change * changes++;\n out.events.push({ event: e, at });\n out.busy = Math.max(out.busy, at);\n settled = Math.max(settled, at);\n }\n });\n // 針が進む目盛りの列の線は書いた順と別に引くので、引き始める順に並べ直す\n out.edges.sort((x, y) => x.a - y.a);\n return out;\n}\n\n/** 時刻の表を作る。`still` を立てると、最後の段の止め絵に全ての段の線の名前と箱の中の処理を出す間 (`whole`) を持つ (#3200) */\nexport function buildTimeline(diagram: Diagram, still = false): Timeline {\n const time = diagram.kind === \"time\" ? diagram.time : undefined;\n const T = MOTION.time;\n const speed = time ? Math.min(T.unitMax, Math.max(T.unitMin, T.axis / Math.max(1, time.scale.count))) : 0;\n let at = 0;\n const plans = diagram.steps.map((step) => {\n if (!time) return plan(step);\n const p = plan(step, { from: at, speed });\n at = p.sweep?.keys[p.sweep.keys.length - 1]?.[1] ?? at;\n return p;\n });\n const steps: Span[] = [];\n let t = MOTION.intro;\n diagram.steps.forEach((step, s) => {\n const read = Math.min(MOTION.stepMax, Math.max(MOTION.stepMin, MOTION.stepBase + [...step.body].length * MOTION.perChar));\n const length = Math.max(read, (plans[s]?.busy ?? 0) + MOTION.dwell);\n steps.push({ start: t, end: t + length });\n t += length;\n });\n const end = t;\n const total = Math.ceil(end + MOTION.outro);\n const last = total - MOTION.tail;\n const lastSpan = steps[steps.length - 1];\n const whole = still && lastSpan ? { start: lastSpan.start + (plans[plans.length - 1]?.busy ?? 0), end: last } : undefined;\n // 状態遷移図の薄い名前は、全ての段の名前を出し直す前に消す\n const faint = whole?.start ?? last;\n\n const edges: EdgeTime[] = [];\n const labels: LabelTime[] = [];\n const events: EventTime[] = [];\n const departures: { step: number; event: number; who: \"main\" | \"coin\"; a: number; b: number }[] = [];\n plans.forEach((p, s) => {\n const span = steps[s] as Span;\n const named: LabelTime[] = [];\n for (const edge of p.edges) {\n const a = span.start + edge.a;\n edges.push({ step: s, event: edge.event, start: a, drawn: span.start + edge.b, end: span.end });\n // 枝分かれの図の、札を書かない線が運ぶ札は、枝分かれの図を描く部品が札ごとに動かす\n const event = diagram.steps[s]?.events[edge.event];\n const own = diagram.kind === \"git\" && event?.type === \"edge\" && event.carry.kind === \"tag\" && event.carry.text === event.from;\n if (edge.carries && !own) departures.push({ step: s, event: edge.event, who: edge.coin ? \"coin\" : \"main\", a, b: span.start + edge.b });\n if (edge.named) named.push({ step: s, event: edge.event, start: a + MOTION.labelDelay, end: span.end });\n }\n // 3 つ目の名前が出る時に 1 つ目を消す\n named.forEach((label, k) => {\n const later = named[k + 2];\n if (later) label.end = Math.min(label.end, later.start);\n });\n for (const label of named) {\n if (whole && label.end > whole.start) label.end = whole.end;\n else {\n if (diagram.kind === \"state\" && label.end < faint) label.after = { start: label.end, end: faint };\n if (whole) label.again = whole;\n }\n }\n labels.push(...named);\n for (const event of p.events) events.push({ step: s, event: event.event, at: span.start + event.at });\n });\n\n const first = steps[0]?.start ?? 0;\n const hasMain = departures.some((d) => d.who === \"main\");\n const carriers: CarrierTime[] = [];\n for (const who of [\"main\", \"coin\"] as const) {\n const list = departures.filter((d) => d.who === who);\n list.forEach((d, k) => {\n const next = list[k + 1];\n // 主役の最初の運ぶ物は、最初の段の始まりから出発点で待つ (何も見えない時間を作らないため)\n const waits = k === 0 && (who === \"main\" || !hasMain);\n carriers.push({\n step: d.step,\n event: d.event,\n who,\n depart: d.a,\n arrive: d.b,\n start: waits ? Math.min(first, d.a) : d.a,\n end: next ? Math.max(next.a, d.b) : last,\n });\n });\n }\n carriers.sort((x, y) => x.depart - y.depart);\n const states = diagram.kind === \"state\" ? stateTimes(diagram, edges, last) : undefined;\n const needle: [number, number][] = [[0, 0]];\n const units: { unit: number; passed: number }[] = [];\n plans.forEach((p, s) => {\n const start = (steps[s] as Span).start;\n for (const [t, position] of p.sweep?.keys ?? []) needle.push([start + t, position]);\n for (const u of p.sweep?.passed ?? []) units.push({ unit: u.unit, passed: start + u.at });\n });\n needle.push([total, at]);\n\n return {\n total,\n last,\n steps,\n edges,\n carriers,\n labels,\n badges: steps.map((span, s) => ({ step: s, appears: span.start })),\n events,\n stills: steps.map((span) => span.end - MOTION.still),\n ...(whole ? { whole } : {}),\n ...(states ? { states } : {}),\n ...(time ? { needle, units, meters: meterTimes(diagram, plans, steps) } : {}),\n };\n}\n\n/**\n * 時間軸の図の物差しの欄の満ち具合 (#3165)。段で最後に書いた値へ向かって変わる。\n * 針が進む段では針の進みに比例して満ち、区切りの境から進む時はその境で 0 に戻ってから満ち直す。針が進まない段では値を書いた時に変わる\n */\nfunction meterTimes(diagram: Diagram, plans: Planned[], steps: Span[]): { field: string; keys: [number, number][] }[] {\n const length = diagram.time?.period?.length;\n return (diagram.strip?.meters ?? []).map(({ field }) => {\n const keys: [number, number][] = [[0, 0]];\n let value = 0;\n plans.forEach((p, s) => {\n const start = (steps[s] as Span).start;\n const sets = (diagram.steps[s]?.events ?? []).flatMap((event, e) => {\n const ratio = event.type === \"strip\" && event.field === field && event.value !== undefined ? ratioOf(event.value) : undefined;\n return ratio === undefined ? [] : [{ e, ratio }];\n });\n const set = sets[sets.length - 1];\n if (!set) return;\n const sweep = p.sweep?.keys ?? [];\n const first = sweep[0];\n const lastKey = sweep[sweep.length - 1];\n if (first && lastKey && lastKey[1] > first[1]) {\n const [p0, p1] = [first[1], lastKey[1]];\n let base = value;\n let from = p0;\n const boundary = length ? Math.floor((p1 - 1e-9) / length) * length : 0;\n if (boundary > 0 && boundary >= p0) {\n const tb = start + (sweep.find(([, position]) => position === boundary)?.[0] ?? first[0]);\n const prev = (keys[keys.length - 1] as [number, number])[0];\n keys.push([Math.max(prev, tb - MOTION.time.reset), value], [tb, 0]);\n base = 0;\n from = boundary;\n }\n for (const [t, position] of sweep) if (position >= from) keys.push([start + t, base + ((set.ratio - base) * (position - from)) / (p1 - from)]);\n } else {\n const at = start + (p.events.find((x) => x.event === set.e)?.at ?? 0);\n keys.push([at, value], [at + MOTION.fade, set.ratio]);\n }\n value = set.ratio;\n });\n return { field, keys };\n });\n}\n\nconst isEnd = (id: string): boolean => (STATE_ENDS as readonly string[]).includes(id);\n\n/**\n * 状態遷移図の状態が光る間。段の線を引き終えて状態へ着いた時から、その状態を出る線を引き始めるまで光り、\n * 出た少し後に済んだ印を出す。同じ状態へ戻る線では光ったまま、最後に着いた状態は終わりまで光る。\n * 物が状態を移るのは線を辿った時なので、運ぶ物の種類 (硬貨や、運ばない線) を問わず全ての線で数える。\n */\nfunction stateTimes(diagram: Diagram, edges: EdgeTime[], last: number): StateTime[] {\n const times = new Map<string, StateTime>();\n const of = (box: string): StateTime => {\n const found = times.get(box) ?? { box, lit: [] };\n times.set(box, found);\n return found;\n };\n let on: { box: string; since: number } | undefined;\n for (const edge of edges) {\n const event = diagram.steps[edge.step]?.events[edge.event];\n if (event?.type !== \"edge\" || event.from === event.to) continue;\n if (on) {\n const left = of(on.box);\n left.lit.push({ start: on.since, end: edge.start });\n if (on.box === event.from && left.done === undefined) left.done = edge.start + MOTION.done;\n on = undefined;\n }\n if (!isEnd(event.to)) on = { box: event.to, since: edge.drawn };\n }\n if (on) of(on.box).lit.push({ start: on.since, end: last });\n return [...times.values()];\n}\n","/**\n * 時刻の点の並びから CSS の keyframes を組む道具。見本帳の `engine.js` の `kf` / `vis` / `rise` / `pop` / `move` を写す。\n *\n * 動きは全て 1 周 `total` 秒の keyframes で、点の時刻は 1 周の中の割合 (%) に直す。\n * 性質ごとに独立して補間されるので、点ごとに変える性質だけを書く。\n */\nimport { EASE, LOOK, MOTION } from \"../look/values\";\n\nexport type Props = Record<string, string | number>;\nexport type Frame = [time: number, props: Props, ease?: string];\n\nconst r2 = (v: number): number => Math.round(v * 100) / 100;\n\nexport class Motion {\n readonly frames: string[] = [];\n private count = 0;\n\n constructor(\n private readonly prefix: string,\n readonly total: number,\n readonly last: number,\n ) {}\n\n private pct(t: number): number {\n return +((Math.min(Math.max(t, 0), this.total) / this.total) * 100).toFixed(3);\n }\n\n /** keyframes を 1 つ足し、その名前を付ける style の字を返す。 */\n kf(points: Frame[]): string {\n const name = `${this.prefix}-${this.count++}`;\n const at = new Map<number, { props: Props; ease?: string }>();\n for (const [t, props, ease] of [...points].sort((a, b) => a[0] - b[0])) {\n const p = this.pct(t);\n const cur = at.get(p) ?? { props: {} };\n Object.assign(cur.props, props);\n if (ease) cur.ease = ease;\n at.set(p, cur);\n }\n const body = [...at]\n .map(([p, { props, ease }]) => {\n const d = Object.entries(props).map(([k, v]) => `${k}:${v}`);\n if (ease) d.push(`animation-timing-function:${ease}`);\n return `${p}%{${d.join(\";\")}}`;\n })\n .join(\"\");\n this.frames.push(`@keyframes ${name}{${body}}`);\n return `animation-name:${name}`;\n }\n\n /** `a` で出て `b` から消える。`within` を立てると `b` までに消え終わる。 */\n vis(a: number, b = this.last, o: { f?: number; on?: Props; off?: Props; ein?: string; within?: boolean } = {}): string {\n const f = o.f ?? MOTION.fade;\n const on = o.on ?? {};\n const off = o.off ?? {};\n const out = o.within ? Math.max(a + f, b - f) : b;\n return this.kf([\n [0, { opacity: 0, ...off }],\n [a, { opacity: 0, ...off }, o.ein ?? EASE.out],\n [a + f, { opacity: 1, ...on }],\n [out, { opacity: 1, ...on }, EASE.inOut],\n [Math.min(out + f, this.total), { opacity: 0, ...off }],\n [this.total, { opacity: 0, ...off }],\n ]);\n }\n\n /** 少し下から浮いて出る。 */\n rise(a: number, b = this.last, within = false): string {\n return this.vis(a, b, { on: { transform: \"translateY(0)\" }, off: { transform: `translateY(${LOOK.rise}px)` }, within });\n }\n\n /** 小さな所から弾んで出る。 */\n pop(a: number, b = this.last): string {\n return this.vis(a, b, { f: MOTION.popFade, ein: EASE.pop, on: { transform: \"scale(1)\" }, off: { transform: `scale(${LOOK.popFrom})` } });\n }\n\n /** 初めから出ていて `b` で消える。 */\n until(b: number): string {\n const f = MOTION.untilFade;\n return this.kf([\n [0, { opacity: 1 }],\n [b, { opacity: 1 }, EASE.inOut],\n [b + f, { opacity: 0 }],\n [this.last, { opacity: 0 }],\n [this.total, { opacity: 1 }],\n ]);\n }\n\n /** 点を辿って動く。`[時刻, x, y, 大きさ, 次の点までの緩急]` の並び。 */\n move(points: [number, number, number, number?, string?][], extra: Frame[] = []): string {\n return this.kf(\n points.map(([t, x, y, s = 1, ease]): Frame => [t, { transform: `translate(${r2(x)}px,${r2(y)}px) scale(${s})` }, ease]).concat(extra),\n );\n }\n\n /** `a` から `b` まで見え、`fade` 秒で消える。 */\n blink(a: number, b: number, fade: number): Frame[] {\n return [\n [0, { opacity: 0 }],\n [a - 0.01, { opacity: 0 }],\n [a, { opacity: 1 }],\n [b, { opacity: 1 }],\n [b + fade, { opacity: 0 }],\n [this.total, { opacity: 0 }],\n ];\n }\n}\n","/**\n * 原本の JSON から図を描く本体。置き場所と時刻の表を作り、部品を重なりの順に並べて SVG にする。\n * git、lineup、state、time、tree の部品は登録簿から引くので、読んでいない種類は描けない (`kinds/registry.ts`、#3248)。\n *\n * 動きは全て SVG の中の CSS の keyframes が回す。1 周の長さは `--T`、止める時刻は `--at`、\n * 止めるか流すかは `--play` の変数で外から変えられる (頁に置く `player.ts` がこれを使う)。\n * 色と字は値の表から CSS の変数として 1 度だけ書き、部品はその変数だけを読む。\n * 止め絵を選ぶと (`still`)、最後の段の止め絵に全ての段の線の名前と箱の中の処理を出し、流れ全体を 1 枚で読ませる (#3200)。\n */\nimport { FIGURE_TEXT } from \"../figure-text\";\nimport { layoutArchitecture } from \"../layout/architecture\";\nimport type { GitLayout } from \"../layout/git\";\nimport type { LineupLayout } from \"../layout/lineup\";\nimport { textWidth } from \"../layout/measure\";\nimport { type Layout, type Rect, rewrapStrip, type SceneField, type SceneLabel, type SceneStrip } from \"../layout/scene\";\nimport { layoutSequence } from \"../layout/sequence\";\nimport type { TimeLayout } from \"../layout/time\";\nimport type { TreeLayout } from \"../layout/tree\";\nimport { kindParts } from \"../kinds/registry\";\nimport { FONTS } from \"../look/fonts\";\nimport { type ColorKey, type Colors, EASE, FONT_VARS, isColorName, isColorValue, LOOK, MOTION, type Palette, paletteVars, resolvePalette, type TextStyle, type Theme, TYPE } from \"../look/values\";\nimport { readDiagram } from \"../version\";\nimport type { Diagram, ViewMode } from \"../schema\";\nimport { buildTimeline, type LabelTime, type Span, type Timeline } from \"../timeline\";\nimport type { NotationLang } from \"../words\";\nimport {\n action,\n badge,\n band,\n card,\n carrier,\n type Ctx,\n cs,\n doneMark,\n edge,\n endMark,\n esc,\n type FieldChange,\n ghostCard,\n headCard,\n label,\n lifeline,\n linkTo,\n path,\n sansOf,\n side,\n strip,\n type SubChange,\n} from \"./parts\";\nimport { findOverlaps, type Ink, type Overlap, type Trace } from \"./ink\";\nimport { Motion } from \"./motion\";\n\nconst isGitLayout = (layout: Layout): layout is GitLayout => layout.kind === \"git\";\nconst isLineupLayout = (layout: Layout): layout is LineupLayout => layout.kind === \"lineup\";\nconst isTimeLayout = (layout: Layout): layout is TimeLayout => layout.kind === \"time\";\nconst isTreeLayout = (layout: Layout): layout is TreeLayout => layout.kind === \"tree\";\n\nexport interface RenderOptions {\n /** 色味の名前。書かないか知らない名前なら紙と墨 */\n palette?: string;\n /**\n * `palette` の色味に重ねる色の値 (#3198)。鍵は色味が持つ色の変数の名前 (`bg`、`ink`、`c-green` など) で、値は描く `theme` の色になる。\n * 渡さない色は色味の値のまま残る。色味に無い名前と、色の値として読めない値は、名前を挙げて描かずに断る\n */\n colors?: Colors;\n theme?: Theme;\n /** 描く部品が出す字 (断りの文、全体図の札、読み上げの名前) の言葉。書かなければ日本語 (#3001) */\n lang?: NotationLang;\n /**\n * 最後の段の止め絵に、全ての段の線の名前と箱の中の処理を最後の段と同じ濃さで出す (#3200)。途中の段の止め絵は今の段の名前だけを出す。\n * 箱の下の 1 行に出す処理は、その箱で最後に起きた処理か書き換えの字を出す。違う段の名前が重なっても置き直さず、最後の段の重なり (`overlaps`) に出す\n */\n still?: boolean;\n}\n\nexport interface Rendered {\n svg: string;\n palette: string;\n theme: Theme;\n /** 書き手が原本で決めた見せ方 */\n view?: ViewMode;\n fonts: { sans: string; mono: string };\n layout: Layout;\n timeline: Timeline;\n diagram: Diagram;\n /** 段ごとの止め絵で、同時に見えている字どうしの重なりと、線が札を持たない字を横切る所 (#3175)。重なりが無ければ空 */\n overlaps: Overlap[];\n}\n\nconst font = (t: TextStyle): string => `font:${t.weight} ${t.size}px var(--${t.family})`;\nconst mix = (pct: number, base = \"var(--surf)\"): string => `color-mix(in srgb,var(--c) ${pct}%,${base})`;\nconst S = LOOK.stroke;\nconst X = LOOK.mix;\n/** 状態遷移図で段が終わった線と番号の灰 (#3171) */\nconst PAST = `color-mix(in srgb,var(--mute) ${X.past}%,var(--bg))`;\n\n/** 部品の見た目。どの値も値の表から読む。 */\nconst PART_CSS = [\n \".dg{display:block;width:100%;height:auto;overflow:visible}\",\n \".dg .dg-a{animation-duration:var(--T);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;animation-delay:calc(var(--at,0) * -1s);animation-play-state:var(--play,running)}\",\n \".dg .dg-popc{transform-box:fill-box;transform-origin:center}\",\n \".dg-bg{fill:var(--bg)}\",\n \".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}\",\n `.dg-bi{fill:${mix(X.regionIcon)};stroke:${mix(X.regionIconEdge, \"transparent\")}}`,\n `.dg-bz{${font(TYPE.regionName)};fill:var(--ct)}`,\n `.dg-bx{${font(TYPE.regionNote)};fill:var(--mute)}`,\n \".dg-st{fill:var(--surf);stroke:var(--hair)}\",\n `.dg-halo{fill:none;stroke:var(--c);stroke-width:${S.halo};stroke-opacity:.16}`,\n `.dg-on{fill:none;stroke:var(--c);stroke-width:${S.on}}`,\n `.dg-ic{fill:${mix(X.icon)}}`,\n `.dg-slot{fill:none;stroke:${mix(X.slot, \"transparent\")};stroke-width:${S.slot};stroke-dasharray:3 3}`,\n `.dg-gl{fill:none;stroke:var(--c);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-sn{${font(TYPE.boxName)};fill:var(--ink)}`,\n `.dg-ss{${font(TYPE.boxSub)};fill:var(--mute)}`,\n `.dg-ss-ok{${font(TYPE.boxSubStrong)};fill:var(--ct)}`,\n `.dg-ss-act{${font(TYPE.boxSubStrong)};fill:var(--ink)}`,\n `.dg-ll{stroke:var(--line);stroke-width:${S.lifeline};stroke-dasharray:3 4}`,\n `.dg-e{fill:none;stroke:var(--line);stroke-width:${S.edge};stroke-linecap:round;stroke-dasharray:0 ${LOOK.edge.ghostDash}}`,\n `.dg-eh{fill:none;stroke:var(--line);stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-e-on{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,\n `.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-flow{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linecap:round;stroke-dasharray:1.5 ${LOOK.edge.flowDash}}`,\n `.dg-e-past{fill:none;stroke:${PAST};stroke-width:${S.edge};stroke-linecap:round}`,\n `.dg-eh-past{fill:none;stroke:${PAST};stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,\n \".dg-bd{cursor:pointer}\",\n \".dg-bdf{fill:var(--c)}\",\n `.dg-bdft{${font(TYPE.badge)};fill:var(--on-c)}`,\n `.dg-bdr{fill:none;stroke:var(--c);stroke-width:${S.badgeRing};pointer-events:none}`,\n `.dg-bdp{fill:${mix(X.badgePast)};stroke:${mix(X.badgePastEdge, \"transparent\")};stroke-width:${S.hair}}`,\n `.dg-bdpt{${font(TYPE.badge)};fill:var(--ct)}`,\n `.dg-bdp-g{fill:var(--surf);stroke:${PAST};stroke-width:${S.hair}}`,\n `.dg-bdpt-g{${font(TYPE.badge)};fill:var(--mute)}`,\n `.dg-cap rect,.dg-act rect{fill:${mix(X.cap)};stroke:${mix(X.capEdge, \"transparent\")}}`,\n `.dg-cap text{${font(TYPE.label)};fill:var(--ct)}`,\n `.dg-capj text{${font(TYPE.labelJa)}}`,\n `.dg-cap-past text{${font(TYPE.label)};fill:var(--mute);fill-opacity:${LOOK.state.pastLabel}}`,\n `.dg-cap-pastj text{${font(TYPE.labelJa)}}`,\n `.dg-act text{${font(TYPE.action)};fill:var(--ct)}`,\n \".dg-car{fill:var(--carry,var(--ink))}\",\n `.dg-car-t{${font(TYPE.carrier)};fill:var(--bg)}`,\n `.dg-car-tj{${font(TYPE.carrierJa)}}`,\n `.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${S.envelope}}`,\n `.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linejoin:round;stroke-linecap:round}`,\n \".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}\",\n \".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}\",\n \".dg-strip{fill:var(--surf);stroke:var(--hair)}\",\n `.dg-sep{stroke:var(--hair);stroke-width:${S.hair}}`,\n `.dg-sh{${font(TYPE.stripTitle)};fill:var(--ink)}`,\n `.dg-fl{${font(TYPE.fieldName)};fill:var(--mute)}`,\n `.dg-fv{${font(TYPE.fieldValue)};fill:var(--ink)}`,\n `.dg-fvj{${font(TYPE.fieldValueJa)};fill:var(--ink)}`,\n \".dg-fv-c{fill:var(--ct)}\",\n \".dg-fl-now{fill:var(--c)}\",\n `.dg-tr-ring{fill:none;stroke:var(--line);stroke-width:${S.trail}}`,\n \".dg-tr-fill{fill:var(--c)}\",\n \".dg-tg rect{fill:var(--c)}\",\n `.dg-tg text{${font(TYPE.tag)};fill:var(--on-c)}`,\n `.dg-side{fill:color-mix(in srgb,var(--c) ${X.side}%,var(--bg));stroke:${mix(X.sideEdge, \"transparent\")};stroke-dasharray:4 4}`,\n `.dg-side-t{${font(TYPE.regionName)};fill:var(--ct)}`,\n `.dg-side-n{${font(TYPE.regionNote)};fill:var(--mute)}`,\n `.dg-ghost{fill:var(--surf);stroke:${mix(X.ghostEdge, \"transparent\")};stroke-dasharray:4 3}`,\n `.dg-path{fill:none;stroke:${mix(X.path, \"transparent\")};stroke-width:${S.path};stroke-linecap:round;stroke-dasharray:0 ${LOOK.edge.ghostDash}}`,\n `.dg-path-h{fill:none;stroke:${mix(X.path, \"transparent\")};stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-path-t{${font(TYPE.label)};fill:var(--ct)}`,\n `.dg-path-tj{${font(TYPE.labelJa)}}`,\n \".dg-start{fill:var(--ink)}\",\n `.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${S.end}}`,\n \".dg-end-in{fill:var(--ink)}\",\n `.dg-end-x{fill:var(--bg);stroke:${mix(X.path, \"transparent\")};stroke-width:${S.arrow};stroke-dasharray:2 2.5}`,\n `.dg-end-xi{fill:${mix(X.path, \"transparent\")}}`,\n `.dg-mark{${font(TYPE.regionNote)};fill:var(--mute)}`,\n `.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${S.done}}`,\n `.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-git-l{fill:none;stroke:var(--c);stroke-width:${S.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,\n `.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${S.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,\n `.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${S.git}}`,\n `.dg-git-id{${font(TYPE.gitId)};fill:var(--ct)}`,\n `.dg-git-h{${font(TYPE.gitHash)};fill:var(--mute)}`,\n `.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,\n `.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,\n `.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,\n // 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く\n `.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,\n `.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,\n `.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,\n `.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,\n `.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,\n `.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,\n `.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,\n `.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,\n `.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,\n `.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,\n // 列の図 (#3239)。封は列の左端から右へ伸びる\n \".dg-ln-chip{fill:var(--c)}\",\n `.dg-ln-plain{fill:color-mix(in srgb,var(--mute) ${X.chipPlain}%,var(--surf))}`,\n `.dg-ln-t{${font(TYPE.chip)};fill:var(--on-c)}`,\n `.dg-ln-tp{${font(TYPE.chip)};fill:var(--ink)}`,\n \".dg-ln-seal{transform-box:fill-box;transform-origin:0 50%}\",\n `.dg-ln-sd{fill:color-mix(in srgb,var(--mute) ${X.sealDark}%,var(--surf))}`,\n `.dg-ln-sl{fill:color-mix(in srgb,var(--mute) ${X.sealLight}%,var(--surf))}`,\n `.dg-ln-stamp{fill:var(--surf);stroke:var(--c);stroke-width:${S.stamp}}`,\n `.dg-ln-st{${font(TYPE.stamp)};fill:var(--ct)}`,\n // 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする\n `.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,\n `.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,\n `.dg-tm-hd{${font(TYPE.timeHead)};fill:var(--ink)}`,\n `.dg-tm-hdj{${font(sansOf(TYPE.timeHead))}}`,\n `.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${S.timeSlot};opacity:.55}`,\n \".dg-tm-m{fill:var(--c)}\",\n \".dg-tm-x{fill:var(--c-slate)}\",\n `.dg-tm-fr{fill:none;stroke:var(--c-blue);stroke-width:${S.timeFrame};stroke-dasharray:3 2}`,\n `.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${X.timeGuide}%,transparent);stroke-width:${S.hair};stroke-dasharray:2 3}`,\n `.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${S.timeAxis}}`,\n `.dg-tm-tk{${font(TYPE.timeTick)};fill:var(--mute)}`,\n `.dg-tm-tkj{${font(sansOf(TYPE.timeTick))}}`,\n `.dg-tm-en{${font(TYPE.timePeriod)};fill:var(--ink2)}`,\n `.dg-tm-er{${font(TYPE.timeRange)};fill:var(--mute)}`,\n `.dg-tm-erj{${font(sansOf(TYPE.timeRange))}}`,\n `.dg-tm-rn{${font(TYPE.timeRow)};fill:var(--ink2)}`,\n `.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${S.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tm-bt{${font(TYPE.spanText)};fill:var(--ct)}`,\n `.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${X.timeSpan}%,transparent);stroke:var(--c);stroke-width:${S.timeSpan};stroke-dasharray:4 3}`,\n `.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${S.timeDrop};stroke-linecap:round;stroke-dasharray:0 3.5}`,\n \".dg-tm-pg{fill:var(--surf);stroke:var(--line);stroke-dasharray:2 2.5}\",\n `.dg-tm-pgl{fill:none;stroke:var(--mute);stroke-width:${S.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${S.timePoint}}`,\n `.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${S.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tm-pn{${font(TYPE.pointName)};fill:var(--ink)}`,\n `.dg-tm-pnj{${font(sansOf(TYPE.pointName))}}`,\n \".dg-tm-pn-g{fill:var(--mute)}\",\n `.dg-tm-ps{${font(TYPE.pointState)};fill:var(--ct)}`,\n `.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,\n `.dg-tm-nd{stroke:var(--ink);stroke-width:${S.timeNeedle};opacity:.55}`,\n \".dg-tm-nh{fill:var(--ink)}\",\n \".dg-tm-ph{fill:none;stroke:var(--line);stroke-dasharray:3 3}\",\n `.dg-tm-ex{fill:color-mix(in srgb,var(--c-slate) ${X.timeEmpty}%,var(--surf));stroke:var(--c-slate);stroke-width:${S.timeFrame};stroke-dasharray:3 3}`,\n `.dg-tm-ext{${font(TYPE.emptyText)};fill:var(--t-slate)}`,\n \".dg-tm-mt{fill:var(--hair)}\",\n \".dg-tm-mf{fill:var(--c);transform-box:fill-box;transform-origin:0 50%}\",\n `.dg-tm-mk{stroke:var(--ink2);stroke-width:${S.timeMeter}}`,\n `.dg-tm-ml{${font(TYPE.meterLine)};fill:var(--ink2)}`,\n \".dg-vp-bg{fill:var(--bg)}\",\n \".dg-vp-frame{fill:none;stroke:var(--hair)}\",\n \".dg-hd-bg{fill:var(--bg)}\",\n \".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}\",\n `.dg-mm-t{${font(TYPE.miniTitle)};fill:var(--mute)}`,\n \".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}\",\n `.dg-mm-band{fill:${mix(X.miniBand)};stroke:${mix(X.miniBandEdge, \"transparent\")};stroke-width:.6}`,\n `.dg-mm-card{fill:${mix(X.mini)}}`,\n `.dg-mm-vp{fill:color-mix(in srgb,var(--ink) ${X.view}%,transparent);stroke:var(--ink);stroke-width:${S.badgeRing};vector-effect:non-scaling-stroke}`,\n].join(\"\");\n\n/** 同じ原本と同じ見た目からは同じ名前になるよう、中身から短い名前を作る (keyframes の名前が頁の中で混ざらないため)。 */\nfunction nameOf(text: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < text.length; i++) {\n h ^= text.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(36);\n}\n\n/** 各箱が動く段。線の両端、処理、字の書き換えの箱。 */\nfunction involved(diagram: Diagram): Map<string, number[]> {\n const on = new Map<string, Set<number>>();\n const add = (id: string, s: number): void => {\n on.set(id, (on.get(id) ?? new Set()).add(s));\n };\n diagram.steps.forEach((step, s) => {\n for (const event of step.events) {\n if (event.type === \"edge\") {\n add(event.from, s);\n add(event.to, s);\n } else if (event.type === \"action\" || event.type === \"swap\") add(event.box, s);\n }\n });\n return new Map([...on].map(([id, steps]) => [id, [...steps].sort((a, b) => a - b)]));\n}\n\n/**\n * 箱の下の字の移り変わり。書き換えはそのまま残し、構成図の処理はその段の間だけ出して元へ戻す。\n * 止め絵を選んだ図は、その箱で最後に起きたのが処理なら、最後の段で起きることが済んだ時にその処理を出し直して繰り返す前まで残す (#3200)\n */\nfunction subChanges(diagram: Diagram, timeline: Timeline, actionsInBox: boolean): Map<string, SubChange[]> {\n type Raw = { t: number; order: number; box: string; set?: string; act?: string | null };\n const raw: Raw[] = [];\n const { whole } = timeline;\n let order = 0;\n for (const time of timeline.events) {\n const event = diagram.steps[time.step]?.events[time.event];\n if (event?.type === \"swap\") raw.push({ t: time.at, order: order++, box: event.box, set: event.text });\n if (actionsInBox && event?.type === \"action\") {\n raw.push({ t: time.at, order: order++, box: event.box, act: event.label });\n const end = (timeline.steps[time.step] as Span).end;\n if (!whole || end <= whole.start) raw.push({ t: end, order: order++, box: event.box, act: null });\n }\n }\n raw.sort((a, b) => a.t - b.t || a.order - b.order);\n const out = new Map<string, SubChange[]>();\n for (const box of diagram.boxes) {\n let base: [string, string] = [box.sub ?? \"\", \"dg-ss\"];\n let acting: string | undefined;\n let shown = base.join(\"|\");\n const list: SubChange[] = [];\n const changes = raw.filter((r) => r.box === box.id);\n const latest = [...changes].reverse().find((r) => r.set !== undefined || typeof r.act === \"string\");\n if (whole && typeof latest?.act === \"string\") changes.push({ t: whole.start, order: order++, box: box.id, act: latest.act });\n for (const change of changes) {\n // 書き換えは、出ている処理の字も置き換える\n if (change.set !== undefined) {\n base = [change.set, \"dg-ss-ok\"];\n acting = undefined;\n }\n if (change.act !== undefined) acting = change.act ?? undefined;\n const now: [string, string] = acting !== undefined ? [acting, \"dg-ss-act\"] : base;\n if (now.join(\"|\") === shown) continue;\n shown = now.join(\"|\");\n list.push([change.t, now[0], now[1]]);\n }\n // すぐ次の字に替わる字は読めないので出さない\n const kept = list.filter((change, k) => {\n const next = list[k + 1];\n return next === undefined || next[0] - change[0] >= MOTION.minShow;\n });\n out.set(box.id, kept);\n }\n return out;\n}\n\nfunction fieldChanges(diagram: Diagram, timeline: Timeline, layout: Layout): Map<string, FieldChange[]> {\n const out = new Map<string, FieldChange[]>();\n for (const time of timeline.events) {\n const event = diagram.steps[time.step]?.events[time.event];\n if (event?.type !== \"strip\") continue;\n const color: ColorKey = layout.badges[time.step]?.color ?? \"slate\";\n const list = out.get(event.field) ?? [];\n const until = (timeline.steps[time.step] as Span).end;\n list.push({ at: time.at, color, step: time.step, until, ...(event.value !== undefined ? { value: event.value } : {}), ...(event.tag !== undefined ? { tag: event.tag } : {}) });\n out.set(event.field, list);\n }\n return out;\n}\n\nexport interface FollowFrame {\n /** 枠の幅 (px)。寄って追う窓はこの幅で、字を原寸で見せる */\n width: number;\n /** 枠の中で見える高さ (px)。渡すと、窓と全体図をこの高さに収め (#3047)、窓をこの高さまで伸ばす (#3053)。枠の高さが図で伸びる置き場では渡さない */\n height?: number;\n /** 隅の全体図の札の言葉。渡し忘れを型の検査で止めるため、省けない欄にする */\n lang: NotationLang;\n}\n\n/**\n * 同じ線の同じ名前を後の段が置く時は、薄く残した名前をその段が始まるまでで消す (#3184)。\n * 止め絵で全ての段の名前を出し直す間は、同じ所に出る後の段の名前に任せる (#3200)\n */\nfunction fadeBefore(l: SceneLabel, time: LabelTime, steps: Span[]): LabelTime {\n if (l.until === undefined) return time;\n const { after, again: _again, ...rest } = time;\n if (!after) return rest;\n const cut = (steps[l.until] as Span).start;\n return cut > after.start ? { ...rest, after: { start: after.start, end: Math.min(after.end, cut) } } : rest;\n}\n\n/** 図を描く。`follow` を渡すと、寄って追う窓と隅の全体図で描く。`ink` を渡すと、描いた字の四角と見えている間をそこへ記録する (#3175)。 */\nexport function drawSvg(diagram: Diagram, layout: Layout, timeline: Timeline, palette: Palette, theme: Theme, follow?: FollowFrame, ink: Ink[] = [], traces: Trace[] = []): string {\n // 札の言葉で全体図の地の幅が変わりうるので、同じ頁に置いた別の言葉の図と名前を分ける。\n // 色は色味の名前でなく色の値から名前を作り、色の値を重ねた図 (#3198) と同じ色味の名前の図の変数の規則を分ける\n const vars = paletteVars(palette, theme);\n const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : \"\"}`);\n const m = new Motion(`dg${id}`, timeline.total, timeline.last);\n const ctx: Ctx = { m, t: timeline, id, sh: `filter=\"url(#dg-sh-${id})\"`, end: (timeline.steps[timeline.steps.length - 1] as Span).end, ink, traces };\n const on = involved(diagram);\n // 時系列図の処理は生存線の上の札に出し、他の図の種類は箱の下の字に出す\n const subs = subChanges(diagram, timeline, layout.kind !== \"sequence\");\n\n const L = { band: [] as string[], base: [] as string[], lit: [] as string[], node: [] as string[], badge: [] as string[], top: [] as string[] };\n for (const region of layout.regions) L.band.push(band(region, ink));\n const ghostColor = layout.boxes.find((b) => b.ghost)?.color ?? \"slate\";\n if (layout.side) L.band.push(side(layout.side, ghostColor, ink));\n // 脇道へ入る道は脇道の状態の色、それ以外の道は送る側の色で描く\n const boxColor = (id: string, ghost?: boolean): ColorKey | undefined => layout.boxes.find((b) => b.id === id && (ghost === undefined || b.ghost === ghost))?.color;\n for (const p of layout.paths) L.base.push(path(p, boxColor(p.to, true) ?? boxColor(p.from) ?? ghostColor, ink, traces));\n for (const e of layout.ends) L.node.push(endMark(e, ghostColor, ink));\n // 状態遷移図は、段で変わった値を今の状態の色で描き、帯の通った状態の点を着いた時刻に塗る (#3171)\n const isState = layout.kind === \"state\";\n const arrivals = new Map((timeline.states ?? []).flatMap((s) => (s.lit[0] ? [[s.box, s.lit[0].start] as [string, number]] : [])));\n // 時間軸の図の物差しの欄は、満ち具合の動きで棒を伸ばす (#3165)\n const meters = new Map((timeline.meters ?? []).map((meter) => [meter.field, meter.keys]));\n const gauge = (field: SceneField): string | undefined => (field.meter ? kindParts(\"time\").meterField({ ...field, meter: field.meter }, meters.get(field.name) ?? [[0, 0]], ctx) : undefined);\n const drawStrip = (s: SceneStrip): string => strip(s, fieldChanges(diagram, timeline, layout), ctx, isState, arrivals, gauge);\n // 寄って追う図の表は窓の下に置くので、窓の中身には描かない (#3270)\n if (layout.strip && !follow) L.band.push(drawStrip(layout.strip));\n for (const line of layout.lifelines) L.base.push(lifeline(line.x, line.y1, line.y2));\n // 枝分かれの図の線と commit と札は、枝分かれの図を描く部品が描く (#3164)\n if (isGitLayout(layout)) {\n const git = kindParts(\"git\").drawGit(layout, diagram, timeline, ctx);\n L.base.push(git.links);\n L.lit.push(git.lines);\n L.node.push(git.commits);\n L.top.push(git.tags);\n }\n // 木の図の木の線と通った跡と木の箱と札は、木の図を描く部品が描く (#3233)。木の線を走る線は通った跡が見せるので、ほかの線と同じ線で描かない\n const treeLayout = isTreeLayout(layout) ? layout : undefined;\n const tree = treeLayout ? kindParts(\"tree\").drawTree(treeLayout, diagram, timeline, ctx) : undefined;\n if (tree) {\n L.base.push(tree.links);\n L.lit.push(tree.trails);\n L.node.push(tree.nodes);\n }\n const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));\n // 列の図の列とチップと封と札は、列の図を描く部品が描く (#3239)\n const lineupLayout = isLineupLayout(layout) ? layout : undefined;\n if (lineupLayout) {\n const lineup = kindParts(\"lineup\").drawLineup(lineupLayout, diagram, timeline, ctx, subs);\n L.base.push(lineup.lanes);\n L.node.push(lineup.chips);\n }\n // 時間軸の図の目盛りと印と拡大の帯の箱と節目は、時間軸の図を描く部品が描く (#3165)。拡大の帯の線は他の図と同じ線で描く\n const timeLayout = isTimeLayout(layout) ? layout : undefined;\n if (timeLayout) {\n const drawn = kindParts(\"time\").drawTime(timeLayout, diagram, timeline, ctx, subs);\n L.base.push(drawn.base);\n L.lit.push(drawn.lit);\n L.node.push(drawn.node);\n L.top.push(drawn.top);\n }\n const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));\n for (const e of layout.edges) {\n const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);\n if (!time || (timeLayout && !wired.has(`${e.step}/${e.event}`)) || runs.has(`${e.step}/${e.event}`)) continue;\n // 木の図の箱は段ごとに現れるので、木の線を走らない線の点線は、両端の木の箱が現れてから出す (#3240)\n const since = Math.max(tree?.appear.get(e.from) ?? 0, tree?.appear.get(e.to) ?? 0);\n const drawn = edge(e, time, ctx, isState, since);\n L.base.push(drawn.base);\n L.lit.push(drawn.lit);\n }\n const states = new Map((timeline.states ?? []).map((s) => [s.box, s]));\n // 飛び先を持つ箱は、箱の札をその飛び先への link で包む (#3199)。時間軸の図の箱は時間軸の図を描く部品が包む\n const links = new Map(diagram.boxes.flatMap((b) => (b.link === undefined ? [] : [[b.id, b.link] as [string, string]])));\n const linked = (id: string, markup: string): string => linkTo(links.get(id), markup);\n for (const box of timeLayout || lineupLayout ? [] : layout.boxes) {\n if (box.ghost) {\n L.node.push(linked(box.id, ghostCard(box, ink)));\n continue;\n }\n const state = states.get(box.id);\n L.node.push(linked(box.id, card(box, ctx, on.get(box.id) ?? [], subs.get(box.id) ?? [], isState ? (state?.lit ?? []) : undefined)));\n if (state?.done !== undefined) L.node.push(doneMark(box, state.done, ctx));\n }\n for (const b of layout.badges) if (!(follow && onStrip(layout, b))) L.badge.push(badge(b, ctx, isState));\n for (const l of layout.labels) {\n const time = timeline.labels.find((t) => t.step === l.step && t.event === l.event);\n if (time) L.top.push(label(l, fadeBefore(l, time, timeline.steps), ctx));\n }\n // 止め絵を選んだ図は、全ての段の名前を出す間にも処理の札を出す。その間に見えている札は繰り返す前まで延ばす (#3200)\n const { whole } = timeline;\n for (const a of layout.actions) {\n const time = timeline.events.find((t) => t.step === a.step && t.event === a.event);\n if (!time) continue;\n const until = (timeline.steps[a.step] as Span).end;\n L.top.push(whole && until > whole.start ? action(a, time.at, whole.end, ctx) : action(a, time.at, until, ctx, whole));\n }\n // 木の図の運ぶ物は着いた所で消える。通った跡が行き先を残し、兄弟の箱から同じ親へ着いた運ぶ物が重ならないため\n for (const time of timeline.carriers) {\n const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);\n if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));\n }\n const content = Object.values(L)\n .map((parts) => parts.join(\"\"))\n .join(\"\");\n\n const { near, far, nearY, farY } = LOOK.shadow;\n const shadow = `<filter id=\"dg-sh-${id}\" x=\"-20%\" y=\"-30%\" width=\"140%\" height=\"180%\"><feDropShadow dx=\"0\" dy=\"${nearY}\" stdDeviation=\"${near}\" style=\"flood-color:var(--sh);flood-opacity:var(--shA)\"/><feDropShadow dx=\"0\" dy=\"${farY}\" stdDeviation=\"${far}\" style=\"flood-color:var(--sh);flood-opacity:var(--shB)\"/></filter>`;\n // 寄って追う時系列図は、頭の箱を窓の上端に貼る頭の列にも描く (#3118)。頭の列の箱はアイコンを外した 2 段 (#3120)。止めて見せる図では描かない\n const heads = follow && layout.kind === \"sequence\" ? layout.boxes.map((box) => linked(box.id, headCard(box, ctx, on.get(box.id) ?? [], subs.get(box.id) ?? []))).join(\"\") : \"\";\n // 表の値だけが変わる段の番号の丸は表の隅に在るので、表と一緒に窓の下へ移す (#3270)。\n // 窓の下の表は図の左端から始まるので、丸の半径だけ内へ寄せる。寄せないと丸の左が図の端で切れる\n const drawTable = (s: SceneStrip, from: SceneStrip): string =>\n drawStrip(s) + layout.badges.filter((b) => onStrip(layout, b)).map((b) => badge({ ...b, x: b.x - from.x + s.x + LOOK.badge.r, y: b.y - from.y + s.y }, ctx, isState)).join(\"\");\n const view = follow ? followView(layout, timeline, diagram, m, id, content, follow, heads, drawTable) : { body: `<rect class=\"dg-bg\" width=\"${layout.width}\" height=\"${layout.height}\" rx=\"${LOOK.region.radius}\"/>${content}`, w: layout.width, h: layout.height };\n const css = `.dg-${id}{${FONT_VARS};--T:${timeline.total}s;${vars}}${PART_CSS}${m.frames.join(\"\")}`;\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"dg dg-${id}\" viewBox=\"0 0 ${Math.ceil(view.w)} ${Math.ceil(view.h)}\" width=\"${Math.ceil(view.w)}\" height=\"${Math.ceil(view.h)}\" role=\"img\" aria-label=\"${esc(diagram.title)}\" data-dragon=\"figure\" data-view=\"${follow ? \"follow\" : \"fixed\"}\">` +\n `<style>${css}</style><defs>${shadow}</defs>${view.body}</svg>`\n );\n}\n\n/** 四角を全部囲む四角。 */\nfunction union(rects: Rect[]): Rect {\n const x = Math.min(...rects.map((r) => r.x));\n const y = Math.min(...rects.map((r) => r.y));\n return { x, y, w: Math.max(...rects.map((r) => r.x + r.w)) - x, h: Math.max(...rects.map((r) => r.y + r.h)) - y };\n}\n\n/** 番号の丸が値の表の上に在るか。表の値だけが変わる段の丸は表の隅に置かれる */\nfunction onStrip(layout: Layout, badge: { y: number }): boolean {\n return layout.strip !== undefined && badge.y >= layout.strip.y;\n}\n\n/** 段で動く物が占める所。 */\nfunction focusOf(layout: Layout, diagram: Diagram, step: number): Rect | undefined {\n const rects = focusParts(layout, diagram, step);\n return rects.length === 0 ? undefined : union(rects);\n}\n\n/**\n * 番号の丸が窓から外れる段で、窓に入れる所 (#3046)。\n * 丸とその周りを起点に、丸に近い動く物から順に、窓 (`vw` × `vh`) に収まる間だけ囲む。収まらない物は飛ばして次を見る\n */\nfunction badgeFocus(badge: { x: number; y: number }, parts: Rect[], vw: number, vh: number): Rect {\n const room = LOOK.badge.r + LOOK.follow.badgeRoom;\n const { x: bx, y: by } = badge;\n const away = (p: Rect): number => Math.hypot(Math.max(0, p.x - bx, bx - p.x - p.w), Math.max(0, p.y - by, by - p.y - p.h));\n let held: Rect = { x: bx - room, y: by - room, w: room * 2, h: room * 2 };\n for (const p of [...parts].sort((a, b) => away(a) - away(b))) {\n const next = union([held, p]);\n if (next.w <= vw && next.h <= vh) held = next;\n }\n return held;\n}\n\n/** 段で動く物を 1 つずつ。 */\nfunction focusParts(layout: Layout, diagram: Diagram, step: number): Rect[] {\n const rects: Rect[] = [];\n for (const e of layout.edges.filter((x) => x.step === step)) {\n const xs = e.points.map((p) => p[0]);\n const ys = e.points.map((p) => p[1]);\n rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });\n }\n rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));\n // 木の図は、その段で現れる木の箱と木の線と、線の両端の木の箱を見る (#3233)\n if (isTreeLayout(layout)) {\n const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => (e.type === \"edge\" ? [e.from, e.to] : [])));\n rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));\n for (const l of layout.links.filter((x) => x.step === step)) {\n const xs = l.points.map((p) => p[0]);\n const ys = l.points.map((p) => p[1]);\n rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });\n }\n }\n // 列の図は、その段で変わる列を見る (#3239)\n if (isLineupLayout(layout)) {\n const changed = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => (\"box\" in e ? [e.box] : [])));\n rects.push(...layout.lanes.filter((lane) => changed.has(lane.id)));\n }\n for (const event of diagram.steps[step]?.events ?? []) {\n const ids = event.type === \"edge\" ? [event.from, event.to] : event.type === \"action\" || event.type === \"swap\" ? [event.box] : [];\n for (const id of ids) {\n const box = layout.boxes.find((b) => b.id === id);\n // 時系列図の頭の箱は遠いので、線の行だけを見る\n if (box && (layout.kind === \"architecture\" || event.type === \"swap\")) rects.push(box);\n }\n }\n return rects;\n}\n\n/**\n * 寄って追う窓。段ごとに動く所へ寄り、窓の外の全体図に今見ている所の枠を同じ動きで出す。\n * 全体図は窓に重ねると今動く線や箱を覆うので、窓の外に置く (#3042)。\n * 縦長の全体図は窓の右に列を取り、横長の全体図は窓の下に置く。失う窓の幅か図の高さの小さい側を選ぶ。\n * 枠の中で見える高さを渡された時は、窓と全体図がその高さに入るまで窓を低くする (#3047)。\n * 枠が余る時は窓を広げ、図の原寸の幅と、見える高さか図の高さまで使う。全体図は今の大きさのまま置く (#3053)。\n * 枠の幅が `LOOK.follow.narrow` より狭い時は、縦長の全体図を出さずに窓へ枠の幅の全部を渡す (#3055)。\n * 段で動く物を全部囲んだ所の真ん中に寄せると今の段の番号の丸が窓から外れる段では、丸に近い動く物から窓に収まるだけ囲んだ所へ寄せる (#3046)。\n * 時系列図は頭の箱 `heads` を窓の上端の頭の列に貼り、窓が横に動く時だけ一緒に動かす。頭の箱は図の上端に在り、線を追う窓からは外れるため。\n * 窓は頭の列の下の残りの高さで動く物を真ん中に見せる (#3118)。\n * 頭の列の箱はアイコンを外した 2 段にして低く貼り、線は図の頭の箱の下から見せ始める (#3120)。\n * 値の表は図の一番下に在り、窓が近づくまで映らず、窓より広い表は右側が切れる。全体図と同じ理由で窓の外に出し、\n * 窓と全体図の下に図の枠の幅で組み直す (#3270)。窓と全体図は表を除いた図の高さ `worldH` の中だけを見る。\n */\nfunction followView(layout: Layout, timeline: Timeline, diagram: Diagram, m: Motion, id: string, content: string, follow: FollowFrame, heads: string, drawTable: (s: SceneStrip, from: SceneStrip) => string): { body: string; w: number; h: number } {\n const F = LOOK.follow;\n const M = LOOK.mini;\n const frameWidth = Math.max(1, follow.width);\n const full = Math.min(layout.width, frameWidth);\n const worldH = layout.strip ? layout.strip.y : layout.height;\n const title = FIGURE_TEXT[follow.lang].overview;\n /** 窓の高さ `vh` の時の全体図の寸法。全体図は窓の高さで縮むので、窓を低くしたら測り直す */\n const sized = (vh: number) => {\n // 全体図の寸法は枠の幅と窓の高さで決め、置き場所に依らない\n // 全体図の幅は表を含む図の比で決める。表を除いた比にすると全体図の列が太り、窓が狭くなる\n const mw = Math.min(M.w, full * 0.4, ((vh * 0.4) / layout.height) * layout.width);\n const k = mw / layout.width;\n const mh = worldH * k;\n // 地の幅は図の縦横の比で決まるので、縦に長い図では札より狭くなる。その時は地を札の幅まで広げ、図は広げた地の真ん中に置く\n const bw = Math.max(mw, Math.ceil(textWidth(title, TYPE.miniTitle)));\n // 縦横の比は窓の高さに依らないので、低くしても全体図の置き場所は変わらない\n return { vh, mw, k, mh, bw, bgW: bw + M.pad * 2, bgH: mh + M.pad * 2 + M.title, beside: mh > mw };\n };\n const natural = sized(Math.min(worldH, Math.max(F.minH, full * F.aspect)));\n // 携帯の幅では縦長の全体図の列が枠の幅の 3 割を取り、窓が図の横の 3 割ほどしか見せない。その時は全体図を出さない。\n // 横長の全体図は窓の下に出して幅を取らないので、狭い枠でも出す\n const bare = natural.beside && frameWidth < F.narrow;\n const tableH = layout.strip ? rewrapStrip(layout.strip, 0, 0, full).h + M.inset : 0;\n // 窓の右の全体図は窓の高さの中に収まり、窓の下の全体図と表は窓の高さに足される\n const room = follow.height === undefined ? Number.POSITIVE_INFINITY : (natural.beside ? follow.height : follow.height - natural.bgH - M.inset) - tableH;\n // 見える高さが窓より低ければ窓と全体図を縮め、高ければ全体図はそのままに窓を図の高さまで伸ばす。\n // 全体図も伸ばすと、狭い枠では右の全体図の列が太って窓が狭くなる\n const { vh, mw, k, mh, bw, bgW, bgH, beside } =\n room < natural.vh ? sized(Math.max(F.fitMinH, room)) : { ...natural, vh: Number.isFinite(room) ? Math.min(worldH, room) : natural.vh };\n // 右の全体図の列は枠の余りに置き、窓は図の原寸の幅まで広げる。枠が図より狭い時は今までどおり枠の幅から列を引く\n const vw = beside && !bare ? Math.min(layout.width, frameWidth - bgW - M.inset) : full;\n const clampX = (x: number): number => Math.min(layout.width - vw / 2, Math.max(vw / 2, x));\n // 時系列図は窓の上端に頭の列を貼るので、動く物は頭の列の下の残りの高さ `below` に見せる (#3118)。\n // 線は図の頭の箱の下 `top` から見せ始め、図の頭の箱は頭の列の下か窓の上に隠す (#3120)\n const top = heads === \"\" ? 0 : Math.max(...layout.boxes.map((b) => b.y + b.h)) + F.headRoom;\n const strip = heads === \"\" ? 0 : F.head.pad * 2 + F.head.h;\n const below = vh - strip;\n /** 頭の列の下の残りの窓の真ん中の高さを、図の頭の箱の下と図の下端で止める */\n const clampY = (y: number): number => Math.min(worldH - below / 2, Math.max(top + below / 2, y));\n const r = LOOK.badge.r;\n let prev: [number, number] = [layout.width / 2, worldH / 2];\n // 頭の列の下の残りの窓の真ん中。窓の真ん中は、これより頭の列の高さの半分だけ上に在る\n const middles = timeline.steps.map((_, s) => {\n // 時間軸の図は、針と印の列を必ず窓に入れる (#3165)。番号の丸へ寄せ直すと、針が窓から外れるため\n if (isTimeLayout(layout)) {\n const f = kindParts(\"time\").timeFocus(layout, timeline, s, focusParts(layout, diagram, s), vw, below);\n prev = [f.x + f.w / 2, f.y + f.h / 2];\n return [clampX(prev[0]), clampY(prev[1])] as [number, number];\n }\n const f = focusOf(layout, diagram, s);\n prev = f ? [f.x + f.w / 2, f.y + f.h / 2] : prev;\n const at: [number, number] = [clampX(prev[0]), clampY(prev[1])];\n // 動く物を全部囲んだ所が窓より大きいと、その端に在る番号の丸が窓から外れる。その段だけ丸の近くへ寄せ直す (#3046)\n const b = layout.badges.find((x) => x.step === s);\n if (!b || onStrip(layout, b) || (Math.abs(b.x - at[0]) <= vw / 2 - r && Math.abs(b.y - at[1]) <= below / 2 - r)) return at;\n const near = badgeFocus(b, focusParts(layout, diagram, s), vw, below);\n // 動く物の無い次の段は、寄せ直した窓のまま止める\n prev = [near.x + near.w / 2, near.y + near.h / 2];\n return [clampX(prev[0]), clampY(prev[1])] as [number, number];\n });\n const centers = middles.map(([x, y]): [number, number] => [x, y - strip / 2]);\n const c0 = centers[0] as [number, number];\n const cam: [number, number, number, number?, string?][] = [\n [0, c0[0], c0[1]],\n [(timeline.steps[0] as Span).start, c0[0], c0[1]],\n ];\n centers.forEach((c, s) => {\n if (s === 0) return;\n const before = centers[s - 1] as [number, number];\n const start = (timeline.steps[s] as Span).start;\n cam.push([start, before[0], before[1], 1, EASE.inOut], [start + F.ease, c[0], c[1]]);\n });\n const cl = centers[centers.length - 1] as [number, number];\n cam.push([timeline.last, cl[0], cl[1], 1, EASE.inOut], [timeline.total, c0[0], c0[1]]);\n const camKf = m.move(cam.map(([t, cx, cy, s, e]) => [t, vw / 2 - cx, vh / 2 - cy, s, e]));\n\n // 右に出す時は窓の上端に揃え、下に出す時は窓の右端から内へ寄せる\n const bgX = beside ? vw + M.inset : vw - bgW - M.inset;\n const bgY = beside ? 0 : vh + M.inset;\n const bx = bgX + M.pad;\n const mx = bx + (bw - mw) / 2;\n const my = bgY + M.pad + M.title;\n /**\n * 全体図の地と札と、今見ている所の枠。窓と同じ動きで枠を動かす。\n * 時系列図の枠は頭の列の下の線を見せる所だけを囲む。頭の箱は頭の列に常に出ているため (#3122)\n */\n const overview = (): { clip: string; body: string } => {\n const shapes = [\n ...layout.regions.map((r) => `<rect class=\"dg-mm-band\" style=\"${cs(r.color)}\" x=\"${mx + r.x * k}\" y=\"${my + r.y * k}\" width=\"${r.w * k}\" height=\"${r.h * k}\" rx=\"3\"/>`),\n ...layout.boxes.map((b) => `<rect class=\"dg-mm-card\" style=\"${cs(b.color)}\" x=\"${mx + b.x * k}\" y=\"${my + b.y * k}\" width=\"${b.w * k}\" height=\"${b.h * k}\" rx=\"1.5\"/>`),\n ...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class=\"dg-mm-card\" style=\"${cs(n.color)}\" x=\"${mx + n.x * k}\" y=\"${my + n.y * k}\" width=\"${n.w * k}\" height=\"${n.h * k}\" rx=\"1.5\"/>`),\n ].join(\"\");\n const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));\n return {\n clip: `<clipPath id=\"dg-mm-${id}\"><rect x=\"${mx}\" y=\"${my}\" width=\"${mw}\" height=\"${mh}\" rx=\"4\"/></clipPath>`,\n body:\n `<rect class=\"dg-mm-bg\" x=\"${bgX}\" y=\"${bgY}\" width=\"${bgW}\" height=\"${bgH}\" rx=\"${M.radius}\"/>` +\n `<text class=\"dg-mm-t\" x=\"${bx}\" y=\"${my - M.pad + 2}\">${title}</text>` +\n `<g clip-path=\"url(#dg-mm-${id})\"><rect class=\"dg-mm-world\" x=\"${mx}\" y=\"${my}\" width=\"${mw}\" height=\"${mh}\"/>${shapes}<rect class=\"dg-mm-vp dg-a\"${strip === 0 ? \"\" : ` y=\"${strip * k}\"`} width=\"${vw * k}\" height=\"${(vh - strip) * k}\" rx=\"2\" style=\"${vp}\"/></g>`,\n };\n };\n const mini = bare ? { clip: \"\", body: \"\" } : overview();\n // 頭の列は窓の中身の上に重ね、窓と同じ時刻と緩急で横にだけ動かす (#3118)\n const head =\n strip === 0\n ? \"\"\n : `<g class=\"dg-hd\"><rect class=\"dg-hd-bg\" width=\"${vw}\" height=\"${strip}\"/><line class=\"dg-sep\" x1=\"0\" y1=\"${strip}\" x2=\"${vw}\" y2=\"${strip}\"/>` +\n `<g class=\"dg-a\" style=\"${m.move(cam.map(([t, cx, , s, e]) => [t, vw / 2 - cx, 0, s, e]))}\">${heads}</g></g>`;\n const body =\n `<defs><clipPath id=\"dg-vp-${id}\"><rect width=\"${vw}\" height=\"${vh}\" rx=\"${LOOK.region.radius}\"/></clipPath>${mini.clip}</defs>` +\n `<g clip-path=\"url(#dg-vp-${id})\"><rect class=\"dg-vp-bg\" width=\"${vw}\" height=\"${vh}\"/><g class=\"dg-a\" style=\"${camKf}\">${content}</g>${head}</g>` +\n `<rect class=\"dg-vp-frame\" x=\"0.5\" y=\"0.5\" width=\"${vw - 1}\" height=\"${vh - 1}\" rx=\"${LOOK.region.radius}\"/>${mini.body}`;\n const w = beside && !bare ? vw + M.inset + bgW : full;\n const bottom = beside ? vh : bgY + bgH;\n if (!layout.strip) return { body, w, h: bottom };\n const table = rewrapStrip(layout.strip, 0, bottom + M.inset, full);\n return { body: body + drawTable(table, layout.strip), w, h: table.y + table.h };\n}\n\n/**\n * 描く色味。名前で選んだ色味の `theme` の色に `colors` の色を重ねる (#3198)。\n * 色味に無い色の名前と、色の値として読めない値は、名前を全て挙げて描かずに断る\n */\nexport function paletteOf(options: RenderOptions, theme: Theme): Palette {\n const palette = resolvePalette(options.palette);\n if (!options.colors) return palette;\n const words = FIGURE_TEXT[options.lang ?? \"ja\"];\n const errors = Object.entries(options.colors).flatMap(([name, value]) => (!isColorName(name) ? [words.unknownColor(name)] : isColorValue(value) ? [] : [words.unreadableColor(name)]));\n if (errors.length > 0) throw new Error(words.cannotDraw(errors.join(\" / \")));\n return { ...palette, [theme]: { ...palette[theme], ...options.colors } };\n}\n\n/** 原本の JSON から図を描く。原本が形に合わない時は、誤りの場所を添えて断る。 */\nexport function renderDiagram(input: unknown, options: RenderOptions = {}): Rendered {\n const lang = options.lang ?? \"ja\";\n const read = readDiagram(input, { lang });\n if (!read.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read.errors.map((e) => `${e.pointer} ${e.message}`).join(\" / \")));\n const diagram = read.diagram;\n const layout =\n diagram.kind === \"sequence\"\n ? layoutSequence(diagram)\n : diagram.kind === \"state\"\n ? kindParts(\"state\", lang).layoutState(diagram, lang)\n : diagram.kind === \"git\"\n ? kindParts(\"git\", lang).layoutGit(diagram)\n : diagram.kind === \"time\"\n ? kindParts(\"time\", lang).layoutTime(diagram, lang)\n : diagram.kind === \"tree\"\n ? kindParts(\"tree\", lang).layoutTree(diagram)\n : diagram.kind === \"lineup\"\n ? kindParts(\"lineup\", lang).layoutLineup(diagram)\n : layoutArchitecture(diagram);\n return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);\n}\n\n/**\n * 置き場所を決めた図を描き、描いた字の重なりを数える (#3175)。`renderDiagram` が原本を読んで置き場所を決めた後に呼ぶ。\n * 重なりは、字を描く部品が記録した字だけから数えるので、描く所が位置を決める字 (箱の名前) も対象に入る\n */\nexport function renderLayout(diagram: Diagram, layout: Layout, timeline: Timeline, options: RenderOptions = {}): Rendered {\n const theme: Theme = options.theme === \"dark\" ? \"dark\" : \"light\";\n const palette = paletteOf(options, theme);\n const ink: Ink[] = [];\n const traces: Trace[] = [];\n const svg = drawSvg(diagram, layout, timeline, palette, theme, undefined, ink, traces);\n return {\n svg,\n palette: palette.id,\n theme,\n ...(diagram.view ? { view: diagram.view } : {}),\n fonts: { ...FONTS },\n layout,\n timeline,\n diagram,\n overlaps: findOverlaps(ink, timeline.stills, traces),\n };\n}\n","/**\n * 見せ方を字の大きさで選ぶ。\n *\n * 全体を枠の幅へ収めた時の箱の名前の字が 10.5px 以上なら、全体を止めて中だけ動かす (`fixed`)。\n * 下回るなら、動く所へ寄って追い、隅の全体図で今どこかを示す (`follow`)。\n * 枠の高さを渡すと、全体を枠の幅と高さの両方へ収めた時の字で選ぶ (#3047)。高さの決まった置き場で、縦に長い図を縮めすぎないため。\n * 書き手が原本の `view` で決めた時は、字の大きさに関わらずそれに従う。\n */\nimport { READABLE_PX, TYPE } from \"./look/values\";\nimport type { Rendered } from \"./render/draw\";\nimport type { ViewMode } from \"./schema\";\n\nexport function chooseView(rendered: Pick<Rendered, \"layout\" | \"view\">, frameWidth: number, frameHeight?: number): { mode: ViewMode; textPx: number } {\n const byWidth = Math.max(0, frameWidth) / rendered.layout.width;\n const scale = frameHeight === undefined ? byWidth : Math.min(byWidth, Math.max(0, frameHeight) / rendered.layout.height);\n const textPx = scale * TYPE.boxName.size;\n if (rendered.view) return { mode: rendered.view, textPx };\n return { mode: textPx >= READABLE_PX ? \"fixed\" : \"follow\", textPx };\n}\n","/**\n * 頁に図を置いて動かす。\n *\n * 動きを嫌う設定 (`prefers-reduced-motion: reduce`) は描く前に読み、その人には一瞬も自動再生せず、\n * 段ごとの止め絵を釦で送る。各段の題と本文と出典は、読み上げの道具が段の順に読める番号付きの一覧として置き、\n * 図そのものは読み上げから隠して同じ中身を 2 度読ませない。\n * 見せ方は枠の幅で選び (`view.ts`)、寄って追う時は窓と全体図で描き直す。\n * 釦と段の一覧の読み上げの名前と全体図の札は、渡した言葉 (`options.lang`、書かなければ日本語) で出す (#3001)。\n * 色は `options.palette` の名前の色味に `options.colors` の色の値を重ね、図と全体図と釦と段の帯を同じ色で塗る (#3198)。\n * 段が替わるたびに `options.onStep` で今の段を知らせ、頁の側が段の札や進み具合を出せるようにする (#3031)。\n * 置いた時に流さず決めた段で止めて置く (`options.pausedAt`) ことと、1 度だけ流して最後の段で止める (`options.playOnce`) ことを選べる。\n * 止め絵を選んだ図 (`options.still`) は、最後の段で止まった時に全ての段の線の名前を出す (#3200)。\n * 頁は `goTo` で段へ移って止め、`mark` で図の上に点線の四角を描く。頁の側では SVG を組まないので、編集画面が字の重なりを囲む時もこれを呼ぶ (#3178)。\n * 段の本文の帯は本文の最も長い段の高さに保ち、段を送っても図の大きさと位置を変えない (#3049)。\n * 帯の中身の幅が `LOOK.player.narrow` より狭い時は、段を送る釦を指で押せる大きさにして段の番号と上の段に並べ、\n * 題と本文をその下の段の全幅に置く (#3057、#3069)。\n */\nimport { FIGURE_TEXT } from \"./figure-text\";\nimport type { Rect } from \"./layout/scene\";\nimport { FONT_VARS, LOOK, paletteVars, type TextStyle, TYPE } from \"./look/values\";\nimport { drawSvg, paletteOf, type RenderOptions, renderDiagram } from \"./render/draw\";\nimport type { Span } from \"./timeline\";\nimport { chooseView } from \"./view\";\n\nexport interface PlayerOptions extends RenderOptions {\n /** 段が替わるたびに今の段 (0 から) を受け取る。置いた時にも最初の段で 1 度呼ぶ。頁の側で段の札や進み具合を出す時に使う (#3031) */\n onStep?: (step: number) => void;\n /**\n * 図を、図の枠の中で見える高さに収める (#3047)。高さに収めると字が読めない図は寄って追う図にし、寄って追う窓と全体図をその高さに収める。\n * 枠の高さが決まっている置き場 (カタログの拡大の重ね窓) で使う。枠の高さが図に合わせて伸びる置き場で使うと、描くたびに低くなる\n */\n fitHeight?: boolean;\n /** 置いた時に流さず、段 `pausedAt` (0 から) の止め絵で止めて置く。段の数を超えた時は最後の段で止める。書かなければ置いた時から流す (#3200) */\n pausedAt?: number;\n /** 流した時に最後の段の止め絵で止め、繰り返さない。最後の段で止まった図を流すと、最初の段から流し直す (#3200) */\n playOnce?: boolean;\n}\n\nexport interface Player {\n /** 今の段 (0 から) */\n readonly step: number;\n /** 動いているか */\n readonly playing: boolean;\n next(): void;\n prev(): void;\n play(): void;\n pause(): void;\n /** 段 `step` (0 から) へ移って止める。段の数を超えた時は最後の段で止める (#3178) */\n goTo(step: number): void;\n /** 図の上に点線の四角を描く。四角は図の座標で渡し、空を渡すと消す。図を置き直しても残る (#3178) */\n mark(rects: readonly Rect[]): void;\n destroy(): void;\n}\n\nconst font = (t: TextStyle): string => `font:${t.weight} ${t.size}px var(--${t.family})`;\nconst px = (v: number): string => `${v}px`;\n\nfunction playerCss(): string {\n const P = LOOK.player;\n const hidden = px(P.hidden);\n return [\n `.dg-player{display:flex;flex-direction:column;gap:${px(P.gap)};color:var(--ink)}`,\n `.dg-player .dg-frame{border-radius:${px(P.radius)};overflow:hidden}`,\n // 並べ方は帯の中身の幅で選ぶ。帯の中の 1 段 (`.dg-row`) が並べ替わり、帯の左右の余白は置いた頁が帯に付ける\n `.dg-bar{container:dg-bar/inline-size}`,\n `.dg-row{display:flex;align-items:flex-start;gap:${px(P.gap)}}`,\n `.dg-btns{display:flex;gap:${px(P.gap / 2)};flex:none}`,\n `.dg-btn{width:${px(P.button)};height:${px(P.button)};border-radius:${px(P.radius)};border:${px(LOOK.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${font(TYPE.button)};cursor:pointer}`,\n `.dg-btn:focus-visible{outline:${px(P.focus)} solid var(--c-blue);outline-offset:${px(P.focus)}}`,\n `.dg-say{display:flex;gap:${px(P.gap)};min-width:0}`,\n `.dg-no{${font(TYPE.stepNo)};color:var(--mute);padding-top:${px(P.focus)}}`,\n `.dg-txt{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}`,\n `.dg-txt>*{grid-area:1/1}`,\n `.dg-room{visibility:hidden}`,\n `.dg-tt{${font(TYPE.stepTitle)};margin:0}`,\n `.dg-tb{${font(TYPE.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,\n `.dg-sr{position:absolute;width:${hidden};height:${hidden};margin:-${hidden};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`,\n // 狭い帯 (携帯の幅) では、段を送る釦を指で押せる大きさにし、その横に番号を置き、\n // 題を 2 段目、本文を 3 段目に置いてどちらも帯の全幅を使う (#3057、#3069)。\n // 釦を大きくすると横に題を置く幅が足りず題が細かく折れるため、題は釦の段に置かない。\n // 題と本文を包む箱を外して写しも同じ升に重ねるので、2 段目は最も高い題、3 段目は最も長い本文の高さになる。\n // 題と本文の間は広い帯と同じく空けず、釦の段の下にだけ間を取って、帯が高くなる分を抑える\n `@container dg-bar (width < ${px(P.narrow)}){` +\n `.dg-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:0 ${px(P.gap)}}` +\n `.dg-say,.dg-txt,.dg-txt>*{display:contents}` +\n `.dg-btns{grid-area:1/1;margin-bottom:${px(P.gap / 2)}}` +\n `.dg-btn{width:${px(P.touch)};height:${px(P.touch)}}` +\n `.dg-no{grid-area:1/2;display:flex;align-items:center;min-height:${px(P.touch)};padding-top:0}` +\n `.dg-tt{grid-area:2/1/3/3}` +\n `.dg-tb{grid-area:3/1/4/3}` +\n `}`,\n // 指で触る時は、広い帯でも段を送る釦を指で押せる大きさにする (#3076)。並びは横 1 列のまま変えない。\n // 広い帯は本文が 2 行あれば帯の高さが変わらず、本文の無い帯だけが釦の分だけ高くなる\n `@media (pointer: coarse){.dg-btn{width:${px(P.touch)};height:${px(P.touch)}}}`,\n `.dg-spot{fill:none;stroke:var(--t-amber);stroke-width:${px(LOOK.stroke.mark)};stroke-dasharray:${LOOK.mark.dash} ${LOOK.mark.gap};pointer-events:none}`,\n ].join(\"\");\n}\n\nfunction ensureCss(doc: Document): void {\n if (doc.getElementById(\"dragon-player-css\")) return;\n const style = doc.createElement(\"style\");\n style.id = \"dragon-player-css\";\n style.textContent = playerCss();\n doc.head.appendChild(style);\n}\n\n/** 釦に出す字。HTML に書き出す時は、この字も字の file に残す。 */\nexport const BUTTON_TEXT = { prev: \"‹\", pause: \"❚❚\", play: \"▶\", next: \"›\" } as const;\n\n/** 図の上に四角を描く時の SVG の名前空間 */\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nconst pad = (n: number): string => String(n).padStart(2, \"0\");\n/** 段の番号の札 (`01/12`)。`step` は 0 から数える。 */\nexport const stepNo = (step: number, count: number): string => `${pad(step + 1)}/${pad(count)}`;\n\nexport function mountDiagram(host: HTMLElement, diagram: unknown, options: PlayerOptions = {}): Player {\n const doc = host.ownerDocument;\n const win = doc.defaultView;\n // 描く前に読む。描いた後に読むと、動きを嫌う人にも一瞬だけ流れてしまう\n const reduce = Boolean(win?.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches);\n const rendered = renderDiagram(diagram, options);\n const lang = options.lang ?? \"ja\";\n const words = FIGURE_TEXT[lang];\n const palette = paletteOf(options, rendered.theme);\n const { timeline } = rendered;\n const steps = rendered.diagram.steps;\n const count = steps.length;\n\n ensureCss(doc);\n const root = doc.createElement(\"div\");\n root.className = \"dg-player\";\n root.dataset.dragon = \"player\";\n root.setAttribute(\"style\", `${FONT_VARS};${paletteVars(palette, rendered.theme)}`);\n\n const frame = doc.createElement(\"div\");\n frame.className = \"dg-frame\";\n const button = (name: string, label: string, text: string): HTMLButtonElement => {\n const b = doc.createElement(\"button\");\n b.type = \"button\";\n b.className = \"dg-btn\";\n b.dataset.dragon = name;\n b.setAttribute(\"aria-label\", label);\n b.textContent = text;\n return b;\n };\n const prevButton = button(\"prev\", words.prev, BUTTON_TEXT.prev);\n const toggleButton = button(\"toggle\", words.pause, BUTTON_TEXT.pause);\n const nextButton = button(\"next\", words.next, BUTTON_TEXT.next);\n const buttons = doc.createElement(\"div\");\n buttons.className = \"dg-btns\";\n // 置いた頁の言葉と違っても、釦の名前を名前の言葉の声で読ませる\n buttons.setAttribute(\"lang\", lang);\n buttons.append(prevButton, toggleButton, nextButton);\n\n // 見える語り。読み上げには下の一覧を読ませるので、こちらは読み上げから隠す\n const say = doc.createElement(\"div\");\n say.className = \"dg-say\";\n say.setAttribute(\"aria-hidden\", \"true\");\n const no = doc.createElement(\"div\");\n no.className = \"dg-no\";\n no.dataset.dragon = \"step-no\";\n const text = doc.createElement(\"div\");\n text.className = \"dg-txt\";\n const title = doc.createElement(\"p\");\n title.className = \"dg-tt\";\n title.dataset.dragon = \"step-title\";\n const body = doc.createElement(\"p\");\n body.className = \"dg-tb\";\n body.dataset.dragon = \"step-body\";\n const live = doc.createElement(\"div\");\n live.append(title, body);\n text.append(live);\n // 全部の段の題と本文の写しを今の段と同じ升に重ね、見た目からは隠して場所だけを取る。\n // 帯の高さが本文の最も長い段で決まり、段を送っても図の枠が伸び縮みしない (#3049)\n for (const step of steps) {\n const room = doc.createElement(\"div\");\n room.className = \"dg-room\";\n room.dataset.dragon = \"caption-room\";\n const roomTitle = doc.createElement(\"p\");\n roomTitle.className = \"dg-tt\";\n roomTitle.textContent = step.title;\n const roomBody = doc.createElement(\"p\");\n roomBody.className = \"dg-tb\";\n roomBody.textContent = step.body;\n room.append(roomTitle, roomBody);\n text.append(room);\n }\n say.append(no, text);\n // 狭い帯では語りの箱を外して番号と題と本文を釦と同じ升の並びに置く (#3057)。\n // 箱を外した要素の読み上げからの隠し方に頼らず、見える語りの 1 つずつも読み上げから隠す\n for (const shown of [no, title, body]) shown.setAttribute(\"aria-hidden\", \"true\");\n const row = doc.createElement(\"div\");\n row.className = \"dg-row\";\n row.append(buttons, say);\n const bar = doc.createElement(\"div\");\n bar.className = \"dg-bar\";\n bar.append(row);\n\n // 読み上げの道具が段の順に読む一覧。見た目からは外すが、読み上げからは隠さない。\n // 段の出典は本文の後ろに、名前を URL への link にして書いた順に並べる (#3199)\n const list = doc.createElement(\"ol\");\n list.className = \"dg-sr\";\n list.dataset.dragon = \"steps\";\n list.setAttribute(\"aria-label\", words.steps(rendered.diagram.title));\n for (const step of steps) {\n const item = doc.createElement(\"li\");\n const head = doc.createElement(\"strong\");\n head.textContent = step.title;\n item.append(head);\n for (const line of step.body.split(\"\\n\")) {\n const p = doc.createElement(\"p\");\n p.textContent = line;\n item.append(p);\n }\n if (step.sources) {\n const sources = doc.createElement(\"ul\");\n for (const source of step.sources) {\n const link = doc.createElement(\"a\");\n link.href = source.url;\n link.textContent = source.name;\n const entry = doc.createElement(\"li\");\n entry.append(link);\n sources.append(entry);\n }\n item.append(sources);\n }\n list.append(item);\n }\n\n root.append(frame, bar, list);\n host.append(root);\n\n const frameWidth = (): number => frame.clientWidth || host.clientWidth || rendered.layout.width;\n /** 高さに収めると頼まれた時だけ、図の枠の中で見える高さ (上下の余白を除く)。測れない時は `undefined` で、幅だけで決める */\n const frameHeight = (): number | undefined => {\n if (!options.fitHeight || !win) return undefined;\n const style = win.getComputedStyle(frame);\n const inner = frame.clientHeight - (Number.parseFloat(style.paddingTop) || 0) - (Number.parseFloat(style.paddingBottom) || 0);\n return inner > 0 ? inner : undefined;\n };\n let mode = chooseView(rendered, frameWidth(), frameHeight()).mode;\n let width = frameWidth();\n let height = frameHeight();\n let svg: SVGSVGElement | null = null;\n // 止めて置く段を渡された図は、動きを嫌う人と同じく止め絵で置く\n let step = options.pausedAt === undefined ? 0 : Math.min(count - 1, Math.max(0, options.pausedAt));\n let playing = !reduce && options.pausedAt === undefined;\n let at = playing ? 0 : (timeline.stills[step] ?? 0);\n /** 1 度だけ流す図が止まる時刻 (最後の段の止め絵) */\n const lastStill = timeline.stills[count - 1] ?? 0;\n let born = Date.now();\n let marked: readonly Rect[] = [];\n\n /**\n * 渡された四角を点線で囲む。寄って追う図では窓の中身と一緒に動く所に置き、止めて見せる図では図の上に置く。\n * 囲みは字の四角より `LOOK.mark.pad` だけ広げ、字の縁に線が掛からないようにする\n */\n const drawMarks = (): void => {\n if (!svg) return;\n for (const old of svg.querySelectorAll(\".dg-spots\")) old.remove();\n if (marked.length === 0) return;\n const M = LOOK.mark;\n const group = doc.createElementNS(SVG_NS, \"g\");\n group.setAttribute(\"class\", \"dg-spots\");\n for (const r of marked) {\n const rect = doc.createElementNS(SVG_NS, \"rect\");\n rect.setAttribute(\"class\", \"dg-spot\");\n rect.setAttribute(\"x\", String(r.x - M.pad));\n rect.setAttribute(\"y\", String(r.y - M.pad));\n rect.setAttribute(\"width\", String(r.w + M.pad * 2));\n rect.setAttribute(\"height\", String(r.h + M.pad * 2));\n rect.setAttribute(\"rx\", String(M.radius));\n group.append(rect);\n }\n (svg.querySelector('g[clip-path^=\"url(#dg-vp-\"] > g.dg-a') ?? svg).append(group);\n };\n\n /** 動きの変数を付けた図を置き直す。置き直すと動きの時計が最初から数え直される */\n const place = (markup?: string): void => {\n let next: SVGSVGElement | null;\n if (markup !== undefined) {\n const holder = doc.createElement(\"div\");\n holder.innerHTML = markup;\n next = holder.querySelector(\"svg\");\n } else {\n next = svg ? (svg.cloneNode(true) as SVGSVGElement) : null;\n }\n if (!next) return;\n next.setAttribute(\"aria-hidden\", \"true\");\n next.removeAttribute(\"role\");\n next.removeAttribute(\"aria-label\");\n next.style.setProperty(\"--at\", String(at));\n next.style.setProperty(\"--play\", playing ? \"running\" : \"paused\");\n next.dataset.motion = playing ? \"play\" : \"still\";\n if (svg) svg.replaceWith(next);\n else frame.append(next);\n svg = next;\n born = Date.now();\n drawMarks();\n };\n const markup = (): string => (mode === \"follow\" ? drawSvg(rendered.diagram, rendered.layout, timeline, palette, rendered.theme, { width, ...(height === undefined ? {} : { height }), lang }) : rendered.svg);\n\n const now = (): number => (playing ? (at + (Date.now() - born) / 1000) % timeline.total : at);\n const stepAt = (t: number): number => {\n let found = 0;\n timeline.steps.forEach((span: Span, i) => {\n if (span.start <= t) found = i;\n });\n return found;\n };\n const show = (): void => {\n const current = steps[step];\n no.textContent = stepNo(step, count);\n title.textContent = current?.title ?? \"\";\n body.textContent = current?.body ?? \"\";\n toggleButton.setAttribute(\"aria-label\", playing ? words.pause : words.play);\n toggleButton.textContent = playing ? BUTTON_TEXT.pause : BUTTON_TEXT.play;\n options.onStep?.(step);\n };\n const restart = (t: number, play: boolean): void => {\n at = t;\n playing = play;\n place();\n show();\n };\n const go = (target: number): void => {\n step = Math.min(count - 1, Math.max(0, target));\n const span = timeline.steps[step] as Span;\n restart(playing ? span.start : (timeline.stills[step] ?? span.start), playing);\n };\n\n /** 流し始める。1 度だけ流す図が最後の段の止め絵まで来ていれば、最初の段から流し直す */\n const resume = (): void => {\n if (options.playOnce && at >= lastStill) {\n step = 0;\n at = 0;\n }\n restart(at, true);\n };\n\n place(markup());\n show();\n\n const timer = win?.setInterval(() => {\n if (!playing) return;\n // 1 度だけ流す図は、1 周の中の時刻に直す前の経った時間で最後の段の止め絵まで来たかを見る\n if (options.playOnce && at + (Date.now() - born) / 1000 >= lastStill) {\n step = count - 1;\n restart(lastStill, false);\n return;\n }\n const s = stepAt(now());\n if (s !== step) {\n step = s;\n show();\n }\n }, 120);\n const onPrev = (): void => go(step - 1);\n const onNext = (): void => go(step + 1);\n const onToggle = (): void => (playing ? restart(now(), false) : resume());\n // 段の番号を押すとその段へ移る\n const onFigure = (event: Event): void => {\n const target = (event.target as Element | null)?.closest?.(\"[data-step]\");\n const s = target ? Number(target.getAttribute(\"data-step\")) : Number.NaN;\n if (Number.isInteger(s)) go(s);\n };\n prevButton.addEventListener(\"click\", onPrev);\n nextButton.addEventListener(\"click\", onNext);\n toggleButton.addEventListener(\"click\", onToggle);\n frame.addEventListener(\"click\", onFigure);\n\n // 枠の大きさが変わったら見せ方を選び直す。寄って追う窓は幅 (高さに収める時は高さも) で決まるので、変われば描き直す\n const Observer = (win as (Window & { ResizeObserver?: typeof ResizeObserver }) | null)?.ResizeObserver;\n const observer = Observer\n ? new Observer(() => {\n const w = frameWidth();\n const h = frameHeight();\n const chosen = chooseView(rendered, w, h).mode;\n if (chosen === mode && (mode === \"fixed\" || (w === width && h === height))) return;\n const t = now();\n mode = chosen;\n width = w;\n height = h;\n at = t;\n place(markup());\n })\n : undefined;\n observer?.observe(frame);\n\n return {\n get step() {\n return step;\n },\n get playing() {\n return playing;\n },\n next: onNext,\n prev: onPrev,\n play: () => {\n if (!playing) resume();\n },\n pause: () => {\n if (playing) restart(now(), false);\n },\n goTo: (target: number) => {\n playing = false;\n go(target);\n },\n mark: (rects: readonly Rect[]) => {\n marked = rects;\n drawMarks();\n },\n destroy: () => {\n if (timer !== undefined) win?.clearInterval(timer);\n observer?.disconnect();\n prevButton.removeEventListener(\"click\", onPrev);\n nextButton.removeEventListener(\"click\", onNext);\n toggleButton.removeEventListener(\"click\", onToggle);\n frame.removeEventListener(\"click\", onFigure);\n root.remove();\n },\n };\n}\n","/**\n * dragon の軽い入口 (`@cardenelabs/dragon/light`、#3248)。\n *\n * 既定の入口と同じ部品を出すが、git、lineup、state、time、tree の描く部品を持たず、`loadKind` を待った時に読む。\n * 読んだ後は既定の入口と同じ関数で、待たずに同じ図を描く。読んでいない種類を描くと、その種類の名前を含む誤りで止まる。\n * 最初に読む量を抑えたい頁を束ねる時に使い、この入口と既定の入口を 1 つの頁で混ぜない (混ぜると全ての部品が頁に入る)。\n */\nimport { kindLoaded, LATER_KINDS, type LaterKind, type LaterKinds, registerKind } from \"./kinds/registry\";\n\nexport * from \"./api\";\nexport { kindLoaded, LATER_KINDS, type LaterKind };\n\nconst LOADERS: { [K in LaterKind]: () => Promise<LaterKinds[K]> } = {\n git: () => import(\"./kinds/git\"),\n lineup: () => import(\"./kinds/lineup\"),\n state: () => import(\"./kinds/state\"),\n time: () => import(\"./kinds/time\"),\n tree: () => import(\"./kinds/tree\"),\n};\n\nconst isLater = (kind: string | undefined): kind is LaterKind => (LATER_KINDS as readonly (string | undefined)[]).includes(kind);\n\n/** 種類の描く部品を読む。時系列図と構成図は初めから持つので何もしない。読み込みが落ちると拒否され、次に呼ぶと読み直す */\nexport async function loadKind(kind: string | undefined): Promise<void> {\n if (!isLater(kind) || kindLoaded(kind)) return;\n await register(kind);\n}\n\nasync function register<K extends LaterKind>(kind: K): Promise<void> {\n registerKind(kind, await LOADERS[kind]());\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/cardene/Desktop/projects/dragon-3276-release-0-45-3/packages/dragon/dist/light/index.cjs","../../src/kinds/registry.ts","../../src/markdown.ts","../../src/field-messages.ts","../../src/schemas/validate-diagram.js","../../src/schema.ts","../../src/messages.ts","../../src/tokenize.ts","../../src/version.ts","../../src/parser.ts","../../src/printer.ts","../../src/layout/architecture.ts","../../src/layout/sequence.ts","../../src/timeline.ts","../../src/render/motion.ts","../../src/render/draw.ts","../../src/view.ts","../../src/player.ts","../../src/light.ts"],"names":["key","value","name","field","line","list","attrs","strip","side","row","edge","label","contentBottom","band","event","action","shown","badge","k","f","r","text","step","markup"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACtEO,IAAM,YAAA,EAAoC,CAAC,KAAA,EAAO,QAAA,EAAU,OAAA,EAAS,MAAA,EAAQ,MAAM,CAAA;AAE1F,IAAM,WAAA,EAAkC,CAAC,CAAA;AAElC,SAAS,YAAA,CAAkC,IAAA,EAAS,KAAA,EAA4B;AACrF,EAAA,U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AAA;AACmB,MAAA;AACnB,IAAA;AACmB,MAAA;AACnB,IAAA;AACmB,MAAA;AACnB,IAAA;AACmB,MAAA;AACxB,IAAA;AACwB,MAAA;AAC1B,EAAA;AACF;AAGgC;AACjB,EAAA;AACD,EAAA;AACiB,EAAA;AACJ,EAAA;AAEE,EAAA;AACA,EAAA;AAC7B;ALmpM+B;AACA;AMt3M0B;AAE9B;AACa,EAAA;AAC1B,IAAA;AACI,IAAA;AACP,IAAA;AACF,IAAA;AACE,IAAA;AACD,IAAA;AACA,IAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACP,EAAA;AACO,EAAA;AACG,IAAA;AACC,IAAA;AACiB,IAAA;AACA,IAAA;AACF,IAAA;AACE,IAAA;AACN,IAAA;AACX,IAAA;AACiB,IAAA;AACP,IAAA;AACH,IAAA;AACP,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACE,IAAA;AACM,IAAA;AACC,IAAA;AACP,IAAA;AACH,IAAA;AACO,IAAA;AACM,IAAA;AACC,IAAA;AACA,IAAA;AACZ,IAAA;AACA,IAAA;AACK,IAAA;AACA,IAAA;AACO,IAAA;AACP,IAAA;AACP,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACG,IAAA;AACH,IAAA;AACE,IAAA;AACY,IAAA;AACDD,IAAAA;AACFA,IAAAA;AACR,IAAA;AACM,IAAA;AACF,IAAA;AACE,IAAA;AACF,IAAA;AACI,IAAA;AACX,IAAA;AACa,IAAA;AACd,IAAA;AACE,IAAA;AACA,IAAA;AACa,IAAA;AACd,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACF,IAAA;AACe,IAAA;AACA,IAAA;AACH,IAAA;AACG,IAAA;AACF,IAAA;AACA,IAAA;AACf,IAAA;AACkB,IAAA;AACA,IAAA;AACd,IAAA;AACH,IAAA;AACC,IAAA;AACA,IAAA;AACe,IAAA;AACD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACV,IAAA;AACD,IAAA;AACD,IAAA;AACJ,IAAA;AACE,IAAA;AACA,IAAA;AACa,IAAA;AACZ,IAAA;AACa,IAAA;AACA,IAAA;AACD,IAAA;AACG,IAAA;AACA,IAAA;AACH,IAAA;AACG,IAAA;AACH,IAAA;AACf,IAAA;AACD,IAAA;AACI,IAAA;AACC,IAAA;AACH,IAAA;AACE,IAAA;AACD,IAAA;AACD,IAAA;AACC,IAAA;AACA,IAAA;AACA,IAAA;AACgB,IAAA;AACD,IAAA;AACH,IAAA;AACE,IAAA;AACjB,IAAA;AACM,IAAA;AACE,IAAA;AACD,IAAA;AACJ,IAAA;AACe,IAAA;AACC,IAAA;AACDE,IAAAA;AACN,IAAA;AACC,IAAA;AACX,IAAA;AACgBC,IAAAA;AAC5B,EAAA;AACF;AAE2B;AACa,EAAA;AAC1B,IAAA;AACI,IAAA;AACP,IAAA;AACF,IAAA;AACE,IAAA;AACD,IAAA;AACA,IAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACC,IAAA;AACD,IAAA;AACP,EAAA;AACO,EAAA;AACG,IAAA;AACC,IAAA;AACiB,IAAA;AACH,IAAA;AACC,IAAA;AACL,IAAA;AACC,IAAA;AACX,IAAA;AACc,IAAA;AACJ,IAAA;AACH,IAAA;AACP,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACA,IAAA;AACE,IAAA;AACM,IAAA;AACC,IAAA;AACP,IAAA;AACH,IAAA;AACO,IAAA;AACM,IAAA;AACC,IAAA;AACA,IAAA;AACZ,IAAA;AACA,IAAA;AACK,IAAA;AACA,IAAA;AACO,IAAA;AACP,IAAA;AACP,IAAA;AACC,IAAA;AACA,IAAA;AACC,IAAA;AACG,IAAA;AACH,IAAA;AACE,IAAA;AACY,IAAA;AACJ,IAAA;AACF,IAAA;AACL,IAAA;AACL,IAAA;AACiB,IAAA;AACjB,IAAA;AACiB,IAAA;AACV,IAAA;AACL,IAAA;AAC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G2B,EAAA;AACD,IAAA;AACf,MAAA;AACF,MAAA;AACP,IAAA;AACgB,IAAA;AAClB,EAAA;AAEc,EAAA;AACT,EAAA;AAEc,EAAA;AACH,IAAA;AAEU,IAAA;AACP,MAAA;AACS,MAAA;AACxB,MAAA;AACF,IAAA;AACsB,IAAA;AACN,IAAA;AACP,MAAA;AACF,MAAA;AACP,IAAA;AACI,EAAA;AACwB,EAAA;AACA,EAAA;AACA,EAAA;AAEW,EAAA;AACjB,IAAA;AACI,IAAA;AACD,IAAA;AAC3B,EAAA;AAC4B,EAAA;AACA,EAAA;AACf,EAAA;AACU,EAAA;AAGiE,EAAA;AAEpF,EAAA;AACuB,IAAA;AACC,IAAA;AACI,IAAA;AACF,IAAA;AACV,IAAA;AACP,IAAA;AACC,IAAA;AACC,IAAA;AACJ,IAAA;AACS,IAAA;AAEhB,EAAA;AACmB,kBAAA;AAEhB,EAAA;AACM,IAAA;AACF,MAAA;AACT,IAAA;AACc,IAAA;AACL,MAAA;AACT,IAAA;AACM,IAAA;AACA,IAAA;AACM,IAAA;AACW,MAAA;AACvB,IAAA;AACa,IAAA;AACc,MAAA;AAC3B,IAAA;AAC0B,IAAA;AACd,MAAA;AACD,MAAA;AACX,IAAA;AACkC,IAAA;AACvB,MAAA;AACC,MAAA;AACZ,IAAA;AACe,IAAA;AACY,MAAA;AACJ,sBAAA;AACV,MAAA;AACA,MAAA;AACE,MAAA;AACP,MAAA;AACM,MAAA;AACd,IAAA;AACF,EAAA;AACF;AjB0tS+B;AACA;AkBtnTqC;AAChD,EAAA;AACG,EAAA;AACD,EAAA;AACD,EAAA;AACA,EAAA;AACrB;AAEkE;AAGM;AAChD,EAAA;AACH,EAAA;AACrB;AAEqE;AAC1C,EAAA;AAC3B;AlBonT+B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/cardene/Desktop/projects/dragon-3276-release-0-45-3/packages/dragon/dist/light/index.cjs","sourcesContent":[null,"/**\n * 図の種類ごとの描く部品の登録簿 (#3248)。\n *\n * 描く所 (`render/draw.ts`) は git、lineup、state、time、tree の部品をここから引く。\n * 全部入りの入口は読み込みの時に全ての種類を登録し (`all.ts`)、軽い入口は `loadKind` が種類を読んだ時に登録する (`light.ts`)。\n * 時系列図と構成図の部品は登録せず、描く所が直に読む。\n */\nimport { FIGURE_TEXT } from \"../figure-text\";\nimport type { NotationLang } from \"../words\";\nimport type * as git from \"./git\";\nimport type * as lineup from \"./lineup\";\nimport type * as state from \"./state\";\nimport type * as time from \"./time\";\nimport type * as tree from \"./tree\";\n\n/** 後から読む種類の名前。部品の型から導くと、部品の型が軽い入口の型の file へ漏れるので字で書く */\nexport type LaterKind = \"git\" | \"lineup\" | \"state\" | \"time\" | \"tree\";\n\nexport interface LaterKinds {\n git: typeof git;\n lineup: typeof lineup;\n state: typeof state;\n time: typeof time;\n tree: typeof tree;\n}\n\n/** 後から読む種類 */\nexport const LATER_KINDS: readonly LaterKind[] = [\"git\", \"lineup\", \"state\", \"time\", \"tree\"];\n\nconst registered: Partial<LaterKinds> = {};\n\nexport function registerKind<K extends LaterKind>(kind: K, parts: LaterKinds[K]): void {\n registered[kind] = parts;\n}\n\n/** 種類の部品を今すぐ描ける形で持っているか。時系列図と構成図は常に持つ */\nexport function kindLoaded(kind: string | undefined): boolean {\n return !(LATER_KINDS as readonly (string | undefined)[]).includes(kind) || registered[kind as LaterKind] !== undefined;\n}\n\n/** 種類の部品。読んでいない時は、種類の名前を含む誤りで止まる */\nexport function kindParts<K extends LaterKind>(kind: K, lang: NotationLang = \"ja\"): LaterKinds[K] {\n const parts = registered[kind];\n if (parts === undefined) throw new Error(FIGURE_TEXT[lang].kindNotLoaded(kind));\n return parts;\n}\n","/**\n * Markdown の中の dragon の囲み (```dragon) を、囲みごとに取り出す。\n *\n * 囲みの開き方と閉じ方は CommonMark に従う。` か ~ を 3 つ以上並べて開き、同じ字を開いた数以上\n * 並べて閉じる。閉じていない囲みは文書の終わりまでを中身にする。dragon 以外の言語の囲みの中は読まない。\n */\nexport interface Fence {\n /** 囲みの中身 (記法) */\n source: string;\n /** 中身の 1 行目が文書の何行目か。記法の誤りの行を文書の行に直す時に足す */\n line: number;\n}\n\nexport function extractDiagrams(markdown: string): Fence[] {\n const lines = markdown.split(/\\r?\\n/);\n if (lines[lines.length - 1] === \"\") lines.pop();\n const fences: Fence[] = [];\n let open: { mark: string; dragon: boolean; start: number; body: string[] } | undefined;\n lines.forEach((text, index) => {\n if (!open) {\n const found = /^ {0,3}(`{3,}|~{3,})\\s*([^\\s`]*)/.exec(text);\n if (found) open = { mark: found[1] ?? \"\", dragon: found[2] === \"dragon\", start: index + 2, body: [] };\n return;\n }\n const close = /^ {0,3}(`{3,}|~{3,})\\s*$/.exec(text)?.[1];\n if (close !== undefined && close[0] === open.mark[0] && close.length >= open.mark.length) {\n if (open.dragon) fences.push({ source: open.body.join(\"\\n\"), line: open.start });\n open = undefined;\n return;\n }\n open.body.push(text);\n });\n if (open?.dragon) fences.push({ source: open.body.join(\"\\n\"), line: open.start });\n return fences;\n}\n","/**\n * 原本の JSON の誤りの文 (#2999)。\n *\n * JSON は語を持たず file から言葉を決められないので、呼ぶ側 (頁なら頁の言葉) が言葉を渡す。\n * 文は schema が使う決まり (JSON Schema の keyword) ごとに持ち、ajv の英語の文はそのまま出さない。\n * schema に決まりを足して文が無い時は、`every-schema-keyword-has-messages` の検査が落ちる。\n */\nimport type { NotationLang } from \"./words\";\n\n/** `^[^…]+$` の形の決まりが書けないとする字。`space` は空白 (`\\s`) */\nexport interface Forbidden {\n space: boolean;\n chars: string[];\n}\n\n/** 書けない組み合わせ (`not`) の欄と、その欄を書ける時の `kind` の値 */\nexport interface Allowed {\n field: string;\n kind: string;\n}\n\nexport interface FieldMessages {\n additionalProperties: (key: string) => string;\n required: (key: string) => string;\n enum: (values: readonly string[]) => string;\n type: (type: string) => string;\n minLength: (limit: number) => string;\n maxLength: (limit: number) => string;\n /** 書けない字を読めない形の決まりでは `undefined` */\n pattern: (forbidden: Forbidden | undefined) => string;\n minItems: (limit: number) => string;\n maxItems: (limit: number) => string;\n minimum: (limit: number) => string;\n const: (value: string) => string;\n /** どの欄の組み合わせか判らない場所では `undefined` */\n not: (allowed: Allowed | undefined) => string;\n /** 状態遷移図の箱の名札に、始まりと終わりの印の名前 (`names`) を書いた */\n reserved: (names: readonly string[]) => string;\n /** `kind` の図だけが書ける出来事の種類 (`types`) を、別の種類の図に書いた (#3164) */\n kindOnly: (types: readonly string[], kind: string) => string;\n /** 16 進の字を `min` から `max` 字で書く決まり (commit の hash、#3164) */\n hex: (min: number, max: number) => string;\n /** 数と単位 (`units`) の組で書く決まり (時間軸の図の目盛りの長さ、#3165) */\n duration: (units: readonly string[]) => string;\n /** 分数か百分率で書く決まり (物差しの線、#3165) */\n ratio: string;\n /** 頁を移る形だけを書ける決まり (箱の飛び先と段の出典の URL、#3199) */\n url: string;\n /** 選べる決まりがどれも欄が足りない時の、足りない欄。それ以外の時は空 */\n anyOf: (fields: readonly string[]) => string;\n oneOf: string;\n discriminator: (tag: string, values: readonly string[]) => string;\n /** 道具より新しい版の図 */\n newer: (version: number, tool: number) => string;\n}\n\nconst TYPES_JA: Record<string, string> = {\n string: \"文字列にする\",\n integer: \"整数にする\",\n number: \"数にする\",\n object: \"オブジェクトにする\",\n array: \"配列にする\",\n boolean: \"true か false にする\",\n null: \"null にする\",\n};\n\nconst TYPES_EN: Record<string, string> = {\n string: \"Use a string\",\n integer: \"Use an integer\",\n number: \"Use a number\",\n object: \"Use an object\",\n array: \"Use an array\",\n boolean: \"Use true or false\",\n null: \"Use null\",\n};\n\nconst plural = (count: number, word: string): string => `${count} ${word}${count === 1 ? \"\" : \"s\"}`;\n\nconst ja: FieldMessages = {\n additionalProperties: (key) => `${key} という欄は書けない`,\n required: (key) => `${key} の欄が要る`,\n enum: (values) => `${values.join(\" / \")} のどれかにする`,\n type: (type) => TYPES_JA[type] ?? `${type} にする`,\n minLength: (limit) => `${limit} 字以上書く`,\n maxLength: (limit) => `${limit} 字までにする`,\n pattern: (forbidden) =>\n forbidden ? `${forbidden.space ? \"空白と \" : \"\"}${forbidden.chars.join(\" \")} は使えない` : \"使えない字が入っている\",\n minItems: (limit) => `${limit} つ以上書く`,\n maxItems: (limit) => `${limit} つまでにする`,\n minimum: (limit) => `${limit} 以上にする`,\n const: (value) => `${value} にする`,\n not: (allowed) => (allowed ? `${allowed.field} の欄は kind が ${allowed.kind} の時だけ書ける` : \"この欄の組み合わせは書けない\"),\n reserved: (names) => `${names.join(\" と \")} は状態遷移図の始まりと終わりの印の名前で、箱の名札に使えない`,\n kindOnly: (types, kind) => `${types.join(\" と \")} の出来事は kind が ${kind} の時だけ書ける`,\n hex: (min, max) => `0 から 9 と a から f の字で ${min} から ${max} 字にする`,\n duration: (units) => `数と単位 (${units.join(\" / \")}) の組で書く (12s など)`,\n ratio: \"分数 (2/3) か百分率 (97%) で書く\",\n url: \"/ で始まる path か、http:// か https:// で始まる URL にする\",\n anyOf: (fields) =>\n fields.length > 0 ? `${fields.join(\" か \")} の${fields.length === 2 ? \"どちらか\" : \"どれか\"}の欄が要る` : \"書ける形のどれにも合わない\",\n oneOf: \"書ける形のどれか 1 つだけに合わせる\",\n discriminator: (tag, values) => `${tag} は ${values.join(\" / \")} のどれかにする`,\n newer: (version, tool) => `版 ${version} の図は、この道具 (版 ${tool}) より新しいので読めない。道具を新しくする`,\n};\n\nconst en: FieldMessages = {\n additionalProperties: (key) => `The ${key} field is not allowed`,\n required: (key) => `The ${key} field is required`,\n enum: (values) => `Use one of ${values.join(\" / \")}`,\n type: (type) => TYPES_EN[type] ?? `Use ${type}`,\n minLength: (limit) => `Write at least ${plural(limit, \"character\")}`,\n maxLength: (limit) => `Write at most ${plural(limit, \"character\")}`,\n pattern: (forbidden) =>\n forbidden\n ? `Cannot contain ${forbidden.space ? \"spaces or \" : \"\"}${forbidden.chars.join(\" \")}`\n : \"Contains characters that are not allowed\",\n minItems: (limit) => `Write at least ${plural(limit, \"item\")}`,\n maxItems: (limit) => `Write at most ${plural(limit, \"item\")}`,\n minimum: (limit) => `Use ${limit} or greater`,\n const: (value) => `Use ${value}`,\n not: (allowed) => (allowed ? `The ${allowed.field} field is allowed only when kind is ${allowed.kind}` : \"This combination of fields is not allowed\"),\n reserved: (names) => `${names.join(\" and \")} name the start and end marks of a state diagram and cannot be box ids`,\n kindOnly: (types, kind) => `${types.join(\" and \")} events are allowed only when kind is ${kind}`,\n hex: (min, max) => `Use ${min} to ${max} characters of 0-9 and a-f`,\n duration: (units) => `Write a number and a unit (${units.join(\" / \")}), such as 12s`,\n ratio: \"Write a fraction (2/3) or a percentage (97%)\",\n url: \"Use a path that starts with / or a URL that starts with http:// or https://\",\n anyOf: (fields) => (fields.length > 0 ? `Write one of the ${fields.join(\" or \")} fields` : \"Does not match any of the allowed shapes\"),\n oneOf: \"Match exactly one of the allowed shapes\",\n discriminator: (tag, values) => `${tag} is one of ${values.join(\" / \")}`,\n newer: (version, tool) => `Version ${version} diagrams are newer than this tool (version ${tool}) and cannot be read. Update the tool`,\n};\n\nexport const FIELD_MESSAGES: Record<NotationLang, FieldMessages> = { ja, en };\n","/* eslint-disable */\n// packages/dragon/scripts/build-validator.mjs が diagram.schema.json から書き出した。手で直さない\nfunction ucs2length(str) {\n let length = 0;\n for (const _ of str) length++;\n return length;\n}\nexport const validate = validate10;export default validate10;const schema11 = {\"title\":\"dragon の図の原本\",\"description\":\"区画、箱、線、運ぶ物、段、中身の帯の 6 部品を共通の骨組みに置き、図の種類だけの物は種類の欄に置く。座標は持たない。箱は枝分かれの図と時間軸の図と木の図だけが持たなくてよい。列の図の箱は列になる。\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"version\",\"kind\",\"title\",\"boxes\",\"steps\"],\"properties\":{\"version\":{\"description\":\"形式の版\",\"type\":\"integer\",\"minimum\":1},\"kind\":{\"description\":\"図の種類\",\"enum\":[\"sequence\",\"architecture\",\"state\",\"git\",\"time\",\"tree\",\"lineup\"]},\"title\":{\"$ref\":\"#/definitions/text\"},\"view\":{\"description\":\"見せ方。書かなければ字の大きさで選ぶ。fixed は全体を止めて中だけ動かし、follow は寄って動かし全体図で今どこかを示す\",\"enum\":[\"fixed\",\"follow\"]},\"regions\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/region\"}},\"boxes\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/box\"}},\"strip\":{\"$ref\":\"#/definitions/strip\"},\"steps\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/step\"}},\"sequence\":{\"$ref\":\"#/definitions/sequence\"},\"state\":{\"$ref\":\"#/definitions/state\"},\"git\":{\"$ref\":\"#/definitions/git\"},\"time\":{\"$ref\":\"#/definitions/time\"},\"lineup\":{\"$ref\":\"#/definitions/lineup\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"sequence\"}}},\"then\":{\"required\":[\"sequence\"],\"properties\":{\"boxes\":{\"minItems\":1},\"steps\":{\"$ref\":\"#/definitions/plainSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"properties\":{\"sequence\":{\"$ref\":\"#/definitions/absent\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"state\"}}},\"then\":{\"properties\":{\"boxes\":{\"minItems\":1,\"items\":{\"properties\":{\"id\":{\"description\":\"始まりと終わりの印の名前は箱の名札に使えない\",\"not\":{\"enum\":[\"start\",\"finish\"]}}}}},\"steps\":{\"$ref\":\"#/definitions/plainSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"git\"}}},\"then\":{\"required\":[\"git\"],\"properties\":{\"steps\":{\"$ref\":\"#/definitions/gitSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"time\"}}},\"then\":{\"required\":[\"time\"],\"properties\":{\"steps\":{\"$ref\":\"#/definitions/timeSteps\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"tree\"}}},\"then\":{\"properties\":{\"steps\":{\"$ref\":\"#/definitions/treeSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"lineup\"}}},\"then\":{\"required\":[\"lineup\"],\"properties\":{\"boxes\":{\"minItems\":1,\"items\":{\"properties\":{\"icon\":{\"$ref\":\"#/definitions/absent\"},\"link\":{\"$ref\":\"#/definitions/absent\"},\"region\":{\"$ref\":\"#/definitions/absent\"}}}},\"steps\":{\"$ref\":\"#/definitions/lineupSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"regions\":{\"$ref\":\"#/definitions/absent\"}}},\"else\":{\"properties\":{\"boxes\":{\"minItems\":1},\"steps\":{\"$ref\":\"#/definitions/plainSteps\"},\"strip\":{\"$ref\":\"#/definitions/plainStrip\"},\"state\":{\"$ref\":\"#/definitions/absent\"},\"git\":{\"$ref\":\"#/definitions/absent\"},\"time\":{\"$ref\":\"#/definitions/absent\"},\"lineup\":{\"$ref\":\"#/definitions/absent\"}}}}}}}},\"definitions\":{\"text\":{\"type\":\"string\",\"minLength\":1},\"absent\":{\"description\":\"この図の種類では書けない欄\",\"not\":{}},\"plainSteps\":{\"description\":\"枝分かれの図でも時間軸の図でも木の図でも列の図でもない図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"gitSteps\":{\"description\":\"枝分かれの図の段。時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"timeSteps\":{\"description\":\"時間軸の図の段。枝分かれの図だけの出来事 (commit と branch) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}}}}}}}},\"treeSteps\":{\"description\":\"木の図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"lineupSteps\":{\"description\":\"列の図の段。線と処理と、枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (color) と、木の図だけの出来事 (leaf と node) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notWiredEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}},\"treeEvent\":{\"description\":\"木の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"leaf\",\"node\"]}}},\"notLineupEvent\":{\"description\":\"列の図だけが書ける出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"line\",\"seal\",\"open\",\"pick\",\"stamp\"]}}}},\"notWiredEvent\":{\"description\":\"箱と線の図の出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"edge\",\"action\"]}}}},\"timeEvent\":{\"description\":\"時間軸の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"now\",\"mark\",\"span\"]}}},\"plainStrip\":{\"description\":\"時間軸の図でない図の中身の帯。物差しを書けない\",\"properties\":{\"meters\":{\"$ref\":\"#/definitions/absent\"}}},\"id\":{\"type\":\"string\",\"pattern\":\"^[^\\\\s\\\\[\\\\]「」=:]+$\"},\"color\":{\"enum\":[\"blue\",\"amber\",\"green\",\"violet\",\"rose\",\"slate\",\"coin\"]},\"region\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"note\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"}}},\"box\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"sub\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"},\"region\":{\"$ref\":\"#/definitions/id\"},\"link\":{\"description\":\"飛び先。描いた図ではこの箱がここへの link になる\",\"$ref\":\"#/definitions/url\"}}},\"strip\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"fields\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"fields\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/text\"}},\"meters\":{\"description\":\"物差しにする欄。時間軸の図だけが書ける\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/meter\"}}}},\"meter\":{\"description\":\"物差しの欄。line の割合の所に線を引き、set の値まで針と一緒に満ちる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"field\",\"line\"],\"properties\":{\"field\":{\"$ref\":\"#/definitions/text\"},\"line\":{\"$ref\":\"#/definitions/ratio\"}}},\"ratio\":{\"description\":\"割合。分数 (2/3) か百分率 (97%)\",\"type\":\"string\",\"pattern\":\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"},\"step\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"body\",\"events\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"body\":{\"$ref\":\"#/definitions/text\"},\"code\":{\"$ref\":\"#/definitions/text\"},\"sources\":{\"description\":\"段の出典。読み上げの段の一覧に、名前を URL への link にして書いた順に出す\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/source\"}},\"events\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/event\"}}}},\"source\":{\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"url\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"url\":{\"$ref\":\"#/definitions/url\"}}},\"url\":{\"description\":\"頁を移る形。/ で始まる path か、http:// か https:// で始まる URL\",\"type\":\"string\",\"pattern\":\"^(/|https?://)\"},\"event\":{\"description\":\"段の中で起きること。起きる順に並べる\",\"type\":\"object\",\"required\":[\"type\"],\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"description\":\"線。運ぶ物を載せて送る側から受ける側へ走る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"carry\"],\"properties\":{\"type\":{\"const\":\"edge\"},\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"},\"carry\":{\"$ref\":\"#/definitions/carry\"},\"labelSide\":{\"description\":\"線の名前を置く側 (寄せの指示)\",\"enum\":[\"above\",\"below\",\"left\",\"right\"]},\"at\":{\"description\":\"時間軸の図の拡大の帯で、線を引く列の目盛り\",\"$ref\":\"#/definitions/unit\"},\"into\":{\"description\":\"時間軸の図の拡大の帯で、受ける箱を選ぶ列の目盛り。書かなければ at の列\",\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"箱の中の処理\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"label\"],\"properties\":{\"type\":{\"const\":\"action\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"箱の下の小さな字の書き換え\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"swap\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"description\":\"時間軸の図の節目の丸の色\",\"$ref\":\"#/definitions/color\"}}},{\"description\":\"commit を積む。枝分かれの図だけが書ける。積んだ枝の札と、その枝を指す HEAD が進む。当て直し (copy) は枝の札を動かさず、merge commit (merge) は取り込む枝の先端も親に持つ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"branch\"],\"properties\":{\"type\":{\"const\":\"commit\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"copy\":{\"$ref\":\"#/definitions/id\"},\"merge\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"},\"note\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"枝を切る。枝分かれの図だけが書ける。枝の札を from の commit へ置き、HEAD をその枝へ移す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"branch\",\"from\"],\"properties\":{\"type\":{\"const\":\"branch\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"時間軸の図の今の時刻の針を、to の目盛りの終わりまで進める\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"to\"],\"properties\":{\"type\":{\"const\":\"now\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"時間軸の図の印の列 row の、from から to の目盛りの印の色を変える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"row\",\"from\",\"to\",\"color\"],\"properties\":{\"type\":{\"const\":\"mark\"},\"row\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"時間軸の図の from から to の目盛りに、括弧と字を出す。shape が box なら印の列を囲み、字を縁の札にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"text\"],\"properties\":{\"type\":{\"const\":\"span\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"shape\":{\"enum\":[\"box\"]},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"葉を出す。木の図だけが書ける。書いた段で葉の箱が現れる。hash を書くと箱に値を出し、名札を葉の下の札に出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\"],\"properties\":{\"type\":{\"const\":\"leaf\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"1 つ以上の子から親を組む。木の図だけが書ける。書いた段で親の箱と、子から親への木の線が現れる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"children\"],\"properties\":{\"type\":{\"const\":\"node\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"children\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"列の box の並びを items に書き換える。列の図だけが書ける。チップは前に居た列から滑り、どの列にも居なかったチップは弾んで現れ、列から外れたチップは消える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"items\"],\"properties\":{\"type\":{\"const\":\"line\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"items\":{\"type\":\"array\",\"minItems\":1,\"maxItems\":12,\"items\":{\"$ref\":\"#/definitions/id\"}}}},{\"description\":\"列 box に封をして、チップを隠す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"seal\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の封を開ける。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"open\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box を選ぶ。列の図だけが書ける。列の縁に色が付き、ほかの列が薄くなる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"pick\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の右に text の札を押す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"stamp\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"中身の帯の欄の値と札\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"field\"],\"anyOf\":[{\"required\":[\"value\"]},{\"required\":[\"tag\"]}],\"properties\":{\"type\":{\"const\":\"strip\"},\"field\":{\"$ref\":\"#/definitions/text\"},\"value\":{\"$ref\":\"#/definitions/text\"},\"tag\":{\"$ref\":\"#/definitions/text\"}}}]},\"carry\":{\"description\":\"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"kind\"],\"properties\":{\"kind\":{\"enum\":[\"envelope\",\"tag\",\"coin\",\"none\"]},\"text\":{\"$ref\":\"#/definitions/text\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"tag\"}}},\"then\":{\"required\":[\"text\"]},\"else\":{\"not\":{\"required\":[\"text\"]}}},\"sequence\":{\"description\":\"時系列図の種類の欄。生存線を左から並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"lifelines\"],\"properties\":{\"lifelines\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}}}},\"state\":{\"description\":\"状態遷移図の種類の欄。最初の段より前に書いた、移れるが段で通るとは限らない線\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"paths\"],\"properties\":{\"paths\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/path\"}}}},\"git\":{\"description\":\"枝分かれの図の種類の欄。枝を上から帯に並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"branches\"],\"properties\":{\"branches\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/branch\"}}}},\"branch\":{\"description\":\"枝。帯の左に名札と添え書きを置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"note\":{\"$ref\":\"#/definitions/text\"}}},\"hash\":{\"description\":\"commit と木の箱の hash。16 進の字で 4 から 40 字\",\"type\":\"string\",\"pattern\":\"^[0-9a-f]{4,40}$\"},\"lineup\":{\"description\":\"列の図の種類の欄。列に並べるチップ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"items\"],\"properties\":{\"items\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/item\"}}}},\"item\":{\"description\":\"チップ。color を書かないチップは薄い色で、label を書かないチップは色だけで出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"label\":{\"description\":\"チップに載せる字\",\"type\":\"string\",\"minLength\":1,\"maxLength\":4}}},\"time\":{\"description\":\"時間軸の図の種類の欄。目盛り、区切り、印の列、節目、拡大の範囲\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"scale\",\"rows\"],\"properties\":{\"scale\":{\"$ref\":\"#/definitions/scale\"},\"period\":{\"$ref\":\"#/definitions/period\"},\"rows\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/row\"}},\"points\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/point\"}},\"zoom\":{\"$ref\":\"#/definitions/zoom\"}}},\"scale\":{\"description\":\"目盛り。unit の名前の目盛りを length の長さで count 個並べ、最初の目盛りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"unit\",\"length\",\"count\"],\"properties\":{\"unit\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"$ref\":\"#/definitions/duration\"},\"count\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}},\"duration\":{\"description\":\"長さ。数と単位 (ms、s、min、h、d) の組\",\"type\":\"string\",\"pattern\":\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"},\"unit\":{\"description\":\"目盛りの位置。0 から数える\",\"type\":\"integer\",\"minimum\":0},\"period\":{\"description\":\"区切り。目盛り length 個ごとに name の区切りを置き、最初の区切りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"length\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}},\"row\":{\"description\":\"印の列。目盛りごとに印を 1 つ置き、empty の目盛りは空きの印にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"empty\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/unit\"}}}},\"point\":{\"description\":\"節目。at の目盛りの印の下に旗の丸と名札を置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"at\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"at\":{\"$ref\":\"#/definitions/unit\"}}},\"zoom\":{\"description\":\"拡大の範囲。from から to の目盛りごとに拡大の帯に列を作る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}},\"path\":{\"description\":\"移れる道。送る側に始まりの印 start、受ける側に終わりの印 finish を書ける。どの段にも出ない道は点線で描き、運ぶ物を走らせない\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}}}};const schema16 = {\"description\":\"この図の種類では書けない欄\",\"not\":{}};const schema74 = {\"type\":\"string\",\"minLength\":1};const schema12 = {\"description\":\"枝分かれの図でも時間軸の図でも木の図でも列の図でもない図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};const schema13 = {\"description\":\"時間軸の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"now\",\"mark\",\"span\"]}}};const schema14 = {\"description\":\"木の図だけが書ける出来事\",\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"leaf\",\"node\"]}}};const schema15 = {\"description\":\"列の図だけが書ける出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"line\",\"seal\",\"open\",\"pick\",\"stamp\"]}}}};function validate11(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs8 = errors;const _errs9 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!((data4 === \"leaf\") || (data4 === \"node\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid9 = _errs9 === errors;if(valid9){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs14 = errors;const _errs15 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing2;if((data2.type === undefined) && (missing2 = \"type\")){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {if(data2.type !== undefined){let data5 = data2.type;if(!(((((data5 === \"line\") || (data5 === \"seal\")) || (data5 === \"open\")) || (data5 === \"pick\")) || (data5 === \"stamp\"))){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}}var valid13 = _errs15 === errors;if(valid13){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data6 = data2.type;const _errs18 = errors;const _errs19 = errors;if(!((data6 === \"commit\") || (data6 === \"branch\"))){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var valid16 = _errs19 === errors;if(valid16){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data2.at !== undefined){const err11 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/at\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data2.into !== undefined){const err12 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/into\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data2.color !== undefined){const err13 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}}}}}}validate11.errors = vErrors;return errors === 0;}const schema19 = {\"description\":\"時間軸の図でない図の中身の帯。物差しを書けない\",\"properties\":{\"meters\":{\"$ref\":\"#/definitions/absent\"}}};function validate13(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.meters !== undefined){const err0 = {instancePath:instancePath+\"/meters\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}validate13.errors = vErrors;return errors === 0;}const schema28 = {\"description\":\"枝分かれの図の段。時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};function validate17(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs8 = errors;const _errs9 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!((data4 === \"leaf\") || (data4 === \"node\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid9 = _errs9 === errors;if(valid9){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs14 = errors;const _errs15 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing2;if((data2.type === undefined) && (missing2 = \"type\")){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {if(data2.type !== undefined){let data5 = data2.type;if(!(((((data5 === \"line\") || (data5 === \"seal\")) || (data5 === \"open\")) || (data5 === \"pick\")) || (data5 === \"stamp\"))){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}}var valid13 = _errs15 === errors;if(valid13){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.at !== undefined){const err9 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/at\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.into !== undefined){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/into\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data2.color !== undefined){const err11 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}}}}}}validate17.errors = vErrors;return errors === 0;}const schema39 = {\"description\":\"時間軸の図の段。枝分かれの図だけの出来事 (commit と branch) と、木の図だけの出来事 (leaf と node) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}}}}}}}};function validate20(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs4 = errors;const _errs5 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!((data3 === \"leaf\") || (data3 === \"node\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid6 = _errs5 === errors;if(valid6){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs4;if(vErrors !== null){if(_errs4){vErrors.length = _errs4;}else {vErrors = null;}}}const _errs10 = errors;const _errs11 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!(((((data4 === \"line\") || (data4 === \"seal\")) || (data4 === \"open\")) || (data4 === \"pick\")) || (data4 === \"stamp\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid10 = _errs11 === errors;if(valid10){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data5 = data2.type;const _errs14 = errors;const _errs15 = errors;if(!((data5 === \"commit\") || (data5 === \"branch\"))){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid13 = _errs15 === errors;if(valid13){const err7 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}}}}}}}}}validate20.errors = vErrors;return errors === 0;}const schema46 = {\"description\":\"木の図の段。枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (at と into と color) と、列の図だけの出来事 (line と seal と open と pick と stamp) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"$ref\":\"#/definitions/notLineupEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"at\":{\"$ref\":\"#/definitions/absent\"},\"into\":{\"$ref\":\"#/definitions/absent\"},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};function validate22(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs9 = errors;const _errs10 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!(((((data4 === \"line\") || (data4 === \"seal\")) || (data4 === \"open\")) || (data4 === \"pick\")) || (data4 === \"stamp\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid10 = _errs10 === errors;if(valid10){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notLineupEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data5 = data2.type;const _errs13 = errors;const _errs14 = errors;if(!((data5 === \"commit\") || (data5 === \"branch\"))){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid13 = _errs14 === errors;if(valid13){const err7 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}else {errors = _errs13;if(vErrors !== null){if(_errs13){vErrors.length = _errs13;}else {vErrors = null;}}}}if(data2.at !== undefined){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/at\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.into !== undefined){const err9 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/into\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data2.color !== undefined){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}}}}}}validate22.errors = vErrors;return errors === 0;}const schema60 = {\"description\":\"列の図の段。線と処理と、枝分かれの図だけの出来事 (commit と branch) と、時間軸の図だけの出来事 (now と mark と span) と欄 (color) と、木の図だけの出来事 (leaf と node) を書けない\",\"items\":{\"properties\":{\"events\":{\"items\":{\"not\":{\"$ref\":\"#/definitions/timeEvent\"},\"allOf\":[{\"not\":{\"$ref\":\"#/definitions/treeEvent\"}},{\"$ref\":\"#/definitions/notWiredEvent\"}],\"properties\":{\"type\":{\"not\":{\"enum\":[\"commit\",\"branch\"]}},\"color\":{\"$ref\":\"#/definitions/absent\"}}}}}}};const schema63 = {\"description\":\"箱と線の図の出来事を書けない\",\"not\":{\"required\":[\"type\"],\"properties\":{\"type\":{\"enum\":[\"edge\",\"action\"]}}}};function validate25(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(Array.isArray(data)){const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(data0 && typeof data0 == \"object\" && !Array.isArray(data0)){if(data0.events !== undefined){let data1 = data0.events;if(Array.isArray(data1)){const len1 = data1.length;for(let i1=0; i1<len1; i1++){let data2 = data1[i1];const _errs3 = errors;const _errs4 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing0;if((data2.type === undefined) && (missing0 = \"type\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data2.type !== undefined){let data3 = data2.type;if(!(((data3 === \"now\") || (data3 === \"mark\")) || (data3 === \"span\"))){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var valid5 = _errs4 === errors;if(valid5){const err2 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs3;if(vErrors !== null){if(_errs3){vErrors.length = _errs3;}else {vErrors = null;}}}const _errs8 = errors;const _errs9 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing1;if((data2.type === undefined) && (missing1 = \"type\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {if(data2.type !== undefined){let data4 = data2.type;if(!((data4 === \"leaf\") || (data4 === \"node\"))){const err4 = {};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}}var valid9 = _errs9 === errors;if(valid9){const err5 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/items/properties/events/items/allOf/0/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}}const _errs14 = errors;const _errs15 = errors;if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){let missing2;if((data2.type === undefined) && (missing2 = \"type\")){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}else {if(data2.type !== undefined){let data5 = data2.type;if(!((data5 === \"edge\") || (data5 === \"action\"))){const err7 = {};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}}var valid13 = _errs15 === errors;if(valid13){const err8 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1,schemaPath:\"#/definitions/notWiredEvent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs14;if(vErrors !== null){if(_errs14){vErrors.length = _errs14;}else {vErrors = null;}}}if(data2 && typeof data2 == \"object\" && !Array.isArray(data2)){if(data2.type !== undefined){let data6 = data2.type;const _errs18 = errors;const _errs19 = errors;if(!((data6 === \"commit\") || (data6 === \"branch\"))){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var valid16 = _errs19 === errors;if(valid16){const err10 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/type\",schemaPath:\"#/items/properties/events/items/properties/type/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}else {errors = _errs18;if(vErrors !== null){if(_errs18){vErrors.length = _errs18;}else {vErrors = null;}}}}if(data2.color !== undefined){const err11 = {instancePath:instancePath+\"/\" + i0+\"/events/\" + i1+\"/color\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}}}}}}validate25.errors = vErrors;return errors === 0;}const schema75 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"note\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"}}};const schema76 = {\"type\":\"string\",\"pattern\":\"^[^\\\\s\\\\[\\\\]「」=:]+$\"};const schema79 = {\"enum\":[\"blue\",\"amber\",\"green\",\"violet\",\"rose\",\"slate\",\"coin\"]};const pattern0 = new RegExp(\"^[^\\\\s\\\\[\\\\]「」=:]+$\", \"u\");const func3 = ucs2length;function validate30(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((key0 === \"id\") || (key0 === \"name\")) || (key0 === \"note\")) || (key0 === \"color\")) || (key0 === \"icon\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.note !== undefined){let data2 = data.note;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === \"blue\") || (data3 === \"amber\")) || (data3 === \"green\")) || (data3 === \"violet\")) || (data3 === \"rose\")) || (data3 === \"slate\")) || (data3 === \"coin\"))){const err9 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === \"string\"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate30.errors = vErrors;return errors === 0;}const schema81 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"sub\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"icon\":{\"$ref\":\"#/definitions/text\"},\"region\":{\"$ref\":\"#/definitions/id\"},\"link\":{\"description\":\"飛び先。描いた図ではこの箱がここへの link になる\",\"$ref\":\"#/definitions/url\"}}};const schema88 = {\"description\":\"頁を移る形。/ で始まる path か、http:// か https:// で始まる URL\",\"type\":\"string\",\"pattern\":\"^(/|https?://)\"};const pattern3 = new RegExp(\"^(/|https?://)\", \"u\");function validate32(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((((key0 === \"id\") || (key0 === \"name\")) || (key0 === \"sub\")) || (key0 === \"color\")) || (key0 === \"icon\")) || (key0 === \"region\")) || (key0 === \"link\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.sub !== undefined){let data2 = data.sub;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+\"/sub\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/sub\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.color !== undefined){let data3 = data.color;if(!(((((((data3 === \"blue\") || (data3 === \"amber\")) || (data3 === \"green\")) || (data3 === \"violet\")) || (data3 === \"rose\")) || (data3 === \"slate\")) || (data3 === \"coin\"))){const err9 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.icon !== undefined){let data4 = data.icon;if(typeof data4 === \"string\"){if(func3(data4) < 1){const err10 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+\"/icon\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.region !== undefined){let data5 = data.region;if(typeof data5 === \"string\"){if(!pattern0.test(data5)){const err12 = {instancePath:instancePath+\"/region\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+\"/region\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.link !== undefined){let data6 = data.link;if(typeof data6 === \"string\"){if(!pattern3.test(data6)){const err14 = {instancePath:instancePath+\"/link\",schemaPath:\"#/definitions/url/pattern\",keyword:\"pattern\",params:{pattern: \"^(/|https?://)\"},message:\"must match pattern \\\"\"+\"^(/|https?://)\"+\"\\\"\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+\"/link\",schemaPath:\"#/definitions/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate32.errors = vErrors;return errors === 0;}const schema89 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"fields\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"fields\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/text\"}},\"meters\":{\"description\":\"物差しにする欄。時間軸の図だけが書ける\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/meter\"}}}};const schema92 = {\"description\":\"物差しの欄。line の割合の所に線を引き、set の値まで針と一緒に満ちる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"field\",\"line\"],\"properties\":{\"field\":{\"$ref\":\"#/definitions/text\"},\"line\":{\"$ref\":\"#/definitions/ratio\"}}};const schema94 = {\"description\":\"割合。分数 (2/3) か百分率 (97%)\",\"type\":\"string\",\"pattern\":\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"};const pattern4 = new RegExp(\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\", \"u\");function validate35(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.field === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"field\"},message:\"must have required property '\"+\"field\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.line === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"line\"},message:\"must have required property '\"+\"line\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"field\") || (key0 === \"line\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.field !== undefined){let data0 = data.field;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.line !== undefined){let data1 = data.line;if(typeof data1 === \"string\"){if(!pattern4.test(data1)){const err5 = {instancePath:instancePath+\"/line\",schemaPath:\"#/definitions/ratio/pattern\",keyword:\"pattern\",params:{pattern: \"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"},message:\"must match pattern \\\"\"+\"^([0-9]+/[0-9]+|[0-9]+(\\\\.[0-9]+)?%)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/line\",schemaPath:\"#/definitions/ratio/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate35.errors = vErrors;return errors === 0;}function validate34(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.fields === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"fields\"},message:\"must have required property '\"+\"fields\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === \"title\") || (key0 === \"fields\")) || (key0 === \"meters\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.title !== undefined){let data0 = data.title;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.fields !== undefined){let data1 = data.fields;if(Array.isArray(data1)){if(data1.length < 1){const err5 = {instancePath:instancePath+\"/fields\",schemaPath:\"#/properties/fields/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}const len0 = data1.length;for(let i0=0; i0<len0; i0++){let data2 = data1[i0];if(typeof data2 === \"string\"){if(func3(data2) < 1){const err6 = {instancePath:instancePath+\"/fields/\" + i0,schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/fields/\" + i0,schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath:instancePath+\"/fields\",schemaPath:\"#/properties/fields/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.meters !== undefined){let data3 = data.meters;if(Array.isArray(data3)){if(data3.length < 1){const err9 = {instancePath:instancePath+\"/meters\",schemaPath:\"#/properties/meters/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len1 = data3.length;for(let i1=0; i1<len1; i1++){if(!(validate35(data3[i1], {instancePath:instancePath+\"/meters/\" + i1,parentData:data3,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);errors = vErrors.length;}}}else {const err10 = {instancePath:instancePath+\"/meters\",schemaPath:\"#/properties/meters/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate34.errors = vErrors;return errors === 0;}const schema95 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"body\",\"events\"],\"properties\":{\"title\":{\"$ref\":\"#/definitions/text\"},\"body\":{\"$ref\":\"#/definitions/text\"},\"code\":{\"$ref\":\"#/definitions/text\"},\"sources\":{\"description\":\"段の出典。読み上げの段の一覧に、名前を URL への link にして書いた順に出す\",\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/source\"}},\"events\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/event\"}}}};const schema99 = {\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"url\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"url\":{\"$ref\":\"#/definitions/url\"}}};function validate39(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.url === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"url\"},message:\"must have required property '\"+\"url\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"name\") || (key0 === \"url\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.name !== undefined){let data0 = data.name;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.url !== undefined){let data1 = data.url;if(typeof data1 === \"string\"){if(!pattern3.test(data1)){const err5 = {instancePath:instancePath+\"/url\",schemaPath:\"#/definitions/url/pattern\",keyword:\"pattern\",params:{pattern: \"^(/|https?://)\"},message:\"must match pattern \\\"\"+\"^(/|https?://)\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/url\",schemaPath:\"#/definitions/url/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate39.errors = vErrors;return errors === 0;}const schema102 = {\"description\":\"段の中で起きること。起きる順に並べる\",\"type\":\"object\",\"required\":[\"type\"],\"discriminator\":{\"propertyName\":\"type\"},\"oneOf\":[{\"description\":\"線。運ぶ物を載せて送る側から受ける側へ走る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"carry\"],\"properties\":{\"type\":{\"const\":\"edge\"},\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"},\"carry\":{\"$ref\":\"#/definitions/carry\"},\"labelSide\":{\"description\":\"線の名前を置く側 (寄せの指示)\",\"enum\":[\"above\",\"below\",\"left\",\"right\"]},\"at\":{\"description\":\"時間軸の図の拡大の帯で、線を引く列の目盛り\",\"$ref\":\"#/definitions/unit\"},\"into\":{\"description\":\"時間軸の図の拡大の帯で、受ける箱を選ぶ列の目盛り。書かなければ at の列\",\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"箱の中の処理\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"label\"],\"properties\":{\"type\":{\"const\":\"action\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"箱の下の小さな字の書き換え\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"swap\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"description\":\"時間軸の図の節目の丸の色\",\"$ref\":\"#/definitions/color\"}}},{\"description\":\"commit を積む。枝分かれの図だけが書ける。積んだ枝の札と、その枝を指す HEAD が進む。当て直し (copy) は枝の札を動かさず、merge commit (merge) は取り込む枝の先端も親に持つ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"branch\"],\"properties\":{\"type\":{\"const\":\"commit\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"copy\":{\"$ref\":\"#/definitions/id\"},\"merge\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"},\"note\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"枝を切る。枝分かれの図だけが書ける。枝の札を from の commit へ置き、HEAD をその枝へ移す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"branch\",\"from\"],\"properties\":{\"type\":{\"const\":\"branch\"},\"branch\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"時間軸の図の今の時刻の針を、to の目盛りの終わりまで進める\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"to\"],\"properties\":{\"type\":{\"const\":\"now\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}},{\"description\":\"時間軸の図の印の列 row の、from から to の目盛りの印の色を変える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"row\",\"from\",\"to\",\"color\"],\"properties\":{\"type\":{\"const\":\"mark\"},\"row\":{\"$ref\":\"#/definitions/id\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"時間軸の図の from から to の目盛りに、括弧と字を出す。shape が box なら印の列を囲み、字を縁の札にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"from\",\"to\",\"text\"],\"properties\":{\"type\":{\"const\":\"span\"},\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"},\"text\":{\"$ref\":\"#/definitions/text\"},\"shape\":{\"enum\":[\"box\"]},\"color\":{\"$ref\":\"#/definitions/color\"}}},{\"description\":\"葉を出す。木の図だけが書ける。書いた段で葉の箱が現れる。hash を書くと箱に値を出し、名札を葉の下の札に出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\"],\"properties\":{\"type\":{\"const\":\"leaf\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"1 つ以上の子から親を組む。木の図だけが書ける。書いた段で親の箱と、子から親への木の線が現れる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"id\",\"children\"],\"properties\":{\"type\":{\"const\":\"node\"},\"id\":{\"$ref\":\"#/definitions/id\"},\"children\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}},\"hash\":{\"$ref\":\"#/definitions/hash\"}}},{\"description\":\"列の box の並びを items に書き換える。列の図だけが書ける。チップは前に居た列から滑り、どの列にも居なかったチップは弾んで現れ、列から外れたチップは消える\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"items\"],\"properties\":{\"type\":{\"const\":\"line\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"items\":{\"type\":\"array\",\"minItems\":1,\"maxItems\":12,\"items\":{\"$ref\":\"#/definitions/id\"}}}},{\"description\":\"列 box に封をして、チップを隠す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"seal\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の封を開ける。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"open\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box を選ぶ。列の図だけが書ける。列の縁に色が付き、ほかの列が薄くなる\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\"],\"properties\":{\"type\":{\"const\":\"pick\"},\"box\":{\"$ref\":\"#/definitions/id\"}}},{\"description\":\"列 box の右に text の札を押す。列の図だけが書ける\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"box\",\"text\"],\"properties\":{\"type\":{\"const\":\"stamp\"},\"box\":{\"$ref\":\"#/definitions/id\"},\"text\":{\"$ref\":\"#/definitions/text\"}}},{\"description\":\"中身の帯の欄の値と札\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"type\",\"field\"],\"anyOf\":[{\"required\":[\"value\"]},{\"required\":[\"tag\"]}],\"properties\":{\"type\":{\"const\":\"strip\"},\"field\":{\"$ref\":\"#/definitions/text\"},\"value\":{\"$ref\":\"#/definitions/text\"},\"tag\":{\"$ref\":\"#/definitions/text\"}}}]};const schema108 = {\"description\":\"目盛りの位置。0 から数える\",\"type\":\"integer\",\"minimum\":0};const schema119 = {\"description\":\"commit と木の箱の hash。16 進の字で 4 から 40 字\",\"type\":\"string\",\"pattern\":\"^[0-9a-f]{4,40}$\"};const pattern14 = new RegExp(\"^[0-9a-f]{4,40}$\", \"u\");const schema106 = {\"description\":\"線の上を走る物。封筒 (メッセージや要求)、札 (名前のある値)、硬貨 (価値)、無し\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"kind\"],\"properties\":{\"kind\":{\"enum\":[\"envelope\",\"tag\",\"coin\",\"none\"]},\"text\":{\"$ref\":\"#/definitions/text\"}},\"if\":{\"required\":[\"kind\"],\"properties\":{\"kind\":{\"const\":\"tag\"}}},\"then\":{\"required\":[\"text\"]},\"else\":{\"not\":{\"required\":[\"text\"]}}};function validate42(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = \"kind\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if(\"tag\" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.text === undefined){const err2 = {instancePath,schemaPath:\"#/then/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = \"then\";}else {const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing1;if((data.text === undefined) && (missing1 = \"text\")){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var valid2 = _errs7 === errors;if(valid2){const err4 = {instancePath,schemaPath:\"#/else/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid0 = _valid0;ifClause0 = \"else\";}if(!valid0){const err5 = {instancePath,schemaPath:\"#/if\",keyword:\"if\",params:{failingKeyword: ifClause0},message:\"must match \\\"\"+ifClause0+\"\\\" schema\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.kind === undefined){const err6 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind\"},message:\"must have required property '\"+\"kind\"+\"'\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!((key0 === \"kind\") || (key0 === \"text\"))){const err7 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.kind !== undefined){let data1 = data.kind;if(!((((data1 === \"envelope\") || (data1 === \"tag\")) || (data1 === \"coin\")) || (data1 === \"none\"))){const err8 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/enum\",keyword:\"enum\",params:{allowedValues: schema106.properties.kind.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.text !== undefined){let data2 = data.text;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err9 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate42.errors = vErrors;return errors === 0;}function validate41(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const tag0 = data.type;if(typeof tag0 == \"string\"){if(tag0 === \"edge\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err1 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.from === undefined){const err2 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.to === undefined){const err3 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.carry === undefined){const err4 = {instancePath,schemaPath:\"#/oneOf/0/required\",keyword:\"required\",params:{missingProperty: \"carry\"},message:\"must have required property '\"+\"carry\"+\"'\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === \"type\") || (key0 === \"from\")) || (key0 === \"to\")) || (key0 === \"label\")) || (key0 === \"carry\")) || (key0 === \"labelSide\")) || (key0 === \"at\")) || (key0 === \"into\"))){const err5 = {instancePath,schemaPath:\"#/oneOf/0/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.type !== undefined){if(\"edge\" !== data.type){const err6 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/0/properties/type/const\",keyword:\"const\",params:{allowedValue: \"edge\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.from !== undefined){let data1 = data.from;if(typeof data1 === \"string\"){if(!pattern0.test(data1)){const err7 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.to !== undefined){let data2 = data.to;if(typeof data2 === \"string\"){if(!pattern0.test(data2)){const err9 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.label !== undefined){let data3 = data.label;if(typeof data3 === \"string\"){if(func3(data3) < 1){const err11 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.carry !== undefined){if(!(validate42(data.carry, {instancePath:instancePath+\"/carry\",parentData:data,parentDataProperty:\"carry\",rootData}))){vErrors = vErrors === null ? validate42.errors : vErrors.concat(validate42.errors);errors = vErrors.length;}}if(data.labelSide !== undefined){let data5 = data.labelSide;if(!((((data5 === \"above\") || (data5 === \"below\")) || (data5 === \"left\")) || (data5 === \"right\"))){const err13 = {instancePath:instancePath+\"/labelSide\",schemaPath:\"#/oneOf/0/properties/labelSide/enum\",keyword:\"enum\",params:{allowedValues: schema102.oneOf[0].properties.labelSide.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.at !== undefined){let data6 = data.at;if(!(((typeof data6 == \"number\") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))){const err14 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if((typeof data6 == \"number\") && (isFinite(data6))){if(data6 < 0 || isNaN(data6)){const err15 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}if(data.into !== undefined){let data7 = data.into;if(!(((typeof data7 == \"number\") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))){const err16 = {instancePath:instancePath+\"/into\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if((typeof data7 == \"number\") && (isFinite(data7))){if(data7 < 0 || isNaN(data7)){const err17 = {instancePath:instancePath+\"/into\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}}else {const err18 = {instancePath,schemaPath:\"#/oneOf/0/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}else if(tag0 === \"action\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err19 = {instancePath,schemaPath:\"#/oneOf/1/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data.box === undefined){const err20 = {instancePath,schemaPath:\"#/oneOf/1/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data.label === undefined){const err21 = {instancePath,schemaPath:\"#/oneOf/1/required\",keyword:\"required\",params:{missingProperty: \"label\"},message:\"must have required property '\"+\"label\"+\"'\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}for(const key1 in data){if(!(((key1 === \"type\") || (key1 === \"box\")) || (key1 === \"label\"))){const err22 = {instancePath,schemaPath:\"#/oneOf/1/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key1},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.type !== undefined){if(\"action\" !== data.type){const err23 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/1/properties/type/const\",keyword:\"const\",params:{allowedValue: \"action\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.box !== undefined){let data9 = data.box;if(typeof data9 === \"string\"){if(!pattern0.test(data9)){const err24 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.label !== undefined){let data10 = data.label;if(typeof data10 === \"string\"){if(func3(data10) < 1){const err26 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}else {const err27 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath,schemaPath:\"#/oneOf/1/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else if(tag0 === \"swap\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err29 = {instancePath,schemaPath:\"#/oneOf/2/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(data.box === undefined){const err30 = {instancePath,schemaPath:\"#/oneOf/2/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(data.text === undefined){const err31 = {instancePath,schemaPath:\"#/oneOf/2/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}for(const key2 in data){if(!((((key2 === \"type\") || (key2 === \"box\")) || (key2 === \"text\")) || (key2 === \"color\"))){const err32 = {instancePath,schemaPath:\"#/oneOf/2/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key2},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data.type !== undefined){if(\"swap\" !== data.type){const err33 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/2/properties/type/const\",keyword:\"const\",params:{allowedValue: \"swap\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data.box !== undefined){let data12 = data.box;if(typeof data12 === \"string\"){if(!pattern0.test(data12)){const err34 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data.text !== undefined){let data13 = data.text;if(typeof data13 === \"string\"){if(func3(data13) < 1){const err36 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}else {const err37 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.color !== undefined){let data14 = data.color;if(!(((((((data14 === \"blue\") || (data14 === \"amber\")) || (data14 === \"green\")) || (data14 === \"violet\")) || (data14 === \"rose\")) || (data14 === \"slate\")) || (data14 === \"coin\"))){const err38 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}else {const err39 = {instancePath,schemaPath:\"#/oneOf/2/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}else if(tag0 === \"commit\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err40 = {instancePath,schemaPath:\"#/oneOf/3/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}if(data.id === undefined){const err41 = {instancePath,schemaPath:\"#/oneOf/3/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(data.branch === undefined){const err42 = {instancePath,schemaPath:\"#/oneOf/3/required\",keyword:\"required\",params:{missingProperty: \"branch\"},message:\"must have required property '\"+\"branch\"+\"'\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}for(const key3 in data){if(!(((((((key3 === \"type\") || (key3 === \"id\")) || (key3 === \"branch\")) || (key3 === \"copy\")) || (key3 === \"merge\")) || (key3 === \"hash\")) || (key3 === \"note\"))){const err43 = {instancePath,schemaPath:\"#/oneOf/3/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key3},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data.type !== undefined){if(\"commit\" !== data.type){const err44 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/3/properties/type/const\",keyword:\"const\",params:{allowedValue: \"commit\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}if(data.id !== undefined){let data16 = data.id;if(typeof data16 === \"string\"){if(!pattern0.test(data16)){const err45 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}else {const err46 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}if(data.branch !== undefined){let data17 = data.branch;if(typeof data17 === \"string\"){if(!pattern0.test(data17)){const err47 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}if(data.copy !== undefined){let data18 = data.copy;if(typeof data18 === \"string\"){if(!pattern0.test(data18)){const err49 = {instancePath:instancePath+\"/copy\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}else {const err50 = {instancePath:instancePath+\"/copy\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}}if(data.merge !== undefined){let data19 = data.merge;if(typeof data19 === \"string\"){if(!pattern0.test(data19)){const err51 = {instancePath:instancePath+\"/merge\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+\"/merge\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}if(data.hash !== undefined){let data20 = data.hash;if(typeof data20 === \"string\"){if(!pattern14.test(data20)){const err53 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{4,40}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{4,40}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}else {const err54 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data.note !== undefined){let data21 = data.note;if(typeof data21 === \"string\"){if(func3(data21) < 1){const err55 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}}else {const err56 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}}else {const err57 = {instancePath,schemaPath:\"#/oneOf/3/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}else if(tag0 === \"branch\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err58 = {instancePath,schemaPath:\"#/oneOf/4/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(data.branch === undefined){const err59 = {instancePath,schemaPath:\"#/oneOf/4/required\",keyword:\"required\",params:{missingProperty: \"branch\"},message:\"must have required property '\"+\"branch\"+\"'\"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data.from === undefined){const err60 = {instancePath,schemaPath:\"#/oneOf/4/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}for(const key4 in data){if(!(((key4 === \"type\") || (key4 === \"branch\")) || (key4 === \"from\"))){const err61 = {instancePath,schemaPath:\"#/oneOf/4/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key4},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}}if(data.type !== undefined){if(\"branch\" !== data.type){const err62 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/4/properties/type/const\",keyword:\"const\",params:{allowedValue: \"branch\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}}if(data.branch !== undefined){let data23 = data.branch;if(typeof data23 === \"string\"){if(!pattern0.test(data23)){const err63 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}}else {const err64 = {instancePath:instancePath+\"/branch\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}}if(data.from !== undefined){let data24 = data.from;if(typeof data24 === \"string\"){if(!pattern0.test(data24)){const err65 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}else {const err66 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}}}else {const err67 = {instancePath,schemaPath:\"#/oneOf/4/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}else if(tag0 === \"now\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err68 = {instancePath,schemaPath:\"#/oneOf/5/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}if(data.to === undefined){const err69 = {instancePath,schemaPath:\"#/oneOf/5/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}for(const key5 in data){if(!((key5 === \"type\") || (key5 === \"to\"))){const err70 = {instancePath,schemaPath:\"#/oneOf/5/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key5},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data.type !== undefined){if(\"now\" !== data.type){const err71 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/5/properties/type/const\",keyword:\"const\",params:{allowedValue: \"now\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data.to !== undefined){let data26 = data.to;if(!(((typeof data26 == \"number\") && (!(data26 % 1) && !isNaN(data26))) && (isFinite(data26)))){const err72 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}if((typeof data26 == \"number\") && (isFinite(data26))){if(data26 < 0 || isNaN(data26)){const err73 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}}}else {const err74 = {instancePath,schemaPath:\"#/oneOf/5/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}}else if(tag0 === \"mark\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err75 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}if(data.row === undefined){const err76 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"row\"},message:\"must have required property '\"+\"row\"+\"'\"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}if(data.from === undefined){const err77 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err77];}else {vErrors.push(err77);}errors++;}if(data.to === undefined){const err78 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err78];}else {vErrors.push(err78);}errors++;}if(data.color === undefined){const err79 = {instancePath,schemaPath:\"#/oneOf/6/required\",keyword:\"required\",params:{missingProperty: \"color\"},message:\"must have required property '\"+\"color\"+\"'\"};if(vErrors === null){vErrors = [err79];}else {vErrors.push(err79);}errors++;}for(const key6 in data){if(!(((((key6 === \"type\") || (key6 === \"row\")) || (key6 === \"from\")) || (key6 === \"to\")) || (key6 === \"color\"))){const err80 = {instancePath,schemaPath:\"#/oneOf/6/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key6},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err80];}else {vErrors.push(err80);}errors++;}}if(data.type !== undefined){if(\"mark\" !== data.type){const err81 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/6/properties/type/const\",keyword:\"const\",params:{allowedValue: \"mark\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err81];}else {vErrors.push(err81);}errors++;}}if(data.row !== undefined){let data28 = data.row;if(typeof data28 === \"string\"){if(!pattern0.test(data28)){const err82 = {instancePath:instancePath+\"/row\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err82];}else {vErrors.push(err82);}errors++;}}else {const err83 = {instancePath:instancePath+\"/row\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err83];}else {vErrors.push(err83);}errors++;}}if(data.from !== undefined){let data29 = data.from;if(!(((typeof data29 == \"number\") && (!(data29 % 1) && !isNaN(data29))) && (isFinite(data29)))){const err84 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err84];}else {vErrors.push(err84);}errors++;}if((typeof data29 == \"number\") && (isFinite(data29))){if(data29 < 0 || isNaN(data29)){const err85 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err85];}else {vErrors.push(err85);}errors++;}}}if(data.to !== undefined){let data30 = data.to;if(!(((typeof data30 == \"number\") && (!(data30 % 1) && !isNaN(data30))) && (isFinite(data30)))){const err86 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err86];}else {vErrors.push(err86);}errors++;}if((typeof data30 == \"number\") && (isFinite(data30))){if(data30 < 0 || isNaN(data30)){const err87 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err87];}else {vErrors.push(err87);}errors++;}}}if(data.color !== undefined){let data31 = data.color;if(!(((((((data31 === \"blue\") || (data31 === \"amber\")) || (data31 === \"green\")) || (data31 === \"violet\")) || (data31 === \"rose\")) || (data31 === \"slate\")) || (data31 === \"coin\"))){const err88 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err88];}else {vErrors.push(err88);}errors++;}}}else {const err89 = {instancePath,schemaPath:\"#/oneOf/6/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err89];}else {vErrors.push(err89);}errors++;}}else if(tag0 === \"span\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err90 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(data.from === undefined){const err91 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}if(data.to === undefined){const err92 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}if(data.text === undefined){const err93 = {instancePath,schemaPath:\"#/oneOf/7/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}for(const key7 in data){if(!((((((key7 === \"type\") || (key7 === \"from\")) || (key7 === \"to\")) || (key7 === \"text\")) || (key7 === \"shape\")) || (key7 === \"color\"))){const err94 = {instancePath,schemaPath:\"#/oneOf/7/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key7},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data.type !== undefined){if(\"span\" !== data.type){const err95 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/7/properties/type/const\",keyword:\"const\",params:{allowedValue: \"span\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data.from !== undefined){let data33 = data.from;if(!(((typeof data33 == \"number\") && (!(data33 % 1) && !isNaN(data33))) && (isFinite(data33)))){const err96 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if((typeof data33 == \"number\") && (isFinite(data33))){if(data33 < 0 || isNaN(data33)){const err97 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}if(data.to !== undefined){let data34 = data.to;if(!(((typeof data34 == \"number\") && (!(data34 % 1) && !isNaN(data34))) && (isFinite(data34)))){const err98 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}if((typeof data34 == \"number\") && (isFinite(data34))){if(data34 < 0 || isNaN(data34)){const err99 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}}if(data.text !== undefined){let data35 = data.text;if(typeof data35 === \"string\"){if(func3(data35) < 1){const err100 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}else {const err101 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data.shape !== undefined){if(!(data.shape === \"box\")){const err102 = {instancePath:instancePath+\"/shape\",schemaPath:\"#/oneOf/7/properties/shape/enum\",keyword:\"enum\",params:{allowedValues: schema102.oneOf[7].properties.shape.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}if(data.color !== undefined){let data37 = data.color;if(!(((((((data37 === \"blue\") || (data37 === \"amber\")) || (data37 === \"green\")) || (data37 === \"violet\")) || (data37 === \"rose\")) || (data37 === \"slate\")) || (data37 === \"coin\"))){const err103 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}}else {const err104 = {instancePath,schemaPath:\"#/oneOf/7/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}else if(tag0 === \"leaf\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err105 = {instancePath,schemaPath:\"#/oneOf/8/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if(data.id === undefined){const err106 = {instancePath,schemaPath:\"#/oneOf/8/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}for(const key8 in data){if(!(((key8 === \"type\") || (key8 === \"id\")) || (key8 === \"hash\"))){const err107 = {instancePath,schemaPath:\"#/oneOf/8/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key8},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data.type !== undefined){if(\"leaf\" !== data.type){const err108 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/8/properties/type/const\",keyword:\"const\",params:{allowedValue: \"leaf\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data.id !== undefined){let data39 = data.id;if(typeof data39 === \"string\"){if(!pattern0.test(data39)){const err109 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}else {const err110 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data.hash !== undefined){let data40 = data.hash;if(typeof data40 === \"string\"){if(!pattern14.test(data40)){const err111 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{4,40}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{4,40}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}else {const err112 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}}else {const err113 = {instancePath,schemaPath:\"#/oneOf/8/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}else if(tag0 === \"node\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err114 = {instancePath,schemaPath:\"#/oneOf/9/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(data.id === undefined){const err115 = {instancePath,schemaPath:\"#/oneOf/9/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}if(data.children === undefined){const err116 = {instancePath,schemaPath:\"#/oneOf/9/required\",keyword:\"required\",params:{missingProperty: \"children\"},message:\"must have required property '\"+\"children\"+\"'\"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}for(const key9 in data){if(!((((key9 === \"type\") || (key9 === \"id\")) || (key9 === \"children\")) || (key9 === \"hash\"))){const err117 = {instancePath,schemaPath:\"#/oneOf/9/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key9},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data.type !== undefined){if(\"node\" !== data.type){const err118 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/9/properties/type/const\",keyword:\"const\",params:{allowedValue: \"node\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data.id !== undefined){let data42 = data.id;if(typeof data42 === \"string\"){if(!pattern0.test(data42)){const err119 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}else {const err120 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data.children !== undefined){let data43 = data.children;if(Array.isArray(data43)){if(data43.length < 1){const err121 = {instancePath:instancePath+\"/children\",schemaPath:\"#/oneOf/9/properties/children/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}const len0 = data43.length;for(let i0=0; i0<len0; i0++){let data44 = data43[i0];if(typeof data44 === \"string\"){if(!pattern0.test(data44)){const err122 = {instancePath:instancePath+\"/children/\" + i0,schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}else {const err123 = {instancePath:instancePath+\"/children/\" + i0,schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}}}else {const err124 = {instancePath:instancePath+\"/children\",schemaPath:\"#/oneOf/9/properties/children/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data.hash !== undefined){let data45 = data.hash;if(typeof data45 === \"string\"){if(!pattern14.test(data45)){const err125 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9a-f]{4,40}$\"},message:\"must match pattern \\\"\"+\"^[0-9a-f]{4,40}$\"+\"\\\"\"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}else {const err126 = {instancePath:instancePath+\"/hash\",schemaPath:\"#/definitions/hash/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}}}else {const err127 = {instancePath,schemaPath:\"#/oneOf/9/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}}else if(tag0 === \"line\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err128 = {instancePath,schemaPath:\"#/oneOf/10/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}if(data.box === undefined){const err129 = {instancePath,schemaPath:\"#/oneOf/10/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err129];}else {vErrors.push(err129);}errors++;}if(data.items === undefined){const err130 = {instancePath,schemaPath:\"#/oneOf/10/required\",keyword:\"required\",params:{missingProperty: \"items\"},message:\"must have required property '\"+\"items\"+\"'\"};if(vErrors === null){vErrors = [err130];}else {vErrors.push(err130);}errors++;}for(const key10 in data){if(!(((key10 === \"type\") || (key10 === \"box\")) || (key10 === \"items\"))){const err131 = {instancePath,schemaPath:\"#/oneOf/10/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key10},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err131];}else {vErrors.push(err131);}errors++;}}if(data.type !== undefined){if(\"line\" !== data.type){const err132 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/10/properties/type/const\",keyword:\"const\",params:{allowedValue: \"line\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err132];}else {vErrors.push(err132);}errors++;}}if(data.box !== undefined){let data47 = data.box;if(typeof data47 === \"string\"){if(!pattern0.test(data47)){const err133 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err133];}else {vErrors.push(err133);}errors++;}}else {const err134 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err134];}else {vErrors.push(err134);}errors++;}}if(data.items !== undefined){let data48 = data.items;if(Array.isArray(data48)){if(data48.length > 12){const err135 = {instancePath:instancePath+\"/items\",schemaPath:\"#/oneOf/10/properties/items/maxItems\",keyword:\"maxItems\",params:{limit: 12},message:\"must NOT have more than 12 items\"};if(vErrors === null){vErrors = [err135];}else {vErrors.push(err135);}errors++;}if(data48.length < 1){const err136 = {instancePath:instancePath+\"/items\",schemaPath:\"#/oneOf/10/properties/items/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}const len1 = data48.length;for(let i1=0; i1<len1; i1++){let data49 = data48[i1];if(typeof data49 === \"string\"){if(!pattern0.test(data49)){const err137 = {instancePath:instancePath+\"/items/\" + i1,schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}}else {const err138 = {instancePath:instancePath+\"/items/\" + i1,schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {instancePath:instancePath+\"/items\",schemaPath:\"#/oneOf/10/properties/items/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}}else {const err140 = {instancePath,schemaPath:\"#/oneOf/10/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}else if(tag0 === \"seal\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err141 = {instancePath,schemaPath:\"#/oneOf/11/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}if(data.box === undefined){const err142 = {instancePath,schemaPath:\"#/oneOf/11/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err142];}else {vErrors.push(err142);}errors++;}for(const key11 in data){if(!((key11 === \"type\") || (key11 === \"box\"))){const err143 = {instancePath,schemaPath:\"#/oneOf/11/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key11},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err143];}else {vErrors.push(err143);}errors++;}}if(data.type !== undefined){if(\"seal\" !== data.type){const err144 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/11/properties/type/const\",keyword:\"const\",params:{allowedValue: \"seal\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err144];}else {vErrors.push(err144);}errors++;}}if(data.box !== undefined){let data51 = data.box;if(typeof data51 === \"string\"){if(!pattern0.test(data51)){const err145 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err145];}else {vErrors.push(err145);}errors++;}}else {const err146 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err146];}else {vErrors.push(err146);}errors++;}}}else {const err147 = {instancePath,schemaPath:\"#/oneOf/11/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err147];}else {vErrors.push(err147);}errors++;}}else if(tag0 === \"open\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err148 = {instancePath,schemaPath:\"#/oneOf/12/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}if(data.box === undefined){const err149 = {instancePath,schemaPath:\"#/oneOf/12/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}for(const key12 in data){if(!((key12 === \"type\") || (key12 === \"box\"))){const err150 = {instancePath,schemaPath:\"#/oneOf/12/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key12},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}if(data.type !== undefined){if(\"open\" !== data.type){const err151 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/12/properties/type/const\",keyword:\"const\",params:{allowedValue: \"open\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data.box !== undefined){let data53 = data.box;if(typeof data53 === \"string\"){if(!pattern0.test(data53)){const err152 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}else {const err153 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}}else {const err154 = {instancePath,schemaPath:\"#/oneOf/12/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err154];}else {vErrors.push(err154);}errors++;}}else if(tag0 === \"pick\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err155 = {instancePath,schemaPath:\"#/oneOf/13/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err155];}else {vErrors.push(err155);}errors++;}if(data.box === undefined){const err156 = {instancePath,schemaPath:\"#/oneOf/13/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err156];}else {vErrors.push(err156);}errors++;}for(const key13 in data){if(!((key13 === \"type\") || (key13 === \"box\"))){const err157 = {instancePath,schemaPath:\"#/oneOf/13/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key13},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err157];}else {vErrors.push(err157);}errors++;}}if(data.type !== undefined){if(\"pick\" !== data.type){const err158 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/13/properties/type/const\",keyword:\"const\",params:{allowedValue: \"pick\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err158];}else {vErrors.push(err158);}errors++;}}if(data.box !== undefined){let data55 = data.box;if(typeof data55 === \"string\"){if(!pattern0.test(data55)){const err159 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err159];}else {vErrors.push(err159);}errors++;}}else {const err160 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err160];}else {vErrors.push(err160);}errors++;}}}else {const err161 = {instancePath,schemaPath:\"#/oneOf/13/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err161];}else {vErrors.push(err161);}errors++;}}else if(tag0 === \"stamp\"){if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err162 = {instancePath,schemaPath:\"#/oneOf/14/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err162];}else {vErrors.push(err162);}errors++;}if(data.box === undefined){const err163 = {instancePath,schemaPath:\"#/oneOf/14/required\",keyword:\"required\",params:{missingProperty: \"box\"},message:\"must have required property '\"+\"box\"+\"'\"};if(vErrors === null){vErrors = [err163];}else {vErrors.push(err163);}errors++;}if(data.text === undefined){const err164 = {instancePath,schemaPath:\"#/oneOf/14/required\",keyword:\"required\",params:{missingProperty: \"text\"},message:\"must have required property '\"+\"text\"+\"'\"};if(vErrors === null){vErrors = [err164];}else {vErrors.push(err164);}errors++;}for(const key14 in data){if(!(((key14 === \"type\") || (key14 === \"box\")) || (key14 === \"text\"))){const err165 = {instancePath,schemaPath:\"#/oneOf/14/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key14},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err165];}else {vErrors.push(err165);}errors++;}}if(data.type !== undefined){if(\"stamp\" !== data.type){const err166 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/14/properties/type/const\",keyword:\"const\",params:{allowedValue: \"stamp\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err166];}else {vErrors.push(err166);}errors++;}}if(data.box !== undefined){let data57 = data.box;if(typeof data57 === \"string\"){if(!pattern0.test(data57)){const err167 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err167];}else {vErrors.push(err167);}errors++;}}else {const err168 = {instancePath:instancePath+\"/box\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}}if(data.text !== undefined){let data58 = data.text;if(typeof data58 === \"string\"){if(func3(data58) < 1){const err169 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {instancePath:instancePath+\"/text\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}}else {const err171 = {instancePath,schemaPath:\"#/oneOf/14/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}else if(tag0 === \"strip\"){const _errs185 = errors;let valid75 = false;const _errs186 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.value === undefined){const err172 = {instancePath,schemaPath:\"#/oneOf/15/anyOf/0/required\",keyword:\"required\",params:{missingProperty: \"value\"},message:\"must have required property '\"+\"value\"+\"'\"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}var _valid0 = _errs186 === errors;valid75 = valid75 || _valid0;if(!valid75){const _errs187 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.tag === undefined){const err173 = {instancePath,schemaPath:\"#/oneOf/15/anyOf/1/required\",keyword:\"required\",params:{missingProperty: \"tag\"},message:\"must have required property '\"+\"tag\"+\"'\"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}}var _valid0 = _errs187 === errors;valid75 = valid75 || _valid0;}if(!valid75){const err174 = {instancePath,schemaPath:\"#/oneOf/15/anyOf\",keyword:\"anyOf\",params:{},message:\"must match a schema in anyOf\"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}else {errors = _errs185;if(vErrors !== null){if(_errs185){vErrors.length = _errs185;}else {vErrors = null;}}}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.type === undefined){const err175 = {instancePath,schemaPath:\"#/oneOf/15/required\",keyword:\"required\",params:{missingProperty: \"type\"},message:\"must have required property '\"+\"type\"+\"'\"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}if(data.field === undefined){const err176 = {instancePath,schemaPath:\"#/oneOf/15/required\",keyword:\"required\",params:{missingProperty: \"field\"},message:\"must have required property '\"+\"field\"+\"'\"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}for(const key15 in data){if(!((((key15 === \"type\") || (key15 === \"field\")) || (key15 === \"value\")) || (key15 === \"tag\"))){const err177 = {instancePath,schemaPath:\"#/oneOf/15/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key15},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}}if(data.type !== undefined){if(\"strip\" !== data.type){const err178 = {instancePath:instancePath+\"/type\",schemaPath:\"#/oneOf/15/properties/type/const\",keyword:\"const\",params:{allowedValue: \"strip\"},message:\"must be equal to constant\"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data.field !== undefined){let data60 = data.field;if(typeof data60 === \"string\"){if(func3(data60) < 1){const err179 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}else {const err180 = {instancePath:instancePath+\"/field\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(data.value !== undefined){let data61 = data.value;if(typeof data61 === \"string\"){if(func3(data61) < 1){const err181 = {instancePath:instancePath+\"/value\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+\"/value\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data.tag !== undefined){let data62 = data.tag;if(typeof data62 === \"string\"){if(func3(data62) < 1){const err183 = {instancePath:instancePath+\"/tag\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}else {const err184 = {instancePath:instancePath+\"/tag\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}}else {const err185 = {instancePath,schemaPath:\"#/oneOf/15/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}else {const err186 = {instancePath,schemaPath:\"#/discriminator\",keyword:\"discriminator\",params:{error: \"mapping\", tag: \"type\", tagValue: tag0},message:\"value of tag \\\"type\\\" must be in oneOf\"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}else {const err187 = {instancePath,schemaPath:\"#/discriminator\",keyword:\"discriminator\",params:{error: \"tag\", tag: \"type\", tagValue: tag0},message:\"tag \\\"type\\\" must be string\"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}}else {const err188 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}validate41.errors = vErrors;return errors === 0;}function validate38(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.title === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.body === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"body\"},message:\"must have required property '\"+\"body\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.events === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"events\"},message:\"must have required property '\"+\"events\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((((key0 === \"title\") || (key0 === \"body\")) || (key0 === \"code\")) || (key0 === \"sources\")) || (key0 === \"events\"))){const err3 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.title !== undefined){let data0 = data.title;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err4 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.body !== undefined){let data1 = data.body;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err6 = {instancePath:instancePath+\"/body\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/body\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.code !== undefined){let data2 = data.code;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err8 = {instancePath:instancePath+\"/code\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+\"/code\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.sources !== undefined){let data3 = data.sources;if(Array.isArray(data3)){if(data3.length < 1){const err10 = {instancePath:instancePath+\"/sources\",schemaPath:\"#/properties/sources/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data3.length;for(let i0=0; i0<len0; i0++){if(!(validate39(data3[i0], {instancePath:instancePath+\"/sources/\" + i0,parentData:data3,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);errors = vErrors.length;}}}else {const err11 = {instancePath:instancePath+\"/sources\",schemaPath:\"#/properties/sources/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.events !== undefined){let data5 = data.events;if(Array.isArray(data5)){const len1 = data5.length;for(let i1=0; i1<len1; i1++){if(!(validate41(data5[i1], {instancePath:instancePath+\"/events/\" + i1,parentData:data5,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate41.errors : vErrors.concat(validate41.errors);errors = vErrors.length;}}}else {const err12 = {instancePath:instancePath+\"/events\",schemaPath:\"#/properties/events/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate38.errors = vErrors;return errors === 0;}const schema147 = {\"description\":\"時系列図の種類の欄。生存線を左から並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"lifelines\"],\"properties\":{\"lifelines\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/id\"}}}};function validate46(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.lifelines === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"lifelines\"},message:\"must have required property '\"+\"lifelines\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"lifelines\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.lifelines !== undefined){let data0 = data.lifelines;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/lifelines\",schemaPath:\"#/properties/lifelines/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){let data1 = data0[i0];if(typeof data1 === \"string\"){if(!pattern0.test(data1)){const err3 = {instancePath:instancePath+\"/lifelines/\" + i0,schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/lifelines/\" + i0,schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}else {const err5 = {instancePath:instancePath+\"/lifelines\",schemaPath:\"#/properties/lifelines/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate46.errors = vErrors;return errors === 0;}const schema149 = {\"description\":\"状態遷移図の種類の欄。最初の段より前に書いた、移れるが段で通るとは限らない線\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"paths\"],\"properties\":{\"paths\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/path\"}}}};const schema150 = {\"description\":\"移れる道。送る側に始まりの印 start、受ける側に終わりの印 finish を書ける。どの段にも出ない道は点線で描き、運ぶ物を走らせない\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/id\"},\"to\":{\"$ref\":\"#/definitions/id\"},\"label\":{\"$ref\":\"#/definitions/text\"}}};function validate49(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === \"from\") || (key0 === \"to\")) || (key0 === \"label\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.to !== undefined){let data1 = data.to;if(typeof data1 === \"string\"){if(!pattern0.test(data1)){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.label !== undefined){let data2 = data.label;if(typeof data2 === \"string\"){if(func3(data2) < 1){const err7 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+\"/label\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate49.errors = vErrors;return errors === 0;}function validate48(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.paths === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"paths\"},message:\"must have required property '\"+\"paths\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"paths\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.paths !== undefined){let data0 = data.paths;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/paths\",schemaPath:\"#/properties/paths/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate49(data0[i0], {instancePath:instancePath+\"/paths/\" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+\"/paths\",schemaPath:\"#/properties/paths/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate48.errors = vErrors;return errors === 0;}const schema154 = {\"description\":\"枝分かれの図の種類の欄。枝を上から帯に並べる順\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"branches\"],\"properties\":{\"branches\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/branch\"}}}};const schema155 = {\"description\":\"枝。帯の左に名札と添え書きを置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"note\":{\"$ref\":\"#/definitions/text\"}}};function validate53(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((key0 === \"id\") || (key0 === \"note\"))){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.note !== undefined){let data1 = data.note;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err4 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+\"/note\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate53.errors = vErrors;return errors === 0;}function validate52(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.branches === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"branches\"},message:\"must have required property '\"+\"branches\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"branches\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.branches !== undefined){let data0 = data.branches;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/branches\",schemaPath:\"#/properties/branches/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate53(data0[i0], {instancePath:instancePath+\"/branches/\" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+\"/branches\",schemaPath:\"#/properties/branches/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate52.errors = vErrors;return errors === 0;}const schema158 = {\"description\":\"時間軸の図の種類の欄。目盛り、区切り、印の列、節目、拡大の範囲\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"scale\",\"rows\"],\"properties\":{\"scale\":{\"$ref\":\"#/definitions/scale\"},\"period\":{\"$ref\":\"#/definitions/period\"},\"rows\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/row\"}},\"points\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/point\"}},\"zoom\":{\"$ref\":\"#/definitions/zoom\"}}};const schema159 = {\"description\":\"目盛り。unit の名前の目盛りを length の長さで count 個並べ、最初の目盛りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"unit\",\"length\",\"count\"],\"properties\":{\"unit\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"$ref\":\"#/definitions/duration\"},\"count\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}};const schema161 = {\"description\":\"長さ。数と単位 (ms、s、min、h、d) の組\",\"type\":\"string\",\"pattern\":\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"};const pattern33 = new RegExp(\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\", \"u\");function validate57(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.unit === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"unit\"},message:\"must have required property '\"+\"unit\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"length\"},message:\"must have required property '\"+\"length\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.count === undefined){const err2 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"count\"},message:\"must have required property '\"+\"count\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === \"unit\") || (key0 === \"length\")) || (key0 === \"count\")) || (key0 === \"from\"))){const err3 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.unit !== undefined){let data0 = data.unit;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err4 = {instancePath:instancePath+\"/unit\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+\"/unit\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.length !== undefined){let data1 = data.length;if(typeof data1 === \"string\"){if(!pattern33.test(data1)){const err6 = {instancePath:instancePath+\"/length\",schemaPath:\"#/definitions/duration/pattern\",keyword:\"pattern\",params:{pattern: \"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"},message:\"must match pattern \\\"\"+\"^[0-9]+(\\\\.[0-9]+)?(ms|s|min|h|d)$\"+\"\\\"\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/length\",schemaPath:\"#/definitions/duration/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.count !== undefined){let data2 = data.count;if(!(((typeof data2 == \"number\") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){const err8 = {instancePath:instancePath+\"/count\",schemaPath:\"#/properties/count/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 < 1 || isNaN(data2)){const err9 = {instancePath:instancePath+\"/count\",schemaPath:\"#/properties/count/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}if(data.from !== undefined){let data3 = data.from;if(!(((typeof data3 == \"number\") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))){const err10 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if((typeof data3 == \"number\") && (isFinite(data3))){if(data3 < 0 || isNaN(data3)){const err11 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}}else {const err12 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate57.errors = vErrors;return errors === 0;}const schema162 = {\"description\":\"区切り。目盛り length 個ごとに name の区切りを置き、最初の区切りの番号を from にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"length\"],\"properties\":{\"name\":{\"$ref\":\"#/definitions/text\"},\"length\":{\"type\":\"integer\",\"minimum\":1},\"from\":{\"type\":\"integer\",\"minimum\":0}}};function validate59(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"length\"},message:\"must have required property '\"+\"length\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((key0 === \"name\") || (key0 === \"length\")) || (key0 === \"from\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.name !== undefined){let data0 = data.name;if(typeof data0 === \"string\"){if(func3(data0) < 1){const err3 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.length !== undefined){let data1 = data.length;if(!(((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err5 = {instancePath:instancePath+\"/length\",schemaPath:\"#/properties/length/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 < 1 || isNaN(data1)){const err6 = {instancePath:instancePath+\"/length\",schemaPath:\"#/properties/length/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}if(data.from !== undefined){let data2 = data.from;if(!(((typeof data2 == \"number\") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))){const err7 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if((typeof data2 == \"number\") && (isFinite(data2))){if(data2 < 0 || isNaN(data2)){const err8 = {instancePath:instancePath+\"/from\",schemaPath:\"#/properties/from/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}}else {const err9 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate59.errors = vErrors;return errors === 0;}const schema164 = {\"description\":\"印の列。目盛りごとに印を 1 つ置き、empty の目盛りは空きの印にする\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"name\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"name\":{\"$ref\":\"#/definitions/text\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"empty\":{\"type\":\"array\",\"items\":{\"$ref\":\"#/definitions/unit\"}}}};function validate61(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"name\"},message:\"must have required property '\"+\"name\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((key0 === \"id\") || (key0 === \"name\")) || (key0 === \"color\")) || (key0 === \"empty\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.name !== undefined){let data1 = data.name;if(typeof data1 === \"string\"){if(func3(data1) < 1){const err5 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+\"/name\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.color !== undefined){let data2 = data.color;if(!(((((((data2 === \"blue\") || (data2 === \"amber\")) || (data2 === \"green\")) || (data2 === \"violet\")) || (data2 === \"rose\")) || (data2 === \"slate\")) || (data2 === \"coin\"))){const err7 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.empty !== undefined){let data3 = data.empty;if(Array.isArray(data3)){const len0 = data3.length;for(let i0=0; i0<len0; i0++){let data4 = data3[i0];if(!(((typeof data4 == \"number\") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){const err8 = {instancePath:instancePath+\"/empty/\" + i0,schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if((typeof data4 == \"number\") && (isFinite(data4))){if(data4 < 0 || isNaN(data4)){const err9 = {instancePath:instancePath+\"/empty/\" + i0,schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}}else {const err10 = {instancePath:instancePath+\"/empty\",schemaPath:\"#/properties/empty/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate61.errors = vErrors;return errors === 0;}const schema169 = {\"description\":\"節目。at の目盛りの印の下に旗の丸と名札を置く\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\",\"at\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"at\":{\"$ref\":\"#/definitions/unit\"}}};function validate63(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.at === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"at\"},message:\"must have required property '\"+\"at\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"id\") || (key0 === \"at\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.at !== undefined){let data1 = data.at;if(!(((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err5 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){const err6 = {instancePath:instancePath+\"/at\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate63.errors = vErrors;return errors === 0;}const schema172 = {\"description\":\"拡大の範囲。from から to の目盛りごとに拡大の帯に列を作る\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"from\",\"to\"],\"properties\":{\"from\":{\"$ref\":\"#/definitions/unit\"},\"to\":{\"$ref\":\"#/definitions/unit\"}}};function validate65(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.from === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"from\"},message:\"must have required property '\"+\"from\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.to === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"to\"},message:\"must have required property '\"+\"to\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === \"from\") || (key0 === \"to\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.from !== undefined){let data0 = data.from;if(!(((typeof data0 == \"number\") && (!(data0 % 1) && !isNaN(data0))) && (isFinite(data0)))){const err3 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if((typeof data0 == \"number\") && (isFinite(data0))){if(data0 < 0 || isNaN(data0)){const err4 = {instancePath:instancePath+\"/from\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}if(data.to !== undefined){let data1 = data.to;if(!(((typeof data1 == \"number\") && (!(data1 % 1) && !isNaN(data1))) && (isFinite(data1)))){const err5 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if((typeof data1 == \"number\") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){const err6 = {instancePath:instancePath+\"/to\",schemaPath:\"#/definitions/unit/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 0},message:\"must be >= 0\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}}else {const err7 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate65.errors = vErrors;return errors === 0;}function validate56(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.scale === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"scale\"},message:\"must have required property '\"+\"scale\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.rows === undefined){const err1 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"rows\"},message:\"must have required property '\"+\"rows\"+\"'\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!(((((key0 === \"scale\") || (key0 === \"period\")) || (key0 === \"rows\")) || (key0 === \"points\")) || (key0 === \"zoom\"))){const err2 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.scale !== undefined){if(!(validate57(data.scale, {instancePath:instancePath+\"/scale\",parentData:data,parentDataProperty:\"scale\",rootData}))){vErrors = vErrors === null ? validate57.errors : vErrors.concat(validate57.errors);errors = vErrors.length;}}if(data.period !== undefined){if(!(validate59(data.period, {instancePath:instancePath+\"/period\",parentData:data,parentDataProperty:\"period\",rootData}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.rows !== undefined){let data2 = data.rows;if(Array.isArray(data2)){if(data2.length < 1){const err3 = {instancePath:instancePath+\"/rows\",schemaPath:\"#/properties/rows/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}const len0 = data2.length;for(let i0=0; i0<len0; i0++){if(!(validate61(data2[i0], {instancePath:instancePath+\"/rows/\" + i0,parentData:data2,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate61.errors : vErrors.concat(validate61.errors);errors = vErrors.length;}}}else {const err4 = {instancePath:instancePath+\"/rows\",schemaPath:\"#/properties/rows/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.points !== undefined){let data4 = data.points;if(Array.isArray(data4)){const len1 = data4.length;for(let i1=0; i1<len1; i1++){if(!(validate63(data4[i1], {instancePath:instancePath+\"/points/\" + i1,parentData:data4,parentDataProperty:i1,rootData}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err5 = {instancePath:instancePath+\"/points\",schemaPath:\"#/properties/points/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.zoom !== undefined){if(!(validate65(data.zoom, {instancePath:instancePath+\"/zoom\",parentData:data,parentDataProperty:\"zoom\",rootData}))){vErrors = vErrors === null ? validate65.errors : vErrors.concat(validate65.errors);errors = vErrors.length;}}}else {const err6 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate56.errors = vErrors;return errors === 0;}const schema175 = {\"description\":\"列の図の種類の欄。列に並べるチップ\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"items\"],\"properties\":{\"items\":{\"type\":\"array\",\"minItems\":1,\"items\":{\"$ref\":\"#/definitions/item\"}}}};const schema176 = {\"description\":\"チップ。color を書かないチップは薄い色で、label を書かないチップは色だけで出す\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"id\"],\"properties\":{\"id\":{\"$ref\":\"#/definitions/id\"},\"color\":{\"$ref\":\"#/definitions/color\"},\"label\":{\"description\":\"チップに載せる字\",\"type\":\"string\",\"minLength\":1,\"maxLength\":4}}};function validate69(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"id\"},message:\"must have required property '\"+\"id\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((key0 === \"id\") || (key0 === \"color\")) || (key0 === \"label\"))){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.id !== undefined){let data0 = data.id;if(typeof data0 === \"string\"){if(!pattern0.test(data0)){const err2 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/pattern\",keyword:\"pattern\",params:{pattern: \"^[^\\\\s\\\\[\\\\]「」=:]+$\"},message:\"must match pattern \\\"\"+\"^[^\\\\s\\\\[\\\\]「」=:]+$\"+\"\\\"\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+\"/id\",schemaPath:\"#/definitions/id/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.color !== undefined){let data1 = data.color;if(!(((((((data1 === \"blue\") || (data1 === \"amber\")) || (data1 === \"green\")) || (data1 === \"violet\")) || (data1 === \"rose\")) || (data1 === \"slate\")) || (data1 === \"coin\"))){const err4 = {instancePath:instancePath+\"/color\",schemaPath:\"#/definitions/color/enum\",keyword:\"enum\",params:{allowedValues: schema79.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.label !== undefined){let data2 = data.label;if(typeof data2 === \"string\"){if(func3(data2) > 4){const err5 = {instancePath:instancePath+\"/label\",schemaPath:\"#/properties/label/maxLength\",keyword:\"maxLength\",params:{limit: 4},message:\"must NOT have more than 4 characters\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func3(data2) < 1){const err6 = {instancePath:instancePath+\"/label\",schemaPath:\"#/properties/label/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+\"/label\",schemaPath:\"#/properties/label/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate69.errors = vErrors;return errors === 0;}function validate68(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.items === undefined){const err0 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"items\"},message:\"must have required property '\"+\"items\"+\"'\"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === \"items\")){const err1 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.items !== undefined){let data0 = data.items;if(Array.isArray(data0)){if(data0.length < 1){const err2 = {instancePath:instancePath+\"/items\",schemaPath:\"#/properties/items/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0<len0; i0++){if(!(validate69(data0[i0], {instancePath:instancePath+\"/items/\" + i0,parentData:data0,parentDataProperty:i0,rootData}))){vErrors = vErrors === null ? validate69.errors : vErrors.concat(validate69.errors);errors = vErrors.length;}}}else {const err3 = {instancePath:instancePath+\"/items\",schemaPath:\"#/properties/items/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}else {const err4 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}validate68.errors = vErrors;return errors === 0;}const func2 = Object.prototype.hasOwnProperty;function validate10(data, {instancePath=\"\", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing0;if((data.kind === undefined) && (missing0 = \"kind\")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {if(data.kind !== undefined){if(\"sequence\" !== data.kind){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.sequence === undefined){const err2 = {instancePath,schemaPath:\"#/then/required\",keyword:\"required\",params:{missingProperty: \"sequence\"},message:\"must have required property '\"+\"sequence\"+\"'\"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.boxes !== undefined){let data1 = data.boxes;if(Array.isArray(data1)){if(data1.length < 1){const err3 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/then/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}if(data.steps !== undefined){if(!(validate11(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err4 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.git !== undefined){const err5 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.time !== undefined){const err6 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.lineup !== undefined){const err7 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;ifClause0 = \"then\";}else {const _errs20 = errors;const _errs21 = errors;let valid7 = true;const _errs22 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing1;if((data.kind === undefined) && (missing1 = \"kind\")){const err8 = {};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {if(data.kind !== undefined){if(\"state\" !== data.kind){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}}var _valid1 = _errs22 === errors;errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}let ifClause1;if(_valid1){const _errs24 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.boxes !== undefined){let data9 = data.boxes;if(Array.isArray(data9)){if(data9.length < 1){const err10 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/else/then/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data9.length;for(let i0=0; i0<len0; i0++){let data10 = data9[i0];if(data10 && typeof data10 == \"object\" && !Array.isArray(data10)){if(data10.id !== undefined){let data11 = data10.id;const _errs28 = errors;const _errs29 = errors;if(!((data11 === \"start\") || (data11 === \"finish\"))){const err11 = {};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var valid13 = _errs29 === errors;if(valid13){const err12 = {instancePath:instancePath+\"/boxes/\" + i0+\"/id\",schemaPath:\"#/else/then/properties/boxes/items/properties/id/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs28;if(vErrors !== null){if(_errs28){vErrors.length = _errs28;}else {vErrors = null;}}}}}}}}if(data.steps !== undefined){if(!(validate11(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.git !== undefined){const err13 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.time !== undefined){const err14 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.lineup !== undefined){const err15 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var _valid1 = _errs24 === errors;valid7 = _valid1;ifClause1 = \"then\";}else {const _errs41 = errors;const _errs42 = errors;let valid17 = true;const _errs43 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing2;if((data.kind === undefined) && (missing2 = \"kind\")){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {if(data.kind !== undefined){if(\"git\" !== data.kind){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}}var _valid2 = _errs43 === errors;errors = _errs42;if(vErrors !== null){if(_errs42){vErrors.length = _errs42;}else {vErrors = null;}}let ifClause2;if(_valid2){const _errs45 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.git === undefined){const err18 = {instancePath,schemaPath:\"#/else/else/then/required\",keyword:\"required\",params:{missingProperty: \"git\"},message:\"must have required property '\"+\"git\"+\"'\"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(data.steps !== undefined){if(!(validate17(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate17.errors : vErrors.concat(validate17.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err19 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data.regions !== undefined){const err20 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data.time !== undefined){const err21 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data.lineup !== undefined){const err22 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}var _valid2 = _errs45 === errors;valid17 = _valid2;ifClause2 = \"then\";}else {const _errs60 = errors;const _errs61 = errors;let valid24 = true;const _errs62 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing3;if((data.kind === undefined) && (missing3 = \"kind\")){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {if(data.kind !== undefined){if(\"time\" !== data.kind){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}}var _valid3 = _errs62 === errors;errors = _errs61;if(vErrors !== null){if(_errs61){vErrors.length = _errs61;}else {vErrors = null;}}let ifClause3;if(_valid3){const _errs64 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.time === undefined){const err25 = {instancePath,schemaPath:\"#/else/else/else/then/required\",keyword:\"required\",params:{missingProperty: \"time\"},message:\"must have required property '\"+\"time\"+\"'\"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data.steps !== undefined){if(!(validate20(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);errors = vErrors.length;}}if(data.state !== undefined){const err26 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data.git !== undefined){const err27 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(data.regions !== undefined){const err28 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(data.lineup !== undefined){const err29 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}var _valid3 = _errs64 === errors;valid24 = _valid3;ifClause3 = \"then\";}else {const _errs78 = errors;const _errs79 = errors;let valid31 = true;const _errs80 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing4;if((data.kind === undefined) && (missing4 = \"kind\")){const err30 = {};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}else {if(data.kind !== undefined){if(\"tree\" !== data.kind){const err31 = {};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}}}var _valid4 = _errs80 === errors;errors = _errs79;if(vErrors !== null){if(_errs79){vErrors.length = _errs79;}else {vErrors = null;}}let ifClause4;if(_valid4){const _errs82 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.steps !== undefined){if(!(validate22(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err32 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data.git !== undefined){const err33 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(data.time !== undefined){const err34 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(data.regions !== undefined){const err35 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data.lineup !== undefined){const err36 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}var _valid4 = _errs82 === errors;valid31 = _valid4;ifClause4 = \"then\";}else {const _errs100 = errors;const _errs101 = errors;let valid39 = true;const _errs102 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){let missing5;if((data.kind === undefined) && (missing5 = \"kind\")){const err37 = {};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}else {if(data.kind !== undefined){if(\"lineup\" !== data.kind){const err38 = {};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}}var _valid5 = _errs102 === errors;errors = _errs101;if(vErrors !== null){if(_errs101){vErrors.length = _errs101;}else {vErrors = null;}}let ifClause5;if(_valid5){const _errs104 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.lineup === undefined){const err39 = {instancePath,schemaPath:\"#/else/else/else/else/else/then/required\",keyword:\"required\",params:{missingProperty: \"lineup\"},message:\"must have required property '\"+\"lineup\"+\"'\"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}if(data.boxes !== undefined){let data39 = data.boxes;if(Array.isArray(data39)){if(data39.length < 1){const err40 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/else/else/else/else/else/then/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}const len1 = data39.length;for(let i1=0; i1<len1; i1++){let data40 = data39[i1];if(data40 && typeof data40 == \"object\" && !Array.isArray(data40)){if(data40.icon !== undefined){const err41 = {instancePath:instancePath+\"/boxes/\" + i1+\"/icon\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(data40.link !== undefined){const err42 = {instancePath:instancePath+\"/boxes/\" + i1+\"/link\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}if(data40.region !== undefined){const err43 = {instancePath:instancePath+\"/boxes/\" + i1+\"/region\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}}}}if(data.steps !== undefined){if(!(validate25(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err44 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}if(data.git !== undefined){const err45 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}if(data.time !== undefined){const err46 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(data.regions !== undefined){const err47 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}var _valid5 = _errs104 === errors;valid39 = _valid5;ifClause5 = \"then\";}else {const _errs130 = errors;if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.boxes !== undefined){let data50 = data.boxes;if(Array.isArray(data50)){if(data50.length < 1){const err48 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/else/else/else/else/else/else/properties/boxes/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}if(data.steps !== undefined){if(!(validate11(data.steps, {instancePath:instancePath+\"/steps\",parentData:data,parentDataProperty:\"steps\",rootData}))){vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);errors = vErrors.length;}}if(data.strip !== undefined){if(!(validate13(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);errors = vErrors.length;}}if(data.state !== undefined){const err49 = {instancePath:instancePath+\"/state\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}if(data.git !== undefined){const err50 = {instancePath:instancePath+\"/git\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(data.time !== undefined){const err51 = {instancePath:instancePath+\"/time\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}if(data.lineup !== undefined){const err52 = {instancePath:instancePath+\"/lineup\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}var _valid5 = _errs130 === errors;valid39 = _valid5;ifClause5 = \"else\";}if(!valid39){const err53 = {instancePath,schemaPath:\"#/else/else/else/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause5},message:\"must match \\\"\"+ifClause5+\"\\\" schema\"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}var _valid4 = _errs100 === errors;valid31 = _valid4;ifClause4 = \"else\";}if(!valid31){const err54 = {instancePath,schemaPath:\"#/else/else/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause4},message:\"must match \\\"\"+ifClause4+\"\\\" schema\"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}var _valid3 = _errs78 === errors;valid24 = _valid3;ifClause3 = \"else\";}if(!valid24){const err55 = {instancePath,schemaPath:\"#/else/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause3},message:\"must match \\\"\"+ifClause3+\"\\\" schema\"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}var _valid2 = _errs60 === errors;valid17 = _valid2;ifClause2 = \"else\";}if(!valid17){const err56 = {instancePath,schemaPath:\"#/else/else/if\",keyword:\"if\",params:{failingKeyword: ifClause2},message:\"must match \\\"\"+ifClause2+\"\\\" schema\"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}var _valid1 = _errs41 === errors;valid7 = _valid1;ifClause1 = \"else\";}if(!valid7){const err57 = {instancePath,schemaPath:\"#/else/if\",keyword:\"if\",params:{failingKeyword: ifClause1},message:\"must match \\\"\"+ifClause1+\"\\\" schema\"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.sequence !== undefined){const err58 = {instancePath:instancePath+\"/sequence\",schemaPath:\"#/definitions/absent/not\",keyword:\"not\",params:{},message:\"must NOT be valid\"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}}var _valid0 = _errs20 === errors;valid0 = _valid0;ifClause0 = \"else\";}if(!valid0){const err59 = {instancePath,schemaPath:\"#/if\",keyword:\"if\",params:{failingKeyword: ifClause0},message:\"must match \\\"\"+ifClause0+\"\\\" schema\"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}if(data && typeof data == \"object\" && !Array.isArray(data)){if(data.version === undefined){const err60 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"version\"},message:\"must have required property '\"+\"version\"+\"'\"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}if(data.kind === undefined){const err61 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"kind\"},message:\"must have required property '\"+\"kind\"+\"'\"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}if(data.title === undefined){const err62 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"title\"},message:\"must have required property '\"+\"title\"+\"'\"};if(vErrors === null){vErrors = [err62];}else {vErrors.push(err62);}errors++;}if(data.boxes === undefined){const err63 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"boxes\"},message:\"must have required property '\"+\"boxes\"+\"'\"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}if(data.steps === undefined){const err64 = {instancePath,schemaPath:\"#/required\",keyword:\"required\",params:{missingProperty: \"steps\"},message:\"must have required property '\"+\"steps\"+\"'\"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}for(const key0 in data){if(!(func2.call(schema11.properties, key0))){const err65 = {instancePath,schemaPath:\"#/additionalProperties\",keyword:\"additionalProperties\",params:{additionalProperty: key0},message:\"must NOT have additional properties\"};if(vErrors === null){vErrors = [err65];}else {vErrors.push(err65);}errors++;}}if(data.version !== undefined){let data58 = data.version;if(!(((typeof data58 == \"number\") && (!(data58 % 1) && !isNaN(data58))) && (isFinite(data58)))){const err66 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/type\",keyword:\"type\",params:{type: \"integer\"},message:\"must be integer\"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}if((typeof data58 == \"number\") && (isFinite(data58))){if(data58 < 1 || isNaN(data58)){const err67 = {instancePath:instancePath+\"/version\",schemaPath:\"#/properties/version/minimum\",keyword:\"minimum\",params:{comparison: \">=\", limit: 1},message:\"must be >= 1\"};if(vErrors === null){vErrors = [err67];}else {vErrors.push(err67);}errors++;}}}if(data.kind !== undefined){let data59 = data.kind;if(!(((((((data59 === \"sequence\") || (data59 === \"architecture\")) || (data59 === \"state\")) || (data59 === \"git\")) || (data59 === \"time\")) || (data59 === \"tree\")) || (data59 === \"lineup\"))){const err68 = {instancePath:instancePath+\"/kind\",schemaPath:\"#/properties/kind/enum\",keyword:\"enum\",params:{allowedValues: schema11.properties.kind.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}}if(data.title !== undefined){let data60 = data.title;if(typeof data60 === \"string\"){if(func3(data60) < 1){const err69 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/minLength\",keyword:\"minLength\",params:{limit: 1},message:\"must NOT have fewer than 1 characters\"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}else {const err70 = {instancePath:instancePath+\"/title\",schemaPath:\"#/definitions/text/type\",keyword:\"type\",params:{type: \"string\"},message:\"must be string\"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data.view !== undefined){let data61 = data.view;if(!((data61 === \"fixed\") || (data61 === \"follow\"))){const err71 = {instancePath:instancePath+\"/view\",schemaPath:\"#/properties/view/enum\",keyword:\"enum\",params:{allowedValues: schema11.properties.view.enum},message:\"must be equal to one of the allowed values\"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}}if(data.regions !== undefined){let data62 = data.regions;if(Array.isArray(data62)){const len2 = data62.length;for(let i2=0; i2<len2; i2++){if(!(validate30(data62[i2], {instancePath:instancePath+\"/regions/\" + i2,parentData:data62,parentDataProperty:i2,rootData}))){vErrors = vErrors === null ? validate30.errors : vErrors.concat(validate30.errors);errors = vErrors.length;}}}else {const err72 = {instancePath:instancePath+\"/regions\",schemaPath:\"#/properties/regions/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}}if(data.boxes !== undefined){let data64 = data.boxes;if(Array.isArray(data64)){const len3 = data64.length;for(let i3=0; i3<len3; i3++){if(!(validate32(data64[i3], {instancePath:instancePath+\"/boxes/\" + i3,parentData:data64,parentDataProperty:i3,rootData}))){vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);errors = vErrors.length;}}}else {const err73 = {instancePath:instancePath+\"/boxes\",schemaPath:\"#/properties/boxes/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err73];}else {vErrors.push(err73);}errors++;}}if(data.strip !== undefined){if(!(validate34(data.strip, {instancePath:instancePath+\"/strip\",parentData:data,parentDataProperty:\"strip\",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data.steps !== undefined){let data67 = data.steps;if(Array.isArray(data67)){if(data67.length < 1){const err74 = {instancePath:instancePath+\"/steps\",schemaPath:\"#/properties/steps/minItems\",keyword:\"minItems\",params:{limit: 1},message:\"must NOT have fewer than 1 items\"};if(vErrors === null){vErrors = [err74];}else {vErrors.push(err74);}errors++;}const len4 = data67.length;for(let i4=0; i4<len4; i4++){if(!(validate38(data67[i4], {instancePath:instancePath+\"/steps/\" + i4,parentData:data67,parentDataProperty:i4,rootData}))){vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);errors = vErrors.length;}}}else {const err75 = {instancePath:instancePath+\"/steps\",schemaPath:\"#/properties/steps/type\",keyword:\"type\",params:{type: \"array\"},message:\"must be array\"};if(vErrors === null){vErrors = [err75];}else {vErrors.push(err75);}errors++;}}if(data.sequence !== undefined){if(!(validate46(data.sequence, {instancePath:instancePath+\"/sequence\",parentData:data,parentDataProperty:\"sequence\",rootData}))){vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);errors = vErrors.length;}}if(data.state !== undefined){if(!(validate48(data.state, {instancePath:instancePath+\"/state\",parentData:data,parentDataProperty:\"state\",rootData}))){vErrors = vErrors === null ? validate48.errors : vErrors.concat(validate48.errors);errors = vErrors.length;}}if(data.git !== undefined){if(!(validate52(data.git, {instancePath:instancePath+\"/git\",parentData:data,parentDataProperty:\"git\",rootData}))){vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);errors = vErrors.length;}}if(data.time !== undefined){if(!(validate56(data.time, {instancePath:instancePath+\"/time\",parentData:data,parentDataProperty:\"time\",rootData}))){vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);errors = vErrors.length;}}if(data.lineup !== undefined){if(!(validate68(data.lineup, {instancePath:instancePath+\"/lineup\",parentData:data,parentDataProperty:\"lineup\",rootData}))){vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);errors = vErrors.length;}}}else {const err76 = {instancePath,schemaPath:\"#/type\",keyword:\"type\",params:{type: \"object\"},message:\"must be object\"};if(vErrors === null){vErrors = [err76];}else {vErrors.push(err76);}errors++;}validate10.errors = vErrors;return errors === 0;}\n","/**\n * 図の原本の形と、原本を JSON Schema で検査する命令。\n *\n * 形の正は `schemas/diagram.schema.json` の 1 本で、下の型はその写し。\n * 誤りは JSON Pointer で場所を示す。欄が足りない時と知らない欄がある時は、その欄の場所まで示す。\n * 誤りの文は呼ぶ側が渡した言葉 (渡さなければ日本語) で出す。文の表は `field-messages.ts` が持つ (#2999)。\n *\n * 検査の関数は schema から前もって書き出した物 (`schemas/validate-diagram.js`) を使う。\n * ajv に schema をその場で組み立てさせると `new Function` を使い、`eval` を許さない頁の CSP で止まる。\n * 書き出しは `scripts/build-validator.mjs` が ajv の設定 `{ allErrors: true, discriminator: true, strictTypes: false }` で行う。\n */\nimport type { ErrorObject } from \"ajv\";\nimport { type Allowed, FIELD_MESSAGES, type FieldMessages, type Forbidden } from \"./field-messages\";\nimport validate from \"./schemas/validate-diagram.js\";\nimport { type NotationLang, STATE_ENDS } from \"./words\";\n\nexport type Color = \"blue\" | \"amber\" | \"green\" | \"violet\" | \"rose\" | \"slate\" | \"coin\";\n/** 色の役の一覧。記法の `color:` に書ける値と、誤りの文に並べる値 */\nexport const COLORS: readonly Color[] = [\"blue\", \"amber\", \"green\", \"violet\", \"rose\", \"slate\", \"coin\"];\n\nexport interface Region {\n id: string;\n name: string;\n note?: string;\n color?: Color;\n icon?: string;\n}\n\nexport interface Box {\n id: string;\n name: string;\n sub?: string;\n color?: Color;\n icon?: string;\n region?: string;\n /** 飛び先。描いた図ではこの箱がここへの link になる。`/` で始まる path か、http:// か https:// で始まる URL (#3199) */\n link?: string;\n}\n\nexport type Carry = { kind: \"envelope\" } | { kind: \"tag\"; text: string } | { kind: \"coin\" } | { kind: \"none\" };\n\nexport type LabelSide = \"above\" | \"below\" | \"left\" | \"right\";\n\n/** 見せ方。`fixed` は全体を止めて中だけ動かし、`follow` は寄って動かし全体図で今どこかを示す。 */\nexport type ViewMode = \"fixed\" | \"follow\";\n\nexport type DiagramEvent =\n | { type: \"edge\"; from: string; to: string; label?: string; carry: Carry; labelSide?: LabelSide; at?: number; into?: number }\n | { type: \"action\"; box: string; label: string }\n | { type: \"swap\"; box: string; text: string; color?: Color }\n | { type: \"strip\"; field: string; value?: string; tag?: string }\n | GitCommit\n | { type: \"branch\"; branch: string; from: string }\n | { type: \"now\"; to: number }\n | TimeMarkEvent\n | TimeSpanEvent\n | TreeLeaf\n | TreeNode\n | LineupOrder\n | { type: \"seal\" | \"open\" | \"pick\"; box: string }\n | LineupStamp;\n\n/** 時間軸の図 (#3165) の、印の列 `row` の `from` から `to` の目盛りの印の色を変える出来事 */\nexport interface TimeMarkEvent {\n type: \"mark\";\n row: string;\n from: number;\n to: number;\n color: Color;\n}\n\n/** 時間軸の図の、`from` から `to` の目盛りの括弧と字。`shape` が `box` なら印の列を囲み、字を縁の札にする */\nexport interface TimeSpanEvent {\n type: \"span\";\n from: number;\n to: number;\n text: string;\n shape?: \"box\";\n color?: Color;\n}\n\n/** 時間軸の図の目盛り。`unit` の名前の目盛りを `length` の長さ (`12s` など) で `count` 個並べ、最初の目盛りの番号を `from` にする */\nexport interface TimeScale {\n unit: string;\n length: string;\n count: number;\n from?: number;\n}\n\n/** 時間軸の図の区切り。目盛り `length` 個ごとに `name` の区切りを置き、最初の区切りの番号を `from` にする */\nexport interface TimePeriod {\n name: string;\n length: number;\n from?: number;\n}\n\n/** 時間軸の図の印の列。目盛りごとに印を 1 つ置き、`empty` の目盛りは空きの印にする */\nexport interface TimeRow {\n id: string;\n name: string;\n color?: Color;\n empty?: number[];\n}\n\n/** 時間軸の図の節目。`at` の目盛りの印の下に旗の丸と名札を置く */\nexport interface TimePoint {\n id: string;\n at: number;\n}\n\n/** 時間軸の図の種類の欄 */\nexport interface TimeSpec {\n scale: TimeScale;\n period?: TimePeriod;\n rows: TimeRow[];\n points?: TimePoint[];\n /** 拡大の帯に列を作る目盛りの範囲 */\n zoom?: { from: number; to: number };\n}\n\n/** 中身の帯の物差しの欄。`line` の割合 (`2/3` か `97%`) の所に線を引く */\nexport interface StripMeter {\n field: string;\n line: string;\n}\n\n/**\n * 枝分かれの図 (#3164) の commit を積む出来事。積んだ枝の札と、その枝を指す HEAD が新しい commit へ進む。\n * 当て直し (`copy`) は枝の札を動かさず、merge commit (`merge`) は取り込む枝の先端も親に持つ\n */\nexport interface GitCommit {\n type: \"commit\";\n id: string;\n branch: string;\n copy?: string;\n merge?: string;\n hash?: string;\n note?: string;\n}\n\n/**\n * 木の図 (#3233) の葉を出す出来事。書いた段で葉の箱が現れる。`hash` を書くと箱に値を出し、名札を葉の下の札に出す\n */\nexport interface TreeLeaf {\n type: \"leaf\";\n id: string;\n hash?: string;\n}\n\n/** 木の図の、1 つ以上の子から親を組む出来事。書いた段で親の箱と、子から親への木の線が現れる */\nexport interface TreeNode {\n type: \"node\";\n id: string;\n children: string[];\n hash?: string;\n}\n\n/** 列の図 (#3239) の、列 `box` の並びを `items` に書き換える出来事。前の段との差分を描く部品が滑る動きに変える */\nexport interface LineupOrder {\n type: \"line\";\n box: string;\n items: string[];\n}\n\n/** 列の図の、列 `box` の右に `text` の札を押す出来事 */\nexport interface LineupStamp {\n type: \"stamp\";\n box: string;\n text: string;\n}\n\n/** 列の図のチップ。`color` を書かないチップは薄い色で、`label` を書かないチップは色だけで出す */\nexport interface LineupItem {\n id: string;\n color?: Color;\n label?: string;\n}\n\n/** 枝分かれの図の枝。上から宣言した順に帯を並べる */\nexport interface GitBranch {\n id: string;\n note?: string;\n}\n\n/** 状態遷移図の、最初の段より前に書いた移れる道。`from` に `start`、`to` に `finish` を書ける */\nexport interface StatePath {\n from: string;\n to: string;\n label?: string;\n}\n\n/** 段の出典。読み上げの段の一覧に、名前を URL への link にして出す。URL の形は箱の飛び先と同じ (#3199) */\nexport interface StepSource {\n name: string;\n url: string;\n}\n\nexport interface Step {\n title: string;\n body: string;\n code?: string;\n /** 書いた順の出典。書かない段は欄を持たない */\n sources?: StepSource[];\n events: DiagramEvent[];\n}\n\nexport interface Diagram {\n version: number;\n kind: \"sequence\" | \"architecture\" | \"state\" | \"git\" | \"time\" | \"tree\" | \"lineup\";\n title: string;\n view?: ViewMode;\n regions?: Region[];\n boxes: Box[];\n strip?: { title: string; fields: string[]; meters?: StripMeter[] };\n steps: Step[];\n sequence?: { lifelines: string[] };\n state?: { paths: StatePath[] };\n git?: { branches: GitBranch[] };\n time?: TimeSpec;\n lineup?: { items: LineupItem[] };\n}\n\nexport interface FieldError {\n /** 誤った欄の場所 (JSON Pointer) */\n pointer: string;\n message: string;\n}\n\nexport type Checked = { ok: true } | { ok: false; errors: FieldError[] };\n\nexport interface CheckOptions {\n /** 誤りの文の言葉。渡さなければ日本語 */\n lang?: NotationLang;\n}\n\n/** 段の中で起きることの種類。schema の event の `discriminator` が見る `type` の値 */\nconst EVENT_TYPES = [\"edge\", \"action\", \"swap\", \"strip\", \"commit\", \"branch\", \"now\", \"mark\", \"span\", \"leaf\", \"node\", \"line\", \"seal\", \"open\", \"pick\", \"stamp\"] as const satisfies readonly DiagramEvent[\"type\"][];\n\n/**\n * その種類の図に書けない根の欄を書いた時の決まりの場所 (#3164)。根の欄に `not: {}` を置く決まり (`absent`) を指し、\n * 誤りの場所の最後の欄が書いた欄になる。種類の欄は、その欄と同じ名前の図の種類だけが書ける\n */\nconst ABSENT = \"#/definitions/absent/not\";\n/**\n * 種類の欄でない欄を書ける図の種類。区画は枝分かれの図と時間軸の図に書けない。\n * 線の列 (`at` と `into`)、節目の丸の色 (`color`)、物差し (`meters`) は時間軸の図だけが書ける (#3165)\n */\nconst ABSENT_KINDS: Record<string, string> = {\n regions: \"sequence / architecture / state\",\n at: \"time\",\n into: \"time\",\n color: \"time\",\n meters: \"time\",\n region: \"sequence / architecture / state\",\n icon: \"sequence / architecture / state / git / time / tree\",\n link: \"sequence / architecture / state / git / time / tree\",\n};\n/** 運ぶ物の書けない組み合わせ (`not: { required: [欄] }`)。誤りの場所の最後の欄で引く */\nconst NOT_ALLOWED: Record<string, Allowed> = {\n carry: { field: \"text\", kind: \"tag\" },\n};\n\n/** 状態遷移図の箱の名札に予約の名前を書いた時の決まりの場所 */\nconst RESERVED_ID = /\\/boxes\\/items\\/properties\\/id\\/not$/u;\n/** 枝分かれの図でない図に、枝分かれの図だけの出来事を書いた時の決まりの場所 (#3164) */\nconst GIT_EVENT = /\\/events\\/items\\/properties\\/type\\/not$/u;\n/** 枝分かれの図だけが書ける出来事 */\nconst GIT_EVENTS = [\"commit\", \"branch\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 時間軸の図でない図に、時間軸の図だけの出来事を書いた時の決まりの場所 (#3165)。出来事に `not` を置く */\nconst TIME_EVENT = /\\/events\\/items\\/not$/u;\n/** 時間軸の図だけが書ける出来事 */\nconst TIME_EVENTS = [\"now\", \"mark\", \"span\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 木の図でない図に、木の図だけの出来事を書いた時の決まりの場所 (#3233)。出来事の `allOf` の中に `not` を置く */\nconst TREE_EVENT = /\\/events\\/items\\/allOf\\/0\\/not$/u;\n/** 木の図だけが書ける出来事 */\nconst TREE_EVENTS = [\"leaf\", \"node\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 列の図でない図に、列の図だけの出来事を書いた時の決まりの場所 (#3239) */\nconst LINEUP_EVENT = \"#/definitions/notLineupEvent/not\";\n/** 列の図だけが書ける出来事 */\nconst LINEUP_EVENTS = [\"line\", \"seal\", \"open\", \"pick\", \"stamp\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 列の図に、線と処理の出来事を書いた時の決まりの場所 (#3239) */\nconst WIRED_EVENT = \"#/definitions/notWiredEvent/not\";\n/** 列の図が書けない、箱と線の図の出来事 */\nconst WIRED_EVENTS = [\"edge\", \"action\"] as const satisfies readonly DiagramEvent[\"type\"][];\n/** 時間軸の図の目盛りの長さの決まり (`^[0-9]+(\\.[0-9]+)?(<単位>|<単位>)$`)。書ける単位を読む */\nconst DURATION = /^\\^\\[0-9\\]\\+\\(\\\\\\.\\[0-9\\]\\+\\)\\?\\(([a-z|]+)\\)\\$$/u;\n/** 割合の決まり。百分率の `%` を持つ */\nconst RATIO = /%\\)\\$$/u;\n\nconst escape = (key: string): string => key.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\");\n\n/** 箱の飛び先と段の出典の URL の決まりの場所 (#3199) */\nconst URL_RULE = \"#/definitions/url/pattern\";\n\n/** commit の hash の決まり (`^[0-9a-f]{<最小>,<最大>}$`)。字の数の幅を読む */\nconst HEX = /^\\^\\[0-9a-f\\]\\{(\\d+),(\\d+)\\}\\$$/u;\n\n/** `^[^…]+$` の形の決まりから書けない字を読む。違う形の決まりでは `undefined` */\nfunction forbiddenOf(pattern: string): Forbidden | undefined {\n const inside = /^\\^\\[\\^(.+)\\]\\+\\$$/u.exec(pattern)?.[1];\n if (inside === undefined) return undefined;\n const chars: string[] = inside.match(/\\\\.|[^\\\\]/gu) ?? [];\n return { space: chars.includes(\"\\\\s\"), chars: chars.filter((char) => char !== \"\\\\s\").map((char) => char.replace(/^\\\\/u, \"\")) };\n}\n\n/** `anyOf` の中の決まりが出した誤り。`anyOf` の誤り 1 つにまとめて出す */\nconst branchesOf = (anyOf: ErrorObject, errors: readonly ErrorObject[]): ErrorObject[] =>\n errors.filter(\n (error) =>\n error !== anyOf &&\n error.schemaPath.startsWith(`${anyOf.schemaPath}/`) &&\n (error.instancePath === anyOf.instancePath || error.instancePath.startsWith(`${anyOf.instancePath}/`)),\n );\n\nfunction toFieldError(error: ErrorObject, errors: readonly ErrorObject[], m: FieldMessages): FieldError {\n const params = error.params as Record<string, unknown>;\n const at = error.instancePath;\n switch (error.keyword) {\n case \"additionalProperties\": {\n const key = String(params.additionalProperty);\n return { pointer: `${at}/${escape(key)}`, message: m.additionalProperties(key) };\n }\n case \"required\": {\n const key = String(params.missingProperty);\n return { pointer: `${at}/${escape(key)}`, message: m.required(key) };\n }\n case \"not\": {\n if (RESERVED_ID.test(error.schemaPath)) return { pointer: at, message: m.reserved(STATE_ENDS) };\n if (GIT_EVENT.test(error.schemaPath)) return { pointer: at, message: m.kindOnly(GIT_EVENTS, \"git\") };\n if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TIME_EVENTS, \"time\") };\n if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TREE_EVENTS, \"tree\") };\n if (error.schemaPath === LINEUP_EVENT) return { pointer: `${at}/type`, message: m.kindOnly(LINEUP_EVENTS, \"lineup\") };\n if (error.schemaPath === WIRED_EVENT) return { pointer: `${at}/type`, message: m.kindOnly(WIRED_EVENTS, \"sequence / architecture / state / git / time / tree\") };\n const last = at.slice(at.lastIndexOf(\"/\") + 1);\n if (error.schemaPath === ABSENT) return { pointer: at, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };\n const allowed = NOT_ALLOWED[last];\n return { pointer: allowed ? `${at}/${allowed.field}` : at, message: m.not(allowed) };\n }\n case \"anyOf\": {\n const branches = branchesOf(error, errors);\n const missing = branches.every((branch) => branch.keyword === \"required\") ? branches.map((branch) => String(branch.params.missingProperty)) : [];\n return { pointer: at, message: m.anyOf(missing) };\n }\n case \"discriminator\": {\n const tag = String(params.tag);\n return { pointer: `${at}/${escape(tag)}`, message: m.discriminator(tag, EVENT_TYPES) };\n }\n case \"enum\":\n return { pointer: at, message: m.enum((params.allowedValues as unknown[]).map(String)) };\n case \"type\":\n return { pointer: at, message: m.type(String(params.type)) };\n case \"minLength\":\n return { pointer: at, message: m.minLength(Number(params.limit)) };\n case \"maxLength\":\n return { pointer: at, message: m.maxLength(Number(params.limit)) };\n case \"pattern\": {\n if (error.schemaPath === URL_RULE) return { pointer: at, message: m.url };\n const pattern = String(params.pattern);\n const hex = HEX.exec(pattern);\n if (hex) return { pointer: at, message: m.hex(Number(hex[1]), Number(hex[2])) };\n const duration = DURATION.exec(pattern);\n if (duration) return { pointer: at, message: m.duration((duration[1] ?? \"\").split(\"|\")) };\n if (RATIO.test(pattern)) return { pointer: at, message: m.ratio };\n return { pointer: at, message: m.pattern(forbiddenOf(pattern)) };\n }\n case \"minItems\":\n return { pointer: at, message: m.minItems(Number(params.limit)) };\n case \"maxItems\":\n return { pointer: at, message: m.maxItems(Number(params.limit)) };\n case \"minimum\":\n return { pointer: at, message: m.minimum(Number(params.limit)) };\n case \"const\":\n return { pointer: at, message: m.const(String(params.allowedValue)) };\n case \"oneOf\":\n return { pointer: at, message: m.oneOf };\n default:\n return { pointer: at, message: error.message ?? error.keyword };\n }\n}\n\n/** 原本の JSON を検査する。版が道具より新しいかは見ない (`readDiagram` が見る)。 */\nexport function validateDiagram(input: unknown, options: CheckOptions = {}): Checked {\n if (validate(input)) return { ok: true };\n const all = validate.errors ?? [];\n const inBranch = new Set(all.filter((error) => error.keyword === \"anyOf\").flatMap((anyOf) => branchesOf(anyOf, all)));\n const m = FIELD_MESSAGES[options.lang ?? \"ja\"];\n // 条件付きの決まり (if / then) は中で落ちた決まりの誤りを別に出すので、包む側の if の誤りは出さない\n const errors = all.filter((error) => error.keyword !== \"if\" && !inBranch.has(error)).map((error) => toFieldError(error, all, m));\n return { ok: false, errors };\n}\n","/**\n * dragon記法の誤りの文 (#2997、#3137)。\n *\n * 記法の語は英語だけで file から言葉が決まらないため、誤りの文は呼ぶ側が渡した言葉\n * (渡さなければ日本語) で出す。文の中の記法の語は語の表から引き、表と文で語が食い違わないようにする。\n */\nimport { COLORS } from \"./schema\";\nimport { CARRIES, DURATION_UNITS, HEADS, KINDS, type NotationLang, SIDES, SPAN_SHAPES, VIEWS } from \"./words\";\n\n/** 新しい形のどの行の書き方を示すか。前の形の行に当たった時に、誤りの文が書き方を示す */\nexport type Shape = \"sequence\" | \"architecture\" | \"group\" | \"box\" | \"strip\" | \"view\" | \"step\" | \"say\" | \"code\" | \"act\" | \"note\" | \"set\";\n\nexport interface Messages {\n noHead: string;\n badHead: string;\n /** 前の形の `word` を書いた行。`shape` の行の書き方を示す */\n oldForm: (word: string, shape: Shape) => string;\n unknownHead: (word: string) => string;\n duplicate: (id: string) => string;\n needsId: (word: string) => string;\n badId: (id: string) => string;\n afterId: string;\n undeclaredBox: (id: string) => string;\n noBody: (title: string) => string;\n emptyStepTitle: string;\n noBoxes: string;\n noSteps: string;\n emptySay: string;\n sayTwice: string;\n codeTwice: string;\n emptyCode: string;\n /** 段の出典の行の形 (#3199) */\n sourceShape: string;\n declarationInStep: string;\n stepLineBeforeStep: string;\n nestedGroup: string;\n strayEnd: string;\n endTakesNothing: string;\n unclosedGroup: (id: string) => string;\n regionReopened: (id: string) => string;\n emptyName: (id: string) => string;\n stripTwice: string;\n stripShape: string;\n emptyStripField: string;\n stripUndeclared: string;\n noSuchField: (field: string) => string;\n stripNeedsValue: string;\n actShape: string;\n noteShape: string;\n edgeShape: string;\n emptyLabel: string;\n quoteUnclosed: string;\n afterQuote: string;\n attrUnclosed: string;\n attrNoColon: (raw: string) => string;\n attrNoValue: (key: string) => string;\n attrTwice: (key: string) => string;\n badAttr: (key: string, allowed: readonly string[]) => string;\n badColor: string;\n badView: string;\n badCarry: string;\n badSide: string;\n /** 箱の飛び先 (`link`) か段の出典 (`url`) に、頁を移る形でない URL を書いた (#3199) */\n badUrl: (key: string) => string;\n carryTwice: string;\n /** 状態遷移図の箱の名札に、始まりか終わりの印の名前を書いた */\n reservedId: (id: string) => string;\n intoStart: string;\n outOfFinish: string;\n /** 状態遷移図の最初の step より前の線に、属性を書いた */\n pathNoAttrs: string;\n /** 枝分かれの図だけの行 (`branch` と `commit`) を、別の種類の図に書いた (#3164) */\n gitOnly: (word: string) => string;\n gitNoGroup: string;\n noBranches: string;\n branchShape: string;\n commitShape: string;\n fromShape: string;\n undeclaredBranch: (id: string) => string;\n /** 札を動かす線の送る側が、枝の名札でも HEAD でもない */\n undeclaredRef: (id: string) => string;\n noCommit: (id: string) => string;\n /** 取り込む枝が、まだどの commit も指していない */\n emptyBranch: (id: string) => string;\n mergeSelf: (id: string) => string;\n /** 枝分かれの図で、今いる場所の札の名前 (`name`) を名札にした */\n headReserved: (name: string) => string;\n badHash: string;\n /** 時間軸の図だけの行か属性 (`word`) を、別の種類の図に書いた (#3165) */\n timeOnly: (word: string) => string;\n /** 木の図だけの行 (`leaf` と `node`) を、別の種類の図に書いた (#3233) */\n treeOnly: (word: string) => string;\n treeNoGroup: string;\n noLeaves: string;\n leafShape: string;\n nodeShape: string;\n /** 親の子に、まだ書いていない名札を書いた */\n noTreeChild: (id: string) => string;\n /** 親の子に、木の箱でない箱 (`box`) を書いた */\n notTreeBox: (id: string) => string;\n /** もう親を持つ箱を、別の親の子にした */\n twoParents: (id: string) => string;\n /** 最後の段を終えて、親を持たない箱が根の外に残った */\n manyRoots: (id: string, root: string) => string;\n /** 列の図だけの行 (`item`、`line`、`seal`、`open`、`pick`、`stamp`) を、別の種類の図に書いた (#3239) */\n lineupOnly: (word: string) => string;\n lineupNoGroup: string;\n lineupNoEdge: string;\n lineupNoAct: string;\n noItems: string;\n itemShape: string;\n lineShape: string;\n /** `seal`、`open`、`pick` の行の形 */\n laneShape: (word: string) => string;\n stampShape: string;\n /** チップの字が上限の字数を超えた */\n labelTooLong: (limit: number) => string;\n /** `line` の行に、宣言していないチップを書いた */\n noSuchItem: (id: string) => string;\n /** 同じ `line` の行に、同じチップを 2 度書いた */\n itemTwice: (id: string) => string;\n /** `line` の行のチップが、1 列の上限を超えた */\n laneFull: (lane: string, limit: number) => string;\n lineOnSealed: (lane: string) => string;\n sealTwice: (lane: string) => string;\n openUnsealed: (lane: string) => string;\n /** 時間軸の図の宣言の行を 2 つ書いた */\n timeTwice: (word: string) => string;\n noScale: string;\n noRows: string;\n scaleShape: string;\n periodShape: string;\n rowShape: string;\n pointShape: string;\n zoomShape: string;\n nowShape: string;\n markShape: string;\n spanShape: string;\n badLength: string;\n badCount: (word: string) => string;\n /** 目盛りの位置か範囲 (`text`) が、0 から `count - 1` の外か、範囲の形でない */\n badUnit: (text: string, count: number) => string;\n /** 針を前の時刻 (`at` の目盛りの終わり) より先へ進めない `now` */\n nowBack: (text: string, at: number) => string;\n /** 拡大の帯の外の列 */\n outOfZoom: (from: number, to: number) => string;\n noZoom: string;\n /** 時間軸の図の箱を宣言したのに、拡大の帯 (`zoom`) が無い */\n boxNeedsZoom: string;\n boxLineNeedsAt: string;\n pointLineNoAt: string;\n mixedLine: string;\n undeclaredRow: (id: string) => string;\n /** 時間軸の図の note の行の名札が、箱でも節目でもない */\n undeclaredNote: (id: string) => string;\n nowReserved: (name: string) => string;\n noteColorPointOnly: string;\n badShape: string;\n badRatio: string;\n /** 物差しの欄 `field` の値が割合でない */\n meterValue: (field: string) => string;\n}\n\nconst list = (words: readonly string[]): string => words.join(\" / \");\n\nconst ja = (): Messages => {\n const shapes: Record<Shape, string> = {\n sequence: \"sequence <題>\",\n architecture: \"architecture <題>\",\n group: \"group <名札> as <名前> [note: <添え書き>] から end まで\",\n box: \"box <名札> as <名前> [note: <下の小さな字>]\",\n strip: \"strip <題>: <欄>, <欄>\",\n view: \"sequence <題> [view: follow]\",\n step: \"step <段の題>\",\n say: \"say <段の本文>\",\n code: \"code <命令>\",\n act: \"act <名札>: <処理の名前>\",\n note: \"note <名札>: <下の小さな字>\",\n set: \"set <欄>: <値> [tag: <札>]\",\n };\n return {\n noHead: `最初の行に図の種類 (${list(KINDS)}) と題を書く`,\n badHead: `最初の行は ${KINDS.join(\" か \")} で始め、続けて題を書く`,\n oldForm: (word, shape) => `${word} は前の形の書き方。新しい形では ${shapes[shape]} と書く`,\n unknownHead: (word) => `${word} は行の頭に書けない。行は ${list(HEADS)} か、<名札> -> <名札> で始める`,\n duplicate: (id) => `${id} は既に宣言した名札`,\n needsId: (word) => `${word} の後ろに名札を書く`,\n badId: (id) => `${id} は名札に使えない。名札には空白と [ ] 「 」 = : を含めない`,\n afterId: \"名札の後ろには as <名前> か属性を書く\",\n undeclaredBox: (id) => `${id} という箱は宣言していない`,\n noBody: (title) => `段「${title}」に本文 (say の行) が要る`,\n emptyStepTitle: \"step の後ろに段の題を書く\",\n noBoxes: \"箱を 1 つ以上宣言する\",\n noSteps: \"段 (step の行) を 1 つ以上書く\",\n emptySay: \"say の後ろか、その下に字下げした行に段の本文を書く\",\n sayTwice: \"1 つの段に say は 1 つまで。長い本文は say の下に字下げして続ける\",\n codeTwice: \"1 つの段に code は 1 行まで\",\n emptyCode: \"code の後ろに命令を書く\",\n sourceShape: \"source は source <名前> [url: <URL>] の形で書く\",\n declarationInStep: \"group と box と strip と branch と、scale と period と row と point と zoom は最初の step より前に書く\",\n stepLineBeforeStep: \"線と say と code と source と act と note と set と commit と枝を切る行と、now と mark と span と、leaf と node の行は step の下に書く\",\n nestedGroup: \"group の中に group は書けない。先に end で閉じる\",\n strayEnd: \"end の前に、閉じる group が無い\",\n endTakesNothing: \"end の後ろには何も書かない\",\n unclosedGroup: (id) => `group ${id} を end で閉じていない`,\n regionReopened: (id) => `group ${id} は宣言済み。もう一度開く時は group ${id} だけを書き、名前と属性は最初の宣言に書く`,\n emptyName: (id) => `${id} の名前が空`,\n stripTwice: \"strip は 1 つだけ宣言する\",\n stripShape: \"strip は strip <題>: <欄>, <欄> の形で書く\",\n emptyStripField: \"strip の欄の名前が空\",\n stripUndeclared: \"set を書く前に、strip <題>: <欄>, <欄> で帯を宣言する\",\n noSuchField: (field) => `${field} という欄は strip に無い`,\n stripNeedsValue: \"set は set <欄>: <値> か set <欄> [tag: <札>] の形で書く\",\n actShape: \"act は act <名札>: <処理の名前> の形で書く\",\n noteShape: \"note は note <名札>: <下の小さな字> の形で書く\",\n edgeShape: \"線は <名札> -> <名札>: <線の名前> [<属性>] の形で書く\",\n emptyLabel: \"線の : の後ろに線の名前を書く。名前を書かない時は : も書かない\",\n quoteUnclosed: '\" で始めた字を \" で閉じていない',\n afterQuote: '\" で閉じた字の後ろには、属性か次の , だけを書く',\n attrUnclosed: \"属性は [ で始めて ] で閉じ、行の終わりに置く\",\n attrNoColon: (raw) => `[${raw}] は書けない。属性は [<鍵>: <値>] の形で書く`,\n attrNoValue: (key) => `${key}: の後ろに値を書く`,\n attrTwice: (key) => `${key} は 1 つの行に 1 つまで`,\n badAttr: (key, allowed) => `${key} はこの行に書けない属性。書けるのは ${list(allowed)}`,\n badColor: `color は ${list(COLORS)} のどれか`,\n badView: `view は ${list(VIEWS)} のどれか`,\n badCarry: `carry は ${list(CARRIES)} のどれか。札は tag: <値> で書く`,\n badSide: `side は ${list(SIDES)} のどれか`,\n badUrl: (key) => `${key} には / で始まる path か、http:// か https:// で始まる URL を書く`,\n carryTwice: \"運ぶ物は 1 本の線に 1 つまで。carry と tag は一緒に書かない\",\n reservedId: (id) => `${id} は状態遷移図の始まりと終わりの印の名前で、箱の名札に使えない`,\n intoStart: \"start へ入る線は書けない。start は始まりの印で、線は start から出る\",\n outOfFinish: \"finish から出る線は書けない。finish は終わりの印で、線は finish へ入る\",\n pathNoAttrs: \"最初の step より前の線は今回は通らない道なので、属性 (carry と tag と side) を書けない\",\n gitOnly: (word) => `${word} の行は git (枝分かれの図) でだけ書ける`,\n gitNoGroup: \"git (枝分かれの図) には group を書けない。枝は branch の行で宣言する\",\n noBranches: \"branch の行で枝を 1 つ以上宣言する\",\n branchShape: \"branch は branch <名札> [note: <添え書き>] の形で書く\",\n commitShape: \"commit は commit <名札> on <枝> [hash: <hash>, note: <一言>] の形で書く。当て直しは copy <commit> を、取り込みは merge <枝> を on <枝> の後ろに書く\",\n fromShape: \"枝を切る行は <枝> from <commit> の形で書く\",\n undeclaredBranch: (id) => `${id} という枝は宣言していない`,\n undeclaredRef: (id) => `${id} という枝は宣言していない。札を動かす線は枝の名札か HEAD から引く`,\n noCommit: (id) => `${id} という commit はまだ積んでいない`,\n emptyBranch: (id) => `${id} の枝はまだどの commit も指していないので取り込めない`,\n mergeSelf: (id) => `${id} は積む枝なので、取り込む枝にできない`,\n headReserved: (name) => `${name} は枝分かれの図で今いる場所の札の名前で、名札に使えない`,\n badHash: \"hash は 0 から 9 と a から f の字で 4 から 40 字にする\",\n timeOnly: (word) => `${word} は time (時間軸の図) でだけ書ける`,\n treeOnly: (word) => `${word} の行は tree (木の図) でだけ書ける`,\n treeNoGroup: \"tree (木の図) には group を書けない。木の箱は leaf と node の行で書く\",\n noLeaves: \"leaf の行で葉を 1 つ以上書く\",\n leafShape: \"leaf は leaf <名札> [hash: <hash>] の形で書く\",\n nodeShape: \"node は node <名札> of <子>, <子> [hash: <hash>] の形で書く\",\n noTreeChild: (id) => `${id} という葉か親はまだ書いていない。子は前に leaf か node で書いた名札にする`,\n notTreeBox: (id) => `${id} は box の行で置いた箱で、木の箱でない。子は leaf か node で書いた名札にする`,\n twoParents: (id) => `${id} はもう別の親の子になっている。木の箱の親は 1 つだけ`,\n manyRoots: (id, root) => `${id} が親を持たないまま残る。木の根は 1 つだけで、${id} も ${root} も最後に 1 つの根へ組む`,\n lineupOnly: (word) => `${word} の行は lineup (列の図) でだけ書ける`,\n lineupNoGroup: \"lineup (列の図) には group を書けない。列は box の行で宣言する\",\n lineupNoEdge: \"lineup (列の図) には線の行を書けない。チップは line の行で列の並びを書くと動く\",\n lineupNoAct: \"lineup (列の図) には act の行を書けない。列の右上の字は note の行で書き換える\",\n noItems: \"item の行でチップを 1 つ以上宣言する\",\n itemShape: \"item は item <名札>, <名札> [color: <色>, label: <字>] の形で書く\",\n lineShape: \"line は line <列>: <チップ>, <チップ> の形で書く\",\n laneShape: (word) => `${word} は ${word} <列> の形で書く`,\n stampShape: \"stamp は stamp <列>: <字> の形で書く\",\n labelTooLong: (limit) => `label は ${limit} 字までにする`,\n noSuchItem: (id) => `${id} というチップは宣言していない`,\n itemTwice: (id) => `${id} はこの行に 2 度書いている。同じ列に同じチップは 1 枚だけ`,\n laneFull: (lane, limit) => `${lane} の列に並べられるチップは ${limit} 枚まで`,\n lineOnSealed: (lane) => `${lane} の列は封をしているので並びを書けない。先に open で開ける`,\n sealTwice: (lane) => `${lane} の列にはもう封をしている`,\n openUnsealed: (lane) => `${lane} の列には封をしていない`,\n timeTwice: (word) => `${word} は 1 つだけ宣言する`,\n noScale: \"scale の行で目盛りを宣言する\",\n noRows: \"row の行で印の列を 1 つ以上宣言する\",\n scaleShape: \"scale は scale <単位> <長さ> <数> [from: <番号>] の形で書く\",\n periodShape: \"period は period <名前> <目盛りの数> [from: <番号>] の形で書く\",\n rowShape: \"row は row <名札> as <名前> [color: <色>, empty: <目盛り> <目盛り>] の形で書く\",\n pointShape: \"point は point <名札> at <目盛り> の形で書く\",\n zoomShape: \"zoom は zoom <目盛り>-<目盛り> の形で書く\",\n nowShape: \"針を進める行は now -> <目盛り> の形で書く\",\n markShape: \"mark は mark <列> <目盛り>-<目盛り> [color: <色>] の形で書く\",\n spanShape: `span は span <目盛り>-<目盛り>: <字> [shape: ${list(SPAN_SHAPES)}, color: <色>] の形で書く`,\n badLength: `長さは数と単位 (${list(DURATION_UNITS)}) の組で書く (12s など)`,\n badCount: (word) => `${word} の目盛りの数は 1 以上の整数にする`,\n badUnit: (text, count) => `${text} は目盛りの位置にできない。0 から ${count - 1} の数か、その範囲 (0-3 など) を書く`,\n nowBack: (text, at) => `now -> ${text} は針を進めない。前の now (${at}) より後の目盛りを書く`,\n outOfZoom: (from, to) => `拡大の帯の列は ${from} から ${to} の目盛りから選ぶ`,\n noZoom: \"at と into は、zoom で拡大の帯を宣言した図の箱どうしの線にだけ書ける\",\n boxNeedsZoom: \"時間軸の図の箱は拡大の帯に置く。zoom <目盛り>-<目盛り> で拡大の範囲を書く\",\n boxLineNeedsAt: \"拡大の帯の箱どうしの線には [at: <目盛り>] で列を書く\",\n pointLineNoAt: \"節目どうしの線は軸の上に引くので、at と into を書けない\",\n mixedLine: \"線は箱どうしか、節目どうしで引く\",\n undeclaredRow: (id) => `${id} という印の列は宣言していない`,\n undeclaredNote: (id) => `${id} という箱か節目は宣言していない`,\n nowReserved: (name) => `${name} は時間軸の図で針を進める行の語で、名札に使えない`,\n noteColorPointOnly: \"note の color は節目の丸の色で、節目の note にだけ書ける\",\n badShape: `shape は ${list(SPAN_SHAPES)} だけ書ける。括弧は shape を書かない`,\n badRatio: \"物差しの線は分数 (2/3) か百分率 (97%) で書く\",\n meterValue: (field) => `${field} は物差しの欄なので、値を分数 (2/3) か百分率 (97%) で書く`,\n };\n};\n\nconst en = (): Messages => {\n const shapes: Record<Shape, string> = {\n sequence: \"sequence <title>\",\n architecture: \"architecture <title>\",\n group: \"group <id> as <name> [note: <note>] through end\",\n box: \"box <id> as <name> [note: <caption>]\",\n strip: \"strip <title>: <field>, <field>\",\n view: \"sequence <title> [view: follow]\",\n step: \"step <step title>\",\n say: \"say <step body>\",\n code: \"code <command>\",\n act: \"act <id>: <action>\",\n note: \"note <id>: <caption>\",\n set: \"set <field>: <value> [tag: <tag>]\",\n };\n return {\n noHead: `Write the diagram kind (${list(KINDS)}) and a title on the first line`,\n badHead: `Start the first line with ${KINDS.join(\" or \")}, followed by the title`,\n oldForm: (word, shape) => `${word} is the old notation. Write ${shapes[shape]} instead`,\n unknownHead: (word) => `A line cannot start with ${word}. Start a line with ${list(HEADS)}, or <id> -> <id>`,\n duplicate: (id) => `${id} is already declared`,\n needsId: (word) => `Write an id after ${word}`,\n badId: (id) => `${id} cannot be an id. An id has no spaces and none of [ ] 「 」 = :`,\n afterId: \"Write as <name> or attributes after the id\",\n undeclaredBox: (id) => `No box named ${id} is declared`,\n noBody: (title) => `Step \"${title}\" needs a body (a say line)`,\n emptyStepTitle: \"Write a title after step\",\n noBoxes: \"Declare at least one box\",\n noSteps: \"Write at least one step (a step line)\",\n emptySay: \"Write the step body after say, or on indented lines below it\",\n sayTwice: \"A step takes one say. Continue a long body on indented lines below it\",\n codeTwice: \"A step takes at most one code line\",\n emptyCode: \"Write the command after code\",\n sourceShape: \"Write a source as source <name> [url: <URL>]\",\n declarationInStep: \"Write group, box, strip, branch, scale, period, row, point and zoom before the first step\",\n stepLineBeforeStep: \"Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark, span, leaf and node under a step\",\n nestedGroup: \"A group cannot hold another group. Close it with end first\",\n strayEnd: \"There is no group for this end to close\",\n endTakesNothing: \"Write nothing after end\",\n unclosedGroup: (id) => `group ${id} is not closed with end`,\n regionReopened: (id) => `group ${id} is already declared. To open it again, write only group ${id}; put the name and attributes on the first one`,\n emptyName: (id) => `${id} has an empty name`,\n stripTwice: \"Declare only one strip\",\n stripShape: \"Write a strip as strip <title>: <field>, <field>\",\n emptyStripField: \"A strip field name is empty\",\n stripUndeclared: \"Declare the strip as strip <title>: <field>, <field> before writing set\",\n noSuchField: (field) => `The strip has no field named ${field}`,\n stripNeedsValue: \"Write set as set <field>: <value> or set <field> [tag: <tag>]\",\n actShape: \"Write act as act <id>: <action>\",\n noteShape: \"Write note as note <id>: <caption>\",\n edgeShape: \"Write a line as <id> -> <id>: <label> [<attributes>]\",\n emptyLabel: \"Write the label after the : of a line, or leave out the : as well\",\n quoteUnclosed: 'A value that starts with \" is not closed with \"',\n afterQuote: 'After a value closed with \", write only attributes or the next ,',\n attrUnclosed: \"Start attributes with [, close them with ], and put them at the end of the line\",\n attrNoColon: (raw) => `[${raw}] cannot be read. Write an attribute as [<key>: <value>]`,\n attrNoValue: (key) => `Write a value after ${key}:`,\n attrTwice: (key) => `Write ${key} only once on a line`,\n badAttr: (key, allowed) => `${key} cannot be written on this line. Write ${list(allowed)}`,\n badColor: `color is one of ${list(COLORS)}`,\n badView: `view is one of ${list(VIEWS)}`,\n badCarry: `carry is one of ${list(CARRIES)}. Write a tag as tag: <value>`,\n badSide: `side is one of ${list(SIDES)}`,\n badUrl: (key) => `Write a path that starts with / or a URL that starts with http:// or https:// for ${key}`,\n carryTwice: \"A line carries one thing. Do not write carry and tag together\",\n reservedId: (id) => `${id} names the start or end mark of a state diagram and cannot be a box id`,\n intoStart: \"A line cannot go into start. start is the start mark, and lines leave it\",\n outOfFinish: \"A line cannot leave finish. finish is the end mark, and lines go into it\",\n pathNoAttrs: \"A line before the first step is a path not taken, so it takes no attributes (carry, tag, side)\",\n gitOnly: (word) => `${word} lines can be written only in git diagrams`,\n gitNoGroup: \"A git diagram takes no group. Declare branches with branch lines\",\n noBranches: \"Declare at least one branch with a branch line\",\n branchShape: \"Write a branch as branch <id> [note: <note>]\",\n commitShape: \"Write a commit as commit <id> on <branch> [hash: <hash>, note: <note>]. For a replayed commit add copy <commit>, and for a merge commit add merge <branch>, after on <branch>\",\n fromShape: \"Write a branch cut as <branch> from <commit>\",\n undeclaredBranch: (id) => `No branch named ${id} is declared`,\n undeclaredRef: (id) => `No branch named ${id} is declared. A line that moves a ref starts from a branch id or HEAD`,\n noCommit: (id) => `No commit named ${id} has been made yet`,\n emptyBranch: (id) => `Branch ${id} does not point at any commit yet, so it cannot be merged`,\n mergeSelf: (id) => `${id} is the branch being committed to, so it cannot be the branch merged in`,\n headReserved: (name) => `${name} names where you are in a git diagram and cannot be an id`,\n badHash: \"Write a hash as 4 to 40 characters of 0-9 and a-f\",\n timeOnly: (word) => `${word} can be written only in time diagrams`,\n treeOnly: (word) => `${word} lines can be written only in tree diagrams`,\n treeNoGroup: \"A tree diagram takes no group. Write the tree boxes with leaf and node lines\",\n noLeaves: \"Write at least one leaf with a leaf line\",\n leafShape: \"Write a leaf as leaf <id> [hash: <hash>]\",\n nodeShape: \"Write a node as node <id> of <child>, <child> [hash: <hash>]\",\n noTreeChild: (id) => `No leaf or node named ${id} has been written yet. A child must be an id written earlier with leaf or node`,\n notTreeBox: (id) => `${id} is a box from a box line, not a tree box. A child must be an id written with leaf or node`,\n twoParents: (id) => `${id} is already a child of another node. A tree box has only one parent`,\n manyRoots: (id, root) => `${id} is left without a parent. A tree has one root, so join ${id} and ${root} under one root by the end`,\n lineupOnly: (word) => `${word} lines can be written only in lineup diagrams`,\n lineupNoGroup: \"A lineup diagram takes no group. Declare the lanes with box lines\",\n lineupNoEdge: \"A lineup diagram takes no edge lines. Chips move when a line line rewrites a lane\",\n lineupNoAct: \"A lineup diagram takes no act lines. Rewrite the text at the top right of a lane with a note line\",\n noItems: \"Declare at least one chip with an item line\",\n itemShape: \"Write an item as item <id>, <id> [color: <color>, label: <text>]\",\n lineShape: \"Write a line as line <lane>: <chip>, <chip>\",\n laneShape: (word) => `Write ${word} as ${word} <lane>`,\n stampShape: \"Write a stamp as stamp <lane>: <text>\",\n labelTooLong: (limit) => `A label is at most ${limit} characters`,\n noSuchItem: (id) => `The chip ${id} is not declared`,\n itemTwice: (id) => `${id} is written twice on this line. A lane holds one of each chip`,\n laneFull: (lane, limit) => `The lane ${lane} holds at most ${limit} chips`,\n lineOnSealed: (lane) => `The lane ${lane} is sealed, so its order cannot be written. Open it first`,\n sealTwice: (lane) => `The lane ${lane} is already sealed`,\n openUnsealed: (lane) => `The lane ${lane} is not sealed`,\n timeTwice: (word) => `Declare only one ${word}`,\n noScale: \"Declare the scale with a scale line\",\n noRows: \"Declare at least one row with a row line\",\n scaleShape: \"Write a scale as scale <unit> <length> <count> [from: <number>]\",\n periodShape: \"Write a period as period <name> <units> [from: <number>]\",\n rowShape: \"Write a row as row <id> as <name> [color: <color>, empty: <unit> <unit>]\",\n pointShape: \"Write a point as point <id> at <unit>\",\n zoomShape: \"Write a zoom as zoom <unit>-<unit>\",\n nowShape: \"Write a needle line as now -> <unit>\",\n markShape: \"Write a mark as mark <row> <unit>-<unit> [color: <color>]\",\n spanShape: `Write a span as span <unit>-<unit>: <text> [shape: ${list(SPAN_SHAPES)}, color: <color>]`,\n badLength: `Write a length as a number and a unit (${list(DURATION_UNITS)}), such as 12s`,\n badCount: (word) => `The unit count of ${word} is a whole number of 1 or more`,\n badUnit: (text, count) => `${text} cannot be a unit. Write a number from 0 to ${count - 1}, or a range such as 0-3`,\n nowBack: (text, at) => `now -> ${text} does not move the needle forward. Write a unit after the previous now (${at})`,\n outOfZoom: (from, to) => `Pick a zoom column from units ${from} to ${to}`,\n noZoom: \"at and into are allowed only on lines between boxes in a diagram that declares a zoom\",\n boxNeedsZoom: \"Boxes of a time diagram sit in the zoom band. Write the zoom range as zoom <unit>-<unit>\",\n boxLineNeedsAt: \"Write the column of a line between zoom boxes as [at: <unit>]\",\n pointLineNoAt: \"A line between points runs along the axis, so it takes no at or into\",\n mixedLine: \"Draw a line between two boxes or between two points\",\n undeclaredRow: (id) => `No row named ${id} is declared`,\n undeclaredNote: (id) => `No box or point named ${id} is declared`,\n nowReserved: (name) => `${name} starts the needle line of a time diagram and cannot be an id`,\n noteColorPointOnly: \"The color of a note colors the circle of a point, so write it only on the note of a point\",\n badShape: `shape takes only ${list(SPAN_SHAPES)}. A bracket takes no shape`,\n badRatio: \"Write the meter line as a fraction (2/3) or a percentage (97%)\",\n meterValue: (field) => `${field} is a meter, so write its value as a fraction (2/3) or a percentage (97%)`,\n };\n};\n\nconst MESSAGES: Record<NotationLang, Messages> = { ja: ja(), en: en() };\n\nexport const messagesFor = (lang: NotationLang): Messages => MESSAGES[lang];\n","/**\n * 記法を 1 行ずつに切る。\n *\n * 空行とコメントの行 (`//` で始まる行) も捨てずに返す。`say` の下に字下げして続けた本文では、\n * 空行も `//` で始まる行も本文の字になるため、捨てるかは読む側が行の場所で決める (#3137)。\n * 行の頭と終わりの空白は落とし、頭の空白の字の数を `indent` に残す。\n * 誤りを示すために元の行の番号と、残した字が始まる列を持たせる。\n * 行と列は 1 から数え、列は字の数で数える (UTF-16 の単位では数えない)。\n */\nexport interface SourceLine {\n line: number;\n column: number;\n /** 行の頭の空白の字の数。`say` の続きの行を見分ける */\n indent: number;\n text: string;\n}\n\n/** 空行かコメントの行 */\nexport const isBlankOrComment = (source: SourceLine): boolean => source.text === \"\" || source.text.startsWith(\"//\");\n\n/** `text` の `index` 番目 (UTF-16 の位置) にある字が、行の何列目かを返す。 */\nexport function columnOf(source: SourceLine, index: number): number {\n return source.column + Array.from(source.text.slice(0, index)).length;\n}\n\nexport function tokenize(notation: string): SourceLine[] {\n return notation.split(/\\r?\\n/).map((raw, index) => {\n const indent = Array.from(raw.slice(0, raw.length - raw.trimStart().length)).length;\n return { line: index + 1, column: indent + 1, indent, text: raw.trim() };\n });\n}\n","/**\n * 原本の形式の版。\n *\n * 道具より新しい版の図は描かずに断る。古い版の図は、版を 1 つずつ上げる変換を通して読み、\n * 原本の file を書き換えるのは移行の命令 (`migrateFile`、Node でだけ動く入口 `node.ts`) だけにする。\n * 今は版 1 しか無いため、版を上げる変換はまだ持たない。版 2 を作る時に、版 1 から 2 への変換と\n * 古い版を読んだ時の警告をここに足す。\n */\nimport { FIELD_MESSAGES } from \"./field-messages\";\nimport { type CheckOptions, type Diagram, type FieldError, validateDiagram } from \"./schema\";\nimport type { NotationLang } from \"./words\";\n\n/** この道具が読める原本の版 */\nexport const FORMAT_VERSION = 1;\n\nexport type Read = { ok: true; diagram: Diagram; warnings: string[] } | { ok: false; errors: FieldError[] };\n\nfunction newerThanTool(input: unknown): number | undefined {\n if (typeof input !== \"object\" || input === null) return undefined;\n const version = (input as { version?: unknown }).version;\n return typeof version === \"number\" && version > FORMAT_VERSION ? version : undefined;\n}\n\nconst newerError = (version: number, lang: NotationLang): FieldError => ({\n pointer: \"/version\",\n message: FIELD_MESSAGES[lang].newer(version, FORMAT_VERSION),\n});\n\n/** 原本を読む。道具より新しい版は描かずに断り、形の誤りは検査の誤りとして返す。誤りの文は `options.lang` (渡さなければ日本語) で出す。 */\nexport function readDiagram(input: unknown, options: CheckOptions = {}): Read {\n const newer = newerThanTool(input);\n if (newer !== undefined) return { ok: false, errors: [newerError(newer, options.lang ?? \"ja\")] };\n const checked = validateDiagram(input, options);\n if (!checked.ok) return checked;\n return { ok: true, diagram: input as Diagram, warnings: [] };\n}\n","/**\n * 人が書く dragon記法を、図の原本の JSON へ変える (#3137)。\n *\n * 行の種類は行の頭の英語の語で決まり、線の行だけは箱の名札から始まる。最初の `step` より前に\n * 図の種類と題と区画と箱と帯を宣言し、`step` ごとに、その段で起きることを起きる順に並べる。\n *\n * sequence <題> [view: fixed か follow] 書かなければ字の大きさで選ぶ。図の種類は sequence と architecture と state\n * group <名札> as <名前> [note: <添え書き>, color: <色>, icon: <印>]\n * box <名札> as <名前> [note: <下の小さな字>, color: <色>, icon: <印>, link: <飛び先>]\n * end 同じ名札の group はもう一度開ける\n * box <名札> as <名前> [...] as が無ければ名札を名前にする\n * strip <題>: <欄>, <欄>\n * step <段の題>\n * say <段の本文> say の下に字下げした行は本文の続き\n * code <段で打つ命令>\n * source <出典の名前> [url: <URL>] 1 つの段に何行でも書ける\n * <名札> -> <名札>: <線の名前> [carry: <運ぶ物>, tag: <値>, side: <側>]\n * act <名札>: <処理の名前> 箱の中の処理\n * note <名札>: <字> 箱の下の小さな字の書き換え\n * set <欄>: <値> [tag: <札>] 中身の帯の値\n *\n * 鍵と値はコロンで区切り、属性は `[ ]` の中に `,` で並べて行の終わりに置く。\n * 空白を含む名前と文は行の終わりか `[` の前に置き、`[` を含む名前と `,` か `]` を含む属性の値だけを\n * `\"` で囲む。囲みの中では `\\\"` が `\"`、`\\\\` が `\\` になる。字下げは `say` の続きの行を見分ける時だけ意味を持つ。\n *\n * 箱の飛び先 (`link`) と段の出典の `url` は描いた図と段の一覧の link にそのまま入るため、頁を移る形\n * (`/` で始まる path か、`http://` か `https://` で始まる URL) だけを受ける (#3199)。\n *\n * 状態遷移図 (`state`) では、線の送る側に始まりの印 `start`、受ける側に終わりの印 `finish` を書ける。\n * 最初の `step` より前に書いた線は、移れるが段で通るとは限らない道 (`state.paths`) になり、属性を持たない (#3163)。\n * 状態遷移図の `start` と `finish` は箱の名札に使えない。時系列図と構成図では宣言して使う普通の名札のまま。\n *\n * 枝分かれの図 (`git`、#3164) は、最初の `step` より前に `branch <名札> [note: <添え書き>]` で枝を上から順に宣言し、\n * 段の中に `commit <名札> on <枝> [hash: <hash>, note: <一言>]` で commit を積み、`<枝> from <commit>` で枝を切る。\n * 当て直しは `on <枝>` の後ろに `copy <commit>` を、merge commit は `merge <枝>` を続ける。\n * 線の行は札を動かす行になり、送る側に枝の名札か `HEAD`、受ける側に積んだ commit を書く。運ぶ物は書かなければ送る側の名前の札。\n * 枝分かれの図では `HEAD` を名札に使えず、区画 (`group`) は書けない。`branch` と `commit` の行は枝分かれの図でだけ書ける。\n *\n * 時間軸の図 (`time`、#3165) は、最初の `step` より前に目盛りと区切りと印の列と節目と拡大の範囲を宣言する。\n *\n * scale <単位> <長さ> <数> [from: <最初の番号>] 長さは数と単位 (ms、s、min、h、d) の組 (`12s`)\n * period <名前> <目盛りの数> [from: <最初の番号>]\n * row <名札> as <名前> [color: <色>, empty: <目盛り> <目盛り>]\n * point <名札> at <目盛り>\n * zoom <目盛り>-<目盛り>\n *\n * 段の中では `now -> <目盛り>` で針をその目盛りの終わりまで進め、`mark <列> <範囲> [color: <色>]` で印の色を変え、\n * `span <範囲>: <字> [shape: box, color: <色>]` で範囲に括弧か囲みを出す。目盛りは 0 から数え、範囲は `0-31` か `0` と書く。\n * 箱は拡大の帯に置き、箱どうしの線は `[at: <目盛り>]` で列を選び、受ける箱を別の列から選ぶ時は `[into: <目盛り>]` を足す。\n * 節目どうしの線は軸の上に引き、`note <節目>: <状態> [color: <色>]` で節目の状態と丸の色を変える。\n * 中身の帯の欄の名前の後ろに `[meter: <割合>]` を書くと物差しになり、`set` の値を割合 (`97%` か `2/3`) で書く。\n * 印の列と箱は同じ名札を持てる (空いた目盛りの列でその箱を空きの枠にするため)。時間軸の図では `now` を名札に使えない。\n *\n * 木の図 (`tree`、#3233) は、段の中に `leaf <名札> [hash: <hash>]` で葉を出し、`node <名札> of <子>, <子> [hash: <hash>]` で\n * 前に書いた葉か親を子にして親を組む。箱は書いた段で現れ、親は 1 つだけ持てる。最後の段を終えた時に親を持たない木の箱は根の 1 つだけ。\n * 線の端には木の箱も `box` の箱も書ける。木の図に区画 (`group`) は書けず、`leaf` と `node` の行は木の図でだけ書ける。\n *\n * 列の図 (`lineup`、#3239) は、`box` の行が列になり、最初の `step` より前に `item <名札>, <名札> [color: <色>, label: <字>]` でチップを宣言する。\n * 段の中で `line <列>: <チップ>, <チップ>` と書くと列の並びが替わり、`seal <列>` で封をし、`open <列>` で開け、`pick <列>` で列を選び、\n * `stamp <列>: <字>` で札を押す。列の図に区画 (`group`) と線と `act` の行は書けない。封をした列の並びは、開けるまで書けない。\n * `item`、`line`、`seal`、`open`、`pick`、`stamp` の行は列の図でだけ書ける。\n *\n * 行の頭の語と同じ綴りの名札 (`end` や `step`) も書ける。名札の次に `->` が来る行は線と読む。\n * 誤りは最初の 1 つで止め、行と列を示す。誤りの文の言葉は呼ぶ側が渡す。\n */\nimport { type Messages, messagesFor, type Shape } from \"./messages\";\nimport {\n type Box,\n type Carry,\n type Color,\n COLORS,\n type Diagram,\n type DiagramEvent,\n type GitBranch,\n type GitCommit,\n type LabelSide,\n type LineupItem,\n type Region,\n type StatePath,\n type Step,\n type StepSource,\n type StripMeter,\n type TimePeriod,\n type TimePoint,\n type TimeRow,\n type TimeScale,\n type ViewMode,\n} from \"./schema\";\nimport { columnOf, isBlankOrComment, type SourceLine, tokenize } from \"./tokenize\";\nimport { FORMAT_VERSION } from \"./version\";\nimport {\n AS,\n AT,\n ATTRS,\n CARRIES,\n COPY,\n FROM,\n HEAD,\n HEADS,\n KINDS,\n LABEL_MOST,\n LANE_ATTRS,\n LANE_MOST,\n LINEUP_HEADS,\n MERGE,\n type NotationLang,\n NOW,\n OF,\n OLD_HEADS,\n ON,\n SIDES,\n SPAN_SHAPES,\n STATE_ENDS,\n TIME_EDGE_ATTRS,\n TIME_HEADS,\n TREE_HEADS,\n VIEWS,\n} from \"./words\";\n\nexport interface LineError {\n line: number;\n column: number;\n message: string;\n}\n\nexport type Parsed = { ok: true; diagram: Diagram } | { ok: false; errors: LineError[] };\n\nexport interface ParseOptions {\n /** 誤りの文の言葉。既定は日本語 */\n lang?: NotationLang;\n}\n\nclass NotationError extends Error {\n constructor(\n readonly line: number,\n readonly column: number,\n message: string,\n ) {\n super(message);\n }\n}\n\nconst fail = (source: SourceLine, index: number, message: string): NotationError =>\n new NotationError(source.line, columnOf(source, index), message);\n\n/** 名札に使える字。原本の JSON の名札の形と同じ */\nconst ID = /^[^\\s[\\]「」=:]+$/u;\n/** 線の行。名札、`->`、名札 */\nconst EDGE = /^([^\\s:[\\]]+?)\\s*->\\s*([^\\s:[\\]]+)/du;\n/** 枝分かれの図の `commit` の行。名札と、`on` の枝と、`copy` の当て直しの元と、`merge` の取り込む枝 */\nconst COMMIT = new RegExp(`^commit\\\\s+([^\\\\s[]+)(?:\\\\s+${ON}\\\\s+([^\\\\s[]+))?(?:\\\\s+${COPY}\\\\s+([^\\\\s[]+))?(?:\\\\s+${MERGE}\\\\s+([^\\\\s[]+))?`, \"du\");\n/** 枝分かれの図の、枝を切る行。枝と `from` と切る commit */\nconst CUT = new RegExp(`^([^\\\\s[]+)\\\\s+${FROM}(?:\\\\s+([^\\\\s[]+))?\\\\s*$`, \"du\");\n/** 木の図の `leaf` の行の名札と、`node` の行の名札と `of` */\nconst LEAF = /^leaf\\s+([^\\s[]+)/du;\nconst NODE = new RegExp(`^node\\\\s+([^\\\\s[]+)\\\\s+${OF}\\\\s+`, \"du\");\n/** 列の図の、`line <列>:` と `stamp <列>:` の行の列と、`seal`、`open`、`pick` の行の列 */\nconst ORDER = /^line\\s+([^\\s:[]+)\\s*:/du;\nconst STAMP = /^stamp\\s+([^\\s:[]+)\\s*:/du;\nconst ON_LANE = /^(?:seal|open|pick)\\s+(\\S+)\\s*$/du;\n/** commit の hash。原本の JSON の hash の形と同じ */\nconst HASH = /^[0-9a-f]{4,40}$/u;\n/** 箱の飛び先と段の出典の URL。原本の JSON の URL の形と同じ */\nconst URL_FORM = /^(\\/|https?:\\/\\/)/u;\n/** 時間軸の図の宣言の行。`scale <単位> <長さ> <数>`、`period <名前> <数>`、`point <名札> at <目盛り>`、`zoom <範囲>` */\nconst SCALE = /^scale\\s+(\\S+)\\s+(\\S+)\\s+([^\\s[]+)/du;\nconst PERIOD = /^period\\s+(\\S+)\\s+([^\\s[]+)/du;\nconst POINT = new RegExp(`^point\\\\s+(\\\\S+)\\\\s+${AT}\\\\s+(\\\\S+)\\\\s*$`, \"du\");\nconst ZOOM = /^zoom\\s+(\\S+)\\s*$/du;\n/** 時間軸の図の段の中の行。`now -> <目盛り>`、`mark <列> <範囲>`、`span <範囲>:` */\nconst NEEDLE = new RegExp(`^${NOW}\\\\s*->`, \"u\");\nconst NOW_LINE = new RegExp(`^${NOW}\\\\s*->\\\\s*(\\\\S+)\\\\s*$`, \"du\");\nconst MARK = /^mark\\s+([^\\s[]+)\\s+([^\\s[]+)/du;\nconst SPAN = /^span\\s+([^\\s:[]+)\\s*:/du;\n/** 目盛りの長さ。原本の JSON の長さの形と同じ */\nconst LENGTH = /^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$/u;\n/** 割合。原本の JSON の割合の形と同じ */\nconst RATIO = /^([0-9]+\\/[0-9]+|[0-9]+(\\.[0-9]+)?%)$/u;\n/** 1 以上の整数と、0 以上の整数 */\nconst COUNT = /^[1-9][0-9]*$/u;\nconst NUMBER = /^(0|[1-9][0-9]*)$/u;\n/** 目盛りの範囲。`0-31` か `0` */\nconst RANGE = /^(0|[1-9][0-9]*)(?:-(0|[1-9][0-9]*))?$/u;\n\nconst isOneOf = <T extends string>(list: readonly T[], word: string): word is T => (list as readonly string[]).includes(word);\n\n/** `at` から空白を飛ばした位置 */\nfunction skipSpaces(text: string, at: number): number {\n let i = at;\n while (i < text.length && /\\s/u.test(text[i] ?? \"\")) i++;\n return i;\n}\n\n/** `[<鍵>: <値>]` の 1 つ。`at` は鍵の位置 */\ninterface Attr {\n value: string;\n at: number;\n}\n\n/** `at` の `\"` から閉じる `\"` までを読む。`end` は閉じた `\"` の次 */\nfunction readQuoted(source: SourceLine, at: number, m: Messages): { value: string; end: number } {\n const text = source.text;\n let value = \"\";\n for (let i = at + 1; i < text.length; i++) {\n const c = text[i] ?? \"\";\n const next = text[i + 1] ?? \"\";\n if (c === \"\\\\\" && (next === '\"' || next === \"\\\\\")) {\n value += next;\n i++;\n } else if (c === '\"') {\n return { value, end: i + 1 };\n } else {\n value += c;\n }\n }\n throw fail(source, at, m.quoteUnclosed);\n}\n\n/**\n * `at` から名前か文を読む。`\"` で始まれば囲みの中、そうでなければ `[` の前か行の終わりまで。\n * `rest` は名前の後ろの位置で、行の終わりか属性の `[` を指す。\n */\nfunction readName(source: SourceLine, at: number, m: Messages): { value: string; rest: number } {\n const text = source.text;\n const start = skipSpaces(text, at);\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n const rest = skipSpaces(text, quoted.end);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.afterQuote);\n return { value: quoted.value, rest };\n }\n const open = text.indexOf(\"[\", start);\n const rest = open < 0 ? text.length : open;\n return { value: text.slice(start, rest).trim(), rest };\n}\n\n/** `at` の `[` から行の終わりの `]` までの属性を読む。`allowed` に無い鍵は誤り */\nfunction readAttrs(source: SourceLine, at: number, allowed: readonly string[], m: Messages): Map<string, Attr> {\n const text = source.text;\n if (!text.endsWith(\"]\")) throw fail(source, at, m.attrUnclosed);\n const close = text.length - 1;\n const attrs = new Map<string, Attr>();\n for (let i = at + 1; ; ) {\n const start = skipSpaces(text, i);\n let colon = start;\n while (colon < close && text[colon] !== \":\" && text[colon] !== \",\") colon++;\n if (colon >= close || text[colon] !== \":\") throw fail(source, start, m.attrNoColon(text.slice(start, colon).trim()));\n const key = text.slice(start, colon).trim();\n if (!allowed.includes(key)) throw fail(source, start, m.badAttr(key, allowed));\n if (attrs.has(key)) throw fail(source, start, m.attrTwice(key));\n let end = skipSpaces(text, colon + 1);\n let value: string;\n if (text[end] === '\"') {\n const quoted = readQuoted(source, end, m);\n value = quoted.value;\n end = skipSpaces(text, quoted.end);\n if (end < close && text[end] !== \",\") throw fail(source, end, m.afterQuote);\n } else {\n const comma = text.indexOf(\",\", end);\n const stop = comma < 0 || comma > close ? close : comma;\n value = text.slice(end, stop).trim();\n end = stop;\n }\n if (value === \"\") throw fail(source, start, m.attrNoValue(key));\n attrs.set(key, { value, at: start });\n if (end >= close) return attrs;\n i = end + 1;\n }\n}\n\n/** `at` から `,` で区切った字の並びを行の終わりまで読む */\nfunction readList(source: SourceLine, at: number, m: Messages): string[] {\n const text = source.text;\n const items: string[] = [];\n for (let i = at; ; ) {\n const start = skipSpaces(text, i);\n let value: string;\n let end: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n value = quoted.value;\n end = skipSpaces(text, quoted.end);\n if (end < text.length && text[end] !== \",\") throw fail(source, end, m.afterQuote);\n } else {\n const comma = text.indexOf(\",\", start);\n end = comma < 0 ? text.length : comma;\n value = text.slice(start, end).trim();\n }\n if (value === \"\") throw fail(source, start, m.emptyStripField);\n items.push(value);\n if (end >= text.length) return items;\n i = end + 1;\n }\n}\n\n/** `group` と `box` の行の、名札と `as` の後ろの名前と属性 */\ninterface Declared {\n id: string;\n idAt: number;\n name?: string;\n attrs: Map<string, Attr>;\n}\n\nfunction readDeclared(source: SourceLine, word: string, allowed: readonly string[], m: Messages): Declared {\n const text = source.text;\n const start = skipSpaces(text, word.length);\n const id = /^[^\\s[]+/u.exec(text.slice(start))?.[0];\n if (id === undefined) throw fail(source, 0, m.needsId(word));\n if (!ID.test(id)) throw fail(source, start, m.badId(id));\n let rest = skipSpaces(text, start + id.length);\n let name: string | undefined;\n if (text.startsWith(AS, rest) && /^(\\s|$)/u.test(text.slice(rest + AS.length, rest + AS.length + 1))) {\n const named = readName(source, rest + AS.length, m);\n if (named.value === \"\") throw fail(source, rest, m.emptyName(id));\n name = named.value;\n rest = named.rest;\n }\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.afterId);\n const attrs = rest < text.length ? readAttrs(source, rest, allowed, m) : new Map<string, Attr>();\n return { id, idAt: start, ...(name !== undefined ? { name } : {}), attrs };\n}\n\n/** 区画と箱の属性 (`note` と `color` と `icon`) */\nfunction lookOf(source: SourceLine, attrs: Map<string, Attr>, m: Messages): { note?: string; color?: Color; icon?: string } {\n const color = attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n const note = attrs.get(\"note\")?.value;\n const icon = attrs.get(\"icon\")?.value;\n return {\n ...(note !== undefined ? { note } : {}),\n ...(color ? { color: color.value as Color } : {}),\n ...(icon !== undefined ? { icon } : {}),\n };\n}\n\n/**\n * 前の形 (#2997 まで) の行なら、その印と、新しい形で書く行の形。`inStep` は段の中の行か。\n * 新しい形で読めない行の誤りの文で、書き直し方を示すために引く。\n */\nfunction oldForm(text: string, inStep: boolean): { word: string; shape: Shape } | undefined {\n const first = text.split(/\\s/u)[0] ?? \"\";\n if (first === \"帯\") return { word: first, shape: inStep ? \"set\" : \"strip\" };\n if (Object.hasOwn(OLD_HEADS, first)) return { word: first, shape: OLD_HEADS[first as keyof typeof OLD_HEADS] };\n if (text.startsWith(\"#\")) return { word: \"#\", shape: \"step\" };\n if (text.startsWith(\">\")) return { word: \">\", shape: \"say\" };\n if (text.startsWith(\"`\")) return { word: \"`\", shape: \"code\" };\n if (text.includes(\"「\")) return { word: \"「」\", shape: inStep ? \"note\" : \"box\" };\n if (/^[^\\s=:]+\\s*=(?!>)/u.test(text)) return { word: \"=\", shape: \"box\" };\n if (inStep && /^[^\\s:]+\\s*:/u.test(text)) return { word: \":\", shape: \"act\" };\n return undefined;\n}\n\n/** 読んでいる段。`body` は `say` を読むまで無い */\ninterface Building {\n source: SourceLine;\n title: string;\n body?: string[];\n code?: string;\n sources: StepSource[];\n events: DiagramEvent[];\n}\n\nfunction parseLines(lines: SourceLine[], m: Messages): Diagram {\n const headAt = lines.findIndex((source) => !isBlankOrComment(source));\n const head = lines[headAt];\n if (!head) throw new NotationError(1, 1, m.noHead);\n const kind = head.text.split(/\\s/u)[0] ?? \"\";\n if (!isOneOf(KINDS, kind)) {\n const old = oldForm(head.text, false);\n throw fail(head, 0, old ? m.oldForm(old.word, old.shape) : m.badHead);\n }\n const titled = readName(head, kind.length, m);\n if (titled.value === \"\") throw fail(head, 0, m.badHead);\n const title = titled.value;\n const shown = titled.rest < head.text.length ? readAttrs(head, titled.rest, ATTRS.diagram, m).get(\"view\") : undefined;\n if (shown && !isOneOf(VIEWS, shown.value)) throw fail(head, shown.at, m.badView);\n const view = shown?.value as ViewMode | undefined;\n\n const isState = kind === \"state\";\n const isGit = kind === \"git\";\n const isTime = kind === \"time\";\n const isTree = kind === \"tree\";\n const isLineup = kind === \"lineup\";\n /** 列の図で宣言したチップと、今封をしている列 (#3239) */\n const items: LineupItem[] = [];\n const sealed = new Set<string>();\n /** 木の図で書いた木の箱と、書いた行と名札の位置。子の箱から親の名札 */\n const trees = new Map<string, { source: SourceLine; at: number }>();\n const parents = new Map<string, string>();\n /** 時間軸の図の目盛りと区切りと印の列と節目と拡大の範囲 (#3165) */\n let scale: TimeScale | undefined;\n let period: TimePeriod | undefined;\n const rows: TimeRow[] = [];\n const points: TimePoint[] = [];\n let zoom: { from: number; to: number } | undefined;\n const meters: StripMeter[] = [];\n /** 目盛りの数が決まってから確かめる、宣言の行の目盛り。最初の step で確かめる */\n const pending: (() => void)[] = [];\n let settled = false;\n /** 最初に宣言した箱の行。時間軸の図で拡大の範囲が無い時に名指す */\n let firstBox: SourceLine | undefined;\n /** 針が今いる目盛りの境 (0 から数える) */\n let needle = 0;\n const branches: GitBranch[] = [];\n /** 枝分かれの図で積んだ commit と、枝の札が今指す commit (まだ何も指さない枝は `null`) */\n const commits = new Set<string>();\n const tips = new Map<string, string | null>();\n const regions: Region[] = [];\n const boxes: Box[] = [];\n const paths: StatePath[] = [];\n const ids = new Set<string>();\n let strip: { title: string; fields: string[] } | undefined;\n const steps: Step[] = [];\n let building: Building | undefined;\n /** 開いている `group` */\n let group: { source: SourceLine; id: string } | undefined;\n\n const declare = (source: SourceLine, id: string, at: number): void => {\n if (ids.has(id)) throw fail(source, at, m.duplicate(id));\n ids.add(id);\n };\n const boxAt = (source: SourceLine, id: string, at: number): string => {\n if (!boxes.some((box) => box.id === id)) throw fail(source, at, m.undeclaredBox(id));\n return id;\n };\n const branchAt = (source: SourceLine, id: string, at: number): string => {\n if (!tips.has(id)) throw fail(source, at, m.undeclaredBranch(id));\n return id;\n };\n const commitAt = (source: SourceLine, id: string, at: number): string => {\n if (!commits.has(id)) throw fail(source, at, m.noCommit(id));\n return id;\n };\n /**\n * 線の端。状態遷移図では送る側に `start`、受ける側に `finish` を書ける。\n * 枝分かれの図では送る側が枝の名札か `HEAD`、受ける側が積んだ commit\n */\n const endAt = (source: SourceLine, id: string, at: number, side: \"from\" | \"to\"): string => {\n if (isGit) {\n if (side === \"to\") return commitAt(source, id, at);\n if (id !== HEAD && !tips.has(id)) throw fail(source, at, m.undeclaredRef(id));\n return id;\n }\n if (isTime) {\n if (!boxes.some((box) => box.id === id) && !points.some((point) => point.id === id)) throw fail(source, at, m.undeclaredNote(id));\n return id;\n }\n if (isTree && trees.has(id)) return id;\n if (!isState || !isOneOf(STATE_ENDS, id)) return boxAt(source, id, at);\n if ((id === \"start\") !== (side === \"from\")) throw fail(source, at, id === \"start\" ? m.intoStart : m.outOfFinish);\n return id;\n };\n /** 状態遷移図の箱と区画の名札に、始まりと終わりの印の名前は使えない。枝分かれの図の名札に、今いる場所の札の名前は使えない */\n const notReserved = (source: SourceLine, id: string, at: number): void => {\n if (isState && isOneOf(STATE_ENDS, id)) throw fail(source, at, m.reservedId(id));\n if (isGit && id === HEAD) throw fail(source, at, m.headReserved(id));\n if (isTime && id === NOW) throw fail(source, at, m.nowReserved(id));\n };\n /** 段の中に書く行の、書き先の段。最初の `step` より前なら誤り */\n const inStep = (source: SourceLine): Building => {\n if (!building) throw fail(source, 0, m.stepLineBeforeStep);\n return building;\n };\n /** 宣言の行。最初の `step` より後なら誤り */\n const beforeSteps = (source: SourceLine): void => {\n if (building) throw fail(source, 0, m.declarationInStep);\n };\n const finish = (): void => {\n if (!building) return;\n if (building.body === undefined) throw fail(building.source, 0, m.noBody(building.title));\n steps.push({\n title: building.title,\n body: building.body.join(\"\\n\"),\n ...(building.code !== undefined ? { code: building.code } : {}),\n ...(building.sources.length > 0 ? { sources: building.sources } : {}),\n events: building.events,\n });\n };\n\n const rest = lines.slice(headAt + 1);\n for (let i = 0; i < rest.length; i++) {\n const source = rest[i];\n if (!source || isBlankOrComment(source)) continue;\n const text = source.text;\n // 時間軸の図の `now -> <目盛り>` は針を進める行で、線と同じ形でも箱どうしの線と読まない\n if (isTime && NEEDLE.test(text)) {\n inStep(source).events.push(readNow(source));\n continue;\n }\n // 名札の次に `->` が来る行は、名札が行の頭の語と同じ綴りでも線と読む\n const edge = EDGE.exec(text);\n if (edge) {\n if (isLineup) throw fail(source, 0, m.lineupNoEdge);\n // 状態遷移図の最初の step より前の線は、移れる道の地図\n if (isState && !building) paths.push(readPath(source, edge));\n else inStep(source).events.push(readEdge(source, edge));\n continue;\n }\n const [word = \"\", second] = text.split(/\\s+/u);\n // 枝分かれの図で、宣言した枝の名札の次に `from` が来る行は、枝を切る行\n if (isGit && tips.has(word) && second === FROM) {\n const step = inStep(source);\n step.events.push(readCut(source));\n continue;\n }\n if (!isGit && (word === \"branch\" || word === \"commit\")) throw fail(source, 0, m.gitOnly(word));\n if (!isTime && isOneOf(TIME_HEADS, word)) throw fail(source, 0, m.timeOnly(word));\n if (!isTree && isOneOf(TREE_HEADS, word)) throw fail(source, 0, m.treeOnly(word));\n if (!isLineup && isOneOf(LINEUP_HEADS, word)) throw fail(source, 0, m.lineupOnly(word));\n if (!isOneOf(HEADS, word)) {\n const old = oldForm(text, building !== undefined);\n throw fail(source, 0, old ? m.oldForm(old.word, old.shape) : m.unknownHead(word));\n }\n switch (word) {\n case \"group\":\n readGroup(source);\n break;\n case \"end\":\n if (text !== word) throw fail(source, word.length, m.endTakesNothing);\n if (!group) throw fail(source, 0, m.strayEnd);\n group = undefined;\n break;\n case \"box\":\n readBox(source);\n break;\n case \"strip\":\n readStrip(source);\n break;\n case \"step\": {\n if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));\n settle();\n finish();\n const stepTitle = text.slice(word.length).trim();\n if (stepTitle === \"\") throw fail(source, 0, m.emptyStepTitle);\n building = { source, title: stepTitle, sources: [], events: [] };\n break;\n }\n case \"say\":\n i = readSay(source, i);\n break;\n case \"code\": {\n const step = inStep(source);\n if (step.code !== undefined) throw fail(source, 0, m.codeTwice);\n const command = text.slice(word.length).trim();\n if (command === \"\") throw fail(source, 0, m.emptyCode);\n step.code = command;\n break;\n }\n case \"source\":\n inStep(source).sources.push(readSource(source));\n break;\n case \"act\": {\n if (isLineup) throw fail(source, 0, m.lineupNoAct);\n const step = inStep(source);\n const on = readOnBox(source, word, m.actShape);\n step.events.push({ type: \"action\", box: on.box, label: on.text });\n break;\n }\n case \"note\": {\n const step = inStep(source);\n if (isTime) {\n step.events.push(readTimeNote(source));\n break;\n }\n const on = readOnBox(source, word, m.noteShape);\n step.events.push({ type: \"swap\", box: on.box, text: on.text });\n break;\n }\n case \"set\":\n inStep(source).events.push(readSet(source));\n break;\n case \"branch\":\n readBranch(source);\n break;\n case \"commit\": {\n const step = inStep(source);\n step.events.push(readCommit(source));\n break;\n }\n case \"scale\":\n readScale(source);\n break;\n case \"period\":\n readPeriod(source);\n break;\n case \"row\":\n readRow(source);\n break;\n case \"point\":\n readPoint(source);\n break;\n case \"zoom\":\n readZoom(source);\n break;\n case \"mark\":\n inStep(source).events.push(readMark(source));\n break;\n case \"span\":\n inStep(source).events.push(readSpan(source));\n break;\n case \"leaf\": {\n const step = inStep(source);\n step.events.push(readLeaf(source));\n break;\n }\n case \"node\": {\n const step = inStep(source);\n step.events.push(readNode(source));\n break;\n }\n case \"item\":\n readItem(source);\n break;\n case \"line\": {\n const step = inStep(source);\n step.events.push(readOrder(source));\n break;\n }\n case \"seal\":\n case \"open\":\n case \"pick\": {\n const step = inStep(source);\n step.events.push(readOnLane(source, word));\n break;\n }\n case \"stamp\": {\n const step = inStep(source);\n step.events.push(readStamp(source));\n break;\n }\n }\n }\n if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));\n settle();\n finish();\n\n if (isGit && branches.length === 0) throw fail(head, 0, m.noBranches);\n if (isTree && trees.size === 0) throw fail(head, 0, m.noLeaves);\n if (isLineup && items.length === 0) throw fail(head, 0, m.noItems);\n if (boxes.length === 0 && !isGit && !isTime && !isTree) throw fail(head, 0, m.noBoxes);\n if (steps.length === 0) throw fail(head, 0, m.noSteps);\n // 木の形は全ての行を読んでから確かめる。親を持たない木の箱が 2 つ以上なら、書いた順で 2 つ目を示す\n const roots = [...trees.keys()].filter((id) => !parents.has(id));\n const [root, stray] = roots;\n const strayAt = stray === undefined ? undefined : trees.get(stray);\n if (root !== undefined && stray !== undefined && strayAt) throw fail(strayAt.source, strayAt.at, m.manyRoots(stray, root));\n\n return {\n version: FORMAT_VERSION,\n kind,\n title,\n ...(view ? { view } : {}),\n ...(regions.length > 0 ? { regions } : {}),\n boxes,\n ...(strip ? { strip: meters.length > 0 ? { ...strip, meters } : strip } : {}),\n steps,\n ...(kind === \"sequence\" ? { sequence: { lifelines: boxes.map((box) => box.id) } } : {}),\n ...(paths.length > 0 ? { state: { paths } } : {}),\n ...(isGit ? { git: { branches } } : {}),\n ...(isLineup ? { lineup: { items } } : {}),\n ...(isTime && scale\n ? {\n time: {\n scale,\n ...(period ? { period } : {}),\n rows,\n ...(points.length > 0 ? { points } : {}),\n ...(zoom ? { zoom } : {}),\n },\n }\n : {}),\n };\n\n /**\n * 時間軸の図の宣言を、目盛りの数が決まってから確かめる。最初の step と記法の終わりで 1 度だけ呼ぶ。\n * 目盛りと印の列が無い図と、拡大の範囲の無い図の箱は誤り\n */\n function settle(): void {\n if (!isTime || settled) return;\n settled = true;\n if (!scale) throw fail(head as SourceLine, 0, m.noScale);\n if (rows.length === 0) throw fail(head as SourceLine, 0, m.noRows);\n for (const check of pending) check();\n if (firstBox && !zoom) throw fail(firstBox, 0, m.boxNeedsZoom);\n }\n\n /** 目盛りの数。目盛りを宣言する前は 0 */\n function countOf(): number {\n return scale?.count ?? 0;\n }\n\n /** `text` を目盛りの位置として読む。0 から目盛りの数より 1 小さい数まで */\n function unitAt(source: SourceLine, at: number, text: string): number {\n if (!NUMBER.test(text) || Number(text) >= countOf()) throw fail(source, at, m.badUnit(text, countOf()));\n return Number(text);\n }\n\n /** `text` を目盛りの範囲として読む。`0-31` か `0` */\n function rangeAt(source: SourceLine, at: number, text: string): { from: number; to: number } {\n const found = RANGE.exec(text);\n const from = Number(found?.[1]);\n const to = Number(found?.[2] ?? found?.[1]);\n if (!found || from > to || to >= countOf()) throw fail(source, at, m.badUnit(text, countOf()));\n return { from, to };\n }\n\n /** `scale <単位> <長さ> <数> [from: <最初の番号>]` の行 */\n function readScale(source: SourceLine): void {\n beforeSteps(source);\n if (scale) throw fail(source, 0, m.timeTwice(\"scale\"));\n const text = source.text;\n const found = SCALE.exec(text);\n const at = (k: number): number => found?.indices?.[k]?.[0] ?? 0;\n if (!found) throw fail(source, 0, m.scaleShape);\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.scaleShape);\n const length = found[2] ?? \"\";\n if (!LENGTH.test(length)) throw fail(source, at(2), m.badLength);\n const count = found[3] ?? \"\";\n if (!COUNT.test(count)) throw fail(source, at(3), m.badCount(\"scale\"));\n const first = rest < text.length ? readAttrs(source, rest, ATTRS.scale, m).get(\"from\") : undefined;\n if (first && !NUMBER.test(first.value)) throw fail(source, first.at, m.scaleShape);\n scale = { unit: found[1] ?? \"\", length, count: Number(count), ...(first ? { from: Number(first.value) } : {}) };\n }\n\n /** `period <名前> <目盛りの数> [from: <最初の番号>]` の行 */\n function readPeriod(source: SourceLine): void {\n beforeSteps(source);\n if (period) throw fail(source, 0, m.timeTwice(\"period\"));\n const text = source.text;\n const found = PERIOD.exec(text);\n if (!found) throw fail(source, 0, m.periodShape);\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.periodShape);\n const length = found[2] ?? \"\";\n if (!COUNT.test(length)) throw fail(source, found.indices?.[2]?.[0] ?? 0, m.badCount(\"period\"));\n const first = rest < text.length ? readAttrs(source, rest, ATTRS.period, m).get(\"from\") : undefined;\n if (first && !NUMBER.test(first.value)) throw fail(source, first.at, m.periodShape);\n period = { name: found[1] ?? \"\", length: Number(length), ...(first ? { from: Number(first.value) } : {}) };\n }\n\n /** `row <名札> as <名前> [color: <色>, empty: <目盛り> <目盛り>]` の行。箱と同じ名札を持てる */\n function readRow(source: SourceLine): void {\n beforeSteps(source);\n const declared = readDeclared(source, \"row\", ATTRS.row, m);\n notReserved(source, declared.id, declared.idAt);\n if (rows.some((row) => row.id === declared.id) || points.some((point) => point.id === declared.id)) throw fail(source, declared.idAt, m.duplicate(declared.id));\n const color = declared.attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n const empty = declared.attrs.get(\"empty\");\n const row: TimeRow = { id: declared.id, name: declared.name ?? declared.id, ...(color ? { color: color.value as Color } : {}) };\n rows.push(row);\n if (empty) {\n const words = empty.value.split(/\\s+/u);\n // 目盛りの数が決まってから確かめる。欄の並びを宣言の形で残すため、先に空の並びを置く\n row.empty = [];\n pending.push(() => {\n row.empty = words.map((word) => unitAt(source, empty.at, word));\n });\n }\n }\n\n /** `point <名札> at <目盛り>` の行。箱と印の列と同じ名札は持てない */\n function readPoint(source: SourceLine): void {\n beforeSteps(source);\n const found = POINT.exec(source.text);\n const id = found?.[1];\n const unit = found?.[2];\n if (!found || id === undefined || unit === undefined) throw fail(source, 0, m.pointShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n const unitStart = found.indices?.[2]?.[0] ?? 0;\n if (!ID.test(id)) throw fail(source, idAt, m.badId(id));\n notReserved(source, id, idAt);\n if (rows.some((row) => row.id === id)) throw fail(source, idAt, m.duplicate(id));\n declare(source, id, idAt);\n const point: TimePoint = { id, at: 0 };\n points.push(point);\n pending.push(() => {\n point.at = unitAt(source, unitStart, unit);\n });\n }\n\n /** `zoom <目盛り>-<目盛り>` の行 */\n function readZoom(source: SourceLine): void {\n beforeSteps(source);\n if (zoom) throw fail(source, 0, m.timeTwice(\"zoom\"));\n const found = ZOOM.exec(source.text);\n const range = found?.[1];\n if (!found || range === undefined) throw fail(source, 0, m.zoomShape);\n const rangeStart = found.indices?.[1]?.[0] ?? 0;\n const placed = { from: 0, to: 0 };\n zoom = placed;\n pending.push(() => {\n Object.assign(placed, rangeAt(source, rangeStart, range));\n });\n }\n\n /** `now -> <目盛り>` の行。針をその目盛りの終わりまで進める。前の針より後の目盛りに限る */\n function readNow(source: SourceLine): DiagramEvent {\n const found = NOW_LINE.exec(source.text);\n const unit = found?.[1];\n if (!found || unit === undefined) throw fail(source, 0, m.nowShape);\n const at = found.indices?.[1]?.[0] ?? 0;\n const to = unitAt(source, at, unit);\n if (to + 1 <= needle) throw fail(source, at, m.nowBack(unit, needle - 1));\n needle = to + 1;\n return { type: \"now\", to };\n }\n\n /** `mark <列> <範囲> [color: <色>]` の行 */\n function readMark(source: SourceLine): DiagramEvent {\n const text = source.text;\n const found = MARK.exec(text);\n const row = found?.[1];\n const range = found?.[2];\n if (!found || row === undefined || range === undefined) throw fail(source, 0, m.markShape);\n if (!rows.some((r) => r.id === row)) throw fail(source, found.indices?.[1]?.[0] ?? 0, m.undeclaredRow(row));\n const { from, to } = rangeAt(source, found.indices?.[2]?.[0] ?? 0, range);\n const rest = skipSpaces(text, found[0].length);\n if (rest >= text.length || text[rest] !== \"[\") throw fail(source, rest, m.markShape);\n const color = readAttrs(source, rest, ATTRS.mark, m).get(\"color\");\n if (!color) throw fail(source, rest, m.markShape);\n if (!isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n return { type: \"mark\", row, from, to, color: color.value };\n }\n\n /** `span <範囲>: <字> [shape: box, color: <色>]` の行 */\n function readSpan(source: SourceLine): DiagramEvent {\n const found = SPAN.exec(source.text);\n const range = found?.[1];\n if (!found || range === undefined) throw fail(source, 0, m.spanShape);\n const { from, to } = rangeAt(source, found.indices?.[1]?.[0] ?? 0, range);\n const named = readName(source, found[0].length, m);\n if (named.value === \"\") throw fail(source, 0, m.spanShape);\n const attrs = named.rest < source.text.length ? readAttrs(source, named.rest, ATTRS.span, m) : new Map<string, Attr>();\n const shape = attrs.get(\"shape\");\n if (shape && !isOneOf(SPAN_SHAPES, shape.value)) throw fail(source, shape.at, m.badShape);\n const color = attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n return { type: \"span\", from, to, text: named.value, ...(shape ? { shape: \"box\" as const } : {}), ...(color ? { color: color.value as Color } : {}) };\n }\n\n /** 時間軸の図の `note <箱か節目>: <字> [color: <色>]` の行。色は節目の丸の色 */\n function readTimeNote(source: SourceLine): DiagramEvent {\n const found = /^note\\s+([^\\s:]+)\\s*:/du.exec(source.text);\n const id = found?.[1];\n if (!found || id === undefined) throw fail(source, 0, m.noteShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n const isPoint = points.some((point) => point.id === id);\n if (!isPoint && !boxes.some((box) => box.id === id)) throw fail(source, idAt, m.undeclaredNote(id));\n const named = readName(source, found[0].length, m);\n if (named.value === \"\") throw fail(source, 0, m.noteShape);\n const color = named.rest < source.text.length ? readAttrs(source, named.rest, ATTRS.note, m).get(\"color\") : undefined;\n if (color && !isPoint) throw fail(source, color.at, m.noteColorPointOnly);\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n return { type: \"swap\", box: id, text: named.value, ...(color ? { color: color.value as Color } : {}) };\n }\n\n /** `group` の行。同じ名札をもう一度開いた時は、名前も属性も書かない */\n function readGroup(source: SourceLine): void {\n beforeSteps(source);\n if (isGit) throw fail(source, 0, m.gitNoGroup);\n if (isTree) throw fail(source, 0, m.treeNoGroup);\n if (isLineup) throw fail(source, 0, m.lineupNoGroup);\n if (group) throw fail(source, 0, m.nestedGroup);\n const declared = readDeclared(source, \"group\", ATTRS.group, m);\n if (regions.some((region) => region.id === declared.id)) {\n if (declared.name !== undefined || declared.attrs.size > 0) throw fail(source, 0, m.regionReopened(declared.id));\n } else {\n notReserved(source, declared.id, declared.idAt);\n declare(source, declared.id, declared.idAt);\n regions.push({ id: declared.id, name: declared.name ?? declared.id, ...lookOf(source, declared.attrs, m) });\n }\n group = { source, id: declared.id };\n }\n\n /** `box` の行。開いている `group` の中なら、その区画に置く */\n function readBox(source: SourceLine): void {\n beforeSteps(source);\n const declared = readDeclared(source, \"box\", isLineup ? LANE_ATTRS : ATTRS.box, m);\n notReserved(source, declared.id, declared.idAt);\n declare(source, declared.id, declared.idAt);\n firstBox ??= source;\n const { note, ...look } = lookOf(source, declared.attrs, m);\n const link = declared.attrs.get(\"link\");\n boxes.push({\n id: declared.id,\n name: declared.name ?? declared.id,\n ...(note !== undefined ? { sub: note } : {}),\n ...look,\n ...(group ? { region: group.id } : {}),\n ...(link ? { link: urlOf(source, \"link\", link) } : {}),\n });\n }\n\n /** `source <名前> [url: <URL>]` の行 */\n function readSource(source: SourceLine): StepSource {\n const named = readName(source, \"source\".length, m);\n const url = named.rest < source.text.length ? readAttrs(source, named.rest, ATTRS.source, m).get(\"url\") : undefined;\n if (named.value === \"\" || !url) throw fail(source, 0, m.sourceShape);\n return { name: named.value, url: urlOf(source, \"url\", url) };\n }\n\n /** 頁を移る形の URL。ほかの形 (`javascript:` など) は、その属性の位置を示して断る */\n function urlOf(source: SourceLine, key: string, attr: Attr): string {\n if (!URL_FORM.test(attr.value)) throw fail(source, attr.at, m.badUrl(key));\n return attr.value;\n }\n\n /** 枝分かれの図の `branch <名札> [note: <添え書き>]` の行。枝は宣言した順に上から帯に並ぶ */\n function readBranch(source: SourceLine): void {\n beforeSteps(source);\n const declared = readDeclared(source, \"branch\", ATTRS.branch, m);\n if (declared.name !== undefined) throw fail(source, 0, m.branchShape);\n notReserved(source, declared.id, declared.idAt);\n declare(source, declared.id, declared.idAt);\n const note = declared.attrs.get(\"note\")?.value;\n branches.push({ id: declared.id, ...(note !== undefined ? { note } : {}) });\n tips.set(declared.id, null);\n }\n\n /**\n * 枝分かれの図の `commit <名札> on <枝> [copy <commit>] [merge <枝>] [hash: <hash>, note: <一言>]` の行。\n * 積んだ枝の札は新しい commit へ進む。当て直しは枝の札を動かさない\n */\n function readCommit(source: SourceLine): GitCommit {\n const text = source.text;\n const found = COMMIT.exec(text);\n const at = (k: number): number => found?.indices?.[k]?.[0] ?? 0;\n const id = found?.[1];\n const on = found?.[2];\n if (!found || id === undefined || on === undefined) throw fail(source, 0, m.commitShape);\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.commitShape);\n if (!ID.test(id)) throw fail(source, at(1), m.badId(id));\n notReserved(source, id, at(1));\n declare(source, id, at(1));\n const branch = branchAt(source, on, at(2));\n const copy = found[3] === undefined ? undefined : commitAt(source, found[3], at(3));\n const merge = found[4] === undefined ? undefined : mergedAt(source, found[4], at(4), branch);\n const attrs = rest < text.length ? readAttrs(source, rest, ATTRS.commit, m) : new Map<string, Attr>();\n const hash = attrs.get(\"hash\");\n if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);\n const note = attrs.get(\"note\")?.value;\n commits.add(id);\n if (copy === undefined) tips.set(branch, id);\n return {\n type: \"commit\",\n id,\n branch,\n ...(copy !== undefined ? { copy } : {}),\n ...(merge !== undefined ? { merge } : {}),\n ...(hash ? { hash: hash.value } : {}),\n ...(note !== undefined ? { note } : {}),\n };\n }\n\n /** merge commit が取り込む枝。積む枝と別の、もう commit を指している枝 */\n function mergedAt(source: SourceLine, id: string, at: number, into: string): string {\n branchAt(source, id, at);\n if (id === into) throw fail(source, at, m.mergeSelf(id));\n if (tips.get(id) === null) throw fail(source, at, m.emptyBranch(id));\n return id;\n }\n\n /** 枝分かれの図の `<枝> from <commit>` の行。枝の札を commit へ置く */\n function readCut(source: SourceLine): DiagramEvent {\n const found = CUT.exec(source.text);\n const branch = found?.[1];\n const from = found?.[2];\n if (!found || branch === undefined || from === undefined) throw fail(source, 0, m.fromShape);\n commitAt(source, from, found.indices?.[2]?.[0] ?? 0);\n tips.set(branch, from);\n return { type: \"branch\", branch, from };\n }\n\n /** 木の図の `leaf <名札> [hash: <hash>]` の行 */\n function readLeaf(source: SourceLine): DiagramEvent {\n const text = source.text;\n const found = LEAF.exec(text);\n const id = found?.[1];\n if (!found || id === undefined) throw fail(source, 0, m.leafShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n if (!ID.test(id)) throw fail(source, idAt, m.badId(id));\n declare(source, id, idAt);\n trees.set(id, { source, at: idAt });\n const rest = skipSpaces(text, found[0].length);\n if (rest < text.length && text[rest] !== \"[\") throw fail(source, rest, m.leafShape);\n const hash = treeHash(source, rest, ATTRS.leaf);\n return { type: \"leaf\", id, ...(hash !== undefined ? { hash } : {}) };\n }\n\n /**\n * 木の図の `node <名札> of <子>, <子> [hash: <hash>]` の行。子は前に書いた葉か親で、まだ親を持たない箱に限る。\n * 子は `,` で区切り、`[` か行の終わりで終わる\n */\n function readNode(source: SourceLine): DiagramEvent {\n const text = source.text;\n const found = NODE.exec(text);\n const id = found?.[1];\n if (!found || id === undefined) throw fail(source, 0, m.nodeShape);\n const idAt = found.indices?.[1]?.[0] ?? 0;\n if (!ID.test(id)) throw fail(source, idAt, m.badId(id));\n declare(source, id, idAt);\n const children: string[] = [];\n let end = found[0].length;\n for (;;) {\n const start = skipSpaces(text, end);\n end = start;\n while (end < text.length && text[end] !== \",\" && text[end] !== \"[\") end++;\n const child = text.slice(start, end).trim();\n if (child === \"\" || !ID.test(child)) throw fail(source, start, m.nodeShape);\n if (!trees.has(child)) throw fail(source, start, ids.has(child) && child !== id ? m.notTreeBox(child) : m.noTreeChild(child));\n if (parents.has(child)) throw fail(source, start, m.twoParents(child));\n parents.set(child, id);\n children.push(child);\n if (text[end] !== \",\") break;\n end++;\n }\n const hash = treeHash(source, end, ATTRS.node);\n trees.set(id, { source, at: idAt });\n return { type: \"node\", id, children, ...(hash !== undefined ? { hash } : {}) };\n }\n\n /** 葉と親の行の名札の後ろの `[hash: <hash>]`。`at` は `[` か行の終わり */\n function treeHash(source: SourceLine, at: number, keys: readonly string[]): string | undefined {\n if (at >= source.text.length) return undefined;\n const hash = readAttrs(source, at, keys, m).get(\"hash\");\n if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);\n return hash?.value;\n }\n\n /** `from` から `to` の前までの、`,` で区切った名札と、それぞれの位置 */\n function namesAt(source: SourceLine, from: number, to: number, shape: string): { value: string; at: number }[] {\n const text = source.text;\n const names: { value: string; at: number }[] = [];\n for (let i = from; ; ) {\n const start = skipSpaces(text, i);\n const comma = text.indexOf(\",\", start);\n const end = comma < 0 || comma > to ? to : comma;\n const value = text.slice(start, end).trim();\n if (value === \"\") throw fail(source, start, shape);\n if (!ID.test(value)) throw fail(source, start, m.badId(value));\n names.push({ value, at: start });\n if (end >= to) return names;\n i = end + 1;\n }\n }\n\n /** 列の図の `item <名札>, <名札> [color: <色>, label: <字>]` の行。並べた名札ごとに、同じ色と字のチップを宣言する */\n function readItem(source: SourceLine): void {\n beforeSteps(source);\n const open = source.text.indexOf(\"[\");\n const end = open < 0 ? source.text.length : open;\n const attrs = open < 0 ? new Map<string, Attr>() : readAttrs(source, open, ATTRS.item, m);\n const color = attrs.get(\"color\");\n if (color && !isOneOf(COLORS, color.value)) throw fail(source, color.at, m.badColor);\n const label = attrs.get(\"label\");\n if (label && [...label.value].length > LABEL_MOST) throw fail(source, label.at, m.labelTooLong(LABEL_MOST));\n for (const { value, at } of namesAt(source, \"item\".length, end, m.itemShape)) {\n declare(source, value, at);\n items.push({ id: value, ...(color ? { color: color.value as Color } : {}), ...(label ? { label: label.value } : {}) });\n }\n }\n\n /** 列の図の `line <列>: <チップ>, <チップ>` の行。チップは宣言したチップで、列に 1 枚ずつ、上限まで。封をした列には書けない */\n function readOrder(source: SourceLine): DiagramEvent {\n const found = ORDER.exec(source.text);\n const lane = found?.[1];\n if (!found || lane === undefined) throw fail(source, 0, m.lineShape);\n const at = found.indices?.[1]?.[0] ?? 0;\n const box = boxAt(source, lane, at);\n if (sealed.has(box)) throw fail(source, at, m.lineOnSealed(box));\n const chips = namesAt(source, found[0].length, source.text.length, m.lineShape);\n const seen = new Set<string>();\n chips.forEach(({ value, at: chipAt }, k) => {\n if (!items.some((item) => item.id === value)) throw fail(source, chipAt, m.noSuchItem(value));\n if (seen.has(value)) throw fail(source, chipAt, m.itemTwice(value));\n if (k >= LANE_MOST) throw fail(source, chipAt, m.laneFull(box, LANE_MOST));\n seen.add(value);\n });\n return { type: \"line\", box, items: chips.map((chip) => chip.value) };\n }\n\n /** 列の図の `seal <列>`、`open <列>`、`pick <列>` の行。封は 1 列に 1 つで、封をした列だけを開けられる */\n function readOnLane(source: SourceLine, word: \"seal\" | \"open\" | \"pick\"): DiagramEvent {\n const found = ON_LANE.exec(source.text);\n const lane = found?.[1];\n if (!found || lane === undefined) throw fail(source, 0, m.laneShape(word));\n const at = found.indices?.[1]?.[0] ?? 0;\n const box = boxAt(source, lane, at);\n if (word === \"seal\") {\n if (sealed.has(box)) throw fail(source, at, m.sealTwice(box));\n sealed.add(box);\n }\n if (word === \"open\" && !sealed.delete(box)) throw fail(source, at, m.openUnsealed(box));\n return { type: word, box };\n }\n\n /** 列の図の `stamp <列>: <字>` の行 */\n function readStamp(source: SourceLine): DiagramEvent {\n const found = STAMP.exec(source.text);\n const lane = found?.[1];\n if (!found || lane === undefined) throw fail(source, 0, m.stampShape);\n const box = boxAt(source, lane, found.indices?.[1]?.[0] ?? 0);\n const named = readName(source, found[0].length, m);\n if (named.value === \"\" || named.rest < source.text.length) throw fail(source, 0, m.stampShape);\n return { type: \"stamp\", box, text: named.value };\n }\n\n /** `strip <題>: <欄>, <欄>` の行 */\n function readStrip(source: SourceLine): void {\n beforeSteps(source);\n if (strip) throw fail(source, 0, m.stripTwice);\n const text = source.text;\n const start = skipSpaces(text, \"strip\".length);\n let stripTitle: string;\n let colon: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n stripTitle = quoted.value;\n colon = skipSpaces(text, quoted.end);\n } else {\n colon = text.indexOf(\":\", start);\n stripTitle = colon < 0 ? \"\" : text.slice(start, colon).trim();\n }\n if (stripTitle === \"\" || text[colon] !== \":\") throw fail(source, 0, m.stripShape);\n if (isTime) {\n strip = { title: stripTitle, fields: readFields(source, colon + 1) };\n return;\n }\n const fields = readList(source, colon + 1, m);\n // 物差しは時間軸の図だけが書ける。ほかの図では欄の名前の一部として読んでいた形なので、欄が属性の形で終わる時だけ断る\n const metered = /\\[\\s*meter\\s*:/u.exec(text);\n if (metered && fields.some((f) => /\\[\\s*meter\\s*:[^\\]]*\\]$/u.test(f))) throw fail(source, metered.index + 1, m.timeOnly(\"meter\"));\n strip = { title: stripTitle, fields };\n }\n\n /**\n * 時間軸の図の `strip` の行の欄。`,` で区切り、欄の名前の後ろに `[meter: <割合>]` を書いた欄は物差しにする。\n * `[` を含む名前は `\"` で囲む\n */\n function readFields(source: SourceLine, at: number): string[] {\n const text = source.text;\n const items: string[] = [];\n for (let i = at; ; ) {\n const start = skipSpaces(text, i);\n let value: string;\n let end: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n value = quoted.value;\n end = skipSpaces(text, quoted.end);\n } else {\n end = start;\n while (end < text.length && text[end] !== \",\" && text[end] !== \"[\") end++;\n value = text.slice(start, end).trim();\n }\n if (value === \"\") throw fail(source, start, m.emptyStripField);\n if (text[end] === \"[\") {\n const close = text.indexOf(\"]\", end);\n if (close < 0) throw fail(source, end, m.attrUnclosed);\n const inside = text.slice(end + 1, close);\n const inner = /^\\s*([a-z]*)\\s*:\\s*(.*?)\\s*$/u.exec(inside);\n if (!inner) throw fail(source, end + 1, m.attrNoColon(inside.trim()));\n const key = inner[1] ?? \"\";\n if (!(ATTRS.strip as readonly string[]).includes(key)) throw fail(source, end + 1, m.badAttr(key, ATTRS.strip));\n if (!RATIO.test(inner[2] ?? \"\")) throw fail(source, end + 1, m.badRatio);\n meters.push({ field: value, line: inner[2] ?? \"\" });\n end = skipSpaces(text, close + 1);\n }\n if (end < text.length && text[end] !== \",\") throw fail(source, end, m.afterQuote);\n items.push(value);\n if (end >= text.length) return items;\n i = end + 1;\n }\n }\n\n /**\n * `say` の行と、その下に `say` より深く字下げして続けた行を段の本文にする。\n * 続きの行の間の空行は本文の空の行になる。返すのは読み終えた最後の行の番号。\n */\n function readSay(source: SourceLine, index: number): number {\n const step = inStep(source);\n if (step.body !== undefined) throw fail(source, 0, m.sayTwice);\n const inline = source.text.slice(\"say\".length).trim();\n const body = inline === \"\" ? [] : [inline];\n let blanks = 0;\n let last = index;\n for (let j = index + 1; j < rest.length; j++) {\n const next = rest[j];\n if (!next) break;\n if (next.text === \"\") {\n blanks++;\n continue;\n }\n if (next.indent <= source.indent) break;\n body.push(...Array.from({ length: blanks }, () => \"\"), next.text);\n blanks = 0;\n last = j;\n }\n if (body.length === 0) throw fail(source, 0, m.emptySay);\n step.body = body;\n return last;\n }\n\n /** `act <名札>: <字>` と `note <名札>: <字>` の行の、箱と字 */\n function readOnBox(source: SourceLine, word: \"act\" | \"note\", shape: string): { box: string; text: string } {\n const found = new RegExp(`^${word}\\\\s+([^\\\\s:]+)\\\\s*:\\\\s*(.*)$`, \"du\").exec(source.text);\n const idAt = found?.indices?.[1]?.[0];\n if (!found || idAt === undefined || (found[2] ?? \"\") === \"\") throw fail(source, 0, shape);\n return { box: boxAt(source, found[1] ?? \"\", idAt), text: found[2] ?? \"\" };\n }\n\n /** 線の行の両端と、`:` の後ろの線の名前。`at` は名前の後ろの位置 */\n function readLine(source: SourceLine, edge: RegExpExecArray): { from: string; to: string; label?: string; at: number } {\n const text = source.text;\n const from = endAt(source, edge[1] ?? \"\", edge.indices?.[1]?.[0] ?? 0, \"from\");\n const to = endAt(source, edge[2] ?? \"\", edge.indices?.[2]?.[0] ?? 0, \"to\");\n const at = skipSpaces(text, edge[0].length);\n if (text[at] !== \":\") return { from, to, at };\n const named = readName(source, at + 1, m);\n if (named.value === \"\") throw fail(source, at, m.emptyLabel);\n return { from, to, label: named.value, at: named.rest };\n }\n\n /** 状態遷移図の最初の `step` より前の `<名札> -> <名札>: <線の名前>` の行。属性は書けない */\n function readPath(source: SourceLine, edge: RegExpExecArray): StatePath {\n const { from, to, label, at } = readLine(source, edge);\n if (at < source.text.length) throw fail(source, at, source.text[at] === \"[\" ? m.pathNoAttrs : m.edgeShape);\n return { from, to, ...(label !== undefined ? { label } : {}) };\n }\n\n /** `<名札> -> <名札>: <線の名前> [<属性>]` の行 */\n function readEdge(source: SourceLine, edge: RegExpExecArray): DiagramEvent {\n const text = source.text;\n const { from, to, label, at } = readLine(source, edge);\n if (at < text.length && text[at] !== \"[\") throw fail(source, at, m.edgeShape);\n const attrs = at < text.length ? readAttrs(source, at, ATTRS.edge, m) : new Map<string, Attr>();\n const tag = attrs.get(\"tag\");\n const carried = attrs.get(\"carry\");\n if (tag && carried) throw fail(source, Math.max(tag.at, carried.at), m.carryTwice);\n if (carried && !isOneOf(CARRIES, carried.value)) throw fail(source, carried.at, m.badCarry);\n const side = attrs.get(\"side\");\n if (side && !isOneOf(SIDES, side.value)) throw fail(source, side.at, m.badSide);\n const columns = readColumns(source, from, to, attrs, at);\n // 枝分かれの図の線は札を動かす線で、書かなければ送る側の名前の札を運ぶ\n let carry: Carry = isGit ? { kind: \"tag\", text: from } : { kind: \"envelope\" };\n if (tag) carry = { kind: \"tag\", text: tag.value };\n else if (carried) carry = carried.value === \"coin\" ? { kind: \"coin\" } : { kind: \"none\" };\n if (isGit && from !== HEAD) tips.set(from, to);\n return {\n type: \"edge\",\n from,\n to,\n ...(label !== undefined ? { label } : {}),\n carry,\n ...(side ? { labelSide: side.value as LabelSide } : {}),\n ...columns,\n };\n }\n\n /**\n * 線の列 (`at` と `into`)。時間軸の図の箱どうしの線は `at` で拡大の帯の列を選び、節目どうしの線は列を持たない。\n * ほかの図の種類には書けない\n */\n function readColumns(source: SourceLine, from: string, to: string, attrs: Map<string, Attr>, end: number): { at?: number; into?: number } {\n const given = TIME_EDGE_ATTRS.flatMap((key) => {\n const attr = attrs.get(key);\n return attr ? [{ key, attr }] : [];\n });\n const first = given[0];\n if (!isTime) {\n if (first) throw fail(source, first.attr.at, m.timeOnly(first.key));\n return {};\n }\n const isBox = (id: string): boolean => boxes.some((box) => box.id === id);\n if (isBox(from) !== isBox(to)) throw fail(source, 0, m.mixedLine);\n if (!isBox(from)) {\n if (first) throw fail(source, first.attr.at, zoom ? m.pointLineNoAt : m.noZoom);\n return {};\n }\n const column = (attr: Attr | undefined): number | undefined => {\n if (!attr) return undefined;\n const unit = unitAt(source, attr.at, attr.value);\n if (!zoom || unit < zoom.from || unit > zoom.to) throw fail(source, attr.at, zoom ? m.outOfZoom(zoom.from, zoom.to) : m.noZoom);\n return unit;\n };\n const at = column(attrs.get(\"at\"));\n if (at === undefined) throw fail(source, end, m.boxLineNeedsAt);\n const into = column(attrs.get(\"into\"));\n return { at, ...(into !== undefined ? { into } : {}) };\n }\n\n /** `set <欄>: <値> [tag: <札>]` か `set <欄> [tag: <札>]` の行 */\n function readSet(source: SourceLine): DiagramEvent {\n const declared = strip;\n if (!declared) throw fail(source, 0, m.stripUndeclared);\n const text = source.text;\n const start = skipSpaces(text, \"set\".length);\n let field: string;\n let at: number;\n if (text[start] === '\"') {\n const quoted = readQuoted(source, start, m);\n field = quoted.value;\n at = skipSpaces(text, quoted.end);\n } else {\n at = start;\n while (at < text.length && text[at] !== \":\" && text[at] !== \"[\") at++;\n field = text.slice(start, at).trim();\n }\n if (!declared.fields.includes(field)) throw fail(source, start, m.noSuchField(field));\n let value: string | undefined;\n if (text[at] === \":\") {\n const named = readName(source, at + 1, m);\n if (named.value === \"\") throw fail(source, at, m.stripNeedsValue);\n value = named.value;\n at = named.rest;\n }\n if (at < text.length && text[at] !== \"[\") throw fail(source, at, m.stripNeedsValue);\n const tag = at < text.length ? readAttrs(source, at, ATTRS.set, m).get(\"tag\")?.value : undefined;\n if (value === undefined && tag === undefined) throw fail(source, 0, m.stripNeedsValue);\n if (value !== undefined && meters.some((meter) => meter.field === field) && !RATIO.test(value)) throw fail(source, start, m.meterValue(field));\n return {\n type: \"strip\",\n field,\n ...(value !== undefined ? { value } : {}),\n ...(tag !== undefined ? { tag } : {}),\n };\n }\n}\n\nexport function parseNotation(notation: string, options: ParseOptions = {}): Parsed {\n try {\n return { ok: true, diagram: parseLines(tokenize(notation), messagesFor(options.lang ?? \"ja\")) };\n } catch (error) {\n if (!(error instanceof NotationError)) throw error;\n return { ok: false, errors: [{ line: error.line, column: error.column, message: error.message }] };\n }\n}\n","/**\n * 図の原本の JSON を、人が書く dragon記法へ書き戻す (#3137)。\n *\n * 並べ方は決まった形に整える。JSON の欄の並び順は見ず、欄の名前で読むので、\n * 同じ内容の JSON からは毎回同じ文字列になる。書き手の行の並べ方とコメントは保たない。\n * 段の中で起きることは JSON の並び順 (起きる順) のまま書く。\n * 状態遷移図の移れる道 (`state.paths`) は、帯の宣言の後、最初の `step` より前に JSON の並びのまま書く (#3163)。\n *\n * `\"` で囲むのは要る時だけにする。`[` を含む名前と、`,` か `]` を含む属性の値と、`\"` で始まる字を囲む。\n * 箱は JSON の並びのまま書き、同じ区画の箱が続く所を 1 つの `group … end` にする。\n * 区画の箱が飛び飛びの時は同じ `group` を開き直す。区画の並びが箱の現れる順と違う時と、\n * 箱の無い区画がある時は、先に全ての区画を中の無い `group … end` で宣言してから開き直す。\n * 枝分かれの図 (#3164) は、枝の `branch` の行を箱より前に書き、札を動かす線の運ぶ物が送る側の名前の札なら書かない。\n * 時間軸の図 (#3165) は、目盛りと区切りと印の列と節目と拡大の範囲の行を箱より前に書き、物差しの欄の後ろに `[meter: <割合>]` を書く。\n * 時間軸の図の `note` は属性を持てるので、`[` を含む字を `\"` で囲む。\n * 木の図 (#3233) の葉と親は、段の中に `leaf` と `node … of …` の行で書く。\n * 列の図 (#3239) のチップは箱の後ろに `item` の行で書き、色が同じで字を持たないチップが続く所は 1 行に並べる。\n * 段の出典 (#3199) は `say` と `code` の後ろ、段の中で起きることより前に、JSON の並びのまま 1 つずつ `source` の行に書く。\n */\nimport type { Box, Diagram, DiagramEvent, LineupItem, Region, TimeSpec } from \"./schema\";\nimport { AT, COPY, FROM, MERGE, NOW, OF, ON } from \"./words\";\n\nconst quote = (text: string): string => `\"${text.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"')}\"`;\n/** 行の終わりか `[` の前に置く名前と文 */\nconst name = (text: string): string => (text.includes(\"[\") || text.startsWith('\"') ? quote(text) : text);\n/** `:` の前に置く字 (帯の題と、`set` の欄) */\nconst key = (text: string): string => (text.includes(\":\") || text.includes(\"[\") || text.startsWith('\"') ? quote(text) : text);\n/** `strip` の行に `,` で並べる欄。時間軸の図の欄は後ろに物差しの属性を書けるので、`[` を含む名前も囲む */\nconst field = (text: string, time: boolean): string => (text.includes(\",\") || text.startsWith('\"') || (time && text.includes(\"[\")) ? quote(text) : text);\n/** 属性の値 */\nconst value = (text: string): string => (text.includes(\",\") || text.includes(\"]\") || text.startsWith('\"') ? quote(text) : text);\n\n/** 属性の並び。値の無い鍵は書かず、1 つも無ければ何も付けない */\nconst attrs = (pairs: [string, string | undefined][]): string => {\n const written = pairs.filter((pair): pair is [string, string] => pair[1] !== undefined);\n return written.length === 0 ? \"\" : ` [${written.map(([k, v]) => `${k}: ${value(v)}`).join(\", \")}]`;\n};\n\n/** 名札と違う名前だけを `as` の後ろに書く */\nconst shown = (id: string, text: string): string => (text === id ? \"\" : ` as ${name(text)}`);\n\nconst declareRegion = (r: Region): string =>\n `group ${r.id}${shown(r.id, r.name)}${attrs([\n [\"note\", r.note],\n [\"color\", r.color],\n [\"icon\", r.icon],\n ])}`;\nconst declareBox = (b: Box): string =>\n `box ${b.id}${shown(b.id, b.name)}${attrs([\n [\"note\", b.sub],\n [\"color\", b.color],\n [\"icon\", b.icon],\n [\"link\", b.link],\n ])}`;\n\n/** 線の行の両端と名前 */\nconst line = (from: string, to: string, label: string | undefined): string => `${from} -> ${to}${label === undefined ? \"\" : `: ${name(label)}`}`;\n\n/** 目盛りの範囲。1 つの目盛りは番号だけを書く */\nconst range = (from: number, to: number): string => (from === to ? `${from}` : `${from}-${to}`);\n/** 数の属性の値 */\nconst num = (n: number | undefined): string | undefined => (n === undefined ? undefined : `${n}`);\n\n/** 段の中の 1 行。`kind` は図の種類。枝分かれの図の線は、送る側の名前の札を書かない時の運ぶ物にする */\nfunction event(e: DiagramEvent, kind: Diagram[\"kind\"]): string {\n switch (e.type) {\n case \"edge\": {\n const plain = kind === \"git\" ? e.carry.kind === \"tag\" && e.carry.text === e.from : e.carry.kind === \"envelope\";\n const carry: [string, string][] = plain ? [] : e.carry.kind === \"tag\" ? [[\"tag\", e.carry.text]] : [[\"carry\", e.carry.kind]];\n return `${line(e.from, e.to, e.label)}${attrs([...carry, [\"side\", e.labelSide], [\"at\", num(e.at)], [\"into\", num(e.into)]])}`;\n }\n case \"action\":\n return `act ${e.box}: ${e.label}`;\n case \"swap\":\n return kind === \"time\" ? `note ${e.box}: ${name(e.text)}${attrs([[\"color\", e.color]])}` : `note ${e.box}: ${e.text}`;\n case \"now\":\n return `${NOW} -> ${e.to}`;\n case \"mark\":\n return `mark ${e.row} ${range(e.from, e.to)}${attrs([[\"color\", e.color]])}`;\n case \"span\":\n return `span ${range(e.from, e.to)}: ${name(e.text)}${attrs([\n [\"shape\", e.shape],\n [\"color\", e.color],\n ])}`;\n case \"strip\":\n return `set ${key(e.field)}${e.value === undefined ? \"\" : `: ${name(e.value)}`}${attrs([[\"tag\", e.tag]])}`;\n case \"commit\":\n return `commit ${e.id} ${ON} ${e.branch}${e.copy === undefined ? \"\" : ` ${COPY} ${e.copy}`}${e.merge === undefined ? \"\" : ` ${MERGE} ${e.merge}`}${attrs([\n [\"hash\", e.hash],\n [\"note\", e.note],\n ])}`;\n case \"branch\":\n return `${e.branch} ${FROM} ${e.from}`;\n case \"leaf\":\n return `leaf ${e.id}${attrs([[\"hash\", e.hash]])}`;\n case \"node\":\n return `node ${e.id} ${OF} ${e.children.join(\", \")}${attrs([[\"hash\", e.hash]])}`;\n case \"line\":\n return `line ${e.box}: ${e.items.join(\", \")}`;\n case \"seal\":\n case \"open\":\n case \"pick\":\n return `${e.type} ${e.box}`;\n case \"stamp\":\n return `stamp ${e.box}: ${name(e.text)}`;\n }\n}\n\n/** 列の図のチップの宣言の行。色が同じで字を持たないチップが続く所は 1 行に並べる */\nfunction itemLines(items: LineupItem[]): string {\n const rows: LineupItem[][] = [];\n for (const item of items) {\n const row = rows.at(-1);\n if (row && item.label === undefined && row[0]?.label === undefined && row[0]?.color === item.color) row.push(item);\n else rows.push([item]);\n }\n return rows\n .map(\n (row) =>\n `item ${row.map((item) => item.id).join(\", \")}${attrs([\n [\"color\", row[0]?.color],\n [\"label\", row[0]?.label],\n ])}`,\n )\n .join(\"\\n\");\n}\n\n/** 時間軸の図の目盛りと区切りと印の列と節目と拡大の範囲の宣言の塊 */\nfunction timeBlocks(time: TimeSpec): string[] {\n const head = [\n `scale ${time.scale.unit} ${time.scale.length} ${time.scale.count}${attrs([[\"from\", num(time.scale.from)]])}`,\n ...(time.period ? [`period ${time.period.name} ${time.period.length}${attrs([[\"from\", num(time.period.from)]])}`] : []),\n ];\n const rows = time.rows.map(\n (r) =>\n `row ${r.id}${shown(r.id, r.name)}${attrs([\n [\"color\", r.color],\n [\"empty\", r.empty && r.empty.length > 0 ? r.empty.join(\" \") : undefined],\n ])}`,\n );\n const points = (time.points ?? []).map((p) => `point ${p.id} ${AT} ${p.at}`);\n return [head.join(\"\\n\"), rows.join(\"\\n\"), ...(points.length > 0 ? [points.join(\"\\n\")] : []), ...(time.zoom ? [`zoom ${range(time.zoom.from, time.zoom.to)}`] : [])];\n}\n\n/** 区画と箱の宣言の塊。塊どうしは空行で区切る */\nfunction declarations(diagram: Diagram): string[] {\n const regions = diagram.regions ?? [];\n const runs: { region?: string; boxes: Box[] }[] = [];\n for (const b of diagram.boxes) {\n const last = runs.at(-1);\n if (last && last.region === b.region) last.boxes.push(b);\n else runs.push({ ...(b.region !== undefined ? { region: b.region } : {}), boxes: [b] });\n }\n const opened = [...new Set(runs.flatMap((run) => (run.region === undefined ? [] : [run.region])))];\n const inOrder = opened.length === regions.length && opened.every((id, i) => regions[i]?.id === id);\n const declared = new Set<string>();\n const blocks: string[] = [];\n if (!inOrder) {\n for (const r of regions) {\n blocks.push(`${declareRegion(r)}\\nend`);\n declared.add(r.id);\n }\n }\n for (const run of runs) {\n const lines = run.boxes.map(declareBox);\n if (run.region === undefined) {\n blocks.push(lines.join(\"\\n\"));\n continue;\n }\n const region = regions.find((r) => r.id === run.region);\n const open = declared.has(run.region) || !region ? `group ${run.region}` : declareRegion(region);\n declared.add(run.region);\n blocks.push([open, ...lines.map((line) => ` ${line}`), \"end\"].join(\"\\n\"));\n }\n return blocks;\n}\n\nexport function printNotation(diagram: Diagram): string {\n const branches = (diagram.git?.branches ?? []).map((b) => `branch ${b.id}${attrs([[\"note\", b.note]])}`);\n const time = diagram.kind === \"time\";\n const blocks = [\n `${diagram.kind} ${name(diagram.title)}${attrs([[\"view\", diagram.view]])}`,\n ...(branches.length > 0 ? [branches.join(\"\\n\")] : []),\n ...(diagram.time ? timeBlocks(diagram.time) : []),\n ...declarations(diagram),\n ...(diagram.lineup && diagram.lineup.items.length > 0 ? [itemLines(diagram.lineup.items)] : []),\n ];\n if (diagram.strip) {\n const meters = new Map((diagram.strip.meters ?? []).map((m) => [m.field, m.line]));\n const fields = diagram.strip.fields.map((f) => `${field(f, time)}${attrs([[\"meter\", meters.get(f)]])}`);\n blocks.push(`strip ${key(diagram.strip.title)}: ${fields.join(\", \")}`);\n }\n if (diagram.state) blocks.push(diagram.state.paths.map((p) => line(p.from, p.to, p.label)).join(\"\\n\"));\n for (const step of diagram.steps) {\n const body = step.body.split(\"\\n\");\n const say = body.length === 1 ? [` say ${step.body}`] : [\" say\", ...body.map((line) => (line === \"\" ? \"\" : ` ${line}`))];\n blocks.push(\n [\n `step ${step.title}`,\n ...say,\n ...(step.code === undefined ? [] : [` code ${step.code}`]),\n ...(step.sources ?? []).map((s) => ` source ${name(s.name)}${attrs([[\"url\", s.url]])}`),\n ...step.events.map((e) => ` ${event(e, diagram.kind)}`),\n ].join(\"\\n\"),\n );\n }\n return `${blocks.join(\"\\n\\n\")}\\n`;\n}\n","/**\n * 構成図の置き場所。\n *\n * 区画を上から帯に積み、帯の左に区画の名前を置く。箱は全ての帯で共通の列に並べるので、\n * 区画をまたぐ線は縦にまっすぐ走る。箱の並びは線を辿って決める。前の区画の箱から線が来る箱を\n * その箱の列に置き、そこから線で繋がる箱を隣の列へ (寄せの指示が左か右なら下の行へ) 置いていく。\n * 線は縦と横の折れ線で、間にある箱を避ける。名前が箱に掛かる時は帯を広げて名前の場所を空ける。\n */\nimport { LOOK, TYPE } from \"../look/values\";\nimport type { Diagram, LabelSide, Region } from \"../schema\";\nimport { textWidth } from \"./measure\";\nimport {\n badgeOnPath,\n badgeRect,\n boxColors,\n boxWidth,\n cornerBadge,\n edgeColor,\n edgesOf,\n labelStyle,\n type Layout,\n lineBadges,\n LOOP_ROOM,\n loopBadge,\n loopLabelBase,\n loopUnder,\n replaceSameSpot,\n layoutStrip,\n type Point,\n placeLabel,\n placeSlot,\n type Rect,\n regionColors,\n type SceneBox,\n type SceneEdge,\n type SceneLabel,\n type SceneRegion,\n seatCarriers,\n shiftContent,\n slotBoxWidth,\n slotRooms,\n stripNeed,\n} from \"./scene\";\n\ninterface Group {\n region?: Region;\n members: string[];\n}\n\ninterface Slot {\n group: number;\n col: number;\n row: number;\n}\n\ninterface Room {\n top: number;\n bottom: number;\n}\n\nexport function layoutArchitecture(diagram: Diagram): Layout {\n const groups = groupsOf(diagram);\n const slots = placeBoxes(diagram, groups);\n const rooms = groups.map(() => ({ top: 0, bottom: 0 }));\n let layout = arrange(diagram, groups, slots, rooms);\n // 名前を置く場所が帯の外へ出たら、その帯を広げて置き直す\n for (let pass = 0; pass < 3 && grow(layout, groups, slots, rooms); pass++) layout = arrange(diagram, groups, slots, rooms);\n return layout;\n}\n\nfunction groupsOf(diagram: Diagram): Group[] {\n const regions = diagram.regions ?? [];\n const known = new Set(regions.map((r) => r.id));\n const groups: Group[] = regions.map((region) => ({ region, members: diagram.boxes.filter((b) => b.region === region.id).map((b) => b.id) }));\n const loose = diagram.boxes.filter((b) => b.region === undefined || !known.has(b.region)).map((b) => b.id);\n if (loose.length > 0) groups.push({ members: loose });\n return groups;\n}\n\nconst vertical = (side: LabelSide | undefined): boolean => side === \"left\" || side === \"right\";\n\n/** 箱を列と行へ置く。列は全ての区画で共通。 */\nfunction placeBoxes(diagram: Diagram, groups: Group[]): Map<string, Slot> {\n const columns = LOOK.architecture.columns;\n const edges = edgesOf(diagram).map((e) => e.edge);\n const slots = new Map<string, Slot>();\n groups.forEach((group, g) => {\n const inGroup = new Set(group.members);\n const taken = new Set<string>();\n const free = (col: number, row: number): boolean => col >= 0 && col < columns && !taken.has(`${col},${row}`);\n const near = (col: number, row: number): [number, number] => {\n const start = Math.min(columns - 1, Math.max(0, col));\n for (let r = row; ; r++) {\n for (let d = 0; d < columns; d++) {\n for (const c of [start + d, start - d]) if (free(c, r)) return [c, r];\n }\n }\n };\n const put = (id: string, col: number, row: number): void => {\n slots.set(id, { group: g, col, row });\n taken.add(`${col},${row}`);\n };\n let dir = 1;\n const visit = (id: string): void => {\n for (const edge of edges) {\n const partner = edge.from === id ? edge.to : edge.to === id ? edge.from : undefined;\n if (partner === undefined || !inGroup.has(partner) || slots.has(partner)) continue;\n const me = slots.get(id) as Slot;\n const [c, r] = vertical(edge.labelSide) ? near(me.col, me.row + 1) : free(me.col + dir, me.row) ? [me.col + dir, me.row] : near(me.col + dir, me.row);\n put(partner, c, r);\n visit(partner);\n }\n };\n // 前の区画の箱と線で繋がる箱 (起きる順に早い線から) をその箱の列に置き、そこから辿る\n const anchorOf = (id: string): { order: number; col: number } | undefined => {\n for (let i = 0; i < edges.length; i++) {\n const edge = edges[i];\n const partner = edge?.from === id ? edge.to : edge?.to === id ? edge.from : undefined;\n const slot = partner === undefined ? undefined : slots.get(partner);\n if (slot && slot.group < g) return { order: i, col: slot.col };\n }\n return undefined;\n };\n let placed = 0;\n for (;;) {\n const rest = group.members.filter((id) => !slots.has(id));\n if (rest.length === 0) break;\n const anchored = rest.map((id) => ({ id, anchor: anchorOf(id) })).filter((a) => a.anchor !== undefined);\n anchored.sort((a, b) => (a.anchor?.order ?? 0) - (b.anchor?.order ?? 0));\n const pick = anchored[0] ?? { id: rest[0] as string, anchor: undefined };\n const want = pick.anchor?.col ?? 0;\n if (placed === 0) dir = want >= (columns - 1) / 2 ? -1 : 1;\n const [c, r] = free(want, 0) ? [want, 0] : near(want, 0);\n put(pick.id, c, r);\n visit(pick.id);\n placed++;\n }\n });\n // 使っていない列を詰める\n const used = [...new Set([...slots.values()].map((s) => s.col))].sort((a, b) => a - b);\n for (const slot of slots.values()) slot.col = used.indexOf(slot.col);\n return slots;\n}\n\n/** 区画の名前の行。空白があれば真ん中に近い空白で 2 行に折る。 */\nfunction nameLines(name: string): string[] {\n const spaces = [...name.matchAll(/ /g)].map((m) => m.index);\n if (spaces.length === 0) return [name];\n const at = spaces.reduce((best, i) => (Math.abs(i - name.length / 2) < Math.abs(best - name.length / 2) ? i : best));\n return [name.slice(0, at), name.slice(at + 1)];\n}\n\nfunction headerSize(region: Region): { w: number; h: number; lines: string[] } {\n const { icon, nameY, line, inset } = LOOK.region;\n const lines = nameLines(region.name);\n const w = Math.max(icon, ...lines.map((l) => textWidth(l, TYPE.regionName)), textWidth(region.note ?? \"\", TYPE.regionNote));\n // 名前の最後の行の下と、添え書きの下まで\n const h = nameY - inset + (lines.length - 1) * line + (region.note ? line : 0) + LOOK.gap / 2;\n return { w, h, lines };\n}\n\nfunction arrange(diagram: Diagram, groups: Group[], slots: Map<string, Slot>, rooms: Room[]): Layout {\n const { box: B, region: R, architecture: A, margin, gap } = LOOK;\n const colors = boxColors(diagram);\n const regionColor = regionColors(diagram);\n const edges = edgesOf(diagram);\n\n // 列の幅と列の間。隣の列を横に結ぶ名前のある線は、名前が収まるまで間を広げる (広げすぎる時は脇へ寄せる)\n const columnCount = Math.max(1, ...[...slots.values()].map((s) => s.col + 1));\n // 運ぶ物を出し入れする箱は、絵柄の横に置き場を並べられる幅にする (#3176)\n const carriedIn = slotRooms(diagram);\n const widths = new Map(diagram.boxes.map((b) => [b.id, Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(carriedIn.get(b.id), b.icon !== undefined, B.padX))]));\n const colW = Array.from({ length: columnCount }, (_, c) => Math.max(B.minW, ...[...slots].filter(([, s]) => s.col === c).map(([id]) => widths.get(id) ?? B.minW)));\n const between = Array.from({ length: Math.max(0, columnCount - 1) }, () => A.columnGap as number);\n for (const { edge } of edges) {\n const a = slots.get(edge.from);\n const b = slots.get(edge.to);\n if (!a || !b || edge.label === undefined || a.group !== b.group || a.row !== b.row || Math.abs(a.col - b.col) !== 1 || vertical(edge.labelSide)) continue;\n const need = textWidth(edge.label, labelStyle(edge.label)) + LOOK.label.padX * 2 + A.labelRoom * 2;\n const i = Math.min(a.col, b.col);\n if (need <= A.maxColumnGap) between[i] = Math.max(between[i] ?? 0, need);\n }\n const headers = groups.map((g) => (g.region ? headerSize(g.region) : undefined));\n const headerW = Math.max(0, ...headers.map((h) => (h ? h.w + R.inset * 2 : 0)));\n const colLeft: number[] = [];\n for (let c = 0; c < columnCount; c++) colLeft.push(c === 0 ? margin + (headerW > 0 ? headerW : R.pad) : (colLeft[c - 1] as number) + (colW[c - 1] as number) + (between[c - 1] as number));\n const center = (c: number): number => (colLeft[c] as number) + (colW[c] as number) / 2;\n\n // 同じ箱へ戻る線は箱の下の輪で描くので、輪を持つ箱の行の下は、輪とその下の名前が収まるだけ空ける (#3186)\n const looped = new Set(edges.filter(({ edge }) => edge.from === edge.to).map(({ edge }) => edge.from));\n const loopRows = new Set([...looped].flatMap((id) => {\n const slot = slots.get(id);\n return slot ? [`${slot.group}:${slot.row}`] : [];\n }));\n const loopRoom = (g: number, row: number): number => (loopRows.has(`${g}:${row}`) ? LOOP_ROOM : 0);\n\n // 帯を上から積む\n const boxes: SceneBox[] = [];\n const bands: { group: number; y: number; h: number; rows: number }[] = [];\n let cursor = margin;\n groups.forEach((group, g) => {\n const rows = Math.max(1, ...group.members.map((id) => (slots.get(id)?.row ?? 0) + 1));\n const room = rooms[g] as Room;\n const top = cursor + R.pad + room.top;\n // 行の上端。輪を持つ行の下は、行の間に輪の分を足す\n const rowTop: number[] = [0];\n for (let r = 1; r < rows; r++) rowTop.push((rowTop[r - 1] as number) + B.h + A.rowGap + loopRoom(g, r - 1));\n for (const id of group.members) {\n const slot = slots.get(id) as Slot;\n const source = diagram.boxes.find((b) => b.id === id);\n const w = widths.get(id) ?? B.minW;\n const cx = center(slot.col);\n const y = top + (rowTop[slot.row] as number);\n boxes.push({\n id,\n name: source?.name ?? id,\n ...(source?.sub !== undefined ? { sub: source.sub } : {}),\n ...(source?.icon !== undefined ? { icon: source.icon } : {}),\n color: colors.get(id) ?? \"slate\",\n x: cx - w / 2,\n y,\n w,\n h: B.h,\n cx,\n cy: y + B.h / 2,\n });\n }\n const contentBottom = top + (rowTop[rows - 1] as number) + B.h + loopRoom(g, rows - 1);\n const header = headers[g];\n const h = Math.max(contentBottom + R.pad + room.bottom - cursor, header ? header.h + R.inset * 2 : 0, group.region ? R.minH : 0);\n bands.push({ group: g, y: cursor, h, rows });\n cursor += h + R.gap;\n });\n const bandsBottom = cursor - R.gap;\n for (const box of boxes) placeSlot(box, carriedIn.get(box.id));\n\n const byId = new Map(boxes.map((b) => [b.id, b]));\n const bandOf = (id: string) => bands[slots.get(id)?.group ?? 0] as (typeof bands)[number];\n /** 折れ線のどれかの区間が、四角を `pad` だけ広げた所に掛かる */\n const crosses = (points: Point[], rect: Rect, pad: number): boolean => {\n for (let i = 1; i < points.length; i++) {\n const [x1, y1] = points[i - 1] as Point;\n const [x2, y2] = points[i] as Point;\n if (Math.min(x1, x2) <= rect.x + rect.w + pad && Math.max(x1, x2) >= rect.x - pad && Math.min(y1, y2) <= rect.y + rect.h + pad && Math.max(y1, y2) >= rect.y - pad) return true;\n }\n return false;\n };\n // 輪を持つ箱の下の、輪と名前の置き場。ほかの線は、その箱から出る線と入る線も含めてここを通さない (#3186)\n const loopZones: Rect[] = [...looped].flatMap((id) => {\n const box = byId.get(id);\n return box ? [{ x: box.x, y: box.y + box.h, w: box.w, h: LOOP_ROOM }] : [];\n });\n const onLoop = (points: Point[]): boolean => loopZones.some((zone) => crosses(points, zone, 0));\n const blocked = (points: Point[], a: string, b: string): boolean =>\n boxes.some((box) => box.id !== a && box.id !== b && crosses(points, box, LOOK.label.search)) || onLoop(points);\n // 箱の下 (上) の、次の行か次の帯との間の真ん中。箱の下に輪が在る時は、輪と名前の下を通す (#3186)\n const laneBelow = (id: string): number => {\n const box = byId.get(id) as SceneBox;\n const band = bandOf(id);\n const slot = slots.get(id);\n const under = box.y + box.h + (slot ? loopRoom(slot.group, slot.row) : 0);\n return (slot?.row ?? 0) < band.rows - 1 ? under + A.rowGap / 2 : Math.min(under + R.pad / 2, band.y + band.h - LOOK.edge.inset);\n };\n const laneAbove = (id: string): number => {\n const box = byId.get(id) as SceneBox;\n const band = bandOf(id);\n return (slots.get(id)?.row ?? 0) > 0 ? box.y - A.rowGap / 2 : Math.max(box.y - R.pad / 2, band.y + LOOK.edge.inset);\n };\n const inset = LOOK.edge.inset;\n /** 列 `col` の右 (左) の、隣の列との間の真ん中。同じ列の箱は幅が違うので、箱ではなく列の端から測る (幅の広い箱の中を通さない) */\n const gapX = (col: number, toRight: boolean): number =>\n toRight ? (colLeft[col] as number) + (colW[col] as number) + (between[col] ?? A.columnGap) / 2 : (colLeft[col] as number) - (between[col - 1] ?? A.columnGap) / 2;\n const route = (from: string, to: string): Point[] => {\n const a = byId.get(from) as SceneBox;\n const b = byId.get(to) as SceneBox;\n // 同じ箱へ戻る線は、状態遷移図と同じ箱の下の輪で描く (#3186)\n if (from === to) return loopUnder(a);\n const sa = slots.get(from) as Slot;\n const sb = slots.get(to) as Slot;\n if (sa.group === sb.group && sa.row === sb.row) {\n const right = b.cx > a.cx;\n const straight: Point[] = [\n [right ? a.x + a.w : a.x, a.cy],\n [right ? b.x - inset : b.x + b.w + inset, b.cy],\n ];\n if (!blocked(straight, from, to)) return straight;\n const below = laneBelow(from);\n const under: Point[] = [\n [a.cx, a.y + a.h],\n [a.cx, below],\n [b.cx, below],\n [b.cx, b.y + b.h + inset],\n ];\n if (!onLoop(under)) return under;\n // 下を回ると輪を横切る時は、上を回る\n const above = laneAbove(from);\n const over: Point[] = [\n [a.cx, a.y],\n [a.cx, above],\n [b.cx, above],\n [b.cx, b.y - inset],\n ];\n return onLoop(over) ? under : over;\n }\n const down = b.cy > a.cy;\n const leave: Point = [a.cx, down ? a.y + a.h : a.y];\n const enter: Point = [b.cx, down ? b.y - inset : b.y + b.h + inset];\n if (sa.col === sb.col) {\n const straight: Point[] = [leave, enter];\n if (!blocked(straight, from, to)) return straight;\n const x = gapX(sa.col, true);\n return [\n [a.x + a.w, a.cy],\n [x, a.cy],\n [x, b.cy],\n [b.x + b.w + inset, b.cy],\n ];\n }\n const right = b.cx > a.cx;\n const lane = down ? laneBelow(from) : laneAbove(from);\n const candidates: Point[][] = [\n [leave, [a.cx, b.cy], [right ? b.x - inset : b.x + b.w + inset, b.cy]],\n [[right ? a.x + a.w : a.x, a.cy], [b.cx, a.cy], enter],\n [leave, [a.cx, lane], [b.cx, lane], enter],\n ];\n // 輪を持つ箱の下からは出入りしない。箱の脇から列の間へ出て、列の間を縦に走る (#3186)\n if (looped.has(from) || looped.has(to)) {\n const ax = gapX(sa.col, right);\n const bx = gapX(sb.col, !right);\n const out: Point[] = [\n [right ? a.x + a.w : a.x, a.cy],\n [ax, a.cy],\n ];\n const side: Point = [right ? b.x - inset : b.x + b.w + inset, b.cy];\n candidates.push(\n [...out, [ax, b.cy], side],\n [...out, [ax, lane], [b.cx, lane], enter],\n [leave, [a.cx, lane], [bx, lane], [bx, b.cy], side],\n [...out, [ax, lane], [bx, lane], [bx, b.cy], side],\n );\n }\n return candidates.find((points) => !blocked(points, from, to)) ?? (candidates[2] as Point[]);\n };\n\n const sceneEdges: SceneEdge[] = edges.map(({ step, event, edge }) => ({\n step,\n event,\n from: edge.from,\n to: edge.to,\n points: route(edge.from, edge.to),\n color: edgeColor(edge, colors),\n carry: edge.carry,\n }));\n // 運ぶ物は着いた箱の置き場に留まり、出る箱の置き場で走り出しを待つ (#3176)\n seatCarriers(sceneEdges, byId, carriedIn);\n // 同じ 2 つの箱を行きと帰りで結ぶまっすぐな線は、少しずらして重ならないようにする。\n // ずらした線の名前は、ずらした側 (もう一方の線の反対側) に置き、どちらの線の名前かを取り違えないようにする (#3175)\n const outward = new Map<SceneEdge, LabelSide>();\n for (const edge of sceneEdges) {\n if (edge.points.length !== 2) continue;\n const back = sceneEdges.some((other) => other.from === edge.to && other.to === edge.from && other.points.length === 2);\n if (!back) continue;\n const [p, q] = edge.points as [Point, Point];\n const flat = Math.abs(q[1] - p[1]) < Math.abs(q[0] - p[0]);\n const d = (edge.from < edge.to ? 1 : -1) * LOOK.edge.parallel;\n edge.points = edge.points.map(([x, y]) => (flat ? [x, y + d] : [x + d, y]));\n outward.set(edge, flat ? (d > 0 ? \"below\" : \"above\") : d > 0 ? \"right\" : \"left\");\n }\n\n const regions: SceneRegion[] = [];\n groups.forEach((group, g) => {\n const band = bands[g] as (typeof bands)[number];\n const header = headers[g];\n if (!group.region || !header) return;\n regions.push({\n id: group.region.id,\n lines: header.lines,\n ...(group.region.note !== undefined ? { note: group.region.note } : {}),\n ...(group.region.icon !== undefined ? { icon: group.region.icon } : {}),\n color: regionColor.get(group.region.id) ?? \"slate\",\n x: margin,\n y: band.y,\n w: 0,\n h: band.h,\n header: { x: margin + R.inset, y: band.y + R.inset, w: header.w, h: header.h },\n });\n });\n\n // 線の名前は、同じ時刻に見えている段の番号 (その段とそれより前の段の番号) も避ける (#3175)\n // 輪の番号は弧に重ねず弧の右に置く (#3186)\n const badgeAt = (edge: SceneEdge, taken: Point[], lines: Point[][]): Point => (edge.from === edge.to ? loopBadge(edge.points) : badgeOnPath(edge.points, taken, lines));\n const early = lineBadges(sceneEdges, diagram.steps.length, badgeAt);\n const labels: SceneLabel[] = [];\n for (const edge of sceneEdges) {\n const source = diagram.steps[edge.step]?.events[edge.event];\n if (source?.type !== \"edge\" || source.label === undefined) continue;\n const seen = [...early].filter(([s]) => s <= edge.step).map(([, b]) => badgeRect(b.point));\n const soft: Rect[] = [...regions.map((r) => r.header), ...labels.filter((l) => l.step === edge.step)];\n // 指示の無い線の名前は、空いていなければ反対の側も探す。ずらした線は自分の側だけを探す\n const side = source.labelSide ?? outward.get(edge);\n // 輪の名前は輪の下から探す (#3186)\n const below = edge.from === edge.to ? { side: \"below\" as const, base: loopLabelBase(edge.points, textWidth(source.label, labelStyle(source.label)) + LOOK.label.padX * 2) } : undefined;\n labels.push(\n placeLabel(\n { step: edge.step, event: edge.event, text: source.label, points: edge.points, color: edge.color, ...(below ?? (side ? { side } : { flip: true })) },\n { hard: boxes, soft, touch: seen },\n ),\n );\n }\n\n const layout: Layout = { kind: \"architecture\", width: 0, height: 0, regions, boxes, lifelines: [], edges: sceneEdges, labels, actions: [], badges: [], paths: [], ends: [] };\n // 名前が左へ出たら、帯の中身を右へ寄せる。帯は図の幅いっぱいに引き直す\n const shift = labels.length > 0 ? Math.max(0, margin + LOOK.label.soft - Math.min(...labels.map((l) => l.x))) : 0;\n if (shift > 0) shiftContent(layout, shift, 0);\n const contentRight = Math.max(...boxes.map((b) => b.x + b.w + R.pad), ...labels.map((l) => l.x + l.w + LOOK.label.soft), ...sceneEdges.flatMap((e) => e.points.map((p) => p[0] + R.pad)));\n const width = Math.max(contentRight + margin, stripNeed(diagram) + margin * 2);\n for (const region of regions) region.w = width - margin * 2;\n // 箱の下を回る線の名前は帯の下へ出ることがあるので、名前の下端まで図に入れる (#3176)\n const contentBottom = Math.max(bandsBottom, ...labels.map((l) => l.y + l.h));\n const strip = layoutStrip(diagram, margin, contentBottom + gap, width - margin * 2);\n layout.width = width;\n layout.height = (strip ? strip.y + strip.h : contentBottom) + margin;\n if (strip) layout.strip = strip;\n const lines = lineBadges(sceneEdges, diagram.steps.length, badgeAt);\n // 同じ所に置いた番号は、後の段が始まると入れ替える (#3184)\n layout.badges = replaceSameSpot(\n diagram.steps.map((step, s) => {\n const line = lines.get(s);\n if (!line) return cornerBadge(step.events, s, layout);\n return { step: s, x: line.point[0], y: line.point[1], color: line.edge.color };\n }),\n );\n return layout;\n}\n\n/** 区画の中を結ぶ線の名前が帯の外へ出ていたら、その分だけ帯の上か下を広げる。広げたら true。 */\nfunction grow(layout: Layout, groups: Group[], slots: Map<string, Slot>, rooms: Room[]): boolean {\n let grown = false;\n const soft = LOOK.label.soft;\n for (const label of layout.labels) {\n const edge = layout.edges.find((e) => e.step === label.step && e.event === label.event);\n const a = edge && slots.get(edge.from);\n const b = edge && slots.get(edge.to);\n if (!a || !b || a.group !== b.group || !groups[a.group]?.region) continue;\n const region = layout.regions.find((r) => r.id === groups[a.group]?.region?.id);\n const room = rooms[a.group];\n if (!region || !room) continue;\n const over = region.y + soft - label.y;\n const under = label.y + label.h - (region.y + region.h - soft);\n if (over > 0) {\n room.top += over;\n grown = true;\n }\n if (under > 0) {\n room.bottom += under;\n grown = true;\n }\n }\n return grown;\n}\n","/**\n * 時系列図の置き場所。\n *\n * 生存線の頭の箱を上に横 1 列に並べ、段で起きる線と処理を起きる順に 1 行ずつ下へ積む。\n * 生存線の間は、箱の幅と、その間を走る線の名前が収まる幅を取る。中身の帯は一番下に置く。\n */\nimport { LOOK, TYPE } from \"../look/values\";\nimport type { Diagram } from \"../schema\";\nimport { textWidth } from \"./measure\";\nimport {\n carrierHalf,\n badgeRect,\n boxColors,\n cornerBadge,\n boxWidth,\n edgeColor,\n labelStyle,\n type Layout,\n lineBadges,\n replaceSameSpot,\n layoutStrip,\n type Point,\n placeLabel,\n type SceneAction,\n type SceneBadge,\n type SceneBox,\n type SceneEdge,\n type SceneLabel,\n shiftContent,\n stripNeed,\n} from \"./scene\";\n\nexport function layoutSequence(diagram: Diagram): Layout {\n const { box: B, sequence: Q, label: L, margin, gap } = LOOK;\n const colors = boxColors(diagram);\n const listed = diagram.sequence?.lifelines ?? [];\n const order = [...listed, ...diagram.boxes.map((b) => b.id).filter((id) => !listed.includes(id))];\n const column = new Map(order.map((id, i) => [id, i]));\n const widths = order.map((id) => boxWidth(diagram, id, false));\n\n // 生存線の間。隣の箱どうしの隙間を取り、名前のある線が走る間は名前が収まるまで広げる\n const spacing = widths.slice(1).map((w, i) => (widths[i] as number) / 2 + w / 2 + Q.columnGap);\n const needs: { from: number; to: number; need: number }[] = [];\n for (const step of diagram.steps) {\n for (const event of step.events) {\n if (event.type !== \"edge\" || event.label === undefined) continue;\n const a = column.get(event.from) ?? 0;\n const b = column.get(event.to) ?? 0;\n const w = textWidth(event.label, labelStyle(event.label)) + L.padX * 2;\n if (a === b) {\n // 自分へ戻る線は名前を右に置くので、右の生存線までに輪と名前が収まる幅を取る\n if (a < spacing.length) needs.push({ from: a, to: a + 1, need: Q.selfW + L.side + w + Q.labelRoom });\n } else {\n needs.push({ from: Math.min(a, b), to: Math.max(a, b), need: w + Q.labelRoom * 2 });\n }\n }\n }\n needs.sort((x, y) => x.to - x.from - (y.to - y.from));\n for (const { from, to, need } of needs) {\n let have = 0;\n for (let i = from; i < to; i++) have += spacing[i] ?? 0;\n if (have >= need) continue;\n const add = (need - have) / (to - from);\n for (let i = from; i < to; i++) spacing[i] = (spacing[i] ?? 0) + add;\n }\n const xs: number[] = [];\n order.forEach((_, i) => xs.push(i === 0 ? margin + (widths[0] as number) / 2 : (xs[i - 1] as number) + (spacing[i - 1] as number)));\n\n const boxes: SceneBox[] = order.map((id, i) => {\n const source = diagram.boxes.find((b) => b.id === id);\n const w = widths[i] as number;\n const cx = xs[i] as number;\n return {\n id,\n name: source?.name ?? id,\n ...(source?.sub !== undefined ? { sub: source.sub } : {}),\n ...(source?.icon !== undefined ? { icon: source.icon } : {}),\n color: colors.get(id) ?? \"slate\",\n x: cx - w / 2,\n y: margin,\n w,\n h: B.h,\n cx,\n cy: margin + B.h / 2,\n };\n });\n const headBottom = margin + B.h;\n\n // 行を積む。線は上か下に名前を、処理は札を持つので、行ごとに上下に要る高さが違う\n const edges: SceneEdge[] = [];\n const actions: SceneAction[] = [];\n const requests: Parameters<typeof placeLabel>[0][] = [];\n let y = headBottom + Q.firstRow;\n let below = 0;\n let first = true;\n diagram.steps.forEach((step, s) => {\n step.events.forEach((event, e) => {\n if (event.type !== \"edge\" && event.type !== \"action\") return;\n let above: number;\n let under: number;\n if (event.type === \"edge\") {\n const side = event.labelSide ?? \"above\";\n const self = event.from === event.to;\n const named = event.label !== undefined;\n above = named && side === \"above\" ? Q.labelOffset + L.h / 2 : gap;\n under = self ? Q.selfH + gap : named && side === \"below\" ? Q.labelOffset + L.h / 2 : gap;\n } else {\n above = LOOK.action.h / 2;\n under = LOOK.action.h / 2;\n }\n y = first ? y + above : y + Math.max(Q.minPitch, below + Q.rowGap + above) + (e === 0 && s > 0 ? Q.stepGap : 0);\n first = false;\n below = under;\n\n if (event.type === \"edge\") {\n const xf = xs[column.get(event.from) ?? 0] as number;\n const xt = xs[column.get(event.to) ?? 0] as number;\n const dir = Math.sign(xt - xf) || 1;\n const points: Point[] =\n xf === xt\n ? [\n [xf, y],\n [xf + Q.selfW, y],\n [xf + Q.selfW, y + Q.selfH],\n [xf + LOOK.edge.inset, y + Q.selfH],\n ]\n : [\n [xf, y],\n [xt - dir * LOOK.edge.inset, y],\n ];\n const color = edgeColor(event, colors);\n // 運ぶ物は着いた生存線の向こう側に留まって矢印の先を隠さず、出る生存線の手前側で走り出しを待って段の番号を隠さない (#3176)\n const seats: Pick<SceneEdge, \"settle\" | \"wait\"> = {};\n if (event.carry.kind !== \"none\") {\n const reach = LOOK.slot.lifeline + carrierHalf(event.carry)[0];\n const [p0, p1] = points as [Point, Point];\n const [q0, q1] = points.slice(-2) as [Point, Point];\n const out = Math.sign(p1[0] - p0[0]) || 1;\n const into = Math.sign(q1[0] - q0[0]) || -1;\n seats.wait = [xf - out * reach, p0[1]];\n seats.settle = [xt + into * reach, q1[1]];\n }\n edges.push({ step: s, event: e, from: event.from, to: event.to, points, color, carry: event.carry, ...seats });\n if (event.label !== undefined) {\n requests.push({\n step: s,\n event: e,\n text: event.label,\n points,\n color,\n ...(event.labelSide ? { side: event.labelSide } : xf === xt ? { side: \"right\" as const } : {}),\n offset: Q.labelOffset,\n });\n }\n } else {\n // 札は生存線の上の番号の丸を隠さないよう、丸の右に出す (#3017)\n const x = xs[column.get(event.box) ?? 0] as number;\n const w = textWidth(event.label, TYPE.action) + LOOK.action.padX * 2;\n actions.push({ step: s, event: e, box: event.box, text: event.label, color: colors.get(event.box) ?? \"slate\", x: x + LOOK.badge.r + 4, y: y - LOOK.action.h / 2, w, h: LOOK.action.h });\n }\n });\n });\n const bottom = (first ? headBottom : y + below) + Q.tail;\n const lifelines = order.map((id, i) => ({ id, x: xs[i] as number, y1: headBottom, y2: bottom }));\n\n // 線の名前は、同じ時刻に見えている段の番号 (その段とそれより前の段の番号) も避ける (#3175)\n const early = lineBadges(edges, diagram.steps.length);\n const labels: SceneLabel[] = [];\n for (const request of requests) {\n const seen = [...early].filter(([s]) => s <= request.step).map(([, b]) => badgeRect(b.point));\n const soft = [...labels.filter((l) => l.step === request.step), ...actions];\n labels.push(placeLabel(request, { hard: boxes, soft, touch: seen }));\n }\n\n const layout: Layout = { kind: \"sequence\", width: 0, height: 0, regions: [], boxes, lifelines, edges, labels, actions, badges: [], paths: [], ends: [] };\n\n // 図の幅。名前が左に出たら全体を右へ寄せ、右端は一番右の物に余白を足した所\n const lefts = [...boxes.map((b) => b.x), ...labels.map((l) => l.x), ...actions.map((a) => a.x)];\n const shift = Math.max(0, margin - Math.min(...lefts));\n if (shift > 0) shiftContent(layout, shift, 0);\n const rights = [...boxes.map((b) => b.x + b.w), ...labels.map((l) => l.x + l.w), ...actions.map((a) => a.x + a.w), ...edges.flatMap((edge) => edge.points.map((p) => p[0]))];\n const width = Math.max(Math.max(...rights) + margin, stripNeed(diagram) + margin * 2);\n const strip = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);\n layout.width = width;\n layout.height = (strip ? strip.y + strip.h : bottom) + margin;\n if (strip) layout.strip = strip;\n layout.badges = badges(diagram, layout);\n return layout;\n}\n\n/**\n * 段の番号。その段の最初の線の始まりに置き、線が無ければ処理する箱の生存線の上、無ければ書き換わる箱の角。\n * 処理の札はその段の終わりに消えるので、札に付けると止め絵で丸だけが浮く (#3017)。\n */\nfunction badges(diagram: Diagram, layout: Layout): SceneBadge[] {\n const lines = lineBadges(layout.edges, diagram.steps.length);\n const placed = diagram.steps.map((step, s): SceneBadge => {\n const line = lines.get(s);\n if (line) return { step: s, x: line.point[0], y: line.point[1], color: line.edge.color };\n const action = layout.actions.find((a) => a.step === s);\n const lifeline = action && layout.lifelines.find((l) => l.id === action.box);\n if (action && lifeline) return { step: s, x: lifeline.x, y: action.y + action.h / 2, color: action.color };\n return cornerBadge(step.events, s, layout);\n });\n // 同じ所に置いた番号は、後の段が始まると入れ替える (#3184)\n return replaceSameSpot(placed);\n}\n","/**\n * 段ごとの始まりと長さと、線、運ぶ物、線の名前、段の番号が見える時刻の表。SVG の動きはこの表から組む。\n *\n * 段の長さは本文の字数で決め、段で起きることが全部済んでから少し留まる長さを下限にする。\n * 運ぶ物は主役 (封筒と札は 1 つ、硬貨は別の 1 つ) ごとに途切れず見え続ける。着いた後は\n * 次の同じ主役が出発するまで着いた先に留まり、次が無ければ終わりまで留まる。\n * 線の名前はその段の間だけ出し、同じ段に何本あっても同時に見えるのは 2 つまでにする。\n * 状態遷移図では、段が終わった後も線の名前を最後の段まで薄く残す (#3171)。薄い名前は 2 つまでの数に入れない。\n * 止め絵を選んだ図では、最後の段で起きることが済んでから繰り返す前まで (`whole`)、全ての段の線の名前を最後の段と同じ濃さで出す (#3200)。\n * その間に見えている名前は繰り返す前まで延ばし、見えていない名前は同じ間に出し直す (`again`)。状態遷移図の薄い名前はその間の前で消す。\n * 状態遷移図では、主役の運ぶ物が乗っている状態を光らせ、運ぶ物が出た状態には少し後に済んだ印を出す (#3163)。\n * 枝分かれの図では、commit を積む出来事と枝を切る出来事も線と同じ間で引く (#3164)。\n * 時間軸の図では、針を進める出来事 (`now`) で針を目盛り 1 つずつ決まった秒数で進める (#3165)。針が進む目盛りの列の線は、\n * 段の中の書いた順に依らず、針がその目盛りに入った時に引き、線を引き終えるまで針は次の目盛りへ進まない。\n * 針を進める出来事より後に書いた出来事は、針が止まってから起こす。物差しの欄は、針が進む段では針の進みに比例して満ち、\n * 区切りの境から進む時は 0 から満ち直す。針が進まない段では値を書いた時に変わる。\n * 列の図 (#3239) の列の並びを書く出来事と、封と札の出来事も線と同じ表に載せ、並びは滑り終えるまで、封は覆い終えるまでを引く間にする。\n * 札を動かす線が運ぶ枝の札は運ぶ物の表に載せない。札は同じ時刻にいくつも出ていて、どの札も主役ではないので、\n * 枝分かれの図を描く部品が札ごとに動かす。線に書いた運ぶ物 (`tag` と `carry`) だけを表に載せる。\n */\nimport { ratioOf } from \"./layout/scene\";\nimport { MOTION } from \"./look/values\";\nimport type { Diagram } from \"./schema\";\nimport { STATE_ENDS } from \"./words\";\n\n/** 秒で表した、見えている間。`end` の時刻は含まない。 */\nexport interface Span {\n start: number;\n end: number;\n}\n\n/** 線を引いている間。`start` で引き始め、`drawn` で引き終わり、`end` (段の終わり) まで濃く残す。枝分かれの図では commit を積む出来事と枝を切る出来事も持つ */\nexport interface EdgeTime extends Span {\n step: number;\n event: number;\n drawn: number;\n}\n\n/** 運ぶ物が見えている間。`depart` に出発し `arrive` に着く。出発を待つ間と、着いた先で留まる間も含む。 */\nexport interface CarrierTime extends Span {\n step: number;\n event: number;\n who: \"main\" | \"coin\";\n depart: number;\n arrive: number;\n}\n\nexport interface LabelTime extends Span {\n step: number;\n event: number;\n /** 状態遷移図だけが持つ。段が終わった後に薄く残す間 */\n after?: Span;\n /** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから、最後の段と同じ濃さで出し直す間 (#3200) */\n again?: Span;\n}\n\n/** 処理、箱の字の書き換え、中身の帯の値が起きる時刻。 */\nexport interface EventTime {\n step: number;\n event: number;\n at: number;\n}\n\n/** 状態遷移図の状態ごとの、光っている間と、済んだ印が出る時刻。運ぶ物が出ていない状態は `done` を持たない */\nexport interface StateTime {\n box: string;\n lit: Span[];\n done?: number;\n}\n\nexport interface Timeline {\n /** 1 周の長さ */\n total: number;\n /** 繰り返す前に消えていく所の始まり */\n last: number;\n steps: Span[];\n edges: EdgeTime[];\n carriers: CarrierTime[];\n labels: LabelTime[];\n badges: { step: number; appears: number }[];\n events: EventTime[];\n /** 段ごとの止め絵の時刻。その段で起きることが全部見えている */\n stills: number[];\n /** 止め絵を選んだ図だけが持つ。最後の段で起きることが済んでから繰り返す前まで、全ての段の線の名前と箱の中の処理を出す間 (#3200) */\n whole?: Span;\n /** 状態遷移図だけが持つ */\n states?: StateTime[];\n /** 時間軸の図だけが持つ (#3165)。針の動き。[時刻, 目盛りの境の位置] の並びで、間は真っ直ぐ進む */\n needle?: [number, number][];\n /** 時間軸の図だけが持つ。針が目盛りを過ぎた (右の境に着いた) 時刻 */\n units?: { unit: number; passed: number }[];\n /** 時間軸の図だけが持つ。物差しの欄の満ち具合の動き。[時刻, 割合] の並びで、間は真っ直ぐ変わる */\n meters?: { field: string; keys: [number, number][] }[];\n}\n\ninterface Planned {\n edges: { event: number; a: number; b: number; carries: boolean; coin: boolean; named: boolean }[];\n events: { event: number; at: number }[];\n busy: number;\n /** 時間軸の図の、針の動き ([段の始まりからの時刻, 境の位置]) と、針が目盛りを過ぎた時刻 */\n sweep?: { keys: [number, number][]; passed: { unit: number; at: number }[] };\n}\n\ntype EdgeEvent = Extract<Diagram[\"steps\"][number][\"events\"][number], { type: \"edge\" }>;\n\n/** 列の図の出来事の長さ */\nconst LINEUP_LENGTH = { line: MOTION.lineup.slide, seal: MOTION.lineup.seal, open: MOTION.fade, pick: MOTION.fade, stamp: MOTION.popFade } as const;\n\n/** 時間軸の図の段を組む時に渡す、段の始まりの針の位置と、目盛り 1 つを進む秒数 */\ninterface Needle {\n from: number;\n speed: number;\n}\n\n/**\n * 段の中で起きることの時刻 (段の始まりから)。線は少しずつずらして引き、書き換えは直前の線が着いてから起こす。\n * 時間軸の図では `needle` を渡し、針を進める出来事の所で針を目盛り 1 つずつ進める。針が進む目盛りの列の線はその目盛りに入った時に引く\n */\nfunction plan(step: Diagram[\"steps\"][number], needle?: Needle): Planned {\n const out: Planned = { edges: [], events: [], busy: 0 };\n let cursor = MOTION.edgeAt;\n let arrived: number | undefined;\n let changes = 0;\n let settled = Number.NEGATIVE_INFINITY;\n const line = (e: number, event: EdgeEvent, a: number): number => {\n const carries = event.carry.kind !== \"none\";\n const b = a + (carries ? MOTION.drawCarry : MOTION.draw);\n out.edges.push({ event: e, a, b, carries, coin: event.carry.kind === \"coin\", named: event.label !== undefined });\n out.busy = Math.max(out.busy, b);\n return b;\n };\n const nows = needle ? step.events.flatMap((event, e) => (event.type === \"now\" ? [{ e, to: event.to }] : [])) : [];\n const p0 = needle?.from ?? 0;\n const p1 = Math.max(p0, ...nows.map((n) => n.to + 1));\n const pulled = (event: Diagram[\"steps\"][number][\"events\"][number]): event is EdgeEvent => event.type === \"edge\" && event.at !== undefined && event.at >= p0 && event.at < p1;\n step.events.forEach((event, e) => {\n if (needle && e === nows[0]?.e) {\n // 針は、前に書いた書き換えが起きてから動き出す\n let t = Math.max(cursor, settled + MOTION.change);\n const keys: [number, number][] = [[t, p0]];\n const passed: { unit: number; at: number }[] = [];\n for (let u = p0; u < p1; u++) {\n const entry = t;\n const lines = step.events.flatMap((ev, k) => (pulled(ev) && ev.at === u ? [{ k, ev }] : []));\n const done = lines.reduce((latest, l, j) => Math.max(latest, line(l.k, l.ev, entry + MOTION.stagger * j)), entry);\n const end = Math.max(entry + needle.speed, lines.length > 0 ? done + MOTION.time.wait : entry);\n if (end - needle.speed > entry + 1e-9) keys.push([end - needle.speed, u]);\n keys.push([end, u + 1]);\n passed.push({ unit: u, at: end });\n t = end;\n }\n out.sweep = { keys, passed };\n out.busy = Math.max(out.busy, t);\n cursor = t + MOTION.time.after;\n arrived = t;\n changes = 0;\n return;\n }\n if (event.type === \"now\" || (needle && pulled(event))) return;\n if (event.type === \"line\" || event.type === \"seal\" || event.type === \"open\" || event.type === \"pick\" || event.type === \"stamp\") {\n const a = cursor;\n const b = a + LINEUP_LENGTH[event.type];\n out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });\n cursor = a + MOTION.lineup.stagger;\n arrived = b;\n changes = 0;\n out.busy = Math.max(out.busy, b);\n return;\n }\n // 枝分かれの図の commit を積む出来事と枝を切る出来事と、木の図の葉と親を出す出来事は、親から引く線と同じ間で引く\n if (event.type === \"commit\" || event.type === \"branch\" || event.type === \"leaf\" || event.type === \"node\") {\n const a = cursor;\n const b = a + MOTION.draw;\n out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });\n cursor = a + MOTION.stagger;\n arrived = b;\n changes = 0;\n out.busy = Math.max(out.busy, b);\n } else if (event.type === \"edge\") {\n const a = cursor;\n arrived = line(e, event, a);\n cursor = a + MOTION.stagger;\n changes = 0;\n } else if (event.type === \"action\") {\n out.events.push({ event: e, at: cursor });\n out.busy = Math.max(out.busy, cursor + MOTION.action);\n cursor += MOTION.action;\n changes = 0;\n } else {\n const at = (arrived ?? cursor) + MOTION.change * changes++;\n out.events.push({ event: e, at });\n out.busy = Math.max(out.busy, at);\n settled = Math.max(settled, at);\n }\n });\n // 針が進む目盛りの列の線は書いた順と別に引くので、引き始める順に並べ直す\n out.edges.sort((x, y) => x.a - y.a);\n return out;\n}\n\n/** 時刻の表を作る。`still` を立てると、最後の段の止め絵に全ての段の線の名前と箱の中の処理を出す間 (`whole`) を持つ (#3200) */\nexport function buildTimeline(diagram: Diagram, still = false): Timeline {\n const time = diagram.kind === \"time\" ? diagram.time : undefined;\n const T = MOTION.time;\n const speed = time ? Math.min(T.unitMax, Math.max(T.unitMin, T.axis / Math.max(1, time.scale.count))) : 0;\n let at = 0;\n const plans = diagram.steps.map((step) => {\n if (!time) return plan(step);\n const p = plan(step, { from: at, speed });\n at = p.sweep?.keys[p.sweep.keys.length - 1]?.[1] ?? at;\n return p;\n });\n const steps: Span[] = [];\n let t = MOTION.intro;\n diagram.steps.forEach((step, s) => {\n const read = Math.min(MOTION.stepMax, Math.max(MOTION.stepMin, MOTION.stepBase + [...step.body].length * MOTION.perChar));\n const length = Math.max(read, (plans[s]?.busy ?? 0) + MOTION.dwell);\n steps.push({ start: t, end: t + length });\n t += length;\n });\n const end = t;\n const total = Math.ceil(end + MOTION.outro);\n const last = total - MOTION.tail;\n const lastSpan = steps[steps.length - 1];\n const whole = still && lastSpan ? { start: lastSpan.start + (plans[plans.length - 1]?.busy ?? 0), end: last } : undefined;\n // 状態遷移図の薄い名前は、全ての段の名前を出し直す前に消す\n const faint = whole?.start ?? last;\n\n const edges: EdgeTime[] = [];\n const labels: LabelTime[] = [];\n const events: EventTime[] = [];\n const departures: { step: number; event: number; who: \"main\" | \"coin\"; a: number; b: number }[] = [];\n plans.forEach((p, s) => {\n const span = steps[s] as Span;\n const named: LabelTime[] = [];\n for (const edge of p.edges) {\n const a = span.start + edge.a;\n edges.push({ step: s, event: edge.event, start: a, drawn: span.start + edge.b, end: span.end });\n // 枝分かれの図の、札を書かない線が運ぶ札は、枝分かれの図を描く部品が札ごとに動かす\n const event = diagram.steps[s]?.events[edge.event];\n const own = diagram.kind === \"git\" && event?.type === \"edge\" && event.carry.kind === \"tag\" && event.carry.text === event.from;\n if (edge.carries && !own) departures.push({ step: s, event: edge.event, who: edge.coin ? \"coin\" : \"main\", a, b: span.start + edge.b });\n if (edge.named) named.push({ step: s, event: edge.event, start: a + MOTION.labelDelay, end: span.end });\n }\n // 3 つ目の名前が出る時に 1 つ目を消す\n named.forEach((label, k) => {\n const later = named[k + 2];\n if (later) label.end = Math.min(label.end, later.start);\n });\n for (const label of named) {\n if (whole && label.end > whole.start) label.end = whole.end;\n else {\n if (diagram.kind === \"state\" && label.end < faint) label.after = { start: label.end, end: faint };\n if (whole) label.again = whole;\n }\n }\n labels.push(...named);\n for (const event of p.events) events.push({ step: s, event: event.event, at: span.start + event.at });\n });\n\n const first = steps[0]?.start ?? 0;\n const hasMain = departures.some((d) => d.who === \"main\");\n const carriers: CarrierTime[] = [];\n for (const who of [\"main\", \"coin\"] as const) {\n const list = departures.filter((d) => d.who === who);\n list.forEach((d, k) => {\n const next = list[k + 1];\n // 主役の最初の運ぶ物は、最初の段の始まりから出発点で待つ (何も見えない時間を作らないため)\n const waits = k === 0 && (who === \"main\" || !hasMain);\n carriers.push({\n step: d.step,\n event: d.event,\n who,\n depart: d.a,\n arrive: d.b,\n start: waits ? Math.min(first, d.a) : d.a,\n end: next ? Math.max(next.a, d.b) : last,\n });\n });\n }\n carriers.sort((x, y) => x.depart - y.depart);\n const states = diagram.kind === \"state\" ? stateTimes(diagram, edges, last) : undefined;\n const needle: [number, number][] = [[0, 0]];\n const units: { unit: number; passed: number }[] = [];\n plans.forEach((p, s) => {\n const start = (steps[s] as Span).start;\n for (const [t, position] of p.sweep?.keys ?? []) needle.push([start + t, position]);\n for (const u of p.sweep?.passed ?? []) units.push({ unit: u.unit, passed: start + u.at });\n });\n needle.push([total, at]);\n\n return {\n total,\n last,\n steps,\n edges,\n carriers,\n labels,\n badges: steps.map((span, s) => ({ step: s, appears: span.start })),\n events,\n stills: steps.map((span) => span.end - MOTION.still),\n ...(whole ? { whole } : {}),\n ...(states ? { states } : {}),\n ...(time ? { needle, units, meters: meterTimes(diagram, plans, steps) } : {}),\n };\n}\n\n/**\n * 時間軸の図の物差しの欄の満ち具合 (#3165)。段で最後に書いた値へ向かって変わる。\n * 針が進む段では針の進みに比例して満ち、区切りの境から進む時はその境で 0 に戻ってから満ち直す。針が進まない段では値を書いた時に変わる\n */\nfunction meterTimes(diagram: Diagram, plans: Planned[], steps: Span[]): { field: string; keys: [number, number][] }[] {\n const length = diagram.time?.period?.length;\n return (diagram.strip?.meters ?? []).map(({ field }) => {\n const keys: [number, number][] = [[0, 0]];\n let value = 0;\n plans.forEach((p, s) => {\n const start = (steps[s] as Span).start;\n const sets = (diagram.steps[s]?.events ?? []).flatMap((event, e) => {\n const ratio = event.type === \"strip\" && event.field === field && event.value !== undefined ? ratioOf(event.value) : undefined;\n return ratio === undefined ? [] : [{ e, ratio }];\n });\n const set = sets[sets.length - 1];\n if (!set) return;\n const sweep = p.sweep?.keys ?? [];\n const first = sweep[0];\n const lastKey = sweep[sweep.length - 1];\n if (first && lastKey && lastKey[1] > first[1]) {\n const [p0, p1] = [first[1], lastKey[1]];\n let base = value;\n let from = p0;\n const boundary = length ? Math.floor((p1 - 1e-9) / length) * length : 0;\n if (boundary > 0 && boundary >= p0) {\n const tb = start + (sweep.find(([, position]) => position === boundary)?.[0] ?? first[0]);\n const prev = (keys[keys.length - 1] as [number, number])[0];\n keys.push([Math.max(prev, tb - MOTION.time.reset), value], [tb, 0]);\n base = 0;\n from = boundary;\n }\n for (const [t, position] of sweep) if (position >= from) keys.push([start + t, base + ((set.ratio - base) * (position - from)) / (p1 - from)]);\n } else {\n const at = start + (p.events.find((x) => x.event === set.e)?.at ?? 0);\n keys.push([at, value], [at + MOTION.fade, set.ratio]);\n }\n value = set.ratio;\n });\n return { field, keys };\n });\n}\n\nconst isEnd = (id: string): boolean => (STATE_ENDS as readonly string[]).includes(id);\n\n/**\n * 状態遷移図の状態が光る間。段の線を引き終えて状態へ着いた時から、その状態を出る線を引き始めるまで光り、\n * 出た少し後に済んだ印を出す。同じ状態へ戻る線では光ったまま、最後に着いた状態は終わりまで光る。\n * 物が状態を移るのは線を辿った時なので、運ぶ物の種類 (硬貨や、運ばない線) を問わず全ての線で数える。\n */\nfunction stateTimes(diagram: Diagram, edges: EdgeTime[], last: number): StateTime[] {\n const times = new Map<string, StateTime>();\n const of = (box: string): StateTime => {\n const found = times.get(box) ?? { box, lit: [] };\n times.set(box, found);\n return found;\n };\n let on: { box: string; since: number } | undefined;\n for (const edge of edges) {\n const event = diagram.steps[edge.step]?.events[edge.event];\n if (event?.type !== \"edge\" || event.from === event.to) continue;\n if (on) {\n const left = of(on.box);\n left.lit.push({ start: on.since, end: edge.start });\n if (on.box === event.from && left.done === undefined) left.done = edge.start + MOTION.done;\n on = undefined;\n }\n if (!isEnd(event.to)) on = { box: event.to, since: edge.drawn };\n }\n if (on) of(on.box).lit.push({ start: on.since, end: last });\n return [...times.values()];\n}\n","/**\n * 時刻の点の並びから CSS の keyframes を組む道具。見本帳の `engine.js` の `kf` / `vis` / `rise` / `pop` / `move` を写す。\n *\n * 動きは全て 1 周 `total` 秒の keyframes で、点の時刻は 1 周の中の割合 (%) に直す。\n * 性質ごとに独立して補間されるので、点ごとに変える性質だけを書く。\n */\nimport { EASE, LOOK, MOTION } from \"../look/values\";\n\nexport type Props = Record<string, string | number>;\nexport type Frame = [time: number, props: Props, ease?: string];\n\nconst r2 = (v: number): number => Math.round(v * 100) / 100;\n\nexport class Motion {\n readonly frames: string[] = [];\n private count = 0;\n\n constructor(\n private readonly prefix: string,\n readonly total: number,\n readonly last: number,\n ) {}\n\n private pct(t: number): number {\n return +((Math.min(Math.max(t, 0), this.total) / this.total) * 100).toFixed(3);\n }\n\n /** keyframes を 1 つ足し、その名前を付ける style の字を返す。 */\n kf(points: Frame[]): string {\n const name = `${this.prefix}-${this.count++}`;\n const at = new Map<number, { props: Props; ease?: string }>();\n for (const [t, props, ease] of [...points].sort((a, b) => a[0] - b[0])) {\n const p = this.pct(t);\n const cur = at.get(p) ?? { props: {} };\n Object.assign(cur.props, props);\n if (ease) cur.ease = ease;\n at.set(p, cur);\n }\n const body = [...at]\n .map(([p, { props, ease }]) => {\n const d = Object.entries(props).map(([k, v]) => `${k}:${v}`);\n if (ease) d.push(`animation-timing-function:${ease}`);\n return `${p}%{${d.join(\";\")}}`;\n })\n .join(\"\");\n this.frames.push(`@keyframes ${name}{${body}}`);\n return `animation-name:${name}`;\n }\n\n /** `a` で出て `b` から消える。`within` を立てると `b` までに消え終わる。 */\n vis(a: number, b = this.last, o: { f?: number; on?: Props; off?: Props; ein?: string; within?: boolean } = {}): string {\n const f = o.f ?? MOTION.fade;\n const on = o.on ?? {};\n const off = o.off ?? {};\n const out = o.within ? Math.max(a + f, b - f) : b;\n return this.kf([\n [0, { opacity: 0, ...off }],\n [a, { opacity: 0, ...off }, o.ein ?? EASE.out],\n [a + f, { opacity: 1, ...on }],\n [out, { opacity: 1, ...on }, EASE.inOut],\n [Math.min(out + f, this.total), { opacity: 0, ...off }],\n [this.total, { opacity: 0, ...off }],\n ]);\n }\n\n /** 少し下から浮いて出る。 */\n rise(a: number, b = this.last, within = false): string {\n return this.vis(a, b, { on: { transform: \"translateY(0)\" }, off: { transform: `translateY(${LOOK.rise}px)` }, within });\n }\n\n /** 小さな所から弾んで出る。 */\n pop(a: number, b = this.last): string {\n return this.vis(a, b, { f: MOTION.popFade, ein: EASE.pop, on: { transform: \"scale(1)\" }, off: { transform: `scale(${LOOK.popFrom})` } });\n }\n\n /** 初めから出ていて `b` で消える。 */\n until(b: number): string {\n const f = MOTION.untilFade;\n return this.kf([\n [0, { opacity: 1 }],\n [b, { opacity: 1 }, EASE.inOut],\n [b + f, { opacity: 0 }],\n [this.last, { opacity: 0 }],\n [this.total, { opacity: 1 }],\n ]);\n }\n\n /** 点を辿って動く。`[時刻, x, y, 大きさ, 次の点までの緩急]` の並び。 */\n move(points: [number, number, number, number?, string?][], extra: Frame[] = []): string {\n return this.kf(\n points.map(([t, x, y, s = 1, ease]): Frame => [t, { transform: `translate(${r2(x)}px,${r2(y)}px) scale(${s})` }, ease]).concat(extra),\n );\n }\n\n /** `a` から `b` まで見え、`fade` 秒で消える。 */\n blink(a: number, b: number, fade: number): Frame[] {\n return [\n [0, { opacity: 0 }],\n [a - 0.01, { opacity: 0 }],\n [a, { opacity: 1 }],\n [b, { opacity: 1 }],\n [b + fade, { opacity: 0 }],\n [this.total, { opacity: 0 }],\n ];\n }\n}\n","/**\n * 原本の JSON から図を描く本体。置き場所と時刻の表を作り、部品を重なりの順に並べて SVG にする。\n * git、lineup、state、time、tree の部品は登録簿から引くので、読んでいない種類は描けない (`kinds/registry.ts`、#3248)。\n *\n * 動きは全て SVG の中の CSS の keyframes が回す。1 周の長さは `--T`、止める時刻は `--at`、\n * 止めるか流すかは `--play` の変数で外から変えられる (頁に置く `player.ts` がこれを使う)。\n * 色と字は値の表から CSS の変数として 1 度だけ書き、部品はその変数だけを読む。\n * 止め絵を選ぶと (`still`)、最後の段の止め絵に全ての段の線の名前と箱の中の処理を出し、流れ全体を 1 枚で読ませる (#3200)。\n */\nimport { FIGURE_TEXT } from \"../figure-text\";\nimport { layoutArchitecture } from \"../layout/architecture\";\nimport type { GitLayout } from \"../layout/git\";\nimport type { LineupLayout } from \"../layout/lineup\";\nimport { textWidth } from \"../layout/measure\";\nimport { type Layout, type Rect, rewrapStrip, type SceneField, type SceneLabel, type SceneStrip } from \"../layout/scene\";\nimport { layoutSequence } from \"../layout/sequence\";\nimport type { TimeLayout } from \"../layout/time\";\nimport type { TreeLayout } from \"../layout/tree\";\nimport { kindParts } from \"../kinds/registry\";\nimport { FONTS } from \"../look/fonts\";\nimport { type ColorKey, type Colors, EASE, FONT_VARS, isColorName, isColorValue, LOOK, MOTION, type Palette, paletteVars, resolvePalette, type TextStyle, type Theme, TYPE } from \"../look/values\";\nimport { readDiagram } from \"../version\";\nimport type { Diagram, ViewMode } from \"../schema\";\nimport { buildTimeline, type LabelTime, type Span, type Timeline } from \"../timeline\";\nimport type { NotationLang } from \"../words\";\nimport {\n action,\n badge,\n band,\n card,\n carrier,\n type Ctx,\n cs,\n doneMark,\n edge,\n endMark,\n esc,\n type FieldChange,\n ghostCard,\n headCard,\n label,\n lifeline,\n linkTo,\n path,\n sansOf,\n side,\n strip,\n type SubChange,\n} from \"./parts\";\nimport { findOverlaps, type Ink, type Overlap, type Trace } from \"./ink\";\nimport { Motion } from \"./motion\";\n\nconst isGitLayout = (layout: Layout): layout is GitLayout => layout.kind === \"git\";\nconst isLineupLayout = (layout: Layout): layout is LineupLayout => layout.kind === \"lineup\";\nconst isTimeLayout = (layout: Layout): layout is TimeLayout => layout.kind === \"time\";\nconst isTreeLayout = (layout: Layout): layout is TreeLayout => layout.kind === \"tree\";\n\nexport interface RenderOptions {\n /** 色味の名前。書かないか知らない名前なら紙と墨 */\n palette?: string;\n /**\n * `palette` の色味に重ねる色の値 (#3198)。鍵は色味が持つ色の変数の名前 (`bg`、`ink`、`c-green` など) で、値は描く `theme` の色になる。\n * 渡さない色は色味の値のまま残る。色味に無い名前と、色の値として読めない値は、名前を挙げて描かずに断る\n */\n colors?: Colors;\n theme?: Theme;\n /** 描く部品が出す字 (断りの文、全体図の札、読み上げの名前) の言葉。書かなければ日本語 (#3001) */\n lang?: NotationLang;\n /**\n * 最後の段の止め絵に、全ての段の線の名前と箱の中の処理を最後の段と同じ濃さで出す (#3200)。途中の段の止め絵は今の段の名前だけを出す。\n * 箱の下の 1 行に出す処理は、その箱で最後に起きた処理か書き換えの字を出す。違う段の名前が重なっても置き直さず、最後の段の重なり (`overlaps`) に出す\n */\n still?: boolean;\n}\n\nexport interface Rendered {\n svg: string;\n palette: string;\n theme: Theme;\n /** 書き手が原本で決めた見せ方 */\n view?: ViewMode;\n fonts: { sans: string; mono: string };\n layout: Layout;\n timeline: Timeline;\n diagram: Diagram;\n /** 段ごとの止め絵で、同時に見えている字どうしの重なりと、線が札を持たない字を横切る所 (#3175)。重なりが無ければ空 */\n overlaps: Overlap[];\n}\n\nconst font = (t: TextStyle): string => `font:${t.weight} ${t.size}px var(--${t.family})`;\nconst mix = (pct: number, base = \"var(--surf)\"): string => `color-mix(in srgb,var(--c) ${pct}%,${base})`;\nconst S = LOOK.stroke;\nconst X = LOOK.mix;\n/** 状態遷移図で段が終わった線と番号の灰 (#3171) */\nconst PAST = `color-mix(in srgb,var(--mute) ${X.past}%,var(--bg))`;\n\n/** 部品の見た目。どの値も値の表から読む。 */\nconst PART_CSS = [\n \".dg{display:block;width:100%;height:auto;overflow:visible}\",\n \".dg .dg-a{animation-duration:var(--T);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;animation-delay:calc(var(--at,0) * -1s);animation-play-state:var(--play,running)}\",\n \".dg .dg-popc{transform-box:fill-box;transform-origin:center}\",\n \".dg-bg{fill:var(--bg)}\",\n \".dg-band{fill:color-mix(in srgb,var(--c) var(--tint),var(--bg));stroke:color-mix(in srgb,var(--c) var(--edge),transparent)}\",\n `.dg-bi{fill:${mix(X.regionIcon)};stroke:${mix(X.regionIconEdge, \"transparent\")}}`,\n `.dg-bz{${font(TYPE.regionName)};fill:var(--ct)}`,\n `.dg-bx{${font(TYPE.regionNote)};fill:var(--mute)}`,\n \".dg-st{fill:var(--surf);stroke:var(--hair)}\",\n `.dg-halo{fill:none;stroke:var(--c);stroke-width:${S.halo};stroke-opacity:.16}`,\n `.dg-on{fill:none;stroke:var(--c);stroke-width:${S.on}}`,\n `.dg-ic{fill:${mix(X.icon)}}`,\n `.dg-slot{fill:none;stroke:${mix(X.slot, \"transparent\")};stroke-width:${S.slot};stroke-dasharray:3 3}`,\n `.dg-gl{fill:none;stroke:var(--c);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-sn{${font(TYPE.boxName)};fill:var(--ink)}`,\n `.dg-ss{${font(TYPE.boxSub)};fill:var(--mute)}`,\n `.dg-ss-ok{${font(TYPE.boxSubStrong)};fill:var(--ct)}`,\n `.dg-ss-act{${font(TYPE.boxSubStrong)};fill:var(--ink)}`,\n `.dg-ll{stroke:var(--line);stroke-width:${S.lifeline};stroke-dasharray:3 4}`,\n `.dg-e{fill:none;stroke:var(--line);stroke-width:${S.edge};stroke-linecap:round;stroke-dasharray:0 ${LOOK.edge.ghostDash}}`,\n `.dg-eh{fill:none;stroke:var(--line);stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-e-on{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,\n `.dg-eh-on{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-flow{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linecap:round;stroke-dasharray:1.5 ${LOOK.edge.flowDash}}`,\n `.dg-e-past{fill:none;stroke:${PAST};stroke-width:${S.edge};stroke-linecap:round}`,\n `.dg-eh-past{fill:none;stroke:${PAST};stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,\n \".dg-bd{cursor:pointer}\",\n \".dg-bdf{fill:var(--c)}\",\n `.dg-bdft{${font(TYPE.badge)};fill:var(--on-c)}`,\n `.dg-bdr{fill:none;stroke:var(--c);stroke-width:${S.badgeRing};pointer-events:none}`,\n `.dg-bdp{fill:${mix(X.badgePast)};stroke:${mix(X.badgePastEdge, \"transparent\")};stroke-width:${S.hair}}`,\n `.dg-bdpt{${font(TYPE.badge)};fill:var(--ct)}`,\n `.dg-bdp-g{fill:var(--surf);stroke:${PAST};stroke-width:${S.hair}}`,\n `.dg-bdpt-g{${font(TYPE.badge)};fill:var(--mute)}`,\n `.dg-cap rect,.dg-act rect{fill:${mix(X.cap)};stroke:${mix(X.capEdge, \"transparent\")}}`,\n `.dg-cap text{${font(TYPE.label)};fill:var(--ct)}`,\n `.dg-capj text{${font(TYPE.labelJa)}}`,\n `.dg-cap-past text{${font(TYPE.label)};fill:var(--mute);fill-opacity:${LOOK.state.pastLabel}}`,\n `.dg-cap-pastj text{${font(TYPE.labelJa)}}`,\n `.dg-act text{${font(TYPE.action)};fill:var(--ct)}`,\n \".dg-car{fill:var(--carry,var(--ink))}\",\n `.dg-car-t{${font(TYPE.carrier)};fill:var(--bg)}`,\n `.dg-car-tj{${font(TYPE.carrierJa)}}`,\n `.dg-env{fill:var(--carry,var(--ink));stroke:var(--surf);stroke-width:${S.envelope}}`,\n `.dg-env-in{fill:none;stroke:var(--surf);stroke-width:${S.flow};stroke-linejoin:round;stroke-linecap:round}`,\n \".dg-coin{fill:var(--coin);stroke:var(--surf);stroke-width:1.2}\",\n \".dg-coin-in{fill:none;stroke:var(--coinin);stroke-width:1.1}\",\n \".dg-strip{fill:var(--surf);stroke:var(--hair)}\",\n `.dg-sep{stroke:var(--hair);stroke-width:${S.hair}}`,\n `.dg-sh{${font(TYPE.stripTitle)};fill:var(--ink)}`,\n `.dg-fl{${font(TYPE.fieldName)};fill:var(--mute)}`,\n `.dg-fv{${font(TYPE.fieldValue)};fill:var(--ink)}`,\n `.dg-fvj{${font(TYPE.fieldValueJa)};fill:var(--ink)}`,\n \".dg-fv-c{fill:var(--ct)}\",\n \".dg-fl-now{fill:var(--c)}\",\n `.dg-tr-ring{fill:none;stroke:var(--line);stroke-width:${S.trail}}`,\n \".dg-tr-fill{fill:var(--c)}\",\n \".dg-tg rect{fill:var(--c)}\",\n `.dg-tg text{${font(TYPE.tag)};fill:var(--on-c)}`,\n `.dg-side{fill:color-mix(in srgb,var(--c) ${X.side}%,var(--bg));stroke:${mix(X.sideEdge, \"transparent\")};stroke-dasharray:4 4}`,\n `.dg-side-t{${font(TYPE.regionName)};fill:var(--ct)}`,\n `.dg-side-n{${font(TYPE.regionNote)};fill:var(--mute)}`,\n `.dg-ghost{fill:var(--surf);stroke:${mix(X.ghostEdge, \"transparent\")};stroke-dasharray:4 3}`,\n `.dg-path{fill:none;stroke:${mix(X.path, \"transparent\")};stroke-width:${S.path};stroke-linecap:round;stroke-dasharray:0 ${LOOK.edge.ghostDash}}`,\n `.dg-path-h{fill:none;stroke:${mix(X.path, \"transparent\")};stroke-width:${S.arrow};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-path-t{${font(TYPE.label)};fill:var(--ct)}`,\n `.dg-path-tj{${font(TYPE.labelJa)}}`,\n \".dg-start{fill:var(--ink)}\",\n `.dg-end{fill:var(--bg);stroke:var(--ink);stroke-width:${S.end}}`,\n \".dg-end-in{fill:var(--ink)}\",\n `.dg-end-x{fill:var(--bg);stroke:${mix(X.path, \"transparent\")};stroke-width:${S.arrow};stroke-dasharray:2 2.5}`,\n `.dg-end-xi{fill:${mix(X.path, \"transparent\")}}`,\n `.dg-mark{${font(TYPE.regionNote)};fill:var(--mute)}`,\n `.dg-done{fill:var(--ink);stroke:var(--surf);stroke-width:${S.done}}`,\n `.dg-done-ck{fill:none;stroke:var(--surf);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-git-l{fill:none;stroke:var(--c);stroke-width:${S.git};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,\n `.dg-git-cp{fill:none;stroke:var(--c);stroke-width:${S.gitOrphan};stroke-linecap:round;stroke-dasharray:3 3;stroke-opacity:.7}`,\n `.dg-git-c{fill:var(--surf);stroke:var(--c);stroke-width:${S.git}}`,\n `.dg-git-id{${font(TYPE.gitId)};fill:var(--ct)}`,\n `.dg-git-h{${font(TYPE.gitHash)};fill:var(--mute)}`,\n `.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,\n `.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,\n `.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,\n // 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く\n `.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,\n `.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,\n `.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,\n `.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,\n `.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,\n `.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,\n `.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,\n `.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,\n `.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,\n `.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,\n // 列の図 (#3239)。封は列の左端から右へ伸びる\n \".dg-ln-chip{fill:var(--c)}\",\n `.dg-ln-plain{fill:color-mix(in srgb,var(--mute) ${X.chipPlain}%,var(--surf))}`,\n `.dg-ln-t{${font(TYPE.chip)};fill:var(--on-c)}`,\n `.dg-ln-tp{${font(TYPE.chip)};fill:var(--ink)}`,\n \".dg-ln-seal{transform-box:fill-box;transform-origin:0 50%}\",\n `.dg-ln-sd{fill:color-mix(in srgb,var(--mute) ${X.sealDark}%,var(--surf))}`,\n `.dg-ln-sl{fill:color-mix(in srgb,var(--mute) ${X.sealLight}%,var(--surf))}`,\n `.dg-ln-stamp{fill:var(--surf);stroke:var(--c);stroke-width:${S.stamp}}`,\n `.dg-ln-st{${font(TYPE.stamp)};fill:var(--ct)}`,\n // 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする\n `.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,\n `.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,\n `.dg-tm-hd{${font(TYPE.timeHead)};fill:var(--ink)}`,\n `.dg-tm-hdj{${font(sansOf(TYPE.timeHead))}}`,\n `.dg-tm-slot{fill:none;stroke:var(--line);stroke-width:${S.timeSlot};opacity:.55}`,\n \".dg-tm-m{fill:var(--c)}\",\n \".dg-tm-x{fill:var(--c-slate)}\",\n `.dg-tm-fr{fill:none;stroke:var(--c-blue);stroke-width:${S.timeFrame};stroke-dasharray:3 2}`,\n `.dg-tm-gd{fill:none;stroke:color-mix(in srgb,var(--c-blue) ${X.timeGuide}%,transparent);stroke-width:${S.hair};stroke-dasharray:2 3}`,\n `.dg-tm-ax{fill:none;stroke:var(--line);stroke-width:${S.timeAxis}}`,\n `.dg-tm-tk{${font(TYPE.timeTick)};fill:var(--mute)}`,\n `.dg-tm-tkj{${font(sansOf(TYPE.timeTick))}}`,\n `.dg-tm-en{${font(TYPE.timePeriod)};fill:var(--ink2)}`,\n `.dg-tm-er{${font(TYPE.timeRange)};fill:var(--mute)}`,\n `.dg-tm-erj{${font(sansOf(TYPE.timeRange))}}`,\n `.dg-tm-rn{${font(TYPE.timeRow)};fill:var(--ink2)}`,\n `.dg-tm-br{fill:none;stroke:var(--c);stroke-width:${S.timeSpan};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tm-bt{${font(TYPE.spanText)};fill:var(--ct)}`,\n `.dg-tm-bx{fill:color-mix(in srgb,var(--c) ${X.timeSpan}%,transparent);stroke:var(--c);stroke-width:${S.timeSpan};stroke-dasharray:4 3}`,\n `.dg-tm-con{fill:none;stroke:var(--line);stroke-width:${S.timeDrop};stroke-linecap:round;stroke-dasharray:0 3.5}`,\n \".dg-tm-pg{fill:var(--surf);stroke:var(--line);stroke-dasharray:2 2.5}\",\n `.dg-tm-pgl{fill:none;stroke:var(--mute);stroke-width:${S.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tm-pc{fill:var(--surf);stroke:var(--c);stroke-width:${S.timePoint}}`,\n `.dg-tm-pcg{fill:none;stroke:var(--c);stroke-width:${S.timeFlag};stroke-linecap:round;stroke-linejoin:round}`,\n `.dg-tm-pn{${font(TYPE.pointName)};fill:var(--ink)}`,\n `.dg-tm-pnj{${font(sansOf(TYPE.pointName))}}`,\n \".dg-tm-pn-g{fill:var(--mute)}\",\n `.dg-tm-ps{${font(TYPE.pointState)};fill:var(--ct)}`,\n `.dg-tm-ln{fill:none;stroke:var(--c);stroke-width:${S.edgeOn};stroke-linecap:round;stroke-dasharray:1 2}`,\n `.dg-tm-nd{stroke:var(--ink);stroke-width:${S.timeNeedle};opacity:.55}`,\n \".dg-tm-nh{fill:var(--ink)}\",\n \".dg-tm-ph{fill:none;stroke:var(--line);stroke-dasharray:3 3}\",\n `.dg-tm-ex{fill:color-mix(in srgb,var(--c-slate) ${X.timeEmpty}%,var(--surf));stroke:var(--c-slate);stroke-width:${S.timeFrame};stroke-dasharray:3 3}`,\n `.dg-tm-ext{${font(TYPE.emptyText)};fill:var(--t-slate)}`,\n \".dg-tm-mt{fill:var(--hair)}\",\n \".dg-tm-mf{fill:var(--c);transform-box:fill-box;transform-origin:0 50%}\",\n `.dg-tm-mk{stroke:var(--ink2);stroke-width:${S.timeMeter}}`,\n `.dg-tm-ml{${font(TYPE.meterLine)};fill:var(--ink2)}`,\n \".dg-vp-bg{fill:var(--bg)}\",\n \".dg-vp-frame{fill:none;stroke:var(--hair)}\",\n \".dg-hd-bg{fill:var(--bg)}\",\n \".dg-mm-bg{fill:var(--surf);stroke:var(--hair)}\",\n `.dg-mm-t{${font(TYPE.miniTitle)};fill:var(--mute)}`,\n \".dg-mm-world{fill:var(--sunk);stroke:var(--hair)}\",\n `.dg-mm-band{fill:${mix(X.miniBand)};stroke:${mix(X.miniBandEdge, \"transparent\")};stroke-width:.6}`,\n `.dg-mm-card{fill:${mix(X.mini)}}`,\n `.dg-mm-vp{fill:color-mix(in srgb,var(--ink) ${X.view}%,transparent);stroke:var(--ink);stroke-width:${S.badgeRing};vector-effect:non-scaling-stroke}`,\n].join(\"\");\n\n/** 同じ原本と同じ見た目からは同じ名前になるよう、中身から短い名前を作る (keyframes の名前が頁の中で混ざらないため)。 */\nfunction nameOf(text: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < text.length; i++) {\n h ^= text.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(36);\n}\n\n/** 各箱が動く段。線の両端、処理、字の書き換えの箱。 */\nfunction involved(diagram: Diagram): Map<string, number[]> {\n const on = new Map<string, Set<number>>();\n const add = (id: string, s: number): void => {\n on.set(id, (on.get(id) ?? new Set()).add(s));\n };\n diagram.steps.forEach((step, s) => {\n for (const event of step.events) {\n if (event.type === \"edge\") {\n add(event.from, s);\n add(event.to, s);\n } else if (event.type === \"action\" || event.type === \"swap\") add(event.box, s);\n }\n });\n return new Map([...on].map(([id, steps]) => [id, [...steps].sort((a, b) => a - b)]));\n}\n\n/**\n * 箱の下の字の移り変わり。書き換えはそのまま残し、構成図の処理はその段の間だけ出して元へ戻す。\n * 止め絵を選んだ図は、その箱で最後に起きたのが処理なら、最後の段で起きることが済んだ時にその処理を出し直して繰り返す前まで残す (#3200)\n */\nfunction subChanges(diagram: Diagram, timeline: Timeline, actionsInBox: boolean): Map<string, SubChange[]> {\n type Raw = { t: number; order: number; box: string; set?: string; act?: string | null };\n const raw: Raw[] = [];\n const { whole } = timeline;\n let order = 0;\n for (const time of timeline.events) {\n const event = diagram.steps[time.step]?.events[time.event];\n if (event?.type === \"swap\") raw.push({ t: time.at, order: order++, box: event.box, set: event.text });\n if (actionsInBox && event?.type === \"action\") {\n raw.push({ t: time.at, order: order++, box: event.box, act: event.label });\n const end = (timeline.steps[time.step] as Span).end;\n if (!whole || end <= whole.start) raw.push({ t: end, order: order++, box: event.box, act: null });\n }\n }\n raw.sort((a, b) => a.t - b.t || a.order - b.order);\n const out = new Map<string, SubChange[]>();\n for (const box of diagram.boxes) {\n let base: [string, string] = [box.sub ?? \"\", \"dg-ss\"];\n let acting: string | undefined;\n let shown = base.join(\"|\");\n const list: SubChange[] = [];\n const changes = raw.filter((r) => r.box === box.id);\n const latest = [...changes].reverse().find((r) => r.set !== undefined || typeof r.act === \"string\");\n if (whole && typeof latest?.act === \"string\") changes.push({ t: whole.start, order: order++, box: box.id, act: latest.act });\n for (const change of changes) {\n // 書き換えは、出ている処理の字も置き換える\n if (change.set !== undefined) {\n base = [change.set, \"dg-ss-ok\"];\n acting = undefined;\n }\n if (change.act !== undefined) acting = change.act ?? undefined;\n const now: [string, string] = acting !== undefined ? [acting, \"dg-ss-act\"] : base;\n if (now.join(\"|\") === shown) continue;\n shown = now.join(\"|\");\n list.push([change.t, now[0], now[1]]);\n }\n // すぐ次の字に替わる字は読めないので出さない\n const kept = list.filter((change, k) => {\n const next = list[k + 1];\n return next === undefined || next[0] - change[0] >= MOTION.minShow;\n });\n out.set(box.id, kept);\n }\n return out;\n}\n\nfunction fieldChanges(diagram: Diagram, timeline: Timeline, layout: Layout): Map<string, FieldChange[]> {\n const out = new Map<string, FieldChange[]>();\n for (const time of timeline.events) {\n const event = diagram.steps[time.step]?.events[time.event];\n if (event?.type !== \"strip\") continue;\n const color: ColorKey = layout.badges[time.step]?.color ?? \"slate\";\n const list = out.get(event.field) ?? [];\n const until = (timeline.steps[time.step] as Span).end;\n list.push({ at: time.at, color, step: time.step, until, ...(event.value !== undefined ? { value: event.value } : {}), ...(event.tag !== undefined ? { tag: event.tag } : {}) });\n out.set(event.field, list);\n }\n return out;\n}\n\nexport interface FollowFrame {\n /** 枠の幅 (px)。寄って追う窓はこの幅で、字を原寸で見せる */\n width: number;\n /** 枠の中で見える高さ (px)。渡すと、窓と全体図をこの高さに収め (#3047)、窓をこの高さまで伸ばす (#3053)。枠の高さが図で伸びる置き場では渡さない */\n height?: number;\n /** 隅の全体図の札の言葉。渡し忘れを型の検査で止めるため、省けない欄にする */\n lang: NotationLang;\n}\n\n/**\n * 同じ線の同じ名前を後の段が置く時は、薄く残した名前をその段が始まるまでで消す (#3184)。\n * 止め絵で全ての段の名前を出し直す間は、同じ所に出る後の段の名前に任せる (#3200)\n */\nfunction fadeBefore(l: SceneLabel, time: LabelTime, steps: Span[]): LabelTime {\n if (l.until === undefined) return time;\n const { after, again: _again, ...rest } = time;\n if (!after) return rest;\n const cut = (steps[l.until] as Span).start;\n return cut > after.start ? { ...rest, after: { start: after.start, end: Math.min(after.end, cut) } } : rest;\n}\n\n/** 図を描く。`follow` を渡すと、寄って追う窓と隅の全体図で描く。`ink` を渡すと、描いた字の四角と見えている間をそこへ記録する (#3175)。 */\nexport function drawSvg(diagram: Diagram, layout: Layout, timeline: Timeline, palette: Palette, theme: Theme, follow?: FollowFrame, ink: Ink[] = [], traces: Trace[] = []): string {\n // 札の言葉で全体図の地の幅が変わりうるので、同じ頁に置いた別の言葉の図と名前を分ける。\n // 色は色味の名前でなく色の値から名前を作り、色の値を重ねた図 (#3198) と同じ色味の名前の図の変数の規則を分ける\n const vars = paletteVars(palette, theme);\n const id = nameOf(`${JSON.stringify(diagram)}|${vars}|${follow ? `${follow.width}|${follow.lang}` : \"\"}`);\n const m = new Motion(`dg${id}`, timeline.total, timeline.last);\n const ctx: Ctx = { m, t: timeline, id, sh: `filter=\"url(#dg-sh-${id})\"`, end: (timeline.steps[timeline.steps.length - 1] as Span).end, ink, traces };\n const on = involved(diagram);\n // 時系列図の処理は生存線の上の札に出し、他の図の種類は箱の下の字に出す\n const subs = subChanges(diagram, timeline, layout.kind !== \"sequence\");\n\n const L = { band: [] as string[], base: [] as string[], lit: [] as string[], node: [] as string[], badge: [] as string[], top: [] as string[] };\n for (const region of layout.regions) L.band.push(band(region, ink));\n const ghostColor = layout.boxes.find((b) => b.ghost)?.color ?? \"slate\";\n if (layout.side) L.band.push(side(layout.side, ghostColor, ink));\n // 脇道へ入る道は脇道の状態の色、それ以外の道は送る側の色で描く\n const boxColor = (id: string, ghost?: boolean): ColorKey | undefined => layout.boxes.find((b) => b.id === id && (ghost === undefined || b.ghost === ghost))?.color;\n for (const p of layout.paths) L.base.push(path(p, boxColor(p.to, true) ?? boxColor(p.from) ?? ghostColor, ink, traces));\n for (const e of layout.ends) L.node.push(endMark(e, ghostColor, ink));\n // 状態遷移図は、段で変わった値を今の状態の色で描き、帯の通った状態の点を着いた時刻に塗る (#3171)\n const isState = layout.kind === \"state\";\n const arrivals = new Map((timeline.states ?? []).flatMap((s) => (s.lit[0] ? [[s.box, s.lit[0].start] as [string, number]] : [])));\n // 時間軸の図の物差しの欄は、満ち具合の動きで棒を伸ばす (#3165)\n const meters = new Map((timeline.meters ?? []).map((meter) => [meter.field, meter.keys]));\n const gauge = (field: SceneField): string | undefined => (field.meter ? kindParts(\"time\").meterField({ ...field, meter: field.meter }, meters.get(field.name) ?? [[0, 0]], ctx) : undefined);\n const drawStrip = (s: SceneStrip): string => strip(s, fieldChanges(diagram, timeline, layout), ctx, isState, arrivals, gauge);\n // 寄って追う図の表は窓の下に置くので、窓の中身には描かない (#3270)\n if (layout.strip && !follow) L.band.push(drawStrip(layout.strip));\n for (const line of layout.lifelines) L.base.push(lifeline(line.x, line.y1, line.y2));\n // 枝分かれの図の線と commit と札は、枝分かれの図を描く部品が描く (#3164)\n if (isGitLayout(layout)) {\n const git = kindParts(\"git\").drawGit(layout, diagram, timeline, ctx);\n L.base.push(git.links);\n L.lit.push(git.lines);\n L.node.push(git.commits);\n L.top.push(git.tags);\n }\n // 木の図の木の線と通った跡と木の箱と札は、木の図を描く部品が描く (#3233)。木の線を走る線は通った跡が見せるので、ほかの線と同じ線で描かない\n const treeLayout = isTreeLayout(layout) ? layout : undefined;\n const tree = treeLayout ? kindParts(\"tree\").drawTree(treeLayout, diagram, timeline, ctx) : undefined;\n if (tree) {\n L.base.push(tree.links);\n L.lit.push(tree.trails);\n L.node.push(tree.nodes);\n }\n const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));\n // 列の図の列とチップと封と札は、列の図を描く部品が描く (#3239)\n const lineupLayout = isLineupLayout(layout) ? layout : undefined;\n if (lineupLayout) {\n const lineup = kindParts(\"lineup\").drawLineup(lineupLayout, diagram, timeline, ctx, subs);\n L.base.push(lineup.lanes);\n L.node.push(lineup.chips);\n }\n // 時間軸の図の目盛りと印と拡大の帯の箱と節目は、時間軸の図を描く部品が描く (#3165)。拡大の帯の線は他の図と同じ線で描く\n const timeLayout = isTimeLayout(layout) ? layout : undefined;\n if (timeLayout) {\n const drawn = kindParts(\"time\").drawTime(timeLayout, diagram, timeline, ctx, subs);\n L.base.push(drawn.base);\n L.lit.push(drawn.lit);\n L.node.push(drawn.node);\n L.top.push(drawn.top);\n }\n const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));\n for (const e of layout.edges) {\n const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);\n if (!time || (timeLayout && !wired.has(`${e.step}/${e.event}`)) || runs.has(`${e.step}/${e.event}`)) continue;\n // 木の図の箱は段ごとに現れるので、木の線を走らない線の点線は、両端の木の箱が現れてから出す (#3240)\n const since = Math.max(tree?.appear.get(e.from) ?? 0, tree?.appear.get(e.to) ?? 0);\n const drawn = edge(e, time, ctx, isState, since);\n L.base.push(drawn.base);\n L.lit.push(drawn.lit);\n }\n const states = new Map((timeline.states ?? []).map((s) => [s.box, s]));\n // 飛び先を持つ箱は、箱の札をその飛び先への link で包む (#3199)。時間軸の図の箱は時間軸の図を描く部品が包む\n const links = new Map(diagram.boxes.flatMap((b) => (b.link === undefined ? [] : [[b.id, b.link] as [string, string]])));\n const linked = (id: string, markup: string): string => linkTo(links.get(id), markup);\n for (const box of timeLayout || lineupLayout ? [] : layout.boxes) {\n if (box.ghost) {\n L.node.push(linked(box.id, ghostCard(box, ink)));\n continue;\n }\n const state = states.get(box.id);\n L.node.push(linked(box.id, card(box, ctx, on.get(box.id) ?? [], subs.get(box.id) ?? [], isState ? (state?.lit ?? []) : undefined)));\n if (state?.done !== undefined) L.node.push(doneMark(box, state.done, ctx));\n }\n for (const b of layout.badges) if (!(follow && onStrip(layout, b))) L.badge.push(badge(b, ctx, isState));\n for (const l of layout.labels) {\n const time = timeline.labels.find((t) => t.step === l.step && t.event === l.event);\n if (time) L.top.push(label(l, fadeBefore(l, time, timeline.steps), ctx));\n }\n // 止め絵を選んだ図は、全ての段の名前を出す間にも処理の札を出す。その間に見えている札は繰り返す前まで延ばす (#3200)\n const { whole } = timeline;\n for (const a of layout.actions) {\n const time = timeline.events.find((t) => t.step === a.step && t.event === a.event);\n if (!time) continue;\n const until = (timeline.steps[a.step] as Span).end;\n L.top.push(whole && until > whole.start ? action(a, time.at, whole.end, ctx) : action(a, time.at, until, ctx, whole));\n }\n // 木の図の運ぶ物は着いた所で消える。通った跡が行き先を残し、兄弟の箱から同じ親へ着いた運ぶ物が重ならないため\n for (const time of timeline.carriers) {\n const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);\n if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));\n }\n const content = Object.values(L)\n .map((parts) => parts.join(\"\"))\n .join(\"\");\n\n const { near, far, nearY, farY } = LOOK.shadow;\n const shadow = `<filter id=\"dg-sh-${id}\" x=\"-20%\" y=\"-30%\" width=\"140%\" height=\"180%\"><feDropShadow dx=\"0\" dy=\"${nearY}\" stdDeviation=\"${near}\" style=\"flood-color:var(--sh);flood-opacity:var(--shA)\"/><feDropShadow dx=\"0\" dy=\"${farY}\" stdDeviation=\"${far}\" style=\"flood-color:var(--sh);flood-opacity:var(--shB)\"/></filter>`;\n // 寄って追う時系列図は、頭の箱を窓の上端に貼る頭の列にも描く (#3118)。頭の列の箱はアイコンを外した 2 段 (#3120)。止めて見せる図では描かない\n const heads = follow && layout.kind === \"sequence\" ? layout.boxes.map((box) => linked(box.id, headCard(box, ctx, on.get(box.id) ?? [], subs.get(box.id) ?? []))).join(\"\") : \"\";\n // 表の値だけが変わる段の番号の丸は表の隅に在るので、表と一緒に窓の下へ移す (#3270)。\n // 窓の下の表は図の左端から始まるので、丸の半径だけ内へ寄せる。寄せないと丸の左が図の端で切れる\n const drawTable = (s: SceneStrip, from: SceneStrip): string =>\n drawStrip(s) + layout.badges.filter((b) => onStrip(layout, b)).map((b) => badge({ ...b, x: b.x - from.x + s.x + LOOK.badge.r, y: b.y - from.y + s.y }, ctx, isState)).join(\"\");\n const view = follow ? followView(layout, timeline, diagram, m, id, content, follow, heads, drawTable) : { body: `<rect class=\"dg-bg\" width=\"${layout.width}\" height=\"${layout.height}\" rx=\"${LOOK.region.radius}\"/>${content}`, w: layout.width, h: layout.height };\n const css = `.dg-${id}{${FONT_VARS};--T:${timeline.total}s;${vars}}${PART_CSS}${m.frames.join(\"\")}`;\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" class=\"dg dg-${id}\" viewBox=\"0 0 ${Math.ceil(view.w)} ${Math.ceil(view.h)}\" width=\"${Math.ceil(view.w)}\" height=\"${Math.ceil(view.h)}\" role=\"img\" aria-label=\"${esc(diagram.title)}\" data-dragon=\"figure\" data-view=\"${follow ? \"follow\" : \"fixed\"}\">` +\n `<style>${css}</style><defs>${shadow}</defs>${view.body}</svg>`\n );\n}\n\n/** 四角を全部囲む四角。 */\nfunction union(rects: Rect[]): Rect {\n const x = Math.min(...rects.map((r) => r.x));\n const y = Math.min(...rects.map((r) => r.y));\n return { x, y, w: Math.max(...rects.map((r) => r.x + r.w)) - x, h: Math.max(...rects.map((r) => r.y + r.h)) - y };\n}\n\n/** 番号の丸が値の表の上に在るか。表の値だけが変わる段の丸は表の隅に置かれる */\nfunction onStrip(layout: Layout, badge: { y: number }): boolean {\n return layout.strip !== undefined && badge.y >= layout.strip.y;\n}\n\n/** 段で動く物が占める所。 */\nfunction focusOf(layout: Layout, diagram: Diagram, step: number): Rect | undefined {\n const rects = focusParts(layout, diagram, step);\n return rects.length === 0 ? undefined : union(rects);\n}\n\n/**\n * 番号の丸が窓から外れる段で、窓に入れる所 (#3046)。\n * 丸とその周りを起点に、丸に近い動く物から順に、窓 (`vw` × `vh`) に収まる間だけ囲む。収まらない物は飛ばして次を見る\n */\nfunction badgeFocus(badge: { x: number; y: number }, parts: Rect[], vw: number, vh: number): Rect {\n const room = LOOK.badge.r + LOOK.follow.badgeRoom;\n const { x: bx, y: by } = badge;\n const away = (p: Rect): number => Math.hypot(Math.max(0, p.x - bx, bx - p.x - p.w), Math.max(0, p.y - by, by - p.y - p.h));\n let held: Rect = { x: bx - room, y: by - room, w: room * 2, h: room * 2 };\n for (const p of [...parts].sort((a, b) => away(a) - away(b))) {\n const next = union([held, p]);\n if (next.w <= vw && next.h <= vh) held = next;\n }\n return held;\n}\n\n/** 段で動く物を 1 つずつ。 */\nfunction focusParts(layout: Layout, diagram: Diagram, step: number): Rect[] {\n const rects: Rect[] = [];\n for (const e of layout.edges.filter((x) => x.step === step)) {\n const xs = e.points.map((p) => p[0]);\n const ys = e.points.map((p) => p[1]);\n rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });\n }\n rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));\n // 木の図は、その段で現れる木の箱と木の線と、線の両端の木の箱を見る (#3233)\n if (isTreeLayout(layout)) {\n const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => (e.type === \"edge\" ? [e.from, e.to] : [])));\n rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));\n for (const l of layout.links.filter((x) => x.step === step)) {\n const xs = l.points.map((p) => p[0]);\n const ys = l.points.map((p) => p[1]);\n rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });\n }\n }\n // 列の図は、その段で変わる列を見る (#3239)\n if (isLineupLayout(layout)) {\n const changed = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => (\"box\" in e ? [e.box] : [])));\n rects.push(...layout.lanes.filter((lane) => changed.has(lane.id)));\n }\n for (const event of diagram.steps[step]?.events ?? []) {\n const ids = event.type === \"edge\" ? [event.from, event.to] : event.type === \"action\" || event.type === \"swap\" ? [event.box] : [];\n for (const id of ids) {\n const box = layout.boxes.find((b) => b.id === id);\n // 時系列図の頭の箱は遠いので、線の行だけを見る\n if (box && (layout.kind === \"architecture\" || event.type === \"swap\")) rects.push(box);\n }\n }\n return rects;\n}\n\n/**\n * 寄って追う窓。段ごとに動く所へ寄り、窓の外の全体図に今見ている所の枠を同じ動きで出す。\n * 全体図は窓に重ねると今動く線や箱を覆うので、窓の外に置く (#3042)。\n * 縦長の全体図は窓の右に列を取り、横長の全体図は窓の下に置く。失う窓の幅か図の高さの小さい側を選ぶ。\n * 枠の中で見える高さを渡された時は、窓と全体図がその高さに入るまで窓を低くする (#3047)。\n * 枠が余る時は窓を広げ、図の原寸の幅と、見える高さか図の高さまで使う。全体図は今の大きさのまま置く (#3053)。\n * 枠の幅が `LOOK.follow.narrow` より狭い時は、縦長の全体図を出さずに窓へ枠の幅の全部を渡す (#3055)。値の表を持つ図は、狭い枠では横長の全体図も出さない (#3274)。\n * 段で動く物を全部囲んだ所の真ん中に寄せると今の段の番号の丸が窓から外れる段では、丸に近い動く物から窓に収まるだけ囲んだ所へ寄せる (#3046)。\n * 時系列図は頭の箱 `heads` を窓の上端の頭の列に貼り、窓が横に動く時だけ一緒に動かす。頭の箱は図の上端に在り、線を追う窓からは外れるため。\n * 窓は頭の列の下の残りの高さで動く物を真ん中に見せる (#3118)。\n * 頭の列の箱はアイコンを外した 2 段にして低く貼り、線は図の頭の箱の下から見せ始める (#3120)。\n * 値の表は図の一番下に在り、窓が近づくまで映らず、窓より広い表は右側が切れる。全体図と同じ理由で窓の外に出し、\n * 窓と全体図の下に図の枠の幅で組み直す (#3270)。窓と全体図は表を除いた図の高さ `worldH` の中だけを見る。\n */\nfunction followView(layout: Layout, timeline: Timeline, diagram: Diagram, m: Motion, id: string, content: string, follow: FollowFrame, heads: string, drawTable: (s: SceneStrip, from: SceneStrip) => string): { body: string; w: number; h: number } {\n const F = LOOK.follow;\n const M = LOOK.mini;\n const frameWidth = Math.max(1, follow.width);\n const full = Math.min(layout.width, frameWidth);\n const worldH = layout.strip ? layout.strip.y : layout.height;\n const title = FIGURE_TEXT[follow.lang].overview;\n /** 窓の高さ `vh` の時の全体図の寸法。全体図は窓の高さで縮むので、窓を低くしたら測り直す */\n const sized = (vh: number) => {\n // 全体図の寸法は枠の幅と窓の高さで決め、置き場所に依らない\n // 全体図の幅は表を含む図の比で決める。表を除いた比にすると全体図の列が太り、窓が狭くなる\n const mw = Math.min(M.w, full * 0.4, ((vh * 0.4) / layout.height) * layout.width);\n const k = mw / layout.width;\n const mh = worldH * k;\n // 地の幅は図の縦横の比で決まるので、縦に長い図では札より狭くなる。その時は地を札の幅まで広げ、図は広げた地の真ん中に置く\n const bw = Math.max(mw, Math.ceil(textWidth(title, TYPE.miniTitle)));\n // 縦横の比は窓の高さに依らないので、低くしても全体図の置き場所は変わらない\n return { vh, mw, k, mh, bw, bgW: bw + M.pad * 2, bgH: mh + M.pad * 2 + M.title, beside: mh > mw };\n };\n const natural = sized(Math.min(worldH, Math.max(F.minH, full * F.aspect)));\n // 携帯の幅では縦長の全体図の列が枠の幅の 3 割を取り、窓が図の横の 3 割ほどしか見せない。その時は全体図を出さない。\n // 横長の全体図は窓の下に出して幅を取らないので、狭い枠でも出す。\n // ただし値の表を持つ図は、窓の下に全体図と表が重なって段を送る釦を最初の画面の外へ押し出すので、狭い枠では全体図を出さない (#3274)\n const bare = frameWidth < F.narrow && (natural.beside || layout.strip !== undefined);\n const tableH = layout.strip ? rewrapStrip(layout.strip, 0, 0, full).h + M.inset : 0;\n // 窓の右の全体図は窓の高さの中に収まり、窓の下の全体図と表は窓の高さに足される\n const room = follow.height === undefined ? Number.POSITIVE_INFINITY : (natural.beside || bare ? follow.height : follow.height - natural.bgH - M.inset) - tableH;\n // 見える高さが窓より低ければ窓と全体図を縮め、高ければ全体図はそのままに窓を図の高さまで伸ばす。\n // 全体図も伸ばすと、狭い枠では右の全体図の列が太って窓が狭くなる\n const { vh, mw, k, mh, bw, bgW, bgH, beside } =\n room < natural.vh ? sized(Math.max(F.fitMinH, room)) : { ...natural, vh: Number.isFinite(room) ? Math.min(worldH, room) : natural.vh };\n // 右の全体図の列は枠の余りに置き、窓は図の原寸の幅まで広げる。枠が図より狭い時は今までどおり枠の幅から列を引く\n const vw = beside && !bare ? Math.min(layout.width, frameWidth - bgW - M.inset) : full;\n const clampX = (x: number): number => Math.min(layout.width - vw / 2, Math.max(vw / 2, x));\n // 時系列図は窓の上端に頭の列を貼るので、動く物は頭の列の下の残りの高さ `below` に見せる (#3118)。\n // 線は図の頭の箱の下 `top` から見せ始め、図の頭の箱は頭の列の下か窓の上に隠す (#3120)\n const top = heads === \"\" ? 0 : Math.max(...layout.boxes.map((b) => b.y + b.h)) + F.headRoom;\n const strip = heads === \"\" ? 0 : F.head.pad * 2 + F.head.h;\n const below = vh - strip;\n /** 頭の列の下の残りの窓の真ん中の高さを、図の頭の箱の下と図の下端で止める */\n const clampY = (y: number): number => Math.min(worldH - below / 2, Math.max(top + below / 2, y));\n const r = LOOK.badge.r;\n let prev: [number, number] = [layout.width / 2, worldH / 2];\n // 頭の列の下の残りの窓の真ん中。窓の真ん中は、これより頭の列の高さの半分だけ上に在る\n const middles = timeline.steps.map((_, s) => {\n // 時間軸の図は、針と印の列を必ず窓に入れる (#3165)。番号の丸へ寄せ直すと、針が窓から外れるため\n if (isTimeLayout(layout)) {\n const f = kindParts(\"time\").timeFocus(layout, timeline, s, focusParts(layout, diagram, s), vw, below);\n prev = [f.x + f.w / 2, f.y + f.h / 2];\n return [clampX(prev[0]), clampY(prev[1])] as [number, number];\n }\n const f = focusOf(layout, diagram, s);\n prev = f ? [f.x + f.w / 2, f.y + f.h / 2] : prev;\n const at: [number, number] = [clampX(prev[0]), clampY(prev[1])];\n // 動く物を全部囲んだ所が窓より大きいと、その端に在る番号の丸が窓から外れる。その段だけ丸の近くへ寄せ直す (#3046)\n const b = layout.badges.find((x) => x.step === s);\n if (!b || onStrip(layout, b) || (Math.abs(b.x - at[0]) <= vw / 2 - r && Math.abs(b.y - at[1]) <= below / 2 - r)) return at;\n const near = badgeFocus(b, focusParts(layout, diagram, s), vw, below);\n // 動く物の無い次の段は、寄せ直した窓のまま止める\n prev = [near.x + near.w / 2, near.y + near.h / 2];\n return [clampX(prev[0]), clampY(prev[1])] as [number, number];\n });\n const centers = middles.map(([x, y]): [number, number] => [x, y - strip / 2]);\n const c0 = centers[0] as [number, number];\n const cam: [number, number, number, number?, string?][] = [\n [0, c0[0], c0[1]],\n [(timeline.steps[0] as Span).start, c0[0], c0[1]],\n ];\n centers.forEach((c, s) => {\n if (s === 0) return;\n const before = centers[s - 1] as [number, number];\n const start = (timeline.steps[s] as Span).start;\n cam.push([start, before[0], before[1], 1, EASE.inOut], [start + F.ease, c[0], c[1]]);\n });\n const cl = centers[centers.length - 1] as [number, number];\n cam.push([timeline.last, cl[0], cl[1], 1, EASE.inOut], [timeline.total, c0[0], c0[1]]);\n const camKf = m.move(cam.map(([t, cx, cy, s, e]) => [t, vw / 2 - cx, vh / 2 - cy, s, e]));\n\n // 右に出す時は窓の上端に揃え、下に出す時は窓の右端から内へ寄せる\n const bgX = beside ? vw + M.inset : vw - bgW - M.inset;\n const bgY = beside ? 0 : vh + M.inset;\n const bx = bgX + M.pad;\n const mx = bx + (bw - mw) / 2;\n const my = bgY + M.pad + M.title;\n /**\n * 全体図の地と札と、今見ている所の枠。窓と同じ動きで枠を動かす。\n * 時系列図の枠は頭の列の下の線を見せる所だけを囲む。頭の箱は頭の列に常に出ているため (#3122)\n */\n const overview = (): { clip: string; body: string } => {\n const shapes = [\n ...layout.regions.map((r) => `<rect class=\"dg-mm-band\" style=\"${cs(r.color)}\" x=\"${mx + r.x * k}\" y=\"${my + r.y * k}\" width=\"${r.w * k}\" height=\"${r.h * k}\" rx=\"3\"/>`),\n ...layout.boxes.map((b) => `<rect class=\"dg-mm-card\" style=\"${cs(b.color)}\" x=\"${mx + b.x * k}\" y=\"${my + b.y * k}\" width=\"${b.w * k}\" height=\"${b.h * k}\" rx=\"1.5\"/>`),\n ...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class=\"dg-mm-card\" style=\"${cs(n.color)}\" x=\"${mx + n.x * k}\" y=\"${my + n.y * k}\" width=\"${n.w * k}\" height=\"${n.h * k}\" rx=\"1.5\"/>`),\n ].join(\"\");\n const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));\n return {\n clip: `<clipPath id=\"dg-mm-${id}\"><rect x=\"${mx}\" y=\"${my}\" width=\"${mw}\" height=\"${mh}\" rx=\"4\"/></clipPath>`,\n body:\n `<rect class=\"dg-mm-bg\" x=\"${bgX}\" y=\"${bgY}\" width=\"${bgW}\" height=\"${bgH}\" rx=\"${M.radius}\"/>` +\n `<text class=\"dg-mm-t\" x=\"${bx}\" y=\"${my - M.pad + 2}\">${title}</text>` +\n `<g clip-path=\"url(#dg-mm-${id})\"><rect class=\"dg-mm-world\" x=\"${mx}\" y=\"${my}\" width=\"${mw}\" height=\"${mh}\"/>${shapes}<rect class=\"dg-mm-vp dg-a\"${strip === 0 ? \"\" : ` y=\"${strip * k}\"`} width=\"${vw * k}\" height=\"${(vh - strip) * k}\" rx=\"2\" style=\"${vp}\"/></g>`,\n };\n };\n const mini = bare ? { clip: \"\", body: \"\" } : overview();\n // 頭の列は窓の中身の上に重ね、窓と同じ時刻と緩急で横にだけ動かす (#3118)\n const head =\n strip === 0\n ? \"\"\n : `<g class=\"dg-hd\"><rect class=\"dg-hd-bg\" width=\"${vw}\" height=\"${strip}\"/><line class=\"dg-sep\" x1=\"0\" y1=\"${strip}\" x2=\"${vw}\" y2=\"${strip}\"/>` +\n `<g class=\"dg-a\" style=\"${m.move(cam.map(([t, cx, , s, e]) => [t, vw / 2 - cx, 0, s, e]))}\">${heads}</g></g>`;\n const body =\n `<defs><clipPath id=\"dg-vp-${id}\"><rect width=\"${vw}\" height=\"${vh}\" rx=\"${LOOK.region.radius}\"/></clipPath>${mini.clip}</defs>` +\n `<g clip-path=\"url(#dg-vp-${id})\"><rect class=\"dg-vp-bg\" width=\"${vw}\" height=\"${vh}\"/><g class=\"dg-a\" style=\"${camKf}\">${content}</g>${head}</g>` +\n `<rect class=\"dg-vp-frame\" x=\"0.5\" y=\"0.5\" width=\"${vw - 1}\" height=\"${vh - 1}\" rx=\"${LOOK.region.radius}\"/>${mini.body}`;\n const w = beside && !bare ? vw + M.inset + bgW : full;\n // 全体図を出さない時は、窓のすぐ下に表を置く\n const bottom = beside || bare ? vh : bgY + bgH;\n if (!layout.strip) return { body, w, h: bottom };\n const table = rewrapStrip(layout.strip, 0, bottom + M.inset, full);\n return { body: body + drawTable(table, layout.strip), w, h: table.y + table.h };\n}\n\n/**\n * 描く色味。名前で選んだ色味の `theme` の色に `colors` の色を重ねる (#3198)。\n * 色味に無い色の名前と、色の値として読めない値は、名前を全て挙げて描かずに断る\n */\nexport function paletteOf(options: RenderOptions, theme: Theme): Palette {\n const palette = resolvePalette(options.palette);\n if (!options.colors) return palette;\n const words = FIGURE_TEXT[options.lang ?? \"ja\"];\n const errors = Object.entries(options.colors).flatMap(([name, value]) => (!isColorName(name) ? [words.unknownColor(name)] : isColorValue(value) ? [] : [words.unreadableColor(name)]));\n if (errors.length > 0) throw new Error(words.cannotDraw(errors.join(\" / \")));\n return { ...palette, [theme]: { ...palette[theme], ...options.colors } };\n}\n\n/** 原本の JSON から図を描く。原本が形に合わない時は、誤りの場所を添えて断る。 */\nexport function renderDiagram(input: unknown, options: RenderOptions = {}): Rendered {\n const lang = options.lang ?? \"ja\";\n const read = readDiagram(input, { lang });\n if (!read.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read.errors.map((e) => `${e.pointer} ${e.message}`).join(\" / \")));\n const diagram = read.diagram;\n const layout =\n diagram.kind === \"sequence\"\n ? layoutSequence(diagram)\n : diagram.kind === \"state\"\n ? kindParts(\"state\", lang).layoutState(diagram, lang)\n : diagram.kind === \"git\"\n ? kindParts(\"git\", lang).layoutGit(diagram)\n : diagram.kind === \"time\"\n ? kindParts(\"time\", lang).layoutTime(diagram, lang)\n : diagram.kind === \"tree\"\n ? kindParts(\"tree\", lang).layoutTree(diagram)\n : diagram.kind === \"lineup\"\n ? kindParts(\"lineup\", lang).layoutLineup(diagram)\n : layoutArchitecture(diagram);\n return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);\n}\n\n/**\n * 置き場所を決めた図を描き、描いた字の重なりを数える (#3175)。`renderDiagram` が原本を読んで置き場所を決めた後に呼ぶ。\n * 重なりは、字を描く部品が記録した字だけから数えるので、描く所が位置を決める字 (箱の名前) も対象に入る\n */\nexport function renderLayout(diagram: Diagram, layout: Layout, timeline: Timeline, options: RenderOptions = {}): Rendered {\n const theme: Theme = options.theme === \"dark\" ? \"dark\" : \"light\";\n const palette = paletteOf(options, theme);\n const ink: Ink[] = [];\n const traces: Trace[] = [];\n const svg = drawSvg(diagram, layout, timeline, palette, theme, undefined, ink, traces);\n return {\n svg,\n palette: palette.id,\n theme,\n ...(diagram.view ? { view: diagram.view } : {}),\n fonts: { ...FONTS },\n layout,\n timeline,\n diagram,\n overlaps: findOverlaps(ink, timeline.stills, traces),\n };\n}\n","/**\n * 見せ方を字の大きさで選ぶ。\n *\n * 全体を枠の幅へ収めた時の箱の名前の字が 10.5px 以上なら、全体を止めて中だけ動かす (`fixed`)。\n * 下回るなら、動く所へ寄って追い、隅の全体図で今どこかを示す (`follow`)。\n * 枠の高さを渡すと、全体を枠の幅と高さの両方へ収めた時の字で選ぶ (#3047)。高さの決まった置き場で、縦に長い図を縮めすぎないため。\n * 書き手が原本の `view` で決めた時は、字の大きさに関わらずそれに従う。\n */\nimport { READABLE_PX, TYPE } from \"./look/values\";\nimport type { Rendered } from \"./render/draw\";\nimport type { ViewMode } from \"./schema\";\n\nexport function chooseView(rendered: Pick<Rendered, \"layout\" | \"view\">, frameWidth: number, frameHeight?: number): { mode: ViewMode; textPx: number } {\n const byWidth = Math.max(0, frameWidth) / rendered.layout.width;\n const scale = frameHeight === undefined ? byWidth : Math.min(byWidth, Math.max(0, frameHeight) / rendered.layout.height);\n const textPx = scale * TYPE.boxName.size;\n if (rendered.view) return { mode: rendered.view, textPx };\n return { mode: textPx >= READABLE_PX ? \"fixed\" : \"follow\", textPx };\n}\n","/**\n * 頁に図を置いて動かす。\n *\n * 動きを嫌う設定 (`prefers-reduced-motion: reduce`) は描く前に読み、その人には一瞬も自動再生せず、\n * 段ごとの止め絵を釦で送る。各段の題と本文と出典は、読み上げの道具が段の順に読める番号付きの一覧として置き、\n * 図そのものは読み上げから隠して同じ中身を 2 度読ませない。\n * 見せ方は枠の幅で選び (`view.ts`)、寄って追う時は窓と全体図で描き直す。\n * 釦と段の一覧の読み上げの名前と全体図の札は、渡した言葉 (`options.lang`、書かなければ日本語) で出す (#3001)。\n * 色は `options.palette` の名前の色味に `options.colors` の色の値を重ね、図と全体図と釦と段の帯を同じ色で塗る (#3198)。\n * 段が替わるたびに `options.onStep` で今の段を知らせ、頁の側が段の札や進み具合を出せるようにする (#3031)。\n * 置いた時に流さず決めた段で止めて置く (`options.pausedAt`) ことと、1 度だけ流して最後の段で止める (`options.playOnce`) ことを選べる。\n * 止め絵を選んだ図 (`options.still`) は、最後の段で止まった時に全ての段の線の名前を出す (#3200)。\n * 頁は `goTo` で段へ移って止め、`mark` で図の上に点線の四角を描く。頁の側では SVG を組まないので、編集画面が字の重なりを囲む時もこれを呼ぶ (#3178)。\n * 段の本文の帯は本文の最も長い段の高さに保ち、段を送っても図の大きさと位置を変えない (#3049)。\n * 帯の中身の幅が `LOOK.player.narrow` より狭い時は、段を送る釦を指で押せる大きさにして段の番号と上の段に並べ、\n * 題と本文をその下の段の全幅に置く (#3057、#3069)。\n */\nimport { FIGURE_TEXT } from \"./figure-text\";\nimport type { Rect } from \"./layout/scene\";\nimport { FONT_VARS, LOOK, paletteVars, type TextStyle, TYPE } from \"./look/values\";\nimport { drawSvg, paletteOf, type RenderOptions, renderDiagram } from \"./render/draw\";\nimport type { Span } from \"./timeline\";\nimport { chooseView } from \"./view\";\n\nexport interface PlayerOptions extends RenderOptions {\n /** 段が替わるたびに今の段 (0 から) を受け取る。置いた時にも最初の段で 1 度呼ぶ。頁の側で段の札や進み具合を出す時に使う (#3031) */\n onStep?: (step: number) => void;\n /**\n * 図を、図の枠の中で見える高さに収める (#3047)。高さに収めると字が読めない図は寄って追う図にし、寄って追う窓と全体図をその高さに収める。\n * 枠の高さが決まっている置き場 (カタログの拡大の重ね窓) で使う。枠の高さが図に合わせて伸びる置き場で使うと、描くたびに低くなる\n */\n fitHeight?: boolean;\n /** 置いた時に流さず、段 `pausedAt` (0 から) の止め絵で止めて置く。段の数を超えた時は最後の段で止める。書かなければ置いた時から流す (#3200) */\n pausedAt?: number;\n /** 流した時に最後の段の止め絵で止め、繰り返さない。最後の段で止まった図を流すと、最初の段から流し直す (#3200) */\n playOnce?: boolean;\n}\n\nexport interface Player {\n /** 今の段 (0 から) */\n readonly step: number;\n /** 動いているか */\n readonly playing: boolean;\n next(): void;\n prev(): void;\n play(): void;\n pause(): void;\n /** 段 `step` (0 から) へ移って止める。段の数を超えた時は最後の段で止める (#3178) */\n goTo(step: number): void;\n /** 図の上に点線の四角を描く。四角は図の座標で渡し、空を渡すと消す。図を置き直しても残る (#3178) */\n mark(rects: readonly Rect[]): void;\n destroy(): void;\n}\n\nconst font = (t: TextStyle): string => `font:${t.weight} ${t.size}px var(--${t.family})`;\nconst px = (v: number): string => `${v}px`;\n\nfunction playerCss(): string {\n const P = LOOK.player;\n const hidden = px(P.hidden);\n return [\n `.dg-player{display:flex;flex-direction:column;gap:${px(P.gap)};color:var(--ink)}`,\n `.dg-player .dg-frame{border-radius:${px(P.radius)};overflow:hidden}`,\n // 並べ方は帯の中身の幅で選ぶ。帯の中の 1 段 (`.dg-row`) が並べ替わり、帯の左右の余白は置いた頁が帯に付ける\n `.dg-bar{container:dg-bar/inline-size}`,\n `.dg-row{display:flex;align-items:flex-start;gap:${px(P.gap)}}`,\n `.dg-btns{display:flex;gap:${px(P.gap / 2)};flex:none}`,\n `.dg-btn{width:${px(P.button)};height:${px(P.button)};border-radius:${px(P.radius)};border:${px(LOOK.stroke.hair)} solid var(--hair);background:var(--surf);color:var(--ink);${font(TYPE.button)};cursor:pointer}`,\n `.dg-btn:focus-visible{outline:${px(P.focus)} solid var(--c-blue);outline-offset:${px(P.focus)}}`,\n `.dg-say{display:flex;gap:${px(P.gap)};min-width:0}`,\n `.dg-no{${font(TYPE.stepNo)};color:var(--mute);padding-top:${px(P.focus)}}`,\n `.dg-txt{display:grid;grid-template-columns:minmax(0,1fr);min-width:0}`,\n `.dg-txt>*{grid-area:1/1}`,\n `.dg-room{visibility:hidden}`,\n `.dg-tt{${font(TYPE.stepTitle)};margin:0}`,\n `.dg-tb{${font(TYPE.stepBody)};color:var(--ink2);margin:0;white-space:pre-line}`,\n `.dg-sr{position:absolute;width:${hidden};height:${hidden};margin:-${hidden};padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}`,\n // 狭い帯 (携帯の幅) では、段を送る釦を指で押せる大きさにし、その横に番号を置き、\n // 題を 2 段目、本文を 3 段目に置いてどちらも帯の全幅を使う (#3057、#3069)。\n // 釦を大きくすると横に題を置く幅が足りず題が細かく折れるため、題は釦の段に置かない。\n // 題と本文を包む箱を外して写しも同じ升に重ねるので、2 段目は最も高い題、3 段目は最も長い本文の高さになる。\n // 題と本文の間は広い帯と同じく空けず、釦の段の下にだけ間を取って、帯が高くなる分を抑える\n `@container dg-bar (width < ${px(P.narrow)}){` +\n `.dg-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:0 ${px(P.gap)}}` +\n `.dg-say,.dg-txt,.dg-txt>*{display:contents}` +\n `.dg-btns{grid-area:1/1;margin-bottom:${px(P.gap / 2)}}` +\n `.dg-btn{width:${px(P.touch)};height:${px(P.touch)}}` +\n `.dg-no{grid-area:1/2;display:flex;align-items:center;min-height:${px(P.touch)};padding-top:0}` +\n `.dg-tt{grid-area:2/1/3/3}` +\n `.dg-tb{grid-area:3/1/4/3}` +\n `}`,\n // 指で触る時は、広い帯でも段を送る釦を指で押せる大きさにする (#3076)。並びは横 1 列のまま変えない。\n // 広い帯は本文が 2 行あれば帯の高さが変わらず、本文の無い帯だけが釦の分だけ高くなる\n `@media (pointer: coarse){.dg-btn{width:${px(P.touch)};height:${px(P.touch)}}}`,\n `.dg-spot{fill:none;stroke:var(--t-amber);stroke-width:${px(LOOK.stroke.mark)};stroke-dasharray:${LOOK.mark.dash} ${LOOK.mark.gap};pointer-events:none}`,\n ].join(\"\");\n}\n\nfunction ensureCss(doc: Document): void {\n if (doc.getElementById(\"dragon-player-css\")) return;\n const style = doc.createElement(\"style\");\n style.id = \"dragon-player-css\";\n style.textContent = playerCss();\n doc.head.appendChild(style);\n}\n\n/** 釦に出す字。HTML に書き出す時は、この字も字の file に残す。 */\nexport const BUTTON_TEXT = { prev: \"‹\", pause: \"❚❚\", play: \"▶\", next: \"›\" } as const;\n\n/** 図の上に四角を描く時の SVG の名前空間 */\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nconst pad = (n: number): string => String(n).padStart(2, \"0\");\n/** 段の番号の札 (`01/12`)。`step` は 0 から数える。 */\nexport const stepNo = (step: number, count: number): string => `${pad(step + 1)}/${pad(count)}`;\n\nexport function mountDiagram(host: HTMLElement, diagram: unknown, options: PlayerOptions = {}): Player {\n const doc = host.ownerDocument;\n const win = doc.defaultView;\n // 描く前に読む。描いた後に読むと、動きを嫌う人にも一瞬だけ流れてしまう\n const reduce = Boolean(win?.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches);\n const rendered = renderDiagram(diagram, options);\n const lang = options.lang ?? \"ja\";\n const words = FIGURE_TEXT[lang];\n const palette = paletteOf(options, rendered.theme);\n const { timeline } = rendered;\n const steps = rendered.diagram.steps;\n const count = steps.length;\n\n ensureCss(doc);\n const root = doc.createElement(\"div\");\n root.className = \"dg-player\";\n root.dataset.dragon = \"player\";\n root.setAttribute(\"style\", `${FONT_VARS};${paletteVars(palette, rendered.theme)}`);\n\n const frame = doc.createElement(\"div\");\n frame.className = \"dg-frame\";\n const button = (name: string, label: string, text: string): HTMLButtonElement => {\n const b = doc.createElement(\"button\");\n b.type = \"button\";\n b.className = \"dg-btn\";\n b.dataset.dragon = name;\n b.setAttribute(\"aria-label\", label);\n b.textContent = text;\n return b;\n };\n const prevButton = button(\"prev\", words.prev, BUTTON_TEXT.prev);\n const toggleButton = button(\"toggle\", words.pause, BUTTON_TEXT.pause);\n const nextButton = button(\"next\", words.next, BUTTON_TEXT.next);\n const buttons = doc.createElement(\"div\");\n buttons.className = \"dg-btns\";\n // 置いた頁の言葉と違っても、釦の名前を名前の言葉の声で読ませる\n buttons.setAttribute(\"lang\", lang);\n buttons.append(prevButton, toggleButton, nextButton);\n\n // 見える語り。読み上げには下の一覧を読ませるので、こちらは読み上げから隠す\n const say = doc.createElement(\"div\");\n say.className = \"dg-say\";\n say.setAttribute(\"aria-hidden\", \"true\");\n const no = doc.createElement(\"div\");\n no.className = \"dg-no\";\n no.dataset.dragon = \"step-no\";\n const text = doc.createElement(\"div\");\n text.className = \"dg-txt\";\n const title = doc.createElement(\"p\");\n title.className = \"dg-tt\";\n title.dataset.dragon = \"step-title\";\n const body = doc.createElement(\"p\");\n body.className = \"dg-tb\";\n body.dataset.dragon = \"step-body\";\n const live = doc.createElement(\"div\");\n live.append(title, body);\n text.append(live);\n // 全部の段の題と本文の写しを今の段と同じ升に重ね、見た目からは隠して場所だけを取る。\n // 帯の高さが本文の最も長い段で決まり、段を送っても図の枠が伸び縮みしない (#3049)\n for (const step of steps) {\n const room = doc.createElement(\"div\");\n room.className = \"dg-room\";\n room.dataset.dragon = \"caption-room\";\n const roomTitle = doc.createElement(\"p\");\n roomTitle.className = \"dg-tt\";\n roomTitle.textContent = step.title;\n const roomBody = doc.createElement(\"p\");\n roomBody.className = \"dg-tb\";\n roomBody.textContent = step.body;\n room.append(roomTitle, roomBody);\n text.append(room);\n }\n say.append(no, text);\n // 狭い帯では語りの箱を外して番号と題と本文を釦と同じ升の並びに置く (#3057)。\n // 箱を外した要素の読み上げからの隠し方に頼らず、見える語りの 1 つずつも読み上げから隠す\n for (const shown of [no, title, body]) shown.setAttribute(\"aria-hidden\", \"true\");\n const row = doc.createElement(\"div\");\n row.className = \"dg-row\";\n row.append(buttons, say);\n const bar = doc.createElement(\"div\");\n bar.className = \"dg-bar\";\n bar.append(row);\n\n // 読み上げの道具が段の順に読む一覧。見た目からは外すが、読み上げからは隠さない。\n // 段の出典は本文の後ろに、名前を URL への link にして書いた順に並べる (#3199)\n const list = doc.createElement(\"ol\");\n list.className = \"dg-sr\";\n list.dataset.dragon = \"steps\";\n list.setAttribute(\"aria-label\", words.steps(rendered.diagram.title));\n for (const step of steps) {\n const item = doc.createElement(\"li\");\n const head = doc.createElement(\"strong\");\n head.textContent = step.title;\n item.append(head);\n for (const line of step.body.split(\"\\n\")) {\n const p = doc.createElement(\"p\");\n p.textContent = line;\n item.append(p);\n }\n if (step.sources) {\n const sources = doc.createElement(\"ul\");\n for (const source of step.sources) {\n const link = doc.createElement(\"a\");\n link.href = source.url;\n link.textContent = source.name;\n const entry = doc.createElement(\"li\");\n entry.append(link);\n sources.append(entry);\n }\n item.append(sources);\n }\n list.append(item);\n }\n\n root.append(frame, bar, list);\n host.append(root);\n\n const frameWidth = (): number => frame.clientWidth || host.clientWidth || rendered.layout.width;\n /** 高さに収めると頼まれた時だけ、図の枠の中で見える高さ (上下の余白を除く)。測れない時は `undefined` で、幅だけで決める */\n const frameHeight = (): number | undefined => {\n if (!options.fitHeight || !win) return undefined;\n const style = win.getComputedStyle(frame);\n const inner = frame.clientHeight - (Number.parseFloat(style.paddingTop) || 0) - (Number.parseFloat(style.paddingBottom) || 0);\n return inner > 0 ? inner : undefined;\n };\n let mode = chooseView(rendered, frameWidth(), frameHeight()).mode;\n let width = frameWidth();\n let height = frameHeight();\n let svg: SVGSVGElement | null = null;\n // 止めて置く段を渡された図は、動きを嫌う人と同じく止め絵で置く\n let step = options.pausedAt === undefined ? 0 : Math.min(count - 1, Math.max(0, options.pausedAt));\n let playing = !reduce && options.pausedAt === undefined;\n let at = playing ? 0 : (timeline.stills[step] ?? 0);\n /** 1 度だけ流す図が止まる時刻 (最後の段の止め絵) */\n const lastStill = timeline.stills[count - 1] ?? 0;\n let born = Date.now();\n let marked: readonly Rect[] = [];\n\n /**\n * 渡された四角を点線で囲む。寄って追う図では窓の中身と一緒に動く所に置き、止めて見せる図では図の上に置く。\n * 囲みは字の四角より `LOOK.mark.pad` だけ広げ、字の縁に線が掛からないようにする\n */\n const drawMarks = (): void => {\n if (!svg) return;\n for (const old of svg.querySelectorAll(\".dg-spots\")) old.remove();\n if (marked.length === 0) return;\n const M = LOOK.mark;\n const group = doc.createElementNS(SVG_NS, \"g\");\n group.setAttribute(\"class\", \"dg-spots\");\n for (const r of marked) {\n const rect = doc.createElementNS(SVG_NS, \"rect\");\n rect.setAttribute(\"class\", \"dg-spot\");\n rect.setAttribute(\"x\", String(r.x - M.pad));\n rect.setAttribute(\"y\", String(r.y - M.pad));\n rect.setAttribute(\"width\", String(r.w + M.pad * 2));\n rect.setAttribute(\"height\", String(r.h + M.pad * 2));\n rect.setAttribute(\"rx\", String(M.radius));\n group.append(rect);\n }\n (svg.querySelector('g[clip-path^=\"url(#dg-vp-\"] > g.dg-a') ?? svg).append(group);\n };\n\n /** 動きの変数を付けた図を置き直す。置き直すと動きの時計が最初から数え直される */\n const place = (markup?: string): void => {\n let next: SVGSVGElement | null;\n if (markup !== undefined) {\n const holder = doc.createElement(\"div\");\n holder.innerHTML = markup;\n next = holder.querySelector(\"svg\");\n } else {\n next = svg ? (svg.cloneNode(true) as SVGSVGElement) : null;\n }\n if (!next) return;\n next.setAttribute(\"aria-hidden\", \"true\");\n next.removeAttribute(\"role\");\n next.removeAttribute(\"aria-label\");\n next.style.setProperty(\"--at\", String(at));\n next.style.setProperty(\"--play\", playing ? \"running\" : \"paused\");\n next.dataset.motion = playing ? \"play\" : \"still\";\n if (svg) svg.replaceWith(next);\n else frame.append(next);\n svg = next;\n born = Date.now();\n drawMarks();\n };\n const markup = (): string => (mode === \"follow\" ? drawSvg(rendered.diagram, rendered.layout, timeline, palette, rendered.theme, { width, ...(height === undefined ? {} : { height }), lang }) : rendered.svg);\n\n const now = (): number => (playing ? (at + (Date.now() - born) / 1000) % timeline.total : at);\n const stepAt = (t: number): number => {\n let found = 0;\n timeline.steps.forEach((span: Span, i) => {\n if (span.start <= t) found = i;\n });\n return found;\n };\n const show = (): void => {\n const current = steps[step];\n no.textContent = stepNo(step, count);\n title.textContent = current?.title ?? \"\";\n body.textContent = current?.body ?? \"\";\n toggleButton.setAttribute(\"aria-label\", playing ? words.pause : words.play);\n toggleButton.textContent = playing ? BUTTON_TEXT.pause : BUTTON_TEXT.play;\n options.onStep?.(step);\n };\n const restart = (t: number, play: boolean): void => {\n at = t;\n playing = play;\n place();\n show();\n };\n const go = (target: number): void => {\n step = Math.min(count - 1, Math.max(0, target));\n const span = timeline.steps[step] as Span;\n restart(playing ? span.start : (timeline.stills[step] ?? span.start), playing);\n };\n\n /** 流し始める。1 度だけ流す図が最後の段の止め絵まで来ていれば、最初の段から流し直す */\n const resume = (): void => {\n if (options.playOnce && at >= lastStill) {\n step = 0;\n at = 0;\n }\n restart(at, true);\n };\n\n place(markup());\n show();\n\n const timer = win?.setInterval(() => {\n if (!playing) return;\n // 1 度だけ流す図は、1 周の中の時刻に直す前の経った時間で最後の段の止め絵まで来たかを見る\n if (options.playOnce && at + (Date.now() - born) / 1000 >= lastStill) {\n step = count - 1;\n restart(lastStill, false);\n return;\n }\n const s = stepAt(now());\n if (s !== step) {\n step = s;\n show();\n }\n }, 120);\n const onPrev = (): void => go(step - 1);\n const onNext = (): void => go(step + 1);\n const onToggle = (): void => (playing ? restart(now(), false) : resume());\n // 段の番号を押すとその段へ移る\n const onFigure = (event: Event): void => {\n const target = (event.target as Element | null)?.closest?.(\"[data-step]\");\n const s = target ? Number(target.getAttribute(\"data-step\")) : Number.NaN;\n if (Number.isInteger(s)) go(s);\n };\n prevButton.addEventListener(\"click\", onPrev);\n nextButton.addEventListener(\"click\", onNext);\n toggleButton.addEventListener(\"click\", onToggle);\n frame.addEventListener(\"click\", onFigure);\n\n // 枠の大きさが変わったら見せ方を選び直す。寄って追う窓は幅 (高さに収める時は高さも) で決まるので、変われば描き直す\n const Observer = (win as (Window & { ResizeObserver?: typeof ResizeObserver }) | null)?.ResizeObserver;\n const observer = Observer\n ? new Observer(() => {\n const w = frameWidth();\n const h = frameHeight();\n const chosen = chooseView(rendered, w, h).mode;\n if (chosen === mode && (mode === \"fixed\" || (w === width && h === height))) return;\n const t = now();\n mode = chosen;\n width = w;\n height = h;\n at = t;\n place(markup());\n })\n : undefined;\n observer?.observe(frame);\n\n return {\n get step() {\n return step;\n },\n get playing() {\n return playing;\n },\n next: onNext,\n prev: onPrev,\n play: () => {\n if (!playing) resume();\n },\n pause: () => {\n if (playing) restart(now(), false);\n },\n goTo: (target: number) => {\n playing = false;\n go(target);\n },\n mark: (rects: readonly Rect[]) => {\n marked = rects;\n drawMarks();\n },\n destroy: () => {\n if (timer !== undefined) win?.clearInterval(timer);\n observer?.disconnect();\n prevButton.removeEventListener(\"click\", onPrev);\n nextButton.removeEventListener(\"click\", onNext);\n toggleButton.removeEventListener(\"click\", onToggle);\n frame.removeEventListener(\"click\", onFigure);\n root.remove();\n },\n };\n}\n","/**\n * dragon の軽い入口 (`@cardenelabs/dragon/light`、#3248)。\n *\n * 既定の入口と同じ部品を出すが、git、lineup、state、time、tree の描く部品を持たず、`loadKind` を待った時に読む。\n * 読んだ後は既定の入口と同じ関数で、待たずに同じ図を描く。読んでいない種類を描くと、その種類の名前を含む誤りで止まる。\n * 最初に読む量を抑えたい頁を束ねる時に使い、この入口と既定の入口を 1 つの頁で混ぜない (混ぜると全ての部品が頁に入る)。\n */\nimport { kindLoaded, LATER_KINDS, type LaterKind, type LaterKinds, registerKind } from \"./kinds/registry\";\n\nexport * from \"./api\";\nexport { kindLoaded, LATER_KINDS, type LaterKind };\n\nconst LOADERS: { [K in LaterKind]: () => Promise<LaterKinds[K]> } = {\n git: () => import(\"./kinds/git\"),\n lineup: () => import(\"./kinds/lineup\"),\n state: () => import(\"./kinds/state\"),\n time: () => import(\"./kinds/time\"),\n tree: () => import(\"./kinds/tree\"),\n};\n\nconst isLater = (kind: string | undefined): kind is LaterKind => (LATER_KINDS as readonly (string | undefined)[]).includes(kind);\n\n/** 種類の描く部品を読む。時系列図と構成図は初めから持つので何もしない。読み込みが落ちると拒否され、次に呼ぶと読み直す */\nexport async function loadKind(kind: string | undefined): Promise<void> {\n if (!isLater(kind) || kindLoaded(kind)) return;\n await register(kind);\n}\n\nasync function register<K extends LaterKind>(kind: K): Promise<void> {\n registerKind(kind, await LOADERS[kind]());\n}\n"]}
|