@cardenelabs/dragon 0.75.0 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.ja.md +2 -2
  2. package/README.md +2 -2
  3. package/dist/cdn/dragon-main.js +1 -1
  4. package/dist/cdn/dragon.js +1 -1
  5. package/dist/cdn/{framed-AKGEB6S4.js → framed-EY7MCXO5.js} +10 -11
  6. package/dist/cdn/framed-EY7MCXO5.js.map +1 -0
  7. package/dist/cli.cjs +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/embed.cjs +16 -16
  10. package/dist/embed.cjs.map +1 -1
  11. package/dist/embed.js +16 -16
  12. package/dist/embed.js.map +1 -1
  13. package/dist/frame.cjs +16 -16
  14. package/dist/frame.cjs.map +1 -1
  15. package/dist/frame.js +16 -16
  16. package/dist/frame.js.map +1 -1
  17. package/dist/header.cjs +16 -16
  18. package/dist/header.cjs.map +1 -1
  19. package/dist/header.d.cts +4 -1
  20. package/dist/header.d.ts +4 -1
  21. package/dist/header.js +16 -16
  22. package/dist/header.js.map +1 -1
  23. package/dist/light/chart-X3JZXB7X.cjs.map +1 -1
  24. package/dist/light/checkout-ID7EXZKS.cjs.map +1 -1
  25. package/dist/light/chunk-2UIJLZQS.cjs.map +1 -1
  26. package/dist/light/chunk-32F5LGYM.cjs.map +1 -1
  27. package/dist/light/chunk-37YJVHKU.cjs.map +1 -1
  28. package/dist/light/chunk-3K7HXFGU.cjs.map +1 -1
  29. package/dist/light/chunk-3N6XGWY3.cjs.map +1 -1
  30. package/dist/light/chunk-3WNASQ4F.cjs.map +1 -1
  31. package/dist/light/chunk-5TGDO7AR.cjs.map +1 -1
  32. package/dist/light/chunk-5YBLDLYL.cjs.map +1 -1
  33. package/dist/light/chunk-BQ224M6S.cjs.map +1 -1
  34. package/dist/light/chunk-BZJAJNOY.cjs.map +1 -1
  35. package/dist/light/chunk-CHBS42VR.cjs.map +1 -1
  36. package/dist/light/chunk-CSY2M2ZF.cjs.map +1 -1
  37. package/dist/light/chunk-CY365UJL.cjs.map +1 -1
  38. package/dist/light/chunk-D6AWLCS4.cjs.map +1 -1
  39. package/dist/light/chunk-EFPTGCUT.cjs.map +1 -1
  40. package/dist/light/chunk-EGEJ2PZU.cjs.map +1 -1
  41. package/dist/light/chunk-FQ6EHQI4.cjs.map +1 -1
  42. package/dist/light/chunk-FXUL4JF7.cjs.map +1 -1
  43. package/dist/light/chunk-H64H2OY3.cjs.map +1 -1
  44. package/dist/light/chunk-H7GHG4MU.cjs.map +1 -1
  45. package/dist/light/chunk-HBMD7U4E.cjs.map +1 -1
  46. package/dist/light/chunk-IV4QO6S3.cjs.map +1 -1
  47. package/dist/light/chunk-J7WOLGM5.cjs.map +1 -1
  48. package/dist/light/chunk-JYWZ6CXU.cjs.map +1 -1
  49. package/dist/light/chunk-LFGJVSUY.cjs.map +1 -1
  50. package/dist/light/chunk-LFVA44T7.cjs.map +1 -1
  51. package/dist/light/chunk-M3OG3EO4.cjs.map +1 -1
  52. package/dist/light/chunk-MVELFHAA.cjs.map +1 -1
  53. package/dist/light/chunk-MVFMWHCG.cjs.map +1 -1
  54. package/dist/light/chunk-OBDQYQW7.cjs.map +1 -1
  55. package/dist/light/chunk-OLBWXQAN.cjs.map +1 -1
  56. package/dist/light/chunk-P5OAASO6.cjs.map +1 -1
  57. package/dist/light/chunk-QWPVCX5A.cjs.map +1 -1
  58. package/dist/light/chunk-S42M54IW.cjs.map +1 -1
  59. package/dist/light/chunk-TMHQNQRC.cjs.map +1 -1
  60. package/dist/light/chunk-TMXS76EN.cjs.map +1 -1
  61. package/dist/light/chunk-TZMBIKGJ.cjs.map +1 -1
  62. package/dist/light/chunk-UHJDQGMN.cjs.map +1 -1
  63. package/dist/light/chunk-UN6WQLU7.cjs.map +1 -1
  64. package/dist/light/chunk-UZNIABQO.cjs.map +1 -1
  65. package/dist/light/chunk-WGR7LOJZ.cjs.map +1 -1
  66. package/dist/light/chunk-YALPCSWW.cjs.map +1 -1
  67. package/dist/light/chunk-YJXF2J5R.cjs.map +1 -1
  68. package/dist/light/chunk-ZXX3TUJF.cjs.map +1 -1
  69. package/dist/light/cycle-2XACC564.cjs.map +1 -1
  70. package/dist/light/er-NNOIUAMN.cjs.map +1 -1
  71. package/dist/light/flow-77MQIZTE.cjs.map +1 -1
  72. package/dist/light/git-I2U4X7BH.cjs.map +1 -1
  73. package/dist/light/index.cjs.map +1 -1
  74. package/dist/light/lineup-UIGE4OTC.cjs.map +1 -1
  75. package/dist/light/matrix-G5LWGZLA.cjs.map +1 -1
  76. package/dist/light/mind-NZ2UZGRU.cjs.map +1 -1
  77. package/dist/light/pen-YKT3AQG2.cjs.map +1 -1
  78. package/dist/light/pipe-EZX6P3SM.cjs.map +1 -1
  79. package/dist/light/read-2CDK5L23.cjs.map +1 -1
  80. package/dist/light/read-2F2544RV.cjs.map +1 -1
  81. package/dist/light/read-2YW4EIPG.cjs.map +1 -1
  82. package/dist/light/read-4IVGQSSQ.cjs.map +1 -1
  83. package/dist/light/read-4JAHWXJD.cjs.map +1 -1
  84. package/dist/light/read-56LAPGCZ.cjs.map +1 -1
  85. package/dist/light/read-57SWS5FY.cjs.map +1 -1
  86. package/dist/light/read-5KBTP6Z2.cjs.map +1 -1
  87. package/dist/light/read-5MWEQRHC.cjs.map +1 -1
  88. package/dist/light/read-5ZM54K75.cjs.map +1 -1
  89. package/dist/light/read-6OB5GZL6.cjs.map +1 -1
  90. package/dist/light/read-6VFJHLUY.cjs.map +1 -1
  91. package/dist/light/read-7JCTPQRN.cjs.map +1 -1
  92. package/dist/light/read-7NMMPDOJ.cjs.map +1 -1
  93. package/dist/light/read-7VURJ7JH.cjs.map +1 -1
  94. package/dist/light/read-A6UKZDB6.cjs.map +1 -1
  95. package/dist/light/read-BLY7FGW6.cjs.map +1 -1
  96. package/dist/light/read-CX4OJNA5.cjs.map +1 -1
  97. package/dist/light/read-DNOQGGAA.cjs.map +1 -1
  98. package/dist/light/read-FQODA66G.cjs.map +1 -1
  99. package/dist/light/read-FVJ2ZANC.cjs.map +1 -1
  100. package/dist/light/read-GNDJBICD.cjs.map +1 -1
  101. package/dist/light/read-GPICB7EV.cjs.map +1 -1
  102. package/dist/light/read-HLQ3O2EY.cjs.map +1 -1
  103. package/dist/light/read-IQ4ZDMXU.cjs.map +1 -1
  104. package/dist/light/read-IYADDI7P.cjs.map +1 -1
  105. package/dist/light/read-JAJQAMTT.cjs.map +1 -1
  106. package/dist/light/read-JXQCAGVB.cjs.map +1 -1
  107. package/dist/light/read-KHKBGDMH.cjs.map +1 -1
  108. package/dist/light/read-KHMI7BLQ.cjs.map +1 -1
  109. package/dist/light/read-KNIKCAD7.cjs.map +1 -1
  110. package/dist/light/read-MHJORRLJ.cjs.map +1 -1
  111. package/dist/light/read-NGRLYO4J.cjs.map +1 -1
  112. package/dist/light/read-NJVQ56VB.cjs.map +1 -1
  113. package/dist/light/read-NNUDMZ5Y.cjs.map +1 -1
  114. package/dist/light/read-OPPCTEVP.cjs.map +1 -1
  115. package/dist/light/read-P6RYSGSC.cjs.map +1 -1
  116. package/dist/light/read-PZ7HUBUD.cjs.map +1 -1
  117. package/dist/light/read-QLVXA2AM.cjs.map +1 -1
  118. package/dist/light/read-R7QDGI3Z.cjs.map +1 -1
  119. package/dist/light/read-RR7DTA7C.cjs.map +1 -1
  120. package/dist/light/read-TMVI3SFD.cjs.map +1 -1
  121. package/dist/light/read-TZOSUG56.cjs.map +1 -1
  122. package/dist/light/read-UHJ2PWRC.cjs.map +1 -1
  123. package/dist/light/read-VC2A7LYL.cjs.map +1 -1
  124. package/dist/light/read-VDD66HHL.cjs.map +1 -1
  125. package/dist/light/read-W3LCBM2A.cjs.map +1 -1
  126. package/dist/light/read-XCSEQMMC.cjs.map +1 -1
  127. package/dist/light/read-XDZ73ZUX.cjs.map +1 -1
  128. package/dist/light/read-Z3ORGJSL.cjs.map +1 -1
  129. package/dist/light/read-ZHAWKO6J.cjs.map +1 -1
  130. package/dist/light/read-ZYXLIU6T.cjs.map +1 -1
  131. package/dist/light/sankey-NVGFOYYU.cjs.map +1 -1
  132. package/dist/light/state-2EJKP54B.cjs.map +1 -1
  133. package/dist/light/tabler-P2VVGLOL.cjs.map +1 -1
  134. package/dist/light/time-DRE3GJEU.cjs.map +1 -1
  135. package/dist/light/tree-GGBX3XAZ.cjs.map +1 -1
  136. package/dist/light/try-OV4XRYFL.cjs.map +1 -1
  137. package/dist/light/user-blocks-read-VCJ2URDT.cjs.map +1 -1
  138. package/dist/light/validator-CFJGBSZW.cjs.map +1 -1
  139. package/dist/light/venn-TW7FTGME.cjs.map +1 -1
  140. package/package.json +12 -13
  141. package/src/frame/header.mjs +15 -13
  142. package/src/frame/header.ts +4 -1
  143. package/dist/cdn/framed-AKGEB6S4.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/cardene/Desktop/projects/dragon-3711-release-0-75-0/packages/dragon/dist/light/checkout-ID7EXZKS.cjs","../../src/kinds/checkout/layout.ts","../../src/checkout/blocks/party.ts","../../src/checkout/blocks/product.ts","../../src/checkout/blocks/delivery.ts","../../src/checkout/blocks/option.ts","../../src/checkout/blocks/budget.ts","../../src/checkout/blocks/total.ts","../../src/checkout/blocks/approval.ts","../../src/checkout/blocks/payment.ts","../../src/checkout/blocks/order.ts","../../src/checkout/blocks/scenario.ts","../../src/checkout/blocks/flow.ts","../../src/checkout/blocks/index.ts","../../src/checkout/read.ts","../../src/checkout/definition.ts","../../src/checkout/model.mjs","../../src/checkout/template.ts","../../src/checkout/skin.ts","../../src/checkout/runtime.mjs","../../src/kinds/checkout.ts"],"names":["b","product","delivery"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B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AChG,IAAA;AACuB,IAAA;AAChB,IAAA;AACT,EAAA;AACF;ApB0rCoK;AACA;AACA","file":"/Users/cardene/Desktop/projects/dragon-3711-release-0-75-0/packages/dragon/dist/light/checkout-ID7EXZKS.cjs","sourcesContent":[null,"import type { DiagramModel } from \"../../schema\";\nimport type { Layout, SceneBox } from \"../../layout/scene\";\nimport type { KindOptions } from \"../parts\";\nimport type { NotationLang } from \"../../words\";\nexport type PurchaseLayout = Layout & { overlay?: boolean };\nexport const CHECKOUT_MARKER = \"data-checkout-flow\";\nexport function layoutCheckout(diagram: DiagramModel, _lang: NotationLang, options: KindOptions): PurchaseLayout {\n const width = options.anchors ? Math.max(...Object.values(options.anchors).map(r=>r.x+r.w)) : Math.max(880, options.width ?? 960);\n const gap = options.anchors ? (width < 600 ? 18 : 36) : 64;\n const w = Math.min(160, (width - gap * 3) / 4);\n const boxes: SceneBox[] = diagram.boxes.map((b,i) => {\n const r = options.anchors?.[b.id] ?? { x: (width - 4*w - 3*gap)/2 + i*(w+gap), y:12, w, h:108 };\n return { ...b,...r, color:\"green\", cx:r.x+r.w/2, cy:r.y+r.h/2 };\n });\n const edges = diagram.steps.flatMap((s,step) => s.events.flatMap((e,event) => {\n if (e.type !== \"edge\") return [];\n const a=boxes.find(b=>b.id===e.from)!, b=boxes.find(b=>b.id===e.to)!;\n const dir=b.x>a.x?1:-1;\n const port = options.anchors ? 4 : 20;\n const depart = options.anchors ? 3 : port;\n return [{ step,event,from:e.from,to:e.to,carry:e.carry,color:\"green\" as const,\n points:[[dir>0?a.x+a.w+depart:a.x-depart,a.cy],[dir>0?b.x-port:b.x+b.w+port,b.cy]] as [number,number][] }];\n }));\n return {kind:\"checkout\",width,height:Math.max(...boxes.map(b=>b.y+b.h))+(options.overlay?0:12),boxes,edges,overlay:options.overlay,\n regions:[],lifelines:[],labels:[],actions:[],badges:[],paths:[],ends:[]};\n}\n","import type { BlockRule } from \"./index\";\n\nexport const party = {\n \"name\": \"party\",\n \"min\": 4,\n \"max\": 4,\n \"fields\": {\n \"role\": {\n \"required\": true,\n \"values\": [\n \"buyer\",\n \"agent\",\n \"seller\",\n \"payment\"\n ]\n },\n \"note\": {\n \"default\": \"\"\n },\n \"icon\": {\n \"default\": \"bag\",\n \"values\": [\n \"user\",\n \"agent\",\n \"shop\",\n \"card\",\n \"bolt\",\n \"truck\",\n \"bag\",\n \"lock\",\n \"check\",\n \"refresh\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const product = {\n \"name\": \"product\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"price\": {\n \"number\": true,\n \"required\": true\n },\n \"min\": {\n \"number\": true,\n \"default\": \"1\"\n },\n \"max\": {\n \"number\": true,\n \"default\": \"3\"\n },\n \"initial\": {\n \"number\": true,\n \"default\": \"1\"\n },\n \"unit\": {\n \"required\": true\n },\n \"merchant\": {\n \"required\": true\n },\n \"art\": {\n \"default\": \"none\",\n \"values\": [\n \"none\",\n \"shoe\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const delivery = {\n \"name\": \"delivery\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"initial\": {\n \"required\": true\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const option = {\n \"name\": \"option\",\n \"min\": 1,\n \"max\": 6,\n \"fields\": {\n \"for\": {\n \"required\": true\n },\n \"fee\": {\n \"number\": true,\n \"required\": true\n },\n \"note\": {\n \"default\": \"\"\n },\n \"icon\": {\n \"default\": \"bag\",\n \"values\": [\n \"user\",\n \"agent\",\n \"shop\",\n \"card\",\n \"bolt\",\n \"truck\",\n \"bag\",\n \"lock\",\n \"check\",\n \"refresh\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const budget = {\n \"name\": \"budget\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"min\": {\n \"number\": true,\n \"required\": true\n },\n \"max\": {\n \"number\": true,\n \"required\": true\n },\n \"step\": {\n \"number\": true,\n \"required\": true\n },\n \"initial\": {\n \"number\": true,\n \"required\": true\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const total = {\n \"name\": \"total\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"product\": {\n \"required\": true\n },\n \"delivery\": {\n \"required\": true\n },\n \"rule\": {\n \"required\": true,\n \"values\": [\n \"price * quantity + fee\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const approval = {\n \"name\": \"approval\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"total\": {\n \"required\": true\n },\n \"invalidates\": {\n \"required\": true,\n \"values\": [\n \"quantity, delivery\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const payment = {\n \"name\": \"payment\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"approval\": {\n \"required\": true\n },\n \"limit\": {\n \"required\": true,\n \"values\": [\n \"approved-total\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const order = {\n \"name\": \"order\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"payment\": {\n \"required\": true\n },\n \"policy\": {\n \"required\": true,\n \"values\": [\n \"once\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const scenario = {\n \"name\": \"scenario\",\n \"min\": 3,\n \"max\": 3,\n \"fields\": {\n \"outcome\": {\n \"required\": true,\n \"values\": [\n \"normal\",\n \"decline\",\n \"lost\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const flow = {\n \"name\": \"flow\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"buyer\": {\n \"required\": true\n },\n \"agent\": {\n \"required\": true\n },\n \"seller\": {\n \"required\": true\n },\n \"payment\": {\n \"required\": true\n },\n \"wire\": {\n \"required\": true,\n \"values\": [\n \"horizontal\"\n ]\n },\n \"carry\": {\n \"required\": true,\n \"values\": [\n \"message\"\n ]\n }\n }\n} satisfies BlockRule;\n","import { party } from \"./party\";\nimport { product } from \"./product\";\nimport { delivery } from \"./delivery\";\nimport { option } from \"./option\";\nimport { budget } from \"./budget\";\nimport { total } from \"./total\";\nimport { approval } from \"./approval\";\nimport { payment } from \"./payment\";\nimport { order } from \"./order\";\nimport { scenario } from \"./scenario\";\nimport { flow } from \"./flow\";\n\nexport interface FieldRule { required?: boolean; default?: string; values?: readonly string[]; number?: boolean }\nexport interface BlockRule { name: string; min: number; max: number; fields: Readonly<Record<string, FieldRule>> }\nexport const CHECKOUT_BLOCKS: readonly BlockRule[] = [party, product, delivery, option, budget, total, approval, payment, order, scenario, flow];\n","import { messagesFor } from \"../messages\";\nimport { fail, NotationError, readDeclared } from \"../read-kit\";\nimport { isBlankOrComment, tokenize, type SourceLine } from \"../tokenize\";\nimport { CHECKOUT_BLOCKS, type BlockRule } from \"./blocks\";\nexport const MAX_CHECKOUT_LINES = 10000;\n\nexport interface CheckoutBlock {\n kind: string;\n id: string;\n name: string;\n options: Readonly<Record<string, string>>;\n line: number;\n}\nexport interface CheckoutDefinition {\n format: 1;\n kind: \"checkout\";\n id: string;\n title: string;\n note: string;\n blocks: readonly CheckoutBlock[];\n}\nexport type ReadCheckout = { ok: true; definition: CheckoutDefinition } | { ok: false; errors: { line: number; column: number; message: string }[] };\n\nexport function isCheckoutNotation(text: string): boolean {\n const head = tokenize(text).find((line) => !isBlankOrComment(line));\n return head?.text.startsWith(\"checkout \") ?? false;\n}\n\n/** 購入の操作図。数式と規則は列挙した値だけを受け付け、入力をコードとして実行しない。 */\nexport function parseCheckout(text: string): ReadCheckout {\n if (text.split('\\n').length > MAX_CHECKOUT_LINES) return {ok:false,errors:[{line:1,column:1,message:`checkout source line limit is ${MAX_CHECKOUT_LINES}`} ]};\n const lines = tokenize(text).filter((line) => !isBlankOrComment(line));\n const head = lines[0];\n if (!head) return { ok: false, errors: [{ line: 1, column: 1, message: \"checkout の定義がありません\" }] };\n const m = messagesFor(\"ja\");\n const check = (condition: unknown, source: SourceLine, message: string): void => { if (!condition) throw fail(source, 0, message); };\n try {\n check(head.text.startsWith(\"checkout \"), head, \"checkout <id> as <題> [version: 1] で始めます\");\n const title = readDeclared(head, \"checkout\", [\"version\", \"note\"], m);\n check(title.attrs.get(\"version\")?.value === \"1\", head, \"checkout の version は 1 を指定します\");\n check(Boolean(title.name), head, \"checkout の題を as の後に書きます\");\n const blocks: CheckoutBlock[] = [];\n const ids = new Set<string>();\n for (const source of lines.slice(1)) {\n const word = source.text.split(/\\s/u)[0] ?? \"\";\n const rule: BlockRule | undefined = CHECKOUT_BLOCKS.find((part) => part.name === word);\n check(rule, source, `購入の操作図で使えないブロックです: ${word}`);\n if (!rule) continue;\n const read = readDeclared(source, word, Object.keys(rule.fields), m);\n check(/^[a-z][a-z0-9_-]{0,63}$/u.test(read.id), source, \"ブロックの id は小文字の英数字と - と _ で書きます\");\n check(!ids.has(read.id), source, `id が重複しています: ${read.id}`);\n ids.add(read.id);\n const options: Record<string, string> = {};\n for (const [key, field] of Object.entries(rule.fields)) {\n const value = read.attrs.get(key)?.value ?? field.default;\n check(value !== undefined || !field.required, source, `${word} に ${key} を指定します`);\n if (value === undefined) continue;\n check((value.length > 0 || !field.required) && value.length <= 256, source, `${key} は1〜256文字です`);\n if (field.values) check(field.values.includes(value), source, `${key} は ${field.values.join(\" / \")} から指定します`);\n if (field.number) check(/^\\d+$/u.test(value) && Number.isSafeInteger(Number(value)) && Number(value) <= 1000000000, source, `${key} は0〜1000000000の整数です`);\n options[key] = value;\n }\n check((read.name ?? read.id).length <= 80, source, \"表示名は80文字以内です\");\n blocks.push({ kind: word, id: read.id, name: read.name ?? read.id, options, line: source.line });\n }\n const sourceOf = (part: CheckoutBlock): SourceLine => lines.find((line) => line.line === part.line) ?? head;\n for (const rule of CHECKOUT_BLOCKS) {\n const count = blocks.filter((part) => part.kind === rule.name).length;\n check(count >= rule.min && count <= rule.max, head, `${rule.name} は ${rule.min}〜${rule.max} 個定義します`);\n }\n const one = (kind: string): CheckoutBlock => {\n const part = blocks.find((item) => item.kind === kind);\n if (!part) throw fail(head, 0, `${kind} がありません`);\n return part;\n };\n const ref = (part: CheckoutBlock, key: string, kind: string): CheckoutBlock => {\n const found = blocks.find((item) => item.id === part.options[key] && item.kind === kind);\n check(found, sourceOf(part), `${part.id}.${key} は ${kind} の id を指定します`);\n if (!found) throw fail(sourceOf(part), 0, \"参照先がありません\");\n return found;\n };\n const product = one(\"product\"), delivery = one(\"delivery\"), budget = one(\"budget\");\n check(Number(product.options.price) > 0, sourceOf(product), \"単価は1以上です\");\n check(Number(product.options.min) >= 1 && Number(product.options.min) <= Number(product.options.initial) && Number(product.options.initial) <= Number(product.options.max) && Number(product.options.max) <= 12, sourceOf(product), \"数量は 1 ≤ min ≤ initial ≤ max ≤ 12 にします\");\n check(Number(budget.options.min) <= Number(budget.options.initial) && Number(budget.options.initial) <= Number(budget.options.max) && Number(budget.options.min) < Number(budget.options.max), sourceOf(budget), \"予算は min ≤ initial ≤ max で、min < max にします\");\n const stride = Number(budget.options.step);\n check(stride > 0 && (Number(budget.options.max) - Number(budget.options.min)) % stride === 0 && (Number(budget.options.initial) - Number(budget.options.min)) % stride === 0, sourceOf(budget), \"予算の初期値と最大値を step の刻みに揃えます\");\n const options = blocks.filter((part) => part.kind === \"option\");\n for (const part of options) ref(part, \"for\", \"delivery\");\n check(options.some((part) => part.id === delivery.options.initial), sourceOf(delivery), \"配送の initial は option の id を指定します\");\n const total = one(\"total\"), approval = one(\"approval\"), payment = one(\"payment\"), order = one(\"order\"), flow = one(\"flow\");\n ref(total, \"product\", \"product\"); ref(total, \"delivery\", \"delivery\");\n ref(approval, \"total\", \"total\"); ref(payment, \"approval\", \"approval\"); ref(order, \"payment\", \"payment\");\n const parties = blocks.filter((part) => part.kind === \"party\");\n for (const role of [\"buyer\", \"agent\", \"seller\", \"payment\"]) {\n check(parties.filter((part) => part.options.role === role).length === 1, head, `party の role: ${role} を1つ定義します`);\n check(ref(flow, role, \"party\").options.role === role, sourceOf(flow), `flow の ${role} と party の role を揃えます`);\n }\n const cases = blocks.filter((part) => part.kind === \"scenario\");\n for (const outcome of [\"normal\", \"decline\", \"lost\"]) check(cases.filter((part) => part.options.outcome === outcome).length === 1, head, `scenario の outcome: ${outcome} を1つ定義します`);\n return { ok: true, definition: { format: 1, kind: \"checkout\", id: title.id, title: title.name ?? title.id, note: title.attrs.get(\"note\")?.value ?? \"\", blocks } };\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","import type { Diagram, DiagramModel } from \"../schema\";\nimport { MAX_CHECKOUT_LINES, parseCheckout, type CheckoutDefinition } from \"./read\";\n\nexport function definitionOf(diagram: Diagram): CheckoutDefinition {\n if (!diagram.checkout) throw new Error(\"Missing checkout definition\");\n return { ...diagram.checkout, blocks: Object.entries(diagram.blocks).filter(([key]) => key.startsWith(\"purchase-\")).flatMap(([, blocks]) => blocks as CheckoutDefinition[\"blocks\"]) };\n}\n\nexport function purchaseNotation(definition: CheckoutDefinition): string {\n for (const block of definition.blocks) {\n if (!Number.isSafeInteger(block.line) || block.line < 2 || block.line > MAX_CHECKOUT_LINES) throw new Error(`checkout block line must be an integer from 2 to ${MAX_CHECKOUT_LINES}`);\n }\n const attrs = (o: Readonly<Record<string,string>>) => Object.entries(o).map(([k,v]) => `${k}: ${JSON.stringify(v)}`).join(\", \");\n const lines = [`checkout ${definition.id} as ${JSON.stringify(definition.title)} [version: 1, note: ${JSON.stringify(definition.note)}]`];\n // Preserve source positions stored in the semantic blocks across notation/JSON round trips.\n for (const b of [...definition.blocks].sort((a,b) => a.line-b.line)) {\n while (lines.length < b.line-1) lines.push(\"\");\n lines.push(`${b.kind} ${b.id} as ${JSON.stringify(b.name)} [${attrs(b.options)}]`);\n }\n return lines.join(\"\\n\");\n}\n\nexport function validatePurchase(diagram: Diagram): string[] {\n try {\n const read = parseCheckout(purchaseNotation(definitionOf(diagram)));\n return read.ok ? [] : read.errors.map(e => e.message);\n } catch (error) { return [String(error)]; }\n}\n\nexport function modelOf(definition: CheckoutDefinition): DiagramModel {\n const parties = definition.blocks.filter(b => b.kind === \"party\");\n const boxes = parties.map(b => ({ id: b.id, name: b.name, sub: b.options.note, color: \"green\" as const }));\n const flow = definition.blocks.find(b => b.kind === \"flow\")!;\n const routes = [[flow.options.buyer!, flow.options.agent!], [flow.options.agent!, flow.options.seller!], [flow.options.seller!, flow.options.payment!]];\n return { version: 1, kind: \"checkout\", title: definition.title, checkout: definition, boxes,\n steps: [{ title: flow.name, body: definition.note, events: routes.map(([from,to]) => ({type: \"edge\" as const, from: from!, to: to!, carry: {kind:\"envelope\" as const} })) }] };\n}\n\n/** Kind-owned conversion keeps input-specific storage out of the common renderer. */\nexport function diagramOf(model: DiagramModel, version: number): Diagram {\n if (!model.checkout) throw new Error('Missing checkout definition');\n const {blocks: inputs, ...header} = model.checkout;\n const blocks: Record<`purchase-${string}`, import('./read').CheckoutBlock[]> = {};\n for (const block of inputs) (blocks[`purchase-${block.kind}`] ??= []).push(block);\n return {version,kind:'checkout',checkout:header,title:model.title,...(model.view ? {view:model.view} : {}),blocks,steps:model.steps};\n}\n\nexport function checkoutModel(diagram: Diagram): DiagramModel {\n return {...modelOf(definitionOf(diagram)),...(diagram.view ? {view:diagram.view} : {}),steps:diagram.steps};\n}\n\n","export function createCheckoutModel(definition) {\nconst part = kind => definition.blocks.find(block => block.kind === kind);\nconst PRODUCT = part('product');\nconst SHIPPING = part('delivery');\nconst QUANTITY = Object.fromEntries(['min','max','initial'].map(key => [key, Number(PRODUCT.options[key])]));\nconst BUDGET = Object.fromEntries(['min','max','step','initial'].map(key => [key, Number(part('budget').options[key])]));\nconst UNIT_PRICE = Number(PRODUCT.options.price);\nconst DELIVERY = Object.freeze(Object.fromEntries(definition.blocks.filter(block => block.kind === 'option').map(block => [block.id, { name: block.name, fee: Number(block.options.fee), note: block.options.note, icon: block.options.icon }])));\nconst PARTIES = Object.fromEntries(definition.blocks.filter(block => block.kind === 'party').map(block => [block.options.role, block]));\nconst locked = s => ['processing', 'unknown', 'reconciling', 'ordered'].includes(s.phase);\nconst quoted = (s, qty = s.qty, delivery = s.delivery) => ({\n revision: s.revision, qty, delivery, subtotal: UNIT_PRICE * qty,\n fee: DELIVERY[delivery].fee, total: UNIT_PRICE * qty + DELIVERY[delivery].fee,\n merchant: PRODUCT.options.merchant,\n});\nconst add = (s, actor, text) => {\n s.events = [...s.events, { actor, text, n: s.eventCount + 1 }].slice(-6);\n s.eventCount++;\n};\nconst resting = s => s.quote.total > s.budget ? 'over_budget' : s.approval ? 'approved' : 'ready';\n\nfunction initialState(session = 1) {\n const s = {\n session, revision: 1, qty: QUANTITY.initial, delivery: SHIPPING.options.initial, budget: BUDGET.initial,\n phase: 'over_budget', quote: null, approval: null, token: null,\n order: null, chargeCount: 0, attempt: 0, mode: 'normal',\n events: [], eventCount: 0, notice: '', invalidated: false, focus: 'agent',\n };\n s.quote = quoted(s);\n s.phase = resting(s);\n add(s, '販売事業者', `商品${UNIT_PRICE.toLocaleString('ja-JP')}円+送料${s.quote.fee.toLocaleString('ja-JP')}円。合計${s.quote.total.toLocaleString('ja-JP')}円を返しました。`);\n return s;\n}\n\nfunction approvalValid(s) {\n return Boolean(s.approval && s.phase !== 'quoting' &&\n s.approval.revision === s.quote.revision &&\n s.approval.total === s.quote.total && s.approval.total <= s.budget);\n}\n\n/** 説明用の購入モデル。通信、カード認証、課金は実行しない。 */\nfunction transition(previous, event) {\n if (event.type === 'RESET') return initialState(previous.session + 1);\n if (event.session !== undefined && event.session !== previous.session) return previous;\n const s = globalThis.structuredClone(previous);\n switch (event.type) {\n case 'FOCUS':\n if (!['buyer', 'agent', 'seller', 'payment'].includes(event.actor)) return previous;\n s.focus = event.actor;\n return s;\n case 'BUDGET': {\n if (locked(s)) return previous;\n const amount = Number(event.value);\n if (!Number.isFinite(amount) || amount < BUDGET.min || amount > BUDGET.max || (amount - BUDGET.min) % BUDGET.step !== 0) return previous;\n s.budget = amount;\n if (s.approval && s.approval.total > amount) {\n s.approval = null; s.token = null; s.invalidated = true;\n s.notice = '承認した金額より予算が低くなったため、前の承認は使えません。';\n }\n if (s.phase !== 'quoting') s.phase = resting(s);\n return s;\n }\n case 'TERMS': {\n if (locked(s)) return previous;\n const qty = event.qty ?? s.qty;\n const delivery = event.delivery ?? s.delivery;\n if (!Number.isInteger(qty) || qty < QUANTITY.min || qty > QUANTITY.max || !Object.hasOwn(DELIVERY, delivery)) return previous;\n if (qty === s.qty && delivery === s.delivery) return previous;\n s.invalidated = Boolean(s.approval) || s.invalidated;\n s.qty = qty; s.delivery = delivery; s.revision++;\n s.approval = null; s.token = null; s.phase = 'quoting';\n s.notice = s.invalidated ? '購入条件が変わったため、前の承認は使えません。' : '';\n return s;\n }\n case 'QUOTE_READY':\n if (s.phase !== 'quoting' || event.revision !== s.revision) return previous;\n s.quote = quoted(s); s.phase = resting(s);\n add(s, '販売事業者', `${DELIVERY[s.delivery].name}・${s.qty}${PRODUCT.options.unit}で再計算。最新の合計は${s.quote.total.toLocaleString('ja-JP')}円です。`);\n return s;\n case 'APPROVE':\n if (!['ready', 'declined'].includes(s.phase) || s.quote.total > s.budget) return previous;\n s.approval = { ...s.quote }; s.invalidated = false; s.notice = '';\n s.phase = 'approved';\n add(s, '購入者', `${s.quote.total.toLocaleString('ja-JP')}円・${DELIVERY[s.delivery].name}の条件を承認しました。`);\n return s;\n case 'REVOKE':\n if (locked(s) || !s.approval) return previous;\n s.approval = null; s.token = null; s.phase = resting(s);\n s.notice = '承認を取り消しました。購入するにはもう一度承認してください。';\n add(s, '購入者', '購入条件の承認を取り消しました。');\n return s;\n case 'MODE':\n if (locked(s) || !['normal', 'decline', 'lost'].includes(event.mode)) return previous;\n s.mode = event.mode;\n return s;\n case 'BUY':\n if (!['approved', 'declined'].includes(s.phase) || !approvalValid(s)) return previous;\n s.phase = 'processing'; s.attempt++; s.token = null; s.notice = '';\n add(s, 'エージェント', '承認済みの購入内容で支払い委任を要求しました。');\n return s;\n case 'TOKEN_READY':\n if (s.phase !== 'processing' || event.attempt !== s.attempt || s.token) return previous;\n s.token = { maxAmount: s.approval.total, merchant: s.quote.merchant, session: s.session };\n add(s, '決済事業者', `${s.token.merchant}・今回の購入・上限${s.token.maxAmount.toLocaleString('ja-JP')}円に限定したトークンを発行しました。`);\n return s;\n case 'SETTLE':\n if (s.phase !== 'processing' || event.attempt !== s.attempt || !s.token || !approvalValid(s)) return previous;\n if (s.token.maxAmount !== s.quote.total || s.token.session !== s.session || s.token.merchant !== s.quote.merchant) return previous;\n if (s.mode === 'decline') {\n s.phase = 'declined'; s.token = null;\n add(s, '決済事業者', '決済を拒否しました。注文は作成されていません。');\n return s;\n }\n s.chargeCount++;\n s.order = { number: `DEMO-${String(s.session).padStart(3, '0')}`, ...s.quote };\n s.phase = s.mode === 'lost' ? 'unknown' : 'ordered';\n add(s, '販売事業者', `${s.order.total.toLocaleString('ja-JP')}円の決済成功を確認し、注文を1件作成しました。`);\n if (s.mode === 'lost') add(s, 'エージェント', '注文完了の応答が届かず、購入結果を確認できません。');\n else add(s, 'エージェント', '成立した注文を購入者へ伝えました。');\n return s;\n case 'RECONCILE_START':\n if (s.phase !== 'unknown' || !s.order) return previous;\n s.phase = 'reconciling';\n add(s, 'エージェント', '同じ購入の最新状態を販売事業者に問い合わせています。');\n return s;\n case 'RECONCILE':\n if (!['unknown', 'reconciling'].includes(s.phase) || !s.order) return previous;\n s.phase = 'ordered';\n add(s, 'エージェント', '同じ購入の最新状態を取得しました。既存の注文を確認し、追加の決済はしていません。');\n return s;\n default:\n return previous;\n }\n}\n\nfunction viewOf(s) {\n const pending = s.phase === 'quoting';\n const approved = approvalValid(s);\n const gap = s.budget - s.quote.total;\n const lockedInputs = locked(s);\n const titles = {\n over_budget: ['送料を含めると予算を超えています', '配送方法や数量を変えるか、予算を調整してください。'],\n quoting: ['販売事業者が購入条件を再計算しています', '変更を販売事業者に伝えました。最新の購入条件が返るのを待っています。'],\n ready: [s.invalidated ? '条件が変わりました。もう一度承認してください' : '予算内です。購入はまだ確定していません', '合計と配送方法を確認して、この条件で購入するか決めてください。'],\n approved: ['購入者がこの条件を承認しました', '支払いの上限は今回承認した金額です。'],\n processing: [s.token ? '承認した範囲で決済を処理しています' : 'この購入に限った支払いを準備しています', '購入の仕組みを説明するための処理です。実際の課金は行いません。'],\n declined: ['決済が拒否されました。注文はありません', '購入条件の承認と決済の成功は別です。上のケースを切り替えて再度試せます。'],\n unknown: ['購入結果をまだ確認できません', '店側では注文が作成済みです。新たに購入を送り直さず、同じ購入の状態を確認してください。'],\n reconciling: ['販売事業者に注文の結果を確認しています', '同じ購入の最新状態を問い合わせています。決済は繰り返しません。'],\n ordered: ['購入条件の確認から注文成立まで進みました', '注文は1件です。購入の完了と発送・配達の完了は別です。'],\n };\n return { pending, approved, gap, lockedInputs, title: titles[s.phase][0], description: titles[s.phase][1],\n canApprove: !lockedInputs && !pending && !approved && gap >= 0,\n canBuy: !lockedInputs && !pending && approved,\n };\n}\n\nreturn { UNIT_PRICE, DELIVERY, QUANTITY, BUDGET, PRODUCT, PARTIES, initialState, approvalValid, transition, viewOf };\n}\n","export const template = String.raw`\n\n<svg class=\"symbols\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\"><defs>\n <symbol id=\"i-user\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"8\" r=\"3.5\"/><path d=\"M5 21v-2a7 7 0 0 1 14 0v2\"/></symbol>\n <symbol id=\"i-agent\" viewBox=\"0 0 24 24\"><rect x=\"4\" y=\"6\" width=\"16\" height=\"13\" rx=\"4\"/><path d=\"M12 2v4M1 11v4m22-4v4m-15 0h8\"/><circle cx=\"8.5\" cy=\"11\" r=\".5\"/><circle cx=\"15.5\" cy=\"11\" r=\".5\"/></symbol>\n <symbol id=\"i-shop\" viewBox=\"0 0 24 24\"><path d=\"M3 9h18l-2-6H5L3 9Zm1 0v12h16V9M9 21v-7h6v7M3 9c0 4 4 4 4 0 0 4 5 4 5 0 0 4 5 4 5 0 0 4 4 4 4 0\"/></symbol>\n <symbol id=\"i-card\" viewBox=\"0 0 24 24\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"3\"/><path d=\"M2 10h20M6 15h4m3 0h2\"/></symbol>\n <symbol id=\"i-truck\" viewBox=\"0 0 24 24\"><path d=\"M1 5h13v12H1V5Zm13 4h5l4 5v3h-9M15 17h4\"/><circle cx=\"6\" cy=\"18\" r=\"2.5\"/><circle cx=\"18\" cy=\"18\" r=\"2.5\"/></symbol>\n <symbol id=\"i-bolt\" viewBox=\"0 0 24 24\"><path d=\"m14 2-9 12h7l-2 8 9-12h-7l2-8Z\"/></symbol>\n <symbol id=\"i-bag\" viewBox=\"0 0 24 24\"><path d=\"M4 7h16l1 15H3L4 7Zm4 1V6a4 4 0 0 1 8 0v2\"/></symbol>\n <symbol id=\"i-check\" viewBox=\"0 0 24 24\"><path d=\"m5 12 4 4L20 5\"/></symbol>\n <symbol id=\"i-lock\" viewBox=\"0 0 24 24\"><rect x=\"4\" y=\"10\" width=\"16\" height=\"12\" rx=\"3\"/><path d=\"M8 10V6a4 4 0 0 1 8 0v4m-4 5v3\"/></symbol>\n <symbol id=\"i-refresh\" viewBox=\"0 0 24 24\"><path d=\"M20 7A9 9 0 1 0 21 15M20 2v6h-6\"/></symbol>\n</defs></svg>\n<main id=\"lab\" class=\"lab\">\n <header class=\"page-header\">\n <div>\n <h1>条件を変える。<br class=\"small-only\">購入の判断が変わる。</h1>\n <p class=\"intro\">配送や数量を変えて最新の購入条件を承認してみてください。</p></div>\n <div class=\"header-actions\">\n <button id=\"reset\" class=\"reset\" type=\"button\"><svg><use href=\"#i-refresh\"/></svg>最初の条件に戻す</button>\n <fieldset id=\"modes\" class=\"scenario-tabs\"><legend class=\"sr-only\">試すケース</legend><label><input type=\"radio\" name=\"mode\" value=\"normal\" checked><span>通常の購入</span></label><label><input type=\"radio\" name=\"mode\" value=\"decline\"><span>決済拒否</span></label><label><input type=\"radio\" name=\"mode\" value=\"lost\"><span>応答不達</span></label></fieldset>\n </div>\n </header>\n\n <section class=\"board\" aria-label=\"購入条件と購入の状態を操作する図\">\n <div class=\"scene-heading\"><div class=\"flow-heading\"><span class=\"flow-heading-icon\"><svg><use href=\"#i-refresh\"/></svg></span><div><h2>注文フロー</h2><p>条件の変更が誰の処理につながるか</p></div></div><span class=\"scene-pill\" id=\"phase-label\">購入条件を確認</span></div>\n <div class=\"flow-map\" id=\"flow-map\">\n <div id=\"flow-svg\" class=\"flow-svg\" aria-hidden=\"true\"></div>\n <button class=\"actor\" data-actor=\"buyer\" type=\"button\" aria-pressed=\"false\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-user\"/></svg></span><span><strong>あなた</strong><small>購入の判断</small></span></span><span class=\"actor-state\" id=\"actor-buyer\"></span></button>\n <button class=\"actor selected\" data-actor=\"agent\" type=\"button\" aria-pressed=\"true\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-agent\"/></svg></span><span><strong>エージェント</strong><small>情報をつなぐ</small></span></span><span class=\"actor-state\" id=\"actor-agent\"></span></button>\n <button class=\"actor\" data-actor=\"seller\" type=\"button\" aria-pressed=\"false\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-shop\"/></svg></span><span><strong>販売事業者</strong><small>条件と注文</small></span></span><span class=\"actor-state\" id=\"actor-seller\"></span></button>\n <button class=\"actor\" data-actor=\"payment\" type=\"button\" aria-pressed=\"false\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-card\"/></svg></span><span><strong>決済事業者</strong><small>支払いの処理</small></span></span><span class=\"actor-state\" id=\"actor-payment\"></span></button>\n </div>\n <div id=\"transfer\" class=\"transfer\" role=\"status\">条件を変えると購入に関わるやり取りがここに現れます。</div>\n <div id=\"actor-note\" class=\"actor-note\"></div>\n\n <div class=\"coach\" id=\"coach\" role=\"status\" aria-live=\"polite\"><span class=\"coach-dot\" aria-hidden=\"true\"></span><div><h2 id=\"scene-title\"></h2><p id=\"scene-description\"></p></div></div>\n\n <div class=\"workspace\">\n <section class=\"merchant-panel\" aria-labelledby=\"merchant-title\">\n <div class=\"section-label\"><span>01</span><h2 id=\"merchant-title\">販売事業者が返す購入条件</h2><span class=\"live-badge\" id=\"quote-badge\">最新</span></div>\n <div class=\"product\">\n <div class=\"product-art\" aria-hidden=\"true\"><svg viewBox=\"0 0 260 150\"><ellipse cx=\"132\" cy=\"127\" rx=\"104\" ry=\"8\" fill=\"#d9e4dc\"/><path d=\"M27 96 49 72l11-31 24 11 22-3 42 31 57 15q31 3 34 21l-8 10H36q-20-7-9-30Z\" fill=\"#fafbf4\" stroke=\"#254b41\" stroke-width=\"2.5\" stroke-linejoin=\"round\"/><path d=\"m59 43 24 12-10 36-25-15Z\" fill=\"#9bc3aa\" stroke=\"#254b41\" stroke-width=\"2\"/><path d=\"m105 51 42 31 42 10-27 14-44-14-35-22Z\" fill=\"#dce9dc\" stroke=\"#254b41\" stroke-width=\"2\"/><path d=\"M26 106q34 13 83 5l49 8 77-8 2 10-8 7H37q-13-4-11-22Z\" fill=\"#eee8cf\" stroke=\"#254b41\" stroke-width=\"2.5\"/><path d=\"m91 62 24 2m-15 7 25 2m-15 6 25 2M50 94l14-2m101 22 15-8\" fill=\"none\" stroke=\"#254b41\" stroke-width=\"2.5\" stroke-linecap=\"round\"/><path d=\"m151 84 20 8\" stroke=\"#df9857\" stroke-width=\"6\" stroke-linecap=\"round\"/></svg></div>\n <div class=\"product-info\"><span class=\"product-category\">シューズ店A</span><h3>白いランニングシューズ</h3><p><strong>18,000<span>円</span></strong><span> / 1足・税込み</span></p><div class=\"quantity\"><span>数量</span><div class=\"stepper\"><button id=\"qty-down\" type=\"button\" aria-label=\"数量を1足減らす\">−</button><output id=\"quantity\" aria-live=\"polite\">1足</output><button id=\"qty-up\" type=\"button\" aria-label=\"数量を1足増やす\">+</button></div><small>最大3足</small></div></div>\n </div>\n <fieldset class=\"delivery-options\"><legend>配送方法を変える</legend><div id=\"delivery-options\"></div></fieldset>\n <div class=\"quote\" id=\"quote\">\n <div class=\"quote-row\"><span>商品</span><span id=\"subtotal\"></span></div>\n <div class=\"quote-row\"><span>送料</span><span id=\"shipping-fee\"></span></div>\n <div class=\"quote-total\"><div><span>販売事業者が返した合計</span><small id=\"quote-detail\"></small></div><strong id=\"total\"></strong></div>\n <p id=\"budget-gap\" class=\"budget-gap\"></p>\n </div>\n <div class=\"merchant-order\" id=\"merchant-order\" hidden><svg><use href=\"#i-check\"/></svg><div><strong>販売事業者側では注文が1件できています</strong><span id=\"merchant-order-detail\"></span></div></div>\n <p class=\"panel-foot\">価格は説明用の設定です。販売事業者は変更を受けて最新の合計を返します。</p>\n </section>\n\n <section class=\"buyer-panel\" aria-labelledby=\"buyer-title\">\n <div class=\"section-label\"><span>02</span><h2 id=\"buyer-title\">あなたが決める予算と承認</h2></div>\n <div class=\"budget-head\"><label for=\"budget\">送料込みの予算</label><output for=\"budget\" id=\"budget-value\"></output></div>\n <div class=\"budget-slider\"><input id=\"budget\" type=\"range\" min=\"15000\" max=\"60000\" step=\"500\" value=\"20000\" aria-label=\"送料込みの予算\"><div class=\"range-ticks\"><span>15,000円</span><span>60,000円</span></div></div>\n <div class=\"approval\" id=\"approval\"><div class=\"approval-top\"><svg><use href=\"#i-user\"/></svg><strong id=\"approval-status\"></strong><span id=\"approval-mark\"></span></div><p id=\"approval-detail\"></p><button id=\"revoke\" class=\"text-button\" type=\"button\" hidden>承認を取り消す</button></div>\n <p id=\"approval-notice\" class=\"approval-notice\" hidden></p>\n <button id=\"approve\" type=\"button\" class=\"approve-button\"></button>\n <div class=\"permit\" id=\"permit\"><svg><use href=\"#i-lock\"/></svg><div><strong id=\"permit-title\">この購入に限った支払い</strong><p id=\"permit-detail\"></p></div></div>\n <button id=\"buy\" type=\"button\" class=\"buy-button\"></button>\n <button id=\"reconcile\" type=\"button\" class=\"buy-button\" hidden>同じ購入の結果を確認する</button>\n <div class=\"order-result\" id=\"order-result\" hidden></div>\n <p class=\"button-hint\" id=\"button-hint\"></p>\n </section>\n </div>\n\n </section>\n <footer class=\"page-foot\"><p>この図は購入の仕組みを学ぶためのモデルです。実際の注文・カード認証・課金は行いません。</p><p>動きを減らす設定とキーボード操作に対応しています。</p></footer>\n</main>\n`;\n","export const skin = String.raw`\n@charset \"UTF-8\";\n:host{display:block;position:relative;isolation:isolate}\n.actor[data-transfer=sending] .avatar{background:#dcecc8;border-color:#4c805b;box-shadow:0 0 0 5px #a8ca8340;animation:send-lift .8s ease-out}.actor[data-transfer=received] .avatar{background:#dceee1;border-color:#498563;animation:receive-ring .45s ease-out}.transfer{position:relative;overflow:hidden}.transfer[data-active=true]:after{content:\"\";position:absolute;left:0;bottom:0;height:2px;width:100%;background:#679266;transform-origin:left;animation:transfer-progress .8s linear both}@keyframes send-lift{0%,100%{transform:translateY(0)}35%{transform:translateY(-5px)}}@keyframes receive-ring{0%{box-shadow:0 0 0 0 #77a77780;transform:scale(.94)}50%{transform:scale(1.08)}100%{box-shadow:0 0 0 12px #77a77700;transform:scale(1)}}@keyframes transfer-progress{from{transform:scaleX(0)}to{transform:scaleX(1)}}\n.transfer{margin:0 28px 12px;padding:10px 13px;border-left:3px solid #87a77d;background:#edf4e8;color:#365c43;font-size:12px;line-height:1.7;min-height:41px;font-weight:600}.transfer:empty{display:none}@container(max-width:680px){.transfer{margin:0 16px 12px;font-size:11px;min-height:58px}}\n:host{color-scheme:light;--ink:#17372e;--text:#344c42;--muted:#6d7e72;--green:#256a50;--green-dark:#134e39;--mint:#e8f3e9;--lime:#d5ed92;--line:#dbe4db;--paper:#fffefa;--orange:#9f4e1d;--orange-bg:#fff1df;--blue:#365f80;--red:#a34032}\n*{box-sizing:border-box}:host{container-type:inline-size;margin:0;background:#f1f5ef;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,\"Hiragino Kaku Gothic ProN\",\"Noto Sans JP\",Meiryo,sans-serif;font-size:14px;line-height:1.65;-webkit-font-smoothing:antialiased}:host:before{content:\"\";position:absolute;inset:0 0 auto;height:470px;z-index:-1;background:radial-gradient(ellipse at 25% 10%,#fff7df 0,transparent 60%)}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed}button:focus-visible,summary:focus-visible{outline:3px solid #5b8eaa;outline-offset:4px}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.symbols{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}\n.lab{max-width:1200px;margin:0 auto;padding:34px 28px 24px}.page-header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:26px}.eyebrow{display:flex;align-items:center;gap:10px;font-size:12px;font-weight:750;letter-spacing:.06em;margin:0 0 14px;color:var(--green)}.brand-mark{display:grid;place-items:center;width:26px;height:26px;border:1px solid #456e51;border-radius:7px;color:var(--green-dark);font-size:17px;background:#e4efcf;letter-spacing:-.08em}.eyebrow-rule{height:11px;width:1px;background:#adbfae;margin:0 1px}h1{font-size:clamp(25px,3.2cqw,36px);line-height:1.5;letter-spacing:-.04em;margin:0 0 7px;font-weight:760}.intro{color:var(--muted);margin:0;font-size:13px}.small-only{display:none}.reset{display:flex;align-items:center;gap:7px;flex-shrink:0;border:1px solid #cbd7c9;background:#ffffffa0;color:#46614c;border-radius:9px;padding:10px 13px;font-size:12px}.reset svg{width:15px;height:15px}.reset:hover{background:white;border-color:#7ca181}\n.board{background:var(--paper);border:1px solid #d3decf;border-radius:22px;box-shadow:0 18px 65px #2a4a3310;overflow:hidden}.scene-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 28px 0}.scene-pill{font-size:11px;font-weight:700;letter-spacing:.05em;border:1px solid #d2dfca;color:#4b6b4f;background:#f3f7ec;border-radius:5px;padding:4px 9px}.example-note{font-size:11px;color:#7a897c}.flow-map{position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:20px 12px 16px;margin:8px 20px 0;min-height:137px}.flow-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;stroke:none}.flow-base{fill:none;stroke:#d8e3d8;stroke-width:2}.flow-lost{fill:none;stroke:#cc935b;stroke-width:2;stroke-dasharray:4 7}.actor{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:0 2px;background:transparent;border:0;min-width:0;color:var(--muted)}.avatar{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:15px;border:1px solid #d6e1d2;background:#f6f8f2;color:#6b826c;transition:background .25s,border-color .25s,box-shadow .25s}.avatar svg{width:23px;height:23px}.actor strong{font-size:12px;font-weight:700;line-height:1.5;white-space:nowrap}.actor-state{font-size:11px;color:#7a887b;line-height:1.5;min-height:15px}.actor.selected .avatar{box-shadow:0 0 0 4px #dce9d969;border-color:#71977c}.actor.selected strong{color:var(--ink)}.actor[data-state=good] .avatar{background:#e4f0e3;border-color:#b0c9ac;color:#2e6a49}.actor[data-state=warning] .avatar{background:#fff0d9;border-color:#dfb98b;color:#995c24}.actor[data-state=busy] .avatar{background:#e8f0f5;border-color:#9dbcc8;color:#396b80}.actor[data-state=busy] .avatar:after{content:\"\";position:absolute;inset:-3px;border-radius:18px;border:1px solid #6c9aab;animation:breathe 1.1s ease-in-out infinite}.actor[data-state=muted]{opacity:.63}.actor-note{margin:0 28px 17px;padding:10px 14px;border:1px solid #e3e9df;background:#f7f9f3;border-radius:8px;min-height:43px;display:flex;gap:12px;align-items:baseline;font-size:11px;color:#5d7360}.actor-note strong{color:#345d40;flex-shrink:0}.actor-note span{line-height:1.6}.coach{display:flex;gap:12px;padding:19px 28px;border-top:1px solid #edf0e7;border-bottom:1px solid #edf0e7;background:#fafbf5}.coach-dot{height:9px;width:9px;border-radius:50%;background:#81a58c;flex-shrink:0;margin-top:8px;box-shadow:0 0 0 4px #e5eee2}.coach h2{font-size:17px;line-height:1.6;margin:0 0 2px;letter-spacing:-.025em}.coach p{font-size:11px;color:#6a7c6d;margin:0;line-height:1.7}.coach[data-tone=warning]{background:#fff7ea;border-color:#f1e1c8}.coach[data-tone=warning] .coach-dot{background:#c98e48;box-shadow:0 0 0 4px #f4e4cd}.coach[data-tone=good]{background:#edf5e8}.coach[data-tone=good] .coach-dot{background:#3d8656}.coach[data-tone=error]{background:#fff1e9}.coach[data-tone=error] .coach-dot{background:#b96545}\n.workspace{display:grid;grid-template-columns:minmax(0,1.16fr) minmax(0,1fr)}.merchant-panel,.buyer-panel{padding:25px 28px 20px;min-width:0}.merchant-panel{border-right:1px solid var(--line)}.buyer-panel{background:#fafcf6}.section-label{display:flex;align-items:center;gap:9px;margin-bottom:20px}.section-label>span:first-child{font-family:ui-monospace,monospace;font-size:11px;letter-spacing:.04em;color:#80977e}.section-label h2{font-size:13px;letter-spacing:-.02em;margin:0;font-weight:750}.live-badge{margin-left:auto;color:#4f7c50;font-size:10px;border:1px solid #cedfc4;border-radius:4px;padding:1px 6px}.live-badge[data-pending=true]{color:#836232;border-color:#e2c79d}.product{display:flex;gap:14px;align-items:center;margin-bottom:22px}.product-art{width:43%;height:138px;display:grid;place-items:center;background:linear-gradient(135deg,#e9f1df,#f6f7ee);border-radius:13px;flex-shrink:0;overflow:hidden}.product-art svg{width:100%;height:auto;stroke:none;transform:rotate(-6deg)}.product-info{min-width:0}.product-category{font-size:11px;color:#77916f;letter-spacing:.05em}.product-info h3{font-size:15px;line-height:1.7;letter-spacing:-.03em;margin:4px 0 7px}.product-info p{display:flex;gap:5px;align-items:baseline;flex-wrap:wrap;margin:0;font-size:11px;color:#7c897b}.product-info p strong{font-size:21px;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.035em}.product-info p strong span{font-size:11px;margin-left:2px}.quantity{display:flex;gap:9px;align-items:center;margin-top:12px;font-size:11px;color:#6b8068;flex-wrap:wrap}.quantity small{font-size:10px;color:#8c9987}.stepper{display:flex;align-items:center;justify-content:space-between;border:1px solid #ccd8c4;border-radius:7px;overflow:hidden;background:#fffefa}.stepper button{display:grid;place-items:center;width:30px;height:31px;border:0;background:transparent;color:#42694c;font-size:15px;padding:0}.stepper button:hover:not(:disabled){background:#e8f0de}.stepper button:disabled{color:#b9c5b2}.stepper output{min-width:34px;text-align:center;color:#315037;font-size:11px;font-weight:700}.delivery-options{border:0;margin:0 0 19px;padding:0}.delivery-options legend{font-size:11px;font-weight:700;margin-bottom:9px}.delivery-options>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.delivery-option{position:relative;display:block;min-width:0;cursor:pointer}.delivery-option input{position:absolute;inset:0;opacity:0;margin:0;width:100%;height:100%;cursor:pointer}.delivery-card{display:flex;flex-direction:column;align-items:flex-start;padding:12px 10px 10px;border:1px solid #dbe3d3;border-radius:9px;background:#fffefa;gap:5px;transition:border-color .18s,background .18s;min-height:106px}.delivery-card svg{width:19px;height:19px;color:#7b9171}.delivery-card strong{font-size:11px;white-space:nowrap}.delivery-card em{font-size:16px;font-weight:700;font-style:normal;color:#4d6850;letter-spacing:-.02em}.delivery-card em small{font-size:10px;font-weight:500}.delivery-card>small{font-size:10px;color:#91a087}.delivery-option input:checked+.delivery-card{border-color:#73966a;background:#eef4e4;box-shadow:inset 0 0 0 1px #73966a}.delivery-option input:checked+.delivery-card svg{color:#3b6d46}.delivery-option input:checked+.delivery-card:after{content:\"✓\";position:absolute;right:8px;top:9px;width:14px;height:14px;font-size:11px;line-height:14px;text-align:center;background:#3e7850;color:white;border-radius:50%}.delivery-option input:focus-visible+.delivery-card{outline:3px solid #6c98ae;outline-offset:3px}.delivery-option input:disabled+.delivery-card{opacity:.55;cursor:not-allowed}.quote{padding:15px 17px;background:#f6f7f0;border:1px solid #e2e7d9;border-radius:10px}.quote-row{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#6c7d64;margin-bottom:7px;font-variant-numeric:tabular-nums}.quote-total{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px dashed #ced8c3;padding-top:12px;margin-top:10px}.quote-total>div{display:flex;flex-direction:column;gap:3px}.quote-total>div>span{font-size:11px;font-weight:700;color:#405d40}.quote-total small{font-size:10px;color:#86967b}.quote-total strong{font-size:27px;letter-spacing:-.045em;font-variant-numeric:tabular-nums;white-space:nowrap}.quote-total strong small{font-size:12px;color:inherit;margin-left:3px}.quote[data-pending=true] .quote-total strong{color:#8d9b83;letter-spacing:.12em}.budget-gap{margin:10px 0 0;font-size:11px;display:flex;gap:6px;align-items:center;color:#4e7a46}.budget-gap[data-over=true]{color:#a26025}.budget-gap:before{content:\"\";width:5px;height:5px;flex-shrink:0;border-radius:50%;background:currentColor}.panel-foot{font-size:10px;color:#8c9883;line-height:1.8;margin:11px 0 0}.merchant-order{display:flex;align-items:flex-start;gap:9px;padding:12px;margin-top:12px;border:1px solid #b6d0b6;background:#eaf4e7;border-radius:9px;color:#3f7045}.merchant-order svg{width:17px;height:17px;margin-top:2px}.merchant-order strong{display:block;font-size:11px}.merchant-order span{display:block;font-size:11px;color:#698268;margin-top:3px}\n.budget-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:4px 0 15px}.budget-head label{font-size:11px;font-weight:650;color:#5c7559}.budget-head output{font-size:24px;letter-spacing:-.035em;font-weight:750;font-variant-numeric:tabular-nums}.budget-head output small{font-size:11px;font-weight:600;margin-left:3px}.budget-slider{margin-bottom:22px}.budget-slider input{display:block;appearance:none;width:100%;height:6px;border-radius:5px;border:0;margin:0;padding:0;background:#d8e4cf;cursor:pointer}.budget-slider input::-webkit-slider-thumb{appearance:none;width:21px;height:21px;border-radius:50%;border:4px solid #fffefa;background:#366d45;box-shadow:0 0 0 1px #93b18d,0 2px 5px #2a4e301a;cursor:grab}.budget-slider input::-moz-range-thumb{width:14px;height:14px;border-radius:50%;border:4px solid #fffefa;background:#366d45;box-shadow:0 0 0 1px #93b18d;cursor:grab}.budget-slider input:focus-visible{outline:3px solid #5d8eaa;outline-offset:8px}.budget-slider input:disabled{opacity:.4;cursor:not-allowed}.range-ticks{display:flex;justify-content:space-between;font-size:10px;color:#91a085;margin-top:12px}.approval{padding:14px 15px;border:1px solid #d6e0cb;border-radius:10px;background:#fffefa;margin-bottom:10px;min-height:96px}.approval-top{display:flex;align-items:center;gap:7px;font-size:11px}.approval-top svg{width:16px;height:16px;color:#8a9f7d}.approval-top strong{font-weight:700}.approval-top>span{margin-left:auto;font-size:10px;color:#7b8e6d}.approval p{font-size:11px;color:#809072;margin:9px 0 0;line-height:1.85}.approval[data-approved=true]{background:#eaf3df;border-color:#bad2a6}.approval[data-approved=true] .approval-top svg{color:#4c8042}.approval[data-approved=true] .approval-top>span{color:#4f7b46}.approval-notice{color:#a26830;font-size:11px;line-height:1.7;margin:9px 0 11px;padding:9px 11px;border-left:2px solid #d3a164;background:#fcf3e5}.text-button{font-size:11px;color:#6d875e;text-decoration:underline;text-underline-offset:3px;border:0;background:transparent;padding:7px 0 0}.approve-button,.buy-button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;border-radius:9px;min-height:43px;font-size:12px;font-weight:700;padding:10px 12px;transition:background .15s,transform .15s;line-height:1.6}.approve-button{background:#fffefa;color:#3e754c;border:1px solid #a3bd90}.approve-button:hover:not(:disabled){background:#e5efda}.approve-button:disabled{color:#99a38e;border-color:#dce3d1;background:#f0f3e9}.approve-button[data-done=true]{color:#548045;border-color:#c6d8b7;background:#edf4e4}.buy-button{background:var(--green-dark);color:#f8fbe8;border:1px solid var(--green-dark)}.buy-button:hover:not(:disabled){background:#0b3c2a;transform:translateY(-1px)}.buy-button:disabled{background:#dce4d2;border-color:#dce4d2;color:#91a084}.buy-button svg{width:16px;height:16px}.permit{display:flex;gap:9px;margin:15px 0;color:#829575;align-items:flex-start}.permit>svg{width:17px;height:17px;margin-top:2px}.permit strong{display:block;font-size:11px;font-weight:650;color:#617c58}.permit p{font-size:10px;line-height:1.8;margin:4px 0 0}.permit[data-issued=true]{padding:11px;background:#f0f5e6;border:1px dashed #b5c9a1;border-radius:8px;color:#56814d}.permit[data-issued=true] strong{color:#356238}.permit[data-issued=true] p{color:#64835a}.button-hint{font-size:10px;color:#849678;text-align:center;margin:9px 0 0;min-height:16px;line-height:1.8}.order-result{background:#e3f0d6;border:1px solid #b6d0a0;border-radius:9px;padding:14px;margin-top:12px}.order-result strong{font-size:13px;display:block;color:#315e35}.order-result p{font-size:11px;color:#5f7b52;line-height:1.8;margin:5px 0 0}\n.experiments{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 28px;background:#f7f9f0;border-top:1px solid var(--line)}.experiments h2{font-size:11px;margin:0 0 3px;color:#526e4f}.experiments p{font-size:10px;color:#8b9a80;margin:0;line-height:1.7}.experiments fieldset{display:flex;flex-wrap:wrap;gap:5px;border:0;margin:0;padding:0;flex-shrink:0}.experiments label{position:relative;cursor:pointer}.experiments input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}.experiments span{display:block;font-size:11px;padding:7px 9px;border-radius:6px;border:1px solid #d9e3cf;background:#fffefa;color:#768c67;white-space:nowrap}.experiments input:checked+span{background:#e4edda;border-color:#9cb88b;color:#466c3e;box-shadow:inset 0 0 0 1px #9cb88b}.experiments input:focus-visible+span{outline:3px solid #6a95a9;outline-offset:3px}.experiments input:disabled+span{opacity:.45;cursor:not-allowed}.event-log{padding:0 28px;border-top:1px solid #e7ecdf}.event-log summary{font-size:11px;color:#819375;padding:13px 0;cursor:pointer}.event-log summary>span{float:right;font-size:10px}.event-log ol{list-style:none;padding:0 0 10px;margin:0;display:grid;gap:8px}.event-log li{display:grid;grid-template-columns:78px 1fr;gap:8px;align-items:baseline;font-size:11px;padding-left:11px;border-left:1px solid #c8d9bc;color:#718367}.event-log li strong{font-size:10px;color:#4d704b;font-weight:650}.page-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 3px 0}.page-foot p{font-size:10px;color:#8b9b83;line-height:1.8;margin:0}.page-foot p:last-child{font-size:10px;text-align:right}\n.coach-dot{position:relative}\n.coach[data-busy=true] .coach-dot{background:transparent;box-shadow:none}\n.coach[data-busy=true] .coach-dot:after{content:\"\";position:absolute;inset:-3px;border:2px solid #cfdece;border-top-color:#4c7f5e;border-radius:50%;animation:checkout-spin .8s linear infinite}\n.approve-button[aria-busy=true],.buy-button[aria-busy=true]{color:#365e45;background:#e8f0e3}\n.approve-button[aria-busy=true]:before,.buy-button[aria-busy=true]:before{content:\"\";display:block;flex:none;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:checkout-spin .8s linear infinite}\n.lab[data-reduced-motion=true] .coach-dot:after,.lab[data-reduced-motion=true] button[aria-busy=true]:before{animation:none!important}\n@keyframes checkout-spin{to{transform:rotate(360deg)}}\n@keyframes breathe{0%,100%{opacity:.45;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}\n@media(min-width:1400px){.lab{padding-top:42px}.merchant-panel,.buyer-panel{padding-top:28px;padding-bottom:25px}.product{margin-top:6px;margin-bottom:26px}}\n@container(max-width:900px){.lab{padding:24px 18px}.page-header{gap:15px}.reset{font-size:11px;padding:9px}.merchant-panel,.buyer-panel{padding:22px 21px}.product{gap:10px}.product-art{height:124px;width:41%}.product-info h3{font-size:13px}.quantity{gap:6px}.quantity>small{display:none}.delivery-card{padding:11px 8px}.experiments{padding:16px 21px;align-items:flex-start;flex-direction:column;gap:10px}.page-foot p:last-child{display:none}}\n@container(max-width:680px){.lab{padding:21px 13px 18px}.page-header{align-items:flex-start;position:relative;margin-bottom:20px}.eyebrow{font-size:11px;margin-bottom:11px;gap:8px}.brand-mark{width:23px;height:23px;font-size:15px}.page-header h1{font-size:27px;line-height:1.55;margin-top:3px}.small-only{display:block}.intro{font-size:11px;max-width:260px;line-height:1.9;margin-top:9px}.reset{position:absolute;right:0;top:0;border:0;background:transparent;font-size:0;padding:3px}.reset svg{width:17px;height:17px}.board{border-radius:16px}.scene-heading{padding:16px 17px 0}.scene-pill{font-size:10px}.example-note{font-size:10px;max-width:120px;text-align:right;line-height:1.6}.flow-map{margin:8px 6px 0;padding-top:18px;padding-bottom:10px;min-height:124px}.avatar{width:37px;height:37px;border-radius:12px}.avatar svg{width:20px;height:20px}.actor strong{font-size:11px}.actor-state{font-size:10px;max-width:76px;white-space:normal}.actor-note{margin:0 16px 14px;padding:9px 10px;font-size:10px;gap:8px;display:block;min-height:48px}.actor-note strong{display:block;margin-bottom:2px}.coach{padding:15px 17px;gap:10px}.coach h2{font-size:14px;line-height:1.8}.coach p{font-size:11px;line-height:1.8}.coach-dot{width:7px;height:7px;margin-top:9px}.workspace{grid-template-columns:minmax(0,1fr)}.merchant-panel{border-right:0;border-bottom:1px solid var(--line)}.merchant-panel,.buyer-panel{padding:21px 19px}.section-label{margin-bottom:17px}.section-label h2{font-size:12px}.product{gap:14px}.product-art{width:42%;height:126px}.product-info h3{font-size:14px}.product-info p strong{font-size:20px}.quantity>small{display:inline}.delivery-card{min-height:106px}.delivery-card strong{font-size:11px}.quote-total strong{font-size:28px}.budget-head output{font-size:26px}.budget-slider{margin-bottom:25px}.approval p{font-size:11px}.approve-button,.buy-button{min-height:47px;font-size:12px}.permit strong{font-size:11px}.permit p{font-size:11px}.button-hint{font-size:11px}.experiments{padding:17px 19px}.experiments h2{font-size:12px}.experiments p{font-size:11px}.experiments fieldset{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:6px}.experiments span{text-align:center;font-size:11px;padding:9px 5px}.event-log{padding:0 19px}.event-log summary{font-size:11px}.event-log li{grid-template-columns:65px 1fr;font-size:11px}.page-foot p{font-size:10px}.flow-map .actor[data-state=busy] .avatar:after{border-radius:15px}}\n@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.packet{display:none}}\n.flow-heading{display:flex;align-items:center;gap:11px}.flow-heading-icon{display:grid;place-items:center;background:#eaf0df;border:1px solid #d5dfca;border-radius:10px;width:36px;height:36px;color:#497151}.flow-heading-icon svg{width:18px;height:18px}.flow-heading h2{margin:0;font-size:16px;letter-spacing:-.03em}.flow-heading p{margin:2px 0 0;font-size:11px;color:#788575}.scene-heading{padding:24px 28px 0}.scene-pill{background:#f6f8f1;border-color:#dde5d5;letter-spacing:0;font-weight:600;white-space:nowrap}.flow-map{margin:12px 28px 16px;padding:48px 0 0;gap:20px;min-height:0}.actor{border:1px solid #dde5d7;border-radius:12px;background:#fafbf6;padding:16px 14px 12px;align-items:stretch;text-align:left;gap:16px;box-shadow:0 2px 3px #29472a04;transition:border-color .2s,background .2s,box-shadow .2s}.actor:before{content:\"\";position:absolute;top:-9px;left:calc(50% - 3px);width:6px;height:6px;border:1px solid #b2c5aa;border-radius:50%;background:#fffefa}.actor-top{display:flex;align-items:center;gap:10px}.actor-top>span:last-child{min-width:0}.actor-top small{display:block;font-size:10px;color:#89917f;margin-top:3px;white-space:nowrap}.actor strong{display:block;font-size:12px;color:#49604b}.avatar{width:36px;height:36px;border-radius:10px;flex-shrink:0}.avatar svg{width:20px;height:20px}.actor-state{display:flex;align-items:center;gap:6px;background:#eef3e8;border-radius:5px;padding:5px 8px;font-size:11px;color:#55704e;min-height:28px;white-space:normal}.actor-state:before{content:\"\";width:5px;height:5px;background:#9cb091;border-radius:50%;flex-shrink:0}.actor.selected{border-color:#7d9c70;background:#f4f8ed;box-shadow:0 0 0 2px #dce8ce80}.actor.selected .avatar{box-shadow:none;border-color:#c5d6b7}.actor[data-state=muted]{opacity:1}.actor[data-state=muted] .actor-state{background:#f0f1eb;color:#8d9484}.actor[data-state=warning] .actor-state{background:#fff0d8;color:#9c6c36}.actor[data-state=busy] .actor-state{background:#e8f0f2;color:#527782}.flow-svg{z-index:1}.flow-base{stroke:#dce5d5;stroke-width:1.5}.actor[data-transfer=sending],.actor[data-transfer=received]{border-color:#6d9663;box-shadow:0 0 0 3px #d9e9c880}.transfer{margin:0 28px 10px;border:1px solid #dce6d3;border-radius:9px;background:#eef5e7;padding:13px 16px;min-height:48px;font-size:12px;color:#41643e;line-height:1.8}.transfer[data-active=true]:after{background:#86ac6e}.actor-note{border:0;background:transparent;margin:0 28px 16px;padding:4px 2px;min-height:32px;font-size:11px;gap:10px;color:#7b8675}.actor-note strong{font-size:10px;border:1px solid #e1e7da;padding:2px 7px;border-radius:4px;color:#61775c;background:#f7f9f2;white-space:nowrap}\n@container(max-width:680px){.scene-heading{padding:18px 16px 0;gap:7px;align-items:flex-start}.flow-heading{gap:8px}.flow-heading-icon{width:29px;height:29px;border-radius:8px}.flow-heading h2{font-size:14px}.flow-heading p{font-size:10px;max-width:145px}.scene-pill{font-size:9px;padding:4px 6px;margin-top:2px}.flow-map{margin:12px 13px 13px;gap:6px;padding-top:43px}.actor{padding:10px 4px 5px;gap:10px;border-radius:9px;align-items:center}.actor-top{flex-direction:column;gap:8px;text-align:center}.avatar{width:32px;height:32px;border-radius:9px}.actor strong{font-size:10px;letter-spacing:-.05em;white-space:nowrap}.actor-top small{font-size:8px;letter-spacing:-.05em;margin-top:2px}.actor-state{padding:4px 3px;min-height:34px;font-size:9px;line-height:1.5;justify-content:center;gap:0;text-align:center;width:100%;max-width:none}.actor-state:before{display:none}.transfer{margin:0 16px 10px;font-size:11px;padding:10px 12px;min-height:60px}.actor-note{margin:0 17px 14px;font-size:10px;min-height:0;display:flex;align-items:flex-start;padding:0;gap:8px}.actor-note strong{display:inline-block;margin:0;flex-shrink:0}.actor-note span{font-size:10px}.flow-map .actor[data-state=busy] .avatar:after{border-radius:11px}}\n@container(max-width:680px){.stepper button{width:44px;height:44px}.reset{min-width:44px;min-height:44px;display:grid;place-items:center;right:-8px;top:-8px}.reset svg{margin:0}}\n.scene-heading{padding-top:18px}.flow-heading-icon{width:29px;height:29px;border-radius:8px}.flow-heading h2{font-size:15px}.flow-heading p{display:none}.flow-map{margin:14px 28px 0;padding:0 0 31px;gap:16px}.actor{padding:10px 12px 8px;gap:8px;border-radius:9px}.actor:before{top:auto;bottom:-7px;width:5px;height:5px;left:calc(50% - 2.5px)}.avatar{width:30px;height:30px;border-radius:8px}.avatar svg{width:18px;height:18px}.actor-top{gap:9px}.actor-top small{font-size:9px;margin-top:1px}.actor-state{min-height:22px;font-size:10px;padding:3px 6px}.actor[data-transfer=sending] .avatar{animation:none;transform:none;box-shadow:none}.actor.selected{box-shadow:none}.transfer{margin:0 28px 13px;min-height:32px;display:flex;align-items:center;gap:12px;padding:6px 0;background:transparent;border:0;border-radius:0;font-size:11px;font-weight:400;line-height:1.6;overflow:visible;color:#7c8975}.transfer-route{font-weight:650;color:#41613f;white-space:nowrap}.transfer-action{color:#6e7e66}.transfer-amount{margin-left:auto;font-weight:700;font-variant-numeric:tabular-nums;color:#3d6442;background:#edf3e6;border:1px solid #dce7d1;border-radius:5px;padding:2px 8px;white-space:nowrap}.transfer[data-active=true]:after{display:none}.actor-note{margin-bottom:12px}.flow-svg{overflow:visible}.scene-heading+.flow-map{min-height:0}\n@container(max-width:680px){.scene-heading{padding:14px 16px 0;align-items:center}.flow-heading-icon{width:24px;height:24px;border-radius:6px}.flow-heading-icon svg{width:14px;height:14px}.flow-heading h2{font-size:13px}.scene-pill{font-size:9px}.flow-map{margin:12px 13px 0;padding:0 0 31px;gap:6px}.actor{padding:7px 3px 5px;gap:6px}.actor-top{gap:5px}.avatar{width:25px;height:25px;border-radius:7px}.avatar svg{width:16px;height:16px}.actor-top small{display:none}.actor strong{font-size:10px}.actor-state{min-height:30px;font-size:9px;padding:3px 1px}.transfer{margin:0 16px 11px;padding:2px 0;min-height:34px;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:7px;row-gap:2px;font-size:10px}.transfer-route{grid-column:1;grid-row:1}.transfer-action{grid-column:1;grid-row:2}.transfer-amount{grid-column:2;grid-row:1 / 3;margin:0;font-size:11px;padding:3px 6px}.actor-note{margin:0 16px 10px}}\n.flow-map{grid-template-columns:repeat(4,minmax(0,160px));justify-content:space-between;max-width:880px;margin:15px auto 10px;padding:0;width:calc(100% - 56px);gap:28px;align-items:stretch}.actor:before{display:none}.actor{transition:border-color .2s,background .2s,opacity .2s;min-width:0}.actor[data-bypass=true]{opacity:.12;pointer-events:none}.flow-svg{z-index:1}.flow-base{stroke:#cddac5;stroke-width:1.5}.transfer{max-width:880px;margin-left:auto;margin-right:auto;width:calc(100% - 56px)}\n@container(max-width:680px){.flow-map{width:calc(100% - 26px);grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px auto 10px;padding:0}.actor{padding:7px 2px 5px}.actor strong{font-size:9px;letter-spacing:-.07em}.actor-state{font-size:8px}.transfer{width:calc(100% - 32px);margin-left:auto;margin-right:auto}.flow-base{stroke-width:1.2}}\n.wire-route,.wire-head{stroke-linecap:round;stroke-linejoin:round;animation:wire-settle 1.1s ease-out both}.wire-message{filter:drop-shadow(0 1px 1px #284f3328);animation:wire-envelope .7s linear both}.wire-arrival{transform-box:fill-box;transform-origin:center;opacity:0;animation:wire-arrive .4s ease-out .7s both}.wire-origin{animation:wire-origin .7s ease-out both}.actor[data-transfer=received] .avatar{animation:receive-signal .45s ease-out;transform:none}.actor[data-transfer=sending],.actor[data-transfer=received]{box-shadow:0 0 0 2px #dce9d280}.actor[data-bypass=true]{opacity:.1}@keyframes wire-envelope{0%{opacity:0}12%,82%{opacity:1}100%{opacity:0}}@keyframes wire-arrive{0%{opacity:.8;transform:scale(.6)}100%{opacity:0;transform:scale(3.5)}}@keyframes wire-origin{0%{stroke-width:3;opacity:1}40%,100%{stroke-width:1.4;opacity:.8}}@keyframes receive-signal{0%{box-shadow:0 0 0 0 #7d9f6d80}100%{box-shadow:0 0 0 6px #7d9f6d00}}@keyframes wire-settle{0%{opacity:.35}18%,65%{opacity:1}100%{opacity:.65}}\n@container(max-width:680px){.flow-map{gap:18px}.actor-state{font-size:9px}.wire-route,.wire-head{stroke-width:1.6}}\n.header-actions{display:flex;flex-direction:column;align-items:flex-end;gap:17px;flex-shrink:0}.scenario-tabs{display:flex;gap:3px;margin:0;padding:4px;border:1px solid #d4dfcd;border-radius:10px;background:#e8efe1}.scenario-tabs label{position:relative;cursor:pointer}.scenario-tabs input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}.scenario-tabs span{display:block;padding:8px 13px;border:1px solid transparent;border-radius:7px;color:#71806a;font-size:11px;font-weight:600;white-space:nowrap;transition:background .15s,color .15s,box-shadow .15s}.scenario-tabs input:checked+span{color:#31583c;background:#fffefa;border-color:#d1deca;box-shadow:0 1px 3px #3f5e2910}.scenario-tabs input:focus-visible+span{outline:3px solid #5b8eaa;outline-offset:2px}.scenario-tabs label:has(input:disabled){cursor:not-allowed}.scenario-tabs input:disabled{cursor:not-allowed}.scenario-tabs input:disabled+span{opacity:.55}.scenario-tabs input:checked:disabled+span{opacity:1}\n@container(max-width:680px){.page-header{display:block}.header-actions{align-items:stretch;margin-top:17px;gap:0}.scenario-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:3px;width:100%;border-radius:9px}.scenario-tabs span{padding:9px 7px;text-align:center;font-size:11px}.header-actions .reset{position:absolute;right:-8px;top:-8px}}\n`;\n","import { createCheckoutModel } from './model.mjs';\nimport { template, skin } from './assets';\n\nexport function mountCheckoutRuntime(host, definition, options = {}) {\nconst document = host.ownerDocument;\nconst environment = document.defaultView;\nif (!environment) throw new Error('checkout requires a browser document');\nconst scope = host.shadowRoot ?? host.attachShadow({ mode: 'open' });\n// 見た目は再生の部品が渡す口で図の影の根へ入れ、style要素を作らない (#3695)。口を渡さずに直に置いた時は影の根にstyle要素で入れる\nscope.innerHTML = options.styles ? template : `<style>${skin}</style>${template}`;\noptions.styles?.adopt('dragon-checkout-css', skin, scope);\nconst { UNIT_PRICE, DELIVERY, QUANTITY, BUDGET, PRODUCT, PARTIES, initialState, transition, viewOf } = createCheckoutModel(definition);\nlet disposed = false;\nconst $ = id => scope.querySelector(`[id=\"${id}\"]`);\nconst yen = n => `${n.toLocaleString('ja-JP')}円`;\nconst timers = new Set();\nconst effects = new Set();\nlet transferVersion = 0;\nlet pulseVersion = 0;\nlet inspectedActor = false;\nconst reduceMotion = environment.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ?? false;\nlet state = initialState();\n$('lab').dataset.reducedMotion = String(reduceMotion);\n\nconst heading = scope.querySelector('h1'); heading.textContent = definition.title;\nscope.querySelector('.intro').textContent = definition.note;\nscope.querySelector('.product-info h3').textContent = PRODUCT.name;\nscope.querySelector('.product-category').textContent = PRODUCT.options.merchant;\nscope.querySelector('.product-info p strong').textContent = yen(UNIT_PRICE);\nscope.querySelector('.product-info p').lastChild.textContent = ` / 1${PRODUCT.options.unit}・税込み`;\nscope.querySelector('.quantity small').textContent = `最大${QUANTITY.max}${PRODUCT.options.unit}`;\n$('qty-down').setAttribute('aria-label', `数量を1${PRODUCT.options.unit}減らす`);\n$('qty-up').setAttribute('aria-label', `数量を1${PRODUCT.options.unit}増やす`);\nconst of = kind => definition.blocks.find(block => block.kind === kind);\nscope.querySelector('.flow-heading h2').textContent = of('flow').name;\nscope.querySelector('.delivery-options legend').textContent = of('delivery').name;\nscope.querySelector('.budget-head label').textContent = of('budget').name;\nscope.querySelector('.quote-total > div > span').textContent = of('total').name;\n$('budget').setAttribute('aria-label', of('budget').name);\nfor (const key of ['min','max','step']) $('budget').setAttribute(key, String(BUDGET[key]));\nscope.querySelector('.range-ticks').replaceChildren(...[BUDGET.min, BUDGET.max].map(value => { const span = document.createElement('span'); span.textContent = yen(value); return span; }));\nfor (const button of scope.querySelectorAll('[data-actor]')) {\n const part = PARTIES[button.dataset.actor];\n button.querySelector('strong').textContent = part.name;\n button.querySelector('.actor-top small').textContent = part.options.note;\n button.querySelector('use').setAttribute('href', '#i-' + part.options.icon);\n button.dataset.dragonBlock = part.id;\n}\nfor (const input of scope.querySelectorAll('input[name=\"mode\"]')) {\n const part = definition.blocks.find(block => block.kind === 'scenario' && block.options.outcome === input.value);\n input.nextElementSibling.textContent = part.name;\n input.closest('label').dataset.dragonBlock = part.id;\n}\nfor (const [kind, selector] of Object.entries({ product:'.product',delivery:'.delivery-options',budget:'.budget-head',total:'.quote',approval:'.approval',payment:'.permit',order:'.order-result',flow:'.flow-map' })) scope.querySelector(selector).dataset.dragonBlock = of(kind).id;\nif (PRODUCT.options.art !== 'shoe') scope.querySelector('.product-art').innerHTML = '<svg aria-hidden=\"true\"><use href=\"#i-bag\"/></svg>';\n\nfor (const [id, method] of Object.entries(DELIVERY)) {\n const label = document.createElement('label');\n label.className = 'delivery-option';\n const input = document.createElement('input');\n input.type = 'radio'; input.name = 'delivery'; input.value = id; input.setAttribute('aria-label', method.name);\n const card = document.createElement('span'); card.className = 'delivery-card';\n const art = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); art.setAttribute('aria-hidden', 'true');\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use'); use.setAttribute('href', '#i-' + method.icon); art.append(use);\n const name = document.createElement('strong'); name.textContent = method.name;\n const price = document.createElement('em'); price.textContent = method.fee.toLocaleString('ja-JP');\n const currency = document.createElement('small'); currency.textContent = '円'; price.append(currency);\n const note = document.createElement('small'); note.textContent = method.note;\n card.append(art, name, price, note); label.append(input, card);\n input.addEventListener('change', () => dispatch({ type: 'TERMS', delivery: id }));\n $('delivery-options').append(label);\n}\n\nfunction later(fn, delay) {\n const timer = environment.setTimeout(() => { timers.delete(timer); fn(); }, delay);\n timers.add(timer);\n}\n\nfunction sendLater(from, to, delay, color, label, amount) {\n const version = transferVersion;\n later(() => { if (version === transferVersion) pulse(from, to, color, label, amount); }, delay);\n}\n\nfunction emphasize(id, tone = 'good') {\n if (reduceMotion || $(id).hidden) return;\n const effect = $(id).animate([\n { transform: 'translateY(3px)', boxShadow: `0 0 0 4px ${tone === 'warning' ? '#cc935b55' : '#81a96b55'}` },\n { transform: 'translateY(0)', boxShadow: '0 0 0 0 transparent' },\n ], { duration: 900, easing: 'cubic-bezier(.2,.8,.2,1)' });\n effects.add(effect);\n effect.finished.then(() => effects.delete(effect), () => effects.delete(effect));\n}\n\nfunction dispatch(event) {\n const before = state;\n const next = transition(state, event);\n if (disposed || next === state) return;\n state = next;\n if (!['FOCUS', 'MODE'].includes(event.type)) {\n transferVersion++;\n pulseVersion++;\n for (const actor of scope.querySelectorAll('[data-actor]')) { delete actor.dataset.transfer; delete actor.dataset.bypass; }\n delete $('transfer').dataset.active;\n activeRoute = undefined;\n }\n if (event.type === 'RESET') {\n inspectedActor = false;\n for (const timer of timers) environment.clearTimeout(timer);\n timers.clear();\n activeRoute = undefined;\n for (const effect of effects) effect.cancel();\n effects.clear();\n for (const actor of scope.querySelectorAll('[data-actor]')) delete actor.dataset.transfer;\n delete $('transfer').dataset.active;\n $('transfer').textContent = '条件を変えると購入に関わるやり取りがここに現れます。';\n }\n render();\n const { session, revision, attempt } = state;\n if (event.type === 'TERMS') {\n pulse('buyer', 'agent', '#518563', '数量・配送の変更を伝える');\n sendLater('agent', 'seller', 800, '#518563', '新しい合計を問い合わせる');\n later(() => dispatch({ type: 'QUOTE_READY', session, revision }), 1700);\n if (before.approval) emphasize('approval', 'warning');\n } else if (event.type === 'QUOTE_READY') {\n pulse('seller', 'agent', '#518563', '再計算した購入条件を返す', state.quote.total);\n sendLater('agent', 'buyer', 900, '#518563', '最新の合計を提示する', state.quote.total);\n emphasize('quote');\n } else if (event.type === 'APPROVE') {\n pulse('buyer', 'agent', '#518563', 'この購入条件を承認する', state.approval.total);\n emphasize('approval');\n } else if (event.type === 'BUY') {\n pulse('agent', 'payment', '#518563', '支払いの委任を要求', state.approval.total);\n later(() => dispatch({ type: 'TOKEN_READY', session, attempt }), reduceMotion ? 120 : 900);\n later(() => dispatch({ type: 'SETTLE', session, attempt }), reduceMotion ? 450 : 3800);\n } else if (event.type === 'TOKEN_READY') {\n const amount = state.token.maxAmount;\n pulse('payment', 'agent', '#518563', '上限付きトークンを返す', amount);\n sendLater('agent', 'seller', 900, '#518563', 'トークンを渡す', amount);\n sendLater('seller', 'payment', 1800, '#518563', '決済を要求', amount);\n emphasize('permit');\n } else if (event.type === 'SETTLE') {\n pulse('payment', 'seller', state.phase === 'declined' ? '#b76743' : '#4e8761', state.phase === 'declined' ? '決済の拒否を返す' : '決済の成功を返す', before.token.maxAmount);\n emphasize('coach', state.phase === 'declined' ? 'warning' : 'good');\n if (state.order) emphasize('merchant-order');\n if (state.phase === 'ordered') {\n sendLater('seller', 'agent', 900, '#518563', '成立した注文を返す', state.order.total);\n sendLater('agent', 'buyer', 1800, '#518563', '注文成立を知らせる', state.order.total);\n emphasize('order-result');\n }\n } else if (event.type === 'RECONCILE_START') {\n pulse('agent', 'seller', '#518563', '同じ購入の結果を問い合わせる');\n later(() => dispatch({ type: 'RECONCILE', session }), 1200);\n } else if (event.type === 'RECONCILE') {\n pulse('seller', 'agent', '#518563', '既存の注文を返す', state.order.total);\n emphasize('order-result');\n } else if (event.type === 'BUDGET' && before.approval && !state.approval) {\n pulse('buyer', 'agent', '#c58d4c');\n }\n}\n\nfunction actorDescriptions(s, v) {\n return {\n buyer: v.approved ? `あなたが承認したのは${yen(s.approval.total)}・${DELIVERY[s.approval.delivery].name}です。予算を増やしても、承認した金額が自動で増えるわけではありません。` : `あなたの予算は${yen(s.budget)}です。予算内でも、購入条件を確認して承認するまでは購入を進めません。`,\n agent: s.phase === 'unknown' ? '店からの応答が届いていません。新しい購入を送るのではなく、同じ購入の状態を確認します。' : s.phase === 'reconciling' ? '同じ購入の最新状態を販売事業者に問い合わせています。追加の決済は行いません。' : s.phase === 'ordered' ? '店が返した注文を購入者へ伝えました。注文の確認と配送の完了は別です。' : v.pending ? '数量や配送の変更を販売事業者へ伝えています。販売事業者の新しい返答を待ち、手元の古い金額で確定しません。' : v.gap < 0 ? '返された合計が予算を超えているため、購入の完了を要求しません。条件の変更を待っています。' : v.approved ? '最新の購入条件が承認されています。この購入に使う支払い情報を用意できます。' : '販売事業者が返した最新の購入内容を示し、購入者の承認を待っています。',\n seller: s.order ? `店側では${yen(s.order.total)}の注文が1件成立しています。エージェントへ応答が届いたかどうかとは別の状態です。` : v.pending ? `変更を受けて販売条件を計算し直しています。この例では商品${yen(UNIT_PRICE)}×数量に、選んだ配送方法の送料を加えます。` : `商品と配送方法を確認し、合計${yen(s.quote.total)}を返しています。正式な購入内容を計算するのは販売事業者です。`,\n payment: s.token ? `今回の購入・${s.token.merchant}・上限${yen(s.token.maxAmount)}という条件で支払いを扱います。トークンの発行と決済の成功は別です。` : s.phase === 'declined' ? 'この決済は拒否しました。購入者が承認していても、決済が成功したことにはなりません。' : 'まだ支払いは要求されていません。購入者の承認を得た後にこの購入に限った支払いを処理します。',\n };\n}\n\nfunction render() {\n const s = state;\n const v = viewOf(s);\n const reconciling = s.phase === 'reconciling';\n const busy = v.pending || s.phase === 'processing' || reconciling;\n $('scene-title').textContent = v.title;\n $('scene-description').textContent = v.description;\n $('coach').dataset.tone = ['over_budget', 'unknown'].includes(s.phase) ? 'warning' : s.phase === 'declined' ? 'error' : ['approved', 'ordered'].includes(s.phase) ? 'good' : 'neutral';\n $('coach').dataset.busy = String(busy);\n $('phase-label').textContent = { quoting: '購入条件を更新', over_budget: '購入条件を確認', ready: '購入者の承認待ち', approved: '最新条件を承認済み', processing: '支払いを処理', declined: '決済が失敗', unknown: '購入結果は未確認', reconciling: '注文結果を確認中', ordered: '注文成立' }[s.phase];\n\n $('quantity').textContent = `${s.qty}${PRODUCT.options.unit}`;\n $('qty-down').disabled = v.lockedInputs || s.qty === QUANTITY.min;\n $('qty-up').disabled = v.lockedInputs || s.qty === QUANTITY.max;\n for (const input of scope.querySelectorAll('input[name=\"delivery\"]')) {\n input.checked = input.value === s.delivery; input.disabled = v.lockedInputs;\n }\n $('quote').dataset.pending = String(v.pending);\n $('quote').setAttribute('aria-busy', String(v.pending));\n $('quote-badge').dataset.pending = String(v.pending);\n $('quote-badge').textContent = v.pending ? '更新中' : '最新';\n $('subtotal').textContent = v.pending ? '再計算中' : yen(s.quote.subtotal);\n $('shipping-fee').textContent = v.pending ? '—' : yen(s.quote.fee);\n $('total').innerHTML = v.pending ? '···' : `${s.quote.total.toLocaleString('ja-JP')}<small>円</small>`;\n $('quote-detail').textContent = v.pending ? '最新の返答を待っています' : `${DELIVERY[s.quote.delivery].name}・${s.quote.qty}${PRODUCT.options.unit}・税込み`;\n $('budget-gap').dataset.over = String(v.gap < 0);\n $('budget-gap').textContent = v.pending ? 'エージェントが変更を伝えています' : v.gap < 0 ? `予算を${yen(-v.gap)}超えています` : v.gap === 0 ? '送料込みで予算ちょうどです' : `予算まで${yen(v.gap)}あります`;\n $('budget').value = s.budget;\n $('budget').disabled = v.lockedInputs;\n $('budget').setAttribute('aria-valuetext', yen(s.budget));\n $('budget').style.background = `linear-gradient(to right,#6c9365 ${(s.budget - BUDGET.min) / (BUDGET.max - BUDGET.min) * 100}%,#d8e4cf 0)`;\n $('budget-value').innerHTML = `${s.budget.toLocaleString('ja-JP')}<small>円</small>`;\n\n $('approval').dataset.approved = String(v.approved);\n $('approval-status').textContent = v.approved ? `${yen(s.approval.total)}の条件を承認済み` : '最新の購入条件はまだ未承認';\n $('approval-mark').textContent = v.approved ? '✓ 承認済み' : '承認待ち';\n $('approval-detail').textContent = v.approved ? `${s.approval.qty}${PRODUCT.options.unit}・${DELIVERY[s.approval.delivery].name}を承認しています。数量や配送を変えると承認が無効になります。` : v.pending ? '販売事業者が返す新しい購入条件を待っています。' : `合計${yen(s.quote.total)}・${DELIVERY[s.quote.delivery].name}を確認して承認します。`;\n $('revoke').hidden = !v.approved || v.lockedInputs;\n $('approval-notice').hidden = !s.notice;\n $('approval-notice').textContent = s.notice;\n $('approve').disabled = !v.canApprove;\n $('approve').dataset.done = String(v.approved);\n $('approve').setAttribute('aria-busy', String(v.pending));\n $('approve').textContent = v.approved ? '✓ この購入条件は承認済み' : v.pending ? '購入条件を更新しています' : v.gap < 0 ? '予算を超えるため承認できません' : `${yen(s.quote.total)}の条件を承認する`;\n\n $('permit').dataset.issued = String(Boolean(s.token));\n $('permit-title').textContent = s.token ? `この購入・上限${yen(s.token.maxAmount)}` : 'この購入に限った支払い';\n $('permit-detail').textContent = s.token ? `${s.token.merchant}で有効期限内に使えるトークンです。会話の予算${yen(s.budget)}とは別の制約です。` : v.approved ? `承認した${yen(s.approval.total)}に限定した支払いを用意します。` : '購入条件が承認された後に支払いに使う情報を用意します。';\n $('buy').disabled = !v.canBuy;\n $('buy').hidden = ['unknown', 'reconciling', 'ordered'].includes(s.phase);\n $('buy').setAttribute('aria-busy', String(s.phase === 'processing'));\n $('buy').textContent = s.phase === 'processing' ? s.token ? '利用条件を照合して決済しています' : '支払いを準備しています' : s.phase === 'declined' ? '同じ購入条件でもう一度試す' : v.approved ? `${yen(s.approval.total)}で購入を試す` : '承認して購入を試す';\n $('reconcile').hidden = !['unknown', 'reconciling'].includes(s.phase);\n $('reconcile').disabled = reconciling;\n $('reconcile').setAttribute('aria-busy', String(reconciling));\n $('reconcile').textContent = reconciling ? '注文の結果を確認しています' : '同じ購入の結果を確認する';\n $('order-result').hidden = s.phase !== 'ordered';\n $('order-result').replaceChildren();\n if (s.phase === 'ordered') {\n const title = document.createElement('strong'); title.textContent = '注文が1件成立しました';\n const description = document.createElement('p'); description.textContent = `${yen(s.order.total)}・${DELIVERY[s.order.delivery].name}・${s.order.qty}${PRODUCT.options.unit}。発送と配達はこの後です。`;\n $('order-result').append(title, description);\n }\n $('merchant-order').hidden = !s.order;\n $('merchant-order-detail').textContent = s.order ? `${yen(s.order.total)}・${DELIVERY[s.order.delivery].name} / 決済の成立は${s.chargeCount}回` : '';\n $('button-hint').textContent = ['unknown', 'reconciling'].includes(s.phase) ? '結果を確認しても追加の決済は行いません。' : s.phase === 'ordered' ? '別の条件を試す時は右上から最初に戻せます。' : s.phase === 'processing' ? '処理中は数量や配送を変更できません。' : v.approved ? '条件を変えたら改めて承認します。' : '予算内でも承認なしには購入を進めません。';\n for (const input of scope.querySelectorAll('input[name=\"mode\"]')) {\n input.checked = input.value === s.mode; input.disabled = v.lockedInputs;\n }\n renderActors(s, v);\n drawLinks();\n}\n\nfunction renderActors(s, v) {\n const actorStates = {\n buyer: [s.phase === 'ordered' ? '注文を確認済み' : v.approved ? '最新条件を承認済み' : v.gap < 0 ? '予算を超過' : '条件を確認', s.phase === 'unknown' ? 'warning' : v.approved ? 'good' : v.gap < 0 ? 'warning' : 'neutral'],\n agent: [{ quoting: '条件を伝える', over_budget: '購入を止める', ready: '承認を待つ', approved: '購入の準備', processing: '支払いを依頼', declined: '失敗を伝える', unknown: '結果は未確認', reconciling: '注文を確認中', ordered: '注文を伝える' }[s.phase], ['over_budget', 'unknown', 'declined'].includes(s.phase) ? 'warning' : ['quoting', 'processing', 'reconciling'].includes(s.phase) ? 'busy' : v.approved ? 'good' : 'neutral'],\n seller: [s.order ? '注文が1件成立' : v.pending ? '合計を再計算' : `合計${yen(s.quote.total)}`, v.pending ? 'busy' : 'good'],\n payment: [s.order ? '決済済み' : s.phase === 'declined' ? '決済を拒否' : s.phase === 'processing' ? s.token ? '利用条件を照合' : 'トークンを発行' : 'まだ呼ばれない', s.order ? 'good' : s.phase === 'declined' ? 'warning' : s.phase === 'processing' ? 'busy' : 'muted'],\n };\n for (const button of scope.querySelectorAll('[data-actor]')) {\n const id = button.dataset.actor;\n $('actor-' + id).textContent = actorStates[id][0];\n button.dataset.state = actorStates[id][1];\n button.classList.toggle('selected', s.focus === id);\n button.setAttribute('aria-pressed', String(s.focus === id));\n }\n const name = PARTIES[s.focus].name;\n const title = document.createElement('strong'); title.textContent = name;\n const description = document.createElement('span'); description.textContent = actorDescriptions(s, v)[s.focus];\n $('actor-note').replaceChildren(title, description);\n $('actor-note').hidden = !inspectedActor;\n}\n\nlet activeRoute;\nlet flowDrawKey;\nfunction anchors() {\n const parent = $('flow-map').getBoundingClientRect();\n return Object.fromEntries([...scope.querySelectorAll('[data-actor]')].map(el => {\n const r = el.getBoundingClientRect();\n const party = PARTIES[el.dataset.actor];\n return [party.id, {x:r.left-parent.x,y:r.top-parent.y,w:r.width,h:r.height}];\n }));\n}\nfunction drawLinks() {\n if (!$('flow-map').clientWidth) return;\n const ports = anchors();\n const key = JSON.stringify([ports, activeRoute, pulseVersion]);\n if (key === flowDrawKey) return;\n flowDrawKey = key;\n const output = options.drawFlow(ports, activeRoute);\n $('flow-svg').innerHTML = options.styles ? options.styles.markup(output.svg) : output.svg;\n const svg = $('flow-svg').firstElementChild;\n svg.setAttribute('width', $('flow-map').clientWidth);\n svg.setAttribute('height', $('flow-map').clientHeight);\n svg.setAttribute('preserveAspectRatio', 'none');\n svg.style.setProperty('--play', activeRoute && !reduceMotion ? 'running' : 'paused');\n // Native timeline is played once for each input action, then held at arrival.\n const total = output.timeline.total;\n svg.style.setProperty('--T', '.7s');\n if (!activeRoute) {\n for (const item of svg.querySelectorAll('.dg-a')) item.style.visibility = 'hidden';\n }\n else later(() => {\n if (svg !== $('flow-svg').firstElementChild) return;\n svg.style.setProperty('--play','paused');\n svg.style.setProperty('--at', String(Math.min(total, output.timeline.last) * .7 / total));\n }, 700);\n}\nfunction pulse(from, to, _color = '#518563', label = '', amount = null) {\n const names = Object.fromEntries(Object.entries(PARTIES).map(([role, block]) => [role, block.name]));\n if (label) {\n const route = document.createElement('span'); route.className = 'transfer-route'; route.textContent = `${names[from]} → ${names[to]}`;\n const action = document.createElement('span'); action.className = 'transfer-action'; action.textContent = label;\n $('transfer').replaceChildren(route, action);\n if (amount !== null) {\n const value = document.createElement('span'); value.className = 'transfer-amount'; value.textContent = yen(amount);\n $('transfer').append(value);\n }\n }\n if (reduceMotion) return;\n const roles = ['buyer', 'agent', 'seller', 'payment'];\n const first = Math.min(roles.indexOf(from), roles.indexOf(to));\n const last = Math.max(roles.indexOf(from), roles.indexOf(to));\n for (const actor of scope.querySelectorAll('[data-actor]')) {\n delete actor.dataset.transfer;\n actor.dataset.bypass = String(roles.indexOf(actor.dataset.actor) > first && roles.indexOf(actor.dataset.actor) < last);\n }\n scope.querySelector(`[data-actor=\"${from}\"]`).dataset.transfer = 'sending';\n $('transfer').dataset.active = 'true';\n const version = ++pulseVersion;\n later(() => {\n if (version !== pulseVersion) return;\n delete scope.querySelector(`[data-actor=\"${from}\"]`).dataset.transfer;\n scope.querySelector(`[data-actor=\"${to}\"]`).dataset.transfer = 'received';\n later(() => {\n if (version !== pulseVersion) return;\n delete scope.querySelector(`[data-actor=\"${to}\"]`).dataset.transfer;\n delete $('transfer').dataset.active;\n }, 450);\n }, 700);\n activeRoute = undefined;\n activeRoute = {from:PARTIES[from].id, to:PARTIES[to].id};\n drawLinks();\n}\n\n$('qty-down').addEventListener('click', () => dispatch({ type: 'TERMS', qty: state.qty - 1 }));\n$('qty-up').addEventListener('click', () => dispatch({ type: 'TERMS', qty: state.qty + 1 }));\n$('budget').addEventListener('input', event => dispatch({ type: 'BUDGET', value: Number(event.target.value) }));\n$('approve').addEventListener('click', () => dispatch({ type: 'APPROVE' }));\n$('revoke').addEventListener('click', () => dispatch({ type: 'REVOKE' }));\n$('buy').addEventListener('click', () => dispatch({ type: 'BUY' }));\n$('reconcile').addEventListener('click', () => dispatch({ type: 'RECONCILE_START' }));\n$('reset').addEventListener('click', () => dispatch({ type: 'RESET' }));\nfor (const input of scope.querySelectorAll('input[name=\"mode\"]')) input.addEventListener('change', () => dispatch({ type: 'MODE', mode: input.value }));\nfor (const button of scope.querySelectorAll('[data-actor]')) button.addEventListener('click', () => {\n inspectedActor = !inspectedActor || state.focus !== button.dataset.actor;\n dispatch({ type: 'FOCUS', actor: button.dataset.actor });\n renderActors(state, viewOf(state));\n});\nconst onResize = () => {\n drawLinks();\n options.onResize?.(Math.ceil($('lab').getBoundingClientRect().height));\n};\nconst observer = environment.ResizeObserver ? new environment.ResizeObserver(onResize) : undefined;\nobserver?.observe($('lab'));\nif (!observer) environment.addEventListener('resize', onResize);\nrender();\nreturn {\n definition,\n dispatch,\n getState: () => globalThis.structuredClone(state),\n destroy() {\n if (disposed) return;\n disposed = true;\n observer?.disconnect();\n environment.removeEventListener('resize', onResize);\n for (const timer of timers) environment.clearTimeout(timer);\n for (const effect of effects) effect.cancel();\n timers.clear(); effects.clear(); scope.replaceChildren();\n },\n};\n}\n","/** Native purchase kind. Ports, edges and carriers use the shared SVG pipeline. */\nimport { CHECKOUT_MARKER, layoutCheckout, type PurchaseLayout } from \"./checkout/layout\";\nimport type { KindParts } from \"./parts\";\nimport { isCheckoutNotation, parseCheckout } from \"../checkout/read\";\nimport { definitionOf, purchaseNotation, validatePurchase, modelOf, diagramOf, checkoutModel } from \"../checkout/definition\";\nimport { mountCheckoutRuntime } from \"../checkout/runtime.mjs\";\nimport { fromModel } from \"../model\";\nimport { markParsed } from \"../parsed\";\nimport { renderDiagram } from \"../render/draw\";\nimport { card } from \"../blocks/box/draw\";\nimport type { Player } from \"../player\";\n\nconst mounted = new WeakMap<HTMLElement, Player>();\nexport const parts: KindParts<PurchaseLayout> = {\n ownBoxes: true,\n model: {from: diagramOf, to: checkoutModel},\n validate: validatePurchase,\n times(_diagram, timeline) {\n if (timeline.edges.length !== 1) return timeline;\n return {...timeline,total:4,last:3.8,steps:[{start:0,end:3.2}],\n edges:timeline.edges.map(e=>({...e,start:.1,drawn:3,end:3.2})),\n carriers:timeline.carriers.map(c=>({...c,start:0,depart:.1,arrive:3,end:3.6})),stills:[3.3]};\n },\n notation: {\n matches: isCheckoutNotation,\n print: diagram => purchaseNotation(definitionOf(diagram)),\n read(text) {\n const read = parseCheckout(text);\n return read.ok ? { ok:true, diagram:markParsed(fromModel(modelOf(read.definition), 2)) } : read;\n },\n },\n layout: layoutCheckout,\n draw(layout, _diagram, ctx, subs) {\n const compact = layout.edges.some(e=>Math.abs(e.points[1]![0]-e.points[0]![0])<28);\n return { css: `.dg{background:transparent}.dg-bg{display:none}.dg-env{transform:scale(.52);fill:#fffefa;stroke:#518563;stroke-width:2.2;filter:none}.dg-env-in{transform:scale(.52);fill:none;stroke:#518563;stroke-width:1.5}.dg-e{stroke-dasharray:none;stroke:#c2d1bc;stroke-width:1.4}.dg-e-on,.dg-eh-on{stroke-width:1.8}${compact?'.dg-env{x:-1.5px;y:-1.5px;width:3px;height:3px;rx:1.5px;transform:none;fill:#518563;stroke:#fffefa;stroke-width:.6}.dg-env-in{display:none}':''}`,\n top: layout.overlay ? layout.edges.map(e=>{\n const time=ctx.t.carriers.find(c=>c.step===e.step&&c.event===e.event);\n if(!time)return '';\n const [x,y]=e.points.at(-1)!;\n const animation=ctx.m.kf([[0,{opacity:0}],[time.arrive,{opacity:0,r:'2px'}],[time.arrive+.08,{opacity:.7,r:'3px'}],[time.end,{opacity:0,r:'7px'}],[ctx.m.total,{opacity:0}]]);\n return `<circle class=\"dg-a\" cx=\"${x}\" cy=\"${y}\" r=\"2\" fill=\"none\" stroke=\"#518563\" stroke-width=\"1.3\" style=\"${animation}\"/>`;\n }).join('') : '',\n node: layout.overlay ? \"\" : `<g ${CHECKOUT_MARKER}=\"\">${layout.boxes.map(b => card(b,ctx,[],subs.get(b.id) ?? [])).join(\"\")}</g>` };\n },\n mountInput(host, diagram, options) {\n mounted.get(host)?.destroy();\n const definition = definitionOf(diagram);\n const input = mountCheckoutRuntime(host, definition, { ...options, drawFlow(anchors: Record<string,{x:number;y:number;w:number;h:number}>, route?:{from:string;to:string}) {\n const source = structuredClone(diagram);\n if (route) source.steps = [{title:\"送受信\",body:\"購入条件と注文の情報を伝える\",events:[{type:\"edge\",from:route.from,to:route.to,carry:{kind:\"envelope\"}}]}];\n const rendered = renderDiagram(source,{...options, anchors, overlay:true, width:host.clientWidth});\n return { svg:rendered.svg, timeline:rendered.timeline };\n } });\n const player: Player = {\n get step(){return input.getState().eventCount;}, get playing(){return false;}, diagram,\n dispatch:event=>input.dispatch(event), getState:()=>input.getState(),\n next(){},prev(){},play(){},pause(){},goTo(){},setSpeed(){},mark(){},destroy:()=>input.destroy(),\n };\n mounted.set(host,player);\n return player;\n },\n};\n"]}
