pmx-canvas 0.9.3 → 0.11.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 (237) hide show
  1. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  2. package/.github/extensions/pmx-canvas/tools.json +9418 -2016
  3. package/CHANGELOG.md +54 -1
  4. package/dist/canvas/chunks/abnfDiagram-N423BO3Z-p8dtp6va.js +1 -0
  5. package/dist/canvas/chunks/architecture-TIHT7OUA-9tffvpsv.js +1 -0
  6. package/dist/canvas/chunks/architectureDiagram-T3A2C74G-5jhmxrzf.js +36 -0
  7. package/dist/canvas/chunks/blockDiagram-VBNYF7ZC-pw1fa9yb.js +132 -0
  8. package/dist/canvas/chunks/c4Diagram-5PPSVZJV-x07nq0tt.js +10 -0
  9. package/dist/canvas/chunks/classDiagram-JCYQIIEL-nc6g5x1r.js +1 -0
  10. package/dist/canvas/chunks/classDiagram-v2-OCEON4UE-0qnbpwvh.js +1 -0
  11. package/dist/canvas/chunks/cose-bilkent-JH36ORCC-nm39npq0.js +1 -0
  12. package/dist/canvas/chunks/cynefin-VYW2F7L2-ys8p46ts.js +1 -0
  13. package/dist/canvas/chunks/cynefinDiagram-MW4NZA55-vdxrwahz.js +62 -0
  14. package/dist/canvas/chunks/dagre-VZM6K2ZE-bqdm7wpd.js +4 -0
  15. package/dist/canvas/chunks/diagram-7IWD3JNH-gs5gpr93.js +30 -0
  16. package/dist/canvas/chunks/diagram-B4RE2ZJO-cgwjg47s.js +3 -0
  17. package/dist/canvas/chunks/diagram-LBJQPF4R-w3vahpav.js +24 -0
  18. package/dist/canvas/chunks/diagram-Q27KOJAE-42837z6h.js +24 -0
  19. package/dist/canvas/chunks/diagram-UB23O5K3-4fz83q59.js +41 -0
  20. package/dist/canvas/chunks/ebnfDiagram-BXEA7PRR-zphtgegj.js +1 -0
  21. package/dist/canvas/chunks/erDiagram-JOGREHBK-zvbbdxp4.js +85 -0
  22. package/dist/canvas/chunks/eventmodeling-45OFAUF4-v9q6dn4c.js +1 -0
  23. package/dist/canvas/chunks/flowDiagram-UKHOOZJN-yrr5z8tc.js +1 -0
  24. package/dist/canvas/chunks/ganttDiagram-PKOTCBZU-282jzycm.js +292 -0
  25. package/dist/canvas/chunks/gitGraph-TEB2WS4Q-kdwb8m0a.js +1 -0
  26. package/dist/canvas/chunks/gitGraphDiagram-DS77QQ5N-vqqy6p1b.js +106 -0
  27. package/dist/canvas/chunks/index-0rk4gp1g.js +2 -0
  28. package/dist/canvas/chunks/index-194m3hc3.js +2 -0
  29. package/dist/canvas/chunks/index-1r72hdzb.js +301 -0
  30. package/dist/canvas/chunks/index-353m7b0p.js +2 -0
  31. package/dist/canvas/chunks/index-3cy1bzwh.js +2 -0
  32. package/dist/canvas/chunks/index-5tv8v1hk.js +1 -0
  33. package/dist/canvas/chunks/index-6ceya556.js +332 -0
  34. package/dist/canvas/chunks/index-6qmsnxwy.js +4 -0
  35. package/dist/canvas/chunks/index-d3b3gqe9.js +2 -0
  36. package/dist/canvas/chunks/index-fjtdggjn.js +2 -0
  37. package/dist/canvas/chunks/index-g3pwnqeb.js +2 -0
  38. package/dist/canvas/chunks/index-gf4e0et4.js +2 -0
  39. package/dist/canvas/chunks/index-hj99nz1f.js +1 -0
  40. package/dist/canvas/chunks/index-nprm96xp.js +16 -0
  41. package/dist/canvas/chunks/index-qj8fxwsf.js +2 -0
  42. package/dist/canvas/chunks/index-r2fyc9w1.js +89 -0
  43. package/dist/canvas/chunks/index-rft2hcz5.js +2 -0
  44. package/dist/canvas/chunks/index-rh7nv68n.js +2 -0
  45. package/dist/canvas/chunks/index-s4j678gj.js +2 -0
  46. package/dist/canvas/chunks/index-tb1wf525.js +179 -0
  47. package/dist/canvas/chunks/index-vv56h019.js +2 -0
  48. package/dist/canvas/chunks/index-w2mra17t.js +207 -0
  49. package/dist/canvas/chunks/index-wgv7en21.js +232 -0
  50. package/dist/canvas/chunks/index-yw8h9vha.js +157 -0
  51. package/dist/canvas/chunks/info-DKCQHKI2-wpzs6sz3.js +1 -0
  52. package/dist/canvas/chunks/infoDiagram-6WML65LV-v1yvggqj.js +2 -0
  53. package/dist/canvas/chunks/ishikawaDiagram-WSZJBQD7-5hnq1a9p.js +70 -0
  54. package/dist/canvas/chunks/journeyDiagram-NVQOT4AX-zjcffveh.js +139 -0
  55. package/dist/canvas/chunks/kanban-definition-27J2QSJJ-dakqtfp1.js +89 -0
  56. package/dist/canvas/chunks/katex-dmg8k4zm.js +257 -0
  57. package/dist/canvas/chunks/mermaid.core-j2geswrd.js +12 -0
  58. package/dist/canvas/chunks/mindmap-definition-FAOFIHXS-142xhr3k.js +96 -0
  59. package/dist/canvas/chunks/packet-7NZHBO7P-xn439f0s.js +1 -0
  60. package/dist/canvas/chunks/pegDiagram-VL7TDLO6-5wvk7vsd.js +1 -0
  61. package/dist/canvas/chunks/pie-RZYD4A2V-0kf16rwh.js +1 -0
  62. package/dist/canvas/chunks/pieDiagram-7S7Q4E2Y-ztdhwycc.js +39 -0
  63. package/dist/canvas/chunks/quadrantDiagram-CIZ2JOQS-c5p9gmg6.js +7 -0
  64. package/dist/canvas/chunks/radar-I7S5WNFK-0g2pz36t.js +1 -0
  65. package/dist/canvas/chunks/railroad-3IZDKUUU-fcaran6j.js +1 -0
  66. package/dist/canvas/chunks/railroad-abnf-AHOZXSZD-wgdya41q.js +1 -0
  67. package/dist/canvas/chunks/railroad-ebnf-EBAXGLYW-gy07a4ka.js +1 -0
  68. package/dist/canvas/chunks/railroad-peg-LSFZ7HO6-ewk6wtkh.js +1 -0
  69. package/dist/canvas/chunks/railroadDiagram-AXF67PYL-xkmqkjwf.js +1 -0
  70. package/dist/canvas/chunks/requirementDiagram-LRYGKXZP-9wm2dyaw.js +84 -0
  71. package/dist/canvas/chunks/sankeyDiagram-W5VNT64P-2w19etgb.js +40 -0
  72. package/dist/canvas/chunks/sequenceDiagram-SI44F4Z6-0jn0vwmz.js +162 -0
  73. package/dist/canvas/chunks/sizeCapture-X5ZJPWSS-x75epwdq.js +1 -0
  74. package/dist/canvas/chunks/stateDiagram-OKZ733FA-schjpy6d.js +1 -0
  75. package/dist/canvas/chunks/stateDiagram-v2-UEYNNEHI-k8sfp2e7.js +1 -0
  76. package/dist/canvas/chunks/swimlanes-SLNWSIFB-gkw4xce3.js +1 -0
  77. package/dist/canvas/chunks/swimlanesDiagram-ULZ7WXOC-nqysw67j.js +8 -0
  78. package/dist/canvas/chunks/timeline-definition-Z64GVDOM-x7nkcy01.js +120 -0
  79. package/dist/canvas/chunks/treeView-QDETBFTQ-cesw6gp0.js +1 -0
  80. package/dist/canvas/chunks/treemap-6X3UGDF4-zdv4knp9.js +1 -0
  81. package/dist/canvas/chunks/vennDiagram-T6HMQDX7-x8dqn9yf.js +34 -0
  82. package/dist/canvas/chunks/wardley-OPB4EBWU-44pdddez.js +1 -0
  83. package/dist/canvas/chunks/wardleyDiagram-T6FBY63Y-t1j52t9r.js +78 -0
  84. package/dist/canvas/chunks/xychartDiagram-ELKLHX3M-38t16pme.js +7 -0
  85. package/dist/canvas/global.css +389 -229
  86. package/dist/canvas/index.js +141 -211
  87. package/dist/canvas/mcp-app.html +4205 -554
  88. package/dist/canvas/mermaid-entry.js +338 -338
  89. package/dist/canvas/surface-theme.css +6 -6
  90. package/dist/json-render/index.css +1 -1
  91. package/dist/json-render/index.js +49 -49
  92. package/dist/types/client/canvas/BarHint.d.ts +5 -3
  93. package/dist/types/client/canvas/CanvasNode.d.ts +0 -11
  94. package/dist/types/client/canvas/EdgeLayer.d.ts +1 -2
  95. package/dist/types/client/canvas/auto-fit.d.ts +4 -5
  96. package/dist/types/client/mermaid-entry.d.ts +1 -2
  97. package/dist/types/client/mermaid-render.d.ts +1 -0
  98. package/dist/types/client/nodes/BoardNode.d.ts +1 -1
  99. package/dist/types/client/nodes/ExtAppFrame.d.ts +7 -90
  100. package/dist/types/client/nodes/McpAppNode.d.ts +1 -25
  101. package/dist/types/client/nodes/MermaidNode.d.ts +1 -8
  102. package/dist/types/client/nodes/ViewerFrame.d.ts +29 -0
  103. package/dist/types/client/nodes/ViewerHost.d.ts +6 -0
  104. package/dist/types/client/nodes/iframe-document-url.d.ts +3 -9
  105. package/dist/types/client/nodes/primitive-copy.d.ts +5 -0
  106. package/dist/types/client/nodes/use-iframe-content-height.d.ts +1 -1
  107. package/dist/types/client/nodes/use-surface-frame.d.ts +4 -6
  108. package/dist/types/client/nodes/viewer-runtime-state.d.ts +2 -1
  109. package/dist/types/client/state/canvas-store.d.ts +3 -1
  110. package/dist/types/client/state/intent-bridge.d.ts +1 -0
  111. package/dist/types/client/state/presentation.d.ts +17 -6
  112. package/dist/types/json-render/server.d.ts +2 -1
  113. package/dist/types/mcp/canvas-access.d.ts +1 -12
  114. package/dist/types/mcp/resource-subscriptions.d.ts +7 -0
  115. package/dist/types/mcp/server.d.ts +2 -0
  116. package/dist/types/server/ax-wait.d.ts +1 -0
  117. package/dist/types/server/canvas-operations.d.ts +1 -0
  118. package/dist/types/server/canvas-state.d.ts +2 -0
  119. package/dist/types/server/index.d.ts +11 -6
  120. package/dist/types/server/operations/http.d.ts +10 -0
  121. package/dist/types/server/operations/index.d.ts +2 -2
  122. package/dist/types/server/operations/invoker.d.ts +4 -3
  123. package/dist/types/server/operations/mcp-contracts.d.ts +20 -0
  124. package/dist/types/server/operations/mcp.d.ts +2 -0
  125. package/dist/types/server/operations/ops/batch.d.ts +1 -0
  126. package/dist/types/server/operations/ops/boards.d.ts +0 -1
  127. package/dist/types/server/operations/registry.d.ts +2 -2
  128. package/dist/types/server/operations/types.d.ts +12 -2
  129. package/dist/types/server/server.d.ts +2 -0
  130. package/dist/types/server/tour-control.d.ts +13 -3
  131. package/dist/types/server/webpage-node.d.ts +1 -0
  132. package/dist/types/shared/ax-surface-protocol.d.ts +0 -9
  133. package/dist/types/shared/tour.d.ts +8 -0
  134. package/docs/api-reference.md +2 -2
  135. package/docs/cli.md +1 -1
  136. package/docs/design/Chrome.dc.html +32 -6
  137. package/docs/design/Types1.dc.html +3 -2
  138. package/docs/design/Types2.dc.html +1 -1
  139. package/docs/design/Types3.dc.html +1 -1
  140. package/docs/design/Zoom.dc.html +37 -60
  141. package/docs/design/canvas.json +1 -1
  142. package/docs/design.md +169 -4
  143. package/docs/http-api.md +82 -1
  144. package/docs/mcp.md +101 -21
  145. package/docs/node-types.md +38 -3
  146. package/docs/plans/plan-009-tech-debt-backlog.md +2 -2
  147. package/docs/plans/plan-019-post-0.9-roadmap.md +402 -13
  148. package/docs/product-vision-2026-09.md +9 -0
  149. package/docs/sdk.md +5 -2
  150. package/package.json +2 -2
  151. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  152. package/plugins/pmx-canvas/plugin.json +1 -1
  153. package/plugins/pmx-canvas/runtime.json +1 -1
  154. package/plugins/pmx-canvas/tools.json +9418 -2016
  155. package/skills/pmx-canvas/SKILL.md +19 -21
  156. package/skills/pmx-canvas/references/full-reference.md +44 -6
  157. package/skills/pmx-canvas/references/installing-pmx-canvas.md +7 -7
  158. package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +3 -5
  159. package/src/client/canvas/BarHint.tsx +6 -3
  160. package/src/client/canvas/CanvasNode.tsx +34 -47
  161. package/src/client/canvas/CanvasViewport.tsx +6 -7
  162. package/src/client/canvas/ContextMenu.tsx +63 -3
  163. package/src/client/canvas/EdgeLayer.tsx +365 -169
  164. package/src/client/canvas/ExpandedNodeOverlay.tsx +1 -2
  165. package/src/client/canvas/Presentation.tsx +53 -3
  166. package/src/client/canvas/ToolRail.tsx +2 -0
  167. package/src/client/canvas/TopBar.tsx +24 -9
  168. package/src/client/canvas/auto-fit.ts +9 -11
  169. package/src/client/canvas/canvas-area.ts +1 -1
  170. package/src/client/canvas/use-focus-trap.ts +6 -1
  171. package/src/client/mermaid-entry.ts +6 -20
  172. package/src/client/mermaid-render.ts +39 -0
  173. package/src/client/nodes/AxStepControls.tsx +45 -69
  174. package/src/client/nodes/BoardNode.tsx +65 -9
  175. package/src/client/nodes/ContextNode.tsx +88 -396
  176. package/src/client/nodes/ExtAppFrame.tsx +283 -1462
  177. package/src/client/nodes/FileNode.tsx +92 -81
  178. package/src/client/nodes/HtmlNode.tsx +8 -36
  179. package/src/client/nodes/LedgerNode.tsx +31 -17
  180. package/src/client/nodes/MarkdownNode.tsx +8 -17
  181. package/src/client/nodes/McpAppNode.tsx +48 -154
  182. package/src/client/nodes/MermaidNode.tsx +80 -69
  183. package/src/client/nodes/PromptNode.tsx +12 -14
  184. package/src/client/nodes/ResponseNode.tsx +8 -6
  185. package/src/client/nodes/StatusNode.tsx +22 -7
  186. package/src/client/nodes/StatusSummary.tsx +5 -3
  187. package/src/client/nodes/TraceNode.tsx +8 -8
  188. package/src/client/nodes/ViewerFrame.tsx +262 -0
  189. package/src/client/nodes/ViewerHost.tsx +41 -0
  190. package/src/client/nodes/WebpageNode.tsx +22 -24
  191. package/src/client/nodes/iframe-document-url.ts +20 -27
  192. package/src/client/nodes/primitive-copy.ts +97 -0
  193. package/src/client/nodes/use-iframe-content-height.ts +34 -10
  194. package/src/client/nodes/use-surface-frame.ts +22 -11
  195. package/src/client/nodes/viewer-runtime-state.ts +41 -35
  196. package/src/client/state/canvas-store.ts +18 -12
  197. package/src/client/state/intent-bridge.ts +1 -0
  198. package/src/client/state/presentation.ts +135 -15
  199. package/src/client/state/sse-bridge.ts +18 -19
  200. package/src/client/theme/global.css +389 -229
  201. package/src/client/theme/surface-theme.css +6 -6
  202. package/src/json-render/charts/tufte-components.tsx +44 -2
  203. package/src/json-render/renderer/index.css +62 -2
  204. package/src/json-render/renderer/index.tsx +31 -7
  205. package/src/json-render/server.ts +3 -2
  206. package/src/mcp/canvas-access.ts +6 -47
  207. package/src/mcp/resource-subscriptions.ts +181 -0
  208. package/src/mcp/server.ts +185 -219
  209. package/src/server/ax-wait.ts +21 -6
  210. package/src/server/board-export.ts +35 -24
  211. package/src/server/canvas-geometry.ts +1 -0
  212. package/src/server/canvas-operations.ts +6 -2
  213. package/src/server/canvas-state.ts +5 -0
  214. package/src/server/demo-state.json +106 -100
  215. package/src/server/html-primitives.ts +3 -9
  216. package/src/server/html-surface.ts +8 -0
  217. package/src/server/index.ts +30 -12
  218. package/src/server/operations/http.ts +69 -21
  219. package/src/server/operations/index.ts +8 -1
  220. package/src/server/operations/invoker.ts +53 -5
  221. package/src/server/operations/mcp-contracts.ts +354 -0
  222. package/src/server/operations/mcp.ts +153 -18
  223. package/src/server/operations/ops/ax-await.ts +18 -10
  224. package/src/server/operations/ops/ax-read.ts +2 -0
  225. package/src/server/operations/ops/ax-timeline.ts +2 -2
  226. package/src/server/operations/ops/batch.ts +27 -8
  227. package/src/server/operations/ops/boards.ts +1 -3
  228. package/src/server/operations/ops/nodes.ts +18 -3
  229. package/src/server/operations/ops/viewport.ts +11 -9
  230. package/src/server/operations/registry.ts +24 -4
  231. package/src/server/operations/types.ts +16 -2
  232. package/src/server/server.ts +17 -59
  233. package/src/server/tour-control.ts +66 -6
  234. package/src/server/webpage-node.ts +9 -4
  235. package/src/shared/ax-surface-protocol.ts +0 -11
  236. package/src/shared/content-height-reporter.ts +4 -3
  237. package/src/shared/tour.ts +8 -0