1
+ {"version":3,"sources":["/Users/cardene/Desktop/projects/dragon-3715-release-0-76-0/packages/dragon/dist/light/checkout-ID7EXZKS.cjs","../../src/kinds/checkout/layout.ts","../../src/checkout/blocks/party.ts","../../src/checkout/blocks/product.ts","../../src/checkout/blocks/delivery.ts","../../src/checkout/blocks/option.ts","../../src/checkout/blocks/budget.ts","../../src/checkout/blocks/total.ts","../../src/checkout/blocks/approval.ts","../../src/checkout/blocks/payment.ts","../../src/checkout/blocks/order.ts","../../src/checkout/blocks/scenario.ts","../../src/checkout/blocks/flow.ts","../../src/checkout/blocks/index.ts","../../src/checkout/read.ts","../../src/checkout/definition.ts","../../src/checkout/model.mjs","../../src/checkout/template.ts","../../src/checkout/skin.ts","../../src/checkout/runtime.mjs","../../src/kinds/checkout.ts"],"names":["b","product","delivery"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACA;AC7BO,IAAM,gBAAA,EAAkB,oBAAA;AACxB,SAAS,cAAA,CAAe,OAAA,EAAuB,KAAA,EAAqB,OAAA,EAAsC;AAC7G,EAAA,MAAM,MAAA,EAAQ,OAAA,CAAQ,QAAA,EAAU,IAAA,CAAK,GAAA,CAAI,GAAG,MAAA,CAAO,MAAA,CAAO,OAAA,CAAQ,OAAO,CAAA,CAAE,GAAA,CAAI,CAAA,CAAA,EAAA,GAAG,CAAA,CAAE,EAAA,EAAE,CAAA,CAAE,CAAC,CAAC,EAAA,EAAI,IAAA,CAAK,GAAA,CAAI,GAAA,mBAAK,OAAA,CAAQ,KAAA,UAAS,KAAG,CAAA;AAChI,EAAA,MAAM,IAAA,EAAM,OAAA,CAAQ,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AAA;AAC0B,EAAA;AACiD,IAAA;AAC1E,IAAA;AAAO,MAAA;AAC8B,MAAA;AAC4B,QAAA;AACpD,QAAA;AACU,QAAA;AACoG,QAAA;AACL,QAAA;AAC7G,MAAA;AAC6G,MAAA;AAAO,IAAA;AACtI,EAAA;AACmC,EAAA;AACN,oBAAA;AACY,IAAA;AACoI,IAAA;AACnI,MAAA;AACwB,MAAA;AACmC,MAAA;AAC3C,MAAA;AACrD,IAAA;AACoB,IAAA;AACX,MAAA;AAAyB,QAAA;AAAW,MAAA;AAAgB,MAAA;AAAQ,QAAA;AAAM,MAAA;AAAG,MAAA;AAC3C,MAAA;AAA+B,MAAA;AAC7D,MAAA;AAAC,MAAA;AAAQ,MAAA;AAAC,MAAA;AAAQ,MAAA;AAAC,MAAA;AAAS,MAAA;AAAC,MAAA;AAAQ,MAAA;AAAC,MAAA;AAAY,MAAA;AAAC,MAAA;AAAQ,MAAA;AAAC,MAAA;AAA4B,MAAA;AAChG,IAAA;AACuB,IAAA;AAChB,IAAA;AACT,EAAA;AACF;ApB0rCoK;AACA;AACA","file":"/Users/cardene/Desktop/projects/dragon-3715-release-0-76-0/packages/dragon/dist/light/checkout-ID7EXZKS.cjs","sourcesContent":[null,"import type { DiagramModel } from \"../../schema\";\nimport type { Layout, SceneBox } from \"../../layout/scene\";\nimport type { KindOptions } from \"../parts\";\nimport type { NotationLang } from \"../../words\";\nexport type PurchaseLayout = Layout & { overlay?: boolean };\nexport const CHECKOUT_MARKER = \"data-checkout-flow\";\nexport function layoutCheckout(diagram: DiagramModel, _lang: NotationLang, options: KindOptions): PurchaseLayout {\n const width = options.anchors ? Math.max(...Object.values(options.anchors).map(r=>r.x+r.w)) : Math.max(880, options.width ?? 960);\n const gap = options.anchors ? (width < 600 ? 18 : 36) : 64;\n const w = Math.min(160, (width - gap * 3) / 4);\n const boxes: SceneBox[] = diagram.boxes.map((b,i) => {\n const r = options.anchors?.[b.id] ?? { x: (width - 4*w - 3*gap)/2 + i*(w+gap), y:12, w, h:108 };\n return { ...b,...r, color:\"green\", cx:r.x+r.w/2, cy:r.y+r.h/2 };\n });\n const edges = diagram.steps.flatMap((s,step) => s.events.flatMap((e,event) => {\n if (e.type !== \"edge\") return [];\n const a=boxes.find(b=>b.id===e.from)!, b=boxes.find(b=>b.id===e.to)!;\n const dir=b.x>a.x?1:-1;\n const port = options.anchors ? 4 : 20;\n const depart = options.anchors ? 3 : port;\n return [{ step,event,from:e.from,to:e.to,carry:e.carry,color:\"green\" as const,\n points:[[dir>0?a.x+a.w+depart:a.x-depart,a.cy],[dir>0?b.x-port:b.x+b.w+port,b.cy]] as [number,number][] }];\n }));\n return {kind:\"checkout\",width,height:Math.max(...boxes.map(b=>b.y+b.h))+(options.overlay?0:12),boxes,edges,overlay:options.overlay,\n regions:[],lifelines:[],labels:[],actions:[],badges:[],paths:[],ends:[]};\n}\n","import type { BlockRule } from \"./index\";\n\nexport const party = {\n \"name\": \"party\",\n \"min\": 4,\n \"max\": 4,\n \"fields\": {\n \"role\": {\n \"required\": true,\n \"values\": [\n \"buyer\",\n \"agent\",\n \"seller\",\n \"payment\"\n ]\n },\n \"note\": {\n \"default\": \"\"\n },\n \"icon\": {\n \"default\": \"bag\",\n \"values\": [\n \"user\",\n \"agent\",\n \"shop\",\n \"card\",\n \"bolt\",\n \"truck\",\n \"bag\",\n \"lock\",\n \"check\",\n \"refresh\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const product = {\n \"name\": \"product\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"price\": {\n \"number\": true,\n \"required\": true\n },\n \"min\": {\n \"number\": true,\n \"default\": \"1\"\n },\n \"max\": {\n \"number\": true,\n \"default\": \"3\"\n },\n \"initial\": {\n \"number\": true,\n \"default\": \"1\"\n },\n \"unit\": {\n \"required\": true\n },\n \"merchant\": {\n \"required\": true\n },\n \"art\": {\n \"default\": \"none\",\n \"values\": [\n \"none\",\n \"shoe\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const delivery = {\n \"name\": \"delivery\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"initial\": {\n \"required\": true\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const option = {\n \"name\": \"option\",\n \"min\": 1,\n \"max\": 6,\n \"fields\": {\n \"for\": {\n \"required\": true\n },\n \"fee\": {\n \"number\": true,\n \"required\": true\n },\n \"note\": {\n \"default\": \"\"\n },\n \"icon\": {\n \"default\": \"bag\",\n \"values\": [\n \"user\",\n \"agent\",\n \"shop\",\n \"card\",\n \"bolt\",\n \"truck\",\n \"bag\",\n \"lock\",\n \"check\",\n \"refresh\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const budget = {\n \"name\": \"budget\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"min\": {\n \"number\": true,\n \"required\": true\n },\n \"max\": {\n \"number\": true,\n \"required\": true\n },\n \"step\": {\n \"number\": true,\n \"required\": true\n },\n \"initial\": {\n \"number\": true,\n \"required\": true\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const total = {\n \"name\": \"total\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"product\": {\n \"required\": true\n },\n \"delivery\": {\n \"required\": true\n },\n \"rule\": {\n \"required\": true,\n \"values\": [\n \"price * quantity + fee\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const approval = {\n \"name\": \"approval\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"total\": {\n \"required\": true\n },\n \"invalidates\": {\n \"required\": true,\n \"values\": [\n \"quantity, delivery\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const payment = {\n \"name\": \"payment\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"approval\": {\n \"required\": true\n },\n \"limit\": {\n \"required\": true,\n \"values\": [\n \"approved-total\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const order = {\n \"name\": \"order\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"payment\": {\n \"required\": true\n },\n \"policy\": {\n \"required\": true,\n \"values\": [\n \"once\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const scenario = {\n \"name\": \"scenario\",\n \"min\": 3,\n \"max\": 3,\n \"fields\": {\n \"outcome\": {\n \"required\": true,\n \"values\": [\n \"normal\",\n \"decline\",\n \"lost\"\n ]\n }\n }\n} satisfies BlockRule;\n","import type { BlockRule } from \"./index\";\n\nexport const flow = {\n \"name\": \"flow\",\n \"min\": 1,\n \"max\": 1,\n \"fields\": {\n \"buyer\": {\n \"required\": true\n },\n \"agent\": {\n \"required\": true\n },\n \"seller\": {\n \"required\": true\n },\n \"payment\": {\n \"required\": true\n },\n \"wire\": {\n \"required\": true,\n \"values\": [\n \"horizontal\"\n ]\n },\n \"carry\": {\n \"required\": true,\n \"values\": [\n \"message\"\n ]\n }\n }\n} satisfies BlockRule;\n","import { party } from \"./party\";\nimport { product } from \"./product\";\nimport { delivery } from \"./delivery\";\nimport { option } from \"./option\";\nimport { budget } from \"./budget\";\nimport { total } from \"./total\";\nimport { approval } from \"./approval\";\nimport { payment } from \"./payment\";\nimport { order } from \"./order\";\nimport { scenario } from \"./scenario\";\nimport { flow } from \"./flow\";\n\nexport interface FieldRule { required?: boolean; default?: string; values?: readonly string[]; number?: boolean }\nexport interface BlockRule { name: string; min: number; max: number; fields: Readonly<Record<string, FieldRule>> }\nexport const CHECKOUT_BLOCKS: readonly BlockRule[] = [party, product, delivery, option, budget, total, approval, payment, order, scenario, flow];\n","import { messagesFor } from \"../messages\";\nimport { fail, NotationError, readDeclared } from \"../read-kit\";\nimport { isBlankOrComment, tokenize, type SourceLine } from \"../tokenize\";\nimport { CHECKOUT_BLOCKS, type BlockRule } from \"./blocks\";\nexport const MAX_CHECKOUT_LINES = 10000;\n\nexport interface CheckoutBlock {\n kind: string;\n id: string;\n name: string;\n options: Readonly<Record<string, string>>;\n line: number;\n}\nexport interface CheckoutDefinition {\n format: 1;\n kind: \"checkout\";\n id: string;\n title: string;\n note: string;\n blocks: readonly CheckoutBlock[];\n}\nexport type ReadCheckout = { ok: true; definition: CheckoutDefinition } | { ok: false; errors: { line: number; column: number; message: string }[] };\n\nexport function isCheckoutNotation(text: string): boolean {\n const head = tokenize(text).find((line) => !isBlankOrComment(line));\n return head?.text.startsWith(\"checkout \") ?? false;\n}\n\n/** 購入の操作図。数式と規則は列挙した値だけを受け付け、入力をコードとして実行しない。 */\nexport function parseCheckout(text: string): ReadCheckout {\n if (text.split('\\n').length > MAX_CHECKOUT_LINES) return {ok:false,errors:[{line:1,column:1,message:`checkout source line limit is ${MAX_CHECKOUT_LINES}`} ]};\n const lines = tokenize(text).filter((line) => !isBlankOrComment(line));\n const head = lines[0];\n if (!head) return { ok: false, errors: [{ line: 1, column: 1, message: \"checkout の定義がありません\" }] };\n const m = messagesFor(\"ja\");\n const check = (condition: unknown, source: SourceLine, message: string): void => { if (!condition) throw fail(source, 0, message); };\n try {\n check(head.text.startsWith(\"checkout \"), head, \"checkout <id> as <題> [version: 1] で始めます\");\n const title = readDeclared(head, \"checkout\", [\"version\", \"note\"], m);\n check(title.attrs.get(\"version\")?.value === \"1\", head, \"checkout の version は 1 を指定します\");\n check(Boolean(title.name), head, \"checkout の題を as の後に書きます\");\n const blocks: CheckoutBlock[] = [];\n const ids = new Set<string>();\n for (const source of lines.slice(1)) {\n const word = source.text.split(/\\s/u)[0] ?? \"\";\n const rule: BlockRule | undefined = CHECKOUT_BLOCKS.find((part) => part.name === word);\n check(rule, source, `購入の操作図で使えないブロックです: ${word}`);\n if (!rule) continue;\n const read = readDeclared(source, word, Object.keys(rule.fields), m);\n check(/^[a-z][a-z0-9_-]{0,63}$/u.test(read.id), source, \"ブロックの id は小文字の英数字と - と _ で書きます\");\n check(!ids.has(read.id), source, `id が重複しています: ${read.id}`);\n ids.add(read.id);\n const options: Record<string, string> = {};\n for (const [key, field] of Object.entries(rule.fields)) {\n const value = read.attrs.get(key)?.value ?? field.default;\n check(value !== undefined || !field.required, source, `${word} に ${key} を指定します`);\n if (value === undefined) continue;\n check((value.length > 0 || !field.required) && value.length <= 256, source, `${key} は1〜256文字です`);\n if (field.values) check(field.values.includes(value), source, `${key} は ${field.values.join(\" / \")} から指定します`);\n if (field.number) check(/^\\d+$/u.test(value) && Number.isSafeInteger(Number(value)) && Number(value) <= 1000000000, source, `${key} は0〜1000000000の整数です`);\n options[key] = value;\n }\n check((read.name ?? read.id).length <= 80, source, \"表示名は80文字以内です\");\n blocks.push({ kind: word, id: read.id, name: read.name ?? read.id, options, line: source.line });\n }\n const sourceOf = (part: CheckoutBlock): SourceLine => lines.find((line) => line.line === part.line) ?? head;\n for (const rule of CHECKOUT_BLOCKS) {\n const count = blocks.filter((part) => part.kind === rule.name).length;\n check(count >= rule.min && count <= rule.max, head, `${rule.name} は ${rule.min}〜${rule.max} 個定義します`);\n }\n const one = (kind: string): CheckoutBlock => {\n const part = blocks.find((item) => item.kind === kind);\n if (!part) throw fail(head, 0, `${kind} がありません`);\n return part;\n };\n const ref = (part: CheckoutBlock, key: string, kind: string): CheckoutBlock => {\n const found = blocks.find((item) => item.id === part.options[key] && item.kind === kind);\n check(found, sourceOf(part), `${part.id}.${key} は ${kind} の id を指定します`);\n if (!found) throw fail(sourceOf(part), 0, \"参照先がありません\");\n return found;\n };\n const product = one(\"product\"), delivery = one(\"delivery\"), budget = one(\"budget\");\n check(Number(product.options.price) > 0, sourceOf(product), \"単価は1以上です\");\n check(Number(product.options.min) >= 1 && Number(product.options.min) <= Number(product.options.initial) && Number(product.options.initial) <= Number(product.options.max) && Number(product.options.max) <= 12, sourceOf(product), \"数量は 1 ≤ min ≤ initial ≤ max ≤ 12 にします\");\n check(Number(budget.options.min) <= Number(budget.options.initial) && Number(budget.options.initial) <= Number(budget.options.max) && Number(budget.options.min) < Number(budget.options.max), sourceOf(budget), \"予算は min ≤ initial ≤ max で、min < max にします\");\n const stride = Number(budget.options.step);\n check(stride > 0 && (Number(budget.options.max) - Number(budget.options.min)) % stride === 0 && (Number(budget.options.initial) - Number(budget.options.min)) % stride === 0, sourceOf(budget), \"予算の初期値と最大値を step の刻みに揃えます\");\n const options = blocks.filter((part) => part.kind === \"option\");\n for (const part of options) ref(part, \"for\", \"delivery\");\n check(options.some((part) => part.id === delivery.options.initial), sourceOf(delivery), \"配送の initial は option の id を指定します\");\n const total = one(\"total\"), approval = one(\"approval\"), payment = one(\"payment\"), order = one(\"order\"), flow = one(\"flow\");\n ref(total, \"product\", \"product\"); ref(total, \"delivery\", \"delivery\");\n ref(approval, \"total\", \"total\"); ref(payment, \"approval\", \"approval\"); ref(order, \"payment\", \"payment\");\n const parties = blocks.filter((part) => part.kind === \"party\");\n for (const role of [\"buyer\", \"agent\", \"seller\", \"payment\"]) {\n check(parties.filter((part) => part.options.role === role).length === 1, head, `party の role: ${role} を1つ定義します`);\n check(ref(flow, role, \"party\").options.role === role, sourceOf(flow), `flow の ${role} と party の role を揃えます`);\n }\n const cases = blocks.filter((part) => part.kind === \"scenario\");\n for (const outcome of [\"normal\", \"decline\", \"lost\"]) check(cases.filter((part) => part.options.outcome === outcome).length === 1, head, `scenario の outcome: ${outcome} を1つ定義します`);\n return { ok: true, definition: { format: 1, kind: \"checkout\", id: title.id, title: title.name ?? title.id, note: title.attrs.get(\"note\")?.value ?? \"\", blocks } };\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","import type { Diagram, DiagramModel } from \"../schema\";\nimport { MAX_CHECKOUT_LINES, parseCheckout, type CheckoutDefinition } from \"./read\";\n\nexport function definitionOf(diagram: Diagram): CheckoutDefinition {\n if (!diagram.checkout) throw new Error(\"Missing checkout definition\");\n return { ...diagram.checkout, blocks: Object.entries(diagram.blocks).filter(([key]) => key.startsWith(\"purchase-\")).flatMap(([, blocks]) => blocks as CheckoutDefinition[\"blocks\"]) };\n}\n\nexport function purchaseNotation(definition: CheckoutDefinition): string {\n for (const block of definition.blocks) {\n if (!Number.isSafeInteger(block.line) || block.line < 2 || block.line > MAX_CHECKOUT_LINES) throw new Error(`checkout block line must be an integer from 2 to ${MAX_CHECKOUT_LINES}`);\n }\n const attrs = (o: Readonly<Record<string,string>>) => Object.entries(o).map(([k,v]) => `${k}: ${JSON.stringify(v)}`).join(\", \");\n const lines = [`checkout ${definition.id} as ${JSON.stringify(definition.title)} [version: 1, note: ${JSON.stringify(definition.note)}]`];\n // Preserve source positions stored in the semantic blocks across notation/JSON round trips.\n for (const b of [...definition.blocks].sort((a,b) => a.line-b.line)) {\n while (lines.length < b.line-1) lines.push(\"\");\n lines.push(`${b.kind} ${b.id} as ${JSON.stringify(b.name)} [${attrs(b.options)}]`);\n }\n return lines.join(\"\\n\");\n}\n\nexport function validatePurchase(diagram: Diagram): string[] {\n try {\n const read = parseCheckout(purchaseNotation(definitionOf(diagram)));\n return read.ok ? [] : read.errors.map(e => e.message);\n } catch (error) { return [String(error)]; }\n}\n\nexport function modelOf(definition: CheckoutDefinition): DiagramModel {\n const parties = definition.blocks.filter(b => b.kind === \"party\");\n const boxes = parties.map(b => ({ id: b.id, name: b.name, sub: b.options.note, color: \"green\" as const }));\n const flow = definition.blocks.find(b => b.kind === \"flow\")!;\n const routes = [[flow.options.buyer!, flow.options.agent!], [flow.options.agent!, flow.options.seller!], [flow.options.seller!, flow.options.payment!]];\n return { version: 1, kind: \"checkout\", title: definition.title, checkout: definition, boxes,\n steps: [{ title: flow.name, body: definition.note, events: routes.map(([from,to]) => ({type: \"edge\" as const, from: from!, to: to!, carry: {kind:\"envelope\" as const} })) }] };\n}\n\n/** Kind-owned conversion keeps input-specific storage out of the common renderer. */\nexport function diagramOf(model: DiagramModel, version: number): Diagram {\n if (!model.checkout) throw new Error('Missing checkout definition');\n const {blocks: inputs, ...header} = model.checkout;\n const blocks: Record<`purchase-${string}`, import('./read').CheckoutBlock[]> = {};\n for (const block of inputs) (blocks[`purchase-${block.kind}`] ??= []).push(block);\n return {version,kind:'checkout',checkout:header,title:model.title,...(model.view ? {view:model.view} : {}),blocks,steps:model.steps};\n}\n\nexport function checkoutModel(diagram: Diagram): DiagramModel {\n return {...modelOf(definitionOf(diagram)),...(diagram.view ? {view:diagram.view} : {}),steps:diagram.steps};\n}\n\n","export function createCheckoutModel(definition) {\nconst part = kind => definition.blocks.find(block => block.kind === kind);\nconst PRODUCT = part('product');\nconst SHIPPING = part('delivery');\nconst QUANTITY = Object.fromEntries(['min','max','initial'].map(key => [key, Number(PRODUCT.options[key])]));\nconst BUDGET = Object.fromEntries(['min','max','step','initial'].map(key => [key, Number(part('budget').options[key])]));\nconst UNIT_PRICE = Number(PRODUCT.options.price);\nconst DELIVERY = Object.freeze(Object.fromEntries(definition.blocks.filter(block => block.kind === 'option').map(block => [block.id, { name: block.name, fee: Number(block.options.fee), note: block.options.note, icon: block.options.icon }])));\nconst PARTIES = Object.fromEntries(definition.blocks.filter(block => block.kind === 'party').map(block => [block.options.role, block]));\nconst locked = s => ['processing', 'unknown', 'reconciling', 'ordered'].includes(s.phase);\nconst quoted = (s, qty = s.qty, delivery = s.delivery) => ({\n revision: s.revision, qty, delivery, subtotal: UNIT_PRICE * qty,\n fee: DELIVERY[delivery].fee, total: UNIT_PRICE * qty + DELIVERY[delivery].fee,\n merchant: PRODUCT.options.merchant,\n});\nconst add = (s, actor, text) => {\n s.events = [...s.events, { actor, text, n: s.eventCount + 1 }].slice(-6);\n s.eventCount++;\n};\nconst resting = s => s.quote.total > s.budget ? 'over_budget' : s.approval ? 'approved' : 'ready';\n\nfunction initialState(session = 1) {\n const s = {\n session, revision: 1, qty: QUANTITY.initial, delivery: SHIPPING.options.initial, budget: BUDGET.initial,\n phase: 'over_budget', quote: null, approval: null, token: null,\n order: null, chargeCount: 0, attempt: 0, mode: 'normal',\n events: [], eventCount: 0, notice: '', invalidated: false, focus: 'agent',\n };\n s.quote = quoted(s);\n s.phase = resting(s);\n add(s, '販売事業者', `商品${UNIT_PRICE.toLocaleString('ja-JP')}円+送料${s.quote.fee.toLocaleString('ja-JP')}円。合計${s.quote.total.toLocaleString('ja-JP')}円を返しました。`);\n return s;\n}\n\nfunction approvalValid(s) {\n return Boolean(s.approval && s.phase !== 'quoting' &&\n s.approval.revision === s.quote.revision &&\n s.approval.total === s.quote.total && s.approval.total <= s.budget);\n}\n\n/** 説明用の購入モデル。通信、カード認証、課金は実行しない。 */\nfunction transition(previous, event) {\n if (event.type === 'RESET') return initialState(previous.session + 1);\n if (event.session !== undefined && event.session !== previous.session) return previous;\n const s = globalThis.structuredClone(previous);\n switch (event.type) {\n case 'FOCUS':\n if (!['buyer', 'agent', 'seller', 'payment'].includes(event.actor)) return previous;\n s.focus = event.actor;\n return s;\n case 'BUDGET': {\n if (locked(s)) return previous;\n const amount = Number(event.value);\n if (!Number.isFinite(amount) || amount < BUDGET.min || amount > BUDGET.max || (amount - BUDGET.min) % BUDGET.step !== 0) return previous;\n s.budget = amount;\n if (s.approval && s.approval.total > amount) {\n s.approval = null; s.token = null; s.invalidated = true;\n s.notice = '承認した金額より予算が低くなったため、前の承認は使えません。';\n }\n if (s.phase !== 'quoting') s.phase = resting(s);\n return s;\n }\n case 'TERMS': {\n if (locked(s)) return previous;\n const qty = event.qty ?? s.qty;\n const delivery = event.delivery ?? s.delivery;\n if (!Number.isInteger(qty) || qty < QUANTITY.min || qty > QUANTITY.max || !Object.hasOwn(DELIVERY, delivery)) return previous;\n if (qty === s.qty && delivery === s.delivery) return previous;\n s.invalidated = Boolean(s.approval) || s.invalidated;\n s.qty = qty; s.delivery = delivery; s.revision++;\n s.approval = null; s.token = null; s.phase = 'quoting';\n s.notice = s.invalidated ? '購入条件が変わったため、前の承認は使えません。' : '';\n return s;\n }\n case 'QUOTE_READY':\n if (s.phase !== 'quoting' || event.revision !== s.revision) return previous;\n s.quote = quoted(s); s.phase = resting(s);\n add(s, '販売事業者', `${DELIVERY[s.delivery].name}・${s.qty}${PRODUCT.options.unit}で再計算。最新の合計は${s.quote.total.toLocaleString('ja-JP')}円です。`);\n return s;\n case 'APPROVE':\n if (!['ready', 'declined'].includes(s.phase) || s.quote.total > s.budget) return previous;\n s.approval = { ...s.quote }; s.invalidated = false; s.notice = '';\n s.phase = 'approved';\n add(s, '購入者', `${s.quote.total.toLocaleString('ja-JP')}円・${DELIVERY[s.delivery].name}の条件を承認しました。`);\n return s;\n case 'REVOKE':\n if (locked(s) || !s.approval) return previous;\n s.approval = null; s.token = null; s.phase = resting(s);\n s.notice = '承認を取り消しました。購入するにはもう一度承認してください。';\n add(s, '購入者', '購入条件の承認を取り消しました。');\n return s;\n case 'MODE':\n if (locked(s) || !['normal', 'decline', 'lost'].includes(event.mode)) return previous;\n s.mode = event.mode;\n return s;\n case 'BUY':\n if (!['approved', 'declined'].includes(s.phase) || !approvalValid(s)) return previous;\n s.phase = 'processing'; s.attempt++; s.token = null; s.notice = '';\n add(s, 'エージェント', '承認済みの購入内容で支払い委任を要求しました。');\n return s;\n case 'TOKEN_READY':\n if (s.phase !== 'processing' || event.attempt !== s.attempt || s.token) return previous;\n s.token = { maxAmount: s.approval.total, merchant: s.quote.merchant, session: s.session };\n add(s, '決済事業者', `${s.token.merchant}・今回の購入・上限${s.token.maxAmount.toLocaleString('ja-JP')}円に限定したトークンを発行しました。`);\n return s;\n case 'SETTLE':\n if (s.phase !== 'processing' || event.attempt !== s.attempt || !s.token || !approvalValid(s)) return previous;\n if (s.token.maxAmount !== s.quote.total || s.token.session !== s.session || s.token.merchant !== s.quote.merchant) return previous;\n if (s.mode === 'decline') {\n s.phase = 'declined'; s.token = null;\n add(s, '決済事業者', '決済を拒否しました。注文は作成されていません。');\n return s;\n }\n s.chargeCount++;\n s.order = { number: `DEMO-${String(s.session).padStart(3, '0')}`, ...s.quote };\n s.phase = s.mode === 'lost' ? 'unknown' : 'ordered';\n add(s, '販売事業者', `${s.order.total.toLocaleString('ja-JP')}円の決済成功を確認し、注文を1件作成しました。`);\n if (s.mode === 'lost') add(s, 'エージェント', '注文完了の応答が届かず、購入結果を確認できません。');\n else add(s, 'エージェント', '成立した注文を購入者へ伝えました。');\n return s;\n case 'RECONCILE_START':\n if (s.phase !== 'unknown' || !s.order) return previous;\n s.phase = 'reconciling';\n add(s, 'エージェント', '同じ購入の最新状態を販売事業者に問い合わせています。');\n return s;\n case 'RECONCILE':\n if (!['unknown', 'reconciling'].includes(s.phase) || !s.order) return previous;\n s.phase = 'ordered';\n add(s, 'エージェント', '同じ購入の最新状態を取得しました。既存の注文を確認し、追加の決済はしていません。');\n return s;\n default:\n return previous;\n }\n}\n\nfunction viewOf(s) {\n const pending = s.phase === 'quoting';\n const approved = approvalValid(s);\n const gap = s.budget - s.quote.total;\n const lockedInputs = locked(s);\n const titles = {\n over_budget: ['送料を含めると予算を超えています', '配送方法や数量を変えるか、予算を調整してください。'],\n quoting: ['販売事業者が購入条件を再計算しています', '変更を販売事業者に伝えました。最新の購入条件が返るのを待っています。'],\n ready: [s.invalidated ? '条件が変わりました。もう一度承認してください' : '予算内です。購入はまだ確定していません', '合計と配送方法を確認して、この条件で購入するか決めてください。'],\n approved: ['購入者がこの条件を承認しました', '支払いの上限は今回承認した金額です。'],\n processing: [s.token ? '承認した範囲で決済を処理しています' : 'この購入に限った支払いを準備しています', '購入の仕組みを説明するための処理です。実際の課金は行いません。'],\n declined: ['決済が拒否されました。注文はありません', '購入条件の承認と決済の成功は別です。上のケースを切り替えて再度試せます。'],\n unknown: ['購入結果をまだ確認できません', '店側では注文が作成済みです。新たに購入を送り直さず、同じ購入の状態を確認してください。'],\n reconciling: ['販売事業者に注文の結果を確認しています', '同じ購入の最新状態を問い合わせています。決済は繰り返しません。'],\n ordered: ['購入条件の確認から注文成立まで進みました', '注文は1件です。購入の完了と発送・配達の完了は別です。'],\n };\n return { pending, approved, gap, lockedInputs, title: titles[s.phase][0], description: titles[s.phase][1],\n canApprove: !lockedInputs && !pending && !approved && gap >= 0,\n canBuy: !lockedInputs && !pending && approved,\n };\n}\n\nreturn { UNIT_PRICE, DELIVERY, QUANTITY, BUDGET, PRODUCT, PARTIES, initialState, approvalValid, transition, viewOf };\n}\n","export const template = String.raw`\n\n<svg class=\"symbols\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\"><defs>\n <symbol id=\"i-user\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"8\" r=\"3.5\"/><path d=\"M5 21v-2a7 7 0 0 1 14 0v2\"/></symbol>\n <symbol id=\"i-agent\" viewBox=\"0 0 24 24\"><rect x=\"4\" y=\"6\" width=\"16\" height=\"13\" rx=\"4\"/><path d=\"M12 2v4M1 11v4m22-4v4m-15 0h8\"/><circle cx=\"8.5\" cy=\"11\" r=\".5\"/><circle cx=\"15.5\" cy=\"11\" r=\".5\"/></symbol>\n <symbol id=\"i-shop\" viewBox=\"0 0 24 24\"><path d=\"M3 9h18l-2-6H5L3 9Zm1 0v12h16V9M9 21v-7h6v7M3 9c0 4 4 4 4 0 0 4 5 4 5 0 0 4 5 4 5 0 0 4 4 4 4 0\"/></symbol>\n <symbol id=\"i-card\" viewBox=\"0 0 24 24\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"3\"/><path d=\"M2 10h20M6 15h4m3 0h2\"/></symbol>\n <symbol id=\"i-truck\" viewBox=\"0 0 24 24\"><path d=\"M1 5h13v12H1V5Zm13 4h5l4 5v3h-9M15 17h4\"/><circle cx=\"6\" cy=\"18\" r=\"2.5\"/><circle cx=\"18\" cy=\"18\" r=\"2.5\"/></symbol>\n <symbol id=\"i-bolt\" viewBox=\"0 0 24 24\"><path d=\"m14 2-9 12h7l-2 8 9-12h-7l2-8Z\"/></symbol>\n <symbol id=\"i-bag\" viewBox=\"0 0 24 24\"><path d=\"M4 7h16l1 15H3L4 7Zm4 1V6a4 4 0 0 1 8 0v2\"/></symbol>\n <symbol id=\"i-check\" viewBox=\"0 0 24 24\"><path d=\"m5 12 4 4L20 5\"/></symbol>\n <symbol id=\"i-lock\" viewBox=\"0 0 24 24\"><rect x=\"4\" y=\"10\" width=\"16\" height=\"12\" rx=\"3\"/><path d=\"M8 10V6a4 4 0 0 1 8 0v4m-4 5v3\"/></symbol>\n <symbol id=\"i-refresh\" viewBox=\"0 0 24 24\"><path d=\"M20 7A9 9 0 1 0 21 15M20 2v6h-6\"/></symbol>\n</defs></svg>\n<main id=\"lab\" class=\"lab\">\n <header class=\"page-header\">\n <div>\n <h1>条件を変える。<br class=\"small-only\">購入の判断が変わる。</h1>\n <p class=\"intro\">配送や数量を変えて最新の購入条件を承認してみてください。</p></div>\n <div class=\"header-actions\">\n <button id=\"reset\" class=\"reset\" type=\"button\"><svg><use href=\"#i-refresh\"/></svg>最初の条件に戻す</button>\n <fieldset id=\"modes\" class=\"scenario-tabs\"><legend class=\"sr-only\">試すケース</legend><label><input type=\"radio\" name=\"mode\" value=\"normal\" checked><span>通常の購入</span></label><label><input type=\"radio\" name=\"mode\" value=\"decline\"><span>決済拒否</span></label><label><input type=\"radio\" name=\"mode\" value=\"lost\"><span>応答不達</span></label></fieldset>\n </div>\n </header>\n\n <section class=\"board\" aria-label=\"購入条件と購入の状態を操作する図\">\n <div class=\"scene-heading\"><div class=\"flow-heading\"><span class=\"flow-heading-icon\"><svg><use href=\"#i-refresh\"/></svg></span><div><h2>注文フロー</h2><p>条件の変更が誰の処理につながるか</p></div></div><span class=\"scene-pill\" id=\"phase-label\">購入条件を確認</span></div>\n <div class=\"flow-map\" id=\"flow-map\">\n <div id=\"flow-svg\" class=\"flow-svg\" aria-hidden=\"true\"></div>\n <button class=\"actor\" data-actor=\"buyer\" type=\"button\" aria-pressed=\"false\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-user\"/></svg></span><span><strong>あなた</strong><small>購入の判断</small></span></span><span class=\"actor-state\" id=\"actor-buyer\"></span></button>\n <button class=\"actor selected\" data-actor=\"agent\" type=\"button\" aria-pressed=\"true\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-agent\"/></svg></span><span><strong>エージェント</strong><small>情報をつなぐ</small></span></span><span class=\"actor-state\" id=\"actor-agent\"></span></button>\n <button class=\"actor\" data-actor=\"seller\" type=\"button\" aria-pressed=\"false\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-shop\"/></svg></span><span><strong>販売事業者</strong><small>条件と注文</small></span></span><span class=\"actor-state\" id=\"actor-seller\"></span></button>\n <button class=\"actor\" data-actor=\"payment\" type=\"button\" aria-pressed=\"false\"><span class=\"actor-top\"><span class=\"avatar\"><svg><use href=\"#i-card\"/></svg></span><span><strong>決済事業者</strong><small>支払いの処理</small></span></span><span class=\"actor-state\" id=\"actor-payment\"></span></button>\n </div>\n <div id=\"transfer\" class=\"transfer\" role=\"status\">条件を変えると購入に関わるやり取りがここに現れます。</div>\n <div id=\"actor-note\" class=\"actor-note\"></div>\n\n <div class=\"coach\" id=\"coach\" role=\"status\" aria-live=\"polite\"><span class=\"coach-dot\" aria-hidden=\"true\"></span><div><h2 id=\"scene-title\"></h2><p id=\"scene-description\"></p></div></div>\n\n <div class=\"workspace\">\n <section class=\"merchant-panel\" aria-labelledby=\"merchant-title\">\n <div class=\"section-label\"><span>01</span><h2 id=\"merchant-title\">販売事業者が返す購入条件</h2><span class=\"live-badge\" id=\"quote-badge\">最新</span></div>\n <div class=\"product\">\n <div class=\"product-art\" aria-hidden=\"true\"><svg viewBox=\"0 0 260 150\"><ellipse cx=\"132\" cy=\"127\" rx=\"104\" ry=\"8\" fill=\"#d9e4dc\"/><path d=\"M27 96 49 72l11-31 24 11 22-3 42 31 57 15q31 3 34 21l-8 10H36q-20-7-9-30Z\" fill=\"#fafbf4\" stroke=\"#254b41\" stroke-width=\"2.5\" stroke-linejoin=\"round\"/><path d=\"m59 43 24 12-10 36-25-15Z\" fill=\"#9bc3aa\" stroke=\"#254b41\" stroke-width=\"2\"/><path d=\"m105 51 42 31 42 10-27 14-44-14-35-22Z\" fill=\"#dce9dc\" stroke=\"#254b41\" stroke-width=\"2\"/><path d=\"M26 106q34 13 83 5l49 8 77-8 2 10-8 7H37q-13-4-11-22Z\" fill=\"#eee8cf\" stroke=\"#254b41\" stroke-width=\"2.5\"/><path d=\"m91 62 24 2m-15 7 25 2m-15 6 25 2M50 94l14-2m101 22 15-8\" fill=\"none\" stroke=\"#254b41\" stroke-width=\"2.5\" stroke-linecap=\"round\"/><path d=\"m151 84 20 8\" stroke=\"#df9857\" stroke-width=\"6\" stroke-linecap=\"round\"/></svg></div>\n <div class=\"product-info\"><span class=\"product-category\">シューズ店A</span><h3>白いランニングシューズ</h3><p><strong>18,000<span>円</span></strong><span> / 1足・税込み</span></p><div class=\"quantity\"><span>数量</span><div class=\"stepper\"><button id=\"qty-down\" type=\"button\" aria-label=\"数量を1足減らす\">−</button><output id=\"quantity\" aria-live=\"polite\">1足</output><button id=\"qty-up\" type=\"button\" aria-label=\"数量を1足増やす\">+</button></div><small>最大3足</small></div></div>\n </div>\n <fieldset class=\"delivery-options\"><legend>配送方法を変える</legend><div id=\"delivery-options\"></div></fieldset>\n <div class=\"quote\" id=\"quote\">\n <div class=\"quote-row\"><span>商品</span><span id=\"subtotal\"></span></div>\n <div class=\"quote-row\"><span>送料</span><span id=\"shipping-fee\"></span></div>\n <div class=\"quote-total\"><div><span>販売事業者が返した合計</span><small id=\"quote-detail\"></small></div><strong id=\"total\"></strong></div>\n <p id=\"budget-gap\" class=\"budget-gap\"></p>\n </div>\n <div class=\"merchant-order\" id=\"merchant-order\" hidden><svg><use href=\"#i-check\"/></svg><div><strong>販売事業者側では注文が1件できています</strong><span id=\"merchant-order-detail\"></span></div></div>\n <p class=\"panel-foot\">価格は説明用の設定です。販売事業者は変更を受けて最新の合計を返します。</p>\n </section>\n\n <section class=\"buyer-panel\" aria-labelledby=\"buyer-title\">\n <div class=\"section-label\"><span>02</span><h2 id=\"buyer-title\">あなたが決める予算と承認</h2></div>\n <div class=\"budget-head\"><label for=\"budget\">送料込みの予算</label><output for=\"budget\" id=\"budget-value\"></output></div>\n <div class=\"budget-slider\"><input id=\"budget\" type=\"range\" min=\"15000\" max=\"60000\" step=\"500\" value=\"20000\" aria-label=\"送料込みの予算\"><div class=\"range-ticks\"><span>15,000円</span><span>60,000円</span></div></div>\n <div class=\"approval\" id=\"approval\"><div class=\"approval-top\"><svg><use href=\"#i-user\"/></svg><strong id=\"approval-status\"></strong><span id=\"approval-mark\"></span></div><p id=\"approval-detail\"></p><button id=\"revoke\" class=\"text-button\" type=\"button\" hidden>承認を取り消す</button></div>\n <p id=\"approval-notice\" class=\"approval-notice\" hidden></p>\n <button id=\"approve\" type=\"button\" class=\"approve-button\"></button>\n <div class=\"permit\" id=\"permit\"><svg><use href=\"#i-lock\"/></svg><div><strong id=\"permit-title\">この購入に限った支払い</strong><p id=\"permit-detail\"></p></div></div>\n <button id=\"buy\" type=\"button\" class=\"buy-button\"></button>\n <button id=\"reconcile\" type=\"button\" class=\"buy-button\" hidden>同じ購入の結果を確認する</button>\n <div class=\"order-result\" id=\"order-result\" hidden></div>\n <p class=\"button-hint\" id=\"button-hint\"></p>\n </section>\n </div>\n\n </section>\n <footer class=\"page-foot\"><p>この図は購入の仕組みを学ぶためのモデルです。実際の注文・カード認証・課金は行いません。</p><p>動きを減らす設定とキーボード操作に対応しています。</p></footer>\n</main>\n`;\n","export const skin = String.raw`\n@charset \"UTF-8\";\n:host{display:block;position:relative;isolation:isolate}\n.actor[data-transfer=sending] .avatar{background:#dcecc8;border-color:#4c805b;box-shadow:0 0 0 5px #a8ca8340;animation:send-lift .8s ease-out}.actor[data-transfer=received] .avatar{background:#dceee1;border-color:#498563;animation:receive-ring .45s ease-out}.transfer{position:relative;overflow:hidden}.transfer[data-active=true]:after{content:\"\";position:absolute;left:0;bottom:0;height:2px;width:100%;background:#679266;transform-origin:left;animation:transfer-progress .8s linear both}@keyframes send-lift{0%,100%{transform:translateY(0)}35%{transform:translateY(-5px)}}@keyframes receive-ring{0%{box-shadow:0 0 0 0 #77a77780;transform:scale(.94)}50%{transform:scale(1.08)}100%{box-shadow:0 0 0 12px #77a77700;transform:scale(1)}}@keyframes transfer-progress{from{transform:scaleX(0)}to{transform:scaleX(1)}}\n.transfer{margin:0 28px 12px;padding:10px 13px;border-left:3px solid #87a77d;background:#edf4e8;color:#365c43;font-size:12px;line-height:1.7;min-height:41px;font-weight:600}.transfer:empty{display:none}@container(max-width:680px){.transfer{margin:0 16px 12px;font-size:11px;min-height:58px}}\n:host{color-scheme:light;--ink:#17372e;--text:#344c42;--muted:#6d7e72;--green:#256a50;--green-dark:#134e39;--mint:#e8f3e9;--lime:#d5ed92;--line:#dbe4db;--paper:#fffefa;--orange:#9f4e1d;--orange-bg:#fff1df;--blue:#365f80;--red:#a34032}\n*{box-sizing:border-box}:host{container-type:inline-size;margin:0;background:#f1f5ef;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,\"Hiragino Kaku Gothic ProN\",\"Noto Sans JP\",Meiryo,sans-serif;font-size:14px;line-height:1.65;-webkit-font-smoothing:antialiased}:host:before{content:\"\";position:absolute;inset:0 0 auto;height:470px;z-index:-1;background:radial-gradient(ellipse at 25% 10%,#fff7df 0,transparent 60%)}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed}button:focus-visible,summary:focus-visible{outline:3px solid #5b8eaa;outline-offset:4px}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.symbols{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}\n.lab{max-width:1200px;margin:0 auto;padding:34px 28px 24px}.page-header{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:26px}.eyebrow{display:flex;align-items:center;gap:10px;font-size:12px;font-weight:750;letter-spacing:.06em;margin:0 0 14px;color:var(--green)}.brand-mark{display:grid;place-items:center;width:26px;height:26px;border:1px solid #456e51;border-radius:7px;color:var(--green-dark);font-size:17px;background:#e4efcf;letter-spacing:-.08em}.eyebrow-rule{height:11px;width:1px;background:#adbfae;margin:0 1px}h1{font-size:clamp(25px,3.2cqw,36px);line-height:1.5;letter-spacing:-.04em;margin:0 0 7px;font-weight:760}.intro{color:var(--muted);margin:0;font-size:13px}.small-only{display:none}.reset{display:flex;align-items:center;gap:7px;flex-shrink:0;border:1px solid #cbd7c9;background:#ffffffa0;color:#46614c;border-radius:9px;padding:10px 13px;font-size:12px}.reset svg{width:15px;height:15px}.reset:hover{background:white;border-color:#7ca181}\n.board{background:var(--paper);border:1px solid #d3decf;border-radius:22px;box-shadow:0 18px 65px #2a4a3310;overflow:hidden}.scene-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 28px 0}.scene-pill{font-size:11px;font-weight:700;letter-spacing:.05em;border:1px solid #d2dfca;color:#4b6b4f;background:#f3f7ec;border-radius:5px;padding:4px 9px}.example-note{font-size:11px;color:#7a897c}.flow-map{position:relative;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:20px 12px 16px;margin:8px 20px 0;min-height:137px}.flow-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;stroke:none}.flow-base{fill:none;stroke:#d8e3d8;stroke-width:2}.flow-lost{fill:none;stroke:#cc935b;stroke-width:2;stroke-dasharray:4 7}.actor{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:0 2px;background:transparent;border:0;min-width:0;color:var(--muted)}.avatar{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:15px;border:1px solid #d6e1d2;background:#f6f8f2;color:#6b826c;transition:background .25s,border-color .25s,box-shadow .25s}.avatar svg{width:23px;height:23px}.actor strong{font-size:12px;font-weight:700;line-height:1.5;white-space:nowrap}.actor-state{font-size:11px;color:#7a887b;line-height:1.5;min-height:15px}.actor.selected .avatar{box-shadow:0 0 0 4px #dce9d969;border-color:#71977c}.actor.selected strong{color:var(--ink)}.actor[data-state=good] .avatar{background:#e4f0e3;border-color:#b0c9ac;color:#2e6a49}.actor[data-state=warning] .avatar{background:#fff0d9;border-color:#dfb98b;color:#995c24}.actor[data-state=busy] .avatar{background:#e8f0f5;border-color:#9dbcc8;color:#396b80}.actor[data-state=busy] .avatar:after{content:\"\";position:absolute;inset:-3px;border-radius:18px;border:1px solid #6c9aab;animation:breathe 1.1s ease-in-out infinite}.actor[data-state=muted]{opacity:.63}.actor-note{margin:0 28px 17px;padding:10px 14px;border:1px solid #e3e9df;background:#f7f9f3;border-radius:8px;min-height:43px;display:flex;gap:12px;align-items:baseline;font-size:11px;color:#5d7360}.actor-note strong{color:#345d40;flex-shrink:0}.actor-note span{line-height:1.6}.coach{display:flex;gap:12px;padding:19px 28px;border-top:1px solid #edf0e7;border-bottom:1px solid #edf0e7;background:#fafbf5}.coach-dot{height:9px;width:9px;border-radius:50%;background:#81a58c;flex-shrink:0;margin-top:8px;box-shadow:0 0 0 4px #e5eee2}.coach h2{font-size:17px;line-height:1.6;margin:0 0 2px;letter-spacing:-.025em}.coach p{font-size:11px;color:#6a7c6d;margin:0;line-height:1.7}.coach[data-tone=warning]{background:#fff7ea;border-color:#f1e1c8}.coach[data-tone=warning] .coach-dot{background:#c98e48;box-shadow:0 0 0 4px #f4e4cd}.coach[data-tone=good]{background:#edf5e8}.coach[data-tone=good] .coach-dot{background:#3d8656}.coach[data-tone=error]{background:#fff1e9}.coach[data-tone=error] .coach-dot{background:#b96545}\n.workspace{display:grid;grid-template-columns:minmax(0,1.16fr) minmax(0,1fr)}.merchant-panel,.buyer-panel{padding:25px 28px 20px;min-width:0}.merchant-panel{border-right:1px solid var(--line)}.buyer-panel{background:#fafcf6}.section-label{display:flex;align-items:center;gap:9px;margin-bottom:20px}.section-label>span:first-child{font-family:ui-monospace,monospace;font-size:11px;letter-spacing:.04em;color:#80977e}.section-label h2{font-size:13px;letter-spacing:-.02em;margin:0;font-weight:750}.live-badge{margin-left:auto;color:#4f7c50;font-size:10px;border:1px solid #cedfc4;border-radius:4px;padding:1px 6px}.live-badge[data-pending=true]{color:#836232;border-color:#e2c79d}.product{display:flex;gap:14px;align-items:center;margin-bottom:22px}.product-art{width:43%;height:138px;display:grid;place-items:center;background:linear-gradient(135deg,#e9f1df,#f6f7ee);border-radius:13px;flex-shrink:0;overflow:hidden}.product-art svg{width:100%;height:auto;stroke:none;transform:rotate(-6deg)}.product-info{min-width:0}.product-category{font-size:11px;color:#77916f;letter-spacing:.05em}.product-info h3{font-size:15px;line-height:1.7;letter-spacing:-.03em;margin:4px 0 7px}.product-info p{display:flex;gap:5px;align-items:baseline;flex-wrap:wrap;margin:0;font-size:11px;color:#7c897b}.product-info p strong{font-size:21px;color:var(--ink);font-variant-numeric:tabular-nums;letter-spacing:-.035em}.product-info p strong span{font-size:11px;margin-left:2px}.quantity{display:flex;gap:9px;align-items:center;margin-top:12px;font-size:11px;color:#6b8068;flex-wrap:wrap}.quantity small{font-size:10px;color:#8c9987}.stepper{display:flex;align-items:center;justify-content:space-between;border:1px solid #ccd8c4;border-radius:7px;overflow:hidden;background:#fffefa}.stepper button{display:grid;place-items:center;width:30px;height:31px;border:0;background:transparent;color:#42694c;font-size:15px;padding:0}.stepper button:hover:not(:disabled){background:#e8f0de}.stepper button:disabled{color:#b9c5b2}.stepper output{min-width:34px;text-align:center;color:#315037;font-size:11px;font-weight:700}.delivery-options{border:0;margin:0 0 19px;padding:0}.delivery-options legend{font-size:11px;font-weight:700;margin-bottom:9px}.delivery-options>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.delivery-option{position:relative;display:block;min-width:0;cursor:pointer}.delivery-option input{position:absolute;inset:0;opacity:0;margin:0;width:100%;height:100%;cursor:pointer}.delivery-card{display:flex;flex-direction:column;align-items:flex-start;padding:12px 10px 10px;border:1px solid #dbe3d3;border-radius:9px;background:#fffefa;gap:5px;transition:border-color .18s,background .18s;min-height:106px}.delivery-card svg{width:19px;height:19px;color:#7b9171}.delivery-card strong{font-size:11px;white-space:nowrap}.delivery-card em{font-size:16px;font-weight:700;font-style:normal;color:#4d6850;letter-spacing:-.02em}.delivery-card em small{font-size:10px;font-weight:500}.delivery-card>small{font-size:10px;color:#91a087}.delivery-option input:checked+.delivery-card{border-color:#73966a;background:#eef4e4;box-shadow:inset 0 0 0 1px #73966a}.delivery-option input:checked+.delivery-card svg{color:#3b6d46}.delivery-option input:checked+.delivery-card:after{content:\"✓\";position:absolute;right:8px;top:9px;width:14px;height:14px;font-size:11px;line-height:14px;text-align:center;background:#3e7850;color:white;border-radius:50%}.delivery-option input:focus-visible+.delivery-card{outline:3px solid #6c98ae;outline-offset:3px}.delivery-option input:disabled+.delivery-card{opacity:.55;cursor:not-allowed}.quote{padding:15px 17px;background:#f6f7f0;border:1px solid #e2e7d9;border-radius:10px}.quote-row{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#6c7d64;margin-bottom:7px;font-variant-numeric:tabular-nums}.quote-total{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px dashed #ced8c3;padding-top:12px;margin-top:10px}.quote-total>div{display:flex;flex-direction:column;gap:3px}.quote-total>div>span{font-size:11px;font-weight:700;color:#405d40}.quote-total small{font-size:10px;color:#86967b}.quote-total strong{font-size:27px;letter-spacing:-.045em;font-variant-numeric:tabular-nums;white-space:nowrap}.quote-total strong small{font-size:12px;color:inherit;margin-left:3px}.quote[data-pending=true] .quote-total strong{color:#8d9b83;letter-spacing:.12em}.budget-gap{margin:10px 0 0;font-size:11px;display:flex;gap:6px;align-items:center;color:#4e7a46}.budget-gap[data-over=true]{color:#a26025}.budget-gap:before{content:\"\";width:5px;height:5px;flex-shrink:0;border-radius:50%;background:currentColor}.panel-foot{font-size:10px;color:#8c9883;line-height:1.8;margin:11px 0 0}.merchant-order{display:flex;align-items:flex-start;gap:9px;padding:12px;margin-top:12px;border:1px solid #b6d0b6;background:#eaf4e7;border-radius:9px;color:#3f7045}.merchant-order svg{width:17px;height:17px;margin-top:2px}.merchant-order strong{display:block;font-size:11px}.merchant-order span{display:block;font-size:11px;color:#698268;margin-top:3px}\n.budget-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin:4px 0 15px}.budget-head label{font-size:11px;font-weight:650;color:#5c7559}.budget-head output{font-size:24px;letter-spacing:-.035em;font-weight:750;font-variant-numeric:tabular-nums}.budget-head output small{font-size:11px;font-weight:600;margin-left:3px}.budget-slider{margin-bottom:22px}.budget-slider input{display:block;appearance:none;width:100%;height:6px;border-radius:5px;border:0;margin:0;padding:0;background:#d8e4cf;cursor:pointer}.budget-slider input::-webkit-slider-thumb{appearance:none;width:21px;height:21px;border-radius:50%;border:4px solid #fffefa;background:#366d45;box-shadow:0 0 0 1px #93b18d,0 2px 5px #2a4e301a;cursor:grab}.budget-slider input::-moz-range-thumb{width:14px;height:14px;border-radius:50%;border:4px solid #fffefa;background:#366d45;box-shadow:0 0 0 1px #93b18d;cursor:grab}.budget-slider input:focus-visible{outline:3px solid #5d8eaa;outline-offset:8px}.budget-slider input:disabled{opacity:.4;cursor:not-allowed}.range-ticks{display:flex;justify-content:space-between;font-size:10px;color:#91a085;margin-top:12px}.approval{padding:14px 15px;border:1px solid #d6e0cb;border-radius:10px;background:#fffefa;margin-bottom:10px;min-height:96px}.approval-top{display:flex;align-items:center;gap:7px;font-size:11px}.approval-top svg{width:16px;height:16px;color:#8a9f7d}.approval-top strong{font-weight:700}.approval-top>span{margin-left:auto;font-size:10px;color:#7b8e6d}.approval p{font-size:11px;color:#809072;margin:9px 0 0;line-height:1.85}.approval[data-approved=true]{background:#eaf3df;border-color:#bad2a6}.approval[data-approved=true] .approval-top svg{color:#4c8042}.approval[data-approved=true] .approval-top>span{color:#4f7b46}.approval-notice{color:#a26830;font-size:11px;line-height:1.7;margin:9px 0 11px;padding:9px 11px;border-left:2px solid #d3a164;background:#fcf3e5}.text-button{font-size:11px;color:#6d875e;text-decoration:underline;text-underline-offset:3px;border:0;background:transparent;padding:7px 0 0}.approve-button,.buy-button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;border-radius:9px;min-height:43px;font-size:12px;font-weight:700;padding:10px 12px;transition:background .15s,transform .15s;line-height:1.6}.approve-button{background:#fffefa;color:#3e754c;border:1px solid #a3bd90}.approve-button:hover:not(:disabled){background:#e5efda}.approve-button:disabled{color:#99a38e;border-color:#dce3d1;background:#f0f3e9}.approve-button[data-done=true]{color:#548045;border-color:#c6d8b7;background:#edf4e4}.buy-button{background:var(--green-dark);color:#f8fbe8;border:1px solid var(--green-dark)}.buy-button:hover:not(:disabled){background:#0b3c2a;transform:translateY(-1px)}.buy-button:disabled{background:#dce4d2;border-color:#dce4d2;color:#91a084}.buy-button svg{width:16px;height:16px}.permit{display:flex;gap:9px;margin:15px 0;color:#829575;align-items:flex-start}.permit>svg{width:17px;height:17px;margin-top:2px}.permit strong{display:block;font-size:11px;font-weight:650;color:#617c58}.permit p{font-size:10px;line-height:1.8;margin:4px 0 0}.permit[data-issued=true]{padding:11px;background:#f0f5e6;border:1px dashed #b5c9a1;border-radius:8px;color:#56814d}.permit[data-issued=true] strong{color:#356238}.permit[data-issued=true] p{color:#64835a}.button-hint{font-size:10px;color:#849678;text-align:center;margin:9px 0 0;min-height:16px;line-height:1.8}.order-result{background:#e3f0d6;border:1px solid #b6d0a0;border-radius:9px;padding:14px;margin-top:12px}.order-result strong{font-size:13px;display:block;color:#315e35}.order-result p{font-size:11px;color:#5f7b52;line-height:1.8;margin:5px 0 0}\n.experiments{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 28px;background:#f7f9f0;border-top:1px solid var(--line)}.experiments h2{font-size:11px;margin:0 0 3px;color:#526e4f}.experiments p{font-size:10px;color:#8b9a80;margin:0;line-height:1.7}.experiments fieldset{display:flex;flex-wrap:wrap;gap:5px;border:0;margin:0;padding:0;flex-shrink:0}.experiments label{position:relative;cursor:pointer}.experiments input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}.experiments span{display:block;font-size:11px;padding:7px 9px;border-radius:6px;border:1px solid #d9e3cf;background:#fffefa;color:#768c67;white-space:nowrap}.experiments input:checked+span{background:#e4edda;border-color:#9cb88b;color:#466c3e;box-shadow:inset 0 0 0 1px #9cb88b}.experiments input:focus-visible+span{outline:3px solid #6a95a9;outline-offset:3px}.experiments input:disabled+span{opacity:.45;cursor:not-allowed}.event-log{padding:0 28px;border-top:1px solid #e7ecdf}.event-log summary{font-size:11px;color:#819375;padding:13px 0;cursor:pointer}.event-log summary>span{float:right;font-size:10px}.event-log ol{list-style:none;padding:0 0 10px;margin:0;display:grid;gap:8px}.event-log li{display:grid;grid-template-columns:78px 1fr;gap:8px;align-items:baseline;font-size:11px;padding-left:11px;border-left:1px solid #c8d9bc;color:#718367}.event-log li strong{font-size:10px;color:#4d704b;font-weight:650}.page-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 3px 0}.page-foot p{font-size:10px;color:#8b9b83;line-height:1.8;margin:0}.page-foot p:last-child{font-size:10px;text-align:right}\n.coach-dot{position:relative}\n.coach[data-busy=true] .coach-dot{background:transparent;box-shadow:none}\n.coach[data-busy=true] .coach-dot:after{content:\"\";position:absolute;inset:-3px;border:2px solid #cfdece;border-top-color:#4c7f5e;border-radius:50%;animation:checkout-spin .8s linear infinite}\n.approve-button[aria-busy=true],.buy-button[aria-busy=true]{color:#365e45;background:#e8f0e3}\n.approve-button[aria-busy=true]:before,.buy-button[aria-busy=true]:before{content:\"\";display:block;flex:none;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:checkout-spin .8s linear infinite}\n.lab[data-reduced-motion=true] .coach-dot:after,.lab[data-reduced-motion=true] button[aria-busy=true]:before{animation:none!important}\n@keyframes checkout-spin{to{transform:rotate(360deg)}}\n@keyframes breathe{0%,100%{opacity:.45;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}\n@media(min-width:1400px){.lab{padding-top:42px}.merchant-panel,.buyer-panel{padding-top:28px;padding-bottom:25px}.product{margin-top:6px;margin-bottom:26px}}\n@container(max-width:900px){.lab{padding:24px 18px}.page-header{gap:15px}.reset{font-size:11px;padding:9px}.merchant-panel,.buyer-panel{padding:22px 21px}.product{gap:10px}.product-art{height:124px;width:41%}.product-info h3{font-size:13px}.quantity{gap:6px}.quantity>small{display:none}.delivery-card{padding:11px 8px}.experiments{padding:16px 21px;align-items:flex-start;flex-direction:column;gap:10px}.page-foot p:last-child{display:none}}\n@container(max-width:680px){.lab{padding:21px 13px 18px}.page-header{align-items:flex-start;position:relative;margin-bottom:20px}.eyebrow{font-size:11px;margin-bottom:11px;gap:8px}.brand-mark{width:23px;height:23px;font-size:15px}.page-header h1{font-size:27px;line-height:1.55;margin-top:3px}.small-only{display:block}.intro{font-size:11px;max-width:260px;line-height:1.9;margin-top:9px}.reset{position:absolute;right:0;top:0;border:0;background:transparent;font-size:0;padding:3px}.reset svg{width:17px;height:17px}.board{border-radius:16px}.scene-heading{padding:16px 17px 0}.scene-pill{font-size:10px}.example-note{font-size:10px;max-width:120px;text-align:right;line-height:1.6}.flow-map{margin:8px 6px 0;padding-top:18px;padding-bottom:10px;min-height:124px}.avatar{width:37px;height:37px;border-radius:12px}.avatar svg{width:20px;height:20px}.actor strong{font-size:11px}.actor-state{font-size:10px;max-width:76px;white-space:normal}.actor-note{margin:0 16px 14px;padding:9px 10px;font-size:10px;gap:8px;display:block;min-height:48px}.actor-note strong{display:block;margin-bottom:2px}.coach{padding:15px 17px;gap:10px}.coach h2{font-size:14px;line-height:1.8}.coach p{font-size:11px;line-height:1.8}.coach-dot{width:7px;height:7px;margin-top:9px}.workspace{grid-template-columns:minmax(0,1fr)}.merchant-panel{border-right:0;border-bottom:1px solid var(--line)}.merchant-panel,.buyer-panel{padding:21px 19px}.section-label{margin-bottom:17px}.section-label h2{font-size:12px}.product{gap:14px}.product-art{width:42%;height:126px}.product-info h3{font-size:14px}.product-info p strong{font-size:20px}.quantity>small{display:inline}.delivery-card{min-height:106px}.delivery-card strong{font-size:11px}.quote-total strong{font-size:28px}.budget-head output{font-size:26px}.budget-slider{margin-bottom:25px}.approval p{font-size:11px}.approve-button,.buy-button{min-height:47px;font-size:12px}.permit strong{font-size:11px}.permit p{font-size:11px}.button-hint{font-size:11px}.experiments{padding:17px 19px}.experiments h2{font-size:12px}.experiments p{font-size:11px}.experiments fieldset{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:6px}.experiments span{text-align:center;font-size:11px;padding:9px 5px}.event-log{padding:0 19px}.event-log summary{font-size:11px}.event-log li{grid-template-columns:65px 1fr;font-size:11px}.page-foot p{font-size:10px}.flow-map .actor[data-state=busy] .avatar:after{border-radius:15px}}\n@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.packet{display:none}}\n.flow-heading{display:flex;align-items:center;gap:11px}.flow-heading-icon{display:grid;place-items:center;background:#eaf0df;border:1px solid #d5dfca;border-radius:10px;width:36px;height:36px;color:#497151}.flow-heading-icon svg{width:18px;height:18px}.flow-heading h2{margin:0;font-size:16px;letter-spacing:-.03em}.flow-heading p{margin:2px 0 0;font-size:11px;color:#788575}.scene-heading{padding:24px 28px 0}.scene-pill{background:#f6f8f1;border-color:#dde5d5;letter-spacing:0;font-weight:600;white-space:nowrap}.flow-map{margin:12px 28px 16px;padding:48px 0 0;gap:20px;min-height:0}.actor{border:1px solid #dde5d7;border-radius:12px;background:#fafbf6;padding:16px 14px 12px;align-items:stretch;text-align:left;gap:16px;box-shadow:0 2px 3px #29472a04;transition:border-color .2s,background .2s,box-shadow .2s}.actor:before{content:\"\";position:absolute;top:-9px;left:calc(50% - 3px);width:6px;height:6px;border:1px solid #b2c5aa;border-radius:50%;background:#fffefa}.actor-top{display:flex;align-items:center;gap:10px}.actor-top>span:last-child{min-width:0}.actor-top small{display:block;font-size:10px;color:#89917f;margin-top:3px;white-space:nowrap}.actor strong{display:block;font-size:12px;color:#49604b}.avatar{width:36px;height:36px;border-radius:10px;flex-shrink:0}.avatar svg{width:20px;height:20px}.actor-state{display:flex;align-items:center;gap:6px;background:#eef3e8;border-radius:5px;padding:5px 8px;font-size:11px;color:#55704e;min-height:28px;white-space:normal}.actor-state:before{content:\"\";width:5px;height:5px;background:#9cb091;border-radius:50%;flex-shrink:0}.actor.selected{border-color:#7d9c70;background:#f4f8ed;box-shadow:0 0 0 2px #dce8ce80}.actor.selected .avatar{box-shadow:none;border-color:#c5d6b7}.actor[data-state=muted]{opacity:1}.actor[data-state=muted] .actor-state{background:#f0f1eb;color:#8d9484}.actor[data-state=warning] .actor-state{background:#fff0d8;color:#9c6c36}.actor[data-state=busy] .actor-state{background:#e8f0f2;color:#527782}.flow-svg{z-index:1}.flow-base{stroke:#dce5d5;stroke-width:1.5}.actor[data-transfer=sending],.actor[data-transfer=received]{border-color:#6d9663;box-shadow:0 0 0 3px #d9e9c880}.transfer{margin:0 28px 10px;border:1px solid #dce6d3;border-radius:9px;background:#eef5e7;padding:13px 16px;min-height:48px;font-size:12px;color:#41643e;line-height:1.8}.transfer[data-active=true]:after{background:#86ac6e}.actor-note{border:0;background:transparent;margin:0 28px 16px;padding:4px 2px;min-height:32px;font-size:11px;gap:10px;color:#7b8675}.actor-note strong{font-size:10px;border:1px solid #e1e7da;padding:2px 7px;border-radius:4px;color:#61775c;background:#f7f9f2;white-space:nowrap}\n@container(max-width:680px){.scene-heading{padding:18px 16px 0;gap:7px;align-items:flex-start}.flow-heading{gap:8px}.flow-heading-icon{width:29px;height:29px;border-radius:8px}.flow-heading h2{font-size:14px}.flow-heading p{font-size:10px;max-width:145px}.scene-pill{font-size:9px;padding:4px 6px;margin-top:2px}.flow-map{margin:12px 13px 13px;gap:6px;padding-top:43px}.actor{padding:10px 4px 5px;gap:10px;border-radius:9px;align-items:center}.actor-top{flex-direction:column;gap:8px;text-align:center}.avatar{width:32px;height:32px;border-radius:9px}.actor strong{font-size:10px;letter-spacing:-.05em;white-space:nowrap}.actor-top small{font-size:8px;letter-spacing:-.05em;margin-top:2px}.actor-state{padding:4px 3px;min-height:34px;font-size:9px;line-height:1.5;justify-content:center;gap:0;text-align:center;width:100%;max-width:none}.actor-state:before{display:none}.transfer{margin:0 16px 10px;font-size:11px;padding:10px 12px;min-height:60px}.actor-note{margin:0 17px 14px;font-size:10px;min-height:0;display:flex;align-items:flex-start;padding:0;gap:8px}.actor-note strong{display:inline-block;margin:0;flex-shrink:0}.actor-note span{font-size:10px}.flow-map .actor[data-state=busy] .avatar:after{border-radius:11px}}\n@container(max-width:680px){.stepper button{width:44px;height:44px}.reset{min-width:44px;min-height:44px;display:grid;place-items:center;right:-8px;top:-8px}.reset svg{margin:0}}\n.scene-heading{padding-top:18px}.flow-heading-icon{width:29px;height:29px;border-radius:8px}.flow-heading h2{font-size:15px}.flow-heading p{display:none}.flow-map{margin:14px 28px 0;padding:0 0 31px;gap:16px}.actor{padding:10px 12px 8px;gap:8px;border-radius:9px}.actor:before{top:auto;bottom:-7px;width:5px;height:5px;left:calc(50% - 2.5px)}.avatar{width:30px;height:30px;border-radius:8px}.avatar svg{width:18px;height:18px}.actor-top{gap:9px}.actor-top small{font-size:9px;margin-top:1px}.actor-state{min-height:22px;font-size:10px;padding:3px 6px}.actor[data-transfer=sending] .avatar{animation:none;transform:none;box-shadow:none}.actor.selected{box-shadow:none}.transfer{margin:0 28px 13px;min-height:32px;display:flex;align-items:center;gap:12px;padding:6px 0;background:transparent;border:0;border-radius:0;font-size:11px;font-weight:400;line-height:1.6;overflow:visible;color:#7c8975}.transfer-route{font-weight:650;color:#41613f;white-space:nowrap}.transfer-action{color:#6e7e66}.transfer-amount{margin-left:auto;font-weight:700;font-variant-numeric:tabular-nums;color:#3d6442;background:#edf3e6;border:1px solid #dce7d1;border-radius:5px;padding:2px 8px;white-space:nowrap}.transfer[data-active=true]:after{display:none}.actor-note{margin-bottom:12px}.flow-svg{overflow:visible}.scene-heading+.flow-map{min-height:0}\n@container(max-width:680px){.scene-heading{padding:14px 16px 0;align-items:center}.flow-heading-icon{width:24px;height:24px;border-radius:6px}.flow-heading-icon svg{width:14px;height:14px}.flow-heading h2{font-size:13px}.scene-pill{font-size:9px}.flow-map{margin:12px 13px 0;padding:0 0 31px;gap:6px}.actor{padding:7px 3px 5px;gap:6px}.actor-top{gap:5px}.avatar{width:25px;height:25px;border-radius:7px}.avatar svg{width:16px;height:16px}.actor-top small{display:none}.actor strong{font-size:10px}.actor-state{min-height:30px;font-size:9px;padding:3px 1px}.transfer{margin:0 16px 11px;padding:2px 0;min-height:34px;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:7px;row-gap:2px;font-size:10px}.transfer-route{grid-column:1;grid-row:1}.transfer-action{grid-column:1;grid-row:2}.transfer-amount{grid-column:2;grid-row:1 / 3;margin:0;font-size:11px;padding:3px 6px}.actor-note{margin:0 16px 10px}}\n.flow-map{grid-template-columns:repeat(4,minmax(0,160px));justify-content:space-between;max-width:880px;margin:15px auto 10px;padding:0;width:calc(100% - 56px);gap:28px;align-items:stretch}.actor:before{display:none}.actor{transition:border-color .2s,background .2s,opacity .2s;min-width:0}.actor[data-bypass=true]{opacity:.12;pointer-events:none}.flow-svg{z-index:1}.flow-base{stroke:#cddac5;stroke-width:1.5}.transfer{max-width:880px;margin-left:auto;margin-right:auto;width:calc(100% - 56px)}\n@container(max-width:680px){.flow-map{width:calc(100% - 26px);grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:12px auto 10px;padding:0}.actor{padding:7px 2px 5px}.actor strong{font-size:9px;letter-spacing:-.07em}.actor-state{font-size:8px}.transfer{width:calc(100% - 32px);margin-left:auto;margin-right:auto}.flow-base{stroke-width:1.2}}\n.wire-route,.wire-head{stroke-linecap:round;stroke-linejoin:round;animation:wire-settle 1.1s ease-out both}.wire-message{filter:drop-shadow(0 1px 1px #284f3328);animation:wire-envelope .7s linear both}.wire-arrival{transform-box:fill-box;transform-origin:center;opacity:0;animation:wire-arrive .4s ease-out .7s both}.wire-origin{animation:wire-origin .7s ease-out both}.actor[data-transfer=received] .avatar{animation:receive-signal .45s ease-out;transform:none}.actor[data-transfer=sending],.actor[data-transfer=received]{box-shadow:0 0 0 2px #dce9d280}.actor[data-bypass=true]{opacity:.1}@keyframes wire-envelope{0%{opacity:0}12%,82%{opacity:1}100%{opacity:0}}@keyframes wire-arrive{0%{opacity:.8;transform:scale(.6)}100%{opacity:0;transform:scale(3.5)}}@keyframes wire-origin{0%{stroke-width:3;opacity:1}40%,100%{stroke-width:1.4;opacity:.8}}@keyframes receive-signal{0%{box-shadow:0 0 0 0 #7d9f6d80}100%{box-shadow:0 0 0 6px #7d9f6d00}}@keyframes wire-settle{0%{opacity:.35}18%,65%{opacity:1}100%{opacity:.65}}\n@container(max-width:680px){.flow-map{gap:18px}.actor-state{font-size:9px}.wire-route,.wire-head{stroke-width:1.6}}\n.header-actions{display:flex;flex-direction:column;align-items:flex-end;gap:17px;flex-shrink:0}.scenario-tabs{display:flex;gap:3px;margin:0;padding:4px;border:1px solid #d4dfcd;border-radius:10px;background:#e8efe1}.scenario-tabs label{position:relative;cursor:pointer}.scenario-tabs input{position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}.scenario-tabs span{display:block;padding:8px 13px;border:1px solid transparent;border-radius:7px;color:#71806a;font-size:11px;font-weight:600;white-space:nowrap;transition:background .15s,color .15s,box-shadow .15s}.scenario-tabs input:checked+span{color:#31583c;background:#fffefa;border-color:#d1deca;box-shadow:0 1px 3px #3f5e2910}.scenario-tabs input:focus-visible+span{outline:3px solid #5b8eaa;outline-offset:2px}.scenario-tabs label:has(input:disabled){cursor:not-allowed}.scenario-tabs input:disabled{cursor:not-allowed}.scenario-tabs input:disabled+span{opacity:.55}.scenario-tabs input:checked:disabled+span{opacity:1}\n@container(max-width:680px){.page-header{display:block}.header-actions{align-items:stretch;margin-top:17px;gap:0}.scenario-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:3px;width:100%;border-radius:9px}.scenario-tabs span{padding:9px 7px;text-align:center;font-size:11px}.header-actions .reset{position:absolute;right:-8px;top:-8px}}\n`;\n","import { createCheckoutModel } from './model.mjs';\nimport { template, skin } from './assets';\n\nexport function mountCheckoutRuntime(host, definition, options = {}) {\nconst document = host.ownerDocument;\nconst environment = document.defaultView;\nif (!environment) throw new Error('checkout requires a browser document');\nconst scope = host.shadowRoot ?? host.attachShadow({ mode: 'open' });\n// 見た目は再生の部品が渡す口で図の影の根へ入れ、style要素を作らない (#3695)。口を渡さずに直に置いた時は影の根にstyle要素で入れる\nscope.innerHTML = options.styles ? template : `<style>${skin}</style>${template}`;\noptions.styles?.adopt('dragon-checkout-css', skin, scope);\nconst { UNIT_PRICE, DELIVERY, QUANTITY, BUDGET, PRODUCT, PARTIES, initialState, transition, viewOf } = createCheckoutModel(definition);\nlet disposed = false;\nconst $ = id => scope.querySelector(`[id=\"${id}\"]`);\nconst yen = n => `${n.toLocaleString('ja-JP')}円`;\nconst timers = new Set();\nconst effects = new Set();\nlet transferVersion = 0;\nlet pulseVersion = 0;\nlet inspectedActor = false;\nconst reduceMotion = environment.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ?? false;\nlet state = initialState();\n$('lab').dataset.reducedMotion = String(reduceMotion);\n\nconst heading = scope.querySelector('h1'); heading.textContent = definition.title;\nscope.querySelector('.intro').textContent = definition.note;\nscope.querySelector('.product-info h3').textContent = PRODUCT.name;\nscope.querySelector('.product-category').textContent = PRODUCT.options.merchant;\nscope.querySelector('.product-info p strong').textContent = yen(UNIT_PRICE);\nscope.querySelector('.product-info p').lastChild.textContent = ` / 1${PRODUCT.options.unit}・税込み`;\nscope.querySelector('.quantity small').textContent = `最大${QUANTITY.max}${PRODUCT.options.unit}`;\n$('qty-down').setAttribute('aria-label', `数量を1${PRODUCT.options.unit}減らす`);\n$('qty-up').setAttribute('aria-label', `数量を1${PRODUCT.options.unit}増やす`);\nconst of = kind => definition.blocks.find(block => block.kind === kind);\nscope.querySelector('.flow-heading h2').textContent = of('flow').name;\nscope.querySelector('.delivery-options legend').textContent = of('delivery').name;\nscope.querySelector('.budget-head label').textContent = of('budget').name;\nscope.querySelector('.quote-total > div > span').textContent = of('total').name;\n$('budget').setAttribute('aria-label', of('budget').name);\nfor (const key of ['min','max','step']) $('budget').setAttribute(key, String(BUDGET[key]));\nscope.querySelector('.range-ticks').replaceChildren(...[BUDGET.min, BUDGET.max].map(value => { const span = document.createElement('span'); span.textContent = yen(value); return span; }));\nfor (const button of scope.querySelectorAll('[data-actor]')) {\n const part = PARTIES[button.dataset.actor];\n button.querySelector('strong').textContent = part.name;\n button.querySelector('.actor-top small').textContent = part.options.note;\n button.querySelector('use').setAttribute('href', '#i-' + part.options.icon);\n button.dataset.dragonBlock = part.id;\n}\nfor (const input of scope.querySelectorAll('input[name=\"mode\"]')) {\n const part = definition.blocks.find(block => block.kind === 'scenario' && block.options.outcome === input.value);\n input.nextElementSibling.textContent = part.name;\n input.closest('label').dataset.dragonBlock = part.id;\n}\nfor (const [kind, selector] of Object.entries({ product:'.product',delivery:'.delivery-options',budget:'.budget-head',total:'.quote',approval:'.approval',payment:'.permit',order:'.order-result',flow:'.flow-map' })) scope.querySelector(selector).dataset.dragonBlock = of(kind).id;\nif (PRODUCT.options.art !== 'shoe') scope.querySelector('.product-art').innerHTML = '<svg aria-hidden=\"true\"><use href=\"#i-bag\"/></svg>';\n\nfor (const [id, method] of Object.entries(DELIVERY)) {\n const label = document.createElement('label');\n label.className = 'delivery-option';\n const input = document.createElement('input');\n input.type = 'radio'; input.name = 'delivery'; input.value = id; input.setAttribute('aria-label', method.name);\n const card = document.createElement('span'); card.className = 'delivery-card';\n const art = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); art.setAttribute('aria-hidden', 'true');\n const use = document.createElementNS('http://www.w3.org/2000/svg', 'use'); use.setAttribute('href', '#i-' + method.icon); art.append(use);\n const name = document.createElement('strong'); name.textContent = method.name;\n const price = document.createElement('em'); price.textContent = method.fee.toLocaleString('ja-JP');\n const currency = document.createElement('small'); currency.textContent = '円'; price.append(currency);\n const note = document.createElement('small'); note.textContent = method.note;\n card.append(art, name, price, note); label.append(input, card);\n input.addEventListener('change', () => dispatch({ type: 'TERMS', delivery: id }));\n $('delivery-options').append(label);\n}\n\nfunction later(fn, delay) {\n const timer = environment.setTimeout(() => { timers.delete(timer); fn(); }, delay);\n timers.add(timer);\n}\n\nfunction sendLater(from, to, delay, color, label, amount) {\n const version = transferVersion;\n later(() => { if (version === transferVersion) pulse(from, to, color, label, amount); }, delay);\n}\n\nfunction emphasize(id, tone = 'good') {\n if (reduceMotion || $(id).hidden) return;\n const effect = $(id).animate([\n { transform: 'translateY(3px)', boxShadow: `0 0 0 4px ${tone === 'warning' ? '#cc935b55' : '#81a96b55'}` },\n { transform: 'translateY(0)', boxShadow: '0 0 0 0 transparent' },\n ], { duration: 900, easing: 'cubic-bezier(.2,.8,.2,1)' });\n effects.add(effect);\n effect.finished.then(() => effects.delete(effect), () => effects.delete(effect));\n}\n\nfunction dispatch(event) {\n const before = state;\n const next = transition(state, event);\n if (disposed || next === state) return;\n state = next;\n if (!['FOCUS', 'MODE'].includes(event.type)) {\n transferVersion++;\n pulseVersion++;\n for (const actor of scope.querySelectorAll('[data-actor]')) { delete actor.dataset.transfer; delete actor.dataset.bypass; }\n delete $('transfer').dataset.active;\n activeRoute = undefined;\n }\n if (event.type === 'RESET') {\n inspectedActor = false;\n for (const timer of timers) environment.clearTimeout(timer);\n timers.clear();\n activeRoute = undefined;\n for (const effect of effects) effect.cancel();\n effects.clear();\n for (const actor of scope.querySelectorAll('[data-actor]')) delete actor.dataset.transfer;\n delete $('transfer').dataset.active;\n $('transfer').textContent = '条件を変えると購入に関わるやり取りがここに現れます。';\n }\n render();\n const { session, revision, attempt } = state;\n if (event.type === 'TERMS') {\n pulse('buyer', 'agent', '#518563', '数量・配送の変更を伝える');\n sendLater('agent', 'seller', 800, '#518563', '新しい合計を問い合わせる');\n later(() => dispatch({ type: 'QUOTE_READY', session, revision }), 1700);\n if (before.approval) emphasize('approval', 'warning');\n } else if (event.type === 'QUOTE_READY') {\n pulse('seller', 'agent', '#518563', '再計算した購入条件を返す', state.quote.total);\n sendLater('agent', 'buyer', 900, '#518563', '最新の合計を提示する', state.quote.total);\n emphasize('quote');\n } else if (event.type === 'APPROVE') {\n pulse('buyer', 'agent', '#518563', 'この購入条件を承認する', state.approval.total);\n emphasize('approval');\n } else if (event.type === 'BUY') {\n pulse('agent', 'payment', '#518563', '支払いの委任を要求', state.approval.total);\n later(() => dispatch({ type: 'TOKEN_READY', session, attempt }), reduceMotion ? 120 : 900);\n later(() => dispatch({ type: 'SETTLE', session, attempt }), reduceMotion ? 450 : 3800);\n } else if (event.type === 'TOKEN_READY') {\n const amount = state.token.maxAmount;\n pulse('payment', 'agent', '#518563', '上限付きトークンを返す', amount);\n sendLater('agent', 'seller', 900, '#518563', 'トークンを渡す', amount);\n sendLater('seller', 'payment', 1800, '#518563', '決済を要求', amount);\n emphasize('permit');\n } else if (event.type === 'SETTLE') {\n pulse('payment', 'seller', state.phase === 'declined' ? '#b76743' : '#4e8761', state.phase === 'declined' ? '決済の拒否を返す' : '決済の成功を返す', before.token.maxAmount);\n emphasize('coach', state.phase === 'declined' ? 'warning' : 'good');\n if (state.order) emphasize('merchant-order');\n if (state.phase === 'ordered') {\n sendLater('seller', 'agent', 900, '#518563', '成立した注文を返す', state.order.total);\n sendLater('agent', 'buyer', 1800, '#518563', '注文成立を知らせる', state.order.total);\n emphasize('order-result');\n }\n } else if (event.type === 'RECONCILE_START') {\n pulse('agent', 'seller', '#518563', '同じ購入の結果を問い合わせる');\n later(() => dispatch({ type: 'RECONCILE', session }), 1200);\n } else if (event.type === 'RECONCILE') {\n pulse('seller', 'agent', '#518563', '既存の注文を返す', state.order.total);\n emphasize('order-result');\n } else if (event.type === 'BUDGET' && before.approval && !state.approval) {\n pulse('buyer', 'agent', '#c58d4c');\n }\n}\n\nfunction actorDescriptions(s, v) {\n return {\n buyer: v.approved ? `あなたが承認したのは${yen(s.approval.total)}・${DELIVERY[s.approval.delivery].name}です。予算を増やしても、承認した金額が自動で増えるわけではありません。` : `あなたの予算は${yen(s.budget)}です。予算内でも、購入条件を確認して承認するまでは購入を進めません。`,\n agent: s.phase === 'unknown' ? '店からの応答が届いていません。新しい購入を送るのではなく、同じ購入の状態を確認します。' : s.phase === 'reconciling' ? '同じ購入の最新状態を販売事業者に問い合わせています。追加の決済は行いません。' : s.phase === 'ordered' ? '店が返した注文を購入者へ伝えました。注文の確認と配送の完了は別です。' : v.pending ? '数量や配送の変更を販売事業者へ伝えています。販売事業者の新しい返答を待ち、手元の古い金額で確定しません。' : v.gap < 0 ? '返された合計が予算を超えているため、購入の完了を要求しません。条件の変更を待っています。' : v.approved ? '最新の購入条件が承認されています。この購入に使う支払い情報を用意できます。' : '販売事業者が返した最新の購入内容を示し、購入者の承認を待っています。',\n seller: s.order ? `店側では${yen(s.order.total)}の注文が1件成立しています。エージェントへ応答が届いたかどうかとは別の状態です。` : v.pending ? `変更を受けて販売条件を計算し直しています。この例では商品${yen(UNIT_PRICE)}×数量に、選んだ配送方法の送料を加えます。` : `商品と配送方法を確認し、合計${yen(s.quote.total)}を返しています。正式な購入内容を計算するのは販売事業者です。`,\n payment: s.token ? `今回の購入・${s.token.merchant}・上限${yen(s.token.maxAmount)}という条件で支払いを扱います。トークンの発行と決済の成功は別です。` : s.phase === 'declined' ? 'この決済は拒否しました。購入者が承認していても、決済が成功したことにはなりません。' : 'まだ支払いは要求されていません。購入者の承認を得た後にこの購入に限った支払いを処理します。',\n };\n}\n\nfunction render() {\n const s = state;\n const v = viewOf(s);\n const reconciling = s.phase === 'reconciling';\n const busy = v.pending || s.phase === 'processing' || reconciling;\n $('scene-title').textContent = v.title;\n $('scene-description').textContent = v.description;\n $('coach').dataset.tone = ['over_budget', 'unknown'].includes(s.phase) ? 'warning' : s.phase === 'declined' ? 'error' : ['approved', 'ordered'].includes(s.phase) ? 'good' : 'neutral';\n $('coach').dataset.busy = String(busy);\n $('phase-label').textContent = { quoting: '購入条件を更新', over_budget: '購入条件を確認', ready: '購入者の承認待ち', approved: '最新条件を承認済み', processing: '支払いを処理', declined: '決済が失敗', unknown: '購入結果は未確認', reconciling: '注文結果を確認中', ordered: '注文成立' }[s.phase];\n\n $('quantity').textContent = `${s.qty}${PRODUCT.options.unit}`;\n $('qty-down').disabled = v.lockedInputs || s.qty === QUANTITY.min;\n $('qty-up').disabled = v.lockedInputs || s.qty === QUANTITY.max;\n for (const input of scope.querySelectorAll('input[name=\"delivery\"]')) {\n input.checked = input.value === s.delivery; input.disabled = v.lockedInputs;\n }\n $('quote').dataset.pending = String(v.pending);\n $('quote').setAttribute('aria-busy', String(v.pending));\n $('quote-badge').dataset.pending = String(v.pending);\n $('quote-badge').textContent = v.pending ? '更新中' : '最新';\n $('subtotal').textContent = v.pending ? '再計算中' : yen(s.quote.subtotal);\n $('shipping-fee').textContent = v.pending ? '—' : yen(s.quote.fee);\n $('total').innerHTML = v.pending ? '···' : `${s.quote.total.toLocaleString('ja-JP')}<small>円</small>`;\n $('quote-detail').textContent = v.pending ? '最新の返答を待っています' : `${DELIVERY[s.quote.delivery].name}・${s.quote.qty}${PRODUCT.options.unit}・税込み`;\n $('budget-gap').dataset.over = String(v.gap < 0);\n $('budget-gap').textContent = v.pending ? 'エージェントが変更を伝えています' : v.gap < 0 ? `予算を${yen(-v.gap)}超えています` : v.gap === 0 ? '送料込みで予算ちょうどです' : `予算まで${yen(v.gap)}あります`;\n $('budget').value = s.budget;\n $('budget').disabled = v.lockedInputs;\n $('budget').setAttribute('aria-valuetext', yen(s.budget));\n $('budget').style.background = `linear-gradient(to right,#6c9365 ${(s.budget - BUDGET.min) / (BUDGET.max - BUDGET.min) * 100}%,#d8e4cf 0)`;\n $('budget-value').innerHTML = `${s.budget.toLocaleString('ja-JP')}<small>円</small>`;\n\n $('approval').dataset.approved = String(v.approved);\n $('approval-status').textContent = v.approved ? `${yen(s.approval.total)}の条件を承認済み` : '最新の購入条件はまだ未承認';\n $('approval-mark').textContent = v.approved ? '✓ 承認済み' : '承認待ち';\n $('approval-detail').textContent = v.approved ? `${s.approval.qty}${PRODUCT.options.unit}・${DELIVERY[s.approval.delivery].name}を承認しています。数量や配送を変えると承認が無効になります。` : v.pending ? '販売事業者が返す新しい購入条件を待っています。' : `合計${yen(s.quote.total)}・${DELIVERY[s.quote.delivery].name}を確認して承認します。`;\n $('revoke').hidden = !v.approved || v.lockedInputs;\n $('approval-notice').hidden = !s.notice;\n $('approval-notice').textContent = s.notice;\n $('approve').disabled = !v.canApprove;\n $('approve').dataset.done = String(v.approved);\n $('approve').setAttribute('aria-busy', String(v.pending));\n $('approve').textContent = v.approved ? '✓ この購入条件は承認済み' : v.pending ? '購入条件を更新しています' : v.gap < 0 ? '予算を超えるため承認できません' : `${yen(s.quote.total)}の条件を承認する`;\n\n $('permit').dataset.issued = String(Boolean(s.token));\n $('permit-title').textContent = s.token ? `この購入・上限${yen(s.token.maxAmount)}` : 'この購入に限った支払い';\n $('permit-detail').textContent = s.token ? `${s.token.merchant}で有効期限内に使えるトークンです。会話の予算${yen(s.budget)}とは別の制約です。` : v.approved ? `承認した${yen(s.approval.total)}に限定した支払いを用意します。` : '購入条件が承認された後に支払いに使う情報を用意します。';\n $('buy').disabled = !v.canBuy;\n $('buy').hidden = ['unknown', 'reconciling', 'ordered'].includes(s.phase);\n $('buy').setAttribute('aria-busy', String(s.phase === 'processing'));\n $('buy').textContent = s.phase === 'processing' ? s.token ? '利用条件を照合して決済しています' : '支払いを準備しています' : s.phase === 'declined' ? '同じ購入条件でもう一度試す' : v.approved ? `${yen(s.approval.total)}で購入を試す` : '承認して購入を試す';\n $('reconcile').hidden = !['unknown', 'reconciling'].includes(s.phase);\n $('reconcile').disabled = reconciling;\n $('reconcile').setAttribute('aria-busy', String(reconciling));\n $('reconcile').textContent = reconciling ? '注文の結果を確認しています' : '同じ購入の結果を確認する';\n $('order-result').hidden = s.phase !== 'ordered';\n $('order-result').replaceChildren();\n if (s.phase === 'ordered') {\n const title = document.createElement('strong'); title.textContent = '注文が1件成立しました';\n const description = document.createElement('p'); description.textContent = `${yen(s.order.total)}・${DELIVERY[s.order.delivery].name}・${s.order.qty}${PRODUCT.options.unit}。発送と配達はこの後です。`;\n $('order-result').append(title, description);\n }\n $('merchant-order').hidden = !s.order;\n $('merchant-order-detail').textContent = s.order ? `${yen(s.order.total)}・${DELIVERY[s.order.delivery].name} / 決済の成立は${s.chargeCount}回` : '';\n $('button-hint').textContent = ['unknown', 'reconciling'].includes(s.phase) ? '結果を確認しても追加の決済は行いません。' : s.phase === 'ordered' ? '別の条件を試す時は右上から最初に戻せます。' : s.phase === 'processing' ? '処理中は数量や配送を変更できません。' : v.approved ? '条件を変えたら改めて承認します。' : '予算内でも承認なしには購入を進めません。';\n for (const input of scope.querySelectorAll('input[name=\"mode\"]')) {\n input.checked = input.value === s.mode; input.disabled = v.lockedInputs;\n }\n renderActors(s, v);\n drawLinks();\n}\n\nfunction renderActors(s, v) {\n const actorStates = {\n buyer: [s.phase === 'ordered' ? '注文を確認済み' : v.approved ? '最新条件を承認済み' : v.gap < 0 ? '予算を超過' : '条件を確認', s.phase === 'unknown' ? 'warning' : v.approved ? 'good' : v.gap < 0 ? 'warning' : 'neutral'],\n agent: [{ quoting: '条件を伝える', over_budget: '購入を止める', ready: '承認を待つ', approved: '購入の準備', processing: '支払いを依頼', declined: '失敗を伝える', unknown: '結果は未確認', reconciling: '注文を確認中', ordered: '注文を伝える' }[s.phase], ['over_budget', 'unknown', 'declined'].includes(s.phase) ? 'warning' : ['quoting', 'processing', 'reconciling'].includes(s.phase) ? 'busy' : v.approved ? 'good' : 'neutral'],\n seller: [s.order ? '注文が1件成立' : v.pending ? '合計を再計算' : `合計${yen(s.quote.total)}`, v.pending ? 'busy' : 'good'],\n payment: [s.order ? '決済済み' : s.phase === 'declined' ? '決済を拒否' : s.phase === 'processing' ? s.token ? '利用条件を照合' : 'トークンを発行' : 'まだ呼ばれない', s.order ? 'good' : s.phase === 'declined' ? 'warning' : s.phase === 'processing' ? 'busy' : 'muted'],\n };\n for (const button of scope.querySelectorAll('[data-actor]')) {\n const id = button.dataset.actor;\n $('actor-' + id).textContent = actorStates[id][0];\n button.dataset.state = actorStates[id][1];\n button.classList.toggle('selected', s.focus === id);\n button.setAttribute('aria-pressed', String(s.focus === id));\n }\n const name = PARTIES[s.focus].name;\n const title = document.createElement('strong'); title.textContent = name;\n const description = document.createElement('span'); description.textContent = actorDescriptions(s, v)[s.focus];\n $('actor-note').replaceChildren(title, description);\n $('actor-note').hidden = !inspectedActor;\n}\n\nlet activeRoute;\nlet flowDrawKey;\nfunction anchors() {\n const parent = $('flow-map').getBoundingClientRect();\n return Object.fromEntries([...scope.querySelectorAll('[data-actor]')].map(el => {\n const r = el.getBoundingClientRect();\n const party = PARTIES[el.dataset.actor];\n return [party.id, {x:r.left-parent.x,y:r.top-parent.y,w:r.width,h:r.height}];\n }));\n}\nfunction drawLinks() {\n if (!$('flow-map').clientWidth) return;\n const ports = anchors();\n const key = JSON.stringify([ports, activeRoute, pulseVersion]);\n if (key === flowDrawKey) return;\n flowDrawKey = key;\n const output = options.drawFlow(ports, activeRoute);\n $('flow-svg').innerHTML = options.styles ? options.styles.markup(output.svg) : output.svg;\n const svg = $('flow-svg').firstElementChild;\n svg.setAttribute('width', $('flow-map').clientWidth);\n svg.setAttribute('height', $('flow-map').clientHeight);\n svg.setAttribute('preserveAspectRatio', 'none');\n svg.style.setProperty('--play', activeRoute && !reduceMotion ? 'running' : 'paused');\n // Native timeline is played once for each input action, then held at arrival.\n const total = output.timeline.total;\n svg.style.setProperty('--T', '.7s');\n if (!activeRoute) {\n for (const item of svg.querySelectorAll('.dg-a')) item.style.visibility = 'hidden';\n }\n else later(() => {\n if (svg !== $('flow-svg').firstElementChild) return;\n svg.style.setProperty('--play','paused');\n svg.style.setProperty('--at', String(Math.min(total, output.timeline.last) * .7 / total));\n }, 700);\n}\nfunction pulse(from, to, _color = '#518563', label = '', amount = null) {\n const names = Object.fromEntries(Object.entries(PARTIES).map(([role, block]) => [role, block.name]));\n if (label) {\n const route = document.createElement('span'); route.className = 'transfer-route'; route.textContent = `${names[from]} → ${names[to]}`;\n const action = document.createElement('span'); action.className = 'transfer-action'; action.textContent = label;\n $('transfer').replaceChildren(route, action);\n if (amount !== null) {\n const value = document.createElement('span'); value.className = 'transfer-amount'; value.textContent = yen(amount);\n $('transfer').append(value);\n }\n }\n if (reduceMotion) return;\n const roles = ['buyer', 'agent', 'seller', 'payment'];\n const first = Math.min(roles.indexOf(from), roles.indexOf(to));\n const last = Math.max(roles.indexOf(from), roles.indexOf(to));\n for (const actor of scope.querySelectorAll('[data-actor]')) {\n delete actor.dataset.transfer;\n actor.dataset.bypass = String(roles.indexOf(actor.dataset.actor) > first && roles.indexOf(actor.dataset.actor) < last);\n }\n scope.querySelector(`[data-actor=\"${from}\"]`).dataset.transfer = 'sending';\n $('transfer').dataset.active = 'true';\n const version = ++pulseVersion;\n later(() => {\n if (version !== pulseVersion) return;\n delete scope.querySelector(`[data-actor=\"${from}\"]`).dataset.transfer;\n scope.querySelector(`[data-actor=\"${to}\"]`).dataset.transfer = 'received';\n later(() => {\n if (version !== pulseVersion) return;\n delete scope.querySelector(`[data-actor=\"${to}\"]`).dataset.transfer;\n delete $('transfer').dataset.active;\n }, 450);\n }, 700);\n activeRoute = undefined;\n activeRoute = {from:PARTIES[from].id, to:PARTIES[to].id};\n drawLinks();\n}\n\n$('qty-down').addEventListener('click', () => dispatch({ type: 'TERMS', qty: state.qty - 1 }));\n$('qty-up').addEventListener('click', () => dispatch({ type: 'TERMS', qty: state.qty + 1 }));\n$('budget').addEventListener('input', event => dispatch({ type: 'BUDGET', value: Number(event.target.value) }));\n$('approve').addEventListener('click', () => dispatch({ type: 'APPROVE' }));\n$('revoke').addEventListener('click', () => dispatch({ type: 'REVOKE' }));\n$('buy').addEventListener('click', () => dispatch({ type: 'BUY' }));\n$('reconcile').addEventListener('click', () => dispatch({ type: 'RECONCILE_START' }));\n$('reset').addEventListener('click', () => dispatch({ type: 'RESET' }));\nfor (const input of scope.querySelectorAll('input[name=\"mode\"]')) input.addEventListener('change', () => dispatch({ type: 'MODE', mode: input.value }));\nfor (const button of scope.querySelectorAll('[data-actor]')) button.addEventListener('click', () => {\n inspectedActor = !inspectedActor || state.focus !== button.dataset.actor;\n dispatch({ type: 'FOCUS', actor: button.dataset.actor });\n renderActors(state, viewOf(state));\n});\nconst onResize = () => {\n drawLinks();\n options.onResize?.(Math.ceil($('lab').getBoundingClientRect().height));\n};\nconst observer = environment.ResizeObserver ? new environment.ResizeObserver(onResize) : undefined;\nobserver?.observe($('lab'));\nif (!observer) environment.addEventListener('resize', onResize);\nrender();\nreturn {\n definition,\n dispatch,\n getState: () => globalThis.structuredClone(state),\n destroy() {\n if (disposed) return;\n disposed = true;\n observer?.disconnect();\n environment.removeEventListener('resize', onResize);\n for (const timer of timers) environment.clearTimeout(timer);\n for (const effect of effects) effect.cancel();\n timers.clear(); effects.clear(); scope.replaceChildren();\n },\n};\n}\n","/** Native purchase kind. Ports, edges and carriers use the shared SVG pipeline. */\nimport { CHECKOUT_MARKER, layoutCheckout, type PurchaseLayout } from \"./checkout/layout\";\nimport type { KindParts } from \"./parts\";\nimport { isCheckoutNotation, parseCheckout } from \"../checkout/read\";\nimport { definitionOf, purchaseNotation, validatePurchase, modelOf, diagramOf, checkoutModel } from \"../checkout/definition\";\nimport { mountCheckoutRuntime } from \"../checkout/runtime.mjs\";\nimport { fromModel } from \"../model\";\nimport { markParsed } from \"../parsed\";\nimport { renderDiagram } from \"../render/draw\";\nimport { card } from \"../blocks/box/draw\";\nimport type { Player } from \"../player\";\n\nconst mounted = new WeakMap<HTMLElement, Player>();\nexport const parts: KindParts<PurchaseLayout> = {\n ownBoxes: true,\n model: {from: diagramOf, to: checkoutModel},\n validate: validatePurchase,\n times(_diagram, timeline) {\n if (timeline.edges.length !== 1) return timeline;\n return {...timeline,total:4,last:3.8,steps:[{start:0,end:3.2}],\n edges:timeline.edges.map(e=>({...e,start:.1,drawn:3,end:3.2})),\n carriers:timeline.carriers.map(c=>({...c,start:0,depart:.1,arrive:3,end:3.6})),stills:[3.3]};\n },\n notation: {\n matches: isCheckoutNotation,\n print: diagram => purchaseNotation(definitionOf(diagram)),\n read(text) {\n const read = parseCheckout(text);\n return read.ok ? { ok:true, diagram:markParsed(fromModel(modelOf(read.definition), 2)) } : read;\n },\n },\n layout: layoutCheckout,\n draw(layout, _diagram, ctx, subs) {\n const compact = layout.edges.some(e=>Math.abs(e.points[1]![0]-e.points[0]![0])<28);\n return { css: `.dg{background:transparent}.dg-bg{display:none}.dg-env{transform:scale(.52);fill:#fffefa;stroke:#518563;stroke-width:2.2;filter:none}.dg-env-in{transform:scale(.52);fill:none;stroke:#518563;stroke-width:1.5}.dg-e{stroke-dasharray:none;stroke:#c2d1bc;stroke-width:1.4}.dg-e-on,.dg-eh-on{stroke-width:1.8}${compact?'.dg-env{x:-1.5px;y:-1.5px;width:3px;height:3px;rx:1.5px;transform:none;fill:#518563;stroke:#fffefa;stroke-width:.6}.dg-env-in{display:none}':''}`,\n top: layout.overlay ? layout.edges.map(e=>{\n const time=ctx.t.carriers.find(c=>c.step===e.step&&c.event===e.event);\n if(!time)return '';\n const [x,y]=e.points.at(-1)!;\n const animation=ctx.m.kf([[0,{opacity:0}],[time.arrive,{opacity:0,r:'2px'}],[time.arrive+.08,{opacity:.7,r:'3px'}],[time.end,{opacity:0,r:'7px'}],[ctx.m.total,{opacity:0}]]);\n return `<circle class=\"dg-a\" cx=\"${x}\" cy=\"${y}\" r=\"2\" fill=\"none\" stroke=\"#518563\" stroke-width=\"1.3\" style=\"${animation}\"/>`;\n }).join('') : '',\n node: layout.overlay ? \"\" : `<g ${CHECKOUT_MARKER}=\"\">${layout.boxes.map(b => card(b,ctx,[],subs.get(b.id) ?? [])).join(\"\")}</g>` };\n },\n mountInput(host, diagram, options) {\n mounted.get(host)?.destroy();\n const definition = definitionOf(diagram);\n const input = mountCheckoutRuntime(host, definition, { ...options, drawFlow(anchors: Record<string,{x:number;y:number;w:number;h:number}>, route?:{from:string;to:string}) {\n const source = structuredClone(diagram);\n if (route) source.steps = [{title:\"送受信\",body:\"購入条件と注文の情報を伝える\",events:[{type:\"edge\",from:route.from,to:route.to,carry:{kind:\"envelope\"}}]}];\n const rendered = renderDiagram(source,{...options, anchors, overlay:true, width:host.clientWidth});\n return { svg:rendered.svg, timeline:rendered.timeline };\n } });\n const player: Player = {\n get step(){return input.getState().eventCount;}, get playing(){return false;}, diagram,\n dispatch:event=>input.dispatch(event), getState:()=>input.getState(),\n next(){},prev(){},play(){},pause(){},goTo(){},setSpeed(){},mark(){},destroy:()=>input.destroy(),\n };\n mounted.set(host,player);\n return player;\n },\n};\n"]}