@@ -0,0 +1,4 @@
1
+ var Hn=Object.create;var{getPrototypeOf:Gn,defineProperty:ie,getOwnPropertyNames:Bn}=Object;var We=Object.prototype.hasOwnProperty;function Wn(n){return this[n]}var Yn,jn,K=(n,o,a)=>{var c=n!=null&&typeof n==="object";if(c){var u=o?Yn??=new WeakMap:jn??=new WeakMap,p=u.get(n);if(p)return p}a=n!=null?Hn(Gn(n)):{};let h=o||!n||!n.__esModule||!We.call(n,"default")?ie(a,"default",{value:n,enumerable:!0}):a;if(n&&typeof n==="object"||typeof n==="function"){for(let M of Bn(n))if(!We.call(h,M))ie(h,M,{get:Wn.bind(n,M),enumerable:!0})}if(c)u.set(n,h);return h};var se=(n,o)=>()=>(o||n((o={exports:{}}).exports,o),o.exports);var $n=(n)=>n;function Xn(n,o){this[n]=$n.bind(null,o)}var Cr=(n,o)=>{for(var a in o)ie(n,a,{get:o[a],enumerable:!0,configurable:!0,set:Xn.bind(o,a)})};var Ye,ae,Ut,T=(n,o)=>{for(var[a,c,u]of Ye||[])for(var p=[n],h=globalThis,M=h.document,D,z,j,F,P;z=p.pop();)if(!ae[z]&&(j=c[z])){ae[z]=1;for(F=1;F<j.length;F++)p.push(u[j[F]]);if(!o&&z!==n&&(D=M&&M.head)){if(Ut===void 0)Ut=(F=M.querySelector("meta[property=csp-nonce]"))&&(F.nonce||F.getAttribute("nonce"))||"";if(P=M.createElement("link"),P.rel="modulepreload",P.crossOrigin="",Ut)P.nonce=Ut;P.href=new h.URL(j[0],a),D.appendChild(P)}}},Vi=(n,o,a,c)=>{for(var u={},p=0;p<o.length;p++)u[o[p]]=a[p];(Ye||=[]).push([n,u,o]),ae||={},T(o[c],1)};/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */function je(n,o){(o==null||o>n.length)&&(o=n.length);for(var a=0,c=Array(o);a<o;a++)c[a]=n[a];return c}function Vn(n){if(Array.isArray(n))return n}function qn(n,o){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var c,u,p,h,M=[],D=!0,z=!1;try{if(p=(a=a.call(n)).next,o===0);else for(;!(D=(c=p.call(a)).done)&&(M.push(c.value),M.length!==o);D=!0);}catch(j){z=!0,u=j}finally{try{if(!D&&a.return!=null&&(h=a.return(),Object(h)!==h))return}finally{if(z)throw u}}return M}}function Kn(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zn(n,o){return Vn(n)||qn(n,o)||Jn(n,o)||Kn()}function Jn(n,o){if(n){if(typeof n=="string")return je(n,o);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?je(n,o):void 0}}var{entries:sn,setPrototypeOf:$e,isFrozen:Qn,getPrototypeOf:to,getOwnPropertyDescriptor:eo,freeze:N,seal:I,create:Tt}=Object,ln=typeof Reflect<"u"&&Reflect,{apply:me,construct:de}=ln;if(!N)N=function(o){return o};if(!I)I=function(o){return o};if(!me)me=function(o,a){for(var c=arguments.length,u=Array(c>2?c-2:0),p=2;p<c;p++)u[p-2]=arguments[p];return o.apply(a,u)};if(!de)de=function(o){for(var a=arguments.length,c=Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];return new o(...c)};var mt=b(Array.prototype.forEach),no=b(Array.prototype.lastIndexOf),Xe=b(Array.prototype.pop),dt=b(Array.prototype.push),oo=b(Array.prototype.splice),tt=Array.isArray,bt=b(String.prototype.toLowerCase),le=b(String.prototype.toString),Ve=b(String.prototype.match),yt=b(String.prototype.replace),qe=b(String.prototype.indexOf),ro=b(String.prototype.trim),io=b(Number.prototype.toString),ao=b(Boolean.prototype.toString),Ke=typeof BigInt>"u"?null:b(BigInt.prototype.toString),Ze=typeof Symbol>"u"?null:b(Symbol.prototype.toString),R=b(Object.prototype.hasOwnProperty),St=b(Object.prototype.toString),O=b(RegExp.prototype.test),it=so(TypeError);function b(n){return function(o){if(o instanceof RegExp)o.lastIndex=0;for(var a=arguments.length,c=Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];return me(n,o,c)}}function so(n){return function(){for(var o=arguments.length,a=Array(o),c=0;c<o;c++)a[c]=arguments[c];return de(n,a)}}function m(n,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bt;if($e)$e(n,null);if(!tt(o))return n;let c=o.length;while(c--){let u=o[c];if(typeof u==="string"){let p=a(u);if(p!==u){if(!Qn(o))o[c]=p;u=p}}n[u]=!0}return n}function lo(n){for(let o=0;o<n.length;o++)if(!R(n,o))n[o]=null;return n}function L(n){let o=Tt(null);for(let c of sn(n)){var a=Zn(c,2);let u=a[0],p=a[1];if(R(n,u))if(tt(p))o[u]=lo(p);else if(p&&typeof p==="object"&&p.constructor===Object)o[u]=L(p);else o[u]=p}return o}function co(n){switch(typeof n){case"string":return n;case"number":return io(n);case"boolean":return ao(n);case"bigint":return Ke?Ke(n):"0";case"symbol":return Ze?Ze(n):"Symbol()";case"undefined":return St(n);case"function":case"object":{if(n===null)return St(n);let o=n,a=H(o,"toString");if(typeof a==="function"){let c=a(o);return typeof c==="string"?c:St(c)}return St(n)}default:return St(n)}}function H(n,o){while(n!==null){let c=eo(n,o);if(c){if(c.get)return b(c.get);if(typeof c.value==="function")return b(c.value)}n=to(n)}function a(){return null}return a}function uo(n){try{return O(n,""),!0}catch(o){return!1}}var Je=N(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ce=N(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ue=N(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fo=N(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fe=N(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),po=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qe=N(["#text"]),tn=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),pe=N(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),en=N(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ft=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),mo=I(/{{[\w\W]*|^[\w\W]*}}/g),To=I(/<%[\w\W]*|^[\w\W]*%>/g),ho=I(/\${[\w\W]*/g),_o=I(/^data-[\-\w.\u00B7-\uFFFF]+$/),go=I(/^aria-[\-\w]+$/),nn=I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Eo=I(/^(?:\w+script|data):/i),Ao=I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yo=I(/^html$/i),So=I(/^[a-z][.\w]*(-[.\w]+)+$/i),on=I(/<[/\w!]/g),rn=I(/<[/\w]/g),bo=I(/<\/no(script|embed|frames)/i),Oo=I(/\/>/i),U={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ro=function(){return typeof window>"u"?null:window},No=function(o,a){if(typeof o!=="object"||typeof o.createPolicy!=="function")return null;let c=null,u="data-tt-policy-suffix";if(a&&a.hasAttribute(u))c=a.getAttribute(u);let p="dompurify"+(c?"#"+c:"");try{return o.createPolicy(p,{createHTML(h){return h},createScriptURL(h){return h}})}catch(h){return console.warn("TrustedTypes policy "+p+" could not be created."),null}},an=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Q=function(o,a,c,u){return R(o,a)&&tt(o[a])?m(u.base?L(u.base):{},o[a],u.transform):c};function cn(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ro(),o=(i)=>cn(i);if(o.version="3.4.13",o.removed=[],!n||!n.document||n.document.nodeType!==U.document||!n.Element)return o.isSupported=!1,o;let a=n.document,c=a,u=c.currentScript;n.DocumentFragment;let{HTMLTemplateElement:p,Node:h,Element:M,NodeFilter:D,NamedNodeMap:z}=n;z===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;let{DOMParser:j,trustedTypes:F}=n,P=M.prototype,un=H(P,"cloneNode"),zt=H(P,"remove"),fn=H(P,"nextSibling"),at=H(P,"childNodes"),et=H(P,"parentNode"),Te=H(P,"shadowRoot"),Ht=H(P,"attributes"),w=h&&h.prototype?H(h.prototype,"nodeType"):null,G=h&&h.prototype?H(h.prototype,"nodeName"):null,Ot=h&&h.prototype?H(h.prototype,"ownerDocument"):null;if(typeof p==="function"){let i=a.createElement("template");if(i.content&&i.content.ownerDocument)a=i.content.ownerDocument}let x,nt="",Gt,he=!1,ht=0,_e=function(){if(ht>0)throw it('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},st=function(t){_e(),ht++;try{return x.createHTML(t)}finally{ht--}},pn=function(t){_e(),ht++;try{return x.createScriptURL(t)}finally{ht--}},mn=function(){if(!he)Gt=No(F,u),he=!0;return Gt},Rt=a,{implementation:Bt,createNodeIterator:ge,createDocumentFragment:dn,getElementsByTagName:Tn}=Rt,hn=c.importNode,_=an();o.isSupported=typeof sn==="function"&&typeof et==="function"&&Bt&&Bt.createHTMLDocument!==void 0;let _n=mo,gn=To,En=ho,An=_o,yn=go,Sn=Eo,Ee=Ao,bn=So,Ae=nn,g=null,Wt=m({},[...Je,...ce,...ue,...fe,...Qe]),E=null,Yt=m({},[...tn,...pe,...en,...Ft]),S=Object.seal(Tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_t=null,ye=null,X=Object.seal(Tt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Se=!0,jt=!0,be=!1,Oe=!0,q=!1,Z=!0,ot=!1,$t=!1,Nt=null,It=null,Xt=!1,lt=!1,Dt=!1,Lt=!1,Re=!0,Ne=!1,Ie="user-content-",Vt=!0,wt=!1,ct={},B=null,qt=m({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),De=null,Le=m({},["audio","video","img","source","image","track"]),Kt=null,we=m({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",Mt="http://www.w3.org/2000/svg",W="http://www.w3.org/1999/xhtml",ut=W,Zt=!1,Jt=null,On=m({},[Ct,Mt,W],le),Ce=N(["mi","mo","mn","ms","mtext"]),Qt=m({},Ce),Me=N(["annotation-xml"]),te=m({},Me),Rn=m({},["title","style","font","a","script"]),gt=null,Nn=["application/xhtml+xml","text/html"],In="text/html",A=null,ft=null,Dn=a.createElement("form"),Pe=function(t){return t instanceof RegExp||t instanceof Function},ee=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ft&&ft===t)return;if(!t||typeof t!=="object")t={};t=L(t),gt=Nn.indexOf(t.PARSER_MEDIA_TYPE)===-1?In:t.PARSER_MEDIA_TYPE,A=gt==="application/xhtml+xml"?le:bt,g=Q(t,"ALLOWED_TAGS",Wt,{transform:A}),E=Q(t,"ALLOWED_ATTR",Yt,{transform:A}),Jt=Q(t,"ALLOWED_NAMESPACES",On,{transform:le}),Kt=Q(t,"ADD_URI_SAFE_ATTR",we,{transform:A,base:we}),De=Q(t,"ADD_DATA_URI_TAGS",Le,{transform:A,base:Le}),B=Q(t,"FORBID_CONTENTS",qt,{transform:A}),_t=Q(t,"FORBID_TAGS",L({}),{transform:A}),ye=Q(t,"FORBID_ATTR",L({}),{transform:A}),ct=R(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES==="object"?L(t.USE_PROFILES):t.USE_PROFILES:!1,Se=t.ALLOW_ARIA_ATTR!==!1,jt=t.ALLOW_DATA_ATTR!==!1,be=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=t.SAFE_FOR_TEMPLATES||!1,Z=t.SAFE_FOR_XML!==!1,ot=t.WHOLE_DOCUMENT||!1,lt=t.RETURN_DOM||!1,Dt=t.RETURN_DOM_FRAGMENT||!1,Lt=t.RETURN_TRUSTED_TYPE||!1,Xt=t.FORCE_BODY||!1,Re=t.SANITIZE_DOM!==!1,Ne=t.SANITIZE_NAMED_PROPS||!1,Vt=t.KEEP_CONTENT!==!1,wt=t.IN_PLACE||!1,Ae=uo(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:nn,ut=typeof t.NAMESPACE==="string"?t.NAMESPACE:W,Qt=R(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&typeof t.MATHML_TEXT_INTEGRATION_POINTS==="object"?L(t.MATHML_TEXT_INTEGRATION_POINTS):m({},Ce),te=R(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&typeof t.HTML_INTEGRATION_POINTS==="object"?L(t.HTML_INTEGRATION_POINTS):m({},Me);let e=R(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING==="object"?L(t.CUSTOM_ELEMENT_HANDLING):Tt(null);if(S=Tt(null),R(e,"tagNameCheck")&&Pe(e.tagNameCheck))S.tagNameCheck=e.tagNameCheck;if(R(e,"attributeNameCheck")&&Pe(e.attributeNameCheck))S.attributeNameCheck=e.attributeNameCheck;if(R(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements==="boolean")S.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements;if(I(S),q)jt=!1;if(Dt)lt=!0;if(ct){if(g=m({},Qe),E=Tt(null),ct.html===!0)m(g,Je),m(E,tn);if(ct.svg===!0)m(g,ce),m(E,pe),m(E,Ft);if(ct.svgFilters===!0)m(g,ue),m(E,pe),m(E,Ft);if(ct.mathMl===!0)m(g,fe),m(E,en),m(E,Ft)}if(X.tagCheck=null,X.attributeCheck=null,R(t,"ADD_TAGS")){if(typeof t.ADD_TAGS==="function")X.tagCheck=t.ADD_TAGS;else if(tt(t.ADD_TAGS)){if(g===Wt)g=L(g);m(g,t.ADD_TAGS,A)}}if(R(t,"ADD_ATTR")){if(typeof t.ADD_ATTR==="function")X.attributeCheck=t.ADD_ATTR;else if(tt(t.ADD_ATTR)){if(E===Yt)E=L(E);m(E,t.ADD_ATTR,A)}}if(R(t,"ADD_URI_SAFE_ATTR")&&tt(t.ADD_URI_SAFE_ATTR))m(Kt,t.ADD_URI_SAFE_ATTR,A);if(R(t,"FORBID_CONTENTS")&&tt(t.FORBID_CONTENTS)){if(B===qt)B=L(B);m(B,t.FORBID_CONTENTS,A)}if(R(t,"ADD_FORBID_CONTENTS")&&tt(t.ADD_FORBID_CONTENTS)){if(B===qt)B=L(B);m(B,t.ADD_FORBID_CONTENTS,A)}if(Vt)g["#text"]=!0;if(ot)m(g,["html","head","body"]);if(g.table)m(g,["tbody"]),delete _t.tbody;if(t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!=="function")throw it('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!=="function")throw it('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let r=x;x=t.TRUSTED_TYPES_POLICY;try{nt=st("")}catch(s){throw x=r,s}}else if(t.TRUSTED_TYPES_POLICY===null)x=void 0,nt="";else{if(x===void 0)x=mn();if(x&&typeof nt==="string")nt=st("")}if(N)N(t);ft=t},xe=m({},[...ce,...ue,...fo]),ke=m({},[...fe,...po]),Ln=function(t,e,r){if(e.namespaceURI===W)return t==="svg";if(e.namespaceURI===Ct)return t==="svg"&&(r==="annotation-xml"||Qt[r]);return Boolean(xe[t])},wn=function(t,e,r){if(e.namespaceURI===W)return t==="math";if(e.namespaceURI===Mt)return t==="math"&&te[r];return Boolean(ke[t])},Cn=function(t,e,r){if(e.namespaceURI===Mt&&!te[r])return!1;if(e.namespaceURI===Ct&&!Qt[r])return!1;return!ke[t]&&(Rn[t]||!xe[t])},Mn=function(t){let e=et(t);if(!e||!e.tagName)e={namespaceURI:ut,tagName:"template"};let r=bt(t.tagName),s=bt(e.tagName);if(!Jt[t.namespaceURI])return!1;if(t.namespaceURI===Mt)return Ln(r,e,s);if(t.namespaceURI===Ct)return wn(r,e,s);if(t.namespaceURI===W)return Cn(r,e,s);if(gt==="application/xhtml+xml"&&Jt[t.namespaceURI])return!0;return!1},J=function(t){dt(o.removed,{element:t});try{et(t).removeChild(t)}catch(e){if(zt(t),!et(t))throw it("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Pt=function(t){Et(t);let e=at(t);if(e){let s=[];mt(e,(l)=>{dt(s,l)}),mt(s,(l)=>{try{zt(l)}catch(f){}})}let r=Ht(t);if(r)for(let s=r.length-1;s>=0;--s){let l=r[s],f=l&&l.name;if(typeof f==="string")try{t.removeAttribute(f)}catch(d){}}},rt=function(t,e){try{dt(o.removed,{attribute:e.getAttributeNode(t),from:e})}catch(r){dt(o.removed,{attribute:null,from:e})}if(e.removeAttribute(t),t==="is")if(lt||Dt)try{J(e)}catch(r){}else try{e.setAttribute(t,"")}catch(r){}},Pn=function(t){let e=Ht(t);if(!e)return;for(let r=e.length-1;r>=0;--r){let s=e[r],l=s&&s.name;if(typeof l!=="string"||E[A(l)])continue;try{t.removeAttribute(l)}catch(f){}}},Et=function(t){let e=[t];while(e.length>0){let r=e.pop();if((w?w(r):r.nodeType)===U.element)Pn(r);let l=at(r);if(l)for(let f=l.length-1;f>=0;--f)e.push(l[f])}},xn=function(t){if(!Z)return;let e=[t];while(e.length>0){let r=e.pop(),s=w?w(r):r.nodeType;if(s===U.processingInstruction||s===U.comment&&O(rn,r.data)){try{zt(r)}catch(f){}continue}if(s===U.element){let f=r,d=A(G?G(r):r.nodeName);try{if(f.hasAttribute&&f.hasAttribute("patchsrc"))f.removeAttribute("patchsrc");if(f.hasAttribute&&f.hasAttribute("for")&&d!=="label"&&d!=="output")f.removeAttribute("for")}catch(y){}}let l=at(r);if(l)for(let f=l.length-1;f>=0;--f)e.push(l[f])}},ve=function(t){let e=null,r=null;if(Xt)t="<remove></remove>"+t;else{let f=Ve(t,/^[\r\n\t ]+/);r=f&&f[0]}if(gt==="application/xhtml+xml"&&ut===W)t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>";let s=x?st(t):t;if(ut===W)try{e=new j().parseFromString(s,gt)}catch(f){}if(!e||!e.documentElement){e=Bt.createDocument(ut,"template",null);try{e.documentElement.innerHTML=Zt?nt:s}catch(f){}}let l=e.body||e.documentElement;if(t&&r)l.insertBefore(a.createTextNode(r),l.childNodes[0]||null);if(ut===W)return Tn.call(e,ot?"html":"body")[0];return ot?e.documentElement:l},Ue=function(t){let e=Ot?Ot(t):t.ownerDocument;return ge.call(e||t,t,D.SHOW_ELEMENT|D.SHOW_COMMENT|D.SHOW_TEXT|D.SHOW_PROCESSING_INSTRUCTION|D.SHOW_CDATA_SECTION,null)},xt=function(t){return t=yt(t,_n," "),t=yt(t,gn," "),t=yt(t,En," "),t},ne=function(t){var e;t.normalize();let r=Ot?Ot(t):t.ownerDocument,s=ge.call(r||t,t,D.SHOW_TEXT|D.SHOW_COMMENT|D.SHOW_CDATA_SECTION|D.SHOW_PROCESSING_INSTRUCTION,null),l=s.nextNode();while(l)l.data=xt(l.data),l=s.nextNode();let f=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");if(f)mt(f,(d)=>{if(pt(d.content))ne(d.content)})},kt=function(t){let e=G?G(t):null;if(typeof e!=="string")return!1;if(A(e)!=="form")return!1;return typeof t.nodeName!=="string"||typeof t.textContent!=="string"||typeof t.removeChild!=="function"||t.attributes!==Ht(t)||typeof t.removeAttribute!=="function"||typeof t.setAttribute!=="function"||typeof t.namespaceURI!=="string"||typeof t.insertBefore!=="function"||typeof t.hasChildNodes!=="function"||t.nodeType!==w(t)||t.childNodes!==at(t)},pt=function(t){if(!w||typeof t!=="object"||t===null)return!1;try{return w(t)===U.documentFragment}catch(e){return!1}},At=function(t){if(!w||typeof t!=="object"||t===null)return!1;try{return typeof w(t)==="number"}catch(e){return!1}};function Y(i,t,e){if(i.length===0)return;mt(i,(r)=>{r.call(o,t,e,ft)})}let kn=function(t,e){if(Z&&t.hasChildNodes()&&!At(t.firstElementChild)&&O(on,t.textContent)&&O(on,t.innerHTML))return!0;if(Z&&t.namespaceURI===W&&e==="style"&&At(t.firstElementChild))return!0;if(t.nodeType===U.processingInstruction)return!0;if(Z&&t.nodeType===U.comment&&O(rn,t.data))return!0;return!1},vn=function(t,e,r){if(!_t[e]&&Ge(e)){if(S.tagNameCheck instanceof RegExp&&O(S.tagNameCheck,e))return!1;if(S.tagNameCheck instanceof Function&&S.tagNameCheck(e))return!1}if(Vt&&!B[e]){let s=et(t),l=at(t);if(l&&s){let f=l.length;for(let d=f-1;d>=0;--d){let y=t===r?un(l[d],!0):l[d];s.insertBefore(y,fn(t))}}}return J(t),!0},Fe=function(t,e,r,s){if(t.length===0)return e;return e===r||e===s?L(e):e},ze=function(t,e){if(Y(_.beforeSanitizeElements,t,null),t!==e&&et(t)===null){if(wt)Et(t);return!0}if(kt(t))return J(t),!0;let r=A(G?G(t):t.nodeName);if(g=Fe(_.uponSanitizeElement,g,Wt,Nt),Y(_.uponSanitizeElement,t,{tagName:r,allowedTags:g}),t!==e&&et(t)===null){if(wt)Et(t);return!0}if(kn(t,r))return J(t),!0;if(_t[r]||!(X.tagCheck instanceof Function&&X.tagCheck(r))&&!g[r]){let l=vn(t,r,e);if(l===!1)Y(_.afterSanitizeElements,t,null);return l}if((w?w(t):t.nodeType)===U.element&&!Mn(t))return J(t),!0;if((r==="noscript"||r==="noembed"||r==="noframes")&&O(bo,t.innerHTML))return J(t),!0;if(q&&t.nodeType===U.text){let l=xt(t.textContent);if(t.textContent!==l)dt(o.removed,{element:t.cloneNode()}),t.textContent=l}return Y(_.afterSanitizeElements,t,null),!1},He=function(t,e,r){if(ye[e])return!1;if(Z&&e==="patchsrc")return!1;if(Z&&e==="for"&&t!=="label"&&t!=="output")return!1;if(Re&&(e==="id"||e==="name")&&((r in a)||(r in Dn)))return!1;let s=E[e]||X.attributeCheck instanceof Function&&X.attributeCheck(e,t);if(jt&&O(An,e));else if(Se&&O(yn,e));else if(!s)if(Ge(t)&&(S.tagNameCheck instanceof RegExp&&O(S.tagNameCheck,t)||S.tagNameCheck instanceof Function&&S.tagNameCheck(t))&&(S.attributeNameCheck instanceof RegExp&&O(S.attributeNameCheck,e)||S.attributeNameCheck instanceof Function&&S.attributeNameCheck(e,t))||e==="is"&&S.allowCustomizedBuiltInElements&&(S.tagNameCheck instanceof RegExp&&O(S.tagNameCheck,r)||S.tagNameCheck instanceof Function&&S.tagNameCheck(r)));else return!1;else if(Kt[e]);else if(O(Ae,yt(r,Ee,"")));else if((e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&qe(r,"data:")===0&&De[t]);else if(be&&!O(Sn,yt(r,Ee,"")));else if(r)return!1;return!0},Un=m({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ge=function(t){return!Un[bt(t)]&&O(bn,t)},Fn=function(t,e,r,s){if(x&&typeof F==="object"&&typeof F.getAttributeType==="function"&&!r)switch(F.getAttributeType(t,e)){case"TrustedHTML":return st(s);case"TrustedScriptURL":return pn(s)}return s},zn=function(t,e,r,s){try{if(r)t.setAttributeNS(r,e,s);else t.setAttribute(e,s);if(kt(t))J(t);else Xe(o.removed)}catch(l){rt(e,t)}},Be=function(t){Y(_.beforeSanitizeAttributes,t,null);let e=t.attributes;if(!e||kt(t))return;E=Fe(_.uponSanitizeAttribute,E,Yt,It);let r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0},s=e.length,l=A(t.nodeName);while(s--){let f=e[s],{name:d,namespaceURI:y,value:k}=f,v=A(d),re=k,C=d==="value"?re:ro(re);if(r.attrName=v,r.attrValue=C,r.keepAttr=!0,r.forceKeepAttr=void 0,Y(_.uponSanitizeAttribute,t,r),C=r.attrValue,Ne&&(v==="id"||v==="name")&&qe(C,Ie)!==0)rt(d,t),C=Ie+C;if(Z&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,C)){rt(d,t);continue}if(v==="attributename"&&Ve(C,"href")){rt(d,t);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){rt(d,t);continue}if(!Oe&&O(Oo,C)){rt(d,t);continue}if(q)C=xt(C);if(!He(l,v,C)){rt(d,t);continue}if(C=Fn(l,v,y,C),C!==re)zn(t,d,y,C)}Y(_.afterSanitizeAttributes,t,null)},vt=function(t){let e=null,r=Ue(t);Y(_.beforeSanitizeShadowDOM,t,null);while(e=r.nextNode()){if(Y(_.uponSanitizeShadowNode,e,null),ze(e,t),Be(e),pt(e.content))vt(e.content);if((w?w(e):e.nodeType)===U.element){let l=Te(e);if(pt(l))oe(l),vt(l)}}Y(_.afterSanitizeShadowDOM,t,null)},oe=function(t){let e=[{node:t,shadow:null}];while(e.length>0){let r=e.pop();if(r.shadow){vt(r.shadow);continue}let s=r.node,f=(w?w(s):s.nodeType)===U.element,d=at(s);if(d)for(let y=d.length-1;y>=0;--y)e.push({node:d[y],shadow:null});if(f){let y=G?G(s):null;if(typeof y==="string"&&A(y)==="template"){let k=s.content;if(pt(k))e.push({node:k,shadow:null})}}if(f){let y=Te(s);if(pt(y))e.push({node:null,shadow:y},{node:y,shadow:null})}}};return o.sanitize=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,r=null,s=null,l=null;if(Zt=!i,Zt)i="<!-->";if(typeof i!=="string"&&!At(i)){if(i=co(i),typeof i!=="string")throw it("dirty is not a string, aborting")}if(!o.isSupported)return i;if($t)g=Nt,E=It;else ee(t);if(_.uponSanitizeElement.length>0||_.uponSanitizeAttribute.length>0)g=L(g);if(_.uponSanitizeAttribute.length>0)E=L(E);o.removed=[];let f=wt&&typeof i!=="string"&&At(i);if(f){xn(i);let k=G?G(i):i.nodeName;if(typeof k==="string"){let v=A(k);if(!g[v]||_t[v])throw Pt(i),it("root node is forbidden and cannot be sanitized in-place")}if(kt(i))throw Pt(i),it("root node is clobbered and cannot be sanitized in-place");try{oe(i)}catch(v){throw Pt(i),v}}else if(At(i)){if(e=ve("<!---->"),r=e.ownerDocument.importNode(i,!0),r.nodeType===U.element&&r.nodeName==="BODY")e=r;else if(r.nodeName==="HTML")e=r;else e.appendChild(r);oe(r)}else{if(!lt&&!q&&!ot&&i.indexOf("<")===-1)return x&&Lt?st(i):i;if(e=ve(i),!e)return lt?null:Lt?nt:""}if(e&&Xt)J(e.firstChild);let d=f?i:e;try{let k=Ue(d);while(s=k.nextNode())if(ze(s,d),Be(s),pt(s.content))vt(s.content)}catch(k){if(f)Pt(i),mt(o.removed,(v)=>{if(v.element)Et(v.element)});throw k}if(f){if(mt(o.removed,(k)=>{if(k.element)Et(k.element)}),q)ne(i);return i}if(lt){if(q)ne(e);if(Dt){l=dn.call(e.ownerDocument);while(e.firstChild)l.appendChild(e.firstChild)}else l=e;if(E.shadowroot||E.shadowrootmode)l=hn.call(c,l,!0);return l}let y=ot?e.outerHTML:e.innerHTML;if(ot&&g["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&O(yo,e.ownerDocument.doctype.name))y="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
3
+ `+y;if(q)y=xt(y);return x&&Lt?st(y):y},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ee(i),$t=!0,Nt=g,It=E},o.clearConfig=function(){ft=null,$t=!1,Nt=null,It=null,x=Gt,nt=""},o.isValidAttribute=function(i,t,e){if(!ft)ee({});let r=A(i),s=A(t);return He(r,s,e)},o.addHook=function(i,t){if(typeof t!=="function")return;if(!R(_,i))return;dt(_[i],t)},o.removeHook=function(i,t){if(!R(_,i))return;if(t!==void 0){let e=no(_[i],t);return e===-1?void 0:oo(_[i],e,1)[0]}return Xe(_[i])},o.removeHooks=function(i){if(!R(_,i))return;_[i]=[]},o.removeAllHooks=function(){_=an()},o}var V=cn();
4
+ export{K,se,Cr,T,Vi,V};
@@ -0,0 +1,2 @@
1
+ import{W,re,Y,Ve,I,G,ir,gn,Ee,ee,Ct,_e,ut,nt,bn,xn,U,sr,je,Tn,lr,kn,$r,xe,cr,oe,At}from"./index-fjtdggjn.js";import{Cr}from"./index-6qmsnxwy.js";var b={};Cr(b,{default:()=>Pr});var S=Object.create,pr=function(){function r(){}return function(t){if(!G(t))return{};if(S)return S(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}(),h=pr;function mr(r,t){var e=-1,n=r.length;t||(t=Array(n));while(++e<n)t[e]=r[e];return t}var dn=mr;function ur(r,t,e){if(t=="__proto__"&&ir)ir(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0});else r[t]=e}var xt=ur;var gr=Object.prototype,br=gr.hasOwnProperty;function yr(r,t,e){var n=r[t];if(!(br.call(r,t)&&Ee(n,e))||e===void 0&&!(t in r))xt(r,t,e)}var wt=yr;function dr(r,t,e,n){var m=!e;e||(e={});var i=-1,a=t.length;while(++i<a){var f=t[i],p=n?n(e[f],r[f],f,e,r):void 0;if(p===void 0)p=r[f];if(m)xt(e,f,p);else wt(e,f,p)}return e}var tt=dr;function Tr(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var v=Tr;var Ar=Object.prototype,xr=Ar.hasOwnProperty;function jr(r){if(!G(r))return v(r);var t=Ct(r),e=[];for(var n in r)if(!(n=="constructor"&&(t||!xr.call(r,n))))e.push(n);return e}var w=jr;function Ir(r){return ee(r)?bn(r,!0):w(r)}var ye=Ir;var Sr=xn(Object.getPrototypeOf,Object),nr=Sr;function hr(r,t){return r&&tt(t,U(t),r)}var P=hr;function vr(r,t){return r&&tt(t,ye(t),r)}var C=vr;var L=typeof b=="object"&&b&&!b.nodeType&&b,B=L&&typeof g=="object"&&g&&!g.nodeType&&g,wr=B&&B.exports===L,E=wr?W.Buffer:void 0,M=E?E.allocUnsafe:void 0;function Br(r,t){if(t)return r.slice();var e=r.length,n=M?M(e):new r.constructor(e);return r.copy(n),n}var Pr=Br;function Er(r,t){return tt(r,lr(r),t)}var F=Er;var Mr=Object.getOwnPropertySymbols,Lr=!Mr?Tn:function(r){var t=[];while(r)sr(t,lr(r)),r=nr(r);return t},y=Lr;function Ur(r,t){return tt(r,y(r),t)}var _=Ur;function Fr(r){return kn(r,ye,y)}var K=Fr;var _r=Object.prototype,Kr=_r.hasOwnProperty;function Dr(r){var t=r.length,e=new r.constructor(t);if(t&&typeof r[0]=="string"&&Kr.call(r,"index"))e.index=r.index,e.input=r.input;return e}var D=Dr;function Gr(r){var t=new r.constructor(r.byteLength);return new cr(t).set(new cr(r)),t}var l=Gr;function Nr(r,t){var e=t?l(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.byteLength)}var N=Nr;var Rr=/\w*$/;function Vr(r){var t=new r.constructor(r.source,Rr.exec(r));return t.lastIndex=r.lastIndex,t}var R=Vr;var V=re?re.prototype:void 0,q=V?V.valueOf:void 0;function qr(r){return q?Object(q.call(r)):{}}var H=qr;function Wr(r,t){var e=t?l(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var hn=Wr;var Yr="[object Boolean]",Hr="[object Date]",Jr="[object Map]",Qr="[object Number]",Xr="[object RegExp]",Zr="[object Set]",zr="[object String]",kr="[object Symbol]",rt="[object ArrayBuffer]",et="[object DataView]",ot="[object Float32Array]",at="[object Float64Array]",it="[object Int8Array]",ft="[object Int16Array]",pt="[object Int32Array]",mt="[object Uint8Array]",st="[object Uint8ClampedArray]",ct="[object Uint16Array]",lt="[object Uint32Array]";function gt(r,t,e){var n=r.constructor;switch(t){case rt:return l(r);case Yr:case Hr:return new n(+r);case et:return N(r,e);case ot:case at:case it:case ft:case pt:case mt:case st:case ct:case lt:return hn(r,e);case Jr:return new n;case Qr:case zr:return new n(r);case Xr:return R(r);case Zr:return new n;case kr:return H(r)}}var J=gt;function bt(r){return typeof r.constructor=="function"&&!Ct(r)?h(nr(r)):{}}var fn=bt;var yt="[object Map]";function dt(r){return Y(r)&&xe(r)==yt}var Q=dt;var X=nt&&nt.isMap,Tt=X?ut(X):Q,Z=Tt;var jt="[object Set]";function Ot(r){return Y(r)&&xe(r)==jt}var z=Ot;var k=nt&&nt.isSet,It=k?ut(k):z,rr=It;var St=1,ht=2,vt=4,tr="[object Arguments]",Pt="[object Array]",Bt="[object Boolean]",Et="[object Date]",Mt="[object Error]",er="[object Function]",Lt="[object GeneratorFunction]",Ut="[object Map]",Ft="[object Number]",or="[object Object]",_t="[object RegExp]",Kt="[object Set]",Dt="[object String]",Gt="[object Symbol]",Nt="[object WeakMap]",Rt="[object ArrayBuffer]",Vt="[object DataView]",qt="[object Float32Array]",Wt="[object Float64Array]",Yt="[object Int8Array]",$t="[object Int16Array]",Ht="[object Int32Array]",Jt="[object Uint8Array]",Qt="[object Uint8ClampedArray]",Xt="[object Uint16Array]",Zt="[object Uint32Array]",o={};o[tr]=o[Pt]=o[Rt]=o[Vt]=o[Bt]=o[Et]=o[qt]=o[Wt]=o[Yt]=o[$t]=o[Ht]=o[Ut]=o[Ft]=o[or]=o[_t]=o[Kt]=o[Dt]=o[Gt]=o[Jt]=o[Qt]=o[Xt]=o[Zt]=!0;o[Mt]=o[er]=o[Nt]=!1;function d(r,t,e,n,m,i){var a,f=t&St,p=t&ht,ar=t&vt;if(e)a=m?e(r,n,m,i):e(r);if(a!==void 0)return a;if(!G(r))return r;var T=I(r);if(T){if(a=D(r),!f)return dn(r,a)}else{var c=xe(r),A=c==er||c==Lt;if(_e(r))return Pr(r,f);if(c==or||c==tr||A&&!m){if(a=p||A?{}:fn(r),!f)return p?_(r,C(a,r)):F(r,P(a,r))}else{if(!o[c])return m?r:{};a=J(r,c,f)}}i||(i=new je);var x=i.get(r);if(x)return x;if(i.set(r,a),rr(r))r.forEach(function(s){a.add(d(s,t,e,s,r,i))});else if(Z(r))r.forEach(function(s,u){a.set(u,d(s,t,e,u,r,i))});var fr=ar?p?K:$r:p?ye:U,j=T?void 0:fr(r);return gn(j||r,function(s,u){if(j)u=s,s=r[u];wt(a,u,d(s,t,e,u,r,i))}),a}var Or=d;function zt(r,t){var e=-1,n=ee(r)?Array(r.length):[];return At(r,function(m,i,a){n[++e]=t(m,i,a)}),n}var pn=zt;function kt(r,t){var e=I(r)?Ve:pn;return e(r,oe(t,3))}var O=kt;
2
+ export{dn,xt,wt,tt,ye,nr,Pr,hn,fn,Or,pn,O};
@@ -0,0 +1,2 @@
1
+ import{Cr}from"./index-6qmsnxwy.js";var ot={};Cr(ot,{default:()=>_e});var st={};Cr(st,{default:()=>nt});var Jr=typeof global=="object"&&global&&global.Object===Object&&global,Q=Jr;var Qr=typeof self=="object"&&self&&self.Object===Object&&self,Vr=Q||Qr||Function("return this")(),W=Vr;var to=W.Symbol,re=to;var Rt=Object.prototype,{hasOwnProperty:eo,toString:ro}=Rt,q=re?re.toStringTag:void 0;function oo(t){var e=eo.call(t,q),r=t[q];try{t[q]=void 0;var o=!0}catch(f){}var a=ro.call(t);if(o)if(e)t[q]=r;else delete t[q];return a}var Ft=oo;var ao=Object.prototype,fo=ao.toString;function io(t){return fo.call(t)}var Bt=io;var no="[object Null]",so="[object Undefined]",Gt=re?re.toStringTag:void 0;function po(t){if(t==null)return t===void 0?so:no;return Gt&&Gt in Object(t)?Ft(t):Bt(t)}var me=po;function uo(t){return t!=null&&typeof t=="object"}var Y=uo;var mo="[object Symbol]";function lo(t){return typeof t=="symbol"||Y(t)&&me(t)==mo}var Se=lo;function xo(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var Ve=xo;var ho=Array.isArray,I=ho;var co=1/0,Ut=re?re.prototype:void 0,zt=Ut?Ut.toString:void 0;function Wt(t){if(typeof t=="string")return t;if(I(t))return Ve(t,Wt)+"";if(Se(t))return zt?zt.call(t):"";var e=t+"";return e=="0"&&1/t==-co?"-0":e}var Kt=Wt;function go(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var G=go;function yo(t){return t}var ve=yo;var _o="[object AsyncFunction]",bo="[object Function]",vo="[object GeneratorFunction]",Oo="[object Proxy]";function Ao(t){if(!G(t))return!1;var e=me(t);return e==bo||e==vo||e==_o||e==Oo}var rt=Ao;var To=W["__core-js_shared__"],V=To;var Ht=function(){var t=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function wo(t){return!!Ht&&Ht in t}var qt=wo;var So=Function.prototype,Po=So.toString;function Co(t){if(t!=null){try{return Po.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var _=Co;var Eo=/[\\^$.*+?()[\]{}|]/g,Io=/^\[object .+?Constructor\]$/,Lo=Function.prototype,jo=Object.prototype,Mo=Lo.toString,No=jo.hasOwnProperty,Do=RegExp("^"+Mo.call(No).replace(Eo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ro(t){if(!G(t)||qt(t))return!1;var e=rt(t)?Do:Io;return e.test(_(t))}var $t=Ro;function Fo(t,e){return t==null?void 0:t[e]}var Yt=Fo;function Bo(t,e){var r=Yt(t,e);return $t(r)?r:void 0}var h=Bo;var Go=h(W,"WeakMap"),tt=Go;function Uo(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Xt=Uo;function zo(){}var Zt=zo;var Wo=800,Ko=16,Ho=Date.now;function qo(t){var e=0,r=0;return function(){var o=Ho(),a=Ko-(o-r);if(r=o,a>0){if(++e>=Wo)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Jt=qo;function $o(t){return function(){return t}}var be=$o;var ko=function(){try{var t=h(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ir=ko;var Yo=!ir?ve:function(t,e){return ir(t,"toString",{configurable:!0,enumerable:!1,value:be(e),writable:!0})},Qt=Yo;var Xo=Jt(Qt),mn=Xo;function Zo(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var gn=Zo;function Jo(t,e,r,o){var a=t.length,f=r+(o?1:-1);while(o?f--:++f<a)if(e(t[f],f,t))return f;return-1}var yn=Jo;function Qo(t){return t!==t}var Vt=Qo;function Vo(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var te=Vo;function ta(t,e,r){return e===e?te(t,e,r):yn(t,Vt,r)}var ae=ta;function ea(t,e){var r=t==null?0:t.length;return!!r&&ae(t,e,0)>-1}var fe=ea;var ra=9007199254740991,oa=/^(?:0|[1-9]\d*)$/;function aa(t,e){var r=typeof t;return e=e==null?ra:e,!!e&&(r=="number"||r!="symbol"&&oa.test(t))&&(t>-1&&t%1==0&&t<e)}var Tt=aa;function fa(t,e){return t===e||t!==t&&e!==e}var Ee=fa;var ie=Math.max;function ia(t,e,r){return e=ie(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,f=ie(o.length-e,0),i=Array(f);while(++a<f)i[a]=o[e+a];a=-1;var n=Array(e+1);while(++a<e)n[a]=o[a];return n[e]=r(i),Xt(t,this,n)}}var vn=ia;function na(t,e){return mn(vn(t,e,ve),t+"")}var kt=na;var sa=9007199254740991;function pa(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=sa}var N=pa;function ua(t){return t!=null&&N(t.length)&&!rt(t)}var ee=ua;var ma=Object.prototype;function la(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ma;return t===r}var Ct=la;function da(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var ne=da;var xa="[object Arguments]";function ha(t){return Y(t)&&me(t)==xa}var wt=ha;var se=Object.prototype,{hasOwnProperty:ca,propertyIsEnumerable:ga}=se,ya=wt(function(){return arguments}())?wt:function(t){return Y(t)&&ca.call(t,"callee")&&!ga.call(t,"callee")},Ye=ya;function _a(){return!1}var pe=_a;var de=typeof ot=="object"&&ot&&!ot.nodeType&&ot,ue=de&&typeof et=="object"&&et&&!et.nodeType&&et,ba=ue&&ue.exports===de,le=ba?W.Buffer:void 0,va=le?le.isBuffer:void 0,Oa=va||pe,_e=Oa;var Aa="[object Arguments]",Ta="[object Array]",wa="[object Boolean]",Sa="[object Date]",Pa="[object Error]",Ca="[object Function]",Ea="[object Map]",Ia="[object Number]",La="[object Object]",ja="[object RegExp]",Ma="[object Set]",Na="[object String]",Da="[object WeakMap]",Ra="[object ArrayBuffer]",Fa="[object DataView]",Ba="[object Float32Array]",Ga="[object Float64Array]",Ua="[object Int8Array]",za="[object Int16Array]",Wa="[object Int32Array]",Ka="[object Uint8Array]",Ha="[object Uint8ClampedArray]",qa="[object Uint16Array]",$a="[object Uint32Array]",m={};m[Ba]=m[Ga]=m[Ua]=m[za]=m[Wa]=m[Ka]=m[Ha]=m[qa]=m[$a]=!0;m[Aa]=m[Ta]=m[Ra]=m[wa]=m[Fa]=m[Sa]=m[Pa]=m[Ca]=m[Ea]=m[Ia]=m[La]=m[ja]=m[Ma]=m[Na]=m[Da]=!1;function ka(t){return Y(t)&&N(t.length)&&!!m[me(t)]}var he=ka;function Ya(t){return function(e){return t(e)}}var ut=Ya;var ce=typeof st=="object"&&st&&!st.nodeType&&st,k=ce&&typeof ft=="object"&&ft&&!ft.nodeType&&ft,Xa=k&&k.exports===ce,Pt=Xa&&Q.process,Za=function(){try{var t=k&&k.require&&k.require("util").types;if(t)return t;return Pt&&Pt.binding&&Pt.binding("util")}catch(e){}}(),nt=Za;var ye=nt&&nt.isTypedArray,Ja=ye?ut(ye):he,St=Ja;var Qa=Object.prototype,Va=Qa.hasOwnProperty;function tf(t,e){var r=I(t),o=!r&&Ye(t),a=!r&&!o&&_e(t),f=!r&&!o&&!a&&St(t),i=r||o||a||f,n=i?ne(t.length,String):[],p=n.length;for(var u in t)if((e||Va.call(t,u))&&!(i&&(u=="length"||a&&(u=="offset"||u=="parent")||f&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Tt(u,p))))n.push(u);return n}var bn=tf;function ef(t,e){return function(r){return t(e(r))}}var xn=ef;var rf=xn(Object.keys,Object),Oe=rf;var of=Object.prototype,af=of.hasOwnProperty;function ff(t){if(!Ct(t))return Oe(t);var e=[];for(var r in Object(t))if(af.call(t,r)&&r!="constructor")e.push(r);return e}var ar=ff;function nf(t){return ee(t)?bn(t):ar(t)}var U=nf;var sf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pf=/^\w*$/;function uf(t,e){if(I(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||Se(t))return!0;return pf.test(t)||!sf.test(t)||e!=null&&t in Object(e)}var D=uf;var mf=h(Object,"create"),b=mf;function lf(){this.__data__=b?b(null):{},this.size=0}var Te=lf;function df(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var we=df;var xf="__lodash_hash_undefined__",hf=Object.prototype,cf=hf.hasOwnProperty;function gf(t){var e=this.__data__;if(b){var r=e[t];return r===xf?void 0:r}return cf.call(e,t)?e[t]:void 0}var Pe=gf;var yf=Object.prototype,_f=yf.hasOwnProperty;function bf(t){var e=this.__data__;return b?e[t]!==void 0:_f.call(e,t)}var Ce=bf;var vf="__lodash_hash_undefined__";function Of(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?vf:e,this}var Ie=Of;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=Te;R.prototype.delete=we;R.prototype.get=Pe;R.prototype.has=Ce;R.prototype.set=Ie;var It=R;function Af(){this.__data__=[],this.size=0}var Le=Af;function Tf(t,e){var r=t.length;while(r--)if(Ee(t[r][0],e))return r;return-1}var O=Tf;var wf=Array.prototype,Sf=wf.splice;function Pf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else Sf.call(e,r,1);return--this.size,!0}var Me=Pf;function Cf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var Ne=Cf;function Ef(t){return O(this.__data__,t)>-1}var De=Ef;function If(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var Re=If;function F(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}F.prototype.clear=Le;F.prototype.delete=Me;F.prototype.get=Ne;F.prototype.has=De;F.prototype.set=Re;var A=F;var Lf=h(W,"Map"),T=Lf;function jf(){this.size=0,this.__data__={hash:new It,map:new(T||A),string:new It}}var Fe=jf;function Mf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Be=Mf;function Nf(t,e){var r=t.__data__;return Be(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Nf;function Df(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var Ge=Df;function Rf(t){return w(this,t).get(t)}var Ue=Rf;function Ff(t){return w(this,t).has(t)}var ze=Ff;function Bf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var We=Bf;function z(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}z.prototype.clear=Fe;z.prototype.delete=Ge;z.prototype.get=Ue;z.prototype.has=ze;z.prototype.set=We;var E=z;var Gf="Expected a function";function Lt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(Gf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],f=r.cache;if(f.has(a))return f.get(a);var i=t.apply(this,o);return r.cache=f.set(a,i)||f,i};return r.cache=new(Lt.Cache||E),r}Lt.Cache=E;var Ke=Lt;var Uf=500;function zf(t){var e=Ke(t,function(o){if(r.size===Uf)r.clear();return o}),r=e.cache;return e}var He=zf;var Wf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kf=/\\(\\)?/g,Hf=He(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(Wf,function(r,o,a,f){e.push(a?f.replace(Kf,"$1"):o||r)}),e}),qe=Hf;function qf(t){return t==null?"":Kt(t)}var wn=qf;function $f(t,e){if(I(t))return t;return D(t,e)?[t]:qe(wn(t))}var Et=$f;var kf=1/0;function Yf(t){if(typeof t=="string"||Se(t))return t;var e=t+"";return e=="0"&&1/t==-kf?"-0":e}var it=Yf;function Xf(t,e){e=Et(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[it(e[r++])];return r&&r==o?t:void 0}var _t=Xf;function Zf(t,e,r){var o=t==null?void 0:_t(t,e);return o===void 0?r:o}var $e=Zf;function Jf(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var sr=Jf;var ke=re?re.isConcatSpreadable:void 0;function Qf(t){return I(t)||Ye(t)||!!(ke&&t&&t[ke])}var Xe=Qf;function Ze(t,e,r,o,a){var f=-1,i=t.length;r||(r=Xe),a||(a=[]);while(++f<i){var n=t[f];if(e>0&&r(n))if(e>1)Ze(n,e-1,r,o,a);else sr(a,n);else if(!o)a[a.length]=n}return a}var or=Ze;function Vf(t,e,r,o){var a=-1,f=t==null?0:t.length;if(o&&f)r=t[++a];while(++a<f)r=e(r,t[a],a,t);return r}var Je=Vf;function ti(){this.__data__=new A,this.size=0}var Qe=ti;function ei(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var tr=ei;function ri(t){return this.__data__.get(t)}var er=ri;function oi(t){return this.__data__.has(t)}var rr=oi;var ai=200;function fi(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<ai-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var fr=fi;function K(t){var e=this.__data__=new A(t);this.size=e.size}K.prototype.clear=Qe;K.prototype.delete=tr;K.prototype.get=er;K.prototype.has=rr;K.prototype.set=fr;var je=K;function ii(t,e){var r=-1,o=t==null?0:t.length,a=0,f=[];while(++r<o){var i=t[r];if(e(i,r,t))f[a++]=i}return f}var pt=ii;function ni(){return[]}var Tn=ni;var si=Object.prototype,pi=si.propertyIsEnumerable,nr=Object.getOwnPropertySymbols,ui=!nr?Tn:function(t){if(t==null)return[];return t=Object(t),pt(nr(t),function(e){return pi.call(t,e)})},lr=ui;function mi(t,e,r){var o=e(t);return I(t)?o:sr(o,r(t))}var kn=mi;function li(t){return kn(t,U,lr)}var $r=li;var di=h(W,"DataView"),mt=di;var xi=h(W,"Promise"),lt=xi;var hi=h(W,"Set"),S=hi;var pr="[object Map]",ci="[object Object]",mr="[object Promise]",xr="[object Set]",gr="[object WeakMap]",yr="[object DataView]",gi=_(mt),yi=_(T),_i=_(lt),bi=_(S),vi=_(tt),j=me;if(mt&&j(new mt(new ArrayBuffer(1)))!=yr||T&&j(new T)!=pr||lt&&j(lt.resolve())!=mr||S&&j(new S)!=xr||tt&&j(new tt)!=gr)j=function(t){var e=me(t),r=e==ci?t.constructor:void 0,o=r?_(r):"";if(o)switch(o){case gi:return yr;case yi:return pr;case _i:return mr;case bi:return xr;case vi:return gr}return e};var xe=j;var Oi=W.Uint8Array,cr=Oi;var Ai="__lodash_hash_undefined__";function Ti(t){return this.__data__.set(t,Ai),this}var _r=Ti;function wi(t){return this.__data__.has(t)}var br=wi;function dt(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}dt.prototype.add=dt.prototype.push=_r;dt.prototype.has=br;var xt=dt;function Si(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var vr=Si;function Pi(t,e){return t.has(e)}var ht=Pi;var Ci=1,Ei=2;function Ii(t,e,r,o,a,f){var i=r&Ci,n=t.length,p=e.length;if(n!=p&&!(i&&p>n))return!1;var u=f.get(t),x=f.get(e);if(u&&x)return u==e&&x==t;var d=-1,l=!0,y=r&Ei?new xt:void 0;f.set(t,e),f.set(e,t);while(++d<n){var c=t[d],g=e[d];if(o)var v=i?o(g,c,d,e,t,f):o(c,g,d,t,e,f);if(v!==void 0){if(v)continue;l=!1;break}if(y){if(!vr(e,function(P,C){if(!ht(y,C)&&(c===P||a(c,P,r,o,f)))return y.push(C)})){l=!1;break}}else if(!(c===g||a(c,g,r,o,f))){l=!1;break}}return f.delete(t),f.delete(e),l}var ct=Ii;function Li(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var Or=Li;function ji(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var H=ji;var Mi=1,Ni=2,Di="[object Boolean]",Ri="[object Date]",Fi="[object Error]",Bi="[object Map]",Gi="[object Number]",Ui="[object RegExp]",zi="[object Set]",Wi="[object String]",Ki="[object Symbol]",Hi="[object ArrayBuffer]",qi="[object DataView]",Ar=re?re.prototype:void 0,jt=Ar?Ar.valueOf:void 0;function $i(t,e,r,o,a,f,i){switch(r){case qi:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Hi:if(t.byteLength!=e.byteLength||!f(new cr(t),new cr(e)))return!1;return!0;case Di:case Ri:case Gi:return Ee(+t,+e);case Fi:return t.name==e.name&&t.message==e.message;case Ui:case Wi:return t==e+"";case Bi:var n=Or;case zi:var p=o&Mi;if(n||(n=H),t.size!=e.size&&!p)return!1;var u=i.get(t);if(u)return u==e;o|=Ni,i.set(t,e);var x=ct(n(t),n(e),o,a,f,i);return i.delete(t),x;case Ki:if(jt)return jt.call(t)==jt.call(e)}return!1}var Tr=$i;var ki=1,Yi=Object.prototype,Xi=Yi.hasOwnProperty;function Zi(t,e,r,o,a,f){var i=r&ki,n=$r(t),p=n.length,u=$r(e),x=u.length;if(p!=x&&!i)return!1;var d=p;while(d--){var l=n[d];if(!(i?l in e:Xi.call(e,l)))return!1}var y=f.get(t),c=f.get(e);if(y&&c)return y==e&&c==t;var g=!0;f.set(t,e),f.set(e,t);var v=i;while(++d<p){l=n[d];var P=t[l],C=e[l];if(o)var Dt=i?o(C,P,l,e,t,f):o(P,C,l,t,e,f);if(!(Dt===void 0?P===C||a(P,C,r,o,f):Dt)){g=!1;break}v||(v=l=="constructor")}if(g&&!v){var Z=t.constructor,J=e.constructor;if(Z!=J&&(("constructor"in t)&&("constructor"in e))&&!(typeof Z=="function"&&Z instanceof Z&&typeof J=="function"&&J instanceof J))g=!1}return f.delete(t),f.delete(e),g}var wr=Zi;var Ji=1,Sr="[object Arguments]",Pr="[object Array]",gt="[object Object]",Qi=Object.prototype,Er=Qi.hasOwnProperty;function Vi(t,e,r,o,a,f){var i=I(t),n=I(e),p=i?Pr:xe(t),u=n?Pr:xe(e);p=p==Sr?gt:p,u=u==Sr?gt:u;var x=p==gt,d=u==gt,l=p==u;if(l&&_e(t)){if(!_e(e))return!1;i=!0,x=!1}if(l&&!x)return f||(f=new je),i||St(t)?ct(t,e,r,o,a,f):Tr(t,e,p,r,o,a,f);if(!(r&Ji)){var y=x&&Er.call(t,"__wrapped__"),c=d&&Er.call(e,"__wrapped__");if(y||c){var g=y?t.value():t,v=c?e.value():e;return f||(f=new je),a(g,v,r,o,f)}}if(!l)return!1;return f||(f=new je),wr(t,e,r,o,a,f)}var Ir=Vi;function Lr(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!Y(t)&&!Y(e))return t!==t&&e!==e;return Ir(t,e,r,o,Lr,a)}var yt=Lr;var tn=1,en=2;function rn(t,e,r,o){var a=r.length,f=a,i=!o;if(t==null)return!f;t=Object(t);while(a--){var n=r[a];if(i&&n[2]?n[1]!==t[n[0]]:!(n[0]in t))return!1}while(++a<f){n=r[a];var p=n[0],u=t[p],x=n[1];if(i&&n[2]){if(u===void 0&&!(p in t))return!1}else{var d=new je;if(o)var l=o(u,x,p,t,e,d);if(!(l===void 0?yt(x,u,tn|en,o,d):l))return!1}}return!0}var jr=rn;function on(t){return t===t&&!G(t)}var bt=on;function an(t){var e=U(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,bt(a)]}return e}var Mr=an;function fn(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var vt=fn;function nn(t){var e=Mr(t);if(e.length==1&&e[0][2])return vt(e[0][0],e[0][1]);return function(r){return r===t||jr(r,t,e)}}var Nr=nn;function sn(t,e){return t!=null&&e in Object(t)}var Dr=sn;function pn(t,e,r){e=Et(e,t);var o=-1,a=e.length,f=!1;while(++o<a){var i=it(e[o]);if(!(f=t!=null&&r(t,i)))break;t=t[i]}if(f||++o!=a)return f;return a=t==null?0:t.length,!!a&&N(a)&&Tt(i,a)&&(I(t)||Ye(t))}var Cn=pn;function un(t,e){return t!=null&&Cn(t,e,Dr)}var Sn=un;var ln=1,dn=2;function hn(t,e){if(D(t)&&bt(e))return vt(it(t),e);return function(r){var o=$e(r,t);return o===void 0&&o===e?Sn(r,t):yt(e,o,ln|dn)}}var Rr=hn;function cn(t){return function(e){return e==null?void 0:e[t]}}var En=cn;function On(t){return function(e){return _t(e,t)}}var Fr=On;function An(t){return D(t)?En(it(t)):Fr(t)}var Br=An;function Pn(t){if(typeof t=="function")return t;if(t==null)return ve;if(typeof t=="object")return I(t)?Rr(t[0],t[1]):Nr(t);return Br(t)}var oe=Pn;function In(t){return function(e,r,o){var a=-1,f=Object(e),i=o(e),n=i.length;while(n--){var p=i[t?n:++a];if(r(f[p],p,f)===!1)break}return e}}var Gr=In;var Ln=Gr(),ur=Ln;function jn(t,e){return t&&ur(t,e,U)}var dr=jn;function Mn(t,e){return function(r,o){if(r==null)return r;if(!ee(r))return t(r,o);var a=r.length,f=e?a:-1,i=Object(r);while(e?f--:++f<a)if(o(i[f],f,i)===!1)break;return r}}var Ur=Mn;var Nn=Ur(dr),At=Nn;function Dn(t){return Y(t)&&ee(t)}var _n=Dn;function Rn(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var zr=Rn;function Fn(t){return typeof t=="function"?t:ve}var hr=Fn;function Bn(t,e){var r=I(t)?gn:At;return r(t,hr(e))}var s=Bn;function Gn(t,e){var r=[];return At(t,function(o,a,f){if(e(o,a,f))r.push(o)}),r}var Wr=Gn;function Un(t,e){var r=I(t)?pt:Wr;return r(t,oe(e,3))}var ge=Un;function zn(t,e){return Ve(e,function(r){return t[r]})}var Kr=zn;function Wn(t){return t==null?[]:Kr(t,U(t))}var Ae=Wn;var Kn="[object Map]",Hn="[object Set]",qn=Object.prototype,$n=qn.hasOwnProperty;function Yn(t){if(t==null)return!0;if(ee(t)&&(I(t)||typeof t=="string"||typeof t.splice=="function"||_e(t)||St(t)||Ye(t)))return!t.length;var e=xe(t);if(e==Kn||e==Hn)return!t.size;if(Ct(t))return!ar(t).length;for(var r in t)if($n.call(t,r))return!1;return!0}var Ot=Yn;function Xn(t){return t===void 0}var B=Xn;function Zn(t,e,r,o,a){return a(t,function(f,i,n){r=o?(o=!1,f):e(r,f,i,n)}),r}var Hr=Zn;function Jn(t,e,r){var o=I(t)?Je:Hr,a=arguments.length<3;return o(t,oe(e,4),r,a,At)}var at=Jn;var Qn=1/0,Vn=!(S&&1/H(new S([,-0]))[1]==Qn)?Zt:function(t){return new S(t)},qr=Vn;var ts=200;function es(t,e,r){var o=-1,a=fe,f=t.length,i=!0,n=[],p=n;if(r)i=!1,a=zr;else if(f>=ts){var u=e?null:qr(t);if(u)return H(u);i=!1,a=ht,p=new xt}else p=e?[]:n;t:while(++o<f){var x=t[o],d=e?e(x):x;if(x=r||x!==0?x:0,i&&d===d){var l=p.length;while(l--)if(p[l]===d)continue t;if(e)p.push(d);n.push(x)}else if(!a(p,d,r)){if(p!==n)p.push(d);n.push(x)}}return n}var kr=es;var rs=kt(function(t){return kr(or(t,1,_n,!0))}),Mt=rs;var as="\x00",M="\x00",Yr="\x01";class L{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=be(void 0),this._defaultEdgeLabelFn=be(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[M]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!rt(t))t=be(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return U(this._nodes)}sources(){var t=this;return ge(this.nodes(),function(e){return Ot(t._in[e])})}sinks(){var t=this;return ge(this.nodes(),function(e){return Ot(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return s(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=M,this._children[t]={},this._children[M][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],s(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];s(U(this._in[t]),e),delete this._in[t],delete this._preds[t],s(U(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(B(e))e=M;else{e+="";for(var r=e;!B(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==M)return e}}children(t){if(B(t))t=M;if(this._isCompound){var e=this._children[t];if(e)return U(e)}else if(t===M)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return U(e)}successors(t){var e=this._sucs[t];if(e)return U(e)}neighbors(t){var e=this.predecessors(t);if(e)return Mt(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;s(this._nodes,function(f,i){if(t(i))e.setNode(i,f)}),s(this._edgeObjs,function(f){if(e.hasNode(f.v)&&e.hasNode(f.w))e.setEdge(f,r.edge(f))});var o={};function a(f){var i=r.parent(f);if(i===void 0||e.hasNode(i))return o[f]=i,i;else if(i in o)return o[i];else return a(i)}if(this._isCompound)s(e.nodes(),function(f){e.setParent(f,a(f))});return e}setDefaultEdgeLabel(t){if(!rt(t))t=be(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Ae(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return at(t,function(a,f){if(o.length>1)r.setEdge(a,f,e);else r.setEdge(a,f);return f}),this}setEdge(){var t,e,r,o,a=!1,f=arguments[0];if(typeof f==="object"&&f!==null&&"v"in f){if(t=f.v,e=f.w,r=f.name,arguments.length===2)o=arguments[1],a=!0}else if(t=f,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!B(r))r=""+r;var i=X(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,i)){if(a)this._edgeLabels[i]=o;return this}if(!B(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[i]=a?o:this._defaultEdgeLabelFn(t,e,r);var n=fs(this._isDirected,t,e,r);return t=n.v,e=n.w,Object.freeze(n),this._edgeObjs[i]=n,Xr(this._preds[e],t),Xr(this._sucs[t],e),this._in[e][i]=n,this._out[t][i]=n,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?Nt(this._isDirected,arguments[0]):X(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?Nt(this._isDirected,arguments[0]):X(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?Nt(this._isDirected,arguments[0]):X(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Zr(this._preds[e],t),Zr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=Ae(r);if(!e)return o;return ge(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=Ae(r);if(!e)return o;return ge(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}L.prototype._nodeCount=0;L.prototype._edgeCount=0;function Xr(t,e){if(t[e])t[e]++;else t[e]=1}function Zr(t,e){if(!--t[e])delete t[e]}function X(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}return a+Yr+f+Yr+(B(o)?as:o)}function fs(t,e,r,o){var a=""+e,f=""+r;if(!t&&a>f){var i=a;a=f,f=i}var n={v:a,w:f};if(o)n.name=o;return n}function Nt(t,e){return X(t,e.v,e.w,e.name)}
2
+ export{W,re,me,Y,Se,Ve,I,G,ve,rt,be,ir,mn,gn,yn,Tt,Ee,vn,kt,ee,Ct,Ye,_e,ut,nt,St,bn,xn,ar,U,wn,Et,it,_t,sr,or,je,Tn,lr,kn,$r,xe,cr,Cn,Sn,En,oe,ur,dr,At,_n,hr,s,ge,Ae,B,at,L};
@@ -0,0 +1,2 @@
1
+ import{S,te}from"./index-1r72hdzb.js";var n=(r,o)=>S.lang.round(te.parse(r)[o]),Rt=n;
2
+ export{Rt};
@@ -0,0 +1,2 @@
1
+ import{Ue}from"./index-hj99nz1f.js";class o extends Map{constructor(e,r=l){super();if(Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(f(this,e))}has(e){return super.has(f(this,e))}set(e,r){return super.set(a(this,e),r)}delete(e){return super.delete(p(this,e))}}function f({_intern:e,_key:r},t){let n=r(t);return e.has(n)?e.get(n):t}function a({_intern:e,_key:r},t){let n=r(t);if(e.has(n))return e.get(n);return e.set(n,t),t}function p({_intern:e,_key:r},t){let n=r(t);if(e.has(n))t=e.get(n),e.delete(n);return t}function l(e){return e!==null&&typeof e==="object"?e.valueOf():e}var c=Symbol("implicit");function pe(){var e=new o,r=[],t=[],n=c;function s(u){let i=e.get(u);if(i===void 0){if(n!==c)return n;e.set(u,i=r.push(u)-1)}return t[i%t.length]}return s.domain=function(u){if(!arguments.length)return r.slice();r=[],e=new o;for(let i of u){if(e.has(i))continue;e.set(i,r.push(i)-1)}return s},s.range=function(u){return arguments.length?(t=Array.from(u),s):t.slice()},s.unknown=function(u){return arguments.length?(n=u,s):n},s.copy=function(){return pe(r,t).unknown(n)},Ue.apply(s,arguments),s}
2
+ export{pe};
@@ -0,0 +1 @@
1
+ function Ue(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}export{Ue};
@@ -0,0 +1,16 @@
1
+ import{e}from"./index-1r72hdzb.js";var we=e(()=>`
2
+ /* Font Awesome icon styling - consolidated */
3
+ .label-icon {
4
+ display: inline-block;
5
+ height: 1em;
6
+ overflow: visible;
7
+ vertical-align: -0.125em;
8
+ }
9
+
10
+ .node .label-icon path {
11
+ fill: currentColor;
12
+ stroke: revert;
13
+ stroke-width: revert;
14
+ }
15
+ `,"getIconStyles");
16
+ export{we};
@@ -0,0 +1,2 @@
1
+ import{e,Ht,n,pt}from"./index-1r72hdzb.js";import{K}from"./index-6qmsnxwy.js";var l=K(pt(),1);var dt=e((s,t)=>{let r=s.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name)r.attr("name",t.name);if(t.rx)r.attr("rx",t.rx);if(t.ry)r.attr("ry",t.ry);if(t.attrs!==void 0)for(let a in t.attrs)r.attr(a,t.attrs[a]);if(t.class)r.attr("class",t.class);return r},"drawRect"),Br=e((s,t)=>{let r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};dt(s,r).lower()},"drawBackgroundRect"),Mi=e((s,t)=>{let r=t.text.replace(Ht," "),a=s.append("text");if(a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class)a.attr("class",t.class);let i=a.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(r),a},"drawText"),An=e((s,t,r,a)=>{let i=s.append("image");i.attr("x",t),i.attr("y",r);let o=l.sanitizeUrl(a);i.attr("xlink:href",o)},"drawImage"),Rn=e((s,t,r,a)=>{let i=s.append("use");i.attr("x",t),i.attr("y",r);let o=l.sanitizeUrl(a);i.attr("xlink:href",`#${o}`)},"drawEmbeddedImage"),ne=e(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),In=e(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),It=e(()=>{let s=n(".mermaidTooltip");if(s.empty())s=n("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
2
+ export{dt,Br,Mi,An,Rn,ne,In,It};
@@ -0,0 +1,89 @@
1
+ import{e,t,j,u,w,k,d,r,A}from"./index-1r72hdzb.js";var E="",W="",_="",B=[],O=new Map,R=e((i)=>w(i,r()),"sanitizeText"),N=e((i)=>{switch(i.type){case"terminal":return{...i,value:R(i.value)};case"nonterminal":return{...i,name:R(i.name)};case"sequence":return{...i,elements:i.elements.map(N)};case"choice":return{...i,alternatives:i.alternatives.map(N)};case"optional":return{...i,element:N(i.element)};case"repetition":return{...i,element:N(i.element),separator:i.separator?N(i.separator):void 0};case"special":return{...i,text:R(i.text)}}},"sanitizeAstNode"),K=e(()=>{E="",W="",_="",B.length=0,O.clear(),d(),t.debug("[Railroad] Database cleared")},"clear"),X=e((i)=>{E=R(i),t.debug("[Railroad] Title set:",i)},"setTitle"),H=e(()=>E,"getTitle"),J=e((i)=>{let o={...i,name:R(i.name),definition:N(i.definition),comment:i.comment?R(i.comment):void 0};if(t.debug("[Railroad] Adding rule:",o.name),O.has(o.name))t.warn(`[Railroad] Rule '${o.name}' is already defined. Overwriting.`);B.push(o),O.set(o.name,o)},"addRule"),Q=e(()=>B,"getRules"),Z=e((i)=>O.get(i),"getRule"),V=e((i)=>{W=R(i).replace(/^\s+/g,""),t.debug("[Railroad] Accessibility title set:",i)},"setAccTitle"),ee=e(()=>W,"getAccTitle"),te=e((i)=>{_=R(i).replace(/\n\s+/g,`
2
+ `),t.debug("[Railroad] Accessibility description set:",i)},"setAccDescription"),re=e(()=>_,"getAccDescription"),ie=X,ne=H,P={clear:K,setTitle:X,getTitle:H,addRule:J,getRules:Q,getRule:Z,setAccTitle:V,getAccTitle:ee,setAccDescription:te,getAccDescription:re,setDiagramTitle:ie,getDiagramTitle:ne},C={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ae=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,oe=/^[\w "',.-]+$/,le=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),q=e((i)=>{if(!i)return!1;return Object.keys(i).every((o)=>o==="railroad"||le.has(o))},"isRailroadStyleOptions"),se=e((i)=>{if(!i)return{};if("railroad"in i&&i.railroad)return i.railroad;return q(i)?i:{}},"extractRailroadOverrides"),de=e((i)=>{if(!i||q(i))return{};let{railroad:o,svgId:s,theme:a,look:n,...l}=i;return l},"extractThemeOverrides"),f=e((i,o)=>{if(typeof i!=="string")return o;let s=i.trim();return ae.test(s)?s:o},"sanitizeColorValue"),G=e((i,o)=>{if(typeof i!=="string")return o;let s=i.trim();return oe.test(s)?s:o},"sanitizeFontFamilyValue"),b=e((i,o)=>{let s=typeof i==="number"?i:typeof i==="string"?Number.parseFloat(i):Number.NaN;return Number.isFinite(s)&&s>=0?s:o},"sanitizeNumberValue"),ce=e((i)=>{let o=typeof i==="number"?i:typeof i==="string"?Number.parseFloat(i):Number.NaN;return Number.isFinite(o)&&o>0?o:void 0},"parseThemeFontSize"),me=e((i)=>{let o=G(i.fontFamily,C.fontFamily),s=ce(i.fontSize)??C.fontSize;return{...C,fontFamily:o,fontSize:s,terminalFill:f(i.secondBkg??i.secondaryColor,C.terminalFill),terminalStroke:f(i.secondaryBorderColor??i.lineColor,C.terminalStroke),terminalTextColor:f(i.secondaryTextColor??i.textColor,C.terminalTextColor),nonTerminalFill:f(i.mainBkg??i.background,C.nonTerminalFill),nonTerminalStroke:f(i.primaryBorderColor??i.lineColor,C.nonTerminalStroke),nonTerminalTextColor:f(i.primaryTextColor??i.textColor,C.nonTerminalTextColor),lineColor:f(i.lineColor,C.lineColor),markerFill:f(i.lineColor,C.markerFill),commentFill:f(i.labelBackground??i.tertiaryColor,C.commentFill),commentStroke:f(i.tertiaryBorderColor??i.lineColor,C.commentStroke),commentTextColor:f(i.tertiaryTextColor??i.textColor,C.commentTextColor),specialFill:f(i.tertiaryColor??i.secondaryColor,C.specialFill),specialStroke:f(i.tertiaryBorderColor??i.secondaryBorderColor,C.specialStroke),ruleNameColor:f(i.titleColor??i.textColor,C.ruleNameColor)}},"buildThemeDefaults"),Y=e((i)=>{let o=u(),s={...j(),...o.themeVariables??{},...de(i)},a=me(s),n={...o.railroad??{},...se(i)};return{compactMode:n.compactMode??a.compactMode,padding:b(n.padding,a.padding),verticalSeparation:b(n.verticalSeparation,a.verticalSeparation),horizontalSeparation:b(n.horizontalSeparation,a.horizontalSeparation),arcRadius:b(n.arcRadius,a.arcRadius),fontSize:b(n.fontSize,a.fontSize),fontFamily:G(n.fontFamily,a.fontFamily),terminalFill:f(n.terminalFill,a.terminalFill),terminalStroke:f(n.terminalStroke,a.terminalStroke),terminalTextColor:f(n.terminalTextColor,a.terminalTextColor),nonTerminalFill:f(n.nonTerminalFill,a.nonTerminalFill),nonTerminalStroke:f(n.nonTerminalStroke,a.nonTerminalStroke),nonTerminalTextColor:f(n.nonTerminalTextColor,a.nonTerminalTextColor),lineColor:f(n.lineColor,a.lineColor),strokeWidth:b(n.strokeWidth,a.strokeWidth),markerFill:f(n.markerFill,a.markerFill),commentFill:f(n.commentFill,a.commentFill),commentStroke:f(n.commentStroke,a.commentStroke),commentTextColor:f(n.commentTextColor,a.commentTextColor),specialFill:f(n.specialFill,a.specialFill),specialStroke:f(n.specialStroke,a.specialStroke),ruleNameColor:f(n.ruleNameColor,a.ruleNameColor),showMarkers:n.showMarkers??a.showMarkers,markerRadius:b(n.markerRadius,a.markerRadius)}},"buildRailroadStyleOptions"),ze=e((i)=>{let{fontFamily:o,fontSize:s,terminalFill:a,terminalStroke:n,terminalTextColor:l,nonTerminalFill:T,nonTerminalStroke:h,nonTerminalTextColor:c,lineColor:x,strokeWidth:g,markerFill:p,commentFill:F,commentStroke:m,commentTextColor:v,specialFill:M,specialStroke:z,ruleNameColor:y}=Y(i);return`
3
+ .railroad-diagram {
4
+ font-family: ${o};
5
+ font-size: ${s}px;
6
+ }
7
+
8
+ .railroad-terminal rect {
9
+ fill: ${a};
10
+ stroke: ${n};
11
+ stroke-width: ${g}px;
12
+ }
13
+
14
+ .railroad-terminal text {
15
+ fill: ${l};
16
+ font-family: ${o};
17
+ font-size: ${s}px;
18
+ text-anchor: middle;
19
+ dominant-baseline: middle;
20
+ }
21
+
22
+ .railroad-nonterminal rect {
23
+ fill: ${T};
24
+ stroke: ${h};
25
+ stroke-width: ${g}px;
26
+ }
27
+
28
+ .railroad-nonterminal text {
29
+ fill: ${c};
30
+ font-family: ${o};
31
+ font-size: ${s}px;
32
+ text-anchor: middle;
33
+ dominant-baseline: middle;
34
+ }
35
+
36
+ .railroad-line {
37
+ stroke: ${x};
38
+ stroke-width: ${g}px;
39
+ fill: none;
40
+ }
41
+
42
+ .railroad-start circle,
43
+ .railroad-end circle {
44
+ fill: ${p};
45
+ }
46
+
47
+ .railroad-comment ellipse {
48
+ fill: ${F};
49
+ stroke: ${m};
50
+ stroke-width: ${g}px;
51
+ }
52
+
53
+ .railroad-comment text {
54
+ fill: ${v};
55
+ font-style: italic;
56
+ font-family: ${o};
57
+ font-size: ${s}px;
58
+ text-anchor: middle;
59
+ dominant-baseline: middle;
60
+ }
61
+
62
+ .railroad-special rect {
63
+ fill: ${M};
64
+ stroke: ${z};
65
+ stroke-width: ${g}px;
66
+ stroke-dasharray: 5,3;
67
+ }
68
+
69
+ .railroad-special text {
70
+ fill: ${c};
71
+ font-family: ${o};
72
+ font-size: ${s}px;
73
+ text-anchor: middle;
74
+ dominant-baseline: middle;
75
+ }
76
+
77
+ .railroad-rule-name {
78
+ font-weight: bold;
79
+ fill: ${y};
80
+ font-family: ${o};
81
+ font-size: ${s}px;
82
+ }
83
+
84
+ .railroad-group {
85
+ /* Grouping container, no specific styles */
86
+ }
87
+ `},"getStyles"),S=class{constructor(){this.d=""}static{e(this,"PathBuilder")}moveTo(i,o){return this.d+=`M ${i} ${o} `,this}lineTo(i,o){return this.d+=`L ${i} ${o} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,o,s,a,n,l,T){return this.d+=`A ${i} ${o} ${s} ${a?1:0} ${n?1:0} ${l} ${T} `,this}build(){return this.d.trim()}},he=class{constructor(i,o=Y()){this.textCache=new Map,this.svg=i,this.config=o}static{e(this,"RailroadRenderer")}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);let o=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),s=o.node().getBBox(),a={width:s.width,height:s.height};return o.remove(),this.textCache.set(i,a),a}renderTerminal(i,o){let s=this.measureText(o),a=s.width+this.config.padding*2,n=s.height+this.config.padding*2,l=i.append("g").attr("class","railroad-terminal");return l.append("rect").attr("x",0).attr("y",0).attr("width",a).attr("height",n).attr("rx",10).attr("ry",10),l.append("text").attr("x",a/2).attr("y",n/2).text(o),{element:l.node(),dimensions:{width:a,height:n,up:n/2,down:n/2}}}renderNonTerminal(i,o){let s=this.measureText(o),a=s.width+this.config.padding*2,n=s.height+this.config.padding*2,l=i.append("g").attr("class","railroad-nonterminal");return l.append("rect").attr("x",0).attr("y",0).attr("width",a).attr("height",n),l.append("text").attr("x",a/2).attr("y",n/2).text(o),{element:l.node(),dimensions:{width:a,height:n,up:n/2,down:n/2}}}renderSequence(i,o){let s=o.map((c)=>this.renderExpression(i,c)),a=0,n=0,l=0;for(let c of s)a+=c.dimensions.width,n=Math.max(n,c.dimensions.up),l=Math.max(l,c.dimensions.down);a+=(s.length-1)*this.config.horizontalSeparation;let T=i.append("g").attr("class","railroad-sequence"),h=0;for(let c=0;c<s.length;c++){let x=s[c],g=n-x.dimensions.up;if(T.node().appendChild(x.element).setAttribute("transform",`translate(${h}, ${g})`),c<s.length-1){let F=h+x.dimensions.width,m=F+this.config.horizontalSeparation,v=n;T.append("path").attr("class","railroad-line").attr("d",new S().moveTo(F,v).lineTo(m,v).build())}h+=x.dimensions.width+this.config.horizontalSeparation}return{element:T.node(),dimensions:{width:a,height:n+l,up:n,down:l}}}renderChoice(i,o){let s=o.map((p)=>this.renderExpression(i,p)),a=0,n=0;for(let p of s)a=Math.max(a,p.dimensions.width),n+=p.dimensions.height;n+=(s.length-1)*this.config.verticalSeparation;let l=this.config.arcRadius,T=l*4,h=a+T,c=i.append("g").attr("class","railroad-choice"),x=0,g=n/2;for(let p of s){let F=x,m=F+p.dimensions.up,v=l*2+(a-p.dimensions.width)/2;c.node().appendChild(p.element).setAttribute("transform",`translate(${v}, ${F})`);let z=new S,y=m>g;if(m===g)z.moveTo(0,g).lineTo(v,m);else z.moveTo(0,g).arcTo(l,l,0,!1,y,l,g+(y?l:-l)).lineTo(l,m-(y?l:-l)).arcTo(l,l,0,!1,!y,l*2,m).lineTo(v,m);c.append("path").attr("class","railroad-line").attr("d",z.build());let D=new S,L=v+p.dimensions.width,U=h-l*2;if(m===g)D.moveTo(L,m).lineTo(h,g);else D.moveTo(L,m).lineTo(U,m).arcTo(l,l,0,!1,!y,h-l,m+(y?-l:l)).lineTo(h-l,g+(y?l:-l)).arcTo(l,l,0,!1,y,h,g);c.append("path").attr("class","railroad-line").attr("d",D.build()),x+=p.dimensions.height+this.config.verticalSeparation}return{element:c.node(),dimensions:{width:h,height:n,up:g,down:n-g}}}renderOptional(i,o){let s=this.renderExpression(i,o),a=this.config.arcRadius,n=a*2,l=s.dimensions.width+a*4,T=s.dimensions.height+n,h=i.append("g").attr("class","railroad-optional"),c=a*2,x=n;h.node().appendChild(s.element).setAttribute("transform",`translate(${c}, ${x})`);let p=x+s.dimensions.up,F=new S().moveTo(0,p).lineTo(a*2,p);h.append("path").attr("class","railroad-line").attr("d",F.build());let m=new S().moveTo(c+s.dimensions.width,p).lineTo(l,p);h.append("path").attr("class","railroad-line").attr("d",m.build());let v=new S().moveTo(0,p).arcTo(a,a,0,!1,!1,a,p-a).lineTo(a,a).arcTo(a,a,0,!1,!0,a*2,0).lineTo(l-a*2,0).arcTo(a,a,0,!1,!0,l-a,a).lineTo(l-a,p-a).arcTo(a,a,0,!1,!1,l,p);return h.append("path").attr("class","railroad-line").attr("d",v.build()),{element:h.node(),dimensions:{width:l,height:T,up:p,down:T-p}}}renderRepetition(i,o,s){let a=this.renderExpression(i,o),n=this.config.arcRadius,l=n*2,T=a.dimensions.width+n*4,h=s===0,c=a.dimensions.height+l+(h?l:0),x=i.append("g").attr("class","railroad-repetition"),g=n*2,p=h?l:0;x.node().appendChild(a.element).setAttribute("transform",`translate(${g}, ${p})`);let m=p+a.dimensions.up;x.append("path").attr("class","railroad-line").attr("d",new S().moveTo(0,m).lineTo(n*2,m).build()),x.append("path").attr("class","railroad-line").attr("d",new S().moveTo(g+a.dimensions.width,m).lineTo(T,m).build());let v=p+a.dimensions.height+n,M=new S().moveTo(g+a.dimensions.width,m).arcTo(n,n,0,!1,!0,g+a.dimensions.width+n,m+n).lineTo(g+a.dimensions.width+n,v).arcTo(n,n,0,!1,!0,g+a.dimensions.width,v+n).lineTo(n*2,v+n).arcTo(n,n,0,!1,!0,n,v).lineTo(n,m+n).arcTo(n,n,0,!1,!0,n*2,m);if(x.append("path").attr("class","railroad-line").attr("d",M.build()),h){let z=new S().moveTo(0,m).arcTo(n,n,0,!1,!1,n,m-n).lineTo(n,n).arcTo(n,n,0,!1,!0,n*2,0).lineTo(T-n*2,0).arcTo(n,n,0,!1,!0,T-n,n).lineTo(T-n,m-n).arcTo(n,n,0,!1,!1,T,m);x.append("path").attr("class","railroad-line").attr("d",z.build())}return{element:x.node(),dimensions:{width:T,height:c,up:m,down:c-m}}}renderSpecial(i,o){let s=this.measureText("? "+o+" ?"),a=s.width+this.config.padding*2,n=s.height+this.config.padding*2,l=i.append("g").attr("class","railroad-special");return l.append("rect").attr("x",0).attr("y",0).attr("width",a).attr("height",n),l.append("text").attr("x",a/2).attr("y",n/2).text("? "+o+" ?"),{element:l.node(),dimensions:{width:a,height:n,up:n/2,down:n/2}}}renderExpression(i,o){switch(o.type){case"terminal":return this.renderTerminal(i,o.value);case"nonterminal":return this.renderNonTerminal(i,o.name);case"sequence":return this.renderSequence(i,o.elements);case"choice":return this.renderChoice(i,o.alternatives);case"optional":return this.renderOptional(i,o.element);case"repetition":return this.renderRepetition(i,o.element,o.min);case"special":return this.renderSpecial(i,o.text);default:throw Error(`Unknown node type: ${o.type}`)}}renderRule(i,o){let s=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${o})`),a=i.name+" =",n=this.measureText(a).width+20,l=n+20,T=s.append("g"),h=this.renderExpression(T,i.definition),c=Math.max(20,h.dimensions.up),x=c-h.dimensions.up;return T.attr("transform",`translate(${l}, ${x})`),s.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",c).text(a),s.append("g").attr("class","railroad-start").append("circle").attr("cx",n).attr("cy",c).attr("r",this.config.markerRadius),s.append("g").attr("class","railroad-end").append("circle").attr("cx",l+h.dimensions.width+10).attr("cy",c).attr("r",this.config.markerRadius),s.append("path").attr("class","railroad-line").attr("d",new S().moveTo(n+this.config.markerRadius,c).lineTo(l,c).build()),s.append("path").attr("class","railroad-line").attr("d",new S().moveTo(l+h.dimensions.width,c).lineTo(l+h.dimensions.width+10-this.config.markerRadius,c).build()),{height:Math.max(40,x+h.dimensions.height+this.config.padding*2),width:l+h.dimensions.width+10+this.config.markerRadius}}renderDiagram(i){let o=this.config.padding,s=0;for(let a of i){let n=this.renderRule(a,o);o+=n.height+this.config.verticalSeparation,s=Math.max(s,n.width)}return{width:s+this.config.padding*2,height:o+this.config.padding}}},I=e((i,o,s)=>{k(i,o.height,o.width,s),i.attr("viewBox",`0 0 ${o.width} ${o.height}`)},"configureRailroadSvgSize"),pe=e((i,o,s)=>{t.debug(`[Railroad] Rendering diagram
88
+ `+i);try{let a=A(o);a.attr("class","railroad-diagram");let l=u().railroad?.useMaxWidth??!0,T=P.getRules();if(t.debug(`[Railroad] Rendering ${T.length} rules`),T.length===0){t.warn("[Railroad] No rules to render"),I(a,{height:100,width:200},l);return}let c=new he(a,Y()).renderDiagram(T);I(a,c,l),t.debug("[Railroad] Render complete")}catch(a){throw t.error("[Railroad] Render error:",a),a}},"draw"),Ge={draw:pe};
89
+ export{P,ze,Ge};
@@ -0,0 +1,2 @@
1
+ import{W,me,Y,Se,Ve,I,G,ve,rt,be,mn,yn,Tt,Ee,vn,kt,ee,Ye,_e,ut,St,ar,U,wn,Et,it,_t,or,je,xe,Cn,Sn,En,oe,ur,dr,_n,hr,s,ge,Ae,B,at,L}from"./index-fjtdggjn.js";import{dn,xt,wt,tt,ye,nr,Pr,hn,fn,Or,pn,O}from"./index-d3b3gqe9.js";var qn=/\s/;function Hn(r){var e=r.length;while(e--&&qn.test(r.charAt(e)));return e}var Mr=Hn;var Xn=/^\s+/;function Jn(r){return r?r.slice(0,Mr(r)+1).replace(Xn,""):r}var jr=Jn;var Fr=NaN,Kn=/^[-+]0x[0-9a-f]+$/i,Zn=/^0b[01]+$/i,Qn=/^0o[0-7]+$/i,$n=parseInt;function et(r){if(typeof r=="number")return r;if(Se(r))return Fr;if(G(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=G(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=jr(r);var n=Zn.test(r);return n||Qn.test(r)?$n(r.slice(2),n?2:8):Kn.test(r)?Fr:+r}var Ar=et;var Gr=1/0,nt=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;function ot(r){if(!r)return r===0?r:0;if(r=Ar(r),r===Gr||r===-Gr){var e=r<0?-1:1;return e*nt}return r===r?r:0}var T=ot;function ft(r){var e=T(r),n=e%1;return e===e?n?e-n:e:0}var Br=ft;function st(r,e,n){if(!G(n))return!1;var t=typeof e;if(t=="number"?ee(n)&&Tt(e,n.length):t=="string"&&(e in n))return Ee(n[e],r);return!1}var y=st;function dt(r){return kt(function(e,n){var t=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;if(i=r.length>3&&typeof i=="function"?(o--,i):void 0,a&&y(n[0],n[1],a))i=o<3?void 0:i,o=1;e=Object(e);while(++t<o){var f=n[t];if(f)r(e,f,t,i)}return e})}var Vr=dt;function ct(r){var e=r==null?0:r.length;return e?or(r,1):[]}var w=ct;function pt(r){return mn(vn(r,void 0,w),r+"")}var Dr=pt;var mt="[object Object]",lt=Function.prototype,ht=Object.prototype,zr=lt.toString,vt=ht.hasOwnProperty,bt=zr.call(Object);function gt(r){if(!Y(r)||me(r)!=mt)return!1;var e=nr(r);if(e===null)return!0;var n=vt.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&zr.call(n)==bt}var Yr=gt;var yt="\\ud800-\\udfff",Ot="\\u0300-\\u036f",It="\\ufe20-\\ufe2f",Nt="\\u20d0-\\u20ff",Pt=Ot+It+Nt,Ct="\\ufe0e\\ufe0f",Lt="\\u200d",Rt=RegExp("["+Lt+yt+Pt+Ct+"]");function Mt(r){return Rt.test(r)}var Ur=Mt;var jt=1,Ft=4;function At(r){return Or(r,jt|Ft)}var Wr=At;var Gt=function(){return W.Date.now()},fr=Gt;var qr=Object.prototype,Bt=qr.hasOwnProperty,Vt=kt(function(r,e){r=Object(r);var n=-1,t=e.length,o=t>2?e[2]:void 0;if(o&&y(e[0],e[1],o))t=1;while(++n<t){var i=e[n],a=ye(i),f=-1,u=a.length;while(++f<u){var d=a[f],c=r[d];if(c===void 0||Ee(c,qr[d])&&!Bt.call(r,d))r[d]=i[d]}}return r}),Hr=Vt;function Dt(r,e,n){if(n!==void 0&&!Ee(r[e],n)||n===void 0&&!(e in r))xt(r,e,n)}var z=Dt;function zt(r,e){if(e==="constructor"&&typeof r[e]==="function")return;if(e=="__proto__")return;return r[e]}var q=zt;function Yt(r){return tt(r,ye(r))}var Xr=Yt;function Ut(r,e,n,t,o,i,a){var f=q(r,n),u=q(e,n),d=a.get(u);if(d){z(r,n,d);return}var c=i?i(f,u,n+"",r,e,a):void 0,p=c===void 0;if(p){var m=I(u),l=!m&&_e(u),h=!m&&!l&&St(u);if(c=u,m||l||h)if(I(f))c=f;else if(_n(f))c=dn(f);else if(l)p=!1,c=Pr(u,!0);else if(h)p=!1,c=hn(u,!0);else c=[];else if(Yr(u)||Ye(u)){if(c=f,Ye(f))c=Xr(f);else if(!G(f)||rt(f))c=fn(u)}else p=!1}if(p)a.set(u,c),o(c,u,t,i,a),a.delete(u);z(r,n,c)}var Jr=Ut;function Kr(r,e,n,t,o){if(r===e)return;ur(e,function(i,a){if(o||(o=new je),G(i))Jr(r,e,a,n,Kr,t,o);else{var f=t?t(q(r,a),i,a+"",r,e,o):void 0;if(f===void 0)f=i;z(r,a,f)}},ye)}var Zr=Kr;function Wt(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var S=Wt;function qt(r){return function(e,n,t){var o=Object(e);if(!ee(e)){var i=oe(n,3);e=U(e),n=function(f){return i(o[f],f,o)}}var a=r(e,n,t);return a>-1?o[i?e[a]:a]:void 0}}var Qr=qt;var Ht=Math.max;function Xt(r,e,n){var t=r==null?0:r.length;if(!t)return-1;var o=n==null?0:Br(n);if(o<0)o=Ht(t+o,0);return yn(r,oe(e,3),o)}var $r=Xt;var Jt=Qr($r),H=Jt;function Kt(r,e){return r==null?r:ur(r,hr(e),ye)}var re=Kt;function Zt(r,e){return r&&dr(r,hr(e))}var ne=Zt;function Qt(r,e){return r>e}var te=Qt;var $t=Object.prototype,ro=$t.hasOwnProperty;function eo(r,e){return r!=null&&ro.call(r,e)}var ie=eo;function no(r,e){return r!=null&&Cn(r,e,ie)}var Z=no;var to="[object String]";function oo(r){return typeof r=="string"||!I(r)&&Y(r)&&me(r)==to}var ae=oo;function io(r,e){return r<e}var Q=io;function ao(r,e){var n={};return e=oe(e,3),dr(r,function(t,o,i){xt(n,o,e(t,o,i))}),n}var M=ao;function fo(r,e,n){var t=-1,o=r.length;while(++t<o){var i=r[t],a=e(i);if(a!=null&&(f===void 0?a===a&&!Se(a):n(a,f)))var f=a,u=i}return u}var j=fo;function uo(r){return r&&r.length?j(r,ve,te):void 0}var b=uo;var so=Vr(function(r,e,n){Zr(r,e,n)}),X=so;function co(r){return r&&r.length?j(r,ve,Q):void 0}var k=co;function po(r,e){return r&&r.length?j(r,oe(e,2),Q):void 0}var F=po;function mo(r,e,n,t){if(!G(r))return r;e=Et(e,r);var o=-1,i=e.length,a=i-1,f=r;while(f!=null&&++o<i){var u=it(e[o]),d=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(o!=a){var c=f[u];if(d=t?t(c,u,f):void 0,d===void 0)d=G(c)?c:Tt(e[o+1])?[]:{}}wt(f,u,d),f=f[u]}return r}var fe=mo;function lo(r,e,n){var t=-1,o=e.length,i={};while(++t<o){var a=e[t],f=_t(r,a);if(n(f,a))fe(i,Et(a,r),f)}return i}var ue=lo;function ho(r,e){var n=r.length;r.sort(e);while(n--)r[n]=r[n].value;return r}var se=ho;function vo(r,e){if(r!==e){var n=r!==void 0,t=r===null,o=r===r,i=Se(r),a=e!==void 0,f=e===null,u=e===e,d=Se(e);if(!f&&!d&&!i&&r>e||i&&a&&u&&!f&&!d||t&&a&&u||!n&&u||!o)return 1;if(!t&&!i&&!d&&r<e||d&&n&&o&&!t&&!i||f&&n&&o||!a&&o||!u)return-1}return 0}var de=vo;function _o(r,e,n){var t=-1,o=r.criteria,i=e.criteria,a=o.length,f=n.length;while(++t<a){var u=de(o[t],i[t]);if(u){if(t>=f)return u;var d=n[t];return u*(d=="desc"?-1:1)}}return r.index-e.index}var ce=_o;function bo(r,e,n){if(e.length)e=Ve(e,function(i){if(I(i))return function(a){return _t(a,i.length===1?i[0]:i)};return i});else e=[ve];var t=-1;e=Ve(e,ut(oe));var o=pn(r,function(i,a,f){var u=Ve(e,function(d){return d(i)});return{criteria:u,index:++t,value:i}});return se(o,function(i,a){return ce(i,a,n)})}var pe=bo;var wo=En("length"),le=wo;var we="\\ud800-\\udfff",go="\\u0300-\\u036f",Eo="\\ufe20-\\ufe2f",yo="\\u20d0-\\u20ff",xo=go+Eo+yo,ko="\\ufe0e\\ufe0f",Oo="["+we+"]",sr="["+xo+"]",cr="\\ud83c[\\udffb-\\udfff]",Io="(?:"+sr+"|"+cr+")",ke="[^"+we+"]",Oe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ie="[\\ud800-\\udbff][\\udc00-\\udfff]",No="\\u200d",Ne=Io+"?",Pe="["+ko+"]?",Po="(?:"+No+"(?:"+[ke,Oe,Ie].join("|")+")"+Pe+Ne+")*",Co=Pe+Ne+Po,Lo="(?:"+[ke+sr+"?",sr,Oe,Ie,Oo].join("|")+")",he=RegExp(cr+"(?="+cr+")|"+Lo+Co,"g");function So(r){var e=he.lastIndex=0;while(he.test(r))++e;return e}var Ce=So;function Ro(r){return Ur(r)?Ce(r):le(r)}var Le=Ro;function To(r,e){return ue(r,e,function(n,t){return Sn(r,t)})}var Re=To;var Mo=Dr(function(r,e){return r==null?{}:Re(r,e)}),A=Mo;var{ceil:jo,max:Fo}=Math;function Ao(r,e,n,t){var o=-1,i=Fo(jo((e-r)/(n||1)),0),a=Array(i);while(i--)a[t?i:++o]=r,r+=n;return a}var Te=Ao;function Go(r){return function(e,n,t){if(t&&typeof t!="number"&&y(e,n,t))n=t=void 0;if(e=T(e),n===void 0)n=e,e=0;else n=T(n);return t=t===void 0?e<n?1:-1:T(t),Te(e,n,t,r)}}var Me=Go;var Bo=Me(),g=Bo;var Vo="[object Map]",Do="[object Set]";function zo(r){if(r==null)return 0;if(ee(r))return ae(r)?Le(r):r.length;var e=xe(r);if(e==Vo||e==Do)return r.size;return ar(r).length}var Fe=zo;var Yo=kt(function(r,e){if(r==null)return[];var n=e.length;if(n>1&&y(r,e[0],e[1]))e=[];else if(n>2&&y(e[0],e[1],e[2]))e=[e[0]];return pe(r,or(e,1),[])}),x=Yo;var Uo=0;function Wo(r){var e=++Uo;return wn(r)+e}var V=Wo;function qo(r,e,n){var t=-1,o=r.length,i=e.length,a={};while(++t<o){var f=t<i?e[t]:void 0;n(a,r[t],f)}return a}var Ge=qo;function Ho(r,e){return Ge(r||[],e||[],wt)}var pr=Ho;class mr{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,e=r._prev;if(e!==r)return Be(e),e}enqueue(r){var e=this._sentinel;if(r._prev&&r._next)Be(r);r._next=e._next,e._next._prev=r,e._next=r,r._prev=e}toString(){var r=[],e=this._sentinel,n=e._prev;while(n!==e)r.push(JSON.stringify(n,Xo)),n=n._prev;return"["+r.join(", ")+"]"}}function Be(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Xo(r,e){if(r!=="_next"&&r!=="_prev")return e}var Jo=be(1);function De(r,e){if(r.nodeCount()<=1)return[];var n=Zo(r,e||Jo),t=Ko(n.graph,n.buckets,n.zeroIdx);return w(O(t,function(o){return r.outEdges(o.v,o.w)}))}function Ko(r,e,n){var t=[],o=e[e.length-1],i=e[0],a;while(r.nodeCount()){while(a=i.dequeue())lr(r,e,n,a);while(a=o.dequeue())lr(r,e,n,a);if(r.nodeCount()){for(var f=e.length-2;f>0;--f)if(a=e[f].dequeue(),a){t=t.concat(lr(r,e,n,a,!0));break}}}return t}function lr(r,e,n,t,o){var i=o?[]:void 0;return s(r.inEdges(t.v),function(a){var f=r.edge(a),u=r.node(a.v);if(o)i.push({v:a.v,w:a.w});u.out-=f,vr(e,n,u)}),s(r.outEdges(t.v),function(a){var f=r.edge(a),u=a.w,d=r.node(u);d.in-=f,vr(e,n,d)}),r.removeNode(t.v),i}function Zo(r,e){var n=new L,t=0,o=0;s(r.nodes(),function(f){n.setNode(f,{v:f,in:0,out:0})}),s(r.edges(),function(f){var u=n.edge(f.v,f.w)||0,d=e(f),c=u+d;n.setEdge(f.v,f.w,c),o=Math.max(o,n.node(f.v).out+=d),t=Math.max(t,n.node(f.w).in+=d)});var i=g(o+t+3).map(function(){return new mr}),a=t+1;return s(n.nodes(),function(f){vr(i,a,n.node(f))}),{graph:n,buckets:i,zeroIdx:a}}function vr(r,e,n){if(!n.out)r[0].enqueue(n);else if(!n.in)r[r.length-1].enqueue(n);else r[n.out-n.in+e].enqueue(n)}function ze(r){var e=r.graph().acyclicer==="greedy"?De(r,n(r)):Qo(r);s(e,function(t){var o=r.edge(t);r.removeEdge(t),o.forwardName=t.name,o.reversed=!0,r.setEdge(t.w,t.v,o,V("rev"))});function n(t){return function(o){return t.edge(o).weight}}}function Qo(r){var e=[],n={},t={};function o(i){if(Object.prototype.hasOwnProperty.call(t,i))return;t[i]=!0,n[i]=!0,s(r.outEdges(i),function(a){if(Object.prototype.hasOwnProperty.call(n,a.w))e.push(a);else o(a.w)}),delete n[i]}return s(r.nodes(),o),e}function Ue(r){s(r.edges(),function(e){var n=r.edge(e);if(n.reversed){r.removeEdge(e);var t=n.forwardName;delete n.reversed,delete n.forwardName,r.setEdge(e.w,e.v,n,t)}})}function E(r,e,n,t){var o;do o=V(t);while(r.hasNode(o));return n.dummy=e,r.setNode(o,n),o}function qe(r){var e=new L().setGraph(r.graph());return s(r.nodes(),function(n){e.setNode(n,r.node(n))}),s(r.edges(),function(n){var t=e.edge(n.v,n.w)||{weight:0,minlen:1},o=r.edge(n);e.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),e}function er(r){var e=new L({multigraph:r.isMultigraph()}).setGraph(r.graph());return s(r.nodes(),function(n){if(!r.children(n).length)e.setNode(n,r.node(n))}),s(r.edges(),function(n){e.setEdge(n,r.edge(n))}),e}function _r(r,e){var{x:n,y:t}=r,o=e.x-n,i=e.y-t,a=r.width/2,f=r.height/2;if(!o&&!i)throw Error("Not possible to find intersection inside of the rectangle");var u,d;if(Math.abs(i)*a>Math.abs(o)*f){if(i<0)f=-f;u=f*o/i,d=f}else{if(o<0)a=-a;u=a,d=a*i/o}return{x:n+u,y:t+d}}function N(r){var e=O(g(wr(r)+1),function(){return[]});return s(r.nodes(),function(n){var t=r.node(n),o=t.rank;if(!B(o))e[o][t.order]=n}),e}function He(r){var e=k(O(r.nodes(),function(n){return r.node(n).rank}));s(r.nodes(),function(n){var t=r.node(n);if(Z(t,"rank"))t.rank-=e})}function Xe(r){var e=k(O(r.nodes(),function(i){return r.node(i).rank})),n=[];s(r.nodes(),function(i){var a=r.node(i).rank-e;if(!n[a])n[a]=[];n[a].push(i)});var t=0,o=r.graph().nodeRankFactor;s(n,function(i,a){if(B(i)&&a%o!==0)--t;else if(t)s(i,function(f){r.node(f).rank+=t})})}function br(r,e,n,t){var o={width:0,height:0};if(arguments.length>=4)o.rank=n,o.order=t;return E(r,"border",o,e)}function wr(r){return b(O(r.nodes(),function(e){var n=r.node(e).rank;if(!B(n))return n}))}function Je(r,e){var n={lhs:[],rhs:[]};return s(r,function(t){if(e(t))n.lhs.push(t);else n.rhs.push(t)}),n}function Ke(r,e){var n=fr();try{return e()}finally{console.log(r+" time: "+(fr()-n)+"ms")}}function Ze(r,e){return e()}function $e(r){function e(n){var t=r.children(n),o=r.node(n);if(t.length)s(t,e);if(Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)Qe(r,"borderLeft","_bl",n,o,i),Qe(r,"borderRight","_br",n,o,i)}}s(r.children(),e)}function Qe(r,e,n,t,o,i){var a={width:0,height:0,rank:i,borderType:e},f=o[e][i-1],u=E(r,"border",a,n);if(o[e][i]=u,r.setParent(u,t),f)r.setEdge(f,u,{weight:1})}function en(r){var e=r.graph().rankdir.toLowerCase();if(e==="lr"||e==="rl")tn(r)}function nn(r){var e=r.graph().rankdir.toLowerCase();if(e==="bt"||e==="rl")$o(r);if(e==="lr"||e==="rl")ri(r),tn(r)}function tn(r){s(r.nodes(),function(e){rn(r.node(e))}),s(r.edges(),function(e){rn(r.edge(e))})}function rn(r){var e=r.width;r.width=r.height,r.height=e}function $o(r){s(r.nodes(),function(e){gr(r.node(e))}),s(r.edges(),function(e){var n=r.edge(e);if(s(n.points,gr),Object.prototype.hasOwnProperty.call(n,"y"))gr(n)})}function gr(r){r.y=-r.y}function ri(r){s(r.nodes(),function(e){Er(r.node(e))}),s(r.edges(),function(e){var n=r.edge(e);if(s(n.points,Er),Object.prototype.hasOwnProperty.call(n,"x"))Er(n)})}function Er(r){var e=r.x;r.x=r.y,r.y=e}function on(r){r.graph().dummyChains=[],s(r.edges(),function(e){ni(r,e)})}function ni(r,e){var n=e.v,t=r.node(n).rank,o=e.w,i=r.node(o).rank,a=e.name,f=r.edge(e),u=f.labelRank;if(i===t+1)return;r.removeEdge(e);var d=void 0,c,p;for(p=0,++t;t<i;++p,++t){if(f.points=[],d={width:0,height:0,edgeLabel:f,edgeObj:e,rank:t},c=E(r,"edge",d,"_d"),t===u)d.width=f.width,d.height=f.height,d.dummy="edge-label",d.labelpos=f.labelpos;if(r.setEdge(n,c,{weight:f.weight},a),p===0)r.graph().dummyChains.push(c);n=c}r.setEdge(n,o,{weight:f.weight},a)}function an(r){s(r.graph().dummyChains,function(e){var n=r.node(e),t=n.edgeLabel,o;r.setEdge(n.edgeObj,t);while(n.dummy){if(o=r.successors(e)[0],r.removeNode(e),t.points.push({x:n.x,y:n.y}),n.dummy==="edge-label")t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height;e=o,n=r.node(e)}})}function J(r){var e={};function n(t){var o=r.node(t);if(Object.prototype.hasOwnProperty.call(e,t))return o.rank;e[t]=!0;var i=k(O(r.outEdges(t),function(a){return n(a.w)-r.edge(a).minlen}));if(i===Number.POSITIVE_INFINITY||i===void 0||i===null)i=0;return o.rank=i}s(r.sources(),n)}function R(r,e){return r.node(e.w).rank-r.node(e.v).rank-r.edge(e).minlen}function tr(r){var e=new L({directed:!1}),n=r.nodes()[0],t=r.nodeCount();e.setNode(n,{});var o,i;while(ti(e,r)<t)o=oi(e,r),i=e.hasNode(o.v)?R(r,o):-R(r,o),ii(e,r,i);return e}function ti(r,e){function n(t){s(e.nodeEdges(t),function(o){var i=o.v,a=t===i?o.w:i;if(!r.hasNode(a)&&!R(e,o))r.setNode(a,{}),r.setEdge(t,a,{}),n(a)})}return s(r.nodes(),n),r.nodeCount()}function oi(r,e){return F(e.edges(),function(n){if(r.hasNode(n.v)!==r.hasNode(n.w))return R(e,n)})}function ii(r,e,n){s(r.nodes(),function(t){e.node(t).rank+=n})}var Ws=be(1);var Qs=be(1);yr.CycleException=K;function yr(r){var e={},n={},t=[];function o(i){if(Object.prototype.hasOwnProperty.call(n,i))throw new K;if(!Object.prototype.hasOwnProperty.call(e,i))n[i]=!0,e[i]=!0,s(r.predecessors(i),o),delete n[i],t.push(i)}if(s(r.sinks(),o),Fe(e)!==r.nodeCount())throw new K;return t}function K(){}K.prototype=Error();function ir(r,e,n){if(!I(e))e=[e];var t=(r.isDirected()?r.successors:r.neighbors).bind(r),o=[],i={};return s(e,function(a){if(!r.hasNode(a))throw Error("Graph does not have node: "+a);sn(r,a,n==="post",i,t,o)}),o}function sn(r,e,n,t,o,i){if(!Object.prototype.hasOwnProperty.call(t,e)){if(t[e]=!0,!n)i.push(e);if(s(o(e),function(a){sn(r,a,n,t,o,i)}),n)i.push(e)}}function xr(r,e){return ir(r,e,"post")}function kr(r,e){return ir(r,e,"pre")}C.initLowLimValues=Nr;C.initCutValues=Ir;C.calcCutValue=ln;C.leaveEdge=gn;C.enterEdge=xn;C.exchangeEdges=kn;function C(r){r=qe(r),J(r);var e=tr(r);Nr(e),Ir(e,r);var n,t;while(n=gn(e))t=xn(e,r,n),kn(e,r,n,t)}function Ir(r,e){var n=xr(r,r.nodes());n=n.slice(0,n.length-1),s(n,function(t){di(r,e,t)})}function di(r,e,n){var t=r.node(n),o=t.parent;r.edge(n,o).cutvalue=ln(r,e,n)}function ln(r,e,n){var t=r.node(n),o=t.parent,i=!0,a=e.edge(n,o),f=0;if(!a)i=!1,a=e.edge(o,n);return f=a.weight,s(e.nodeEdges(n),function(u){var d=u.v===n,c=d?u.w:u.v;if(c!==o){var p=d===i,m=e.edge(u).weight;if(f+=p?m:-m,pi(r,n,c)){var l=r.edge(n,c).cutvalue;f+=p?-l:l}}}),f}function Nr(r,e){if(arguments.length<2)e=r.nodes()[0];bn(r,{},1,e)}function bn(r,e,n,t,o){var i=n,a=r.node(t);if(e[t]=!0,s(r.neighbors(t),function(f){if(!Object.prototype.hasOwnProperty.call(e,f))n=bn(r,e,n,f,t)}),a.low=i,a.lim=n++,o)a.parent=o;else delete a.parent;return n}function gn(r){return H(r.edges(),function(e){return r.edge(e).cutvalue<0})}function xn(r,e,n){var{v:t,w:o}=n;if(!e.hasEdge(t,o))t=n.w,o=n.v;var i=r.node(t),a=r.node(o),f=i,u=!1;if(i.lim>a.lim)f=a,u=!0;var d=ge(e.edges(),function(c){return u===cn(r,r.node(c.v),f)&&u!==cn(r,r.node(c.w),f)});return F(d,function(c){return R(e,c)})}function kn(r,e,n,t){var{v:o,w:i}=n;r.removeEdge(o,i),r.setEdge(t.v,t.w,{}),Nr(r),Ir(r,e),ci(r,e)}function ci(r,e){var n=H(r.nodes(),function(o){return!e.node(o).parent}),t=kr(r,n);t=t.slice(1),s(t,function(o){var i=r.node(o).parent,a=e.edge(o,i),f=!1;if(!a)a=e.edge(i,o),f=!0;e.node(o).rank=e.node(i).rank+(f?a.minlen:-a.minlen)})}function pi(r,e,n){return r.hasEdge(e,n)}function cn(r,e,n){return n.low<=e.lim&&e.lim<=n.lim}function Cr(r){switch(r.graph().ranker){case"network-simplex":On(r);break;case"tight-tree":li(r);break;case"longest-path":mi(r);break;default:On(r)}}var mi=J;function li(r){J(r),tr(r)}function On(r){C(r)}function In(r){var e=E(r,"root",{},"_root"),n=hi(r),t=b(Ae(n))-1,o=2*t+1;r.graph().nestingRoot=e,s(r.edges(),function(a){r.edge(a).minlen*=o});var i=vi(r)+1;s(r.children(),function(a){Nn(r,e,o,i,t,n,a)}),r.graph().nodeRankFactor=o}function Nn(r,e,n,t,o,i,a){var f=r.children(a);if(!f.length){if(a!==e)r.setEdge(e,a,{weight:0,minlen:n});return}var u=br(r,"_bt"),d=br(r,"_bb"),c=r.node(a);if(r.setParent(u,a),c.borderTop=u,r.setParent(d,a),c.borderBottom=d,s(f,function(p){Nn(r,e,n,t,o,i,p);var m=r.node(p),l=m.borderTop?m.borderTop:p,h=m.borderBottom?m.borderBottom:p,_=m.borderTop?t:2*t,D=l!==h?1:o-i[a]+1;r.setEdge(u,l,{weight:_,minlen:D,nestingEdge:!0}),r.setEdge(h,d,{weight:_,minlen:D,nestingEdge:!0})}),!r.parent(a))r.setEdge(e,u,{weight:0,minlen:o+i[a]})}function hi(r){var e={};function n(t,o){var i=r.children(t);if(i&&i.length)s(i,function(a){n(a,o+1)});e[t]=o}return s(r.children(),function(t){n(t,1)}),e}function vi(r){return at(r.edges(),function(e,n){return e+r.edge(n).weight},0)}function Pn(r){var e=r.graph();r.removeNode(e.nestingRoot),delete e.nestingRoot,s(r.edges(),function(n){var t=r.edge(n);if(t.nestingEdge)r.removeEdge(n)})}function Ln(r,e,n){var t={},o;s(n,function(i){var a=r.parent(i),f,u;while(a){if(f=r.parent(a),f)u=t[f],t[f]=a;else u=o,o=a;if(u&&u!==a){e.setEdge(u,a);return}a=f}})}function Rn(r,e,n){var t=bi(r),o=new L({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return r.node(i)});return s(r.nodes(),function(i){var a=r.node(i),f=r.parent(i);if(a.rank===e||a.minRank<=e&&e<=a.maxRank){if(o.setNode(i),o.setParent(i,f||t),s(r[n](i),function(u){var d=u.v===i?u.w:u.v,c=o.edge(d,i),p=!B(c)?c.weight:0;o.setEdge(d,i,{weight:r.edge(u).weight+p})}),Object.prototype.hasOwnProperty.call(a,"minRank"))o.setNode(i,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]})}}),o}function bi(r){var e;while(r.hasNode(e=V("_root")));return e}function Tn(r,e){var n=0;for(var t=1;t<e.length;++t)n+=wi(r,e[t-1],e[t]);return n}function wi(r,e,n){var t=pr(n,O(n,function(d,c){return c})),o=w(O(e,function(d){return x(O(r.outEdges(d),function(c){return{pos:t[c.w],weight:r.edge(c).weight}}),"pos")})),i=1;while(i<n.length)i<<=1;var a=2*i-1;i-=1;var f=O(Array(a),function(){return 0}),u=0;return s(o.forEach(function(d){var c=d.pos+i;f[c]+=d.weight;var p=0;while(c>0){if(c%2)p+=f[c+1];c=c-1>>1,f[c]+=d.weight}u+=d.weight*p})),u}function Mn(r){var e={},n=ge(r.nodes(),function(f){return!r.children(f).length}),t=b(O(n,function(f){return r.node(f).rank})),o=O(g(t+1),function(){return[]});function i(f){if(Z(e,f))return;e[f]=!0;var u=r.node(f);o[u.rank].push(f),s(r.successors(f),i)}var a=x(n,function(f){return r.node(f).rank});return s(a,i),o}function jn(r,e){return O(e,function(n){var t=r.inEdges(n);if(!t.length)return{v:n};else{var o=at(t,function(i,a){var f=r.edge(a),u=r.node(a.v);return{sum:i.sum+f.weight*u.order,weight:i.weight+f.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}})}function Fn(r,e){var n={};s(r,function(o,i){var a=n[o.v]={indegree:0,in:[],out:[],vs:[o.v],i};if(!B(o.barycenter))a.barycenter=o.barycenter,a.weight=o.weight}),s(e.edges(),function(o){var i=n[o.v],a=n[o.w];if(!B(i)&&!B(a))a.indegree++,i.out.push(n[o.w])});var t=ge(n,function(o){return!o.indegree});return gi(t)}function gi(r){var e=[];function n(i){return function(a){if(a.merged)return;if(B(a.barycenter)||B(i.barycenter)||a.barycenter>=i.barycenter)Ei(i,a)}}function t(i){return function(a){if(a.in.push(i),--a.indegree===0)r.push(a)}}while(r.length){var o=r.pop();e.push(o),s(o.in.reverse(),n(o)),s(o.out,t(o))}return O(ge(e,function(i){return!i.merged}),function(i){return A(i,["vs","i","barycenter","weight"])})}function Ei(r,e){var n=0,t=0;if(r.weight)n+=r.barycenter*r.weight,t+=r.weight;if(e.weight)n+=e.barycenter*e.weight,t+=e.weight;r.vs=e.vs.concat(r.vs),r.barycenter=n/t,r.weight=t,r.i=Math.min(e.i,r.i),e.merged=!0}function Gn(r,e){var n=Je(r,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=n.lhs,o=x(n.rhs,function(c){return-c.i}),i=[],a=0,f=0,u=0;t.sort(yi(!!e)),u=An(i,o,u),s(t,function(c){u+=c.vs.length,i.push(c.vs),a+=c.barycenter*c.weight,f+=c.weight,u=An(i,o,u)});var d={vs:w(i)};if(f)d.barycenter=a/f,d.weight=f;return d}function An(r,e,n){var t;while(e.length&&(t=S(e)).i<=n)e.pop(),r.push(t.vs),n++;return n}function yi(r){return function(e,n){if(e.barycenter<n.barycenter)return-1;else if(e.barycenter>n.barycenter)return 1;return!r?e.i-n.i:n.i-e.i}}function Lr(r,e,n,t){var o=r.children(e),i=r.node(e),a=i?i.borderLeft:void 0,f=i?i.borderRight:void 0,u={};if(a)o=ge(o,function(h){return h!==a&&h!==f});var d=jn(r,o);s(d,function(h){if(r.children(h.v).length){var _=Lr(r,h.v,n,t);if(u[h.v]=_,Object.prototype.hasOwnProperty.call(_,"barycenter"))ki(h,_)}});var c=Fn(d,n);xi(c,u);var p=Gn(c,t);if(a){if(p.vs=w([a,p.vs,f]),r.predecessors(a).length){var m=r.node(r.predecessors(a)[0]),l=r.node(r.predecessors(f)[0]);if(!Object.prototype.hasOwnProperty.call(p,"barycenter"))p.barycenter=0,p.weight=0;p.barycenter=(p.barycenter*p.weight+m.order+l.order)/(p.weight+2),p.weight+=2}}return p}function xi(r,e){s(r,function(n){n.vs=w(n.vs.map(function(t){if(e[t])return e[t].vs;return t}))})}function ki(r,e){if(!B(r.barycenter))r.barycenter=(r.barycenter*r.weight+e.barycenter*e.weight)/(r.weight+e.weight),r.weight+=e.weight;else r.barycenter=e.barycenter,r.weight=e.weight}function Dn(r){var e=wr(r),n=Bn(r,g(1,e+1),"inEdges"),t=Bn(r,g(e-1,-1,-1),"outEdges"),o=Mn(r);Vn(r,o);var i=Number.POSITIVE_INFINITY,a;for(var f=0,u=0;u<4;++f,++u){Oi(f%2?n:t,f%4>=2),o=N(r);var d=Tn(r,o);if(d<i)u=0,a=Wr(o),i=d}Vn(r,a)}function Bn(r,e,n){return O(e,function(t){return Rn(r,t,n)})}function Oi(r,e){var n=new L;s(r,function(t){var o=t.graph().root,i=Lr(t,o,n,e);s(i.vs,function(a,f){t.node(a).order=f}),Ln(t,n,i.vs)})}function Vn(r,e){s(e,function(n){s(n,function(t,o){r.node(t).order=o})})}function zn(r){var e=Ni(r);s(r.graph().dummyChains,function(n){var t=r.node(n),o=t.edgeObj,i=Ii(r,e,o.v,o.w),{path:a,lca:f}=i,u=0,d=a[u],c=!0;while(n!==o.w){if(t=r.node(n),c){while((d=a[u])!==f&&r.node(d).maxRank<t.rank)u++;if(d===f)c=!1}if(!c){while(u<a.length-1&&r.node(d=a[u+1]).minRank<=t.rank)u++;d=a[u]}r.setParent(n,d),n=r.successors(n)[0]}})}function Ii(r,e,n,t){var o=[],i=[],a=Math.min(e[n].low,e[t].low),f=Math.max(e[n].lim,e[t].lim),u,d;u=n;do u=r.parent(u),o.push(u);while(u&&(e[u].low>a||f>e[u].lim));d=u,u=t;while((u=r.parent(u))!==d)i.push(u);return{path:o.concat(i.reverse()),lca:d}}function Ni(r){var e={},n=0;function t(o){var i=n;s(r.children(o),t),e[o]={low:i,lim:n++}}return s(r.children(),t),e}function Pi(r,e){var n={};function t(o,i){var a=0,f=0,u=o.length,d=S(i);return s(i,function(c,p){var m=Li(r,c),l=m?r.node(m).order:u;if(m||c===d)s(i.slice(f,p+1),function(h){s(r.predecessors(h),function(_){var D=r.node(_),Tr=D.order;if((Tr<a||l<Tr)&&!(D.dummy&&r.node(h).dummy))Yn(n,_,h)})}),f=p+1,a=l}),i}return at(e,t),n}function Ci(r,e){var n={};function t(i,a,f,u,d){var c;s(g(a,f),function(p){if(c=i[p],r.node(c).dummy)s(r.predecessors(c),function(m){var l=r.node(m);if(l.dummy&&(l.order<u||l.order>d))Yn(n,m,c)})})}function o(i,a){var f=-1,u,d=0;return s(a,function(c,p){if(r.node(c).dummy==="border"){var m=r.predecessors(c);if(m.length)u=r.node(m[0]).order,t(a,d,p,f,u),d=p,f=u}t(a,d,a.length,u,i.length)}),a}return at(e,o),n}function Li(r,e){if(r.node(e).dummy)return H(r.predecessors(e),function(n){return r.node(n).dummy})}function Yn(r,e,n){if(e>n){var t=e;e=n,n=t}if(!Object.prototype.hasOwnProperty.call(r,e))Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=r[e];Object.defineProperty(o,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Si(r,e,n){if(e>n){var t=e;e=n,n=t}return!!r[e]&&Object.prototype.hasOwnProperty.call(r[e],n)}function Ri(r,e,n,t){var o={},i={},a={};return s(e,function(f){s(f,function(u,d){o[u]=u,i[u]=u,a[u]=d})}),s(e,function(f){var u=-1;s(f,function(d){var c=t(d);if(c.length){c=x(c,function(_){return a[_]});var p=(c.length-1)/2;for(var m=Math.floor(p),l=Math.ceil(p);m<=l;++m){var h=c[m];if(i[d]===d&&u<a[h]&&!Si(n,d,h))i[h]=d,i[d]=o[d]=o[h],u=a[h]}}})}),{root:o,align:i}}function Ti(r,e,n,t,o){var i={},a=Mi(r,e,n,o),f=o?"borderLeft":"borderRight";function u(p,m){var l=a.nodes(),h=l.pop(),_={};while(h){if(_[h])p(h);else _[h]=!0,l.push(h),l=l.concat(m(h));h=l.pop()}}function d(p){i[p]=a.inEdges(p).reduce(function(m,l){return Math.max(m,i[l.v]+a.edge(l))},0)}function c(p){var m=a.outEdges(p).reduce(function(h,_){return Math.min(h,i[_.w]-a.edge(_))},Number.POSITIVE_INFINITY),l=r.node(p);if(m!==Number.POSITIVE_INFINITY&&l.borderType!==f)i[p]=Math.max(i[p],m)}return u(d,a.predecessors.bind(a)),u(c,a.successors.bind(a)),s(t,function(p){i[p]=i[n[p]]}),i}function Mi(r,e,n,t){var o=new L,i=r.graph(),a=Gi(i.nodesep,i.edgesep,t);return s(e,function(f){var u;s(f,function(d){var c=n[d];if(o.setNode(c),u){var p=n[u],m=o.edge(p,c);o.setEdge(p,c,Math.max(a(r,d,u),m||0))}u=d})}),o}function ji(r,e){return F(Ae(e),function(n){var{NEGATIVE_INFINITY:t,POSITIVE_INFINITY:o}=Number;return re(n,function(i,a){var f=Bi(r,a)/2;t=Math.max(i+f,t),o=Math.min(i-f,o)}),t-o})}function Fi(r,e){var n=Ae(e),t=k(n),o=b(n);s(["u","d"],function(i){s(["l","r"],function(a){var f=i+a,u=r[f],d;if(u===e)return;var c=Ae(u);if(d=a==="l"?t-k(c):o-b(c),d)r[f]=M(u,function(p){return p+d})})})}function Ai(r,e){return M(r.ul,function(n,t){if(e)return r[e.toLowerCase()][t];else{var o=x(O(r,t));return(o[1]+o[2])/2}})}function Un(r){var e=N(r),n=X(Pi(r,e),Ci(r,e)),t={},o;s(["u","d"],function(a){o=a==="u"?e:Ae(e).reverse(),s(["l","r"],function(f){if(f==="r")o=O(o,function(p){return Ae(p).reverse()});var u=(a==="u"?r.predecessors:r.successors).bind(r),d=Ri(r,o,n,u),c=Ti(r,o,d.root,d.align,f==="r");if(f==="r")c=M(c,function(p){return-p});t[a+f]=c})});var i=ji(r,t);return Fi(t,i),Ai(t,r.graph().align)}function Gi(r,e,n){return function(t,o,i){var a=t.node(o),f=t.node(i),u=0,d;if(u+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":d=-a.width/2;break;case"r":d=a.width/2;break}if(d)u+=n?d:-d;if(d=0,u+=(a.dummy?e:r)/2,u+=(f.dummy?e:r)/2,u+=f.width/2,Object.prototype.hasOwnProperty.call(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":d=f.width/2;break;case"r":d=-f.width/2;break}if(d)u+=n?d:-d;return d=0,u}}function Bi(r,e){return r.node(e).width}function Wn(r){r=er(r),Vi(r),ne(Un(r),function(e,n){r.node(n).x=e})}function Vi(r){var e=N(r),n=r.graph().ranksep,t=0;s(e,function(o){var i=b(O(o,function(a){return r.node(a).height}));s(o,function(a){r.node(a).y=t+i/2}),t+=i+n})}function rr(r,e){var n=e&&e.debugTiming?Ke:Ze;n("layout",()=>{var t=n(" buildLayoutGraph",()=>Zi(r));n(" runLayout",()=>Di(t,n)),n(" updateInputGraph",()=>zi(r,t))})}function Di(r,e){e(" makeSpaceForEdgeLabels",()=>Qi(r)),e(" removeSelfEdges",()=>fa(r)),e(" acyclic",()=>ze(r)),e(" nestingGraph.run",()=>In(r)),e(" rank",()=>Cr(er(r))),e(" injectEdgeLabelProxies",()=>$i(r)),e(" removeEmptyRanks",()=>Xe(r)),e(" nestingGraph.cleanup",()=>Pn(r)),e(" normalizeRanks",()=>He(r)),e(" assignRankMinMax",()=>ra(r)),e(" removeEdgeLabelProxies",()=>ea(r)),e(" normalize.run",()=>on(r)),e(" parentDummyChains",()=>zn(r)),e(" addBorderSegments",()=>$e(r)),e(" order",()=>Dn(r)),e(" insertSelfEdges",()=>ua(r)),e(" adjustCoordinateSystem",()=>en(r)),e(" position",()=>Wn(r)),e(" positionSelfEdges",()=>sa(r)),e(" removeBorderNodes",()=>aa(r)),e(" normalize.undo",()=>an(r)),e(" fixupEdgeLabelCoords",()=>oa(r)),e(" undoCoordinateSystem",()=>nn(r)),e(" translateGraph",()=>na(r)),e(" assignNodeIntersects",()=>ta(r)),e(" reversePoints",()=>ia(r)),e(" acyclic.undo",()=>Ue(r))}function zi(r,e){s(r.nodes(),function(n){var t=r.node(n),o=e.node(n);if(t){if(t.x=o.x,t.y=o.y,e.children(n).length)t.width=o.width,t.height=o.height}}),s(r.edges(),function(n){var t=r.edge(n),o=e.edge(n);if(t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x"))t.x=o.x,t.y=o.y}),r.graph().width=e.graph().width,r.graph().height=e.graph().height}var Yi=["nodesep","edgesep","ranksep","marginx","marginy"],Ui={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Wi=["acyclicer","ranker","rankdir","align"],qi=["width","height"],Hi={width:0,height:0},Xi=["minlen","weight","width","height","labeloffset"],Ji={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ki=["labelpos"];function Zi(r){var e=new L({multigraph:!0,compound:!0}),n=Rr(r.graph());return e.setGraph(X({},Ui,Sr(n,Yi),A(n,Wi))),s(r.nodes(),function(t){var o=Rr(r.node(t));e.setNode(t,Hr(Sr(o,qi),Hi)),e.setParent(t,r.parent(t))}),s(r.edges(),function(t){var o=Rr(r.edge(t));e.setEdge(t,X({},Ji,Sr(o,Xi),A(o,Ki)))}),e}function Qi(r){var e=r.graph();e.ranksep/=2,s(r.edges(),function(n){var t=r.edge(n);if(t.minlen*=2,t.labelpos.toLowerCase()!=="c")if(e.rankdir==="TB"||e.rankdir==="BT")t.width+=t.labeloffset;else t.height+=t.labeloffset})}function $i(r){s(r.edges(),function(e){var n=r.edge(e);if(n.width&&n.height){var t=r.node(e.v),o=r.node(e.w),i={rank:(o.rank-t.rank)/2+t.rank,e};E(r,"edge-proxy",i,"_ep")}})}function ra(r){var e=0;s(r.nodes(),function(n){var t=r.node(n);if(t.borderTop)t.minRank=r.node(t.borderTop).rank,t.maxRank=r.node(t.borderBottom).rank,e=b(e,t.maxRank)}),r.graph().maxRank=e}function ea(r){s(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="edge-proxy")r.edge(n.e).labelRank=n.rank,r.removeNode(e)})}function na(r){var e=Number.POSITIVE_INFINITY,n=0,t=Number.POSITIVE_INFINITY,o=0,i=r.graph(),a=i.marginx||0,f=i.marginy||0;function u(d){var{x:c,y:p,width:m,height:l}=d;e=Math.min(e,c-m/2),n=Math.max(n,c+m/2),t=Math.min(t,p-l/2),o=Math.max(o,p+l/2)}s(r.nodes(),function(d){u(r.node(d))}),s(r.edges(),function(d){var c=r.edge(d);if(Object.prototype.hasOwnProperty.call(c,"x"))u(c)}),e-=a,t-=f,s(r.nodes(),function(d){var c=r.node(d);c.x-=e,c.y-=t}),s(r.edges(),function(d){var c=r.edge(d);if(s(c.points,function(p){p.x-=e,p.y-=t}),Object.prototype.hasOwnProperty.call(c,"x"))c.x-=e;if(Object.prototype.hasOwnProperty.call(c,"y"))c.y-=t}),i.width=n-e+a,i.height=o-t+f}function ta(r){s(r.edges(),function(e){var n=r.edge(e),t=r.node(e.v),o=r.node(e.w),i,a;if(!n.points)n.points=[],i=o,a=t;else i=n.points[0],a=n.points[n.points.length-1];n.points.unshift(_r(t,i)),n.points.push(_r(o,a))})}function oa(r){s(r.edges(),function(e){var n=r.edge(e);if(Object.prototype.hasOwnProperty.call(n,"x")){if(n.labelpos==="l"||n.labelpos==="r")n.width-=n.labeloffset;switch(n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}}})}function ia(r){s(r.edges(),function(e){var n=r.edge(e);if(n.reversed)n.points.reverse()})}function aa(r){s(r.nodes(),function(e){if(r.children(e).length){var n=r.node(e),t=r.node(n.borderTop),o=r.node(n.borderBottom),i=r.node(S(n.borderLeft)),a=r.node(S(n.borderRight));n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-t.y),n.x=i.x+n.width/2,n.y=t.y+n.height/2}}),s(r.nodes(),function(e){if(r.node(e).dummy==="border")r.removeNode(e)})}function fa(r){s(r.edges(),function(e){if(e.v===e.w){var n=r.node(e.v);if(!n.selfEdges)n.selfEdges=[];n.selfEdges.push({e,label:r.edge(e)}),r.removeEdge(e)}})}function ua(r){var e=N(r);s(e,function(n){var t=0;s(n,function(o,i){var a=r.node(o);a.order=i+t,s(a.selfEdges,function(f){E(r,"selfedge",{width:f.label.width,height:f.label.height,rank:a.rank,order:i+ ++t,e:f.e,label:f.label},"_se")}),delete a.selfEdges})})}function sa(r){s(r.nodes(),function(e){var n=r.node(e);if(n.dummy==="selfedge"){var t=r.node(n.e.v),o=t.x+t.width/2,i=t.y,a=n.x-o,f=t.height/2;r.setEdge(n.e,n.label),r.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-f},{x:o+5*a/6,y:i-f},{x:o+a,y:i},{x:o+5*a/6,y:i+f},{x:o+2*a/3,y:i+f}],n.label.x=n.x,n.label.y=n.y}})}function Sr(r,e){return M(A(r,e),Number)}function Rr(r){var e={};return s(r,function(n,t){e[t.toLowerCase()]=n}),e}
2
+ export{rr};
@@ -0,0 +1,2 @@
1
+ import{z,xi,ue,Dt,zi,On,Ke,Ut,ae,wr,qr,qt,Gi,wi,$n}from"./index-1r72hdzb.js";function k(l){return l.innerRadius}function b(l){return l.outerRadius}function _(l){return l.startAngle}function nn(l){return l.endAngle}function en(l){return l&&l.padAngle}function rn(l,d,q,P,x,h,S,r){var D=q-l,a=P-d,n=S-x,y=r-h,u=y*D-n*a;if(u*u<ae)return;return u=(n*(d-h)-y*(l-x))/u,[l+u*D,d+u*a]}function M(l,d,q,P,x,h,S){var r=l-q,D=d-P,a=(S?h:-h)/Ut(r*r+D*D),n=a*D,y=-a*r,u=l+n,s=d+y,t=q+n,f=P+y,j=(u+t)/2,o=(s+f)/2,g=t-u,c=f-s,v=g*g+c*c,A=x-h,R=u*f-t*s,E=(c<0?-1:1)*Ut(zi(0,A*A*v-R*R)),I=(R*c-g*E)/v,O=(-R*g-c*E)/v,T=(R*c+g*E)/v,m=(-R*g+c*E)/v,p=I-j,e=O-o,i=T-j,B=m-o;if(p*p+e*e>i*i+B*B)I=T,O=m;return{cx:I,cy:O,x01:-n,y01:-y,x11:I*(x/A-1),y11:O*(x/A-1)}}function De(){var l=k,d=b,q=z(0),P=null,x=_,h=nn,S=en,r=null,D=$n(a);function a(){var n,y,u=+l.apply(this,arguments),s=+d.apply(this,arguments),t=x.apply(this,arguments)-qr,f=h.apply(this,arguments)-qr,j=xi(f-t),o=f>t;if(!r)r=n=D();if(s<u)y=s,s=u,u=y;if(!(s>ae))r.moveTo(0,0);else if(j>qt-ae){if(r.moveTo(s*Dt(t),s*Ke(t)),r.arc(0,0,s,t,f,!o),u>ae)r.moveTo(u*Dt(f),u*Ke(f)),r.arc(0,0,u,f,t,o)}else{var g=t,c=f,v=t,A=f,R=j,E=j,I=S.apply(this,arguments)/2,O=I>ae&&(P?+P.apply(this,arguments):Ut(u*u+s*s)),T=On(xi(s-u)/2,+q.apply(this,arguments)),m=T,p=T,e,i;if(O>ae){var B=wi(O/u*Ke(I)),G=wi(O/s*Ke(I));if((R-=B*2)>ae)B*=o?1:-1,v+=B,A-=B;else R=0,v=A=(t+f)/2;if((E-=G*2)>ae)G*=o?1:-1,g+=G,c-=G;else E=0,g=c=(t+f)/2}var C=s*Dt(g),F=s*Ke(g),H=u*Dt(A),J=u*Ke(A);if(T>ae){var K=s*Dt(c),L=s*Ke(c),N=u*Dt(v),Q=u*Ke(v),w;if(j<wr)if(w=rn(C,F,N,Q,K,L,H,J)){var U=C-w[0],V=F-w[1],W=K-w[0],X=L-w[1],Y=1/Ke(Gi((U*W+V*X)/(Ut(U*U+V*V)*Ut(W*W+X*X)))/2),Z=Ut(w[0]*w[0]+w[1]*w[1]);m=On(T,(u-Z)/(Y-1)),p=On(T,(s-Z)/(Y+1))}else m=p=0}if(!(E>ae))r.moveTo(C,F);else if(p>ae)if(e=M(N,Q,C,F,s,p,o),i=M(K,L,H,J,s,p,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),p<T)r.arc(e.cx,e.cy,p,ue(e.y01,e.x01),ue(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,p,ue(e.y01,e.x01),ue(e.y11,e.x11),!o),r.arc(0,0,s,ue(e.cy+e.y11,e.cx+e.x11),ue(i.cy+i.y11,i.cx+i.x11),!o),r.arc(i.cx,i.cy,p,ue(i.y11,i.x11),ue(i.y01,i.x01),!o);else r.moveTo(C,F),r.arc(0,0,s,g,c,!o);if(!(u>ae)||!(R>ae))r.lineTo(H,J);else if(m>ae)if(e=M(H,J,K,L,u,-m,o),i=M(C,F,N,Q,u,-m,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),m<T)r.arc(e.cx,e.cy,m,ue(e.y01,e.x01),ue(i.y01,i.x01),!o);else r.arc(e.cx,e.cy,m,ue(e.y01,e.x01),ue(e.y11,e.x11),!o),r.arc(0,0,u,ue(e.cy+e.y11,e.cx+e.x11),ue(i.cy+i.y11,i.cx+i.x11),o),r.arc(i.cx,i.cy,m,ue(i.y11,i.x11),ue(i.y01,i.x01),!o);else r.arc(0,0,u,A,v,o)}if(r.closePath(),n)return r=null,n+""||null}return a.centroid=function(){var n=(+l.apply(this,arguments)+ +d.apply(this,arguments))/2,y=(+x.apply(this,arguments)+ +h.apply(this,arguments))/2-wr/2;return[Dt(y)*n,Ke(y)*n]},a.innerRadius=function(n){return arguments.length?(l=typeof n==="function"?n:z(+n),a):l},a.outerRadius=function(n){return arguments.length?(d=typeof n==="function"?n:z(+n),a):d},a.cornerRadius=function(n){return arguments.length?(q=typeof n==="function"?n:z(+n),a):q},a.padRadius=function(n){return arguments.length?(P=n==null?null:typeof n==="function"?n:z(+n),a):P},a.startAngle=function(n){return arguments.length?(x=typeof n==="function"?n:z(+n),a):x},a.endAngle=function(n){return arguments.length?(h=typeof n==="function"?n:z(+n),a):h},a.padAngle=function(n){return arguments.length?(S=typeof n==="function"?n:z(+n),a):S},a.context=function(n){return arguments.length?(r=n==null?null:n,a):r},a}
2
+ export{De};
@@ -0,0 +1,2 @@
1
+ import{e,n}from"./index-1r72hdzb.js";var le=e((o,t)=>{let m;if(t==="sandbox")m=n("#i"+o);return(t==="sandbox"?n(m.nodes()[0].contentDocument.body):n("body")).select(`[id="${o}"]`)},"getDiagramElement");
2
+ export{le};