@pi-outpost/embed 0.54.0 → 0.56.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 (27) hide show
  1. package/README.md +1 -1
  2. package/dist/{CodeEditor-Dei7wUOV.js → CodeEditor-C2mtBAxz.js} +21 -21
  3. package/dist/{CodeEditor-CIWnYOMo.cjs → CodeEditor-CHKp59kP.cjs} +3 -3
  4. package/dist/{PdfViewer-HG_qT5b4.js → PdfViewer-DOE0n8FV.js} +94 -73
  5. package/dist/{PdfViewer-CCav_nmm.cjs → PdfViewer-SiwxJfzA.cjs} +1 -1
  6. package/dist/{conversationExport-CPhTW6Ko.cjs → conversationExport-CE0UTxEg.cjs} +2 -2
  7. package/dist/{conversationExport-BlW4R5hL.js → conversationExport-DojQkOLk.js} +45 -45
  8. package/dist/conversationHistory-DdjP3rjR.cjs +537 -0
  9. package/dist/{conversationHistory-wmxP-e7h.js → conversationHistory-g6h0_Fjx.js} +21044 -17852
  10. package/dist/{dist-CUml8Wzk.js → dist-B9wvGgxB.js} +1 -1
  11. package/dist/{dist-BB8DIy0-.cjs → dist-BMzIUMhf.cjs} +1 -1
  12. package/dist/{dist-DU0BjKn0.cjs → dist-BawiB8yE.cjs} +1 -1
  13. package/dist/{dist-BXKM-sMu.cjs → dist-BjxwUutQ.cjs} +1 -1
  14. package/dist/{dist-CuX47mx0.js → dist-Bk3hLKgL.js} +1 -1
  15. package/dist/{dist-CqvTKR3J.cjs → dist-Bnsp4Y3i.cjs} +1 -1
  16. package/dist/{dist-0gxsdPHi.cjs → dist-CM2l_BHt.cjs} +1 -1
  17. package/dist/{dist-CDuDYc3h.js → dist-CvxwObne.js} +1 -1
  18. package/dist/{dist-BhRuhsmx.js → dist-DUziszL2.js} +1 -1
  19. package/dist/{dist-DNzYo4it.cjs → dist-F6qtkv2Q.cjs} +1 -1
  20. package/dist/{dist-CV2qXUTt.js → dist-LBUs7dVk.js} +1 -1
  21. package/dist/{dist-Ccs3Mpvk.js → dist-VWDOErn8.js} +1 -1
  22. package/dist/{dist-BAXGE-5E.cjs → dist-kpPXlS4A.cjs} +1 -1
  23. package/dist/{dist-Bt2YslBF.js → dist-nQ2aeIgK.js} +2 -2
  24. package/dist/pi-outpost-embed.cjs +36 -33
  25. package/dist/pi-outpost-embed.js +3328 -2858
  26. package/package.json +1 -1
  27. package/dist/conversationHistory-DVdpMO_m.cjs +0 -424
@@ -0,0 +1,537 @@
1
+ const e=require("./rolldown-runtime-DbbDpzbe.cjs"),t=require("./lib-CRTt_FoR.cjs"),n=require("./workspacePath-BdmjN0W2.cjs"),r=require("./download-U7JEZ6c9.cjs"),i=require("./katex-C-T_oEhv.cjs");let a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");var c=(0,a.createContext)(`dark`),l=()=>(0,a.useContext)(c);function u({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,a.useState)(!1);async function s(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,o.jsx)(`button`,{type:`button`,onClick:s,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}function d(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function f({label:e,open:t,onClose:n,children:r,actions:i,containerRef:c,anchorRef:l,testId:u=`structured-enlarged`}){(0,a.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let f=(0,a.useRef)(void 0);return f.current=d(l?.current)??f.current,t?(0,s.createPortal)((0,o.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":u,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/60 p-6`,children:(0,o.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex max-h-full min-w-0 w-auto max-w-[95vw] flex-col overflow-hidden rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,o.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center justify-between gap-4`,children:[(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,o.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,o.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})})]}),(0,o.jsx)(`div`,{ref:c,role:`region`,"aria-label":`${e} content`,tabIndex:0,className:`min-h-0 min-w-0 overflow-auto [&_svg]:!max-w-none`,children:r}),i&&(0,o.jsx)(`div`,{className:`mt-2 flex shrink-0 flex-wrap items-center justify-start gap-3`,children:i})]})}),f.current??globalThis.document.body):null}var p=.8;function m(e){return e===`landscape`?`portrait`:`landscape`}function h(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*p?`portrait`:`landscape`}var g=[`LR`,`RL`];function _(e){return g.includes(e)?`landscape`:`portrait`}function v(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function y(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function b(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function x(e){let t=e.split(`
2
+ `),n=b(t);if(n===-1)return;let r=t[n],i=/^(\s*)(flowchart|graph)([ \t]+(TD|TB|BT|LR|RL)\b)?(.*)$/i.exec(r);if(i!==null){let[,e,r,,a,o]=i,s=a===void 0?`TB`:y(a),c=v(s),l=[...t];return l[n]=`${e}${r} ${c}${o}`,{direction:s,turned:l.join(`
3
+ `)}}let a=/^(\s*)stateDiagram(-v2)?\s*$/i.exec(r);if(a!==null)return S(t,n,a[1])}function S(e,t,n){let r=0;for(let n=t+1;n<e.length;n+=1){let t=e[n],i=r===0?/^\s*direction\s+(TD|TB|BT|LR|RL)\s*$/i.exec(t):null;if(i!==null){let r=y(i[1]),a=[...e];return a[n]=t.replace(/(direction\s+)(TD|TB|BT|LR|RL)/i,`$1${v(r)}`),{direction:r,turned:a.join(`
4
+ `)}}r+=(t.match(/\{/g)?.length??0)-(t.match(/\}/g)?.length??0),r<0&&(r=0)}let i=[...e];return i.splice(t+1,0,`${n} direction LR`),{direction:`TB`,turned:i.join(`
5
+ `)}}var C=`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,w=`flex flex-wrap items-center gap-3 text-xs`,T=null;async function E(e){let t=await(T??=Promise.resolve().then(()=>require("./mermaid.core-73kk5oPm.cjs")).then(e=>e.t));return t.default.initialize({startOnLoad:!1,theme:e,look:`classic`,securityLevel:`strict`,suppressErrorRendering:!0}),t}function ee(e){let t=/viewBox="\s*[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e),n=t?Number(t[1]):NaN;return Number.isFinite(n)&&n>0?n:void 0}function D(e,t){if(typeof e!=`object`||!e||!(`props`in e))return null;let n=e.props;if(t!==void 0&&!RegExp(`\\blanguage-${t}\\b`).test(n.className??``))return null;let r=n.children;return typeof r==`string`?r:Array.isArray(r)&&r.every(e=>typeof e==`string`)?r.join(``):null}function te(e){let t=D(e,`mermaid`);return t===null?null:t.trim()}function ne(e){let{children:t,...n}=e,r=te(t);if(r!==null)return(0,o.jsx)(re,{code:r});let i=D(t);return i===null?(0,o.jsx)(`pre`,{...n,children:t}):(0,o.jsxs)(`div`,{className:`code-block relative`,"data-testid":`code-block`,children:[(0,o.jsx)(`pre`,{...n,children:t}),(0,o.jsx)(u,{iconOnly:!0,text:i.replace(/\n$/,``),className:`absolute right-1.5 top-1.5 rounded border border-zinc-300 bg-white/80 px-1.5 py-0.5 text-xs text-zinc-500 hover:text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900/80 dark:text-zinc-400 dark:hover:text-zinc-100`})]})}function re({code:e}){let n=(0,a.useId)().replace(/[^a-zA-Z0-9]/g,``),r=l()===`light`?`default`:`dark`,[i,s]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[p,g]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,S]=(0,a.useState)(!1),[T,D]=(0,a.useState)(null),te=(0,a.useRef)(!1),ne=(0,a.useRef)(0),re=(0,a.useRef)(0),ie=()=>`mermaid-${n}-${++re.current}`,ae=(0,a.useMemo)(()=>x(e),[e]),oe=ae===void 0?`landscape`:_(ae.direction),[se,ce]=(0,a.useState)(void 0),le=i?.svg??null,ue=i!==null&&i.orientation!==oe,de=(0,a.useRef)(null),O=(0,a.useRef)(e);O.current=e,(0,a.useEffect)(()=>(ne.current+=1,s(null),ce(void 0),y(!1),d(null),D(null),()=>{ne.current+=1}),[e]);async function fe(){if(!i||te.current)return;te.current=!0,S(!0),D(null);let e=ne.current;try{let{renderDiagram:t}=await Promise.resolve().then(()=>require("./mermaidToImage-Ckx06W6z.cjs")).then(e=>e.r),r=await t(i.source,`mermaid-download-${n}`);if(e!==ne.current)return;let a=URL.createObjectURL(new Blob([r.svg],{type:`image/svg+xml;charset=utf-8`}));try{let e=document.createElement(`a`);e.href=a,e.download=`diagram.svg`,e.click()}finally{URL.revokeObjectURL(a)}}catch(t){e===ne.current&&D(t instanceof Error?t.message:String(t))}finally{te.current=!1,S(!1)}}return(0,a.useEffect)(()=>{let e=!1,n=setTimeout(()=>void t.h(async()=>{try{let t=(await E(r)).default,n=O.current,i=x(n),a=i===void 0?`landscape`:_(i.direction);if(se!==void 0&&i!==void 0){let r=se===a?n:i.turned,{svg:o}=await t.render(ie(),r);e||(s({svg:o,orientation:se,source:r}),d(null));return}let o=await t.render(ie(),n),c={svg:o.svg,orientation:a,source:n},l=ee(o.svg);if(i!==void 0&&l!==void 0&&l>710){let e=await t.render(ie(),i.turned),n=ee(e.svg);if(n!==void 0){let t=a===`landscape`?h(l,n):h(n,l);t!==a&&(c={svg:e.svg,orientation:t,source:i.turned})}}e||(s(c),d(null))}catch(t){e||(s(null),d(t instanceof Error?t.message:String(t)))}}),300);return()=>{e=!0,clearTimeout(n)}},[e,n,r,se]),le?(0,o.jsxs)(`div`,{ref:de,className:`my-2 flex flex-col gap-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`,children:[(0,o.jsxs)(`div`,{className:`${w} order-3`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:()=>g(!p),title:p?`Show diagram`:`Show code`,className:C,children:p?`⚏ diagram`:`⌗ code`}),!p&&ae!==void 0&&i!==null&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`mermaid-orientation`,onClick:()=>ce(e=>m(e??i.orientation)),title:i.orientation===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${m(i.orientation)}`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,children:i.orientation===`portrait`?`↔ landscape`:`↕ portrait`}),!p&&(0,o.jsx)(`button`,{type:`button`,onClick:()=>y(!0),"aria-label":`Show diagram at full size`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,children:`⤢ enlarge`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:b,onClick:()=>void fe(),title:`Save as .svg — insert it as a picture in a document`,children:b?`preparing SVG…`:`⤓ download SVG`}),(0,o.jsx)(u,{text:e,className:C}),T&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,T]})]}),p?(0,o.jsx)(`pre`,{className:`overflow-x-auto font-mono text-xs text-zinc-500 dark:text-zinc-400`,children:e}):(0,o.jsx)(`div`,{className:`flex justify-center overflow-x-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:le}}),ue&&!p&&(0,o.jsxs)(`div`,{className:`mt-1 text-center text-xs text-zinc-400 dark:text-zinc-600`,"data-testid":`mermaid-turned`,children:[`drawn `,i?.orientation,` to fit — the source asks for `,oe]}),(0,o.jsx)(f,{label:`diagram`,testId:`mermaid-enlarged`,open:v,onClose:()=>y(!1),anchorRef:de,actions:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:b,onClick:()=>void fe(),children:b?`preparing SVG…`:`⤓ download SVG`}),T&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,T]})]}),children:(0,o.jsx)(`div`,{style:{width:ee(le)},className:`[&_svg]:!h-auto [&_svg]:!max-w-none [&_svg]:!w-full`,dangerouslySetInnerHTML:{__html:le}})})]}):(0,o.jsxs)(`pre`,{className:`my-2 overflow-x-auto rounded-lg border border-zinc-200 bg-zinc-50 p-3 font-mono text-xs text-zinc-500 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-400`,children:[e,c&&(0,o.jsx)(`div`,{className:`mt-2 text-red-600 dark:text-red-400`,children:c})]})}var ie=`urn:structured-exchange:1`,ae=[`graph`,`sequence`];function oe(e){return se(e)?[`graph`,`sequence`,`table`]:ae}function se(e){return e===`urn:structured-exchange:2`||e===`urn:structured-exchange:3`}function ce(e){if(Array.isArray(e))return{cells:e};let t=e.heading;return typeof t==`string`?{cells:[],role:e.role,heading:t}:{cells:e.cells,role:e.role}}var le={nodes:500,edges:2e3,participants:100,messages:1e3,columns:50,rows:5e3,removals:500,ref:200,localId:200,label:500,kind:100,kindsPerVocabulary:64,columnName:200,cell:1e3},ue=`urn:structured-exchange:2`,de={profile:200,attributesPerItem:50,removeAttributesPerItem:50,attributeName:200,attributeString:1e3,attributeListItems:50,revision:200,locationsPerItem:10,uri:2e3,position:1e6,artifactsPerItem:20,artifactsPerDocument:50,artifactRel:100,artifactMediaType:100,artifactLabel:500,artifactDigest:71,relations:2e3,heading:500,headingDepth:6,viewpoints:20,viewpointConcern:500},O=8e6,fe=`urn:structured-exchange:3`,pe=[ie,ue,fe];function me(e){return pe.find(t=>t===e)}var he=4e6,ge=Math.max(he,O);function _e(e){return se(e)?O:he}var ve=e=>new TextEncoder().encode(e).length;function ye(e){return e===`bytes`?ge:e===`relations`?de.relations:le[e]}function be(e,t){let n=ye(e),r=t?.[e];return r===void 0||r>=n?{limit:n,level:`ceiling`}:{limit:r,level:`deployment`}}function xe(e,t,n){let r=ve(e),i=be(`bytes`,t),a=n===void 0?1/0:_e(n),o=Math.min(i.limit,a),s=o===a&&a<i.limit?`ceiling`:i.level;if(!(r<=o))return{rule:`document-too-large`,path:``,message:`document is ${r} bytes, past the ${o}-byte ${s===`ceiling`?`contract ceiling`:`limit this deployment applies`}`,limit:o,observed:r,level:s}}var k={graph:[`nodes`,`edges`],sequence:[`participants`,`messages`],table:[`columns`,`rows`,`relations`]};function A(e,t){if(t===void 0)return[];let n=[];for(let r of k[e.kind]??[]){let i=e.data[r];if(!Array.isArray(i))continue;let{limit:a,level:o}=be(r,t);o===`deployment`&&i.length>a&&n.push({rule:`collection-past-deployment-limit`,path:`/data/${r}`,message:`${r} has ${i.length} entries, past the ${a} this deployment allows`,limit:a,observed:i.length,level:o})}return n}function Se(e,t){let n={};for(let t of k[e.kind]??[]){let r=e.data[t];Array.isArray(r)&&(n[t]=r.length)}return{kind:e.kind,bytes:ve(t),counts:n}}var Ce=6.6,we=5.4;function Te(e,t,n){let r=e.flatMap(e=>e.split(/\r?\n/)).reduce((e,t)=>Math.max(e,t.length),0);return Math.min(Math.max(r*Ce+22,t),n)}function Ee(e,t,n,r){let i=t.map(e=>Ae(e).length).reduce((e,t)=>Math.max(e,t),0);return Math.max(Te(e,n,r),Math.min(i*we+22,r))}function De(e,t,n=Ce){let r=Math.max(Math.floor((t-22)/n+1e-6),4),i=[],a=e.split(/\r?\n/);if(a.length>1)return a.flatMap(e=>De(e,t,n)).slice(0,3);let o=``;for(let t of e.split(/\s+/)){let e=o===``?t:`${o} ${t}`;if(e.length<=r)o=e;else for(o!==``&&i.push(o),o=t;o.length>r&&i.length<3;)i.push(o.slice(0,r)),o=o.slice(r)}if(o!==``&&i.push(o),i.length===0)return[``];if(i.length<=3)return i;let s=i.slice(0,3);return s[2]=`${s[2].slice(0,Math.max(r-1,1))}…`,s}function Oe(e,t){return e*15+t*15+14}function ke(e,t){return e.flatMap(e=>De(Ae(e),t,we))}function Ae(e){return`${e.field}: ${e.from===void 0?``:`${e.from} → `}${e.to}`}function je(e,t){return`${e}: ${Me(t)}`}function Me(e){return Array.isArray(e)?e.map(e=>Me(e)).join(`, `):e===null?`null`:typeof e==`object`&&e&&typeof e.ref==`string`?`<${e.ref}>`:String(e)}function Ne(e){let t=e.range===void 0?``:` lines ${e.range.startLine}–${e.range.endLine}`,n=e.revision===void 0?``:` at ${e.revision}`;return`${e.uri}${t}${n}`}function Pe(e){let t=e.label===void 0?e.uri:`${e.label} (${e.uri})`,n=e.mediaType===void 0?``:`, ${e.mediaType}`;return`${e.rel}: ${t}${n} — ${e.sha256.slice(0,14)}…`}var Fe=864e5,Ie=/^(\d{4})-(\d{2})-(\d{2})$/;function Le(e){let t=Ie.exec(e);if(t===null)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],a=new Date(Date.UTC(n,r-1,i));if(a.setUTCFullYear(n,r-1,i),a.getUTCFullYear()===n&&a.getUTCMonth()===r-1&&a.getUTCDate()===i)return Math.round(a.getTime()/Fe)}function Re(e){let t=new Date(e*Fe);return`${String(t.getUTCFullYear()).padStart(4,`0`)}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`}function ze(e=new Date){return Math.round(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/Fe)}function Be(e){let t=Le(e.type===`activity`?e.start:e.date),n=Le(e.type===`activity`?e.end:e.date);return t===void 0||n===void 0?void 0:{start:t,end:n}}function Ve(e){let t=new Map;return e.rows.forEach((e,n)=>{e.type===`task`&&(t.has(e.id)||t.set(e.id,{id:e.id,type:`task`,row:n,days:He(e)}),e.items.forEach((e,r)=>{e.id===void 0||t.has(e.id)||t.set(e.id,{id:e.id,type:e.type,row:n,item:r,days:Be(e)})}))}),t}function He(e){let t;for(let n of e.items){let e=Be(n);e!==void 0&&(t=t===void 0?{...e}:{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)})}return t}function Ue(e){return e.type??`finish-to-start`}function We(e){return{from:e.startsWith(`finish`)?`end`:`start`,to:e.endsWith(`finish`)?`end`:`start`}}function Ge(e,t){let n=t.get(e.from)?.days,r=t.get(e.to)?.days;if(n===void 0||r===void 0)return;let i=We(Ue(e));return r[i.to]>=n[i.from]}function Ke(e){if(`date`in e){let t=Le(e.date)??0;return{start:t,end:t}}return{start:Le(e.start)??0,end:Le(e.end)??0}}function qe(e){if(e.previous===void 0)return;let t=Ke(e.type===`activity`?{start:e.start,end:e.end}:{date:e.date}),n=Ke(e.previous);return{start:t.start-n.start,end:t.end-n.end}}function Je(e){if(e===0)return``;let t=e>0?`+`:`−`,n=Math.abs(e);return n<14?`${t}${n}d`:n<70?`${t}${Math.round(n/7)}w`:`${t}${Math.round(n/30.44)}mo`}function Ye(e){let t=qe(e);return t===void 0?``:t.start===t.end?Je(t.start):t.start===0?`end${Je(t.end)}`:t.end===0?`start${Je(t.start)}`:`${Je(t.start)}, end${Je(t.end)}`}function Xe(e,t){if(e.role!==void 0||t?.role!==void 0)return!0;let n=qe(e);return n!==void 0&&(n.start!==0||n.end!==0)}function Ze(e){return e.role!==void 0||e.items.some(t=>Xe(t,e))}var Qe={week:12,month:4,quarter:.75};function $e(e,t){let n=e>=8?`week`:e>=1?`month`:`quarter`;if(t===void 0)return n;let r=[`week`,`month`,`quarter`];return r[Math.max(r.indexOf(n),r.indexOf(t))]}var et=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function tt(e){return e.width>=24?e.label:e.width>=9?e.label.charAt(0):``}function nt(e,t){return t===`month`?tt(e):e.width>=e.label.length*6+4?e.label:``}function rt(e){return((e+3)%7+7)%7}function it(e){let t=e-rt(e)+3,n=new Date(t*Fe).getUTCFullYear();return Math.floor((t-ct(n,0))/7)+1}function at(e){if(e.label!==void 0&&e.label!==``)return e.label;if(e.type===`milestone`&&e.kind!==void 0&&e.kind!==``)return e.kind}function ot(e){return e.length*Ce}function st(e,t){let n=new Date(e*Fe),r=n.getUTCFullYear(),i=n.getUTCMonth(),a=[];for(;;){i+=1,i===12&&(i=0,r+=1);let e=ct(r,i);if(e>t)return a;a.push({day:e,year:r,month:i})}}function ct(e,t){let n=new Date(0);return n.setUTCFullYear(e,t,1),Math.round(n.getTime()/Fe)}function lt(e,t){let n=e=>e===`bar`||e===`ghost`;return n(e)&&t===`star`||e===`star`&&n(t)}function ut(e,t){return e.x0<t.x1&&t.x0<e.x1}function dt(e,t){if(t<=0||e.width<=t)return;let n=e.items.filter(e=>e.change!==void 0);if(n.length>0){let e=Math.min(...n.flatMap(e=>e.ghost===void 0?[e.glyph.x]:[e.glyph.x,e.ghost.x]));return e<t*.9?void 0:Math.max(0,e-t/6)}if(`x`in e.today&&e.today.x>t*.8)return Math.max(0,e.today.x-t/3)}function ft(e,t,n={}){let r=Le(e.time.start)??0,i=Le(e.time.end)??r,a=n.pxPerDay??Qe[e.time.scale]??4,o=(i-r+1)*a,s=e=>(e-r)*a,c=st(r,i),l=new Date(r*Fe),u=[{day:r,year:l.getUTCFullYear(),month:l.getUTCMonth()},...c],d=u.map((e,t)=>{let n=t+1<u.length?u[t+1].day:i+1;return{label:et[e.month],x:s(e.day),width:(n-e.day)*a,year:e.year,month:e.month}}),f=[];u.forEach((e,t)=>{let n=d[t],r=f[f.length-1];r!==void 0&&r.label===String(e.year)?r.width+=n.width:f.push({label:String(e.year),x:n.x,width:n.width})});let p=$e(a,n.unit),m=(e,t)=>e.map((n,r)=>{let o=r+1<e.length?e[r+1]:i+1;return{label:t(n),x:s(n),width:(o-n)*a}}),h=f,g;if(p===`week`){let e=[];for(let t=r-rt(r)+7;t<=i;t+=7)e.push(t);g=m([r,...e],e=>`W${it(e)}`),h=d.map(e=>({label:`${e.label} ${e.year}`,x:e.x,width:e.width}))}else if(p===`quarter`){let e=u.filter((e,t)=>t===0||e.month%3==0);g=e.map((t,n)=>{let r=n+1<e.length?e[n+1].day:i+1;return{label:`Q${Math.floor(t.month/3)+1}`,x:s(t.day),width:(r-t.day)*a}})}else g=d;let _=g.slice(1).map(e=>e.x),v=[],y=[],b=0,x=e.comparedTo!==void 0,S=(e,t)=>{if(!x)return;if(e.role===`added`||t.role===`added`)return`(new)`;let n=Ye(e);return n===``?void 0:`(${n})`},C=(e,t,n)=>{let r=S(e,t);return r===void 0?n:n===void 0?r:`${n} ${r}`},w=(e,t)=>{if(x)return e.role===`removed`||t.role===`removed`?`removed`:e.role===`added`||t.role===`added`?`added`:Ye(e)===``?void 0:`moved`},T=(e,t)=>{let n=[],r=[],i=[],c=e.map(e=>({...e,days:Be(e.item)})).filter(e=>e.days!==void 0).sort((e,t)=>Number(e.item.type===`milestone`)-Number(t.item.type===`milestone`)||e.days.start-t.days.start||e.row-t.row||e.index-t.index);for(let{item:e,index:t,row:l,days:u,text:d,note:f,change:p}of c){let c=[],m;if(p===`moved`&&e.previous!==void 0){let t=Ke(e.previous);if(e.type===`activity`)m={x0:s(t.start),x1:s(t.end+1)};else{let e=s(t.start)+a/2;m={x0:e-7,x1:e+7,cx:e}}c.push({kind:`ghost`,x0:m.x0,x1:m.x1})}let h,g,_,v;if(e.type===`activity`){if(g=s(u.start),_=s(u.end+1),c.push({kind:`bar`,x0:g,x1:_}),d!==void 0){let e=ot(d);h=e+12<=_-g?{text:d,inside:!0,x:g+6,width:e}:pt(d,g,_,o),f!==void 0&&(h.note=f),c.push({kind:`label`,x0:h.x,x1:h.x+h.width})}}else v=s(u.start)+a/2,g=v-7,_=v+7,c.push({kind:`star`,x0:g,x1:_}),d!==void 0&&(h=pt(d,g,_,o),f!==void 0&&(h.note=f),c.push({kind:`label`,x0:h.x,x1:h.x+h.width}));let y=n.findIndex(e=>c.every(t=>e.every(e=>lt(t.kind,e.kind)||!ut(t,e))));y===-1&&(y=n.length,n.push([])),n[y].push(...c),r.push({row:l,item:t,type:e.type,lane:y,days:u,...e.kind?{kind:e.kind}:{},...p===void 0?{}:{change:p}}),i.push({label:h===void 0?void 0:{...h,...p===`removed`?{struck:!0}:{}},x0:g,x1:_,cx:v,ghost:m})}return r.forEach((e,n)=>{let r=i[n],a=t+4+e.lane*24+12,o=e.type===`activity`?{x:r.x0,y:a-6,width:r.x1-r.x0,height:12}:{x:r.x0,y:a-7,width:14,height:14},s=r.ghost;y.push({...e,glyph:o,...r.cx===void 0?{}:{center:{x:r.cx,y:a}},...r.label===void 0?{}:{label:{...r.label,y:a-8,height:16}},...s===void 0?{}:e.type===`activity`?{ghost:{x:s.x0,y:a-6,width:s.x1-s.x0,height:12}}:{ghost:{x:s.x0,y:a-7,width:14,height:14},ghostCenter:{x:s.cx,y:a}}})}),Math.max(1,n.length)},E=e=>e*24+8,ee=(e,t)=>{let n=T(e.items.map((n,r)=>({row:t,index:r,item:n,text:C(n,e,at(n)),note:S(n,e),change:w(n,e)})),b),r=E(n);v.push({type:`task`,row:t,y:b,height:r,lanes:n,label:e.label,id:e.id}),b+=r},D,te=()=>{if(D!==void 0){if(D.tasks.length===0){let e=D.label?26:10;v.push({type:`separator`,row:D.row,y:b,height:e,...D.label?{label:D.label}:{}}),b+=e}else{let e=T(D.tasks.flatMap(({task:e,row:t})=>e.items.map((n,r)=>({row:t,index:r,item:n,text:C(n,e,at(n)??(n.type===`activity`?e.label:void 0)),note:S(n,e),change:w(n,e)}))),b),t=E(e);v.push({type:`section`,row:D.row,y:b,height:t,lanes:e,...D.label?{label:D.label}:{},tasks:D.tasks.map(({task:e})=>e.id)}),b+=t}D=void 0}},ne=(()=>{let t=new Set;if(!(n.onlyChanged&&x))return;let r;return e.rows.forEach((e,n)=>{e.type===`separator`?r=n:Ze(e)&&(t.add(n),r!==void 0&&t.add(r))}),t})(),re=ne===void 0?0:e.rows.filter((e,t)=>e.type===`task`&&!ne.has(t)).length;e.rows.forEach((e,t)=>{if(ne===void 0||ne.has(t)){if(e.type===`separator`){if(n.compact){te(),D={row:t,...e.label?{label:e.label}:{},tasks:[]};return}let r=e.label?26:10;v.push({type:`separator`,row:t,y:b,height:r,...e.label?{label:e.label}:{}}),b+=r}else D===void 0?ee(e,t):D.tasks.push({task:e,row:t})}}),te();let ie=[];for(let t of e.rows)if(t.type===`task`)for(let e of t.items)e.kind&&!ie.includes(e.kind)&&ie.push(e.kind);for(let t of[...e.periods??[],...e.references??[]])t.kind&&!ie.includes(t.kind)&&ie.push(t.kind);let ae=[];(e.periods??[]).forEach((e,t)=>{let n=Math.max(Le(e.start)??r,r),o=Math.min(Le(e.end)??i,i);n>o||ae.push({index:t,x:s(n),width:(o-n+1)*a,start:e.start,end:e.end,...e.label?{label:e.label}:{},...e.kind?{kind:e.kind}:{}})});let oe=(e.references??[]).flatMap((e,t)=>{let n=Le(e.date);return n===void 0||n<r||n>i?[]:[{index:t,x:s(n)+a/2,label:e.label,date:e.date,...e.kind?{kind:e.kind}:{}}]}),se=[];if(t>=r&&t<=i){let e=s(t)+a/2;se.push({x0:e-26,x1:e+26})}let ce=[],le=[...ae.filter(e=>e.label).map(e=>({of:`period`,index:e.index,text:e.label,x:e.x+3,room:e.width-6})),...oe.map(e=>{let t=ot(e.label)*(10/11);return{of:`reference`,index:e.index,text:e.label,x:Math.min(Math.max(2,e.x-t/2),o-t-2),room:o-4}})].sort((e,t)=>e.x-t.x);for(let e of le){let t=ot(e.text)*(10/11);if(t>e.room)continue;let n={x0:e.x-2,x1:e.x+t+2};se.some(e=>n.x0<e.x1&&e.x0<n.x1)||(se.push(n),ce.push({of:e.of,index:e.index,text:e.text,x:e.x,width:t}))}return{width:o,height:b,start:r,end:i,years:f,months:d,monthLines:c.map(e=>s(e.day)),unit:p,upper:h,lower:g,unitLines:_,rows:v,items:y,dependencies:mt(e,v,y,s),today:t<r?{outside:`before`,day:t}:t>i?{outside:`after`,day:t}:{x:s(t)+a/2,day:t},kinds:ie,hiddenTasks:re,periods:ae,references:oe,headerLabels:ce}}function pt(e,t,n,r){let i=ot(e),a=n+4;if(a+i<=r)return{text:e,inside:!1,x:a,width:i};let o=t-4-i;return o>=0?{text:e,inside:!1,x:o,width:i}:{text:e,inside:!1,x:Math.max(0,r-i),width:i}}function mt(e,t,n,r){let i=Ve(e),a=new Map(n.map(e=>[`${e.row}:${e.item}`,e])),o=new Map(t.map(e=>[e.row,e])),s=(e,t)=>{let s=i.get(e);if(s?.days===void 0)return;if(s.item!==void 0){let e=a.get(`${s.row}:${s.item}`);if(e===void 0)return;let n=e.glyph.y+e.glyph.height/2;return e.center===void 0?{x:t===`start`?e.glyph.x:e.glyph.x+e.glyph.width,y:n}:{x:e.center.x+(t===`start`?-7:7),y:n}}let c=r(t===`start`?s.days.start:s.days.end+1),l=o.get(s.row);if(l!==void 0&&l.type===`task`)return{x:c,y:l.y+4+12};let u=n.filter(e=>e.row===s.row).sort((e,n)=>t===`start`?e.glyph.x-n.glyph.x:n.glyph.x+n.glyph.width-(e.glyph.x+e.glyph.width));if(u.length!==0)return{x:c,y:u[0].glyph.y+u[0].glyph.height/2}},c=[];return(e.dependencies??[]).forEach((e,t)=>{let n=Ue(e),r=We(n),a=s(e.from,r.from),o=s(e.to,r.to),l=Ge(e,i);if(a===void 0||o===void 0||l===void 0)return;let u={x:a.x+(r.from===`end`?8:-8),y:a.y},d={x:o.x+(r.to===`start`?-8:8),y:o.y};if(a.y===o.y&&r.from===`end`&&r.to===`start`&&o.x>=a.x-14){c.push({index:t,from:e.from,to:e.to,type:n,satisfied:l,points:[a,o]});return}let f=o.y>a.y?o.y-12:(o.y,a.y,o.y+12);c.push({index:t,from:e.from,to:e.to,type:n,satisfied:l,points:[a,u,{x:u.x,y:f},{x:d.x,y:f},d,o]})}),c}function ht(e){let t=e.rows.reduce((e,t)=>Math.max(e,(t.label??``).length),0);return Math.min(Math.max(t*Ce+24,120),280)}function gt(e,t){for(let n of e.rows){if(n.type!==`task`)continue;if(n.id===t)return`"${n.label}" (${t})`;let e=n.items.find(e=>e.id===t);if(e!==void 0){let n=at(e);return n===void 0?t:`"${n}" (${t})`}}return t}function _t(e,t,n){let r=n===!1?` — not satisfied by the dates`:``;return`${gt(e,t.to)} waits on ${gt(e,t.from)} (${Ue(t)})${r}`}function vt(e){let t=[];e.title!==void 0&&e.title!==``&&t.push(e.title),e.comparedTo!==void 0&&t.push(`Compared with ${e.comparedTo.label}${e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`}`),t.push(`From ${e.time.start} to ${e.time.end}, by ${e.time.scale}`);for(let n of e.rows){if(t.push(``),n.type===`separator`){t.push(n.label?`— ${n.label} —`:`———`);continue}let e=n.role===void 0?``:n.role===`added`?` — new`:` — removed`;t.push(`${n.label} [${n.id}]${n.items.length===0?` — no items`:``}${e}`);for(let e of n.items){let n=e.type===`activity`?`${e.start} to ${e.end}`:e.date,r=e.label===void 0?``:`: ${e.label}`,i=e.kind===void 0?``:` [${e.kind}]`,a=e.id===void 0?``:` (${e.id})`,o=(()=>{if(e.role===`added`)return` — new`;if(e.role===`removed`)return` — removed`;let t=Ye(e);return t===``||e.previous===void 0?``:` — moved ${t}, was ${`date`in e.previous?e.previous.date:`${e.previous.start} to ${e.previous.end}`}`})();t.push(` ${e.type} ${n}${r}${i}${a}${o}`)}}let n=[...(e.periods??[]).map(e=>` period ${e.start} to ${e.end}${e.label?`: ${e.label}`:``}${e.kind?` [${e.kind}]`:``}`),...(e.references??[]).map(e=>` reference ${e.date}: ${e.label}${e.kind?` [${e.kind}]`:``}`)];n.length>0&&t.push(``,`Calendar`,...n);let r=e.dependencies??[];if(r.length>0){let n=Ve(e);t.push(``,`Dependencies`);for(let i of r)t.push(` ${_t(e,i,Ge(i,n))}`)}return t}function yt(e){let t=[],n=(e,n)=>{let r=Le(e);return r===void 0&&t.push({rule:`invalid-date`,path:n,message:`"${e}" is not a day of the calendar`}),r},r=n(e.time.start,`/data/time/start`),i=n(e.time.end,`/data/time/end`),a=r!==void 0&&i!==void 0&&r<=i?{start:r,end:i}:void 0;r!==void 0&&i!==void 0&&r>i&&t.push({rule:`inverted-range`,path:`/data/time`,message:`the timeline starts on ${e.time.start}, after it ends on ${e.time.end}`});let o=`${e.time.start} to ${e.time.end}`,s=new Map,c=(e,n)=>{if(e===void 0)return;let r=s.get(e);r===void 0?s.set(e,n):t.push({rule:`duplicate-identifier`,path:`${n}/id`,message:`identifier "${e}" is already declared at ${r}`})},l=e.comparedTo!==void 0;e.comparedTo?.date!==void 0&&n(e.comparedTo.date,`/data/comparedTo/date`);let u=e=>t.push({rule:`comparison-without-reference`,path:e,message:"previous dates and change roles describe a comparison; declare `comparedTo` naming the plan they compare with"}),d=new Set;return e.rows.forEach((e,r)=>{if(e.type!==`task`)return;let i=`/data/rows/${r}`;c(e.id,i),e.role!==void 0&&!l&&u(`${i}/role`),e.items.forEach((r,s)=>{let f=`${i}/items/${s}`;if(c(r.id,f),r.kind!==void 0&&d.add(r.kind),r.role!==void 0&&!l&&u(`${f}/role`),r.previous!==void 0){l||u(`${f}/previous`),(r.role!==void 0||e.role!==void 0)&&t.push({rule:`contradictory-change`,path:`${f}/previous`,message:`an item that is ${r.role??`in a task that is ${e.role}`} has no previous dates; it is new or dropped, not moved`});let i=r.previous,s=r.type===`activity`?{first:n(i.start,`${f}/previous/start`),last:n(i.end,`${f}/previous/end`)}:(()=>{let e=n(i.date,`${f}/previous/date`);return{first:e,last:e}})();s.first!==void 0&&s.last!==void 0&&(s.first>s.last?t.push({rule:`inverted-range`,path:`${f}/previous`,message:`the previous dates start on ${i.start}, after they end on ${i.end}`}):a!==void 0&&(s.first<a.start||s.last>a.end)&&t.push({rule:`item-outside-range`,path:`${f}/previous`,message:`the previous dates fall outside the timeline's range ${o}; the range covers both plans, so widen \`time\``}))}r.role!==void 0&&e.role!==void 0&&r.role!==e.role&&t.push({rule:`contradictory-change`,path:`${f}/role`,message:`an item ${r.role} in a task that is ${e.role}`});let p,m;if(r.type===`activity`){if(p=n(r.start,`${f}/start`),m=n(r.end,`${f}/end`),p!==void 0&&m!==void 0&&p>m){t.push({rule:`inverted-range`,path:f,message:`the activity starts on ${r.start}, after it ends on ${r.end}`});return}}else p=m=n(r.date,`${f}/date`);a!==void 0&&p!==void 0&&m!==void 0&&(p<a.start||m>a.end)&&t.push({rule:`item-outside-range`,path:f,message:r.type===`activity`?`the activity runs ${r.start} to ${r.end}, outside the timeline's range ${o}; widen \`time\` or move the activity`:`the milestone falls on ${r.date}, outside the timeline's range ${o}; widen \`time\` or move the milestone`})})}),(e.periods??[]).forEach((e,r)=>{let i=`/data/periods/${r}`;e.kind!==void 0&&d.add(e.kind);let s=n(e.start,`${i}/start`),c=n(e.end,`${i}/end`);s!==void 0&&c!==void 0&&(s>c?t.push({rule:`inverted-range`,path:i,message:`the period starts on ${e.start}, after it ends on ${e.end}`}):a!==void 0&&(c<a.start||s>a.end)&&t.push({rule:`period-outside-range`,path:i,message:`the period ${e.start} to ${e.end} lies wholly outside the timeline's range ${o}, so nothing of it could be drawn`}))}),(e.references??[]).forEach((e,r)=>{let i=`/data/references/${r}`;e.kind!==void 0&&d.add(e.kind);let s=n(e.date,`${i}/date`);s!==void 0&&a!==void 0&&(s<a.start||s>a.end)&&t.push({rule:`item-outside-range`,path:i,message:`the reference date ${e.date} is outside the timeline's range ${o}; widen \`time\` or move it`})}),d.size>le.kindsPerVocabulary&&t.push({rule:`too-many-kinds`,path:`/data/rows`,message:`${d.size} distinct item types, and no more than ${le.kindsPerVocabulary} can be told apart in a rendering`,observed:d.size,limit:le.kindsPerVocabulary}),t.push(...xt(e,Ve(e))),t.push(...bt(e)),t}function bt(e){let t=new Set;for(let n of e.rows)if(n.type===`task`){n.role===`removed`&&t.add(n.id);for(let e of n.items)e.id!==void 0&&(e.role===`removed`||n.role===`removed`)&&t.add(e.id)}let n=[];return(e.dependencies??[]).forEach((e,r)=>{for(let i of[`from`,`to`])t.has(e[i])&&n.push({rule:`dependency-on-removed`,path:`/data/dependencies/${r}/${i}`,message:`"${e[i]}" was dropped from the plan, so nothing can depend on it any more; remove the dependency`})}),n}function xt(e,t){let n=[],r=e.dependencies??[],i=[],a=new Map;r.forEach((r,o)=>{let s=`/data/dependencies/${o}`,c=!0;for(let i of[`from`,`to`]){let a=r[i],o=t.get(a);if(o===void 0)c=!1,n.push({rule:`unresolved-endpoint`,path:`${s}/${i}`,message:`"${a}" is not the identifier of any task or item this timeline declares`});else if(o.type===`task`&&o.days===void 0){c=!1;let t=e.rows[o.row];if(t.type===`task`&&t.items.length>0)continue;n.push({rule:`empty-task-endpoint`,path:`${s}/${i}`,message:`task "${a}" holds no item, so it has no start or finish for a dependency to link`})}}if(!c)return;let l=t.get(r.from),u=t.get(r.to),d=(e,t)=>e.type===`task`&&t.type!==`task`&&t.row===e.row;if(l.id===u.id||d(l,u)||d(u,l)){n.push({rule:`self-dependency`,path:s,message:l.id===u.id?`"${l.id}" cannot depend on itself`:`a task and one of its own items cannot depend on each other: the task's span is made of its items`});return}let f=JSON.stringify([r.from,r.to,Ue(r)]),p=a.get(f);p===void 0?(a.set(f,o),i.push({from:r.from,to:r.to,index:o})):n.push({rule:`duplicate-dependency`,path:s,message:`the same dependency is already declared at /data/dependencies/${p}`})});let o=St(i);return o!==void 0&&n.push({rule:`dependency-cycle`,path:`/data/dependencies/${o.index}`,message:`dependencies form a cycle, which no dates can honour: ${o.ids.join(` → `)}`}),n}function St(e){let t=new Map;for(let n of e){let e=t.get(n.from)??[];e.push({to:n.to,index:n.index}),t.set(n.from,e)}let n=new Map,r=[];for(let e of t.keys()){if(n.has(e))continue;let i=[{id:e,next:0}];for(n.set(e,`open`),r.push({id:e,index:-1});i.length>0;){let e=i[i.length-1],a=t.get(e.id)??[];if(e.next>=a.length){n.set(e.id,`done`),i.pop(),r.pop();continue}let o=a[e.next++],s=n.get(o.to);if(s===`open`){let e=r.findIndex(e=>e.id===o.to);return{ids:[...r.slice(e).map(e=>e.id),o.to],index:o.index}}s===void 0&&(n.set(o.to,`open`),i.push({id:o.to,next:0}),r.push({id:o.to,index:o.index}))}}}function Ct(e){let t=e.data;return e.kind===`graph`?Array.isArray(t.nodes)&&Array.isArray(t.edges):e.kind===`sequence`?Array.isArray(t.participants)&&Array.isArray(t.messages):e.kind===`timeline`?typeof t.time==`object`&&t.time!==null&&Array.isArray(t.rows):Array.isArray(t.columns)&&Array.isArray(t.rows)}function wt(e){return e.kind===`graph`?e.data.nodes:e.kind===`sequence`?e.data.participants:[]}function Tt(e){return e.kind===`graph`?e.data.edges:e.kind===`sequence`?e.data.messages:[]}function Et(e){return e.kind===`graph`||e.kind===`sequence`?e.data.containers??[]:[]}function Dt(e){return e.kind===`graph`?`/data/nodes`:`/data/participants`}function Ot(e){return e.kind===`graph`?`/data/edges`:`/data/messages`}function kt(e){if(e.kind===`timeline`)return[];let t=e.data,n=[];for(let e of[`nodes`,`edges`,`participants`,`messages`,`rows`,`relations`]){let r=t[e];Array.isArray(r)&&r.forEach((t,r)=>{if(typeof t!=`object`||!t||Array.isArray(t))return;let i=t;n.push({at:`/data/${e}/${r}`,ref:typeof i.ref==`string`?i.ref:void 0,set:i.set,expect:i.expect,locations:i.locations})})}return n}function At(e){if(e.kind!==`table`)return[];let t=e.data.rows,n=[];return t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e;(r.ref!==void 0||r.set!==void 0)&&n.push({at:`/data/rows/${t}`,...typeof r.ref==`string`?{ref:r.ref}:{},...r.set===void 0?{}:{set:r.set}})}),n}function jt(e){if(e.kind!==`table`)return[];let t=e.data.rows,n=[];return t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e.id;typeof r==`string`&&n.push({id:r,at:`/data/rows/${t}`})}),n}function Mt(e){if(e.kind!==`table`)return[];let t=e.data.relations;return Array.isArray(t)?t:[]}function Nt(e,t){return e===`timeline`?`a timeline is maintained by presenting the revised timeline again, not proposed as a change, ${t}`:`a ${e} is a projection and cannot be proposed, ${t}`}function Pt(e){let t=[];if(!Ct(e))return t.push({rule:`kind-data-mismatch`,path:`/data`,message:`data does not carry what kind "${e.kind}" declares`}),t;let n=oe(e.schema).includes(e.kind);e.target!==void 0&&!n&&t.push({rule:`kind-not-proposable`,path:`/target`,message:Nt(e.kind,`so it carries no target`)}),e.removals!==void 0&&(n?e.target===void 0&&t.push({rule:`removal-without-target`,path:`/removals`,message:`removals need a target: an artifact that does not exist yet has nothing to remove`}):t.push({rule:`kind-not-proposable`,path:`/removals`,message:Nt(e.kind,`so it declares no removals`)}));let r=wt(e),i=Dt(e),a=new Map;r.forEach((e,n)=>{let r=a.get(e.id);r===void 0?a.set(e.id,n):t.push({rule:`duplicate-identifier`,path:`${i}/${n}/id`,message:`identifier "${e.id}" is already declared at ${i}/${r}`})});let o=new Map;Et(e).forEach((e,n)=>{let r=o.get(e.id);r===void 0?o.set(e.id,n):t.push({rule:`duplicate-container-identifier`,path:`/data/containers/${n}/id`,message:`container "${e.id}" is already declared at /data/containers/${r}`})}),r.forEach((e,n)=>{for(let[r,a]of[[`container`,e.container],[`set/container`,e.set?.container]])a!==void 0&&!o.has(a)&&t.push({rule:`unresolved-container`,path:`${i}/${n}/${r}`,message:`"${a}" is not a container declared in /data/containers`})});let s=Ot(e);Tt(e).forEach((e,n)=>{for(let r of[`from`,`to`]){let o=e[r];a.has(o)||t.push({rule:`unresolved-endpoint`,path:`${s}/${n}/${r}`,message:`"${o}" is not an identifier declared in ${i}`})}});let c=new Map,l=(e,n,r)=>{if(n===void 0)return;let i=`${e}:${n}`,a=c.get(i);a===void 0?c.set(i,r):t.push({rule:`duplicate-reference`,path:r,message:`${e} "${n}" is already addressed at ${a}; a proposal states one intention per thing`})};r.forEach((e,t)=>l(`element`,e.ref,`${i}/${t}`)),Tt(e).forEach((e,t)=>l(`relationship`,e.ref,`${s}/${t}`)),At(e).forEach(e=>l(`row`,e.ref,e.at)),(e.removals??[]).forEach((e,t)=>l(e.type,e.ref,`/removals/${t}`));let u=[...r.map((e,t)=>({at:`${i}/${t}`,ref:e.ref,set:e.set})),...Tt(e).map((t,n)=>({at:`${Ot(e)}/${n}`,ref:t.ref,set:t.set})),...At(e)];for(let r of u)r.set!==void 0&&(r.ref===void 0?t.push({rule:`change-without-reference`,path:`${r.at}/set`,message:`a change names a reference to change; without one this is a new thing, and its fields are its values`}):n?e.target===void 0&&t.push({rule:`change-without-target`,path:`${r.at}/set`,message:`a change needs a target: naming what is being changed is what makes this a proposal rather than a new artifact`}):t.push({rule:`kind-not-proposable`,path:`${r.at}/set`,message:Nt(e.kind,`so nothing in it declares a change`)}));let d=e=>{let t=new Set;for(let n of e)n.kind!==void 0&&n.kind!==``&&t.add(n.kind);return t},f=[[e.kind===`sequence`?`participant`:`element`,i,d(r)],[e.kind===`sequence`?`message`:`relationship`,Ot(e),d(Tt(e))]];for(let[e,n,r]of f)r.size>le.kindsPerVocabulary&&t.push({rule:`too-many-kinds`,path:n,message:`${r.size} distinct ${e} types, and no more than ${le.kindsPerVocabulary} can be told apart in a rendering`,observed:r.size,limit:le.kindsPerVocabulary});let p=e.viewpoints;if(Array.isArray(p)){if(e.kind!==`graph`)t.push({rule:`viewpoints-without-graph`,path:`/viewpoints`,message:`only a graph declares viewpoints; a ${e.kind} has no element and relationship kinds for one to retain`});else{let n=new Set(r.map(e=>e.kind).filter(e=>!!e)),i=new Set(Tt(e).map(e=>e.kind).filter(e=>!!e)),a=new Map;p.forEach((e,r)=>{let o=`/viewpoints/${r}`,{id:s,elementKinds:c,relationshipKinds:l}=e,u=a.get(s);u===void 0?a.set(s,r):t.push({rule:`duplicate-viewpoint-identifier`,path:`${o}/id`,message:`viewpoint "${s}" is already declared at /viewpoints/${u}`}),c===void 0&&l===void 0&&t.push({rule:`empty-viewpoint`,path:o,message:`viewpoint "${s}" retains no kind, so it would show nothing it was not already showing; name elementKinds, relationshipKinds, or both`});let d=[[c,n,i,`elementKinds`,`element`,`relationship`],[l,i,n,`relationshipKinds`,`relationship`,`element`]];for(let[e,n,r,i,a,c]of d)e?.forEach((e,l)=>{n.has(e)||t.push({rule:`unresolved-viewpoint-kind`,path:`${o}/${i}/${l}`,message:`viewpoint "${s}" retains ${a} kind "${e}", and no ${a} of this document has it`+(r.has(e)?` (it is a ${c} kind here, which is a different vocabulary)`:``)})})})}}if(e.kind===`table`){let{columns:n,rows:r}=e.data;r.forEach((e,r)=>{let{cells:i,heading:a}=ce(e);a===void 0&&i.length!==n.length&&t.push({rule:`row-column-mismatch`,path:`/data/rows/${r}`,message:`row has ${i.length} values but ${n.length} columns are declared`,observed:i.length,limit:n.length})})}e.kind===`timeline`&&t.push(...yt(e.data));for(let n of kt(e)){n.expect!==void 0&&(e.target===void 0?t.push({rule:`expectation-without-target`,path:`${n.at}/expect`,message:`an expectation is checked by the authority a proposal targets; a document that targets nothing has nobody to check it`}):n.ref===void 0&&t.push({rule:`expectation-without-reference`,path:`${n.at}/expect`,message:`an expectation describes something that already exists, and this item carries no reference to one`}));let r=n.set?.removeAttributes;if(Array.isArray(r)){let e=n.set?.attributes??{},i=new Map;r.forEach((r,a)=>{if(typeof r!=`string`)return;let o=i.get(r);o===void 0?i.set(r,a):t.push({rule:`duplicate-attribute-removal`,path:`${n.at}/set/removeAttributes/${a}`,message:`"${r}" is already removed at ${n.at}/set/removeAttributes/${o}`}),Object.prototype.hasOwnProperty.call(e,r)&&t.push({rule:`attribute-set-and-removed`,path:`${n.at}/set/removeAttributes/${a}`,message:`"${r}" is both assigned and removed; a proposal states one intention per property`})})}Array.isArray(n.locations)&&n.locations.forEach((e,r)=>{if(typeof e!=`object`||!e)return;let i=e.range;i!==void 0&&(i.endLine<i.startLine||i.endLine===i.startLine&&i.endCharacter!==void 0&&i.startCharacter!==void 0&&i.endCharacter<i.startCharacter)&&t.push({rule:`location-range-reversed`,path:`${n.at}/locations/${r}/range`,message:`a range ends before it begins, so it selects nothing a reader could be taken to`})})}e.kind===`table`&&e.data.rows.forEach((e,n)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e;r.role!==void 0&&r.set!==void 0&&t.push({rule:`role-with-change`,path:`/data/rows/${n}/role`,message:`a row states what it observed or what it asks for, not both: a declared role beside a change is a report and an instruction at once`})});let m=new Map;for(let n of jt(e)){let e=m.get(n.id);e===void 0?m.set(n.id,n.at):t.push({rule:`duplicate-identifier`,path:`${n.at}/id`,message:`identifier "${n.id}" is already declared at ${e}`})}return Mt(e).forEach((e,n)=>{for(let r of[`from`,`to`]){let i=e[r];if(typeof i!=`object`||!i)continue;let a=i.id;typeof a==`string`&&(m.has(a)||t.push({rule:`unresolved-endpoint`,path:`/data/relations/${n}/${r}`,message:`"${a}" is not the identifier of any row this document declares`}))}}),t}function Ft(e,t){let n=t(e);if(n.length>0)return{valid:!1,issues:n};let r=e,i=Pt(r);return i.length>0?{valid:!1,issues:i}:{valid:!0,envelope:r,issues:[]}}function It(e,t,n){let r=xe(e,n);if(r!==void 0)return{valid:!1,issues:[r]};let i;try{i=JSON.parse(e)}catch{return{valid:!1,issues:[{rule:`not-json`,path:``,message:`document is not parseable JSON`}]}}let a=Ft(i,t);if(!a.valid)return a;let o=xe(e,n,a.envelope.schema);if(o!==void 0)return{valid:!1,issues:[o]};let s=A(a.envelope,n);return s.length>0?{valid:!1,issues:s}:{valid:!0,envelope:a.envelope,measurement:Se(a.envelope,e),issues:[]}}function Lt(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e.schema;if(typeof t==`string`&&t.startsWith(`urn:structured-exchange:`))return t}function Rt(e,t,n){let r=xe(e,n);if(r!==void 0)return{status:`too-large`,issue:r};let i;try{i=JSON.parse(e)}catch{return{status:`not-a-document`,why:`unparseable`}}let a=Lt(i);if(a===void 0)return{status:`not-a-document`,why:`undeclared`};if(me(a)===void 0)return{status:`unsupported-version`,schema:a};let o=Ft(i,t);if(!o.valid)return{status:`invalid`,issues:o.issues};let s=xe(e,n,o.envelope.schema);return s===void 0?{status:`valid`,envelope:o.envelope}:{status:`too-large`,issue:s}}function zt(e){let t=e.replace(/\r\n/g,`
6
+ `).replace(/\s+$/,``),n=2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return`sx-${(n>>>0).toString(16).padStart(8,`0`)}-${t.length.toString(36)}`}async function Bt(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:0;left:0;opacity:0;pointer-events:none`,document.body.append(t);try{return t.select(),document.execCommand(`copy`)}catch{return!1}finally{t.remove()}}}function Vt(e,t,n){return e>=t&&e<=n}function Ht(e){return e===8205}function Ut(e){return Vt(e,55296,56319)}function Wt(e){return Vt(e,127462,127487)}function Gt(e){return Vt(e,65024,65039)}function Kt(e){return Vt(e,768,879)||Vt(e,6832,6911)||Vt(e,7616,7679)||Vt(e,65056,65071)}function qt(e){return e>65535?2:1}function Jt(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(Kt(n)||Gt(n))t+=qt(n);else break}return t}function Yt(e,t){let n=e.codePointAt(t),r=t+qt(n);for(r=Jt(e,r);r<e.length-1&&Ht(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+qt(t),r=Jt(e,r)}return Wt(n)&&r<e.length&&Wt(e.codePointAt(r))&&(r+=qt(e.codePointAt(r))),r}function Xt(e){return Ut(e)||Kt(e)||Gt(e)||Ht(e)}function Zt(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=Yt(e,r),n++,n>=t)return!0;return!1}function Qt(e,t){let n=0,r=0;for(;r<e.length;)if(r=Yt(e,r),n++,n>t)return!1;return!0}function $t(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Xt(e.charCodeAt(n)))return Zt(e,t);if(n++,n>=t)return!0}return!1}function en(e,t){let n=0;for(;n<e.length;){if(Xt(e.charCodeAt(n)))return Qt(e,t);if(n++,n>t)return!1}return!0}function tn(e){return Array.isArray(e)}function nn(e){return fn(typeof e,`bigint`)}function rn(e){return fn(typeof e,`boolean`)}function an(e){if(dn(e)||!on(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function on(e){return fn(typeof e,`function`)}function sn(e){return fn(e,null)}function cn(e){return fn(typeof e,`object`)&&!sn(e)}function ln(e){return fn(typeof e,`string`)}function un(e){return fn(typeof e,`symbol`)}function dn(e){return fn(e,void 0)}function fn(e,t){return e===t}function j(e,t){return en(e,t)}function M(e,t){return $t(e,t)}function pn(e){return e instanceof Boolean}function mn(e){return e instanceof Number}function hn(e){return e instanceof String}function gn(e){return globalThis.ArrayBuffer.isView(e)}function _n(e){return e instanceof globalThis.RegExp}function vn(e){return e instanceof globalThis.Date}var yn=[];function bn(e){yn=e.variables}var xn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[0].test(e)||!1)&&e.schema===`urn:structured-exchange:1`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`)&&(e.target===void 0||!(`target`in e)||Sn(e.target))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>Cn(e))&&e.removals.length<=500)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>yn[2].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>Dn(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>kn(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>jn(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>yn[8].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>Dn(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>Mn(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>jn(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).length===2&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&j(e,200)&&M(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[Pn(e),typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[11].test(e)||!1)&&Pn(e.cells)&&(e.role===void 0||!(`role`in e)||e.role===`added`||e.role===`changed`||e.role===`context`||e.role===`removed`)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3].reduce((e,t,n)=>t===!0?++e:e,0)===1),Sn=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),Cn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[1].test(e)||!1)&&(e.type===`element`||e.type===`relationship`)&&Sn(e.ref)&&(e.label===void 0||!(`label`in e)||wn(e.label))&&(e.kind===void 0||!(`kind`in e)||Tn(e.kind))&&(e.from===void 0||!(`from`in e)||En(e.from))&&(e.to===void 0||!(`to`in e)||En(e.to))),wn=(e=>typeof e==`string`&&j(e,500)),Tn=(e=>typeof e==`string`&&j(e,100)&&M(e,1)),En=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),Dn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[3].test(e)||!1)&&En(e.id)&&(e.ref===void 0||!(`ref`in e)||Sn(e.ref))&&(e.label===void 0||!(`label`in e)||wn(e.label))&&(e.kind===void 0||!(`kind`in e)||Tn(e.kind))&&(e.set===void 0||!(`set`in e)||On(e.set))&&(e.container===void 0||!(`container`in e)||En(e.container))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),On=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>yn[4].test(e)||!1)&&(e.label===void 0||!(`label`in e)||wn(e.label))&&(e.kind===void 0||!(`kind`in e)||Tn(e.kind))&&(e.container===void 0||!(`container`in e)||En(e.container))&&Object.getOwnPropertyNames(e).length>=1),kn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[5].test(e)||!1)&&En(e.from)&&En(e.to)&&(e.kind===void 0||!(`kind`in e)||Tn(e.kind))&&(e.ref===void 0||!(`ref`in e)||Sn(e.ref))&&(e.label===void 0||!(`label`in e)||wn(e.label))&&(e.set===void 0||!(`set`in e)||An(e.set))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),An=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>yn[6].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||Tn(e.kind))&&(e.label===void 0||!(`label`in e)||wn(e.label))&&Object.getOwnPropertyNames(e).length>=1),jn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[7].test(e)||!1)&&En(e.id)&&wn(e.label)&&(e.kind===void 0||!(`kind`in e)||Tn(e.kind))),Mn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>yn[9].test(e)||!1)&&En(e.from)&&En(e.to)&&(e.ref===void 0||!(`ref`in e)||Sn(e.ref))&&(e.label===void 0||!(`label`in e)||wn(e.label))&&(e.set===void 0||!(`set`in e)||Nn(e.set))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),Nn=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>yn[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||wn(e.label))&&Object.getOwnPropertyNames(e).length>=1),Pn=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||j(e,1e3)))&&e.length<=50);function Fn(e){return xn(e)}bn({variables:[RegExp(`(^schema$|^kind$|^target$|^removals$|^data$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$)`,`u`),RegExp(`(^label$|^kind$|^container$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$)`,`u`),RegExp(`(^kind$|^label$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$)`,`u`),RegExp(`(^label$)`,`u`),RegExp(`(^cells$|^role$)`,`u`)]});function In(){throw Error(`Unreachable`)}function Ln(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Rn(e){return typeof e==`number`}var zn;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(zn||={});var Bn=BigInt(`14695981039346656037`),[Vn,Hn]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Un=Array.from({length:256}).map((e,t)=>BigInt(t)),Wn=new Float64Array(1),Gn=new DataView(Wn.buffer),Kn=new Uint8Array(Wn.buffer);function qn(e){Bn^=Un[e],Bn=Bn*Vn%Hn}function Jn(e){qn(zn.Array);for(let t of e)lr(t)}function Yn(e){qn(zn.BigInt),Gn.setBigInt64(0,e);for(let e of Kn)qn(e)}function Xn(e){qn(zn.Boolean),qn(+!!e)}function Zn(e){qn(zn.Constructor),lr(e.toString())}function Qn(e){qn(zn.Date),lr(e.getTime())}function $n(e){qn(zn.Function),lr(e.toString())}function er(e){qn(zn.Null)}function tr(e){qn(zn.Number),Gn.setFloat64(0,e,!0);for(let e of Kn)qn(e)}function nr(e){qn(zn.Object);for(let t of Ln(e).sort())lr(t),lr(e[t])}function rr(e){qn(zn.RegExp),ar(e.toString())}var ir=new TextEncoder;function ar(e){qn(zn.String);for(let t of ir.encode(e))qn(t)}function or(e){qn(zn.Symbol),lr(e.toString())}function sr(e){qn(zn.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)qn(t[e])}function cr(e){return qn(zn.Undefined)}function lr(e){return gn(e)?sr(e):vn(e)?Qn(e):_n(e)?rr(e):pn(e)?Xn(e.valueOf()):hn(e)?ar(e.valueOf()):mn(e)?tr(e.valueOf()):Rn(e)?tr(e):tn(e)?Jn(e):rn(e)?Xn(e):nn(e)?Yn(e):an(e)?Zn(e):sn(e)?er(e):cn(e)?nr(e):ln(e)?ar(e):un(e)?or(e):dn(e)?cr(e):on(e)?$n(e):In()}function ur(e){return Bn=BigInt(`14695981039346656037`),lr(e),Bn}function dr(e){return ur(e).toString(16).padStart(16,`0`)}var fr=[];function pr(e){fr=e.variables}var mr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[0].test(e)||!1)&&e.schema===`urn:structured-exchange:2`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`)&&(e.profile===void 0||!(`profile`in e)||typeof e.profile==`string`&&j(e.profile,200)&&M(e.profile,1))&&(e.target===void 0||!(`target`in e)||typeof e.target==`object`&&e.target!==null&&!Array.isArray(e.target)&&`ref`in e.target&&Object.getOwnPropertyNames(e.target).every((e,t)=>fr[1].test(e)||!1)&&hr(e.target.ref)&&(e.target.revision===void 0||!(`revision`in e.target)||gr(e.target.revision)))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>_r(e))&&e.removals.length<=500)&&(e.artifacts===void 0||!(`artifacts`in e)||Array.isArray(e.artifacts)&&e.artifacts.every((e,t)=>xr(e))&&e.artifacts.length<=50)&&(e.viewpoints===void 0||!(`viewpoints`in e)||Array.isArray(e.viewpoints)&&e.viewpoints.every((e,t)=>Sr(e))&&e.viewpoints.length<=20)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>fr[6].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>Cr(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>Fr(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Lr(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>fr[16].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>Cr(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>Rr(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Lr(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>fr[19].test(e)||!1)&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&j(e,200)&&M(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[Br(e),Vr(e),Wr(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3&&(e.data.relations===void 0||!(`relations`in e.data)||Array.isArray(e.data.relations)&&e.data.relations.every((e,t)=>Gr(e))&&e.data.relations.length<=2e3)].reduce((e,t,n)=>t===!0?++e:e,0)===1),hr=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),gr=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),_r=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[2].test(e)||!1)&&(e.type===`element`||e.type===`relationship`||e.type===`row`)&&hr(e.ref)&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.from===void 0||!(`from`in e)||br(e.from))&&(e.to===void 0||!(`to`in e)||br(e.to))),vr=(e=>typeof e==`string`&&j(e,500)),yr=(e=>typeof e==`string`&&j(e,100)&&M(e,1)),br=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),xr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`rel`in e&&`uri`in e&&`sha256`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[3].test(e)||!1)&&typeof e.rel==`string`&&j(e.rel,100)&&M(e.rel,1)&&typeof e.uri==`string`&&j(e.uri,2e3)&&M(e.uri,1)&&typeof e.sha256==`string`&&fr[4].test(e.sha256)&&(e.mediaType===void 0||!(`mediaType`in e)||typeof e.mediaType==`string`&&j(e.mediaType,100)&&M(e.mediaType,1))&&(e.label===void 0||!(`label`in e)||vr(e.label))),Sr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&`concern`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[5].test(e)||!1)&&br(e.id)&&typeof e.label==`string`&&j(e.label,500)&&M(e.label,1)&&typeof e.concern==`string`&&j(e.concern,500)&&M(e.concern,1)&&(e.elementKinds===void 0||!(`elementKinds`in e)||Array.isArray(e.elementKinds)&&e.elementKinds.every((e,t)=>yr(e))&&e.elementKinds.length<=64&&e.elementKinds.length>=1&&new Set(e.elementKinds.map(dr)).size===e.elementKinds.length)&&(e.relationshipKinds===void 0||!(`relationshipKinds`in e)||Array.isArray(e.relationshipKinds)&&e.relationshipKinds.every((e,t)=>yr(e))&&e.relationshipKinds.length<=64&&e.relationshipKinds.length>=1&&new Set(e.relationshipKinds.map(dr)).size===e.relationshipKinds.length)),Cr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[7].test(e)||!1)&&br(e.id)&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.set===void 0||!(`set`in e)||wr(e.set))&&(e.container===void 0||!(`container`in e)||br(e.container))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Ar(e.expect))&&(e.locations===void 0||!(`locations`in e)||jr(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Pr(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),wr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>fr[8].test(e)||!1)&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.container===void 0||!(`container`in e)||br(e.container))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||kr(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Tr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((t,n)=>fr[9].test(t)||Er(e[t]))&&Object.getOwnPropertyNames(e).every((e,t)=>typeof e!=`string`||j(e,200)&&M(e,1))&&Object.getOwnPropertyNames(e).length<=50),Er=(e=>[Dr(e),Or(e),Array.isArray(e)&&e.every((e,t)=>[Dr(e),Or(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.length<=50].reduce((e,t,n)=>t===!0?++e:e,0)===1),Dr=(e=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||j(e,1e3))),Or=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`ref`in e&&Object.getOwnPropertyNames(e).length===1&&hr(e.ref)),kr=(e=>Array.isArray(e)&&e.every((e,t)=>br(e))&&e.length<=50),Ar=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>fr[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.container===void 0||!(`container`in e)||br(e.container))&&(e.revision===void 0||!(`revision`in e)||gr(e.revision))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&Object.getOwnPropertyNames(e).length>=1),jr=(e=>Array.isArray(e)&&e.every((e,t)=>Mr(e))&&e.length<=10),Mr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`uri`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[11].test(e)||!1)&&typeof e.uri==`string`&&j(e.uri,2e3)&&M(e.uri,1)&&(e.revision===void 0||!(`revision`in e)||gr(e.revision))&&(e.range===void 0||!(`range`in e)||typeof e.range==`object`&&e.range!==null&&!Array.isArray(e.range)&&`startLine`in e.range&&`endLine`in e.range&&Object.getOwnPropertyNames(e.range).every((e,t)=>fr[12].test(e)||!1)&&Nr(e.range.startLine)&&(e.range.startCharacter===void 0||!(`startCharacter`in e.range)||Nr(e.range.startCharacter))&&Nr(e.range.endLine)&&(e.range.endCharacter===void 0||!(`endCharacter`in e.range)||Nr(e.range.endCharacter)))),Nr=(e=>Number.isInteger(e)&&(!(Number.isFinite(e)||typeof e==`bigint`)||e<=1e6&&e>=0)),Pr=(e=>Array.isArray(e)&&e.every((e,t)=>xr(e))&&e.length<=20),Fr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[13].test(e)||!1)&&br(e.from)&&br(e.to)&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.set===void 0||!(`set`in e)||Ir(e.set))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Ar(e.expect))&&(e.locations===void 0||!(`locations`in e)||jr(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Pr(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),Ir=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>fr[14].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||kr(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Lr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[15].test(e)||!1)&&br(e.id)&&vr(e.label)&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))),Rr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[17].test(e)||!1)&&br(e.from)&&br(e.to)&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.set===void 0||!(`set`in e)||zr(e.set))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Ar(e.expect))&&(e.locations===void 0||!(`locations`in e)||jr(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Pr(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),zr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>fr[18].test(e)||!1)&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||kr(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Br=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||j(e,1e3)))&&e.length<=50),Vr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[20].test(e)||!1)&&Br(e.cells)&&(e.role===void 0||!(`role`in e)||Hr(e.role))&&(e.id===void 0||!(`id`in e)||br(e.id))&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.set===void 0||!(`set`in e)||Ur(e.set))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Ar(e.expect))&&(e.locations===void 0||!(`locations`in e)||jr(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||Pr(e.artifacts))),Hr=(e=>e===`added`||e===`changed`||e===`context`||e===`removed`),Ur=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>fr[21].test(e)||!1)&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.kind===void 0||!(`kind`in e)||yr(e.kind))&&(e.cells===void 0||!(`cells`in e)||Br(e.cells))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||kr(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Wr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`heading`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[22].test(e)||!1)&&typeof e.heading==`string`&&j(e.heading,500)&&M(e.heading,1)&&(e.depth===void 0||!(`depth`in e)||Number.isInteger(e.depth)&&(!(Number.isFinite(e.depth)||typeof e.depth==`bigint`)||e.depth<=6&&e.depth>=1))&&(e.role===void 0||!(`role`in e)||Hr(e.role))&&(e.id===void 0||!(`id`in e)||br(e.id))&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))),Gr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&`kind`in e&&Object.getOwnPropertyNames(e).every((e,t)=>fr[23].test(e)||!1)&&Kr(e.from)&&Kr(e.to)&&yr(e.kind)&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))&&(e.label===void 0||!(`label`in e)||vr(e.label))&&(e.attributes===void 0||!(`attributes`in e)||Tr(e.attributes))),Kr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>fr[24].test(e)||!1)&&(e.id===void 0||!(`id`in e)||br(e.id))&&(e.ref===void 0||!(`ref`in e)||hr(e.ref))&&Object.getOwnPropertyNames(e).length>=1&&Object.getOwnPropertyNames(e).length<=1&&[!(typeof e==`object`&&e&&!Array.isArray(e))||`id`in e,!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e].reduce((e,t,n)=>t===!0?++e:e,0)===1);function qr(e){return mr(e)}pr({variables:[RegExp(`(^schema$|^kind$|^profile$|^target$|^removals$|^artifacts$|^viewpoints$|^data$)`,`u`),RegExp(`(^ref$|^revision$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^rel$|^uri$|^sha256$|^mediaType$|^label$)`,`u`),RegExp(`^sha256:[0-9a-f]{64}$`,`u`),RegExp(`(^id$|^label$|^concern$|^elementKinds$|^relationshipKinds$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^container$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(?!)`,`u`),RegExp(`(^label$|^kind$|^container$|^revision$|^attributes$)`,`u`),RegExp(`(^uri$|^revision$|^range$)`,`u`),RegExp(`(^startLine$|^startCharacter$|^endLine$|^endCharacter$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^kind$|^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^columns$|^rows$|^relations$)`,`u`),RegExp(`(^cells$|^role$|^id$|^ref$|^kind$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^cells$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^heading$|^depth$|^role$|^id$|^ref$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^attributes$)`,`u`),RegExp(`(^id$|^ref$)`,`u`)]});var N=[];function Jr(e){N=e.variables}var Yr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[0].test(e)||!1)&&e.schema===`urn:structured-exchange:3`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`||e.kind===`timeline`)&&(e.profile===void 0||!(`profile`in e)||typeof e.profile==`string`&&j(e.profile,200)&&M(e.profile,1))&&(e.target===void 0||!(`target`in e)||typeof e.target==`object`&&e.target!==null&&!Array.isArray(e.target)&&`ref`in e.target&&Object.getOwnPropertyNames(e.target).every((e,t)=>N[1].test(e)||!1)&&Xr(e.target.ref)&&(e.target.revision===void 0||!(`revision`in e.target)||Zr(e.target.revision)))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>Qr(e))&&e.removals.length<=500)&&(e.artifacts===void 0||!(`artifacts`in e)||Array.isArray(e.artifacts)&&e.artifacts.every((e,t)=>ni(e))&&e.artifacts.length<=50)&&(e.viewpoints===void 0||!(`viewpoints`in e)||Array.isArray(e.viewpoints)&&e.viewpoints.every((e,t)=>ri(e))&&e.viewpoints.length<=20)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>N[6].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>ii(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>gi(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>vi(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>N[16].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>ii(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>yi(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>vi(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>N[19].test(e)||!1)&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&j(e,200)&&M(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[xi(e),Si(e),Ti(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3&&(e.data.relations===void 0||!(`relations`in e.data)||Array.isArray(e.data.relations)&&e.data.relations.every((e,t)=>Ei(e))&&e.data.relations.length<=2e3),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`time`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>N[25].test(e)||!1)&&(e.data.title===void 0||!(`title`in e.data)||$r(e.data.title))&&typeof e.data.time==`object`&&e.data.time!==null&&!Array.isArray(e.data.time)&&`start`in e.data.time&&`end`in e.data.time&&`scale`in e.data.time&&Object.getOwnPropertyNames(e.data.time).length===3&&Oi(e.data.time.start)&&Oi(e.data.time.end)&&(e.data.time.scale===`week`||e.data.time.scale===`month`||e.data.time.scale===`quarter`)&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>ki(e))&&e.data.rows.length<=500&&(e.data.dependencies===void 0||!(`dependencies`in e.data)||Array.isArray(e.data.dependencies)&&e.data.dependencies.every((e,t)=>Ii(e))&&e.data.dependencies.length<=2e3)&&(e.data.comparedTo===void 0||!(`comparedTo`in e.data)||typeof e.data.comparedTo==`object`&&e.data.comparedTo!==null&&!Array.isArray(e.data.comparedTo)&&`label`in e.data.comparedTo&&Object.getOwnPropertyNames(e.data.comparedTo).every((e,t)=>N[32].test(e)||!1)&&typeof e.data.comparedTo.label==`string`&&j(e.data.comparedTo.label,500)&&M(e.data.comparedTo.label,1)&&(e.data.comparedTo.date===void 0||!(`date`in e.data.comparedTo)||Oi(e.data.comparedTo.date)))&&(e.data.periods===void 0||!(`periods`in e.data)||Array.isArray(e.data.periods)&&e.data.periods.every((e,t)=>Li(e))&&e.data.periods.length<=100)&&(e.data.references===void 0||!(`references`in e.data)||Array.isArray(e.data.references)&&e.data.references.every((e,t)=>Ri(e))&&e.data.references.length<=50)].reduce((e,t,n)=>t===!0?++e:e,0)===1),Xr=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),Zr=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),Qr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[2].test(e)||!1)&&(e.type===`element`||e.type===`relationship`||e.type===`row`)&&Xr(e.ref)&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.from===void 0||!(`from`in e)||ti(e.from))&&(e.to===void 0||!(`to`in e)||ti(e.to))),$r=(e=>typeof e==`string`&&j(e,500)),ei=(e=>typeof e==`string`&&j(e,100)&&M(e,1)),ti=(e=>typeof e==`string`&&j(e,200)&&M(e,1)),ni=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`rel`in e&&`uri`in e&&`sha256`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[3].test(e)||!1)&&typeof e.rel==`string`&&j(e.rel,100)&&M(e.rel,1)&&typeof e.uri==`string`&&j(e.uri,2e3)&&M(e.uri,1)&&typeof e.sha256==`string`&&N[4].test(e.sha256)&&(e.mediaType===void 0||!(`mediaType`in e)||typeof e.mediaType==`string`&&j(e.mediaType,100)&&M(e.mediaType,1))&&(e.label===void 0||!(`label`in e)||$r(e.label))),ri=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&`concern`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[5].test(e)||!1)&&ti(e.id)&&typeof e.label==`string`&&j(e.label,500)&&M(e.label,1)&&typeof e.concern==`string`&&j(e.concern,500)&&M(e.concern,1)&&(e.elementKinds===void 0||!(`elementKinds`in e)||Array.isArray(e.elementKinds)&&e.elementKinds.every((e,t)=>ei(e))&&e.elementKinds.length<=64&&e.elementKinds.length>=1&&new Set(e.elementKinds.map(dr)).size===e.elementKinds.length)&&(e.relationshipKinds===void 0||!(`relationshipKinds`in e)||Array.isArray(e.relationshipKinds)&&e.relationshipKinds.every((e,t)=>ei(e))&&e.relationshipKinds.length<=64&&e.relationshipKinds.length>=1&&new Set(e.relationshipKinds.map(dr)).size===e.relationshipKinds.length)),ii=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[7].test(e)||!1)&&ti(e.id)&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.set===void 0||!(`set`in e)||ai(e.set))&&(e.container===void 0||!(`container`in e)||ti(e.container))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.expect===void 0||!(`expect`in e)||di(e.expect))&&(e.locations===void 0||!(`locations`in e)||fi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||hi(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),ai=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>N[8].test(e)||!1)&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.container===void 0||!(`container`in e)||ti(e.container))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ui(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),oi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((t,n)=>N[9].test(t)||si(e[t]))&&Object.getOwnPropertyNames(e).every((e,t)=>typeof e!=`string`||j(e,200)&&M(e,1))&&Object.getOwnPropertyNames(e).length<=50),si=(e=>[ci(e),li(e),Array.isArray(e)&&e.every((e,t)=>[ci(e),li(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.length<=50].reduce((e,t,n)=>t===!0?++e:e,0)===1),ci=(e=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||j(e,1e3))),li=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`ref`in e&&Object.getOwnPropertyNames(e).length===1&&Xr(e.ref)),ui=(e=>Array.isArray(e)&&e.every((e,t)=>ti(e))&&e.length<=50),di=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>N[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.container===void 0||!(`container`in e)||ti(e.container))&&(e.revision===void 0||!(`revision`in e)||Zr(e.revision))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&Object.getOwnPropertyNames(e).length>=1),fi=(e=>Array.isArray(e)&&e.every((e,t)=>pi(e))&&e.length<=10),pi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`uri`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[11].test(e)||!1)&&typeof e.uri==`string`&&j(e.uri,2e3)&&M(e.uri,1)&&(e.revision===void 0||!(`revision`in e)||Zr(e.revision))&&(e.range===void 0||!(`range`in e)||typeof e.range==`object`&&e.range!==null&&!Array.isArray(e.range)&&`startLine`in e.range&&`endLine`in e.range&&Object.getOwnPropertyNames(e.range).every((e,t)=>N[12].test(e)||!1)&&mi(e.range.startLine)&&(e.range.startCharacter===void 0||!(`startCharacter`in e.range)||mi(e.range.startCharacter))&&mi(e.range.endLine)&&(e.range.endCharacter===void 0||!(`endCharacter`in e.range)||mi(e.range.endCharacter)))),mi=(e=>Number.isInteger(e)&&(!(Number.isFinite(e)||typeof e==`bigint`)||e<=1e6&&e>=0)),hi=(e=>Array.isArray(e)&&e.every((e,t)=>ni(e))&&e.length<=20),gi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[13].test(e)||!1)&&ti(e.from)&&ti(e.to)&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.set===void 0||!(`set`in e)||_i(e.set))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.expect===void 0||!(`expect`in e)||di(e.expect))&&(e.locations===void 0||!(`locations`in e)||fi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||hi(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),_i=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>N[14].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ui(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),vi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[15].test(e)||!1)&&ti(e.id)&&$r(e.label)&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))),yi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[17].test(e)||!1)&&ti(e.from)&&ti(e.to)&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.set===void 0||!(`set`in e)||bi(e.set))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.expect===void 0||!(`expect`in e)||di(e.expect))&&(e.locations===void 0||!(`locations`in e)||fi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||hi(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),bi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>N[18].test(e)||!1)&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ui(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),xi=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||j(e,1e3)))&&e.length<=50),Si=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[20].test(e)||!1)&&xi(e.cells)&&(e.role===void 0||!(`role`in e)||Ci(e.role))&&(e.id===void 0||!(`id`in e)||ti(e.id))&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.set===void 0||!(`set`in e)||wi(e.set))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.expect===void 0||!(`expect`in e)||di(e.expect))&&(e.locations===void 0||!(`locations`in e)||fi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||hi(e.artifacts))),Ci=(e=>e===`added`||e===`changed`||e===`context`||e===`removed`),wi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>N[21].test(e)||!1)&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.cells===void 0||!(`cells`in e)||xi(e.cells))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ui(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Ti=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`heading`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[22].test(e)||!1)&&typeof e.heading==`string`&&j(e.heading,500)&&M(e.heading,1)&&(e.depth===void 0||!(`depth`in e)||Number.isInteger(e.depth)&&(!(Number.isFinite(e.depth)||typeof e.depth==`bigint`)||e.depth<=6&&e.depth>=1))&&(e.role===void 0||!(`role`in e)||Ci(e.role))&&(e.id===void 0||!(`id`in e)||ti(e.id))&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))),Ei=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&`kind`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[23].test(e)||!1)&&Di(e.from)&&Di(e.to)&&ei(e.kind)&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.attributes===void 0||!(`attributes`in e)||oi(e.attributes))),Di=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>N[24].test(e)||!1)&&(e.id===void 0||!(`id`in e)||ti(e.id))&&(e.ref===void 0||!(`ref`in e)||Xr(e.ref))&&Object.getOwnPropertyNames(e).length>=1&&Object.getOwnPropertyNames(e).length<=1&&[!(typeof e==`object`&&e&&!Array.isArray(e))||`id`in e,!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e].reduce((e,t,n)=>t===!0?++e:e,0)===1),Oi=(e=>typeof e==`string`&&N[26].test(e)),ki=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&(e.type===`task`||e.type===`separator`)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`task`?Ai(e):!0)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`separator`?Fi(e):!0)),Ai=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`id`in e&&`label`in e&&`items`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[27].test(e)||!1)&&e.type===`task`&&ti(e.id)&&$r(e.label)&&Array.isArray(e.items)&&e.items.every((e,t)=>ji(e))&&e.items.length<=100&&(e.role===void 0||!(`role`in e)||Ni(e.role))),ji=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&(e.type===`activity`||e.type===`milestone`)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`activity`?Mi(e):!0)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`milestone`?Pi(e):!0)),Mi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`start`in e&&`end`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[28].test(e)||!1)&&e.type===`activity`&&Oi(e.start)&&Oi(e.end)&&(e.id===void 0||!(`id`in e)||ti(e.id))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.previous===void 0||!(`previous`in e)||typeof e.previous==`object`&&e.previous!==null&&!Array.isArray(e.previous)&&`start`in e.previous&&`end`in e.previous&&Object.getOwnPropertyNames(e.previous).length===2&&Oi(e.previous.start)&&Oi(e.previous.end))&&(e.role===void 0||!(`role`in e)||Ni(e.role))),Ni=(e=>e===`added`||e===`removed`),Pi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`date`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[29].test(e)||!1)&&e.type===`milestone`&&Oi(e.date)&&(e.id===void 0||!(`id`in e)||ti(e.id))&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))&&(e.previous===void 0||!(`previous`in e)||typeof e.previous==`object`&&e.previous!==null&&!Array.isArray(e.previous)&&`date`in e.previous&&Object.getOwnPropertyNames(e.previous).length===1&&Oi(e.previous.date))&&(e.role===void 0||!(`role`in e)||Ni(e.role))),Fi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[30].test(e)||!1)&&e.type===`separator`&&(e.label===void 0||!(`label`in e)||$r(e.label))),Ii=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[31].test(e)||!1)&&ti(e.from)&&ti(e.to)&&(e.type===void 0||!(`type`in e)||e.type===`finish-to-start`||e.type===`start-to-start`||e.type===`finish-to-finish`||e.type===`start-to-finish`)),Li=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`start`in e&&`end`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[33].test(e)||!1)&&Oi(e.start)&&Oi(e.end)&&(e.label===void 0||!(`label`in e)||$r(e.label))&&(e.kind===void 0||!(`kind`in e)||ei(e.kind))),Ri=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`date`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>N[34].test(e)||!1)&&Oi(e.date)&&typeof e.label==`string`&&j(e.label,500)&&M(e.label,1)&&(e.kind===void 0||!(`kind`in e)||ei(e.kind)));function zi(e){return Yr(e)}Jr({variables:[RegExp(`(^schema$|^kind$|^profile$|^target$|^removals$|^artifacts$|^viewpoints$|^data$)`,`u`),RegExp(`(^ref$|^revision$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^rel$|^uri$|^sha256$|^mediaType$|^label$)`,`u`),RegExp(`^sha256:[0-9a-f]{64}$`,`u`),RegExp(`(^id$|^label$|^concern$|^elementKinds$|^relationshipKinds$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^container$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(?!)`,`u`),RegExp(`(^label$|^kind$|^container$|^revision$|^attributes$)`,`u`),RegExp(`(^uri$|^revision$|^range$)`,`u`),RegExp(`(^startLine$|^startCharacter$|^endLine$|^endCharacter$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^kind$|^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^columns$|^rows$|^relations$)`,`u`),RegExp(`(^cells$|^role$|^id$|^ref$|^kind$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^cells$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^heading$|^depth$|^role$|^id$|^ref$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^attributes$)`,`u`),RegExp(`(^id$|^ref$)`,`u`),RegExp(`(^title$|^time$|^rows$|^dependencies$|^comparedTo$|^periods$|^references$)`,`u`),RegExp(`^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$`,`u`),RegExp(`(^type$|^id$|^label$|^items$|^role$)`,`u`),RegExp(`(^type$|^start$|^end$|^id$|^label$|^kind$|^previous$|^role$)`,`u`),RegExp(`(^type$|^date$|^id$|^label$|^kind$|^previous$|^role$)`,`u`),RegExp(`(^type$|^label$)`,`u`),RegExp(`(^from$|^to$|^type$)`,`u`),RegExp(`(^label$|^date$)`,`u`),RegExp(`(^start$|^end$|^label$|^kind$)`,`u`),RegExp(`(^date$|^label$|^kind$)`,`u`)]});var Bi={[ie]:Fn,[ue]:qr,[fe]:zi},Vi=e=>{let t=Lt(e),n=me(t);return n===void 0&&t!==void 0?[{rule:`unsupported-version`,path:`/schema`,message:`this build validates ${pe.join(` and `)}`}]:Bi[n??`urn:structured-exchange:1`](e)?[]:[{rule:`schema/invalid`,path:``,message:`does not conform to the published structured-exchange schema`}]},Hi=Object.defineProperty,Ui=(e,t,n)=>t in e?Hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wi=(e,t)=>{for(var n in t)Hi(e,n,{get:t[n],enumerable:!0})},Gi=(e,t,n)=>Ui(e,typeof t==`symbol`?t:t+``,n),Ki={};Wi(Ki,{Graph:()=>ja,alg:()=>aa});var qi=Object.defineProperty,Ji=(e,t)=>{for(var n in t)qi(e,n,{get:t[n],enumerable:!0})},Yi=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=Qi(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=$i(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,Xi(this._preds[a],i),Xi(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?ea(this._isDirected,e):Qi(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?ea(this._isDirected,e):Qi(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?ea(this._isDirected,e):Qi(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],Zi(this._preds[t],e),Zi(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function Xi(e,t){e[t]?e[t]++:e[t]=1}function Zi(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Qi(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function $i(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function ea(e,t){return Qi(e,t.v,t.w,t.name)}Ji({},{read:()=>ia,write:()=>ta});function ta(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:na(e),edges:ra(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function na(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function ra(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function ia(e){let t=new Yi(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var aa={};Ji(aa,{CycleException:()=>ba,bellmanFord:()=>sa,components:()=>la,dijkstra:()=>fa,dijkstraAll:()=>ma,findCycles:()=>ga,floydWarshall:()=>va,isAcyclic:()=>Sa,postorder:()=>Ea,preorder:()=>Da,prim:()=>Oa,shortestPaths:()=>ka,tarjan:()=>ha,topsort:()=>xa});var oa=()=>1;function sa(e,t,n,r){return ca(e,String(t),n||oa,r||function(t){return e.outEdges(t)??[]})}function ca(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function la(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var ua=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},da=()=>1;function fa(e,t,n,r){return pa(e,String(t),n||da,r||function(t){return e.outEdges(t)??[]})}function pa(e,t,n,r){let i={},a=new ua,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function ma(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=fa(e,i,t,n),r},{})}function ha(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ga(e){return ha(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var _a=()=>1;function va(e,t,n){return ya(e,t||_a,n||function(t){return e.outEdges(t)??[]})}function ya(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var ba=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function xa(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new ba;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new ba;return r}function Sa(e){try{xa(e)}catch(e){if(e instanceof ba)return!1;throw e}return!0}function Ca(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=wa(e,t,n===`post`,o,a,r,i)}),i}function wa(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=wa(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function Ta(e,t,n){return Ca(e,t,n,function(e,t){return e.push(t),e},[])}function Ea(e,t){return Ta(e,t,`post`)}function Da(e,t){return Ta(e,t,`pre`)}function Oa(e,t){var n;let r=new Yi,i={},a=new ua,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function ka(e,t,n,r){return Aa(e,t,n,r??(t=>e.outEdges(t)??[]))}function Aa(e,t,n,r){if(n===void 0)return fa(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return sa(e,t,n,r)}return fa(e,t,n,r)}var ja=Yi;function Ma(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Ja(r);return n.dummy=t,e.setNode(i,n),i}function Na(e){let t=new ja().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function Pa(e){let t=new ja({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Fa(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Ia(e){let t=Ya(Ua(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function La(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=Ha(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Ra(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=Ha(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function za(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Ma(e,`border`,i,t)}function Ba(e,t=Va){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Va=65535;function Ha(e,t){return t.length>Va?e(...Ba(t).map(t=>e(...t))):e(...t)}function Ua(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return Ha(Math.max,t)}function Wa(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ga(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function Ka(e,t){return t()}var qa=0;function Ja(e){return e+(``+ ++qa)}function Ya(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Xa(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function Za(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Qa(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var $a=`\0`;function eo(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var to=`3.1.1`,no=class{constructor(){Gi(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return ro(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&ro(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,io)),n=n._prev;return`[`+e.join(`, `)+`]`}};function ro(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function io(e,t){if(e!==`_next`&&e!==`_prev`)return t}var ao=no,oo=()=>1;function so(e,t){if(e.nodeCount()<=1)return[];let n=uo(e,t||oo);return co(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function co(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)lo(e,t,n,o);for(;o=i.dequeue();)lo(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(lo(e,t,n,o,!0)||[]);break}}}return r}function lo(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,fo(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,fo(t,n,o)}),e.removeNode(r.v),o}function uo(e,t){let n=new ja,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=po(i+r+3).map(()=>new ao),o=r+1;return n.nodes().forEach(e=>{fo(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function fo(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function po(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function mo(e,t){(e.graph().acyclicer===`greedy`?so(e,n(e)):ho(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Ja(`rev`))});function n(e){return t=>e.edge(t).weight}}function ho(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&_o(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function go(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function _o(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function vo(e){e.graph().dummyChains=[],e.edges().forEach(t=>yo(e,t))}function yo(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Ma(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function bo(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function xo(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=Ha(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function So(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Co=wo;function wo(e){let t=new ja({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;To(t,e)<i&&(a=Eo(t,e),a);)o=t.hasNode(a.v)?So(e,a):-So(e,a),Do(t,e,o);return t}function To(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!So(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function Eo(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=So(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function Do(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:Oo,postorder:ko}=aa,Ao=jo;jo.initLowLimValues=Fo,jo.initCutValues=Mo,jo.calcCutValue=Po,jo.leaveEdge=Lo,jo.enterEdge=Ro,jo.exchangeEdges=zo;function jo(e){e=Na(e),xo(e);let t=Co(e);Fo(t),Mo(t,e);let n,r;for(;n=Lo(t);)r=Ro(t,e,n),zo(t,e,n,r)}function Mo(e,t){let n=ko(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>No(e,t,n))}function No(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Po(e,t,n)}function Po(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Vo(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Fo(e,t){arguments.length<2&&(t=e.nodes()[0]),Io(e,{},1,t)}function Io(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Io(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Lo(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Ro(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Ho(e,e.node(t.v),s)&&c!==Ho(e,e.node(t.w),s)).reduce((e,n)=>So(t,n)<So(t,e)?n:e)}function zo(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Fo(e),Mo(e,t),Bo(e,t)}function Bo(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=Oo(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Vo(e,t,n){return e.hasEdge(t,n)}function Ho(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Uo=Wo;function Wo(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:qo(e);break;case`tight-tree`:Ko(e);break;case`longest-path`:Go(e);break;case`none`:break;default:qo(e)}}var Go=xo;function Ko(e){xo(e),Co(e)}function qo(e){Ao(e)}var Jo=Yo;function Yo(e){let t=Zo(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Xo(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Xo(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Zo(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children($a).forEach(r),t}function Qo(e){let t=Ma(e,`root`,{},`_root`),n=es(e),r=Object.values(n),i=Ha(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=ts(e)+1;e.children($a).forEach(r=>{$o(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function $o(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=za(e,`_bt`),l=za(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{$o(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function es(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children($a).forEach(e=>n(e,1)),t}function ts(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function ns(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var rs=is;function is(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)as(e,`borderLeft`,`_bl`,n,i,t),as(e,`borderRight`,`_br`,n,i,t)}}e.children($a).forEach(t)}function as(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Ma(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function os(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&cs(e)}function ss(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&us(e),(t===`lr`||t===`rl`)&&(fs(e),cs(e))}function cs(e){e.nodes().forEach(t=>ls(e.node(t))),e.edges().forEach(t=>ls(e.edge(t)))}function ls(e){let t=e.width;e.width=e.height,e.height=t}function us(e){e.nodes().forEach(t=>ds(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(ds),Object.hasOwn(r,`y`)&&ds(r)})}function ds(e){e.y=-e.y}function fs(e){e.nodes().forEach(t=>ps(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(ps),Object.hasOwn(r,`x`)&&ps(r)})}function ps(e){let t=e.x;e.x=e.y,e.y=t}function ms(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=Ya(Ha(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return eo(t,e.node(n),e.node(r))}return a}function hs(e,t){let n=0;for(let r=1;r<t.length;++r)n+=gs(e,t[r-1],t[r]);return n}function gs(e,t,n){let r=Qa(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function _s(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function vs(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),ys(Object.values(n).filter(e=>!e.indegree))}function ys(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&bs(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Xa(e,[`vs`,`i`,`barycenter`,`weight`]))}function bs(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function xs(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Wa(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(Cs(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=Ss(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=Ss(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function Ss(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Cs(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=eo(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function ws(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=_s(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=ws(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&Es(t,r)}});let h=vs(m,n);Ts(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=xs(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function Ts(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function Es(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Ds(e,t,n,r){r||=e.nodes();let i=Os(e),a=new ja({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Os(e){let t;for(;e.hasNode(t=Ja(`_root`)););return t}function ks(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function As(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,As);return}let r=Ua(e),i=js(e,Ya(1,r+1),`inEdges`),a=js(e,Ya(r-1,-1,-1),`outEdges`),o=ms(e,n);if(Ns(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){Ms(t%2?i:a,t%4>=2,l,n),o=Ia(e);let u=hs(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}Ns(e,c)}function js(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return Ds(e,t,n,r.get(t)||[])})}function Ms(e,t,n,r){let i=!0,a=new ja;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=ws(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),ks(e,a,s.vs)})}function Ns(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Ps(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Is(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Ls(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function Fs(e,t){let n={};function r(t,r,i,a,o){Ya(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Ls(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Is(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Ls(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Rs(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function zs(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||Js(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>Js(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!Rs(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function Bs(e,t,n,r,i=!1){let a={},o=Vs(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function Vs(e,t,n,r){let i=new ja,a=e.graph(),o=Ks(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function Hs(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=qs(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function Us(e,t){let n=Object.values(t),r=Ha(Math.min,n),i=Ha(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-Ha(Math.min,c);a!==`l`&&(l=i-Ha(Math.max,c)),l&&(e[o]=Za(s,e=>e+l))})})}function Ws(e,t=void 0){let n=e.ul;return n?Za(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function Gs(e,t){let n=Ia(e),r=Object.assign(Ps(e,n),Fs(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=zs(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=Bs(e,a,s.root,s.align,n===`r`);n===`r`&&(c=Za(c,e=>-e)),i[o+n]=c})}),Us(i,Hs(e,i)),Ws(i,e.graph().align)}function Ks(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function qs(e,t){return e.node(t).width}function Js(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function Ys(e,t){e=Pa(e),Xs(e),Object.entries(Gs(e,t)).forEach(([t,n])=>e.node(t).x=n)}function Xs(e){let t=Ia(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var Zs=new WeakMap;function Qs(e,t={}){return ec(e,Ka,t),e}function $s(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function ec(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new ja({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=$s(e,t.v,r),i=$s(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),ec(o,t,n);let l=dc(o);tc(l,t,n,null),nc(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=dc(e),g=tc(h,t,n,Zs.get(e)??null);Zs.set(e,g),nc(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function tc(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>fc(e)),t(` removeSelfEdges`,()=>xc(e)),t(` acyclic`,()=>mo(e,s)),t(` nestingGraph.run`,()=>Qo(e)),t(` rank`,()=>Uo(Pa(e))),t(` injectEdgeLabelProxies`,()=>pc(e)),t(` removeEmptyRanks`,()=>Ra(e)),t(` nestingGraph.cleanup`,()=>ns(e)),t(` normalizeRanks`,()=>La(e)),t(` assignRankMinMax`,()=>mc(e)),t(` removeEdgeLabelProxies`,()=>hc(e)),t(` normalize.run`,()=>vo(e)),t(` parentDummyChains`,()=>Jo(e)),t(` addBorderSegments`,()=>rs(e)),t(` order`,()=>As(e,n,c)),t(` insertSelfEdges`,()=>Sc(e)),t(` adjustCoordinateSystem`,()=>os(e)),t(` position`,()=>Ys(e,n.corePath)),t(` positionSelfEdges`,()=>Cc(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>bc(e)),t(` normalize.undo`,()=>bo(e)),t(` fixupEdgeLabelCoords`,()=>vc(e)),t(` undoCoordinateSystem`,()=>ss(e)),t(` translateGraph`,()=>gc(e)),t(` assignNodeIntersects`,()=>_c(e)),t(` reversePoints`,()=>yc(e)),t(` acyclic.undo`,()=>go(e)),{graph:e,rawNodes:l}}function nc(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var rc=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],ic={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},ac=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],oc=[`width`,`height`,`rank`],sc={width:0,height:0},cc=[`minlen`,`weight`,`width`,`height`,`labeloffset`],lc={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},uc=[`labelpos`];function dc(e){let t=new ja({multigraph:!0,compound:!0}),n=Tc(e.graph());return t.setGraph(Object.assign({},ic,wc(n,rc),Xa(n,ac))),e.nodes().forEach(n=>{let r=wc(Tc(e.node(n)),oc);Object.keys(sc).forEach(e=>{r[e]===void 0&&(r[e]=sc[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Tc(e.edge(n));t.setEdge(n,Object.assign({},lc,wc(r,cc),Xa(r,uc)))}),t}function fc(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function pc(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Ma(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function mc(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function hc(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function gc(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function _c(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Fa(r,a)),n.points.push(Fa(i,o))})}function vc(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function yc(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function bc(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function xc(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Sc(e){Ia(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{Ma(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function Cc(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function wc(e,t){return Za(Xa(e,t),Number)}function Tc(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function Ec(e){let t=Ia(e),n=new ja({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var Dc={graphlib:Ki,version:to,layout:Qs,debug:Ec,util:{time:Ga,notime:Ka}};function Oc(e,t){return t?e.ref===void 0?`added`:e.set===void 0?`context`:`changed`:`unchanged`}function kc(e,t){if(t&&e.heading===void 0)return e.ref===void 0?`added`:e.set===void 0?`context`:`changed`}function Ac(e,t){return t?e.ref===void 0?`added`:e.set===void 0?`context`:`changed`:`unchanged`}function jc(e){let t=e.set;if(t===void 0)return[];let n=e;return Object.entries(t).filter(([e])=>e!==`attributes`&&e!==`removeAttributes`).map(([e,t])=>{let r=n[e];return{field:e,...typeof r==`string`?{from:r}:{},to:String(t)}})}var Mc={added:`added`,changed:`changed`,context:`existing`,unchanged:``},Nc={added:`added`,changed:`changed`,context:`existing`,removed:`removed`},Pc=[`added`,`changed`,`context`,`removed`];function Fc(e){return e.rows.some(e=>ce(e).role!==void 0)}function Ic(e,t){if(t)return ce(e).role??`context`}function Lc(e){if(e.length===0)return;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t-Vc,y:n-Vc-Hc,width:r-t+Vc*2,height:i-n+Vc*2+Hc}}var Rc=64,zc=24,Bc=12,Vc=10,Hc=16,Uc=16,Wc=160,Gc=52;function Kc(e,t,n=`landscape`){let r=new Dc.graphlib.Graph({compound:!0,multigraph:!0});r.setGraph({rankdir:n===`portrait`?`TB`:`LR`,ranksep:Rc,nodesep:zc,marginx:Bc,marginy:Bc}),r.setDefaultEdgeLabel(()=>({}));for(let n of e.nodes)r.setNode(n.id,t(n));let i=e.containers??[],a=new Map;for(let t of e.nodes)t.container!==void 0&&i.some(e=>e.id===t.container)&&(r.setNode(t.container,{label:t.container}),r.setParent(t.id,t.container),a.set(t.container,[...a.get(t.container)??[],t.id]));e.edges.forEach((e,t)=>{e.from!==e.to&&r.hasNode(e.from)&&r.hasNode(e.to)&&r.setEdge(e.from,e.to,{},String(t))}),Dc.layout(r);let o=e.nodes.map(e=>{let n=r.node(e.id),{width:i,height:a}=t(e);return{id:e.id,x:(n?.x??Bc+i/2)-i/2,y:(n?.y??Bc+a/2)-a/2,width:i,height:a}}),s=[];e.edges.forEach((e,t)=>{if(e.from===e.to)return;let n=r.edge(e.from,e.to,String(t));n?.points!==void 0&&n.points.length>0&&s.push({index:t,points:n.points.map(e=>({x:e.x,y:e.y}))})});let c=[],l=o.reduce((e,t)=>Math.max(e,t.y+t.height),Bc)+Uc,u=new Map(o.map(e=>[e.id,e]));for(let e of i){let t=Lc((a.get(e.id)??[]).flatMap(e=>{let t=u.get(e);return t===void 0?[]:[t]}));t===void 0?(c.push({id:e.id,label:e.label,x:Bc,y:l,width:Wc,height:Gc}),l+=68):c.push({id:e.id,label:e.label,...t})}let d=[...o.map(e=>({x:e.x,y:e.y,width:e.width,height:e.height})),...c],f=Math.min(0,...d.map(e=>e.x))-Bc,p=Math.min(0,...d.map(e=>e.y))-Bc;if(f<0||p<0){for(let e of o)e.x-=f,e.y-=p;for(let e of c)e.x-=f,e.y-=p;for(let e of s)for(let t of e.points)t.x-=f,t.y-=p}let m=[...o.map(e=>({x:e.x,y:e.y,width:e.width,height:e.height})),...c].reduce((e,t)=>({width:Math.max(e.width,t.x+t.width),height:Math.max(e.height,t.y+t.height)}),{width:0,height:0});return{nodes:o,edges:s,containers:c,width:m.width+Bc,height:m.height+Bc}}var qc={attributes:[],expectations:[],assignments:[],removedAttributes:[],locations:[],artifacts:[]};function Jc(e){if(typeof e!=`object`||!e)return qc;let t=e,n=e=>typeof e==`object`&&e&&!Array.isArray(e)?Object.entries(e):[],r=t.set,i=r?.removeAttributes;return{attributes:n(t.attributes),expectations:n(t.expect?.attributes),assignments:n(r?.attributes),removedAttributes:Array.isArray(i)?i.filter(e=>typeof e==`string`):[],locations:Array.isArray(t.locations)?t.locations:[],artifacts:Array.isArray(t.artifacts)?t.artifacts:[]}}function Yc(e){let t=e.target;if(typeof t==`string`)return{ref:t};if(typeof t!=`object`||!t)return;let n=t;if(typeof n.ref==`string`)return{ref:n.ref,...typeof n.revision==`string`?{revision:n.revision}:{}}}function Xc(e,t){let n=(e.removals??[]).map(e=>({type:e.type,ref:e.ref})),r=e.profile,i=e.artifacts,a={...typeof r==`string`?{profile:r}:{},...(()=>{let t=Yc(e);return t===void 0?{}:{target:t}})(),artifacts:Array.isArray(i)?i:[]};if(e.kind===`table`){let r=e.data,i=Fc(r),o=r.rows.map(e=>{let n=Array.isArray(e)?{}:e,r=(Array.isArray(e)?void 0:e.role)??kc({ref:typeof n.ref==`string`?n.ref:void 0,set:n.set,heading:typeof n.heading==`string`?n.heading:void 0},t)??Ic(e,i),{cells:a,heading:o}=ce(e),s=Array.isArray(e)?{}:e;return{cells:a,...r===void 0?{}:{role:r},...o===void 0?{}:{heading:o},...typeof s.depth==`number`?{depth:s.depth}:{},...typeof s.id==`string`?{id:s.id}:{},...typeof s.ref==`string`?{ref:s.ref}:{},...typeof s.kind==`string`?{kind:s.kind}:{},changes:jc(s),...Jc(e)}}),s=new Map;for(let e of o){if(e.id===void 0)continue;let t=e.cells.find(e=>typeof e==`string`&&e!==``);s.set(e.id,(typeof t==`string`?t:void 0)??e.ref??e.id)}let c=r.relations,l=(Array.isArray(c)?c:[]).map(e=>{let t=e,n=e=>{let t=typeof e?.id==`string`?e.id:void 0,n=typeof e?.ref==`string`?e.ref:void 0;return{id:t,ref:n,label:(t===void 0?void 0:s.get(t))??n??t??``}},r=n(t.from),i=n(t.to);return{kind:t.kind??``,...typeof t.label==`string`?{label:t.label}:{},...r.id===void 0?{}:{fromRow:r.id},...i.id===void 0?{}:{toRow:i.id},...r.ref===void 0?{}:{fromRef:r.ref},...i.ref===void 0?{}:{toRef:i.ref},fromLabel:r.label,toLabel:i.label}});return{thingNoun:`column`,linkNoun:`row`,things:[],links:[],columns:r.columns,rows:o,containers:[],removals:n,traces:l,...a}}if(e.kind===`timeline`)return{thingNoun:`task`,linkNoun:`dependency`,things:[],links:[],containers:[],removals:n,traces:[],...a};let o=e.kind===`graph`,s=o?e.data.nodes:e.data.participants,c=o?e.data.edges:e.data.messages,l=new Map(s.map(e=>[e.id,Zc(e)]));return{thingNoun:o?`element`:`participant`,linkNoun:o?`relationship`:`message`,things:s.map(e=>({id:e.id,label:Zc(e),kind:e.kind,role:Oc(e,t),changes:jc(e),container:e.container,...Jc(e)})),links:c.map(e=>({from:e.from,to:e.to,fromLabel:l.get(e.from)??e.from,toLabel:l.get(e.to)??e.to,label:e.label,kind:`kind`in e?e.kind:void 0,role:Ac(e,t),changes:jc(e),isLoop:e.from===e.to,...Jc(e)})),containers:e.data.containers??[],removals:n,traces:[],...a}}function Zc(e){return e.label??e.ref??e.id}function Qc(e){if(e.kind===`graph`){let t=e.data,n=[`flowchart TD`],r=t.containers??[],i=new Set(r.map(e=>e.id)),a=e=>t.nodes.filter(t=>t.container===e);for(let e of r){n.push(` subgraph ${$c(e.id)}["${tl(e.label)}"]`);for(let t of a(e.id))n.push(` ${$c(t.id)}["${tl(Zc(t))}"]`);n.push(` end`)}for(let e of t.nodes)e.container!==void 0&&i.has(e.container)||n.push(` ${$c(e.id)}["${tl(Zc(e))}"]`);for(let e of t.edges){let t=e.label??e.kind,r=t===void 0?`-->`:`-- "${tl(t)}" -->`;n.push(` ${$c(e.from)} ${r} ${$c(e.to)}`)}return n.join(`
7
+ `)}if(e.kind===`sequence`){let t=e.data,n=[`sequenceDiagram`],r=t.containers??[],i=new Set(r.map(e=>e.id)),a=(e,t)=>`${t}participant ${$c(e.id)} as "${tl(Zc(e))}"`;for(let e of r){n.push(` box ${tl(e.label)}`);for(let r of t.participants.filter(t=>t.container===e.id))n.push(a(r,` `));n.push(` end`)}for(let e of t.participants)e.container!==void 0&&i.has(e.container)||n.push(a(e,` `));for(let e of t.messages)n.push(` ${$c(e.from)}->>${$c(e.to)}: ${tl(e.label??``)}`);return n.join(`
8
+ `)}}function $c(e){return`n${[...e].map(e=>e.charCodeAt(0).toString(36)).join(``)}`}var el={"#":`#35;`,'"':`#quot;`,";":`#59;`,"<":`#60;`,">":`#62;`};function tl(e){return e.replace(/[#";<>]/g,e=>el[e]).replace(/[\r\n\t\f\v\u0000-\u001f\u2028\u2029]+/g,` `)}function nl(e,t){return`${e}:${t}`}var rl=new Set;function il(e,t,n){return n===void 0||n===``?!1:e.has(nl(t,n))}function al(e){let t=e?.viewpoints;return Array.isArray(t)?t:[]}function ol(e,t){let n=new Set,r=(e,t,r)=>{if(t===void 0)return;let i=new Set(t);for(let t of e)t.kind!==void 0&&t.kind!==``&&!i.has(t.kind)&&n.add(nl(r,t.kind))};return r(e.nodes,t.elementKinds,`element`),r(e.edges,t.relationshipKinds,`relationship`),n}function sl(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var cl=40,ll=22;function ul(e){let t=e.containers??[],n;if(t.length===0)n=e.participants;else{let r=new Set(t.map(e=>e.id)),i=new Set;n=[];for(let t of e.participants){if(i.has(t.id))continue;let a=t.container;if(a===void 0||!r.has(a))n.push(t),i.add(t.id);else for(let t of e.participants)t.container!==a||i.has(t.id)||(n.push(t),i.add(t.id))}}let r=[];n.forEach((e,n)=>{let i=t.find(t=>t.id===e.container);if(i===void 0)return;let a=r.at(-1);a!==void 0&&a.container.id===i.id&&a.to===n-1?a.to=n:r.push({container:i,from:n,to:n})});let i=t.length>0?ll:0,a=new Map(n.map((e,t)=>[e.id,t])),o=Math.max(...e.participants.map(e=>Ee([Zc(e)],jc(e),110,240)),Te(e.messages.map(e=>e.label??``),110,240)*.8),s=o-14,c=e.participants.reduce((e,t)=>Math.max(e,Oe(De(Zc(t),s).length,ke(jc(t),s).length)),Oe(1,0))+8;return{columns:n,bands:r,bandHeight:i,lifelineX:o,boxW:s,headerHeight:c,messageGap:cl,width:Math.max(e.participants.length*o,240),height:i+c+(e.messages.length+1)*cl,xOf:e=>(a.get(e)??0)*o+o/2}}function dl(e,t){let n=[Zc(e)];t!==`unchanged`&&n.push(`(${Mc[t]})`),e.ref!==void 0&&n.push(`[${e.ref}]`);for(let t of jc(e))n.push(Ae(t));return n.join(` `)}function fl(e,t){let n=t.cx-e.cx,r=t.cy-e.cy;if(n===0&&r===0)return{x:e.cx,y:e.cy};let i=Math.min(n===0?1/0:e.w/2/Math.abs(n),r===0?1/0:e.h/2/Math.abs(r));return{x:e.cx+n*i,y:e.cy+r*i}}function pl(e,t){if(e.length<3)return e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `);let n=[`M ${e[0].x} ${e[0].y}`];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0)continue;let l=((a.x-i.x)*(o.y-a.y)-(a.y-i.y)*(o.x-a.x))/(s*c);if(Math.abs(l)<.02)continue;let u=Math.min(t,s/2,c/2),d={x:a.x-(a.x-i.x)/s*u,y:a.y-(a.y-i.y)/s*u},f={x:a.x+(o.x-a.x)/c*u,y:a.y+(o.y-a.y)/c*u};n.push(`L ${d.x} ${d.y}`,`Q ${a.x} ${a.y} ${f.x} ${f.y}`)}let r=e[e.length-1];return n.push(`L ${r.x} ${r.y}`),n.join(` `)}function ml(e,t,n,r,i){if(e===t){let t=26+r*12,n=e.cx-e.w/4,i=e.cx+e.w/4,a=e.y;return{d:`M ${n} ${a} C ${n} ${a-t}, ${i} ${a-t}, ${i} ${a}`,labelAt:{x:e.cx,y:a-t*.75},span:t*2}}let a=fl(e,t),o=fl(t,e),s=Math.hypot(o.x-a.x,o.y-a.y),c=(n??[]).slice(1,-1),l=i===void 0?c:c.map((e,t)=>{let n=c.length===1?.5:t/(c.length-1);return{x:e.x+i.from.dx*(1-n)+i.to.dx*n,y:e.y+i.from.dy*(1-n)+i.to.dy*n}});if(l.length>0&&r===0){let e=l[Math.floor((l.length-1)/2)];return{d:pl([a,...l,o],12),labelAt:e,span:s}}let u=r===0?0:Math.ceil(r/2)*22*(r%2==1?1:-1),d=(a.x+o.x)/2,f=(a.y+o.y)/2;if(u===0)return{d:`M ${a.x} ${a.y} L ${o.x} ${o.y}`,labelAt:{x:d,y:f},span:s};let p=s===0?0:-(o.y-a.y)/s,m=s===0?0:(o.x-a.x)/s,h=d+p*u*2,g=f+m*u*2;return{d:`M ${a.x} ${a.y} Q ${h} ${g} ${o.x} ${o.y}`,labelAt:{x:d+p*u,y:f+m*u},span:s}}function hl(e){let t=(e.match(/-?\d+(?:\.\d+)?/g)??[]).map(Number);if(t.length<2)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e=0;e+1<t.length;e+=2)n=Math.min(n,t[e]),i=Math.max(i,t[e]),r=Math.min(r,t[e+1]),a=Math.max(a,t[e+1]);return{minX:n,minY:r,maxX:i,maxY:a}}function gl(e,t,n,r){let i=t=>{let n=e.participants.find(e=>e.id===t);return n===void 0?t:Zc(n)},a=t.label===void 0||t.label===``?``:`: ${t.label}`;return[`${n+1}.`,`${i(t.from)} → ${i(t.to)}${a}`,t.from===t.to?`(to itself)`:``,r===`unchanged`?``:`[${Mc[r]}]`,jc(t).map(Ae).join(`, `)].filter(e=>e!==``).join(` `)}function _l(e,t,n){let r=t=>{let n=e.nodes.find(e=>e.id===t);return n===void 0?t:Zc(n)},i=t.label??t.kind;return[`${r(t.from)} → ${r(t.to)}`,i===void 0?``:`(${i})`,n===`unchanged`?``:`[${Mc[n]}]`,jc(t).map(Ae).join(`, `)].filter(e=>e!==``).join(` `)}function vl(e){if(e===void 0||e===``)return;let t=It(e,Vi);return t.valid?{valid:!0,envelope:t.envelope,issues:[]}:t}function yl(e){let t=vl(e);return t?.valid===!0?t.envelope:void 0}function bl(e){return Rt(e,Vi)}var xl=`pi-outpost/structured-exchange-arrangement-1`,Sl=()=>({format:xl,views:{}}),Cl=()=>({elements:{},relationships:{}});function wl(e){return/\.json$/i.test(e)?e.replace(/\.json$/i,`.arrangement.json`):`${e}.arrangement.json`}var Tl=e=>e.replace(/[%>#[\]\s]/g,e=>`%${e.charCodeAt(0).toString(16).padStart(2,`0`).toUpperCase()}`);function El(e){return e.ref===void 0?`id:${Tl(e.id)}`:`ref:${Tl(e.ref)}`}function Dl(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=new Map;return e.edges.map(e=>{if(e.ref!==void 0)return`ref:${Tl(e.ref)}`;let r=t.get(e.from),i=t.get(e.to),a=`${r===void 0?`id:${Tl(e.from)}`:El(r)}>${i===void 0?`id:${Tl(e.to)}`:El(i)}[${Tl(e.kind??``)}]`,o=n.get(a)??0;return n.set(a,o+1),`${a}#${o}`})}var Ol=e=>typeof e==`object`&&!!e&&!Array.isArray(e),kl=e=>Ol(e)&&Number.isFinite(e.x)&&Number.isFinite(e.y);function Al(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,reason:`it is not parseable JSON`}}if(!Ol(t)||t.format!==`pi-outpost/structured-exchange-arrangement-1`)return{ok:!1,reason:`it does not declare "format": "${xl}"`};if(!Ol(t.views))return{ok:!1,reason:`it has no views`};let n={};for(let[e,r]of Object.entries(t.views)){if(!Ol(r))return{ok:!1,reason:`view "${e}" is not an object`};let t=Cl();if(r.orientation!==void 0){if(r.orientation!==`landscape`&&r.orientation!==`portrait`)return{ok:!1,reason:`view "${e}" has an unknown orientation`};t.orientation=r.orientation}if(!Ol(r.elements))return{ok:!1,reason:`view "${e}" has no elements`};if(!Ol(r.relationships))return{ok:!1,reason:`view "${e}" has no relationships`};for(let[n,i]of Object.entries(r.elements)){if(!kl(i))return{ok:!1,reason:`element "${n}" of view "${e}" has no x and y`};t.elements[n]={x:i.x,y:i.y}}for(let[n,i]of Object.entries(r.relationships)){if(!Ol(i))return{ok:!1,reason:`relationship "${n}" of view "${e}" is not an object`};let r={};for(let t of[`exit`,`entry`])if(i[t]!==void 0){if(!kl(i[t]))return{ok:!1,reason:`relationship "${n}" of view "${e}" has an unreadable ${t}`};r[t]={x:i[t].x,y:i[t].y}}if(i.waypoints!==void 0){if(!Array.isArray(i.waypoints)||!i.waypoints.every(kl))return{ok:!1,reason:`relationship "${n}" of view "${e}" has unreadable waypoints`};r.waypoints=i.waypoints.map(e=>({x:e.x,y:e.y}))}if(i.label!==void 0){let t=i.label;if(!Ol(t)||!Number.isFinite(t.along)||!kl(t.offset)||t.across!==void 0&&!Number.isFinite(t.across))return{ok:!1,reason:`relationship "${n}" of view "${e}" has an unreadable label`};r.label={along:t.along,...t.across===void 0?{}:{across:t.across},offset:{x:t.offset.x,y:t.offset.y}}}t.relationships[n]=r}n[e]=t}return{ok:!0,arrangement:{format:xl,views:n}}}var jl=e=>Math.round(e*1e4)/1e4,Ml=e=>Math.round(e/10)*10,Nl=e=>({x:Ml(e.x),y:Ml(e.y)});function Pl(e){let t={};return e.entry!==void 0&&(t.entry={x:jl(e.entry.x),y:jl(e.entry.y)}),e.exit!==void 0&&(t.exit={x:jl(e.exit.x),y:jl(e.exit.y)}),e.label!==void 0&&(t.label={...e.label.across===void 0||e.label.across===0?{}:{across:Math.round(e.label.across)},along:jl(e.label.along),offset:{x:Math.round(e.label.offset.x),y:Math.round(e.label.offset.y)}}),e.waypoints!==void 0&&e.waypoints.length>0&&(t.waypoints=e.waypoints.map(e=>({x:Math.round(e.x),y:Math.round(e.y)}))),t}var Fl=e=>Object.keys(e).sort().map(t=>[t,e[t]]);function Il(e){let t={};for(let[n,r]of Fl(e.views))t[n]={elements:Object.fromEntries(Fl(r.elements).map(([e,t])=>[e,Nl(t)])),...r.orientation===void 0?{}:{orientation:r.orientation},relationships:Object.fromEntries(Fl(r.relationships).map(([e,t])=>[e,Pl(t)]))};return`${JSON.stringify({format:xl,views:t},null,2).replace(/\{\n\s*"x": (-?[\d.]+),\n\s*"y": (-?[\d.]+)\n\s*\}/g,`{ "x": $1, "y": $2 }`)}\n`}var Ll={shape:`label`,perimeter:`rectanglePerimeter`},Rl={shape:`connector`,endArrow:`classic`,rounded:1},zl={ellipse:{shape:`ellipse`,perimeter:`ellipsePerimeter`},rhombus:{shape:`rhombus`,perimeter:`rhombusPerimeter`},triangle:{shape:`triangle`,perimeter:`trianglePerimeter`},line:{shape:`line`},image:{shape:`image`},roundImage:{shape:`image`,perimeter:`ellipsePerimeter`},rhombusImage:{shape:`image`,perimeter:`rhombusPerimeter`},arrow:{shape:`arrow`,edgeStyle:`none`},swimlane:{shape:`swimlane`}};function Bl(e,t){let n=e.startsWith(`;`)?{}:{...t?Rl:Ll};for(let t of e.split(`;`)){let e=t.indexOf(`=`);if(e>=0){let r=t.slice(0,e),i=t.slice(e+1);i===`none`?delete n[r]:n[r]=i.trim()!==``&&Number.isFinite(Number(i))?Number.parseFloat(i):i}else if(Object.hasOwn(zl,t))for(let[e,r]of Object.entries(zl[t]))r===`none`?delete n[e]:n[e]=r}return n}var Vl=(e,t,n)=>{let r=e[t],i=typeof r==`number`?r:Number.parseFloat(String(r??``));return Number.isFinite(i)?i:n},Hl=1,Ul=2,Wl=4,Gl=8,Kl=15,ql=6,Jl=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Yl=e=>Math.round(e*10)/10,Xl=(e,t,n)=>t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height;function Zl(e){let{style:t}=e;if(Vl(t,`rotation`,0)%360!=0||t.direction!==void 0&&t.direction!==`east`||Vl(t,`flipH`,0)===1||Vl(t,`flipV`,0)===1)return!1;let n=String(t.shape??``);if(n.startsWith(`mxgraph.`)||n.startsWith(`stencil(`)||Vl(t,`roundedPerimeter`,0)===1&&Vl(t,`rounded`,0)===1||Vl(t,`labelPerimeter`,0)===1)return!1;let r=t.perimeter;return r===void 0||[`rectanglePerimeter`,`ellipsePerimeter`,`rhombusPerimeter`,`centerPerimeter`].includes(String(r))}function Ql(e,t,n,r,i,a,o,s){let c=(s-a)*(n-e)-(o-i)*(r-t),l=(o-i)*(t-a)-(s-a)*(e-i),u=(n-e)*(t-a)-(r-t)*(e-i),d=l/c,f=u/c;return d>=0&&d<=1&&f>=0&&f<=1?{x:e+d*(n-e),y:t+d*(r-t)}:null}function $l(e,t,n){let r=e.x+e.width/2,i=e.y+e.height/2,a=Math.atan2(t.y-i,t.x-r),o={x:0,y:0},s=Math.PI,c=s/2-a,l=Math.atan2(e.height,e.width);return a<-s+l||a>s-l?(o.x=e.x,o.y=i-e.width*Math.tan(a)/2):a<-l?(o.y=e.y,o.x=r-e.height*Math.tan(c)/2):a<l?(o.x=e.x+e.width,o.y=i+e.width*Math.tan(a)/2):(o.y=e.y+e.height,o.x=r+e.height*Math.tan(c)/2),n&&(t.x>=e.x&&t.x<=e.x+e.width?o.x=t.x:t.y>=e.y&&t.y<=e.y+e.height&&(o.y=t.y),t.x<e.x?o.x=e.x:t.x>e.x+e.width&&(o.x=e.x+e.width),t.y<e.y?o.y=e.y:t.y>e.y+e.height&&(o.y=e.y+e.height)),o}function eu(e,t,n){let{x:r,y:i}=e,a=e.width/2,o=e.height/2,s=r+a,c=i+o,l=t.x,u=t.y,d=Math.trunc(l-s),f=Math.trunc(u-c);if(d===0&&f!==0)return{x:s,y:c+o*f/Math.abs(f)};if(d===0&&f===0)return{x:l,y:u};if(n){if(u>=i&&u<=i+e.height){let e=u-c,t=Math.sqrt(a*a*(1-e*e/(o*o)))||0;return l<=r&&(t=-t),{x:s+t,y:u}}if(l>=r&&l<=r+e.width){let e=l-s,t=Math.sqrt(o*o*(1-e*e/(a*a)))||0;return u<=i&&(t=-t),{x:l,y:c+t}}}let p=a*o/Math.sqrt(o*o*d*d+a*a*f*f);return{x:s+p*d,y:c+p*f}}function tu(e,t,n){let{x:r,y:i}=e,a=e.width,o=e.height,s=r+a/2,c=i+o/2,l=t.x,u=t.y;if(s===l)return c>u?{x:s,y:i}:{x:s,y:i+o};if(c===u)return s>l?{x:r,y:c}:{x:r+a,y:c};let d=s,f=c;return n&&(l>=r&&l<=r+a?d=l:u>=i&&u<=i+o&&(f=u)),l<s?u<c?Ql(l,u,d,f,s,i,r,c):Ql(l,u,d,f,s,i+o,r,c):u<c?Ql(l,u,d,f,s,i,r+a,c):Ql(l,u,d,f,s,i+o,r+a,c)}function nu(e,t,n,r){let i=r+Vl(e.style,`perimeterSpacing`,0),a={x:e.box.x-i,y:e.box.y-i,width:e.box.width+2*i,height:e.box.height+2*i},o=e.style.perimeter,s=null;return o!==void 0&&(a.width>0||a.height>0)&&(o===`ellipsePerimeter`?s=eu(a,t,n):o===`rhombusPerimeter`?s=tu(a,t,n):o===`rectanglePerimeter`&&(s=$l(a,t,n))),s??Jl(e.box)}var ru=(e,t)=>({x:t.x+e.origin.x,y:t.y+e.origin.y});function iu(e){let t=(e&Hl)<<3;return t|=(e&Ul)<<1,t|=(e&Wl)>>1,t|=(e&Gl)>>3,t}function au(e,t,n){let r=e.style.portConstraint??t.style[n?`sourcePortConstraint`:`targetPortConstraint`];if(r===void 0)return Kl;let i=String(r),a=0;return i.includes(`north`)&&(a|=Ul),i.includes(`west`)&&(a|=Hl),i.includes(`south`)&&(a|=Wl),i.includes(`east`)&&(a|=Gl),a}var ou=10;function su(e,t){let n=e.style[t?`sourceJettySize`:`targetJettySize`]??e.style.jettySize??ou;if(n===`auto`){let n=e.style[t?`startArrow`:`endArrow`];if(n!==void 0&&n!==`none`){let n=Vl(e.style,t?`startSize`:`endSize`,ql);return Math.max(2,Math.ceil((n+ou)/ou))*ou}return 20}return typeof n==`number`?n:Number.parseFloat(String(n))}var cu=(e,t,n,r,i)=>{let a=e.absolutePoints.map(e=>e===null?null:{x:Yl(e.x),y:Yl(e.y)}),o=t?.box??null,s=n?.box??null,c=[],l=e=>c.push(e),u=i.length>0&&i[0]!=null?{x:i[0].x,y:i[0].y}:null,d=!0,f=null,p=e=>(e.x=Yl(e.x),e.y=Yl(e.y),(u===null||Math.abs(u.x-e.x)>=1||Math.abs(u.y-e.y)>=1)&&(i.push({x:e.x,y:e.y}),u=e),u),m=a[0]??null;m===null&&t!==null?m=Jl(t.box):m!==null&&(m={...m});let h=a.length-1,g;if(r!==null&&r.length>0){let i=r.map(t=>ru(e,t));if(i.length===0)return;m!==null&&i[0]!==void 0&&(Math.abs(i[0].x-m.x)<1&&(i[0].x=m.x),Math.abs(i[0].y-m.y)<1&&(i[0].y=m.y)),g=a[h],g!=null&&i[i.length-1]!==void 0&&(Math.abs(i[i.length-1].x-g.x)<1&&(i[i.length-1].x=g.x),Math.abs(i[i.length-1].y-g.y)<1&&(i[i.length-1].y=g.y)),f=i[0];let c=t,u=o,p=a[0],_=!1,v=!1,y=f;p!=null&&(c=null);for(let e=0;e<2;e++){let t=p!=null&&p.x===y.x,r=p!=null&&p.y===y.y,o=c!==null&&y.y>=u.y&&y.y<=u.y+u.height,l=c!==null&&y.x>=u.x&&y.x<=u.x+u.width;if(_=r||p==null&&o,v=t||p==null&&l,!(e===0&&(_&&v||t&&r))){if(p!=null&&!r&&!t&&(o||l)){d=!o;break}if(v||_){d=_,e===1&&(d=i.length%2==0?_:v);break}}c=n,u=s,p=a[h],p!=null&&(c=null),y=i[i.length-1],t&&r&&(i=i.slice(1))}d&&(a[0]!=null&&a[0].y!==f.y||a[0]==null&&t!==null&&(f.y<o.y||f.y>o.y+o.height))?l({x:m.x,y:f.y}):!d&&(a[0]!=null&&a[0].x!==f.x||a[0]==null&&t!==null&&(f.x<o.x||f.x>o.x+o.width))&&l({x:f.x,y:m.y}),d?m.y=f.y:m.x=f.x;for(let e of i)d=!d,f=e,d?m.y=f.y:m.x=f.x,l({...m})}else f=m,d=!0;if(m=a[h]??null,m===null&&n!==null&&(m=Jl(n.box)),m!==null&&f!==null&&(d&&(a[h]!=null&&a[h].y!==f.y||a[h]==null&&n!==null&&(f.y<s.y||f.y>s.y+s.height))?l({x:m.x,y:f.y}):!d&&(a[h]!=null&&a[h].x!==f.x||a[h]==null&&n!==null&&(f.x<s.x||f.x>s.x+s.width))&&l({x:f.x,y:m.y})),a[0]==null&&t!==null)for(;c.length>0&&Xl(o,c[0].x,c[0].y);)c.splice(0,1);if(a[h]==null&&n!==null)for(;c.length>0&&Xl(s,c[c.length-1].x,c[c.length-1].y);)c.splice(c.length-1,1);for(let e of c)p(e);let _=i[i.length-1];if(g!=null&&_!=null&&Math.abs(g.x-_.x)<=1&&Math.abs(g.y-_.y)<=1){i.splice(i.length-1,1);let e=i[i.length-1];e!=null&&(Math.abs(e.x-g.x)<1&&(e.x=g.x),Math.abs(e.y-g.y)<1&&(e.y=g.y))}},lu=[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],uu=[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],du=1024,fu=2048,pu=480,mu=512,hu=(e,t,n,r,i)=>{let a=e.absolutePoints.map(e=>e===null?null:{x:Yl(e.x),y:Yl(e.y)}),o=t===null?null:{...t.box,x:Yl(t.box.x),y:Yl(t.box.y),width:Yl(t.box.width),height:Yl(t.box.height)},s=n===null?null:{...n.box,x:Yl(n.box.x),y:Yl(n.box.y),width:Yl(n.box.width),height:Yl(n.box.height)},c=a[0]??null,l=a[a.length-1]??null,u=o===null?c.x:o.x,d=o===null?c.y:o.y,f=o===null?1:o.width,p=o===null?1:o.height,m=s===null?l.x:s.x,h=s===null?l.y:s.y,g=s===null?1:s.width,_=s===null?1:s.height,v=su(e,!0),y=su(e,!1),b=y+v,x=!1;if(c!==null&&l!==null){let e=l.x-c.x,t=l.y-c.y;x=e*e+t*t<b*b}if(x||r!==null&&r.length>0){cu(e,t,n,r,i);return}let S=[Kl,Kl];if(t!==null&&(S[0]=au(t,e,!0)),n!==null&&(S[1]=au(n,e,!1)),f===0||p===0||g===0||_===0)return;let C=[0,0],w=[[u,d,f,p],[m,h,g,_]],T=[v,y],E=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];for(let e=0;e<2;e++)E[e][1]=w[e][0]-T[e],E[e][2]=w[e][1]-T[e],E[e][4]=w[e][0]+w[e][2]+T[e],E[e][8]=w[e][1]+w[e][3]+T[e];let ee=w[0][0]+w[0][2]/2,D=w[0][1]+w[0][3]/2,te=w[1][0]+w[1][2]/2,ne=w[1][1]+w[1][3]/2,re=ee-te,ie=D-ne,ae=0;re<0?ae=ie<0?2:1:ie<=0&&(ae=3,re===0&&(ae=2));let oe=t===null?null:c,se=[[.5,.5],[.5,.5]];t===null&&(se[0]=[0,0]),n===null&&(se[1]=[0,0]);for(let e=0;e<2;e++)oe!==null&&(se[e][0]=(oe.x-w[e][0])/w[e][2],Math.abs(oe.x-w[e][0])<=1?C[e]=Hl:Math.abs(oe.x-w[e][0]-w[e][2])<=1&&(C[e]=Gl),se[e][1]=(oe.y-w[e][1])/w[e][3],Math.abs(oe.y-w[e][1])<=1?C[e]=Ul:Math.abs(oe.y-w[e][1]-w[e][3])<=1&&(C[e]=Wl)),oe=n===null?null:l;let ce=w[0][1]-(w[1][1]+w[1][3]),le=w[0][0]-(w[1][0]+w[1][2]),ue=w[1][1]-(w[0][1]+w[0][3]),de=w[1][0]-(w[0][0]+w[0][2]),O=[];O[1]=Math.max(le-b,0),O[2]=Math.max(ce-b,0),O[4]=Math.max(ue-b,0),O[3]=Math.max(de-b,0);let fe=[],pe=[],me=[];pe[0]=le>=de?Hl:Gl,me[0]=ce>=ue?Ul:Wl,pe[1]=iu(pe[0]),me[1]=iu(me[0]);let he=le>=de?le:de,ge=ce>=ue?ce:ue,_e=[[0,0],[0,0]],ve=!1;for(let e=0;e<2;e++)C[e]===0&&((pe[e]&S[e])===0&&(pe[e]=iu(pe[e])),(me[e]&S[e])===0&&(me[e]=iu(me[e])),_e[e][0]=me[e],_e[e][1]=pe[e]);ge>0&&he>0&&((pe[0]&S[0])>0&&(me[1]&S[1])>0?(_e[0]=[pe[0],me[0]],_e[1]=[me[1],pe[1]],ve=!0):(me[0]&S[0])>0&&(pe[1]&S[1])>0&&(_e[0]=[me[0],pe[0]],_e[1]=[pe[1],me[1]],ve=!0)),ge>0&&!ve&&(_e[0]=[me[0],pe[0]],_e[1]=[me[1],pe[1]],ve=!0),he>0&&!ve&&(_e[0]=[pe[0],me[0]],_e[1]=[pe[1],me[1]],ve=!0);for(let e=0;e<2;e++)C[e]===0&&((_e[e][0]&S[e])===0&&(_e[e][0]=_e[e][1]),fe[e]=_e[e][0]&S[e],fe[e]|=(_e[e][1]&S[e])<<8,fe[e]|=(_e[1-e][e]&S[e])<<16,fe[e]|=(_e[1-e][1-e]&S[e])<<24,fe[e]&15||(fe[e]=fe[e]<<8),fe[e]&3840||(fe[e]=fe[e]&15|fe[e]>>8),fe[e]&983040||(fe[e]=fe[e]&65535|(fe[e]&251658240)>>8),C[e]=fe[e]&15,(S[e]===Hl||S[e]===Ul||S[e]===Gl||S[e]===Wl)&&(C[e]=S[e]));let ye=C[0]===Gl?3:C[0],be=C[1]===Gl?3:C[1];ye-=ae,be-=ae,ye<1&&(ye+=4),be<1&&(be+=4);let xe=uu[ye-1][be-1],k=Array.from({length:12},()=>[0,0]);switch(k[0][0]=w[0][0],k[0][1]=w[0][1],C[0]){case Hl:k[0][0]-=v,k[0][1]+=se[0][1]*w[0][3];break;case Wl:k[0][0]+=se[0][0]*w[0][2],k[0][1]+=w[0][3]+v;break;case Gl:k[0][0]+=w[0][2]+v,k[0][1]+=se[0][1]*w[0][3];break;case Ul:k[0][0]+=se[0][0]*w[0][2],k[0][1]-=v}let A=0,Se=(C[0]&9)>0?0:1,Ce=Se,we=0;for(let e of xe){let t=e&15,n=t===Gl?3:t;n+=ae,n>4&&(n-=4);let r=lu[n-1];we=n%2>0?0:1,we!==Se&&(A++,k[A][0]=k[A-1][0],k[A][1]=k[A-1][1]);let i=(e&fu)>0,a=(e&du)>0,o=(e&pu)>>5;o<<=ae,o>15&&(o>>=4);let s=(e&mu)>0;if((a||i)&&o<9){let e=0,t=+!a;if(e=s&&we===0?w[t][0]+se[t][0]*w[t][2]:s?w[t][1]+se[t][1]*w[t][3]:E[t][o],we===0){let t=k[A][0],n=(e-t)*r[0];n>0&&(k[A][0]+=r[0]*n)}else{let t=k[A][1],n=(e-t)*r[1];n>0&&(k[A][1]+=r[1]*n)}}else s&&(k[A][0]+=r[0]*Math.abs(O[n]/2),k[A][1]+=r[1]*Math.abs(O[n]/2));A>0&&k[A][we]===k[A-1][we]?A--:Se=we}for(let e=0;e<=A&&(e!==A||(((C[1]&9)>0?0:1)===Ce?0:1)==(A+1)%2);e++)i.push({x:Yl(k[e][0]),y:Yl(k[e][1])});let Te=1;for(;Te<i.length;){let[e,t]=[i[Te-1],i[Te]];e==null||t==null||e.x!==t.x||e.y!==t.y?Te++:i.splice(Te,1)}},gu=(e,t,n)=>Xl(e,t,n),_u=(e,t,n,r,i)=>{let a=r!==null&&r.length>0?ru(e,r[0]):null,o=e.absolutePoints[0],s=e.absolutePoints[e.absolutePoints.length-1],c=o==null?t?.box??null:{x:o.x,y:o.y,width:0,height:0},l=s==null?n?.box??null:{x:s.x,y:s.y,width:0,height:0};if(c===null||l===null)return;let u=Math.max(c.x,l.x),d=Math.min(c.x+c.width,l.x+l.width),f=a===null?Math.round(d+(u-d)/2):a.x,p=c.y+c.height/2,m=l.y+l.height/2;if(a!==null&&(a.y>=c.y&&a.y<=c.y+c.height&&(p=a.y),a.y>=l.y&&a.y<=l.y+l.height&&(m=a.y)),!gu(l,f,p)&&!gu(c,f,p)&&i.push({x:f,y:p}),!gu(l,f,m)&&!gu(c,f,m)&&i.push({x:f,y:m}),i.length===1){if(a!==null)!gu(l,f,a.y)&&!gu(c,f,a.y)&&i.push({x:f,y:a.y});else{let e=Math.max(c.y,l.y),t=Math.min(c.y+c.height,l.y+l.height);i.push({x:f,y:e+(t-e)/2})}}a=null},vu=(e,t,n,r,i)=>{let a=r!==null&&r.length>0?ru(e,r[0]):null,o=e.absolutePoints[0],s=e.absolutePoints[e.absolutePoints.length-1],c=o==null?t?.box??null:{x:o.x,y:o.y,width:0,height:0},l=s==null?n?.box??null:{x:s.x,y:s.y,width:0,height:0};if(c===null||l===null)return;let u=Math.max(c.y,l.y),d=Math.min(c.y+c.height,l.y+l.height),f=c.x+c.width/2;a!==null&&a.x>=c.x&&a.x<=c.x+c.width&&(f=a.x);let p=a===null?Math.round(d+(u-d)/2):a.y;if(!gu(l,f,p)&&!gu(c,f,p)&&i.push({x:f,y:p}),f=a!==null&&a.x>=l.x&&a.x<=l.x+l.width?a.x:l.x+l.width/2,!gu(l,f,p)&&!gu(c,f,p)&&i.push({x:f,y:p}),i.length===1){if(a!==null)!gu(l,a.x,p)&&!gu(c,a.x,p)&&i.push({x:a.x,y:p});else{let e=Math.max(c.x,l.x),t=Math.min(c.x+c.width,l.x+l.width);i.push({x:e+(t-e)/2,y:p})}}},yu=(e,t,n,r,i)=>{let a=r!==null&&r.length>0?r[0]:null,o=!1,s=!1;if(t!==null&&n!==null){let r=t.box,i=n.box;if(a!==null){let t=Math.min(r.x,i.x),n=Math.max(r.x+r.width,i.x+i.width),c=Math.min(r.y,i.y),l=Math.max(r.y+r.height,i.y+i.height);a=ru(e,a),o=a.y<c||a.y>l,s=a.x<t||a.x>n}else o=Math.max(r.x,i.x)===Math.min(r.x+r.width,i.x+i.width),o||(s=Math.max(r.y,i.y)===Math.min(r.y+r.height,i.y+i.height))}!s&&(o||e.style.elbow===`vertical`)?vu(e,t,n,r,i):_u(e,t,n,r,i)},bu={orthogonalEdgeStyle:hu,segmentEdgeStyle:cu,elbowEdgeStyle:yu,sideToSideEdgeStyle:_u,topToBottomEdgeStyle:vu},xu=new Set([hu,cu,yu,_u,vu]),Su=new Set([yu,_u,vu]);function Cu(e){let t=new Map(e.cells.filter(e=>e.id!==void 0).map(e=>[e.id,e])),n=new Map,r=(e,i=new Set)=>{if(e.id!==void 0&&n.has(e.id))return n.get(e.id);let a={x:0,y:0},o=e.parent===void 0?void 0:t.get(e.parent);if(o!==void 0&&!i.has(o.id??``)){if(i.add(o.id??``),o.edge)a=null;else if(o.vertex){let e=r(o,i),t=o.geometry;a=e===null||t===void 0||t.relative?null:{x:e.x+t.x,y:e.y+t.y}}}return e.id!==void 0&&n.set(e.id,a),a},i=new Map;for(let t of e.cells){if(t.id===void 0)continue;let e=r(t);!t.vertex||t.geometry===void 0||t.geometry.relative||e===null||t.geometry.unreadable.length>0||i.set(t.id,{box:{x:e.x+t.geometry.x,y:e.y+t.geometry.y,width:t.geometry.width,height:t.geometry.height},style:Bl(t.style,!1)})}return{terminals:i,origins:n}}function wu(e,t){let n=e.geometry;if(n===void 0||e.id===void 0)return;let r=t.origins.get(e.id);if(r==null)return;let i=Bl(e.style,!0);if(i.sourcePort!==void 0||i.targetPort!==void 0||i.snapToPoint!==void 0||Vl(i,`fixedPointSpacing`,0)===1||i.orthogonal!==void 0)return;let a=e.source===void 0?null:t.terminals.get(e.source),o=e.target===void 0?null:t.terminals.get(e.target);if(a===void 0||o===void 0||a!==null&&!Zl(a)||o!==null&&!Zl(o)||a!==null&&a===o)return;let s=Vl(i,`noEdgeStyle`,0)===1?void 0:i.edgeStyle,c=s===void 0?null:bu[String(s)];if(c===void 0)return;let l={style:i,absolutePoints:[null,null],origin:r},u=(e,t)=>{let a=t?`exit`:`entry`;if(e!==null&&e.style.perimeter===`centerPerimeter`)return Jl(e.box);let o=i[`${a}X`],s=i[`${a}Y`];if(e!==null&&o!==void 0&&s!==void 0){let t=Number.parseFloat(String(o)),n=Number.parseFloat(String(s)),r=i[`${a}Perimeter`]===void 0||!!Number(i[`${a}Perimeter`]),c=Vl(i,`${a}Dx`,0),l=Vl(i,`${a}Dy`,0),u={x:e.box.x+t*e.box.width+c,y:e.box.y+n*e.box.height+l};return r&&(u=nu(e,u,!1,0)),u}if(e===null){let e=t?n.sourcePointAt:n.targetPointAt;return e===void 0?null:{x:e.x+r.x,y:e.y+r.y}}return null};if(l.absolutePoints=[u(a,!0),u(o,!1)],a===null&&l.absolutePoints[0]===null||o===null&&l.absolutePoints[1]===null)return;let d=n.points.length>0?n.points:null,f=[l.absolutePoints[0]];if(c!==null)c(l,a,o,d,f);else if(d!==null)for(let e of d)f.push(ru(l,e));f.push(l.absolutePoints[1]);let p=c!==null&&xu.has(c),m=(e,t,n)=>{let r=f.length,a=f[n?Math.min(1,r-1):Math.max(0,r-2)]??null;a===null&&t!==null&&(a=Jl(t.box));let o=Vl(i,`perimeterSpacing`,0)+Vl(i,n?`sourcePerimeterSpacing`:`targetPerimeterSpacing`,0);return a===null?Jl(e.box):nu(e,a,p,o)};if(f[f.length-1]===null&&o!==null&&(f[f.length-1]=m(o,a,!1)),f[0]===null&&a!==null&&(f[0]=m(a,o,!0)),c!==null&&(Su.has(c)||c===hu&&d===null)&&f.length>2){let e=(e,t)=>e!==null&&t!==null&&Math.abs(e.x-t.x)<.01&&Math.abs(e.y-t.y)<.01,t=!1;for(let n=1;n<f.length&&!t;n++)t=e(f[n-1],f[n]);if(t)for(let t=f.length-2;t>0&&f.length>2;t--)(e(f[t],f[t+1])||e(f[t],f[t-1]))&&f.splice(t,1)}if(f.some(e=>e===null)||f.length<2)return;let h=f,g=[],_=0;for(let e=1;e<h.length;e++){let t=Math.hypot(h[e-1].x-h[e].x,h[e-1].y-h[e].y);g.push(t),_+=t}return{points:h,segments:g,length:_}}function Tu(e,t,n={x:0,y:0}){let{points:r,segments:i}=e,a=t.x/2,o=Math.round((a+.5)*e.length),s=i[0]??0,c=0,l=1;for(;o>=Math.round(c+s)&&l<r.length-1;)c+=s,s=i[l++];let u=s===0?0:(o-c)/s,d=r[l-1],f=r[l],p=f.x-d.x,m=f.y-d.y,h=s===0?0:m/s,g=s===0?0:p/s;return{x:d.x+p*u+(h*t.y+n.x),y:d.y+m*u-(g*t.y-n.y)}}function Eu(e){let t=String(e.shape??``);return t===`ellipse`||t===`doubleEllipse`?`ellipse`:t===`rhombus`?`rhombus`:`box`}function Du(e,t,n,r,i){let a=n.width/2-i,o=n.height/2-i;if(a<=0||o<=0)return 0;let s=n.x+n.width/2,c=n.y+n.height/2,l=(e.x-s)/a,u=(e.y-c)/o,d=(t.x-e.x)/a,f=(t.y-e.y)/o,p=0,m=1;if(r===`ellipse`){let e=d*d+f*f;if(e===0)return 0;let t=2*(l*d+u*f),n=l*l+u*u-1,r=t*t-4*e*n;if(r<=0)return 0;let i=Math.sqrt(r);p=Math.max(0,(-t-i)/(2*e)),m=Math.min(1,(-t+i)/(2*e))}else{let e=r===`box`?[[1,0],[-1,0],[0,1],[0,-1]]:[[1,1],[1,-1],[-1,1],[-1,-1]];for(let[t,n]of e){let e=t*l+n*u-1,r=t*d+n*f;if(r===0){if(e>=0)return 0;continue}let i=-e/r;r<0?p=Math.max(p,i):m=Math.min(m,i)}}return m<=p?0:(m-p)*Math.hypot(t.x-e.x,t.y-e.y)}function Ou(e,t){let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),r=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);return n>0&&r>0?n*r:0}function ku(e,t,n){let r=Math.max(1,t.length)*n*.45,i=n*1.18;return{x:e.x-r/2,y:e.y-i/2,width:r,height:i}}function Au(e,t,n,r={x:0,y:0}){let i=[e.label,...t.filter(t=>t.parent===e.id).map(e=>e.label)],a=t=>{let n=n=>{let r=RegExp(`(?:^|;)${t}${n}=([^;]*)`).exec(e.style)?.[1],i=r===void 0?NaN:Number.parseFloat(r);return Number.isFinite(i)?i:void 0},r=n(`X`),i=n(`Y`);return r===void 0||i===void 0?void 0:{x:r,y:i}};return{id:e.id,label:i.filter(e=>e!==``).join(` `),source:e.source,target:e.target,exit:a(`exit`),entry:a(`entry`),points:n,waypoints:(e.geometry?.points??[]).map(e=>({x:r.x+e.x,y:r.y+e.y}))}}var ju=[.25,.5,.75,.125,.375,.625,.875],Mu=.06;function Nu(e,t){let n=t.x+t.width/2-(e.x+e.width/2),r=t.y+t.height/2-(e.y+e.height/2);return Math.abs(n)>=Math.abs(r)?n>=0?`X=1;Y=0.5`:`X=0;Y=0.5`:r>=0?`X=0.5;Y=1`:`X=0.5;Y=0`}var Pu=(e,t)=>{let[n,r]=Nu(e,t).split(`;`).map(e=>Number(e.slice(2)));return{x:e.x+e.width*n,y:e.y+e.height*r}},Fu=(e,t)=>e.x<t.x+t.width&&t.x<e.x+e.width&&e.y<t.y+t.height&&t.y<e.y+e.height,Iu=e=>e.reduce((t,n,r)=>r===0?0:t+Math.hypot(n.x-e[r-1].x,n.y-e[r-1].y),0),Lu=e=>e.replace(/\s+/g,` `).trim().toLowerCase();function Ru(e,t){let n=e.width>0?(t.x-e.x)/e.width:.5,r=e.height>0?(t.y-e.y)/e.height:.5,[i,,a]=[[`left`,Math.abs(n),r],[`right`,Math.abs(1-n),r],[`top`,Math.abs(r),n],[`bottom`,Math.abs(1-r),n]].reduce((e,t)=>t[1]<e[1]?t:e);return{side:i,along:a}}var zu=(e,t)=>{let n=String(t);return e===`left`?`X=0;Y=${n}`:e===`right`?`X=1;Y=${n}`:e===`top`?`X=${n};Y=0`:`X=${n};Y=1`};function Bu(e){let t=e=>e>0&&e<1;if(e.x===0&&t(e.y))return`left`;if(e.x===1&&t(e.y))return`right`;if(e.y===0&&t(e.x))return`top`;if(e.y===1&&t(e.x))return`bottom`}function Vu(e,t,n){return t===`right`?n.x+n.width<=e.x:t===`left`?n.x>=e.x+e.width:t===`bottom`?n.y+n.height<=e.y:n.y>=e.y+e.height}var Hu={left:`left side`,right:`right side`,top:`top`,bottom:`bottom`},Uu=(e,t)=>`${e}:${t}`;function Wu(e,t){let n=new Map;for(let r of e){if(r.points.length<2)continue;let e=(e,i,a)=>{if(e===void 0||!t.has(e))return;let o=n.get(e)??[];o.push({wire:r,shape:e,point:i,role:a}),n.set(e,o)};e(r.source,r.points[0],`exit`),e(r.target,r.points[r.points.length-1],`entry`)}return n}function Gu(e,t){let n=[];for(let r of e){if(r.points.length<2)continue;let e=r.source===void 0?void 0:t.get(r.source),i=r.target===void 0?void 0:t.get(r.target);if(e!==void 0&&i!==void 0)for(let[t,a,o,s]of[[`exit`,r.exit,e,i],[`entry`,r.entry,i,e]]){let e=a===void 0?void 0:Bu(a);e!==void 0&&Vu(o,e,s)&&n.push({wire:r,role:t,side:e})}}return n}function Ku(e,t,n){let r=new Map,i=Wu(e,t);for(let[e,a]of i){let i=t.get(e),o=new Map;for(let e of a){if(!n.has(Uu(e.wire.id,e.role)))continue;let r=e.role===`exit`?e.wire.target:e.wire.source,a=r===void 0?void 0:t.get(r);if(a===void 0)continue;let s=Ru(i,Pu(i,a)).side;o.set(s,[...o.get(s)??[],e])}for(let[e,t]of o){let o=a.filter(e=>!n.has(Uu(e.wire.id,e.role))).map(e=>Ru(i,e.point)).filter(t=>t.side===e).map(e=>e.along),s=t.length===1?[.5,...ju.filter(e=>e!==.5)]:t.length===2?[.25,.75,...ju.filter(e=>e!==.25&&e!==.75)]:ju,c=s.filter(e=>o.every(t=>Math.abs(t-e)>Mu));t.forEach((t,n)=>{let o=c[n];o===void 0?r.set(Uu(t.wire.id,t.role),Ju(i,a,r,e)??zu(e,s[n%s.length])):r.set(Uu(t.wire.id,t.role),zu(e,o))})}}return r}function qu(e,t,n,r,i){return t.flatMap(t=>{let a=Uu(t.wire.id,t.role),o=n.get(a);if(o!==void 0){let[t,n]=o.split(`;`).map(e=>Number(e.slice(2))),i=Ru(e,{x:e.x+e.width*t,y:e.y+e.height*n});return i.side===r?[i.along]:[]}if(i?.has(a))return[];let s=Ru(e,t.point);return s.side===r?[s.along]:[]})}function Ju(e,t,n,r){for(let i of[`right`,`bottom`,`left`,`top`].filter(e=>e!==r)){let r=qu(e,t,n,i),a=ju.find(e=>r.every(t=>Math.abs(t-e)>Mu));if(a!==void 0)return zu(i,a)}}function Yu(e,t,n){let r=Gu(e,t).filter(e=>!n.has(e.wire.id)),i=new Set([...[...n].flatMap(([e,t])=>t.map(t=>Uu(e,t))),...r.map(e=>Uu(e.wire.id,e.role))]);return{away:r,moving:i,placements:Ku(e,t,i)}}function Xu(e,t,n){let r=new Map;for(let[i,a]of Yu(e,t,n).placements){let e=i.slice(i.lastIndexOf(`:`)+1);r.set(i,a.split(`;`).map(t=>`${e}${t}`).join(`;`))}return r}var Zu=e=>`(${Math.round(e.x)}, ${Math.round(e.y)})`;function Qu(e,t){let n=(e,t)=>Math.abs(e.x-t.x)<=1&&Math.abs(e.y-t.y)<=1;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],o=Math.hypot(a.x-i.x,a.y-i.y);if(o>=.5&&o<20){let e=Math.abs(a.x-i.x)<Math.abs(a.y-i.y),r=n=>t.find(t=>e?Math.abs(t.y-n.y)<=1:Math.abs(t.x-n.x)<=1),s=t.find(e=>n(e,a))??t.find(e=>n(e,i))??r(a)??r(i),c=`a ${Math.max(1,Math.round(o))}-unit segment`;if(s===void 0)return{where:i,why:c,vertical:e,waypoints:t,fix:``};let l=n(s,a)||(e?Math.abs(s.y-a.y)<=1:Math.abs(s.x-a.x)<=1)?i:a,u=e?{x:s.x,y:l.y}:{x:l.x,y:s.y};return{where:i,why:c,vertical:e,waypoint:s,waypoints:t.map(e=>e===s?u:e),fix:`move its waypoint at ${Zu(s)} to ${Zu(u)}`}}let s=e[r+2];if(s===void 0)continue;let c={x:a.x-i.x,y:a.y-i.y},l={x:s.x-a.x,y:s.y-a.y};if(Math.abs(c.x*l.y-c.y*l.x)<.5&&c.x*l.x+c.y*l.y<0){let e=t.find(e=>n(e,a)),r=`a segment that goes back over the one before it`;return e===void 0?{where:a,why:r,vertical:c.x===0,waypoints:t,fix:``}:{where:a,why:r,vertical:c.x===0,waypoint:e,waypoints:t.filter(t=>t!==e),fix:`remove its waypoint at ${Zu(e)}`}}}}function $u(e,t,n=e=>`"${e}"`,r=new Map,i){let a=[],{away:o,moving:s,placements:c}=Yu(e,t,r),l=(e,t)=>c.get(Uu(e,t)).split(`;`).map(e=>`${t}${e}`).join(`;`),u=new Map;for(let[r,i]of Wu(e,t)){let e=t.get(r),o=i.filter(e=>!s.has(Uu(e.wire.id,e.role))),l=[];for(let e of o){let t=l.find(t=>Math.abs(t[0].point.x-e.point.x)<=1&&Math.abs(t[0].point.y-e.point.y)<=1);t?t.push(e):l.push([e])}for(let s of l){if(new Set(s.map(e=>e.wire.id)).size<2)continue;let l=new Set(s.map(e=>Lu(e.wire.label)));if(l.size===1&&!l.has(``))continue;let{side:d,along:f}=Ru(e,s[0].point),p=[...o.map(t=>Ru(e,t.point)).filter(e=>e.side===d).map(e=>e.along),...i.flatMap(t=>{let n=c.get(Uu(t.wire.id,t.role));if(n===void 0)return[];let[r,i]=n.split(`;`).map(e=>Number(e.slice(2))),a=Ru(e,{x:e.x+e.width*r,y:e.y+e.height*i});return a.side===d?[a.along]:[]})];p.push(...u.get(`${r}:${d}`)??[]);let m=ju.filter(e=>p.every(t=>Math.abs(t-e)>Mu)&&Math.abs(f-e)>Mu),h=s.slice(1);u.set(`${r}:${d}`,[...u.get(`${r}:${d}`)??[],...m.slice(0,h.length)]);let g=s.map(e=>n(e.wire.id)),_=l.has(``)?`they are not labelled as the same data`:`they carry different data`,v=h.slice(0,m.length).map((e,t)=>`${zu(d,m[t]).split(`;`).map(t=>`${e.role}${t}`).join(`;`)} for ${n(e.wire.id)}`),y=t=>[...i.map(t=>Ru(e,t.point)).filter(e=>e.side===t).map(e=>e.along),...i.flatMap(n=>c.has(Uu(n.wire.id,n.role))?qu(e,[n],c,t):[]),...u.get(`${r}:${t}`)??[]],b=h.slice(m.length).map(i=>{let a=i.role===`exit`?i.wire.target:i.wire.source,o=a===void 0?void 0:t.get(a),s=o===void 0?void 0:Ru(e,Pu(e,o)).side,c=[...new Set([s,`right`,`bottom`,`left`,`top`])].filter(e=>e!==void 0&&e!==d);for(let e of c){let t=ju.find(t=>y(e).every(e=>Math.abs(e-t)>Mu));if(t!==void 0)return u.set(`${r}:${e}`,[...u.get(`${r}:${e}`)??[],t]),`${zu(e,t).split(`;`).map(e=>`${i.role}${e}`).join(`;`)} for ${n(i.wire.id)}, on its ${Hu[e]}`}return`${n(i.wire.id)}: no side of this shape has a free point left, so make the shape larger`}),x=v.length===0?`that ${Hu[d]} has no free point left, so move them to other sides: ${b.join(`, `)}`:`give each its own point on its ${Hu[d]}: ${v.join(`, `)}${b.length>0?`, and, since that side has no free point left, ${b.join(`, `)}`:``}`;a.push({rule:`shared-point`,wires:[...new Set(s.map(e=>e.wire.id))],shapes:[r],message:`connectors ${g.join(`, `)} meet shape ${n(r)} at the same point, and ${_}: ${x}. Only wires with the same label may share a point`})}}let d=new Set;for(let{wire:e,role:t,side:r}of o){d.add(e.id);let i=t===`exit`?e.source:e.target,o=t===`exit`?e.target:e.source;a.push({rule:`facing-away`,wires:[e.id],shapes:[i],message:`connector ${n(e.id)} ${t===`exit`?`leaves`:`enters`} shape ${n(i)} on its ${Hu[r]}, facing away from ${n(o)}: fix it on the side facing it (${l(e.id,t)}), or drop ${t}X/${t}Y to let draw.io choose`})}for(let i of e){if(i.points.length<2||d.has(i.id)||r.has(i.id))continue;let e=i.source===void 0?void 0:t.get(i.source),o=i.target===void 0?void 0:t.get(i.target);if(e===void 0||o===void 0||Fu(e,o))continue;let s=Pu(e,o),c=Pu(o,e),l=Math.hypot(c.x-s.x,c.y-s.y),u=Iu(i.points);if(u<=2*l||u-l<80)continue;let f=Nu(e,o).split(`;`).map(e=>`exit${e}`).join(`;`),p=Nu(o,e).split(`;`).map(e=>`entry${e}`).join(`;`);a.push({rule:`detour`,wires:[i.id],shapes:[i.source,i.target],message:`connector ${n(i.id)} runs ${Math.round(u)} units to join shapes ${n(i.source)} and ${n(i.target)}, whose facing sides are ${Math.round(l)} apart: fix its exit and entry on those sides (${f};${p}), or give it a waypoint on the short way (<Array as="points"><mxPoint x="…" y="…"/></Array> in its geometry)`})}for(let o of e){if(o.waypoints.length===0&&o.exit===void 0&&o.entry===void 0||d.has(o.id)||r.has(o.id))continue;let e=Qu(o.points,o.waypoints);if(e===void 0)continue;let s=(e,t)=>{if(i===void 0)return!0;let n=i(o,e,t);return n!==void 0&&Qu(n,e)===void 0},c;if(e.waypoint!==void 0&&s(e.waypoints)?c=e.fix:s([])&&(c=`remove its waypoints (the <Array as="points"> in its geometry) to let draw.io route it`),c===void 0){let n=o.source===void 0?void 0:t.get(o.source),r=o.target===void 0?void 0:t.get(o.target);if(n===void 0||r===void 0)continue;let i=o.points[0],a=o.points[o.points.length-1],l=(t,n)=>e.vertical?(n.y-t.y)/t.height:(n.x-t.x)/t.width,u=e=>Math.round(e*1e4)/1e4,d=o.entry===void 0?void 0:u(l(r,i)),f=o.exit===void 0?void 0:u(l(n,a)),p=e.vertical?`Y`:`X`;d!==void 0&&d>0&&d<1&&s(o.waypoints,{[`entry${p}`]:d})?c=`put its entry level with its exit: entry${p}=${d}`:f!==void 0&&f>0&&f<1&&s(o.waypoints,{[`exit${p}`]:f})?c=`put its exit level with its entry: exit${p}=${f}`:(o.exit!==void 0||o.entry!==void 0)&&s(o.waypoints,{...o.exit?{exitX:NaN}:{},...o.entry?{entryX:NaN}:{}})&&(c=`drop exitX/exitY and entryX/entryY to let draw.io choose where it leaves and enters`)}if(c===void 0){let r=t.get(o.source),i=t.get(o.target),a=Math.round(r.y+r.height/2-(i.y+i.height/2)),s=Math.round(r.x+r.width/2-(i.x+i.width/2)),l=e.vertical?{name:`y`,by:a}:{name:`x`,by:s};if(l.by===0)continue;c=`line up the shapes it joins, whose middles are ${Math.abs(l.by)} units apart: move ${n(o.target)} by ${l.by>0?`+`:``}${l.by} on ${l.name}`}a.push({rule:`needless-bend`,wires:[o.id],shapes:[],message:`connector ${n(o.id)} has a needless bend near ${Zu(e.where)}: ${e.why}. Fix it: ${c}`})}return a}var ed=class extends Error{constructor(e){super(e),this.name=`XmlError`}},td=new Map([[`amp`,`&`],[`lt`,`<`],[`gt`,`>`],[`quot`,`"`],[`apos`,`'`]]);function nd(e){return e.includes(`&`)?e.replace(/&(#x[0-9a-fA-F]+|#[0-9]+|[a-zA-Z]+);/g,(e,t)=>{if(t.startsWith(`#x`)||t.startsWith(`#X`)){let n=Number.parseInt(t.slice(2),16);return Number.isFinite(n)&&n>0?rd(n,e):e}if(t.startsWith(`#`)){let n=Number.parseInt(t.slice(1),10);return Number.isFinite(n)&&n>0?rd(n,e):e}return td.get(t)??e}):e}function rd(e,t){try{return String.fromCodePoint(e)}catch{return t}}function id(e){let t={},n=/([^\s=/>]+)\s*=\s*("([^"]*)"|'([^']*)')/g,r;for(;(r=n.exec(e))!==null;)t[r[1]]=nd(r[3]??r[4]??``);return t}function ad(e,t){let n=0,r=e.length;for(;n<r;){let r=e.indexOf(`<`,n);if(r===-1){i(e.slice(n));return}if(r>n&&i(e.slice(n,r))===!1)return;if(e.startsWith(`<!--`,r)){let t=e.indexOf(`-->`,r+4);if(t===-1)return;n=t+3;continue}if(e.startsWith(`<![CDATA[`,r)){let i=e.indexOf(`]]>`,r+9);if(i===-1)throw new ed(`unterminated CDATA section`);if(t({kind:`text`,text:e.slice(r+9,i)})===!1)return;n=i+3;continue}if(/^<!doctype/i.test(e.slice(r,r+9)))throw new ed(`this document declares a DOCTYPE, which is refused`);if(e.startsWith(`<?`,r)){let t=e.indexOf(`?>`,r+2);if(t===-1)throw new ed(`unterminated processing instruction`);n=t+2;continue}let a=od(e,r);if(a===-1)throw new ed(`unterminated tag`);let o=e.slice(r+1,a);if(n=a+1,o.startsWith(`/`)){if(t({kind:`close`,name:o.slice(1).trim()})===!1)return;continue}let s=o.endsWith(`/`),c=s?o.slice(0,-1):o,l=c.search(/[\s/]/),u=(l===-1?c:c.slice(0,l)).trim();if(u===``)throw new ed(`a tag has no name`);if(t({kind:`open`,name:u,attributes:l===-1?{}:id(c.slice(l)),selfClosing:s})===!1)return}function i(e){if(e!==``)return t({kind:`text`,text:nd(e)})}}function od(e,t){let n=null;for(let r=t+1;r<e.length;r++){let t=e[r];if(n!==null)t===n&&(n=null);else if(t===`"`||t===`'`)n=t;else if(t===`>`)return r}return-1}var sd=class extends Error{constructor(e){super(e),this.name=`DrawioReadError`}},cd=[`x`,`y`,`width`,`height`];function ld(e){let t=e.replace(/[^\x20-\x7e]/g,`?`);return t.length>40?`${t.slice(0,39)}…`:t}function ud(e){let t=``,n=null;for(let r of e??``)r===`<`?n=``:r===`>`?(n!==null&&/^br\b/i.test(n)&&(t+=` `),n=null):n===null?t+=r:n+=r;return t.replace(/&nbsp;/g,` `).replace(/\s+/g,` `).trim()}function dd(e){let t={x:0,y:0,width:0,height:0,relative:e.relative===`1`,unreadable:[],sourcePoint:!1,targetPoint:!1,points:[]};for(let n of cd){let r=e[n];if(r===void 0)continue;let i=Number(r);r.trim()===``||!Number.isFinite(i)?t.unreadable.push(`${n}="${r}"`):t[n]=i}return t}function fd(e,t){let n=[],r=[],i=null,a=null,o=null,s=!1;try{ad(e,e=>{if(e.kind===`text`)return;if(e.kind===`close`){let t=r.pop();if(t!==e.name)throw new sd(`</${ld(e.name)}> closes <${ld(t??`nothing`)}>`);e.name===`mxCell`?a=null:e.name===`mxGeometry`?o=null:(e.name===`object`||e.name===`UserObject`)&&(i=null);return}let{name:t,attributes:c,selfClosing:l}=e;if(r.length===0){if(t!==`mxGraphModel`)throw new sd(`its model is <${ld(t)}>, not <mxGraphModel>`);s=!0}if(t===`object`||t===`UserObject`)i=c;else if(t===`mxCell`){let e={id:(i??c).id??c.id,parent:c.parent,vertex:c.vertex===`1`,edge:c.edge===`1`,source:c.source,target:c.target,label:ud(i?i.label??i.value:c.value),style:c.style??``,geometry:void 0};n.push(e),a=l?null:e}else if(t===`mxGeometry`&&a!==null&&(c.as??`geometry`)===`geometry`){let e=dd(c);a.geometry=e,o=l?null:e}else if(t===`mxPoint`&&o!==null){let e={x:Number(c.x??0)||0,y:Number(c.y??0)||0},t=o;c.as===`sourcePoint`?(t.sourcePoint=!0,t.sourcePointAt=e):c.as===`targetPoint`?(t.targetPoint=!0,t.targetPointAt=e):c.as===`offset`?t.offset=e:r[r.length-1]===`Array`&&r[r.length-2]===`mxGeometry`&&t.points.push(e)}l||r.push(t)})}catch(e){throw e instanceof sd?e:e instanceof ed?new sd(`page "${t}" is not well-formed XML: ${e.message}`):e}if(!s)throw new sd(`page "${t}" holds no <mxGraphModel>`);if(r.length>0)throw new sd(`page "${t}" ends inside <${r[r.length-1]}>`);return n}function pd(e,t){let n=e.replace(/^/,``).trim(),r;try{ad(n,e=>{if(e.kind===`open`)return r=e.name,!1})}catch(e){throw e instanceof ed?new sd(`this is not well-formed XML: ${e.message}`):e}if(r===`mxGraphModel`)return[{name:`Page-1`,cells:fd(n,`Page-1`)}];if(r!==`mxfile`)throw new sd(r===void 0?`the file is empty`:`its root is <${ld(r)}>, not <mxfile> or <mxGraphModel>`);let i=[],a=/<diagram\b([^>]*?)(\/>|>([\s\S]*?)<\/diagram>)/g,o;for(;(o=a.exec(n))!==null;){let e=`Page-${i.length+1}`;ad(`<diagram${o[1]}/>`,t=>(t.kind===`open`&&t.attributes.name&&(e=t.attributes.name),!1));let n=(o[3]??``).trim();if(n===``)throw new sd(`page "${e}" is empty`);let r;try{if(n.startsWith(`<`))r=n;else if(t===void 0)throw new sd(`its compressed data cannot be read here`);else r=t(n)}catch(t){throw t instanceof sd?new sd(`page "${e}" cannot be read: ${t.message}`):t}i.push({name:e,cells:fd(r,e)})}if(i.length===0)throw new sd(`the <mxfile> holds no <diagram> page`);return i}function md(e){let t=e.label.length>40?`${e.label.slice(0,39)}…`:e.label;return t===``?`"${e.id}"`:`"${e.id}" (${t})`}function hd(e,t){let n=Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x),r=Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y);return n>0&&r>0?n*r:0}function gd(e,t){return t.x>=e.x&&t.y>=e.y&&t.x+t.width<=e.x+e.width&&t.y+t.height<=e.y+e.height}var _d=.1;function vd(e){if(e.label===``)return!1;let t=e.style.split(`;`)[0];return![`line`,`image`,`group`,`text`,`edgeLabel`].includes(t)&&!/(^|;)(shape=(line|image)|image=)/.test(e.style)}var yd={shapes:0,ends:1,sharedPoints:2,detours:3,crossings:4,labels:5};function bd(e,t){let n=t.length,r=new Map,i=(n,i,a,o)=>{let s={severity:n,page:e.name,cells:i,message:a};t.push(s),o!==void 0&&r.set(s,o)},a=new Map;for(let t of e.cells)t.id===void 0||t.id===``?i(`error`,[],`a cell${t.label?` labelled "${t.label}"`:``} has no id`):a.has(t.id)?i(`error`,[t.id],`the id "${t.id}" is used by more than one cell`):a.set(t.id,t);let o=e.cells[0];for(let t of e.cells)t.id!==void 0&&(t.parent===void 0?t!==o&&i(`error`,[t.id],`cell ${md(t)} has no parent; every cell but the root belongs to a layer or a container`):a.has(t.parent)||i(`error`,[t.id],`cell ${md(t)} belongs to "${t.parent}", which does not exist`));let s=e=>e.geometry?.relative===!0||e.parent!==void 0&&a.get(e.parent)?.edge===!0;for(let t of e.cells)if(t.id!==void 0){if(t.edge){for(let[e,n,r]of[[`start`,t.source,t.geometry?.sourcePoint],[`end`,t.target,t.geometry?.targetPoint]])n!==void 0&&!a.has(n)?i(`error`,[t.id],`connector ${md(t)} has its ${e} on "${n}", which does not exist`):n===void 0&&r!==!0&&i(`error`,[t.id],`connector ${md(t)} is attached to nothing at its ${e}: give it a ${e===`start`?`source`:`target`}, or a ${e===`start`?`sourcePoint`:`targetPoint`}`);t.geometry===void 0&&i(`error`,[t.id],`connector ${md(t)} has no <mxGeometry relative="1" as="geometry">`)}if(t.vertex){let e=t.geometry;e===void 0?i(`error`,[t.id],`shape ${md(t)} has no <mxGeometry as="geometry">, so it has no size or place`):e.unreadable.length>0?i(`error`,[t.id],`shape ${md(t)} has geometry that is not numbers: ${e.unreadable.join(`, `)}`):e.width<0||e.height<0?i(`error`,[t.id],`shape ${md(t)} is ${e.width} × ${e.height}: a negative size cannot be drawn`):!s(t)&&e.width===0&&e.height===0&&i(`warning`,[t.id],`shape ${md(t)} is 0 × 0, so nothing of it shows`,yd.shapes)}}let c=e.cells.filter(e=>e.vertex&&e.id!==void 0&&e.geometry!==void 0&&e.geometry.unreadable.length===0&&!s(e)&&e.geometry.width>0&&e.geometry.height>0),l=new Set(c.filter(e=>c.some(t=>t.parent===e.id)).map(e=>e.id)),u=new Map;for(let e of c){let t=e.parent??``;u.set(t,[...u.get(t)??[],e])}for(let e of u.values()){let t=e.filter(vd);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let[r,a]=[t[e],t[n]],o=Math.min(r.geometry.width*r.geometry.height,a.geometry.width*a.geometry.height);hd(r.geometry,a.geometry)>_d*o&&!gd(r.geometry,a.geometry)&&!gd(a.geometry,r.geometry)&&i(`warning`,[r.id,a.id],`shapes ${md(r)} and ${md(a)} overlap`,yd.shapes)}}for(let e of c){let t=e.parent===void 0?void 0:a.get(e.parent);t!==void 0&&t.vertex&&l.has(t.id??``)&&t.geometry!==void 0&&(t.style.split(`;`)[0]===`group`||/(^|;)rotation=(?!0(;|$))/.test(t.style)||gd({...t.geometry,x:0,y:0},e.geometry)||i(`warning`,[e.id,t.id??``],`shape ${md(e)} lies partly outside its container ${md(t)}`,yd.shapes))}Cd(e,a,l,i);let d=t.splice(n),f=e=>e.severity===`error`?-1:r.get(e)??-1;t.push(...d.map((e,t)=>({issue:e,index:t})).sort((e,t)=>f(e.issue)-f(t.issue)||e.index-t.index).map(({issue:e})=>e))}var xd=2,Sd=.3;function Cd(e,t,n,r){let i=Cu(e),a=[...i.terminals.entries()].flatMap(([e,r])=>{let i=t.get(e);return i!==void 0&&vd(i)&&!n.has(e)&&r.box.width>0&&r.box.height>0?[{id:e,cell:i,box:r.box,outline:Eu(r.style)}]:[]}),o=e=>{let n=new Set;for(let r=e===void 0?void 0:t.get(e);r?.parent!==void 0&&!n.has(r.parent);r=t.get(r.parent))n.add(r.parent);return n},s=(e,t,n)=>e.some((r,i)=>i>0&&Du(e[i-1],r,t,n,xd)>0),c=[],l=[],u=new Map,d=new Map,f=[];for(let n of e.cells){if(!n.edge||n.id===void 0)continue;let p=wu(n,i);if(p===void 0)continue;c.push(Au({...n,id:n.id},e.cells,p.points,i.origins.get(n.id)??void 0)),u.set(n.id,p);let m=new Set([n.source,n.target].filter(e=>e!==void 0)),h=new Set([...o(n.source),...o(n.target),...o(n.id)]);for(let e of a)m.has(e.id)||h.has(e.id)||s(p.points,e.box,e.outline)&&r(`warning`,[n.id,e.id],`connector ${md(n)} runs through shape ${md(e.cell)}: move the shape off its path, give the connector a waypoint that goes around it (<Array as="points"><mxPoint x="…" y="…"/></Array> in its geometry), or fix its exit and entry on other sides (exitX/exitY, entryX/entryY)`,yd.crossings);let g=n.source===void 0?void 0:i.terminals.get(n.source),_=n.target===void 0?void 0:i.terminals.get(n.target);if(g!==void 0&&_!==void 0&&Ou(g.box,_.box)===0){let e=[[`source`,n.source,g,_,`exit`],[`target`,n.target,_,g,`entry`]].filter(([,e,n])=>t.get(e)!==void 0&&s(p.points,n.box,Eu(n.style)));if(e.length>0){let t=(n.geometry?.points.length??0)>0,r=e=>RegExp(`(?:^|;)${e}X=`).test(n.style)&&RegExp(`(?:^|;)${e}Y=`).test(n.style);d.set(n.id,e.map(([,,,,e])=>e).filter(e=>!t||r(e))),f.push({edge:{...n,id:n.id},own:e.map(([e,t,,,n])=>({role:e,id:t,prefix:n})),waypoints:t})}}let v=[];if(n.label!==``&&n.geometry!==void 0){let e=n.geometry.relative?{x:n.geometry.x,y:n.geometry.y}:{x:0,y:0};v.push({text:n.label,centre:Tu(p,e,n.geometry.offset),style:n.style,holder:n.id,along:e,...n.geometry.offset?{offset:n.geometry.offset}:{}})}for(let t of e.cells){if(t.parent!==n.id||t.label===``||t.geometry===void 0||!t.geometry.relative||t.id===void 0)continue;let e={x:t.geometry.x,y:t.geometry.y};v.push({text:t.label,centre:Tu(p,e,t.geometry.offset),style:t.style,holder:t.id,along:e,...t.geometry.offset?{offset:t.geometry.offset}:{}})}for(let e of v){let t=Number(/(?:^|;)fontSize=([\d.]+)/.exec(e.style)?.[1]??11)||11,i=ku(e.centre,e.text,t);l.push({wire:n.id,holder:e.holder,text:e.text,fontSize:t,along:e.along,...e.offset?{offset:e.offset}:{},box:i,around:h});for(let t of a)h.has(t.id)||Ou(i,t.box)>Sd*i.width*i.height&&r(`warning`,[n.id,t.id],`the label "${e.text.length>40?`${e.text.slice(0,39)}…`:e.text}" of connector ${md(n)} sits on shape ${md(t.cell)}: move the label along the connector (its mxGeometry x, from -1 at the source to 1 at the target) or beside it (y), or move the shape`,yd.labels)}}let p=e=>{let n=t.get(e);return n===void 0?`"${e}"`:md(n)},m=new Map([...i.terminals].map(([e,t])=>[e,t.box])),h=Xu(c,m,d);for(let{edge:e,own:n,waypoints:i}of f){let a=n.map(({role:e,id:n})=>`its ${e} ${md(t.get(n))}`).join(` and `),o=n.flatMap(({prefix:t})=>h.get(`${e.id}:${t}`)??[]).join(`;`),s=`remove its waypoints (the <Array as="points"> in its geometry) to let draw.io route it, or move the first and last of them off those shapes`,c=i&&o===``?`connector ${md(e)} runs through ${a}: its waypoints take it back across them. Fix it: ${s}`:i?`connector ${md(e)} runs through ${a}: its exit or entry is on a side facing away from the other end, and it has waypoints. Put them on the sides facing each other (${o}), and ${s}`:`connector ${md(e)} runs through ${a}: its exit or entry is on a side facing away from the other end. Put them on the sides facing each other (${o}), or drop exitX/exitY and entryX/entryY to let draw.io choose`;r(`warning`,[e.id,...n.map(({id:e})=>e)],c,yd.ends)}let g={"shared-point":yd.sharedPoints,"facing-away":yd.ends,detour:yd.detours,"needless-bend":yd.detours},_=(e,n,r={})=>{let a=t.get(e.id),o=i.origins.get(e.id);if(a?.geometry===void 0||o==null)return;let s=a.style;for(let[e,t]of Object.entries(r)){let n=Number.isNaN(t)?[e,e.replace(/X$/,`Y`)]:[e];for(let e of n)s=s.replace(RegExp(`(^|;)${e}=[^;]*`),`$1`);Number.isNaN(t)||(s=`${s}${s.endsWith(`;`)?``:`;`}${e}=${t};`)}return wu({...a,style:s,geometry:{...a.geometry,points:n.map(e=>({x:e.x-o.x,y:e.y-o.y}))}},i)?.points},v=new Set(d.keys());for(let e of $u(c,m,p,d,_)){r(`warning`,[...e.wires,...e.shapes],e.message,g[e.rule]);for(let t of e.wires)v.add(t)}Od(l,u,c,a,p,r,_,s,v)}var wd=[0,-.3,.3,-.6,.6,-.8,.8],Td=[-14,14,-28,28],Ed=[10,-10,20,-20,30,-30,40,-40],Dd=e=>e.length>40?`${e.slice(0,39)}…`:e;function Od(e,t,n,r,i,a,o,s,c){let l=(e,t)=>Ou(e,t)>Sd*Math.min(e.width*e.height,t.width*t.height),u=(e,t)=>t.points.reduce((n,r,i)=>i===0?0:n+Du(t.points[i-1],r,e,`box`,0),0),d=(n,i)=>e.every(e=>e===n||!l(i,e.box))&&r.every(e=>n.around.has(e.id)||Ou(i,e.box)<=Sd*i.width*i.height)&&[...t].every(([e,t])=>e===n.wire||u(i,t)<4),f=e=>{let n=t.get(e.wire);if(n===void 0)return;let r=[e.along.x,...wd.filter(t=>Math.abs(t-e.along.x)>.05).sort((t,n)=>Math.abs(t-e.along.x)-Math.abs(n-e.along.x))];for(let t of[e.along.y,...Td.map(t=>e.along.y+t)])for(let i of r)if((i!==e.along.x||t!==e.along.y)&&d(e,ku(Tu(n,{x:i,y:t},e.offset),e.text,e.fontSize)))return{x:i,y:t}},p=e=>{let t=f(e);if(t===void 0)return`move the shapes so the connectors part, or shorten the label`;let n=t.y===e.along.y?``:` y="${t.y}"`;return`move it ${n===``?`along`:`beside`} its connector: set x="${t.x}"${n} in the mxGeometry of ${i(e.holder)}`},m=new Set;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let r=e[t],o=e[n];r.wire===o.wire||m.has(r)||m.has(o)||c.has(r.wire)||c.has(o.wire)||!l(r.box,o.box)||(m.add(o),a(`warning`,[o.wire,r.wire],`the label "${Dd(o.text)}" of connector ${i(o.wire)} lies on the label "${Dd(r.text)}" of connector ${i(r.wire)}: ${p(o)}`,yd.labels))}for(let n of e)if(!(m.has(n)||c.has(n.wire))){for(let[e,r]of t)if(!(e===n.wire||c.has(e)||u(n.box,r)<4)){m.add(n),a(`warning`,[n.wire,e],`the label "${Dd(n.text)}" of connector ${i(n.wire)} lies across connector ${i(e)}: ${p(n)}`,yd.labels);break}}let h=e=>e.replace(/\s+/g,` `).trim().toLowerCase(),g=(e,t)=>{let n=0,r,i;for(let a=1;a<e.length;a++)for(let o=1;o<t.length;o++){let[s,c,l,u]=[e[a-1],e[a],t[o-1],t[o]],d=Math.abs(s.x-c.x)<.5&&Math.abs(l.x-u.x)<.5&&Math.abs(s.x-l.x)<8,f=Math.abs(s.y-c.y)<.5&&Math.abs(l.y-u.y)<.5&&Math.abs(s.y-l.y)<8;if(!d&&!f)continue;let[p,m]=d?[Math.max(Math.min(s.y,c.y),Math.min(l.y,u.y)),Math.min(Math.max(s.y,c.y),Math.max(l.y,u.y))]:[Math.max(Math.min(s.x,c.x),Math.min(l.x,u.x)),Math.min(Math.max(s.x,c.x),Math.max(l.x,u.x))];m-p<=0||(n+=m-p,r===void 0&&(r=d?{x:s.x,y:p}:{x:p,y:s.y},i=d?{x:s.x,y:m}:{x:m,y:s.y}))}return{total:n,from:r,to:i}},_=new Set,v=new Map,y=e=>v.get(e.id)??e.points;for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let l=n[e],u=n[t];if(h(l.label)!==``&&h(l.label)===h(u.label)||_.has(u.id)||c.has(l.id)||c.has(u.id))continue;let d=g(l.points,u.points);if(d.total<12||d.from===void 0||d.to===void 0)continue;_.add(u.id);let f=Math.abs(d.from.x-d.to.x)<.5,p={x:(d.from.x+d.to.x)/2,y:(d.from.y+d.to.y)/2},m=(e,t)=>f?{x:e.x+t,y:e.y}:{x:e.x,y:e.y+t},b=e=>`(${Math.round(e.x)}, ${Math.round(e.y)})`,x=e=>{let t,i=S(e,(i,a)=>{let c=o(e,i,a);if(c===void 0||Qu(c,i)!==void 0||r.some(e=>s(c,e.box,e.outline)))return!1;let l=t=>h(t.label)!==``&&h(t.label)===h(e.label);return n.every(t=>t===e||l(t)||g(y(t),c).total<12)?(t=c,!0):!1});if(i!==void 0&&t!==void 0)return v.set(e.id,t),{wire:e,fix:i}},S=(e,t)=>{for(let n of Ed){for(let r of e.waypoints){let i=m(r,n);if(t(e.waypoints.map(e=>e===r?i:e)))return`move its waypoint at ${b(r)} to ${b(i)}`}if(e.waypoints.length>1){let r=e.waypoints.map(e=>m(e,n));if(t(r))return`move its waypoints to ${r.map(b).join(`, `)}`}if(e.waypoints.length===0){let r=e.points.slice(1,-1).map(e=>m(e,n));if(r.length>0&&t(r))return`add waypoints at ${r.map(b).join(`, `)}: <Array as="points">${r.map(e=>`<mxPoint x="${Math.round(e.x)}" y="${Math.round(e.y)}"/>`).join(``)}</Array> in its geometry`;let i=m(p,n);if(t([i]))return`add a waypoint at ${b(i)}: <Array as="points"><mxPoint x="${Math.round(i.x)}" y="${Math.round(i.y)}"/></Array> in its geometry`}}for(let n of[`exit`,`entry`]){let r=n===`exit`?e.exit:e.entry;if(r===void 0)continue;let i=r.x===0||r.x===1?{axis:`Y`,along:r.y,keep:`${n}X=${r.x}`}:{axis:`X`,along:r.x,keep:`${n}Y=${r.y}`};for(let r of[.25,.75,.125,.375,.625,.875,.5])if(!(Math.abs(r-i.along)<.06)&&t(e.waypoints,{[`${n}${i.axis}`]:r}))return`move its ${n} to ${n}${i.axis}=${r} (keeping ${i.keep})`}},C=x(u)??x(l),w=C?.fix,T=C?.wire??u,E=h(l.label)===``||h(u.label)===``?`they are not labelled as the same data`:`they carry different data`;a(`warning`,[u.id,l.id],`connectors ${i(l.id)} and ${i(u.id)} run along the same line for ${Math.round(d.total)} units from (${Math.round(d.from.x)}, ${Math.round(d.from.y)}), and ${E}: a reader cannot tell them apart. Fix ${i(T.id)}: ${w??`give it another exit or entry point (exitX/exitY, entryX/entryY), or move a shape so their routes part`}`,yd.crossings)}}function kd(e,t){return Ad(pd(e,t))}function Ad(e){let t=[];for(let n of e)bd(n,t);return{pages:e.map(e=>({name:e.name,shapes:e.cells.filter(e=>e.vertex).length,connectors:e.cells.filter(e=>e.edge).length})),issues:t}}var jd=`(?:(?!</mxCell>)[\\s\\S])*?`;function Md(e,t,n){let r=RegExp(`(^|;)${t}=[^;]*`);return r.test(e)?e.replace(r,`$1${t}=${n}`):`${e}${e.endsWith(`;`)||e===``?``:`;`}${t}=${n};`}function Nd(e){let t=new Map,n=(e,n)=>{let r=t.get(e)??{},i=new Set(Object.keys(r));for(let e of n.split(`;`)){let[t,n]=e.split(`=`);t&&n&&!i.has(t)&&(r[t]=n)}t.set(e,r)};for(let t of e){for(let e of t.matchAll(/((?:exit|entry)[XY]=[\d.]+;(?:exit|entry)[XY]=[\d.]+) for "([^"]+)"/g))n(e[2],e[1]);let e=/^connector "([^"]+)".*Fix it: put its (?:entry|exit) level with its (?:exit|entry): ((?:exit|entry)[XY]=[\d.]+)/.exec(t);e&&n(e[1],e[2]);let r=/^connector "([^"]+)".*fix its exit and entry on those sides \(((?:(?:exit|entry)[XY]=[\d.]+;?)+)\)/.exec(t);r&&n(r[1],r[2]);let i=/Fix "([^"]{1,200})"(?: \([^)]{0,80}\))?: move its (?:exit|entry) to ((?:exit|entry)[XY]=[\d.]+) \(keeping ((?:exit|entry)[XY]=[\d.]+)\)/.exec(t);i&&n(i[1],`${i[2]};${i[3]}`);let a=/^connector "([^"]+)".*Fix it: drop exitX\/exitY and entryX\/entryY to let draw\.io choose where/.exec(t);a&&n(a[1],`exitX=none;exitY=none;entryX=none;entryY=none`);let o=/^connector "([^"]+)".*?(?:sides facing each other|side facing it) \(((?:(?:exit|entry)[XY]=[\d.]+;?)+)\)/.exec(t);o&&n(o[1],o[2])}return t}function Pd(e){return e.flatMap(e=>{let t=/Fix "([^"]{1,200})"(?: \([^)]{0,80}\))?: (?:move its waypoints to|add waypoints at) ((?:\(-?\d+, -?\d+\)(?:, )?)+)/.exec(e);return t?[{wire:t[1],points:[...t[2].matchAll(/\((-?\d+), (-?\d+)\)/g)].map(e=>({x:Number(e[1]),y:Number(e[2])}))}]:[]})}function Fd(e,t){let n=e;for(let e of t){let t=e.wire.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=e.points.map(e=>`<mxPoint x="${e.x}" y="${e.y}"/>`).join(``),i=RegExp(`(<mxCell\\b[^>]*\\bid="${t}"[^>]*>\\s*<mxGeometry\\b[^>]*[^/]>${jd}<Array as="points">)[\\s\\S]*?(</Array>)`);n=i.test(n)?n.replace(i,(e,t,n)=>`${t}${r}${n}`):Bd(n,e.wire,r)}return n}function Id(e){return e.flatMap(e=>{let t=/Fix "([^"]{1,200})"(?: \([^)]{0,80}\))?: move its waypoint at/.exec(e)?.[1]??/^connector "([^"]+)"/.exec(e)?.[1];if(t===void 0)return[];let n=/(?:Fix it|Fix "[^"]{1,200}"(?: \([^)]{0,80}\))?): move its waypoint at \((-?\d+), (-?\d+)\) to \((-?\d+), (-?\d+)\)/.exec(e);if(n)return[{wire:t,from:{x:Number(n[1]),y:Number(n[2])},to:{x:Number(n[3]),y:Number(n[4])}}];let r=/Fix it: remove its waypoint at \((-?\d+), (-?\d+)\)/.exec(e);return r?[{wire:t,from:{x:Number(r[1]),y:Number(r[2])},to:null}]:[]})}function Ld(e,t){let n=e;for(let e of t){let t=e.wire.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n=n.replace(RegExp(`(<mxCell\\b[^>]*\\bid="${t}"${jd}<Array as="points">)([\\s\\S]*?)(</Array>)`),(t,n,r,i)=>{let a=r.match(/<mxPoint\b[^>]*\/>/g)?.find(t=>{let n=Number(/\bx="([^"]*)"/.exec(t)?.[1]??0),r=Number(/\by="([^"]*)"/.exec(t)?.[1]??0);return Math.abs(n-e.from.x)<=1&&Math.abs(r-e.from.y)<=1});if(a===void 0)return`${n}${r}${i}`;let o=e.to===null?``:`<mxPoint x="${e.to.x}" y="${e.to.y}"/>`;return`${n}${r.replace(a,o)}${i}`})}return n}function Rd(e){return e.flatMap(e=>{let t=/set x="(-?[\d.]+)"(?: y="(-?[\d.]+)")? in the mxGeometry of "([^"]+)"/.exec(e);return t?[{cell:t[3],x:t[1],...t[2]===void 0?{}:{y:t[2]}}]:[]})}function zd(e,t){let n=e;for(let e of t){let t=e.cell.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n=n.replace(RegExp(`(<mxCell\\b[^>]*\\bid="${t}"[^>]*>\\s*<mxGeometry\\b)([^>]*?)(/?>)`),(t,n,r,i)=>{let a=(e,t,n)=>RegExp(`\\b${t}="[^"]*"`).test(e)?e.replace(RegExp(`\\b${t}="[^"]*"`),`${t}="${n}"`):`${e} ${t}="${n}"`,o=a(r,`x`,e.x);return e.y!==void 0&&(o=a(o,`y`,e.y)),`${n}${o}${i}`})}return n}function Bd(e,t,n){let r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return e.replace(RegExp(`(<mxCell\\b[^>]*\\bid="${r}"[^>]*>\\s*<mxGeometry\\b[^>]*?)(/>|>)`),(e,t,r)=>r===`/>`?`${t}><Array as="points">${n}</Array></mxGeometry>`:`${t}><Array as="points">${n}</Array>`)}function Vd(e){return e.flatMap(e=>{let t=/Fix "([^"]{1,200})"(?: \([^)]{0,80}\))?: add a waypoint at \((-?\d+), (-?\d+)\)/.exec(e);return t?[{wire:t[1],at:{x:Number(t[2]),y:Number(t[3])}}]:[]})}function Hd(e,t){let n=e;for(let e of t){let t=e.wire.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=`<Array as="points"><mxPoint x="${e.at.x}" y="${e.at.y}"/></Array>`;n=n.replace(RegExp(`(<mxCell\\b[^>]*\\bid="${t}"[^>]*>\\s*<mxGeometry\\b[^>]*?)(/>|>)`),(e,t,n)=>n===`/>`?`${t}>${r}</mxGeometry>`:`${t}>${r}`)}return n}function Ud(e){return e.flatMap(e=>{let t=/Fix it: line up the shapes it joins, whose middles are \d+ units apart: move "([^"]{1,200})"(?: \([^)]{0,80}\))? by ([+-]?\d+) on (x|y)/.exec(e);return t?[{shape:t[1],by:Number(t[2]),axis:t[3]}]:[]})}function Wd(e,t){let n=e;for(let e of t){let t=e.shape.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n=n.replace(RegExp(`(<mxCell\\b[^>]*\\bid="${t}"[^>]*>\\s*<mxGeometry\\b[^>]*?\\b${e.axis}=")(-?[\\d.]+)`),(t,n,r)=>`${n}${Number(r)+e.by}`)}return n}function Gd(e){return new Set(e.flatMap(e=>{let t=/^connector "([^"]+)".*(?:Fix it: remove its waypoints|and remove its waypoints)/.exec(e);return t?[t[1]]:[]}))}function Kd(e,t){let n=e;for(let e of t){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n=n.replace(RegExp(`(<mxCell\\b[^>]*\\bid="${t}"${jd})<Array as="points">[\\s\\S]*?</Array>`),`$1`)}return n}function qd(e,t){return e.replace(/<mxCell\b[^>]*>/g,e=>{let n=/\bid="([^"]*)"/.exec(e)?.[1],r=n===void 0?void 0:t.get(n);return r?e.replace(/\bstyle="([^"]*)"/,(e,t)=>{let n=t;for(let[e,t]of Object.entries(r))n=Md(n,e,t);return`style="${n}"`}):e})}var Jd=/at the same point|facing away|runs .* units to join|runs through its (source|target)|needless bend|lies on the label|lies across connector|run along the same line/;function Yd(e,t=12,n,r={}){let i=e,a=new Set,o=r.only??(()=>!0);for(let e=0;;e++){let s=kd(i).issues.map(e=>e.message),c=s.filter(e=>Jd.test(e));n?.(e,c);let l=new Map([...Nd(s)].filter(([e])=>o(e))),u=Id(s).filter(e=>o(e.wire)),d=new Set([...Gd(s)].filter(o)),f=r.moveShapes===!1?[]:Ud(s).filter(e=>o(e.shape)),p=Rd(s).filter(e=>o(e.cell)),m=Vd(s).filter(e=>o(e.wire)),h=Pd(s).filter(e=>o(e.wire));if(l.size===0&&d.size===0&&u.length===0&&f.length===0&&p.length===0&&m.length===0&&h.length===0)return{rounds:e,converged:c.length===0,looped:!1,left:c,xml:i};let g=Fd(Hd(zd(Wd(Ld(Kd(qd(i,l),d),u),f),p),m),h);if(g===i||a.has(g)||e>=t)return{rounds:e,converged:!1,looped:!0,left:c,xml:i};a.add(i),i=g}}var Xd=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/\n/g,`&#10;`),Zd=(e,t)=>t===void 0?``:` ${e}="${Xd(t)}"`;function Qd(e){let t=[`x`,`y`,`width`,`height`].map(t=>e[t]===0?``:` ${t}="${e[t]}"`).join(``),n=[e.points.length===0?``:`<Array as="points">${e.points.map(e=>`<mxPoint x="${e.x}" y="${e.y}"/>`).join(``)}</Array>`,e.offset===void 0?``:`<mxPoint x="${e.offset.x}" y="${e.offset.y}" as="offset"/>`].join(``),r=`<mxGeometry${t}${e.relative?` relative="1"`:``} as="geometry"`;return n===``?`${r}/>`:`${r}>${n}</mxGeometry>`}function $d(e){let t=`${e.vertex?` vertex="1"`:``}${e.edge?` edge="1"`:``}`,n=`<mxCell${Zd(`id`,e.id)}${Zd(`value`,e.label===``?void 0:e.label)}${Zd(`style`,e.style===``?void 0:e.style)}${t}${Zd(`parent`,e.parent)}${Zd(`source`,e.source)}${Zd(`target`,e.target)}`;return e.geometry===void 0?`${n}/>`:`${n}>${Qd(e.geometry)}</mxCell>`}function ef(e){return[`<mxfile host="pi-outpost">`,`<diagram${Zd(`name`,e.name)}>`,`<mxGraphModel><root>`,...e.cells.map($d),`</root></mxGraphModel>`,`</diagram>`,`</mxfile>`,``].join(`
9
+ `)}var tf=`n:`,nf=`r:`,rf=e=>`${tf}${e}`,af=e=>`${nf}${e}`,of=e=>({...e,relative:!1,unreadable:[],sourcePoint:!1,targetPoint:!1,points:[]});function sf(e){let t=(e,t)=>t===void 0?``:`${e}X=${t.x};${e}Y=${t.y};`;return`edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;${t(`exit`,e?.exit)}${t(`entry`,e?.entry)}`}function cf(e,t,n=new Map){let r=[{id:`0`,parent:void 0,vertex:!1,edge:!1,source:void 0,target:void 0,label:``,style:``,geometry:void 0},{id:`1`,parent:`0`,vertex:!1,edge:!1,source:void 0,target:void 0,label:``,style:``,geometry:void 0}];for(let[t,i]of e)r.push({id:rf(t),parent:`1`,vertex:!0,edge:!1,source:void 0,target:void 0,label:n.get(t)??t,style:`rounded=0;whiteSpace=wrap;html=1;`,geometry:of(i)});for(let n of t){if(!e.has(n.from)||!e.has(n.to))continue;let t=n.ends,i={...of({x:t?.label?.along??0,y:t?.label?.across??0,width:0,height:0}),relative:!0,points:(t?.waypoints??[]).map(e=>({...e}))};t?.label!==void 0&&(t.label.offset.x!==0||t.label.offset.y!==0)&&(i.offset={...t.label.offset}),r.push({id:af(n.index),parent:`1`,vertex:!1,edge:!0,source:rf(n.from),target:rf(n.to),label:n.label,style:sf(t),geometry:i})}return{name:`Figure`,cells:r}}function lf(e){let t=Cu(e),n=new Map;for(let r of e.cells){if(!r.edge||r.id===void 0||!r.id.startsWith(nf)||r.source===r.target)continue;let e=wu(r,t);if(e===void 0)continue;let i=Tu(e,{x:r.geometry?.x??0,y:r.geometry?.y??0},r.geometry?.offset);n.set(Number(r.id.slice(2)),{points:e.points,labelAt:i,span:xf(e.points,i)})}return n}var uf=.5;function df(e){let t=[];for(let n of e){let e=t[t.length-1];t.push(e===void 0?{x:ff(n.x),y:ff(n.y)}:{x:Math.abs(n.x-e.x)<uf?e.x:ff(n.x),y:Math.abs(n.y-e.y)<uf?e.y:ff(n.y)})}return t.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `)}var ff=e=>Math.round(e*100)/100,pf=10;function mf(e,t){let n=new Map;for(let e of t){if(e.from===e.to)continue;let t=JSON.stringify([e.from,e.to].sort());n.set(t,[...n.get(t)??[],e])}let r=new Map;for(let t of n.values()){if(t.length<2)continue;let n=e.get(t[0].from),i=e.get(t[0].to);if(n===void 0||i===void 0)continue;let a=gf(n,i)?Math.min(n.height,i.height):Math.min(n.width,i.width),o=Math.max(1,Math.min(t.length,Math.floor(a/pf)-1)),s=t.length-o;t.forEach((t,n)=>{let i=e.get(t.from),a=e.get(t.to);if(i===void 0||a===void 0)return;if(n<o){let e=hf((n+1)/(o+1));r.set(t.index,{exit:_f(i,a,e),entry:_f(a,i,e)});return}let c=n-o,l=c%2==1,u=Math.floor(c/2)+1,d=hf(u/(Math.ceil(s/2)+1)),f=gf(i,a),p=f?{x:d,y:+!!l}:{x:+!!l,y:d},m=20*u,h=f?[i,a].map(e=>({x:Math.round(e.x+e.width*d),y:l?Math.max(i.y+i.height,a.y+a.height)+m:Math.min(i.y,a.y)-m})):[i,a].map(e=>({x:l?Math.max(i.x+i.width,a.x+a.width)+m:Math.min(i.x,a.x)-m,y:Math.round(e.y+e.height*d)}));r.set(t.index,{exit:p,entry:{...p},waypoints:h})})}return r}var hf=e=>Math.round(e*1e4)/1e4;function gf(e,t){return Math.abs(t.x+t.width/2-(e.x+e.width/2))>=Math.abs(t.y+t.height/2-(e.y+e.height/2))}function _f(e,t,n){let r=t.x+t.width/2-(e.x+e.width/2),i=t.y+t.height/2-(e.y+e.height/2);return Math.abs(r)>=Math.abs(i)?{x:+(r>=0),y:n}:{x:n,y:+(i>=0)}}function vf(e,t,n){for(let[r,i]of t)if(!n.includes(r)){for(let t=1;t<e.length;t++)if(Du(e[t-1],e[t],i,`box`,2)>0)return!0}return!1}function yf(e,t,n){let r=lf(cf(e,t)),i=new Map;for(let a of t){let t=r.get(a.index),o=n.get(a.index);if(t===void 0||o===void 0||o.length<3||!vf(t.points,e,[a.from,a.to]))continue;let s=o.slice(1,-1).map(e=>({x:Math.round(e.x),y:Math.round(e.y)}));i.set(a.index,s)}return i}function bf(e,t){if(t.size===0)return e;let n=new Set([...t].map(af)),[r]=pd(Yd(ef(e),12,void 0,{only:e=>n.has(e),moveShapes:!1}).xml);return r===void 0?e:{...r,name:e.name}}function xf(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n],a=Math.min(r.x,i.x)-1<=t.x&&t.x<=Math.max(r.x,i.x)+1,o=Math.min(r.y,i.y)-1<=t.y&&t.y<=Math.max(r.y,i.y)+1;if(a&&o)return Math.abs(r.y-i.y)<uf?Math.abs(i.x-r.x):Math.abs(i.y-r.y)>=28?1/0:0}return 0}function Sf(e,t,n){let r=t.y>=e.y+e.height,i=t.y+t.height<=e.y,a=t.x>=e.x+e.width,o=t.x+t.width<=e.x;return n?r?`bottom`:i?`top`:t.x+t.width/2>=e.x+e.width/2?`right`:`left`:a?`right`:o?`left`:t.y+t.height/2>=e.y+e.height/2?`bottom`:`top`}var Cf=(e,t)=>e===`top`?{x:t,y:0}:e===`bottom`?{x:t,y:1}:e===`left`?{x:0,y:t}:{x:1,y:t};function wf(e,t,n){let r=new Map,i=t.filter(e=>e.ends===void 0&&e.from!==e.to);for(let t of i){let i=e.get(t.from),a=e.get(t.to);if(i!==void 0&&a!==void 0)for(let[e,o,s,c]of[[`exit`,i,a,t.from],[`entry`,a,i,t.to]]){let i=Sf(o,s,n),a=`${c}\u0000${i}`;r.set(a,[...r.get(a)??[],{relationship:t,role:e,side:i,other:s}])}}let a=new Map,o=new Set;for(let e of r.values()){let t=e=>e.side===`top`||e.side===`bottom`?e.other.x+e.other.width/2:e.other.y+e.other.height/2,n=[...e].sort((e,n)=>t(e)-t(n)||e.relationship.index-n.relationship.index||(e.role===`exit`?-1:1));n.forEach((e,t)=>a.set(`${e.relationship.index}:${e.role}`,Cf(e.side,hf((t+1)/(n.length+1))))),n.length===1&&o.add(`${n[0].relationship.index}:${n[0].role}`)}let s=new Map;for(let t of i){let n=a.get(`${t.index}:exit`),r=a.get(`${t.index}:entry`);if(n===void 0||r===void 0)continue;let i=e.get(t.from),c=e.get(t.to);if(o.has(`${t.index}:exit`)&&o.has(`${t.index}:entry`)){let e=Tf(i,c,n,r);if(e!==void 0){s.set(t.index,e);continue}}s.set(t.index,{exit:n,entry:r})}return s}function Tf(e,t,n,r){let i=(n.y===0||n.y===1)&&(r.y===0||r.y===1)&&n.y!==r.y,a=(n.x===0||n.x===1)&&(r.x===0||r.x===1)&&n.x!==r.x;if(!i&&!a)return;let o=i?Math.max(e.x,t.x):Math.max(e.y,t.y),s=i?Math.min(e.x+e.width,t.x+t.width):Math.min(e.y+e.height,t.y+t.height);if(s-o<2)return;let c=Math.round((o+s)/2),l=e=>hf(i?(c-e.x)/e.width:(c-e.y)/e.height);return i?{exit:{x:l(e),y:n.y},entry:{x:l(t),y:r.y}}:{exit:{x:n.x,y:l(e)},entry:{x:r.x,y:l(t)}}}function Ef(e,t){let n=lf(e);return{...e,cells:e.cells.map(e=>{if(!e.edge||e.id===void 0||!e.id.startsWith(nf)||e.geometry===void 0)return e;let r=Number(e.id.slice(2)),i=n.get(r);if(!t.has(r)||i===void 0||i.points.length<3)return e;let a=i.points.slice(1).map((e,t)=>Math.hypot(e.x-i.points[t].x,e.y-i.points[t].y)),o=a.reduce((e,t)=>e+t,0);if(o===0)return e;let s=a.indexOf(Math.max(...a)),c=a.slice(0,s).reduce((e,t)=>e+t,0)+a[s]/2;return{...e,geometry:{...e.geometry,x:hf((c/o-.5)*2)}}})}}var Df=4;function Of(e,t){return t!==void 0&&e.nodes.some(e=>t.elements[El(e)]!==void 0)}var kf=(e,t,n)=>e.x<t.x+t.width+n&&t.x<e.x+e.width+n&&e.y<t.y+t.height+n&&t.y<e.y+e.height+n;function Af(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,El(e)])),a=new Map,o=[];for(let r of e.nodes){let e=t.elements[i.get(r.id)];if(e===void 0)continue;let{width:s,height:c}=n(r);a.set(r.id,{id:r.id,x:e.x,y:e.y,width:s,height:c}),o.push(r.id)}let s=new Set(i.values()),c=Object.keys(t.elements).filter(e=>!s.has(e)).sort(),l=new Map;for(let t of e.edges)t.from!==t.to&&(l.set(t.from,[...l.get(t.from)??[],t.to]),l.set(t.to,[...l.get(t.to)??[],t.from]));let u=r===`landscape`,d=e=>[...a.values()].every(t=>!kf(e,t,24)),f=[],p=[],m=e.nodes.filter(e=>!a.has(e.id));for(;m.length>0;){let e=Math.max(0,m.findIndex(e=>(l.get(e.id)??[]).some(e=>a.has(e)))),t=m.splice(e,1)[0],{width:r,height:i}=n(t),s=(e,n)=>({id:t.id,...Nl({x:e,y:n}),width:r,height:i}),c=(l.get(t.id)??[]).map(e=>a.get(e)).filter(e=>e!==void 0)[0],h;if(c===void 0){let e=[...a.values()];h=e.length===0?s(24,24):u?s(Math.max(...e.map(e=>e.x+e.width))+64,Math.min(...e.map(e=>e.y))):s(Math.min(...e.map(e=>e.x)),Math.max(...e.map(e=>e.y+e.height))+64)}else{let e=u?{dx:c.width+64,dy:0}:{dx:0,dy:c.height+64},t=u?{dx:-(r+64),dy:0}:{dx:0,dy:-(i+64)},n=u?{dx:0,dy:c.height+24}:{dx:c.width+24,dy:0},l=u?i+24:r+24,f=[];for(let r=0;r<=Df;r++){for(let n of[e,t]){let e=r*l;for(let t of r===0?[0]:[1,-1])f.push(u?s(c.x+n.dx,c.y+t*e):s(c.x+t*e,c.y+n.dy))}for(let e of[1,-1]){let t=r+1;f.push(u?s(c.x,c.y+e*t*n.dy):s(c.x+e*t*n.dx,c.y))}}if(h=f.find(d),h===void 0){let t=s(c.x+e.dx,c.y+e.dy);h=t;let n=[...a.values()].filter(e=>u?e.x+e.width+24>t.x:e.y+e.height+24>t.y).sort((e,t)=>e.id.localeCompare(t.id)),l=Math.min(...n.map(e=>u?e.x:e.y)),d=Math.max(0,(u?t.x+r:t.y+i)+64-l);for(let e of n){if(d===0)break;o.includes(e.id)&&p.push({id:e.id,from:{x:e.x,y:e.y}}),u?e.x+=d:e.y+=d}}}a.set(t.id,h),f.push(t.id)}return{boxes:e.nodes.map(e=>a.get(e.id)),arranged:o,placed:f,shifted:p,gone:c}}function jf(e,t,n){let r={...n===void 0?{}:{orientation:n},elements:{},relationships:{}},i=new Map(t.cells.filter(e=>e.id!==void 0).map(e=>[e.id,e]));for(let t of e.nodes){let e=i.get(rf(t.id))?.geometry;e!==void 0&&(r.elements[El(t)]=Nl({x:e.x,y:e.y}))}return Dl(e).forEach((e,t)=>{let n=i.get(af(t));if(n===void 0||n.geometry===void 0)return;let a=Bl(n.style,!0),o=e=>{let t=Number(a[`${e}X`]),n=Number(a[`${e}Y`]);return a[`${e}X`]===void 0||a[`${e}Y`]===void 0||!Number.isFinite(t)||!Number.isFinite(n)?void 0:{x:t,y:n}},s={},c=o(`exit`),l=o(`entry`);c!==void 0&&(s.exit=c),l!==void 0&&(s.entry=l),n.geometry.points.length>0&&(s.waypoints=n.geometry.points.map(e=>({x:Math.round(e.x),y:Math.round(e.y)})));let u=n.geometry.offset??{x:0,y:0};(n.geometry.x!==0||n.geometry.y!==0||u.x!==0||u.y!==0)&&(s.label={along:n.geometry.x,...n.geometry.y===0?{}:{across:n.geometry.y},offset:{x:u.x,y:u.y}}),r.relationships[e]=s}),r}function Mf(e,t,n,r,i,a){let o=jf(e,t,a),s={orientation:a,elements:{...n?.elements,...o.elements},relationships:{...n?.relationships,...o.relationships}},c=e.nodes.find(e=>e.id===r);return c===void 0||(s.elements[El(c)]=Nl(i),Dl(e).forEach((t,n)=>{let i=e.edges[n];(i.from===r||i.to===r)&&delete s.relationships[t]})),s}var Nf=`#ffffff`,Pf=`#27272a`,Ff=`#71717a`,If={added:{fill:`#ecfdf5`,stroke:`#059669`,text:`#065f46`},changed:{fill:`#fffbeb`,stroke:`#d97706`,text:`#92400e`},context:{fill:`#fafafa`,stroke:`#d4d4d8`,text:`#71717a`},unchanged:{fill:`#ffffff`,stroke:`#a1a1aa`,text:Pf}},Lf={added:`#059669`,changed:`#d97706`,context:`#d4d4d8`,unchanged:`#a1a1aa`},Rf=[`added`,`changed`,`context`,`unchanged`],zf=[{fill:`#eff6ff`,stroke:`#2563eb`},{fill:`#f5f3ff`,stroke:`#7c3aed`},{fill:`#ecfeff`,stroke:`#0891b2`},{fill:`#fff1f2`,stroke:`#e11d48`},{fill:`#f7fee7`,stroke:`#65a30d`},{fill:`#fff7ed`,stroke:`#ea580c`},{fill:`#f0fdfa`,stroke:`#0d9488`},{fill:`#fdf4ff`,stroke:`#c026d3`},{fill:`#fefce8`,stroke:`#ca8a04`},{fill:`#f8fafc`,stroke:`#475569`},{fill:`#eef2ff`,stroke:`#4f46e5`},{fill:`#fef2f2`,stroke:`#b91c1c`},{fill:`#f0fdf4`,stroke:`#16a34a`},{fill:`#fdf2f8`,stroke:`#db2777`},{fill:`#f5f5f4`,stroke:`#78716c`},{fill:`#f0f9ff`,stroke:`#0369a1`}],Bf=[void 0,`7 3`,`2 3`,`9 3 2 3`],Vf=zf.length*Bf.length;function Hf(e,t=.88){let n=n=>{let r=Number.parseInt(e.slice(1+n*2,3+n*2),16);return Math.round(r+(255-r)*t).toString(16).padStart(2,`0`)};return`#${n(0)}${n(1)}${n(2)}`}function Uf(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t}zf.length;function Wf(e,t,n={}){let r=n.dashes===!1,i=Vf,a=new Map,o=new Set,s=e=>t!==void 0&&Object.hasOwn(t,e)?t[e].color:void 0,c=new Set;for(let t of e){let e=s(t);e!==void 0&&(a.set(t,{fill:Hf(e),stroke:e,declared:!0}),c.add(e.toLowerCase()))}for(let e=0;e<i;e++)c.has(zf[e%zf.length].stroke.toLowerCase())&&o.add(e);for(let t of e){if(a.has(t))continue;let e;if(r){e=-1;let n=Uf(t)%zf.length;for(let t=0;t<zf.length&&e===-1;t++){let r=(n+t)%zf.length;o.has(r)||(e=r)}for(let t=zf.length;t<Vf&&e===-1;t++){let r=zf.length+(n+t)%(Vf-zf.length);o.has(r)||(e=r)}e===-1&&(e=n)}else{e=Uf(t)%i;for(let t=0;t<i&&o.has(e);t++)e=(e+1)%i}o.add(e);let n=zf[e%zf.length],s=Math.floor(e/zf.length)%Bf.length;if(r)a.set(t,{...n,...s===0?{}:{hatch:s}});else{let e=Bf[s];a.set(t,{...n,...e===void 0?{}:{dash:e}})}}return a}function Gf(e,t){let n=new Map;for(let r of e){let e=t.get(r);if(e?.declared!==!0)continue;let i=e.stroke.toLowerCase();n.set(i,[...n.get(i)??[],r])}let r=new Map;for(let e of n.values())if(!(e.length<2))for(let t of e)r.set(t,e.filter(e=>e!==t));return r}function Kf(e){let t=[];for(let n of e)n.kind!==void 0&&n.kind!==``&&!t.includes(n.kind)&&t.push(n.kind);return t}var qf=`system-ui, Segoe UI, Arial, Helvetica, sans-serif`;function Jf(e){let t=If[e.role],n={fill:e.tint?.fill??t.fill,stroke:e.role===`unchanged`?e.tint?.stroke??t.stroke:t.stroke,text:t.text===`#71717a`?Ff:Pf},r=e.role===`added`||e.role===`changed`?2:1.2,i=e.role===`context`?.62:1,a=e.anchor??`start`,o=De(e.label,e.width),s=ke(e.changes,e.width),c=o.length+s.length,l=e.y+e.height/2-(c-1)*15/2+4,u=a===`middle`?e.x+e.width/2:e.x+8,d=[{shape:`rect`,x:e.x,y:e.y,width:e.width,height:e.height,rx:5,fill:n.fill,stroke:n.stroke,strokeWidth:r,...e.tint?.dash===void 0?{}:{strokeDasharray:e.tint.dash},opacity:i}];return o.forEach((e,t)=>{d.push({shape:`text`,x:u,y:l+t*15,text:e,fontSize:11,fill:n.text,fontFamily:qf,textAnchor:a,opacity:i})}),s.forEach((e,t)=>{d.push({shape:`text`,x:u,y:l+(o.length+t)*15,text:e,fontSize:9,fontWeight:600,fill:n.text,fontFamily:qf,textAnchor:a,opacity:i,testId:`field-changes`})}),d}function Yf(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Xf(e){return Yf(e).replace(/"/g,`&quot;`)}function Zf(e){return e.filter(([,e])=>e!==void 0).map(([e,t])=>` ${e}="${Xf(String(t))}"`).join(``)}function Qf(e){let t=Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]);switch(e.shape){case`rect`:return`<rect${Zf([[`x`,e.x],[`y`,e.y],[`width`,e.width],[`height`,e.height],[`rx`,e.rx],[`fill`,e.fill],[`fill-opacity`,e.fillOpacity],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`opacity`,e.opacity],...t])} />`;case`text`:{let n=`${Yf(e.text)}${e.note===void 0?``:` <tspan font-style="italic">${Yf(e.note)}</tspan>`}`,r=[[`x`,e.x],[`y`,e.y],[`font-size`,e.fontSize],[`font-family`,e.fontFamily],[`font-weight`,e.fontWeight],[`font-style`,e.fontStyle],[`text-anchor`,e.textAnchor]],i=`<text${Zf([...r,[`fill`,e.fill],...e.paintOrder===`stroke`?[]:[[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth]],[`text-decoration`,e.textDecoration],[`opacity`,e.opacity],[`data-testid`,e.testId],...t])}>${n}</text>`;return e.paintOrder===`stroke`?`<text${Zf([...r,[`fill`,e.stroke],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`opacity`,e.opacity],[`aria-hidden`,`true`]])}>${n}</text>${i}`:i}case`line`:return`<line${Zf([[`x1`,e.x1],[`y1`,e.y1],[`x2`,e.x2],[`y2`,e.y2],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`opacity`,e.opacity],[`marker-end`,e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`],...t])} />`;case`path`:return`<path${Zf([[`d`,e.d],[`stroke`,e.stroke],[`fill`,e.fill??`none`],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`stroke-linecap`,e.strokeLinecap],[`opacity`,e.opacity],[`marker-end`,e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`],...t])} />`}}function $f(e){return`<marker id="${Xf(e.id)}" markerWidth="7" markerHeight="7" refX="9" refY="5" viewBox="0 0 10 10" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="${Xf(e.paint)}" /></marker>`}function ep(e){let t=e=>{let n=Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]),r=e.title===void 0?``:`<title>${Yf(e.title)}</title>`,i=[[`opacity`,e.opacity],[`data-testid`,e.testId]];return`<g${Zf([...n,...i])}>${r}`+e.primitives.map(Qf).join(``)+(e.groups??[]).map(t).join(``)+`</g>`},n=e.groups.map(t).join(``),r=e.markers.length===0?``:`<defs>${e.markers.map($f).join(``)}</defs>`;return`<svg xmlns="http://www.w3.org/2000/svg" role="img"`+Zf([[`aria-label`,e.ariaLabel],[`viewBox`,e.viewBox],[`width`,e.width],[`height`,e.height]])+`><rect${Zf([[`x`,e.viewBox.split(` `)[0]],[`y`,e.viewBox.split(` `)[1]],[`width`,e.width],[`height`,e.height],[`fill`,e.background]])} />`+r+n+`</svg>`}var tp=17,np=18,rp=92,ip=860;function ap(e){return Math.min(e,ip)}function op(e){return 21+(e.length+9)*5.6+np}function sp(e,t){let n=ap(t),r=1,i=0;for(let t of e.entries){let e=op(t.label);i>0&&rp+i+e>n-20&&(r+=1,i=0),i+=e}return r}function cp(e){let t=e.flatMap(e=>e.entries).reduce((e,t)=>Math.max(e,op(t.label)),0);return t===0?0:Math.min(rp+t+32,ip)}function lp(e,t){let n=e.filter(e=>e.entries.length>0);return n.length===0?0:n.reduce((e,n)=>e+sp(n,t),0)*tp+12}function up(e,t,n,r){let i=e.filter(e=>e.entries.length>0);if(i.length===0)return[];let a=ap(r),o=[],s=0;for(let e of i){let r=s,i=0,c=[];for(let r of e.entries){let o=op(r.label);i>0&&rp+i+o>a-20&&(s+=1,i=0);let l=t+rp+i,u=n+s*tp;i+=o;let d=e.sample===`line`?{shape:`line`,x1:l,y1:u+5,x2:l+16,y2:u+5,stroke:r.stroke,strokeWidth:1.6,...r.dashed===void 0?{}:{strokeDasharray:r.dashed}}:{shape:`rect`,x:l,y:u,width:16,height:10,rx:2,fill:r.fill,stroke:r.stroke,strokeWidth:1.2,...r.dashed===void 0?{}:{strokeDasharray:r.dashed}};c.push({id:`legend-${r.key??r.label}`,...r.projectColour===!0?{title:`${r.label} — project colour`}:{},data:{"legend-entry":r.key??r.label,...r.projectColour===!0?{"colour-source":`project`}:{},...r.toggles===!0&&r.key!==void 0?{toggles:`true`}:{},...r.faded===!0?{faded:`true`}:{},...r.hidden===!0?{hidden:`true`}:{}},opacity:r.hidden===!0?.45:r.faded===!0?.62:1,primitives:[d,{shape:`text`,x:l+21,y:u+9,text:r.hidden===!0?`${r.label} (hidden)`:r.label,fontSize:9,fill:Ff,fontFamily:qf}]})}o.push({id:`legend-title-${e.title}`,primitives:[{shape:`text`,x:t,y:n+r*tp+9,text:e.title,fontSize:9,fontWeight:600,fill:Ff,fontFamily:qf,testId:`legend-group`}]}),o.push(...c),s+=1}return[{id:`diagram-legend`,testId:`diagram-legend`,primitives:[],groups:o}]}var dp=12,fp=5.2;function pp(e,t){let n=Math.max(Math.floor((t-24)/fp),20),r=[],i=``;for(let t of e.split(/\s+/).filter(e=>e!==``))for(i===``?i=t:i.length+1+t.length<=n?i=`${i} ${t}`:(r.push(i),i=t);i.length>n;)r.push(i.slice(0,n)),i=i.slice(n);return i!==``&&r.push(i),r}function mp(e){let t=e.length;for(;t>0&&(e[t-1]===`.`||/\s/.test(e[t-1]));)--t;return e.slice(0,t)}function hp(e,t,n,r,i){let a=`${t.nodes.length} of ${e.nodes.length} elements and ${t.edges.length} of ${e.edges.length} relationships shown.`+(r?` Hidden types are still part of the proposal.`:``);if(i===void 0)return n.size===0?void 0:`Filtered view: ${a}`;let o=!sl(n,ol(e,i));return`Viewpoint: ${i.label} — ${mp(i.concern)}`+(o?` (adjusted).`:`.`)+(n.size===0?``:` ${a}`)}function gp(e,t){return`${e}-${t.replace(`#`,``)}`}function _p(e){let t=Ee([Zc(e)],jc(e),120,260);return{width:t,height:Oe(De(Zc(e),t).length,ke(jc(e),t).length)}}function vp(e,t){let n=e.nodes.filter(e=>!il(t,`element`,e.kind)),r=new Set(n.map(e=>e.id));return{nodes:n,edges:e.edges.filter(e=>!il(t,`relationship`,e.kind)&&r.has(e.from)&&r.has(e.to)),containers:e.containers}}function yp(e,t,n){return{label:n===void 0?e:`${e} (same colour as ${n.join(`, `)})`,fill:t.fill,stroke:t.stroke,...t.dash===void 0?{}:{dashed:t.dash},...t.declared===!0?{projectColour:!0}:{}}}function bp(e,t){if(t!==void 0)return{layout:Kc(e,_p,t),orientation:t};let n=Kc(e,_p,`landscape`);if(n.width<=710)return{layout:n,orientation:`landscape`};let r=Kc(e,_p,`portrait`);return h(n.width,r.width)===`portrait`?{layout:r,orientation:`portrait`}:{layout:n,orientation:`landscape`}}function xp(e,t=rl){return bp(vp(e,t),void 0).orientation}function Sp(e,t,n,r,i){let a=new Map,o=new Map;for(let e of t.nodes){let t=n(e.id);t!==void 0&&a.set(e.id,{x:t.x,y:t.y,width:t.w,height:t.h})}for(let t of e.nodes)o.set(t.id,Zc(t));let s=e.edges.map((e,t)=>({index:t,from:e.from,to:e.to,label:e.label??e.kind??``})),c=mf(a,s),l=Dl(e),u=new Map;l.forEach((e,t)=>{let n=r?.relationships[e];n!==void 0&&u.set(t,n)});let d=s.map(e=>({...e,ends:u.get(e.index)??c.get(e.index)})),f=wf(a,d,i===`portrait`),p=d.map(e=>({...e,ends:e.ends??f.get(e.index)})),m=new Map(t.edges.map(e=>[e.index,e.points])),h=yf(a,p.filter(e=>!u.has(e.index)),m),g=cf(a,p.map(e=>{let t=h.get(e.index);return t===void 0?e:{...e,ends:{...e.ends,waypoints:t}}}),o),_=new Set(s.filter(e=>!u.has(e.index)&&c.get(e.index)?.waypoints===void 0).map(e=>e.index)),v=bf(Ef(g,_),_);return{page:v,wires:lf(v)}}function Cp(e,t={}){let n=vp(e,t.hidden??rl),{layout:r,orientation:i,placement:a}=wp(n,t.orientation,t.arrangement),o=new Map(r.nodes.map(e=>[e.id,e]));return{shown:n,page:Sp(n,r,e=>{let t=o.get(e);return t===void 0?void 0:{x:t.x,y:t.y,cx:t.x+t.width/2,cy:t.y+t.height/2,w:t.width,h:t.height}},t.arrangement,i).page,orientation:i,...a===void 0?{}:{placement:a}}}function wp(e,t,n){let r=t??n?.orientation;if(n===void 0||!Of(e,n)){let t=bp(e,r),n=t.layout.nodes.map(e=>({...e,...Nl({x:e.x,y:e.y})}));return{...t,layout:{...t.layout,nodes:n}}}let i=r??`landscape`,a=Af(e,n,_p,i),o=a.boxes.map(e=>({...e})),s=new Map(o.map(e=>[e.id,e])),c=[],l=Math.max(0,...o.map(e=>e.y+e.height))+16;for(let t of e.containers??[]){let n=Lc(e.nodes.filter(e=>e.container===t.id).flatMap(e=>{let t=s.get(e.id);return t===void 0?[]:[t]}));n===void 0?(c.push({id:t.id,label:t.label,x:12,y:l,width:160,height:52}),l+=68):c.push({id:t.id,label:t.label,...n})}let u=Math.max(0,...o.map(e=>e.x+e.width),...c.map(e=>e.x+e.width)),d=Math.max(0,...o.map(e=>e.y+e.height),...c.map(e=>e.y+e.height));return{layout:{nodes:o,edges:[],containers:c,width:u+12,height:d+12},orientation:i,placement:a}}function Tp(e,t){let n=t.hidden??rl,r=t.nudges??new Map,i=t.isProposal,a=vp(e,n),{layout:o,orientation:s,placement:c}=wp(a,t.orientation,t.arrangement),l=new Map(o.nodes.map(e=>[e.id,e])),u=e=>{let t=l.get(e);if(t===void 0)return;let n=r.get(e),i=t.x+(n?.dx??0),a=t.y+(n?.dy??0);return{x:i,y:a,cx:i+t.width/2,cy:a+t.height/2,w:t.width,h:t.height}},d=o.containers.map(e=>{let t=Lc(a.nodes.filter(t=>t.container===e.id).flatMap(e=>{let t=u(e.id);return t===void 0?[]:[{x:t.x,y:t.y,width:t.w,height:t.h}]}));return t===void 0?e:{...e,...t}}),f=Wf(Kf(e.nodes),t.appearance?.kinds),p=Wf(Kf(e.edges),t.appearance?.relationshipKinds),m=Gf(Kf(e.nodes),f),h=Gf(Kf(e.edges),p),g=e=>t=>({...yp(t,(e===`element`?f:p).get(t),(e===`element`?m:h).get(t)),toggles:!0,key:nl(e,t),hidden:n.has(nl(e,t))}),_=[{title:`elements`,sample:`box`,entries:Kf(e.nodes).map(g(`element`))},{title:`relationships`,sample:`line`,entries:Kf(e.edges).map(g(`relationship`))}];if(i){let e=new Set([...a.nodes.map(e=>Oc(e,!0)),...a.edges.map(e=>Ac(e,!0))]);_.push({title:`changes`,sample:`box`,entries:Rf.filter(t=>t!==`unchanged`&&e.has(t)).map(e=>({label:Mc[e],fill:Nf,stroke:If[e].stroke,faded:e===`context`}))})}let v=new Map,y=new Map;for(let e of a.edges){let t=JSON.stringify([e.from,e.to]),n=y.get(t)??0;v.set(e,n),y.set(t,n+1)}let{wires:b}=Sp(a,o,u,t.arrangement,s),x=a.edges.map((e,t)=>{let n=u(e.from),r=u(e.to);if(n===void 0||r===void 0)return;let i=b.get(t);return i===void 0?ml(n,e.from===e.to?n:r,void 0,v.get(e)??0):{d:df(i.points),labelAt:i.labelAt,span:i.span}}),S=o.nodes.map(e=>u(e.id)),C=x.flatMap(e=>{let t=e===void 0?void 0:hl(e.d);return t===void 0?[]:[t]}),w=(r.size>0||c!==void 0)&&S.length>0,T=d.map(e=>({x:e.x,y:e.y,w:e.width,h:e.height})),E=e=>w?[]:[e],ee=Math.min(...E(0),...S.map(e=>e.x-12),...T.map(e=>e.x-12),...C.map(e=>e.minX-12)),D=Math.min(...E(0),...S.map(e=>e.y-12),...T.map(e=>e.y-14),...C.map(e=>e.minY-14)),te=Math.max(...E(o.width),...S.map(e=>e.x+e.w+12),...T.map(e=>e.x+e.w+12),...C.map(e=>e.maxX+12)),ne=Math.max(...E(o.height),...S.map(e=>e.y+e.h+12),...T.map(e=>e.y+e.h+12),...C.map(e=>e.maxY+12)),re=e=>{let t=Ac(e,i),n=e.kind===void 0?void 0:p.get(e.kind);return{role:t,stroke:n?.stroke??Lf.unchanged,dash:n?.dash,halo:t===`added`||t===`changed`?Lf[t]:void 0,width:t===`context`?1:t===`unchanged`?1.5:1.8,opacity:t===`context`?.6:1}},ie=[...new Set(a.edges.map(e=>re(e).stroke))],ae=ne+4,oe=Math.max(te-ee,cp(_)),se=hp(e,a,n,i,t.viewpoint),ce=t.viewpoint===void 0||se===void 0?0:pp(se,oe).length*dp+4,le=ne-D+lp(_,oe)+ce,ue=[];for(let e of d)ue.push({id:`container-${e.id}`,data:{container:e.id},primitives:[{shape:`rect`,x:e.x,y:e.y,width:e.width,height:e.height,rx:8,fill:`none`,stroke:Ff,strokeDasharray:`5 3`,opacity:.55},{shape:`text`,x:e.x+8,y:e.y+12,text:e.label,fontSize:10,fill:Ff}]});a.edges.forEach((t,n)=>{let r=u(t.from),i=u(t.to),a=x[n];if(r===void 0||i===void 0||a===void 0)return;let o=re(t),s=o.stroke,c=jc(t),l=t.label??t.kind,d=e=>e.length*5.2+8<=a.span,f=[];o.halo!==void 0&&f.push({shape:`path`,data:{edge:`role`},d:a.d,fill:`none`,stroke:o.halo,strokeWidth:o.width+4,strokeLinecap:`round`,opacity:.3}),f.push({shape:`path`,data:{edge:`line`},d:a.d,fill:`none`,stroke:s,strokeWidth:o.width,...o.dash===void 0?{}:{strokeDasharray:o.dash},opacity:o.opacity,markerEnd:gp(`se-arrow`,s)}),l!==void 0&&d(l)&&f.push({shape:`text`,x:a.labelAt.x,y:a.labelAt.y-5,text:l,textAnchor:`middle`,fontSize:9,fill:s,fontFamily:qf,stroke:Nf,strokeWidth:3,paintOrder:`stroke`});let p=c.map(Ae).join(`, `);c.length>0&&d(p)&&f.push({shape:`text`,x:a.labelAt.x,y:a.labelAt.y+10,text:p,textAnchor:`middle`,fontSize:9,fontWeight:600,fill:s,fontFamily:qf,stroke:Nf,strokeWidth:3,paintOrder:`stroke`,testId:`relationship-change`}),ue.push({id:`edge-${n}`,data:{"relationship-role":o.role,"relationship-shape":t.from===t.to?`loop`:`open`},title:_l(e,t,o.role),primitives:f})});for(let e of a.nodes){let t=u(e.id);if(t===void 0)continue;let n=Oc(e,i);ue.push({id:e.id,data:{"element-role":n,"element-id":e.id,draggable:`node`},title:dl(e,n),primitives:Jf({x:t.x,y:t.y,width:t.w,height:t.h,role:n,label:Zc(e),...e.kind===void 0?{}:{tint:f.get(e.kind)},changes:jc(e)})})}let de=t.viewpoint,O=se;if(O!==void 0&&de!==void 0){let e=pp(O,oe);ue.push({id:`filter-note`,testId:`diagram-filter-note`,data:{viewpoint:de.id},primitives:e.map((t,n)=>({shape:`text`,x:ee+12,y:ae+lp(_,oe)+dp*n+dp-4,text:n<e.length-1?`${t} `:t,fontSize:9,fontWeight:600,fill:`#92400e`,fontFamily:qf}))})}else O!==void 0&&ue.push({id:`filter-note`,primitives:[{shape:`text`,x:ee+12,y:ae+lp(_,oe)-4,text:O,fontSize:9,fontWeight:600,fill:`#92400e`,fontFamily:qf,testId:`diagram-filter-note`}]});return ue.push(...up(_,ee+12,ae,oe)),{width:oe,height:le,viewBox:`${ee} ${D} ${oe} ${le}`,ariaLabel:a.nodes.length===e.nodes.length&&a.edges.length===e.edges.length?`Graph of ${e.nodes.length} elements and ${e.edges.length} relationships`:`Graph of ${e.nodes.length} elements and ${e.edges.length} relationships, filtered to ${a.nodes.length} elements and ${a.edges.length} relationships`,background:Nf,markers:ie.map(e=>({id:gp(`se-arrow`,e),paint:e})),groups:ue,...O===void 0?{}:{narrowing:O},orientation:s}}function Ep(e,t){let n=t.isProposal,r=ul(e),{columns:i,bands:a,bandHeight:o,lifelineX:s,boxW:c,headerHeight:l,messageGap:u}=r,d=o,f=r.xOf,p=Wf(Kf(e.participants),t.appearance?.kinds),m=Gf(Kf(e.participants),p),h=[{title:`participants`,sample:`box`,entries:Kf(e.participants).map(e=>({...yp(e,p.get(e),m.get(e)),key:nl(`element`,e)}))}];if(n){let t=new Set([...e.participants.map(e=>Oc(e,!0)),...e.messages.map(e=>Ac(e,!0))]);h.push({title:`changes`,sample:`box`,entries:Rf.filter(e=>e!==`unchanged`&&t.has(e)).map(e=>({label:Mc[e],fill:Nf,stroke:If[e].stroke,faded:e===`context`}))})}let g=r.height+4,_=Math.max(r.width,cp(h)),v=r.height+lp(h,_),y=[];for(let e of a){let t=e.from*s+(s-c)/2,n=e.to*s+(s+c)/2;y.push({id:`band-${e.container.id}-${e.from}`,data:{container:e.container.id},primitives:[{shape:`rect`,x:t,y:2,width:n-t,height:d-6,rx:5,fill:`none`,stroke:Ff,strokeDasharray:`5 3`,opacity:.55},{shape:`text`,x:(t+n)/2,y:d-9,text:e.container.label,fontSize:10,textAnchor:`middle`,fill:Ff}]})}for(let e of i)y.push({id:`life-${e.id}`,primitives:[{shape:`line`,x1:f(e.id),y1:o+l,x2:f(e.id),y2:r.height-6,stroke:`#d4d4d8`,strokeDasharray:`3 3`,strokeWidth:1}]});for(let e of i){let t=Oc(e,n);y.push({id:e.id,data:{"element-role":t,"element-id":e.id},title:dl(e,t),primitives:Jf({x:f(e.id)-c/2,y:o+4,width:c,height:l-8,role:t,label:Zc(e),...e.kind===void 0?{}:{tint:p.get(e.kind)},changes:jc(e),anchor:`middle`})})}return e.messages.forEach((t,r)=>{let i=Ac(t,n),a=Lf[i],s=o+l+(r+1)*u,c=f(t.from),d=f(t.to),p=t.from===t.to,m=jc(t),h=p?c+26+6:(c+d)/2,g=p?`start`:`middle`,_=[];p?_.push({shape:`path`,d:`M ${c} ${s} h 26 v ${u/2} h -26`,fill:`none`,stroke:a,strokeWidth:1.4,markerEnd:gp(`se-msg`,a)}):_.push({shape:`line`,x1:c,y1:s,x2:d,y2:s,stroke:a,strokeWidth:1.4,markerEnd:gp(`se-msg`,a)}),t.label!==void 0&&_.push({shape:`text`,x:h,y:s-5,text:t.label,textAnchor:g,fontSize:10,fill:Pf,fontFamily:qf,stroke:Nf,strokeWidth:3,paintOrder:`stroke`}),m.length>0&&_.push({shape:`text`,x:h,y:s+11,text:m.map(Ae).join(`, `),textAnchor:g,fontSize:9,fontWeight:600,fill:a,fontFamily:qf,stroke:Nf,strokeWidth:3,paintOrder:`stroke`,testId:`relationship-change`}),_.push({shape:`text`,x:4,y:s+3,text:String(r+1),fontSize:9,fill:Ff,fontFamily:qf}),y.push({id:`message-${r}`,data:{"relationship-role":i,"message-index":String(r),"message-from":t.from,"message-to":t.to},title:gl(e,t,r,i),primitives:_})}),y.push(...up(h,12,g,_)),{width:_,height:v,viewBox:`0 0 ${_} ${v}`,ariaLabel:`Sequence of ${e.participants.length} participants and ${e.messages.length} messages`,background:Nf,markers:Rf.map(e=>({id:gp(`se-msg`,Lf[e]),paint:Lf[e]})),groups:y}}var Dp=/"n:([^"]*)"(?: \([^)]*\))?/g,Op=/"r:(\d+)"(?: \([^)]*\))?/g,kp=20;function Ap(e,t={}){let{shown:n,page:r,placement:i}=Cp(e,t),a=new Map(n.nodes.map(e=>[e.id,Zc(e)])),o=e=>`"${a.get(e)??e}"`,s=e=>{let t=n.edges[e];if(t===void 0)return`relationship ${e}`;let r=t.label??t.kind;return`"${a.get(t.from)??t.from} → ${a.get(t.to)??t.to}"${r===void 0?``:` (${r})`}`},c=e=>e.replace(Dp,(e,t)=>o(t)).replace(Op,(e,t)=>s(Number(t))).replace(/ in the mxGeometry of [^:.,]*/g,``).replace(/To change a connector with edit[^.]*\./g,``),l=[];for(let e of Ad([r]).issues){let t=e.cells.filter(e=>e.startsWith(`n:`)).map(e=>e.slice(2)),n=e.cells.filter(e=>e.startsWith(`r:`)).map(e=>Number(e.slice(2)));if(/runs through shape/.test(e.message)&&n.length===1&&t.length===1){let e=jp(r,n[0],t[0]);l.push({elements:t,relationships:n,message:`${s(n[0])} runs through ${o(t[0])}: ${e??`move the box off its path, or give the relationship waypoints that go around it`}`})}else Jd.test(e.message)&&l.push({elements:t,relationships:n,message:c(e.message).trim()})}let u=t.arrangement;if(u!==void 0){let t=new Set(Dl(e)),n=new Set(e.nodes.map(El));for(let e of Object.keys(u.elements).sort())n.has(e)||l.push({elements:[],relationships:[],message:`the arrangement places "${e}", which the document no longer holds: nothing is drawn for it, and it can be removed from the arrangement`});for(let e of Object.keys(u.relationships).sort())t.has(e)||l.push({elements:[],relationships:[],message:`the arrangement routes "${e}", which the document no longer holds: nothing is drawn for it, and it can be removed from the arrangement`})}for(let e of i?.shifted??[]){let t=i.boxes.find(t=>t.id===e.id);l.push({elements:[e.id],relationships:[],message:`${o(e.id)} was moved from (${e.from.x}, ${e.from.y}) to (${t.x}, ${t.y}) to make room for ${i.placed.map(o).join(`, `)}: check it still reads as you arranged it`})}return l}function jp(e,t,n){let r=new Map(e.cells.filter(e=>e.id!==void 0).map(e=>[e.id,e])),i=r.get(`r:${t}`),a=r.get(`n:${n}`)?.geometry;if(i?.geometry===void 0||a===void 0)return;let o=Cu(e),s=[i.source,i.target],c=e=>[...o.terminals].every(([t,n])=>s.includes(t)||e.every((t,r)=>r===0||Du(e[r-1],t,n.box,`box`,2)===0)),l=e=>wu({...i,geometry:{...i.geometry,points:e}},o)?.points,u=e=>e.reduce((t,n,r)=>r===0?0:t+Math.hypot(n.x-e[r-1].x,n.y-e[r-1].y),0);if(i.geometry.points.length>0){let e=l([]);if(e!==void 0&&c(e))return`remove its waypoints`}let d=l(i.geometry.points);if(d===void 0||d.length<2)return;let f=d[0],p=d[d.length-1],m=[[{x:f.x,y:a.y-kp},{x:p.x,y:a.y-kp}],[{x:f.x,y:a.y+a.height+kp},{x:p.x,y:a.y+a.height+kp}],[{x:a.x-kp,y:f.y},{x:a.x-kp,y:p.y}],[{x:a.x+a.width+kp,y:f.y},{x:a.x+a.width+kp,y:p.y}]].map(e=>e.map(e=>({x:Math.round(e.x),y:Math.round(e.y)}))).map(e=>({lane:e,route:l(e)})).filter(e=>e.route!==void 0&&c(e.route)).sort((e,t)=>u(e.route)-u(t.route))[0];return m===void 0?void 0:`give it waypoints at ${m.lane.map(e=>`(${e.x}, ${e.y})`).join(`, `)}`}var Mp=(0,a.createContext)({serverUrl:``});function Np(){return(0,a.useContext)(Mp)}var Pp=/^(exit|entry)(X|Y|Dx|Dy|Perimeter)$/;function Fp(e,t,n,r,i){let a=new Map(t.cells.filter(e=>e.id!==void 0).map(e=>[e.id,e])),o=new Map(n.cells.filter(e=>e.id!==void 0).map(e=>[e.id,e])),s=new Map(e.nodes.map(e=>[e.id,e])),c=t=>{if(t.id?.startsWith(`n:`)){let e=s.get(t.id.slice(2));return`"${e===void 0?t.label:Zc(e)}"`}let n=t.id?.startsWith(`r:`)?e.edges[Number(t.id.slice(2))]:void 0;if(n===void 0)return t.label===``?`a connector`:`"${t.label}"`;let r=s.get(n.from),i=s.get(n.to);return`"${r===void 0?n.from:Zc(r)} → ${i===void 0?n.to:Zc(i)}"`},l=[];for(let[e,t]of a){if(!t.vertex&&!t.edge)continue;let n=o.get(e);n===void 0?l.push(`${c(t)} was deleted: the document still holds it, so it is drawn again`):(n.label!==t.label&&l.push(`the text of ${c(t)} was changed to "${n.label}": the document's text is not changed from here`),t.edge&&(n.source!==t.source||n.target!==t.target)&&l.push(`${c(t)} was attached to other boxes: a relationship's ends are the document's, so it keeps them`),Ip(t.style,t.edge)!==Ip(n.style,n.edge)&&l.push(`the look of ${c(t)} was changed: colours and styles come from the document's kinds and the project`))}for(let[e,t]of o)a.has(e)||!t.vertex&&!t.edge||l.push(`${t.vertex?`a box`:`a connector`}${t.label===``?``:` "${t.label}"`} was added: the document is not changed from here`);let u=jf(e,{...n,cells:n.cells.filter(e=>e.id!==void 0&&a.has(e.id)&&a.get(e.id).source===e.source&&a.get(e.id).target===e.target)},i);return{view:{orientation:i,elements:{...r?.elements,...u.elements},relationships:{...r?.relationships,...u.relationships}},notKept:l}}function Ip(e,t){return Object.entries(Bl(e,t)).filter(([e])=>!Pp.test(e)).map(([e,t])=>`${e}=${t}`).sort().join(`;`)}var Lp={RENDER:`pi-outpost:drawio-render`,READY:`pi-outpost:drawio-ready`,RENDERED:`pi-outpost:drawio-rendered`,FAILED:`pi-outpost:drawio-failed`,EDIT:`pi-outpost:drawio-edit`,SAVE:`pi-outpost:drawio-save`,CLEAN:`pi-outpost:drawio-clean`,UNDO:`pi-outpost:drawio-undo`,REDO:`pi-outpost:drawio-redo`,EXPORT_SVG:`pi-outpost:drawio-export-svg`,WIRE_STYLE:`pi-outpost:drawio-wire-style`,REMOVE_BENDS:`pi-outpost:drawio-remove-bends`,CHANGED:`pi-outpost:drawio-changed`,SAVED:`pi-outpost:drawio-saved`,SVG:`pi-outpost:drawio-svg`,ESCAPE:`pi-outpost:drawio-escape`,FOCUS:`pi-outpost:drawio-focus`,PAGE_LOCKED:`pi-outpost:drawio-page-locked`};function Rp(e,t=window.location.href){return new URL(`${e}/vendor/drawio/viewer-static.min.js`,t).href}function zp(e){return JSON.stringify(e).replace(/</g,`\\u003c`)}function Bp(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Vp(e){let t=[`default-src 'none'`,`script-src ${e} 'unsafe-inline' 'unsafe-eval'`,`style-src 'unsafe-inline'`,`img-src data: blob:`,`font-src data:`].join(`; `),n=e.slice(0,e.lastIndexOf(`/`)),r={DRAWIO_BASE_URL:n,DRAWIO_LIGHTBOX_URL:n,DRAWIO_VIEWER_URL:e,PROXY_URL:n,STENCIL_PATH:n,SHAPES_PATH:n,STYLE_PATH:n,GRAPH_IMAGE_PATH:n,DRAW_MATH_URL:n,mxImageBasePath:n,mxBasePath:n,mxLoadResources:!1,mxLoadStylesheets:!1};return`<!doctype html>
10
+ <html><head><meta charset="utf-8">
11
+ <meta http-equiv="Content-Security-Policy" content="${Bp(t)}">
12
+ <style>
13
+ html, body { margin: 0; height: 100%; }
14
+ body { font-family: system-ui, sans-serif; background: #ffffff; color: #18181b; box-sizing: border-box; padding: 8px; }
15
+ body.dark { background: #09090b; color: #e4e4e7; }
16
+ /* No padding on the graph's own container: mxGraph places the pointer against the
17
+ container's border box, so a padded one shifts every hit by the padding — wires missed
18
+ by a few pixels, connection points that never answer. The margin is the body's. */
19
+ #diagram { box-sizing: border-box; width: 100%; }
20
+ /* mxGraph's common.css, the part touch-up needs (the viewer is told not to load stylesheets).
21
+ Without it the label editor opens at the foot of the page and never commits. */
22
+ div.mxRubberband { position: absolute; overflow: hidden; border: 1px solid #29b6f2; background: #29b6f2; opacity: .2; }
23
+ .mxCellEditor { position: absolute; display: inline-block; overflow: visible; word-wrap: normal; border: 0; min-width: 1px; resize: none; padding: 0; margin: 0; outline: none; cursor: text; }
24
+ .mxPlainTextEditor * { padding: 0; margin: 0; }
25
+ </style>
26
+ </head><body>
27
+ <script>
28
+ (function () {
29
+ var globals = ${zp(r)};
30
+ for (var name in globals) window[name] = globals[name];
31
+ })();
32
+ <\/script>
33
+ <script src="${Bp(e)}"><\/script>
34
+ <script>
35
+ (function () {
36
+ var M = ${zp(Lp)};
37
+ function tell(message) { parent.postMessage(message, "*"); }
38
+ // The page the reader is on: a saved or retyped diagram keeps it, rather than
39
+ // jumping back to the first page under someone reading the third
40
+ var viewer = null;
41
+ // The last text and theme posted: leaving touch-up redraws them, dropping the edits
42
+ var last = null;
43
+ var editing = false;
44
+ // Touch-up state for the viewer drawn now: its history, keys and saved point
45
+ var touch = null;
46
+
47
+ // What draw.io would open: an <mxfile> of pages, or a bare <mxGraphModel>
48
+ function pagesOf(root) {
49
+ if (root.nodeName === "mxGraphModel") return 1;
50
+ if (root.nodeName !== "mxfile") return 0;
51
+ return root.getElementsByTagName("diagram").length;
52
+ }
53
+
54
+ // \`start\`: the page to show first, when nothing is drawn yet; later texts keep the page shown
55
+ function render(xml, dark, start) {
56
+ last = { xml: xml, dark: dark };
57
+ stopTouchUp();
58
+ document.body.className = dark ? "dark" : "";
59
+ // The viewer's own colours are light-dark() pairs: they follow the color-scheme
60
+ document.documentElement.style.colorScheme = dark ? "dark" : "light";
61
+ var old = document.getElementById("diagram");
62
+ if (old) old.remove();
63
+ var doc = new DOMParser().parseFromString(xml, "text/xml");
64
+ var broken = doc.getElementsByTagName("parsererror")[0];
65
+ if (broken) {
66
+ // The browser's own preamble says nothing the reader needs
67
+ var detail = (broken.textContent || "").replace(/^This page contains the following errors:\\s*/, "").split("\\n")[0];
68
+ tell({ type: M.FAILED, message: "This is not well-formed XML: " + detail });
69
+ return;
70
+ }
71
+ var pages = pagesOf(doc.documentElement);
72
+ if (pages === 0) {
73
+ tell({ type: M.FAILED, message: "This is not a draw.io diagram: its root is <" + doc.documentElement.nodeName + ">, not <mxfile> or <mxGraphModel>." });
74
+ return;
75
+ }
76
+ var page = Math.min(viewer !== null ? viewer.currentPage || 0 : typeof start === "number" && start > 0 ? start : 0, pages - 1);
77
+ var container = document.createElement("div");
78
+ container.id = "diagram";
79
+ document.body.appendChild(container);
80
+ try {
81
+ viewer = new GraphViewer(container, doc.documentElement, {
82
+ page: page,
83
+ toolbar: "pages zoom layers",
84
+ // Always shown, at its default place: the viewer reserves the container's top
85
+ // margin for it. "inline" draws it above the container, outside this frame.
86
+ "toolbar-nohide": true,
87
+ nav: true,
88
+ lightbox: false,
89
+ resize: false,
90
+ "auto-fit": true,
91
+ center: true,
92
+ "check-visible-state": false,
93
+ // A string, not a boolean: GraphViewer.isDarkMode compares with "dark" and "auto"
94
+ "dark-mode": dark ? "dark" : "light",
95
+ });
96
+ fitWidth(viewer);
97
+ tell({ type: M.RENDERED, pages: pages });
98
+ if (editing) startTouchUp();
99
+ } catch (error) {
100
+ viewer = null;
101
+ tell({ type: M.FAILED, message: "draw.io could not draw this diagram: " + (error && error.message ? error.message : String(error)) });
102
+ }
103
+ }
104
+
105
+ // With its zoom toolbar on, the viewer draws at full size and widens its container to
106
+ // match: a diagram wider than the frame runs off its edge, behind a scrollbar a Mac
107
+ // hides — and a box out there cannot be touched up. Scaled down to the frame's width.
108
+ function fitWidth(shown) {
109
+ var graph = shown.graph;
110
+ var available = window.innerWidth - 16 - 2 * graph.border;
111
+ var width = graph.getGraphBounds().width / graph.view.scale;
112
+ if (!(width > available) || available <= 0) return;
113
+ graph.zoomTo(available / width);
114
+ var bounds = graph.getGraphBounds();
115
+ shown.updateContainerWidth(graph.container, bounds.width + 2 * graph.border);
116
+ shown.updateContainerHeight(graph.container, Math.max(shown.minHeight || 0, bounds.height + 2 * graph.border + 1));
117
+ }
118
+
119
+ function changed() {
120
+ if (touch === null) return;
121
+ var undo = touch.undo;
122
+ // A label being typed is an edit too: leaving now would drop it
123
+ var typing = viewer !== null && viewer.graph.isEditing();
124
+ tell({ type: M.CHANGED, dirty: typing || undo.indexOfNextAdd !== touch.clean, canUndo: undo.canUndo(), canRedo: undo.canRedo(), wireStyle: viewer === null ? null : targetWireStyle(viewer.graph), bends: viewer === null ? 0 : targetBends(viewer.graph) });
125
+ }
126
+
127
+ // Wire styles as draw.io's Waypoints menu sets them (Menus.js, edgeStyleChange): the keys
128
+ // each one writes, null removing a key
129
+ var WIRE_STYLES = {
130
+ straight: { edgeStyle: null, curved: null, noEdgeStyle: null, elbow: null },
131
+ orthogonal: { edgeStyle: "orthogonalEdgeStyle", curved: null, noEdgeStyle: null, elbow: null },
132
+ curved: { edgeStyle: "orthogonalEdgeStyle", curved: "1", noEdgeStyle: null, elbow: null }
133
+ };
134
+
135
+ function wireStyleOf(graph, cell) {
136
+ var style = graph.getCurrentCellStyle(cell);
137
+ if (style.noEdgeStyle == 1 || style.edgeStyle == null || style.edgeStyle === "none") return "straight";
138
+ return style.curved == 1 ? "curved" : "orthogonal";
139
+ }
140
+
141
+ function pageWires(graph) {
142
+ var model = graph.getModel();
143
+ return Object.keys(model.cells).map(function (id) { return model.cells[id]; }).filter(function (cell) { return model.isEdge(cell); });
144
+ }
145
+
146
+ // The wires a choice changes: the selected ones, else all of the page's
147
+ function targetWires(graph) {
148
+ var selected = graph.getSelectionCells().filter(function (cell) { return graph.getModel().isEdge(cell); });
149
+ return selected.length > 0 ? selected : pageWires(graph);
150
+ }
151
+
152
+ // How many waypoints the wires a choice changes hold: what "remove bends" would take away
153
+ function targetBends(graph) {
154
+ return targetWires(graph).reduce(function (count, cell) {
155
+ var geometry = graph.getModel().getGeometry(cell);
156
+ return count + (geometry !== null && geometry.points ? geometry.points.length : 0);
157
+ }, 0);
158
+ }
159
+
160
+ // The waypoints of the wires a choice changes, gone in one undoable change. Choosing the
161
+ // style a wire already has changes nothing, so this is the way to straighten one out —
162
+ // a single bend goes with a double click on it (draw.io's dblClickRemoveEnabled)
163
+ function removeBends() {
164
+ if (touch === null || viewer === null) return;
165
+ var graph = viewer.graph;
166
+ if (graph.isEditing()) graph.stopEditing(false);
167
+ var wires = targetWires(graph);
168
+ var model = graph.getModel();
169
+ model.beginUpdate();
170
+ try {
171
+ for (var i = 0; i < wires.length; i++) graph.resetEdge(wires[i]);
172
+ } finally {
173
+ model.endUpdate();
174
+ }
175
+ changed();
176
+ }
177
+
178
+ // The waypoints a handle stands for, in the view's coordinates: the one under it, or the
179
+ // corners of the segment it sits in the middle of. Gone in one undoable change.
180
+ function removeHandle(graph, cell, index) {
181
+ var handler = graph.selectionCellsHandler.getHandler(cell);
182
+ var geometry = graph.getModel().getGeometry(cell);
183
+ if (!handler || !handler.bends || geometry === null || !geometry.points || geometry.points.length === 0) return;
184
+ var view = graph.view;
185
+ var scale = view.scale;
186
+ // A wire inside a group or a lane has its waypoints relative to that parent
187
+ var parentState = view.getState(graph.getModel().getParent(cell));
188
+ var origin = parentState && parentState.origin ? parentState.origin : { x: 0, y: 0 };
189
+ var shown = function (point) { return { x: (point.x + origin.x + view.translate.x) * scale, y: (point.y + origin.y + view.translate.y) * scale }; };
190
+ var near = function (a, b) { return Math.abs(a.x - b.x) <= 2 && Math.abs(a.y - b.y) <= 2; };
191
+ var bounds = handler.bends[index].bounds;
192
+ var handle = { x: bounds.getCenterX(), y: bounds.getCenterY() };
193
+ var points = geometry.points;
194
+ var gone = points.filter(function (point) { return near(shown(point), handle); });
195
+ var corners = handler.state.absolutePoints || [];
196
+ if (gone.length === 0 && index > 0 && index < corners.length) {
197
+ var from = corners[index - 1];
198
+ var to = corners[index];
199
+ gone = points.filter(function (point) { var at = shown(point); return (from && near(at, from)) || (to && near(at, to)); });
200
+ }
201
+ if (gone.length === 0) return;
202
+ var next = geometry.clone();
203
+ next.points = points.filter(function (point) { return gone.indexOf(point) === -1; });
204
+ graph.getModel().setGeometry(cell, next);
205
+ }
206
+
207
+ function targetWireStyle(graph) {
208
+ var wires = targetWires(graph);
209
+ if (wires.length === 0) return newWireStyle(graph);
210
+ var first = wireStyleOf(graph, wires[0]);
211
+ for (var i = 1; i < wires.length; i++) if (wireStyleOf(graph, wires[i]) !== first) return "mixed";
212
+ return first;
213
+ }
214
+
215
+ function newWireStyle(graph) {
216
+ var current = graph.currentEdgeStyle || {};
217
+ if (current.edgeStyle == null || current.edgeStyle === "none") return "straight";
218
+ return current.curved == "1" ? "curved" : "orthogonal";
219
+ }
220
+
221
+ // New wires take this style (Graph.createCurrentEdgeStyle reads currentEdgeStyle)
222
+ function setNewWireStyle(graph, name) {
223
+ var current = mxUtils.clone(graph.currentEdgeStyle || {});
224
+ var keys = WIRE_STYLES[name];
225
+ for (var key in keys) {
226
+ if (keys[key] === null) delete current[key];
227
+ else current[key] = keys[key];
228
+ }
229
+ graph.currentEdgeStyle = current;
230
+ }
231
+
232
+ // One model update: one undo takes it back. Waypoints go, as draw.io resets them: laid out
233
+ // for one style, they make no sense in another
234
+ function applyWireStyle(name) {
235
+ if (touch === null || viewer === null || !WIRE_STYLES[name]) return;
236
+ var graph = viewer.graph;
237
+ if (graph.isEditing()) graph.stopEditing(false);
238
+ var wires = targetWires(graph);
239
+ var model = graph.getModel();
240
+ model.beginUpdate();
241
+ try {
242
+ for (var i = 0; i < wires.length; i++) {
243
+ graph.resetEdge(wires[i]);
244
+ var keys = WIRE_STYLES[name];
245
+ for (var key in keys) graph.setCellStyles(key, keys[key], [wires[i]]);
246
+ }
247
+ } finally {
248
+ model.endUpdate();
249
+ }
250
+ setNewWireStyle(graph, name);
251
+ changed();
252
+ }
253
+
254
+ // The viewer holds back the editing core it bundles; this lets it go, for the page shown
255
+ function startTouchUp() {
256
+ if (viewer === null || touch !== null) return;
257
+ var graph = viewer.graph;
258
+ graph.setEnabled(true);
259
+ // The viewer replaces click with a no-op: nothing would select on click, and an edge —
260
+ // selected by click, not by mousedown like a shape — would never show its handles
261
+ delete graph.click;
262
+ graph.setCellsLocked(false);
263
+ graph.setDisconnectOnMove(false);
264
+ // A wire must end on a shape: one left hanging is what drawio_check reports as an
265
+ // error, and a touch-up should not hand the agent a file it would refuse
266
+ graph.setAllowDanglingEdges(false);
267
+ // The file's own grid, as draw.io would snap to it: a box dropped at x=1089 is one
268
+ // the next reader nudges by hand, and the drawio skill asks for multiples of 10
269
+ var page = originalModel();
270
+ graph.setGridEnabled(page === null || page.getAttribute("grid") !== "0");
271
+ graph.gridSize = Number(page !== null && page.getAttribute("gridSize")) || 10;
272
+ var undo = new mxUndoManager();
273
+ var record = function (sender, event) { undo.undoableEditHappened(event.getProperty("edit")); changed(); };
274
+ graph.getModel().addListener(mxEvent.UNDO, record);
275
+ graph.getView().addListener(mxEvent.UNDO, record);
276
+ // The viewer sizes its drawing area once, to the diagram as it came: a box dragged past
277
+ // its right or bottom edge would vanish there, moved but out of reach. The area grows
278
+ // with the diagram instead, as draw.io's page does, and the frame scrolls to it; past
279
+ // the left or top edge there is nothing to scroll to, so a box stops at the origin.
280
+ graph.setAllowNegativeCoordinates(false);
281
+ var shown = viewer;
282
+ var grow = function () {
283
+ var bounds = graph.getGraphBounds();
284
+ var width = bounds.x + bounds.width + 2 * graph.border;
285
+ var height = bounds.y + bounds.height + 2 * graph.border;
286
+ if (width > container.offsetWidth) shown.updateContainerWidth(container, width);
287
+ if (height > container.offsetHeight) shown.updateContainerHeight(container, height);
288
+ };
289
+ graph.getModel().addListener(mxEvent.CHANGE, grow);
290
+ // New wires start in the style most of the page's wires have: an agent's diagonal wires
291
+ // get diagonal neighbours, not draw.io's orthogonal default
292
+ var counts = { straight: 0, orthogonal: 0, curved: 0 };
293
+ pageWires(graph).forEach(function (cell) { counts[wireStyleOf(graph, cell)] += 1; });
294
+ var most = counts.orthogonal >= counts.straight && counts.orthogonal >= counts.curved ? "orthogonal" : counts.straight >= counts.curved ? "straight" : "curved";
295
+ setNewWireStyle(graph, most);
296
+ graph.getSelectionModel().addListener(mxEvent.CHANGE, changed);
297
+ graph.addListener(mxEvent.EDITING_STARTED, changed);
298
+ graph.addListener(mxEvent.EDITING_STOPPED, changed);
299
+ // The keys are the graph's own, not the document's: mxKeyHandler only takes an event
300
+ // whose target is its element, and a frame's keys otherwise land on <body>
301
+ var container = graph.container;
302
+ container.setAttribute("tabindex", "-1");
303
+ container.style.outline = "none";
304
+ var keys = new mxKeyHandler(graph, container);
305
+ // A bend is taken out by a click on its handle, then Delete — as a shape is. draw.io's own
306
+ // gestures stay as they are beside it. The handle clicked is remembered, drawn apart, until
307
+ // the next click or selection. A straight wire has a handle on each waypoint; an orthogonal
308
+ // one has a handle in the middle of each segment instead, whose corners are the waypoints:
309
+ // Delete takes out the waypoint under the handle, or the waypoints at the segment's corners.
310
+ var chosen = null;
311
+ // After a bend goes, Delete waits for the next click: a second press, or a held key, would
312
+ // otherwise delete the wire still selected under it
313
+ var bendJustRemoved = false;
314
+ var showChosen = function (on) {
315
+ if (chosen === null) return;
316
+ var handler = graph.selectionCellsHandler.getHandler(chosen.cell);
317
+ var shape = handler && handler.bends ? handler.bends[chosen.index] : null;
318
+ if (!shape) return;
319
+ shape.fill = on ? "#f97316" : mxConstants.HANDLE_FILLCOLOR;
320
+ shape.redraw();
321
+ };
322
+ var forget = function () { showChosen(false); chosen = null; };
323
+ var pickBend = {
324
+ mouseDown: function (sender, me) {
325
+ forget();
326
+ bendJustRemoved = false;
327
+ var cells = graph.getSelectionCells();
328
+ for (var i = 0; i < cells.length; i++) {
329
+ if (!graph.getModel().isEdge(cells[i])) continue;
330
+ var handler = graph.selectionCellsHandler.getHandler(cells[i]);
331
+ if (!handler || !handler.bends) continue;
332
+ var index = handler.getHandleForEvent(me);
333
+ // 0 and the last handle are the wire's ends; virtual bends are negative
334
+ if (index !== null && index > 0 && index < handler.bends.length - 1) {
335
+ chosen = { cell: cells[i], index: index };
336
+ return;
337
+ }
338
+ }
339
+ },
340
+ mouseMove: function () {},
341
+ mouseUp: function () { showChosen(true); },
342
+ };
343
+ // First in line: the edge handler, once it has the press, has started dragging that bend
344
+ graph.addMouseListener(pickBend);
345
+ graph.mouseListeners.unshift(graph.mouseListeners.pop());
346
+ graph.getSelectionModel().addListener(mxEvent.CHANGE, function () {
347
+ if (chosen !== null && !graph.isCellSelected(chosen.cell)) forget();
348
+ });
349
+ var remove = function () {
350
+ if (!graph.isEnabled()) return;
351
+ if (chosen !== null && graph.isCellSelected(chosen.cell)) {
352
+ var bend = chosen;
353
+ chosen = null;
354
+ removeHandle(graph, bend.cell, bend.index);
355
+ bendJustRemoved = true;
356
+ return;
357
+ }
358
+ if (bendJustRemoved) return;
359
+ if (!graph.isSelectionEmpty()) graph.deleteCells(graph.getDeletableCells(graph.getSelectionCells()));
360
+ };
361
+ keys.bindKey(46, remove);
362
+ keys.bindKey(8, remove);
363
+ // Undo and redo by hand: mxKeyHandler's control bindings never see ⌘ on a Mac
364
+ var history = function (event) {
365
+ if (graph.isEditing() || !(event.metaKey || event.ctrlKey) || event.altKey) return;
366
+ var key = (event.key || "").toLowerCase();
367
+ if (key !== "z" && key !== "y") return;
368
+ event.preventDefault();
369
+ undoOrRedo(key === "y" || event.shiftKey);
370
+ };
371
+ container.addEventListener("keydown", history);
372
+ // mxGraph prevents the default of a pointerdown, which is what would have given the
373
+ // graph the keyboard — and with it the mousedown that would follow, so this listens
374
+ // for the pointer: without it Delete and ⌘Z go nowhere. Not while a label is being
375
+ // typed, which has the keyboard already
376
+ // A frame cannot always take the keyboard from its parent by itself (a headless
377
+ // browser, a window not in front): the parent is asked to focus it too
378
+ var focus = function () {
379
+ if (graph.isEditing()) return;
380
+ container.focus({ preventScroll: true });
381
+ tell({ type: M.FOCUS });
382
+ };
383
+ document.addEventListener("pointerdown", focus, true);
384
+ // Another page would carry this one's history and edits with it: refused while dirty,
385
+ // and a clean start on the page arrived at
386
+ var showPage = viewer.updateGraphXml;
387
+ viewer.updateGraphXml = function () {
388
+ if (touch !== null && touch.undo.indexOfNextAdd !== touch.clean) {
389
+ tell({ type: M.PAGE_LOCKED });
390
+ return;
391
+ }
392
+ var result = showPage.apply(this, arguments);
393
+ if (touch !== null) {
394
+ touch.undo.clear();
395
+ touch.clean = 0;
396
+ changed();
397
+ }
398
+ return result;
399
+ };
400
+ touch = { undo: undo, keys: keys, clean: 0, record: record, showPage: showPage, focus: focus, history: history, container: container, grow: grow, pickBend: pickBend };
401
+ changed();
402
+ }
403
+
404
+ function stopTouchUp() {
405
+ if (touch === null) return;
406
+ var current = touch;
407
+ touch = null;
408
+ current.keys.destroy();
409
+ if (viewer !== null) viewer.graph.removeMouseListener(current.pickBend);
410
+ document.removeEventListener("pointerdown", current.focus, true);
411
+ current.container.removeEventListener("keydown", current.history);
412
+ if (viewer !== null) {
413
+ viewer.updateGraphXml = current.showPage;
414
+ viewer.graph.getModel().removeListener(current.record);
415
+ viewer.graph.getModel().removeListener(current.grow);
416
+ viewer.graph.removeListener(changed);
417
+ viewer.graph.getSelectionModel().removeListener(changed);
418
+ viewer.graph.getView().removeListener(current.record);
419
+ }
420
+ }
421
+
422
+ function undoOrRedo(redo) {
423
+ if (touch === null) return;
424
+ if (viewer.graph.isEditing()) viewer.graph.stopEditing(false);
425
+ if (redo) { if (touch.undo.canRedo()) touch.undo.redo(); }
426
+ else if (touch.undo.canUndo()) touch.undo.undo();
427
+ changed();
428
+ }
429
+
430
+ // The page shown as draw.io's file had it: its <mxGraphModel>, inflated if it was compressed
431
+ function originalModel() {
432
+ var node = viewer.diagrams && viewer.diagrams.length > 0 ? viewer.diagrams[viewer.currentPage || 0] : viewer.xmlNode;
433
+ if (node.nodeName === "mxGraphModel") return node;
434
+ var models = node.getElementsByTagName("mxGraphModel");
435
+ if (models.length > 0) return models[0];
436
+ var text = mxUtils.getTextContent(node);
437
+ return text ? mxUtils.parseXml(Graph.decompress(text)).documentElement : null;
438
+ }
439
+
440
+ function save() {
441
+ var graph = viewer.graph;
442
+ // A label still being typed is part of what the reader means to save
443
+ if (graph.isEditing()) graph.stopEditing(false);
444
+ var model = new mxCodec(mxUtils.createXmlDocument()).encode(graph.getModel());
445
+ // The codec writes only the cells: grid, page size and the rest are the file's own
446
+ var original = originalModel();
447
+ if (original !== null) {
448
+ for (var i = 0; i < original.attributes.length; i++) {
449
+ var attribute = original.attributes[i];
450
+ if (!model.hasAttribute(attribute.name)) model.setAttribute(attribute.name, attribute.value);
451
+ }
452
+ }
453
+ if (touch !== null) touch.saving = touch.undo.indexOfNextAdd;
454
+ tell({ type: M.SAVED, page: viewer.currentPage || 0, xml: mxUtils.getPrettyXml(model) });
455
+ }
456
+
457
+ function exportSvg() {
458
+ var graph = viewer.graph;
459
+ // Plain text beside each HTML label (draw.io's <switch> fallback), for readers that
460
+ // ignore foreignObject — Word among them
461
+ var svg = graph.getSvg(null, 1, 10, false, null, true);
462
+ var names = viewer.diagrams && viewer.diagrams.length > 0 ? viewer.diagrams[viewer.currentPage || 0].getAttribute("name") : null;
463
+ tell({ type: M.SVG, page: viewer.currentPage || 0, name: names, svg: '<?xml version="1.0" encoding="UTF-8"?>\\n' + mxUtils.getXml(svg) });
464
+ }
465
+
466
+ // The keyboard is in this frame once it has been clicked, so the application never sees
467
+ // an Escape typed here: passed on, except while a label is typed, where Escape cancels
468
+ // the label first, as in draw.io
469
+ // On the window, capturing: before mxGraph's own handlers, which take Escape to cancel
470
+ // a gesture in progress and can keep it from bubbling — right after a drag, it was lost
471
+ window.addEventListener("keydown", function (event) {
472
+ if (event.key !== "Escape") return;
473
+ if (viewer !== null && viewer.graph.isEditing()) return;
474
+ tell({ type: M.ESCAPE });
475
+ }, true);
476
+
477
+ window.addEventListener("message", function (event) {
478
+ // Only the application that holds this frame
479
+ if (event.source !== parent) return;
480
+ var data = event.data;
481
+ if (!data) return;
482
+ if (data.type === M.RENDER && typeof data.xml === "string") render(data.xml, data.dark === true, data.page);
483
+ else if (data.type === M.EDIT) {
484
+ editing = data.on === true;
485
+ if (editing) startTouchUp();
486
+ // The text to come back to, when the parent has a newer one (a save landed); else the last
487
+ else if (typeof data.xml === "string") render(data.xml, data.dark === true);
488
+ else if (touch !== null && last !== null) render(last.xml, last.dark);
489
+ }
490
+ else if (viewer === null) return;
491
+ else if (data.type === M.SAVE && touch !== null) save();
492
+ else if (data.type === M.CLEAN && touch !== null && touch.saving !== undefined) { touch.clean = touch.saving; changed(); }
493
+ else if (data.type === M.UNDO) undoOrRedo(false);
494
+ else if (data.type === M.REDO) undoOrRedo(true);
495
+ else if (data.type === M.EXPORT_SVG) exportSvg();
496
+ else if (data.type === M.WIRE_STYLE && typeof data.style === "string") applyWireStyle(data.style);
497
+ else if (data.type === M.REMOVE_BENDS) removeBends();
498
+ });
499
+
500
+ if (typeof GraphViewer === "undefined") {
501
+ tell({ type: M.FAILED, message: "The draw.io viewer could not be loaded." });
502
+ } else {
503
+ tell({ type: M.READY });
504
+ }
505
+ })();
506
+ <\/script>
507
+ </body></html>`}var Hp=`allow-scripts`,Up=1e4,Wp=(0,a.forwardRef)(function({xml:e,serverUrl:t,title:n,fallback:r,editing:i=!1,onTouchUpChange:s,onPageLocked:c,onEscape:u,onRendered:d,className:f=`flex h-full min-h-[24rem] flex-col`,page:p},m){let h=(0,a.useRef)(null),g=l()===`dark`,_=(0,a.useMemo)(()=>Vp(Rp(t)),[t]),[v,y]=(0,a.useState)(0),[b,x]=(0,a.useState)(null),S=(0,a.useRef)(new Map),C=(0,a.useRef)({onTouchUpChange:s,onPageLocked:c,onEscape:u,onRendered:d});C.current={onTouchUpChange:s,onPageLocked:c,onEscape:u,onRendered:d};let w=(0,a.useRef)(null),T=(0,a.useRef)(i);function E(e){h.current?.contentWindow?.postMessage(e,`*`)}function ee(e,t){return new Promise((n,r)=>{S.current.get(t)?.reject(Error(`superseded`));let i=setTimeout(()=>{S.current.delete(t),r(Error(`the diagram did not answer`))},Up);S.current.set(t,{resolve:(e=>{clearTimeout(i),n(e)}),reject:e=>{clearTimeout(i),r(e)}}),E({type:e})})}return(0,a.useImperativeHandle)(m,()=>({save:()=>ee(Lp.SAVE,Lp.SAVED),markClean:()=>E({type:Lp.CLEAN}),undo:()=>E({type:Lp.UNDO}),redo:()=>E({type:Lp.REDO}),setWireStyle:e=>E({type:Lp.WIRE_STYLE,style:e}),removeBends:()=>E({type:Lp.REMOVE_BENDS}),exportSvg:()=>ee(Lp.EXPORT_SVG,Lp.SVG)})),(0,a.useEffect)(()=>{let e=S.current;function t(t){if(h.current===null||t.source!==h.current.contentWindow)return;let n=t.data;if(typeof n==`object`&&n){if(n.type===Lp.READY)w.current=null,T.current=!1,y(e=>e+1);else if(n.type===Lp.RENDERED)x(null),C.current.onRendered?.(null);else if(n.type===Lp.FAILED){let e=typeof n.message==`string`?n.message:`The diagram could not be drawn.`;x(e),C.current.onRendered?.(e)}else if(n.type===Lp.CHANGED){let e=[`straight`,`orthogonal`,`curved`,`mixed`].includes(n.wireStyle)?n.wireStyle:void 0,t=typeof n.bends==`number`&&Number.isFinite(n.bends)?n.bends:void 0;C.current.onTouchUpChange?.({dirty:n.dirty===!0,canUndo:n.canUndo===!0,canRedo:n.canRedo===!0,...e?{wireStyle:e}:{},...t===void 0?{}:{bends:t}})}else n.type===Lp.FOCUS?h.current!==null&&document.activeElement!==h.current&&h.current.focus({preventScroll:!0}):n.type===Lp.ESCAPE?C.current.onEscape?.():n.type===Lp.PAGE_LOCKED?C.current.onPageLocked?.():n.type===Lp.SAVED&&typeof n.xml==`string`&&typeof n.page==`number`?(e.get(Lp.SAVED)?.resolve({page:n.page,xml:n.xml}),e.delete(Lp.SAVED)):n.type===Lp.SVG&&typeof n.svg==`string`&&typeof n.page==`number`&&(e.get(Lp.SVG)?.resolve({page:n.page,name:typeof n.name==`string`?n.name:null,svg:n.svg}),e.delete(Lp.SVG))}}return window.addEventListener(`message`,t),()=>{window.removeEventListener(`message`,t);for(let t of e.values())t.reject(Error(`the diagram was closed`));e.clear()}},[]),(0,a.useEffect)(()=>{v!==0&&(i?(!T.current&&(w.current===null||w.current.xml!==e||w.current.dark!==g)&&(w.current={xml:e,dark:g},E({type:Lp.RENDER,xml:e,dark:g,...p===void 0?{}:{page:p}})),T.current||E({type:Lp.EDIT,on:!0}),T.current=!0):T.current?(T.current=!1,w.current={xml:e,dark:g},E({type:Lp.EDIT,on:!1,xml:e,dark:g})):(w.current===null||w.current.xml!==e||w.current.dark!==g)&&(w.current={xml:e,dark:g},E({type:Lp.RENDER,xml:e,dark:g,...p===void 0?{}:{page:p}})))},[v,e,g,i]),(0,o.jsxs)(`div`,{className:f,"data-testid":`drawio-view`,children:[b!==null&&(0,o.jsx)(`div`,{role:`alert`,"data-testid":`drawio-failure`,className:`border-b border-amber-300 bg-amber-50 px-3 py-1.5 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:b}),(0,o.jsx)(`iframe`,{ref:h,title:n,"data-testid":`drawio-frame`,sandbox:Hp,srcDoc:_,className:b===null?`min-h-0 w-full flex-1 border-0`:`h-0 w-full border-0`}),b!==null&&(0,o.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:r})]})}),Gp={dirty:!1,canUndo:!1,canRedo:!1},Kp=`Leave without keeping the touch-ups?`;function qp({data:e,hidden:t,orientation:n,arrangement:r,onArrange:i,onNote:s,onDone:c}){let{serverUrl:l}=Np(),u=(0,a.useRef)(null),[d,f]=(0,a.useState)(Gp),[p,m]=(0,a.useState)(!1),[h,g]=(0,a.useState)(null),_=(0,a.useRef)(!1),v=(0,a.useRef)(!1),y=()=>Cp(e,{hidden:t,orientation:n,...r===void 0?{}:{arrangement:r}}),[b,x]=(0,a.useState)(y),S=(0,a.useRef)(e),[T,E]=(0,a.useState)(0),[ee,D]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e!==S.current&&(d.dirty?D(!0):(S.current=e,x(y()),E(e=>e+1),D(!1)))},[e,d.dirty]);let te=(0,a.useRef)(r),ne=(0,a.useMemo)(()=>ef(b.page),[b]);async function re(){if(!v.current){v.current=!0,m(!0),g(null);try{let[t]=pd((await u.current.save()).xml);if(t===void 0)throw Error(`the touch-up returned no page`);let r=Fp(b.shown,b.page,t,te.current,n),a=new Set(e.nodes.map(El)),o=new Set(Dl(e)),l={...r.view,elements:Object.fromEntries(Object.entries(r.view.elements).filter(([e])=>a.has(e)||te.current?.elements[e]!==void 0)),relationships:Object.fromEntries(Object.entries(r.view.relationships).filter(([e])=>o.has(e)||te.current?.relationships[e]!==void 0))},d=r.notKept;te.current=l,i(l),u.current?.markClean(),s(d.length===0?void 0:`Kept the arrangement. Not kept: ${d.join(`; `)}.`),_.current&&c()}catch(e){_.current=!1,g(`Could not keep the touch-up: ${e instanceof Error?e.message:String(e)}`)}finally{v.current=!1,m(!1)}}}function ie(){v.current?_.current=!0:(!d.dirty||window.confirm(Kp))&&c()}return(0,o.jsxs)(`div`,{"data-testid":`structured-touchup`,className:`flex flex-col gap-1`,children:[(0,o.jsxs)(`div`,{className:w,children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!d.dirty||p,onClick:()=>void re(),children:p?`keeping…`:`✓ keep`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!d.canUndo,onClick:()=>u.current?.undo(),title:`Undo (⌘Z / Ctrl+Z)`,children:`↶ undo`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!d.canRedo,onClick:()=>u.current?.redo(),title:`Redo (⇧⌘Z / Ctrl+Y)`,children:`↷ redo`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!d.bends,onClick:()=>u.current?.removeBends(),title:`Remove the bends of the selected wires — or of every wire when none is selected. Click a bend and press Delete to remove just that one.`,children:`remove bends`}),(0,o.jsx)(`button`,{type:`button`,className:C,onClick:ie,title:`Leave the touch-up; touch-ups not kept are asked about first`,children:`done`}),(0,o.jsx)(`span`,{className:`text-xs text-zinc-400`,"data-testid":`structured-touchup-status`,children:d.dirty?`● not kept yet`:`arranging — drag boxes, wire ends and labels; the document's content is not changed from here`}),ee&&(0,o.jsx)(`span`,{role:`status`,"data-testid":`structured-touchup-changed`,className:`text-xs text-amber-700 dark:text-amber-300`,children:`The document changed on disk since this touch-up began: keeping takes only the places of what it still holds. Leave and arrange again to see it as it is now.`}),h!==null&&(0,o.jsx)(`span`,{role:`alert`,className:`text-xs text-red-600 dark:text-red-400`,children:h})]}),(0,o.jsx)(Wp,{ref:u,xml:ne,serverUrl:l,title:`Arrange in draw.io`,editing:!0,onTouchUpChange:f,onEscape:ie,className:`flex h-[32rem] flex-col`},T)]})}var Jp=`change`,Yp=`section`,Xp=`level`;function Zp(e,t,n){let r=Fc(e),i=(e,t)=>n?.[t]?.role??Ic(e,r),a=e.rows.some((e,t)=>i(e,t)!==void 0),o=e.rows.map((e,t)=>({row:e,role:i(e,t)})).filter(({role:e})=>e===void 0||!t.has(nl(`role`,e)));return{shown:o,anyRole:a,withheld:e.rows.length-o.length}}function Qp(e,t,n){let{shown:r,anyRole:i,withheld:a}=Zp(e,t,n),o=e.rows.some(e=>ce(e).heading!==void 0);return{columns:[...o?[Yp,Xp]:[],...e.columns,...i?[Jp]:[]],rows:r.map(({row:t,role:n})=>{let{cells:r,heading:a}=ce(t),s=Array.isArray(t)?void 0:t.depth,c=o?a===void 0?[null,null]:[a,s??1]:[],l=a===void 0?r:e.columns.map(()=>null);return[...c,...l,...i?[n===void 0?null:Nc[n]]:[]]}),withheld:a}}function $p(e){if(e===null)return``;let t=String(e);return/[",\n\r]/.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}function em(e){return[e.columns,...e.rows].map(e=>e.map($p).join(`,`)).join(`\r
508
+ `)}function tm(e){return e===null?``:String(e).replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`).replace(/\r\n|\r|\n/g,`<br>`)}function nm(e){return e.replaceAll(`\\`,`\\\\`).replace(/\r\n|\r|\n/g,` `)}function rm(e,t=new Set,n){let{shown:r,anyRole:i}=Zp(e,t,n),a=[...e.columns,...i?[Jp]:[]],o=`| ${a.map(e=>tm(e)).join(` | `)} |`,s=`| ${a.map(()=>`---`).join(` | `)} |`,c=[],l=[],u=!1,d=()=>{l.length!==0&&(c.push([o,s,...l].join(`
509
+ `)),l=[],u=!0)};for(let{row:e,role:t}of r){let{cells:n,heading:r}=ce(e);if(r!==void 0){d();let t=Array.isArray(e)?1:e.depth??1;c.push(`${`#`.repeat(Math.min(t+1,6))} ${nm(r)}`);continue}let a=[...n,...i?[t===void 0?null:Nc[t]]:[]];l.push(`| ${a.map(tm).join(` | `)} |`)}return d(),!u&&c.length===0&&c.push([o,s].join(`
510
+ `)),`${c.join(`
511
+
512
+ `)}\n`}function im(e,t){r.t(new Blob([``,em(e)],{type:`text/csv;charset=utf-8`}),t)}async function am(e,t){let{default:n}=await Promise.resolve().then(()=>require("./browser-CUQnQIhV.cjs")),i=await n([e.columns.map(e=>({value:e,fontWeight:`bold`})),...e.rows.map(e=>e.map(e=>e===null?{value:void 0}:typeof e==`number`?{value:e,type:Number}:typeof e==`boolean`?{value:e,type:Boolean}:{value:e,type:String}))]).toBlob();r.t(i,t)}function om(e,t,n,i){r.t(new Blob([rm(e,t,n)],{type:`text/markdown;charset=utf-8`}),i)}var sm=e=>JSON.parse(JSON.stringify(e));function cm(e){let t=sm(e);return delete t.comparedTo,t.rows=t.rows.filter(e=>e.type!==`task`||e.role!==`removed`).map(e=>(e.type===`task`&&(delete e.role,e.items=e.items.filter(e=>e.role!==`removed`).map(e=>(delete e.role,delete e.previous,e))),e)),t}var lm=`#e4e4e7`,um=`#ea580c`,dm=`#dc2626`,fm=`#2563eb`,pm={fill:`#e4e4e7`,stroke:`#52525b`},mm=.35,hm=.25,gm=8,_m=24,vm=18,ym=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function bm(e,t,n){let r=[];for(let i=0;i<10;i++){let a=i%2==0?n:n*.45,o=-Math.PI/2+i*Math.PI/5;r.push(`${(e+a*Math.cos(o)).toFixed(2)},${(t+a*Math.sin(o)).toFixed(2)}`)}return`M${r.join(`L`)}Z`}function xm(e,t,n,r,i=1,a=`#a1a1aa`,o=6,s=.5){let c=[],l=i=>{for(let l=o;l<n+r;l+=o){let o=Math.min(l,n),u=Math.max(0,l-n),d=Math.max(0,l-r),f=Math.min(l,r);c.push({shape:`line`,x1:e+(i?n-o:o),y1:t+u,x2:e+(i?n-d:d),y2:t+f,stroke:a,strokeWidth:.6,opacity:s})}};return(i===1||i===3)&&l(!1),(i===2||i===3)&&l(!0),c}function Sm(e){let[t,n,r]=Re(e).split(`-`);return`${Number(r)} ${ym[Number(n)-1]} ${t}`}function Cm(e,t){let n=Math.floor(t/Ce);return e.length<=n?e:`${e.slice(0,Math.max(1,n-1))}…`}function wm(e,t,n){let r=e.rows[n.row];if(r?.type!==`task`)return``;let i=r.items[n.item],a=i.type===`activity`?`${i.start} to ${i.end}`:i.date,o=i.id===void 0?[]:t.dependencies.filter(e=>e.from===i.id||e.to===i.id),s=o.filter(e=>!e.satisfied).length;return[`${i.type} ${a}`,i.label,i.kind===void 0?void 0:`kind ${i.kind}`,`task "${r.label}" (${r.id})`,o.length===0?void 0:`${o.length} ${o.length===1?`dependency`:`dependencies`}${s>0?`, ${s} not satisfied`:``}`].filter(e=>e!==void 0).join(`, `)}function Tm(e,t){let n=t.comparison===`new`?cm(e):e,r=ht(n),i=(()=>{let e=ft(n,t.today,{compact:t.compact,pxPerDay:1,onlyChanged:t.onlyChanged});return e.end-e.start+1})(),a=Qe[t.scale??n.time.scale]??Qe.month,o=!1;if(t.pxPerDay!==void 0)a=t.pxPerDay;else if(t.width!==void 0){let e=(t.width-r-16)/i;a=Math.max(hm,e),o=e<hm}let s=t.unit??(t.pxPerDay!==void 0||t.width!==void 0?t.scale:t.scale??n.time.scale),c=ft(n,t.today,{compact:t.compact,pxPerDay:a,onlyChanged:t.onlyChanged,...s===void 0?{}:{unit:s}}),l=Wf(c.kinds,t.appearance?.kinds,{dashes:!1}),u=e=>e===void 0?pm:l.get(e)??pm,d=t.referenceLine??`today`,f=t.showDependencies??!0,p=[Ff,dm,fm].map(e=>({id:gp(`tl`,e),paint:e})),m=[{id:`header-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:58,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:38,y2:58,stroke:lm})),{shape:`line`,x1:0,x2:c.width,y1:57.5,y2:57.5,stroke:Ff}]},...c.upper.map(e=>({id:`upper-${e.x}`,testId:`timeline-upper`,primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:18,y2:58,stroke:Ff},{shape:`text`,x:e.x+4,y:32,text:e.label,fontSize:11,fontWeight:600,fill:Pf,fontFamily:qf,testId:`timeline-upper`}]})),{id:`year-repeats`,primitives:(c.unit===`month`?c.months:[]).filter((e,t)=>t>0&&e.month%3==0&&e.month!==0).map(e=>({shape:`text`,x:e.x+4,y:32,text:String(e.year),fontSize:11,fill:Ff,fontFamily:qf,testId:`timeline-year-repeat`}))},{id:`units`,primitives:c.lower.map(e=>({shape:`text`,x:e.x+e.width/2,y:52,text:nt(e,c.unit),fontSize:10,textAnchor:`middle`,fill:Ff,fontFamily:qf,testId:`timeline-unit`}))}];c.periods.length>0&&m.push({id:`calendar-bands`,primitives:c.periods.map(e=>({shape:`rect`,x:e.x,y:18,width:e.width,height:40,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}))}),c.headerLabels.length>0&&m.push({id:`calendar-names`,primitives:c.headerLabels.map(e=>{let t=e.of===`period`?c.periods.find(t=>t.index===e.index)?.kind:c.references.find(t=>t.index===e.index)?.kind;return{shape:`text`,...e.of===`reference`?{x:e.x+e.width/2,textAnchor:`middle`}:{x:e.x},y:12,text:e.text,fontSize:10,fill:t===void 0?Ff:u(t).stroke,fontFamily:qf,testId:`timeline-${e.of}-name`}})});let h=d===`dated`?Sm(t.today):`Today`;if(d!==`none`&&`x`in c.today){let e=c.today.x,t=Math.max(44,h.length*6+10);m.push({id:`today-tag`,testId:`timeline-today-tag`,primitives:[{shape:`rect`,x:e-t/2,y:1,width:t,height:15,rx:3,fill:um},{shape:`text`,x:e,y:12,text:h,fontSize:10,fontWeight:600,textAnchor:`middle`,fill:`#ffffff`,fontFamily:qf},{shape:`line`,x1:e,x2:e,y1:16,y2:58,stroke:um,strokeWidth:2}]})}if(d!==`none`&&`outside`in c.today){let e=c.today.outside===`before`,t=d===`dated`?Sm(c.today.day):`Today (${Re(c.today.day)})`;m.push({id:`today-outside`,primitives:[{shape:`text`,x:e?4:c.width-4,y:12,text:e?`◂ ${t} is before this range`:`${t} is after this range ▸`,fontSize:10,fontWeight:600,textAnchor:e?`start`:`end`,fill:um,fontFamily:qf,testId:`timeline-today-outside`,data:{side:c.today.outside}}]})}let g=(()=>{if(t.selection===void 0)return;let e=n.rows[t.selection.row];if(e?.type===`task`)return t.selection.item===void 0?e.id:e.items[t.selection.item]?.id})(),_=e=>g!==void 0&&(e.from===g||e.to===g),v=[{id:`rows-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:c.height,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:0,y2:c.height,stroke:lm}))]},...c.rows.map(e=>e.type===`separator`?{id:`separator-${e.row}`,testId:`timeline-separator`,primitives:[{shape:`rect`,x:0,y:e.y,width:c.width,height:e.height,fill:`#f4f4f5`},{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:e.type===`section`?{id:`section-${e.row}`,testId:`timeline-section`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:{id:`row-${e.row}`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#f4f4f5`}]})];for(let e of c.periods){let t=n.periods[e.index],r=`${t.label??`Period`}: ${Sm(Le(t.start))} – ${Sm(Le(t.end))}`,i=[{shape:`rect`,x:e.x,y:0,width:e.width,height:c.height,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}];e.kind===void 0&&i.push(...xm(e.x,0,e.width,c.height)),v.push({id:`period-${e.index}`,testId:`timeline-period`,title:r,data:{...e.kind?{kind:e.kind}:{}},primitives:i})}for(let e of c.references){let t=e.kind===void 0?`#3f3f46`:u(e.kind).stroke;v.push({id:`reference-${e.index}`,testId:`timeline-reference`,title:`${e.label}: ${Sm(Le(e.date))}`,data:{...e.kind?{kind:e.kind}:{}},primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:0,y2:c.height,stroke:t,strokeWidth:1.5,strokeDasharray:`6 3`}]})}if(f)for(let e of c.dependencies){let t=_(e),r=t?fm:e.satisfied?Ff:dm,i=n.dependencies[e.index];v.push({id:`dependency-${e.index}`,testId:`timeline-dependency`,title:_t(n,i,e.satisfied),data:{from:e.from,to:e.to,type:e.type,satisfied:String(e.satisfied),emphasised:String(t)},primitives:[{shape:`path`,d:`M${e.points.map(e=>`${e.x},${e.y}`).join(` L`)}`,stroke:r,strokeWidth:t?2.25:1.25,...e.satisfied?{}:{strokeDasharray:`4 3`},markerEnd:gp(`tl`,r)}]})}for(let e of c.items){let r=u(e.kind),i=t.selection?.row===e.row&&t.selection.item===e.item,a=[],o=e.change===`removed`;if(e.ghost!==void 0&&(e.type===`activity`?a.push({shape:`rect`,x:e.ghost.x,y:e.ghost.y,width:e.ghost.width,height:e.ghost.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`,data:{previous:`true`}}):e.ghostCenter!==void 0&&(e.ghostCenter.y===e.center.y&&a.push({shape:`line`,x1:e.ghostCenter.x,x2:e.center.x,y1:e.center.y,y2:e.center.y,stroke:Ff,strokeWidth:1,strokeDasharray:`2 2`}),a.push({shape:`path`,d:bm(e.ghostCenter.x,e.ghostCenter.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`,data:{previous:`true`}}))),o)a.push(e.type===`activity`?{shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`}:{shape:`path`,d:bm(e.center.x,e.center.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`});else if(e.type===`activity`){let t=e.kind!==void 0;a.push({shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:t?r.stroke:r.fill,...t?{fillOpacity:mm}:{},stroke:i?fm:r.stroke,strokeWidth:i?2.5:1.25}),r.hatch!==void 0&&a.push(...xm(e.glyph.x,e.glyph.y,e.glyph.width,e.glyph.height,r.hatch,r.stroke,4,.8))}else a.push({shape:`path`,d:bm(e.center.x,e.center.y,7),fill:r.stroke,stroke:i?fm:`#ffffff`,strokeWidth:i?2:.75});e.label!==void 0&&a.push({shape:`text`,x:e.label.x,y:e.label.y+12,...e.label.note!==void 0&&e.label.text.endsWith(e.label.note)?{text:e.label.text.slice(0,-e.label.note.length).trimEnd(),note:e.label.note}:{text:e.label.text},fontSize:11,fill:Pf,fontFamily:qf,testId:`timeline-annotation`,...e.label.struck?{textDecoration:`line-through`}:{},...e.label.inside?{}:{stroke:`#ffffff`,strokeWidth:3,paintOrder:`stroke`}}),v.push({id:`item-${e.row}-${e.item}`,testId:`timeline-${e.type}`,title:wm(n,c,e),data:{row:String(e.row),item:String(e.item),...e.kind===void 0?{}:{kind:e.kind},...e.change===void 0?{}:{change:e.change},selected:String(i)},primitives:a})}d!==`none`&&`x`in c.today&&v.push({id:`today`,testId:`timeline-today`,primitives:[{shape:`line`,x1:c.today.x,x2:c.today.x,y1:0,y2:c.height,stroke:um,strokeWidth:2,opacity:.85}]});let y=c.rows.map(e=>{let t=58+e.y,n=e.type===`section`?`${e.label??``} (${e.tasks.length})`.trim():e.type===`separator`?e.label??``:e.label,i=e.type!==`task`;return{id:`label-${e.row}`,primitives:[...i?[{shape:`line`,x1:0,x2:r,y1:t+.5,y2:t+.5,stroke:`#a1a1aa`,strokeWidth:1}]:[],{shape:`text`,x:8,y:e.type===`separator`?t+e.height-6:t+e.height/2+4,text:Cm(n,r-12),fontSize:11,...i?{fontWeight:600}:{},fill:i?Ff:Pf,fontFamily:qf}]}}),b=new Map;for(let e of n.rows)if(e.type===`task`)for(let t of e.items){if(t.kind===void 0)continue;let e=b.get(t.kind)??{activity:!1,milestone:!1};e[t.type]=!0,b.set(t.kind,e)}let x=Gf(c.kinds,l),S=[],C=0,w=0,T=r+c.width;for(let e of c.kinds){let t=u(e),n=b.get(e);if(n===void 0)continue;let r=x.has(e)?`${e} (same colour as ${x.get(e).join(`, `)})`:e,i=(n.activity?22:0)+(n.milestone?16:0)+r.length*Ce+18;C>0&&C+i>T&&(C=0,w+=1);let a=w*vm,o=[],s=C;n.activity&&(o.push({shape:`rect`,x:s,y:a+4,width:16,height:8,rx:2,fill:t.stroke,stroke:t.stroke,fillOpacity:mm}),t.hatch!==void 0&&o.push(...xm(s,a+4,16,8,t.hatch,t.stroke,4,.8)),s+=22),n.milestone&&(o.push({shape:`path`,d:bm(s+6,a+8,6),fill:t.stroke}),s+=16),o.push({shape:`text`,x:s,y:a+12,text:r,fontSize:10,fill:Ff,fontFamily:qf}),S.push({id:`legend-${e}`,...t.declared===!0?{title:`${e} — project colour`,data:{kind:e,"colour-source":`project`}}:{data:{kind:e}},primitives:o}),C+=i}let E=[...c.periods.map(e=>({kind:e.kind,line:!1,text:n.periods[e.index].label??`Period`})),...c.references.map(e=>({kind:e.kind,line:!0,text:e.label}))];if(E.length>0&&(C>0&&(C=0,w+=1),E.forEach((e,t)=>{let n=22+e.text.length*Ce+18;C>0&&C+n>T&&(C=0,w+=1);let r=w*vm,i=e.kind===void 0?e.line?`#3f3f46`:`#a1a1aa`:u(e.kind).stroke;S.push({id:`legend-calendar-${t}`,testId:`timeline-calendar-legend`,primitives:[e.line?{shape:`line`,x1:C+8,x2:C+8,y1:r+2,y2:r+14,stroke:i,strokeWidth:1.5,strokeDasharray:`3 2`}:{shape:`rect`,x:C,y:r+3,width:16,height:10,fill:i,fillOpacity:.25},{shape:`text`,x:C+22,y:r+12,text:e.text,fontSize:10,fill:Ff,fontFamily:qf}]}),C+=n})),n.comparedTo!==void 0){C>0&&(C=0,w+=1);let e=w*vm,t=[{shape:`rect`,x:0,y:e+4,width:16,height:8,rx:2,fill:`none`,stroke:Ff,strokeDasharray:`4 3`},{shape:`text`,x:22,y:e+12,text:`previous dates (${n.comparedTo.label})`,fontSize:10,fill:Ff,fontFamily:qf}],r=22+(`previous dates (${n.comparedTo.label})`.length+3)*Ce;t.push({shape:`text`,x:r,y:e+12,text:`(new)`,fontStyle:`italic`,fontSize:10,fill:Ff,fontFamily:qf},{shape:`text`,x:r+5*Ce,y:e+12,text:`: added since`,fontSize:10,fill:Ff,fontFamily:qf},{shape:`text`,x:r+20*Ce,y:e+12,text:`removed`,fontSize:10,fill:Ff,fontFamily:qf,textDecoration:`line-through`},{shape:`text`,x:r+28*Ce,y:e+12,text:`: dropped since`,fontSize:10,fill:Ff,fontFamily:qf}),S.push({id:`legend-comparison`,testId:`timeline-comparison-legend`,primitives:t})}let ee=S.length===0?0:(w+1)*vm+6;return{layout:c,pxPerDay:a,overWidth:o,labelWidth:r,tints:l,markers:p,header:m,rows:v,labels:y,legend:{groups:S,height:ee}}}function Em(e,t,n){let r=e=>{switch(e.shape){case`rect`:case`text`:return{...e,x:e.x+t,y:e.y+n};case`line`:return{...e,x1:e.x1+t,x2:e.x2+t,y1:e.y1+n,y2:e.y2+n};case`path`:return{...e,d:Dm(e.d,t,n)}}};return{...e,primitives:e.primitives.map(r),...e.groups?{groups:e.groups.map(e=>Em(e,t,n))}:{}}}function Dm(e,t,n){return e.replace(/(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/g,(e,r,i)=>`${+(Number(r)+t).toFixed(2)},${+(Number(i)+n).toFixed(2)}`)}function Om(e,t){let n=Tm(e,{...t,selection:void 0}),r=t.comparison===`new`?void 0:e.comparedTo,i=gm+(e.title?_m:0)+(r?18:0),a=gm,o=a+n.labelWidth,s=[];if(e.title&&s.push({id:`title`,primitives:[{shape:`text`,x:a,y:23,text:e.title,fontSize:13,fontWeight:600,fill:Pf,fontFamily:qf}]}),r){let t=gm+(e.title?_m:0)+12;s.push({id:`compared-to`,testId:`timeline-compared-to`,primitives:[{shape:`text`,x:a,y:t,text:`Compared with ${r.label}${r.date?` (${Sm(Le(r.date)??0)})`:``}`,fontSize:11,fill:Ff,fontFamily:qf}]})}s.push(...n.header.map(e=>Em(e,o,i))),s.push(...n.rows.map(e=>Em(e,o,i+58))),s.push(...n.labels.map(e=>Em(e,a,i)));let c=i+58+n.layout.height+10;s.push(...n.legend.groups.map(e=>Em(e,a,c)));let l=Math.ceil(o+n.layout.width+gm),u=Math.ceil(c+n.legend.height+gm);return{width:l,height:u,viewBox:`0 0 ${l} ${u}`,ariaLabel:`Timeline${e.title?` "${e.title}"`:``} from ${e.time.start} to ${e.time.end}`,background:`#ffffff`,markers:n.markers,groups:s,overWidth:n.overWidth}}var km=.21,Am=.65;function jm(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Mm(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function Nm(e,t,n){let r=jm(e),i=jm(t),a=jm(n),o=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*a),s=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*a),c=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*a);return{l:.2104542553*o+.793617785*s-.0040720468*c,a:1.9779984951*o-2.428592205*s+.4505937099*c,b:.0259040371*o+.7827717662*s-.808675766*c}}function Pm({l:e,a:t,b:n}){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[4.0767416621*r-3.3077115913*i+.2309699292*a,-1.2684380046*r+2.6097574011*i-.3413193965*a,-.0041960863*r-.7034186147*i+1.707614701*a]}var Fm=e=>e.every(e=>e>=-1e-4&&e<=1.0001);function Im(e){return`#${e.map(e=>Math.round(Math.min(1,Math.max(0,Mm(Math.min(1,Math.max(0,e)))))*255).toString(16).padStart(2,`0`)).join(``)}`}var Lm=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,Rm=new Map;function zm(e){if(!Lm.test(e))return e;let t=Rm.get(e);if(t!==void 0)return t;let[n,r,i]=(e.length===4?[...e.slice(1)].map(e=>e+e):[1,3,5].map(t=>e.slice(t,t+2))).map(e=>Number.parseInt(e,16)/255),a=Nm(n,r,i),o=km+.73*(1-Math.min(1,Math.max(0,a.l)))**Am,s=1,c=Pm({l:o,a:a.a,b:a.b});if(!Fm(c)){let e=0,t=1;for(let n=0;n<20;n++)s=(e+t)/2,Fm(Pm({l:o,a:a.a*s,b:a.b*s}))?e=s:t=s;s=e,c=Pm({l:o,a:a.a*s,b:a.b*s})}let l=Im(c);return Rm.set(e,l),l}function Bm(e){if(e!==void 0&&Lm.test(e))return`light-dark(${e}, ${zm(e)})`}function Vm(e){let t=Bm(e.fill),n=Bm(e.stroke);if(t!==void 0||n!==void 0)return{...t===void 0?{}:{fill:t},...n===void 0?{}:{stroke:n}}}function Hm({primitive:e}){let t=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]));switch(e.shape){case`rect`:return(0,o.jsx)(`rect`,{...t,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,fill:e.fill,fillOpacity:e.fillOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,style:Vm(e)});case`text`:{let n={x:e.x,y:e.y,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,textAnchor:e.textAnchor},r=(0,o.jsxs)(o.Fragment,{children:[e.text,e.note!==void 0&&(0,o.jsxs)(o.Fragment,{children:[` `,(0,o.jsx)(`tspan`,{fontStyle:`italic`,children:e.note})]})]}),i=e.paintOrder===`stroke`,a=(0,o.jsx)(`text`,{...t,"data-testid":e.testId,...n,fill:e.fill,stroke:i?void 0:e.stroke,strokeWidth:i?void 0:e.strokeWidth,textDecoration:e.textDecoration,opacity:e.opacity,style:Vm({fill:e.fill,stroke:i?void 0:e.stroke}),children:r});return i?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`text`,{...n,fill:e.stroke,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:Vm({fill:e.stroke,stroke:e.stroke}),"aria-hidden":`true`,children:r}),a]}):a}case`line`:return(0,o.jsx)(`line`,{...t,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,style:Vm(e)});case`path`:return(0,o.jsx)(`path`,{...t,d:e.d,fill:e.fill??`none`,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,pointerEvents:`none`,style:Vm(e)})}}function Um({group:e,interaction:t}){let n=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t])),{extra:r,before:i}=t?.(e)??{};return(0,o.jsxs)(`g`,{...n,"data-testid":e.testId,opacity:e.opacity,...r,children:[e.title===void 0?null:(0,o.jsx)(`title`,{children:e.title}),i,e.primitives.map((e,t)=>(0,o.jsx)(Hm,{primitive:e},t)),(e.groups??[]).map(e=>(0,o.jsx)(Um,{group:e,interaction:t},e.id))]})}function Wm({markers:e}){return(0,o.jsx)(`defs`,{children:e.map(e=>(0,o.jsx)(`marker`,{id:e.id,markerWidth:`7`,markerHeight:`7`,refX:`9`,refY:`5`,viewBox:`0 0 10 10`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,o.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:e.paint,style:Vm({fill:e.paint})})},e.id))})}var Gm=`#2563eb`,Km={fill:`#e4e4e7`,stroke:`#52525b`};function qm(e){let t=e.replace(/[^\p{L}\p{N}._-]+/gu,`-`),n=0,r=t.length;for(;n<r&&t[n]===`-`;)n+=1;for(;r>n&&t[r-1]===`-`;)--r;return t.slice(n,r)}var Jm=[`week`,`month`,`quarter`,`fit`];function Ym(e){return{scale:e.time.scale,compact:!1,showDependencies:!0,comparison:`compare`,onlyChanged:!1}}function Xm(e){return e.type===`activity`?`${e.start} to ${e.end}`:e.date}function Zm({data:e,today:t,appearance:n,display:r,onDisplayChange:i,onSelect:s,saveFigure:c,exportRef:l}){let u=t??ze(),[d,f]=(0,a.useState)(()=>Ym(e)),p=r??d,m=i??f,h=e=>t=>m(n=>({...n,[e]:typeof t==`function`?t(n[e]):t})),g=e.comparedTo!==void 0,{comparison:_,onlyChanged:v,compact:y,showDependencies:b,scale:x}=p,S=h(`comparison`),C=h(`onlyChanged`),w=(0,a.useMemo)(()=>g&&_===`new`?cm(e):e,[e,g,_]),T=g&&_===`compare`&&v,E=h(`compact`),ee=h(`showDependencies`),[D,te]=(0,a.useState)(void 0),ne=h(`scale`),re=(0,a.useRef)(null),[ie,ae]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=re.current;if(e===null||(ae(e.clientWidth),typeof ResizeObserver>`u`))return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>ae(e.clientWidth))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]);let oe=(Le(w.time.end)??0)-(Le(w.time.start)??0)+1,se=ie>0?ie/oe:0,ce=x===`fit`?{pxPerDay:Math.max(hm,se)}:{pxPerDay:Math.max(Qe[x],se),unit:x},[le,ue]=(0,a.useState)(void 0),de=(0,a.useMemo)(()=>Tm(w,{today:u,compact:y,showDependencies:b,appearance:n??null,referenceLine:`today`,onlyChanged:T,...ce,...D===void 0?{}:{selection:D.type===`item`?{row:D.row,item:D.item}:{row:D.row}}}),[w,u,y,b,n,D,T,x,ie]),O=de.layout,fe=de.tints,pe=(0,a.useMemo)(()=>{let e=!1;for(let t of w.rows)if(t.type===`separator`)e=!0;else if(e)return!0;return!1},[w]),me=(0,a.useMemo)(()=>Gf(O.kinds,fe),[O.kinds,fe]),he=(0,a.useMemo)(()=>ht(w),[w]),ge=(0,a.useMemo)(()=>{let e=new Map;for(let t of w.rows)if(t.type===`task`)for(let n of t.items){if(n.kind===void 0)continue;let t=e.get(n.kind)??{activity:!1,milestone:!1};t[n.type]=!0,e.set(n.kind,t)}return e},[w]),_e=e=>e===void 0?Km:fe.get(e)??Km,ve=(e,t)=>e!==void 0&&e.type===t.type&&e.row===t.row&&(e.type===`task`||t.type===`item`&&e.item===t.item),ye=e=>{let t=ve(D,e);if(te(t=>ve(t,e)?void 0:e),!s)return;let n=w.rows[e.row];if(t||n?.type!==`task`)return s(void 0);s(e.type===`item`?{task:n,item:n.items[e.item]}:{task:n})},be=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),ye(t))},xe=e=>{let t=e.data?.row,n=e.data?.item;if(e.testId!==`timeline-activity`&&e.testId!==`timeline-milestone`||t===void 0||n===void 0)return{};let r={type:`item`,row:Number(t),item:Number(n)},i=`${t}:${n}`,a=O.items.find(e=>e.row===r.row&&e.item===r.item);return{extra:{role:`button`,tabIndex:0,"aria-label":e.title,"aria-pressed":e.data?.selected===`true`,style:{cursor:`pointer`,outline:`none`},onClick:()=>ye(r),onKeyDown:e=>be(e,r),onFocus:()=>ue(i),onBlur:()=>ue(e=>e===i?void 0:e)},before:a===void 0?void 0:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`rect`,{"data-testid":`timeline-hit`,x:a.glyph.x,y:a.glyph.y,width:a.glyph.width,height:a.glyph.height,fill:`transparent`}),le===i&&(0,o.jsx)(`rect`,{"data-testid":`timeline-focus-ring`,x:a.glyph.x-3,y:a.glyph.y-3,width:a.glyph.width+6,height:a.glyph.height+6,rx:4,fill:`none`,stroke:Gm,strokeWidth:1.5,strokeDasharray:`3 2`,style:Vm({stroke:Gm})})]})}},[k,A]=(0,a.useState)(null),Se=()=>ep(Om(w,{today:u,compact:y,showDependencies:b,onlyChanged:T,appearance:n??null,referenceLine:`dated`,...ce})),Ce=`timeline-${qm(w.title??`plan`)||`plan`}.svg`,we=async()=>{if(c){let e=await c(Ce,Se()).catch(()=>!1);A(e===!1?`could not save`:e)}else{let e=URL.createObjectURL(new Blob([Se()],{type:`image/svg+xml`})),t=document.createElement(`a`);t.href=e,t.download=Ce,t.click(),URL.revokeObjectURL(e),A(`SVG downloaded`)}window.setTimeout(()=>A(null),2500)};(0,a.useImperativeHandle)(l,()=>({svg:()=>void we()}));let Te=async()=>{A(await Bt(Se())?`SVG markup copied`:`could not copy`),window.setTimeout(()=>A(null),2500)};(0,a.useEffect)(()=>{let e=re.current;if(e===null)return;let t=dt(O,e.clientWidth);t!==void 0&&(e.scrollLeft=t)},[]);let Ee=(0,a.useRef)(void 0),De=e=>{let t=re.current;t!==null&&(Ee.current=O.start+(t.scrollLeft+t.clientWidth/2)/de.pxPerDay),ne(e)};return(0,a.useLayoutEffect)(()=>{let e=re.current,t=Ee.current;Ee.current=void 0,e!==null&&t!==void 0&&(e.scrollLeft=Math.max(0,(t-O.start)*de.pxPerDay-e.clientWidth/2))},[de.pxPerDay,O.start]),(0,o.jsxs)(`div`,{"data-testid":`timeline`,className:`w-full min-w-0 rounded border border-zinc-200 bg-white text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100`,onKeyDown:e=>{e.key===`Escape`&&te(void 0)},children:[w.title!==void 0&&w.title!==``&&(0,o.jsx)(`p`,{className:`border-b border-zinc-200 px-2 py-1 text-sm font-medium dark:border-zinc-700`,"data-testid":`timeline-title`,children:w.title}),g&&_===`compare`&&(0,o.jsxs)(`p`,{className:`border-b border-zinc-200 px-2 py-0.5 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-compared-to`,children:[`Compared with `,(0,o.jsx)(`span`,{className:`font-medium text-zinc-700 dark:text-zinc-200`,children:e.comparedTo.label}),e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`]}),(0,o.jsxs)(`div`,{className:`flex`,children:[(0,o.jsxs)(`div`,{className:`shrink-0 border-r border-zinc-200 text-xs dark:border-zinc-700`,style:{width:he},"data-testid":`timeline-labels`,children:[(0,o.jsx)(`div`,{style:{height:58}}),O.rows.map(e=>e.type===`section`?(0,o.jsxs)(`div`,{"data-testid":`timeline-section-label`,className:`flex items-center border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},title:`${e.label??`Untitled section`}: ${e.tasks.length} ${e.tasks.length===1?`task`:`tasks`}`,children:[(0,o.jsx)(`span`,{className:`truncate`,children:e.label??``}),(0,o.jsxs)(`span`,{className:`ml-1 shrink-0 font-normal text-zinc-400 dark:text-zinc-500`,children:[`(`,e.tasks.length,`)`]})]},e.row):e.type===`separator`?(0,o.jsx)(`div`,{"data-testid":`timeline-separator-label`,className:`flex items-end border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},children:e.label??``},e.row):(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-task-label`,"aria-pressed":D?.type===`task`&&D.row===e.row,className:`block w-full truncate border-t border-zinc-100 px-2 text-left hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800 `+(D?.type===`task`&&D.row===e.row?`bg-blue-50 font-medium dark:bg-blue-950/50`:``),style:{height:e.height},title:`${e.label} (${e.id})`,onClick:()=>ye({type:`task`,row:e.row}),children:e.label},e.row))]}),(0,o.jsxs)(`div`,{ref:re,className:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`timeline-scroller`,children:[(0,o.jsx)(`svg`,{width:O.width,height:58,role:`img`,"aria-label":`Calendar from ${w.time.start} to ${w.time.end}`,"data-testid":`timeline-header`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:de.header.map(e=>(0,o.jsx)(Um,{group:e},e.id))}),(0,o.jsxs)(`svg`,{width:O.width,height:O.height,role:`group`,"aria-label":`Tasks and items${w.title?` of ${w.title}`:``}`,"data-testid":`timeline-body`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:[(0,o.jsx)(Wm,{markers:de.markers}),de.rows.map(e=>(0,o.jsx)(Um,{group:e,interaction:xe},e.id))]})]})]}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,children:[(0,o.jsx)(`span`,{className:`flex items-center gap-1 text-zinc-500 dark:text-zinc-400`,role:`group`,"aria-label":`Scale`,"data-testid":`timeline-scale`,children:Jm.map((e,t)=>(0,o.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,o.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,o.jsx)(`button`,{type:`button`,"data-scale":e,"aria-pressed":x===e,className:x===e?`font-semibold text-zinc-800 dark:text-zinc-100`:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>De(e),children:e})]},e))}),g&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-comparison-toggle`,"aria-pressed":_===`new`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(void 0),S(e=>e===`compare`?`new`:`compare`)},children:_===`compare`?`new version only`:`show the comparison`}),g&&_===`compare`&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-only-changed-toggle`,"aria-pressed":v,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(void 0),C(e=>!e)},children:v?`show every task`:`only what moved`}),T&&O.hiddenTasks>0&&(0,o.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-unchanged-hidden`,children:[O.hiddenTasks,` unchanged `,O.hiddenTasks===1?`task`:`tasks`,` hidden`]}),pe&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-compact-toggle`,"aria-pressed":y,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{te(e=>e?.type===`task`?void 0:e),E(e=>!e)},children:y?`one row per task`:`one row per section`}),(w.dependencies??[]).length>0&&(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-dependencies-toggle`,"aria-pressed":!b,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>ee(e=>!e),children:b?`hide dependencies`:`show dependencies`}),!b&&(0,o.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-dependencies-hidden`,children:[O.dependencies.length,` `,O.dependencies.length===1?`dependency`:`dependencies`,` hidden`,O.dependencies.some(e=>!e.satisfied)?`, some not satisfied by the dates`:``]}),(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-download-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void we(),children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,"data-testid":`timeline-copy-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void Te(),children:`copy markup`}),k!==null&&(0,o.jsx)(`span`,{role:`status`,className:`text-emerald-700 dark:text-emerald-400`,children:k})]}),g&&_===`compare`&&(0,o.jsxs)(`p`,{className:`flex flex-wrap items-center gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-comparison-key`,children:[(0,o.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(`svg`,{width:18,height:12,"aria-hidden":`true`,children:(0,o.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:`none`,stroke:`#71717a`,strokeDasharray:`4 3`,style:Vm({stroke:`#71717a`})})}),`previous dates`]}),(0,o.jsxs)(`span`,{children:[(0,o.jsx)(`i`,{children:`(new)`}),`: added since`]}),(0,o.jsxs)(`span`,{children:[(0,o.jsx)(`span`,{className:`line-through`,children:`removed`}),`: dropped since`]})]}),(O.periods.length>0||O.references.length>0)&&(0,o.jsxs)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-600 dark:border-zinc-700 dark:text-zinc-300`,"data-testid":`timeline-calendar-legend`,children:[O.periods.map(e=>{let t=w.periods[e.index];return(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-period":e.index,title:`${t.label??`Period`}: ${t.start} – ${t.end}`,children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-2.5 w-4 rounded-sm`,style:{background:Bm(e.kind===void 0?`#a1a1aa`:_e(e.kind).stroke),opacity:.35}}),t.label??`Period`]},`p${e.index}`)}),O.references.map(e=>(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-reference":e.index,title:`${e.label}: ${w.references[e.index].date}`,children:[(0,o.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 border-l-2 border-dashed`,style:{borderColor:Bm(e.kind===void 0?`#3f3f46`:_e(e.kind).stroke)}}),e.label]},`r${e.index}`))]}),O.kinds.some(e=>ge.has(e))&&(0,o.jsx)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-legend`,children:O.kinds.filter(e=>ge.has(e)).map(e=>{let t=_e(e);return(0,o.jsxs)(`li`,{className:`flex items-center gap-1`,"data-kind":e,...t.declared===!0?{"data-colour-source":`project`,title:`${e} — project colour`}:{},children:[ge.get(e)?.activity&&(0,o.jsxs)(`svg`,{width:18,height:12,"aria-hidden":`true`,"data-testid":`timeline-legend-bar`,children:[(0,o.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:t.stroke,fillOpacity:.35,stroke:t.stroke,style:Vm({fill:t.stroke,stroke:t.stroke})}),t.hatch!==void 0&&xm(1,2,16,8,t.hatch,t.stroke,4,.8).map((e,t)=>e.shape===`line`?(0,o.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:Vm({stroke:e.stroke})},t):null)]}),ge.get(e)?.milestone&&(0,o.jsx)(`svg`,{width:14,height:14,"aria-hidden":`true`,"data-testid":`timeline-legend-star`,children:(0,o.jsx)(`path`,{d:bm(7,7,6),fill:t.stroke,style:Vm({fill:t.stroke})})}),(0,o.jsx)(`span`,{className:`font-mono`,children:e}),t.declared===!0&&(0,o.jsx)(`span`,{className:`sr-only`,children:` (project colour)`}),me.has(e)&&(0,o.jsxs)(`span`,{className:`text-zinc-500 dark:text-zinc-400`,"data-testid":`timeline-legend-shared`,children:[`(same colour as `,me.get(e).join(`, `),`)`]})]},e)})}),D!==void 0&&(0,o.jsx)(Qm,{data:w,selection:D,dependencies:O.dependencies})]})}function Qm({data:e,selection:t,dependencies:n}){let r=e.rows[t.row];if(r?.type!==`task`)return null;let i=t.type===`item`?r.items[t.item]:void 0,a=t.type===`task`?r.id:i?.id,s=a===void 0?[]:n.filter(e=>e.to===a),c=a===void 0?[]:n.filter(e=>e.from===a),l=(t,n)=>(0,o.jsxs)(`li`,{"data-satisfied":String(t.satisfied),className:t.satisfied?``:`text-red-700`,children:[gt(e,n),` — `,t.type,t.satisfied?``:` — not satisfied by the dates`]},t.index);return(0,o.jsx)(`div`,{className:`border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-details`,role:`status`,children:(0,o.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Task`}),(0,o.jsxs)(`dd`,{children:[r.label,` `,(0,o.jsxs)(`span`,{className:`font-mono text-zinc-500 dark:text-zinc-400`,children:[`(`,r.id,`)`]})]}),i!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Type`}),(0,o.jsx)(`dd`,{children:i.type}),(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:i.type===`activity`?`Dates`:`Date`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:Xm(i)}),i.label!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Label`}),(0,o.jsx)(`dd`,{children:i.label})]}),i.kind!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Kind`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:i.kind})]}),i.id!==void 0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Identifier`}),(0,o.jsx)(`dd`,{className:`font-mono`,children:i.id})]})]}),s.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Waits on`}),(0,o.jsx)(`dd`,{children:(0,o.jsx)(`ul`,{"data-testid":`timeline-predecessors`,children:s.map(e=>l(e,e.from))})})]}),c.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Needed by`}),(0,o.jsx)(`dd`,{children:(0,o.jsx)(`ul`,{"data-testid":`timeline-successors`,children:c.map(e=>l(e,e.to))})})]})]})})}var $m=(0,a.createContext)(null);function eh(e){let t=e.startsWith(`workspace:`)?e.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e)?null:e;if(t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t))return null;let n=t.replaceAll(`\\`,`/`);return n.split(`/`).includes(`..`)?null:n}function th(e){let t=eh(e);if(t!==null)return{kind:`workspace-file`,path:t};if(/^https?:\/\//i.test(e))return{kind:`external-url`,url:e}}function nh(){let[e,t]=(0,a.useState)(void 0);return{hover:e=>({onPointerEnter:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerMove:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerLeave:()=>t(void 0)}),Tooltip:()=>e===void 0?null:(0,o.jsx)(`div`,{"data-testid":`diagram-tooltip`,role:`tooltip`,style:{position:`fixed`,left:e.x+14,top:e.y+14,zIndex:120},className:`pointer-events-none max-w-sm rounded bg-zinc-900 px-2 py-1 text-xs text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:e.text})}}function rh({data:e,isProposal:t,arrangement:n,onArrange:r,hidden:i,setHidden:s,orientation:c,viewpoint:l}){let u=(0,a.useRef)(null),[d,f]=(0,a.useState)(void 0),[p,m]=(0,a.useState)(!1),{hover:h,Tooltip:g}=nh(),_=(0,a.useRef)(void 0);(0,a.useEffect)(()=>()=>_.current?.(),[]);let v=(0,a.useContext)($m),[y,b]=(0,a.useState)(void 0),x=y??n,S=(0,a.useMemo)(()=>Tp(e,{isProposal:t,hidden:i,orientation:c,...x===void 0?{}:{arrangement:x},...l===void 0?{}:{viewpoint:l},...v===null?{}:{appearance:v}}),[e,t,i,x,c,l,v]),C=e=>{if(e.button!==0)return;let t=e.target;if(t.closest(`[data-draggable="node"]`)!==null||t.closest(`[data-legend-entry]`)!==null)return;let n=u.current?.parentElement??null;for(;n!==null&&n.scrollWidth<=n.clientWidth&&n.scrollHeight<=n.clientHeight;)n=n.parentElement;if(n===null)return;e.preventDefault();let r=e.clientX,i=e.clientY,a=n.scrollLeft,o=n.scrollTop,s=e.currentTarget;s.setPointerCapture?.(e.pointerId),m(!0);let c=e=>{n.scrollLeft=a-(e.clientX-r),n.scrollTop=o-(e.clientY-i)},l=()=>{_.current=void 0,s.releasePointerCapture?.(e.pointerId),s.removeEventListener(`pointermove`,c),s.removeEventListener(`pointerup`,l),s.removeEventListener(`pointercancel`,l),m(!1)};_.current?.(),_.current=l,s.addEventListener(`pointermove`,c),s.addEventListener(`pointerup`,l),s.addEventListener(`pointercancel`,l)},w=t=>a=>{if(a.button!==0)return;a.preventDefault();let o=u.current,s=o===null?1:(o.getBoundingClientRect().width||S.width)/S.width,l=a.clientX,d=a.clientY,{shown:p,page:m}=Cp(e,{hidden:i,orientation:c,...n===void 0?{}:{arrangement:n}}),h=m.cells.find(e=>e.id===rf(t))?.geometry;if(h===void 0)return;let g=a.currentTarget;g.setPointerCapture?.(a.pointerId),f(t);let v,y,x=e=>{let r={x:h.x+(e.clientX-l)/s,y:h.y+(e.clientY-d)/s};v=Mf(p,m,n,t,r,c),y===void 0&&(y=requestAnimationFrame(()=>{y=void 0,b(v)}))},C=()=>{_.current=void 0,y!==void 0&&cancelAnimationFrame(y),g.releasePointerCapture?.(a.pointerId),g.removeEventListener(`pointermove`,x),g.removeEventListener(`pointerup`,C),g.removeEventListener(`pointercancel`,C),f(void 0),b(void 0),v!==void 0&&r(v)};_.current?.(),_.current=C,g.addEventListener(`pointermove`,x),g.addEventListener(`pointerup`,C),g.addEventListener(`pointercancel`,C)},T=e=>{let t=new Set(i);t.delete(e)||t.add(e),s(t)},E=e=>{let t=e.data?.[`element-id`];if(e.data?.draggable===`node`&&t!==void 0)return{extra:{onPointerDown:w(t),style:{cursor:d===t?`grabbing`:`grab`},...e.title===void 0?{}:h(e.title)}};if(e.data?.[`relationship-role`]!==void 0){let t=e.primitives.find(e=>e.shape===`path`&&e.data?.edge===`line`);return{extra:e.title===void 0?{}:h(e.title),before:t===void 0||t.shape!==`path`?null:(0,o.jsx)(`path`,{"data-edge":`hit`,"data-hit":`edge`,d:t.d,fill:`none`,stroke:`transparent`,strokeWidth:14,pointerEvents:`stroke`})}}let n=e.data?.[`legend-entry`];if(n!==void 0&&e.data?.toggles===`true`){let t=e.primitives[0],r=t.shape===`rect`?t.x:t.shape===`line`?t.x1:0,i=t.shape===`rect`?t.y:t.shape===`line`?t.y1-5:0,a=e.primitives.find(e=>e.shape===`text`),s=a?.shape===`text`?op(a.text.replace(` (hidden)`,``))-8:0;return{extra:{onClick:()=>T(n),style:{cursor:`pointer`}},before:(0,o.jsx)(`rect`,{"data-hit":`legend`,x:r-3,y:i-3,width:s,height:16,fill:`transparent`})}}return{}};return(0,o.jsxs)(o.Fragment,{children:[n!==void 0&&Object.keys(n.elements).length>0&&(0,o.jsx)(`button`,{type:`button`,className:`mb-1 text-xs underline text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200`,onClick:()=>r(void 0),children:`reset layout`}),(0,o.jsx)(g,{}),(0,o.jsxs)(`svg`,{ref:u,role:`img`,"aria-label":S.ariaLabel,viewBox:S.viewBox,width:S.width,height:S.height,xmlns:`http://www.w3.org/2000/svg`,onPointerDown:C,style:{cursor:p?`grabbing`:`grab`,touchAction:`none`},children:[(0,o.jsx)(`rect`,{x:Number(S.viewBox.split(` `)[0]),y:Number(S.viewBox.split(` `)[1]),width:S.width,height:S.height,fill:S.background,style:Vm({fill:S.background})}),(0,o.jsx)(Wm,{markers:S.markers}),S.groups.map(e=>(0,o.jsx)(Um,{group:e,interaction:E},e.id))]})]})}function ih({data:e,isProposal:t}){let{hover:n,Tooltip:r}=nh(),i=(0,a.useContext)($m),s=(0,a.useMemo)(()=>Ep(e,{isProposal:t,...i===null?{}:{appearance:i}}),[e,t,i]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(`svg`,{role:`img`,"aria-label":s.ariaLabel,viewBox:s.viewBox,width:s.width,height:s.height,xmlns:`http://www.w3.org/2000/svg`,children:[(0,o.jsx)(`rect`,{x:0,y:0,width:s.width,height:s.height,fill:s.background,style:Vm({fill:s.background})}),(0,o.jsx)(Wm,{markers:s.markers}),s.groups.map(e=>(0,o.jsx)(Um,{group:e,interaction:e=>e.title===void 0?{}:{extra:n(e.title)}},e.id))]}),(0,o.jsx)(r,{})]})}var ah={added:`bg-emerald-50 dark:bg-emerald-950/40`,changed:`bg-amber-50 dark:bg-amber-950/40`,context:`bg-zinc-50 text-zinc-500 dark:bg-zinc-900/60 dark:text-zinc-400`,removed:`bg-red-50 text-red-800 dark:bg-red-950/40 dark:text-red-200`},oh={added:`border-emerald-600 bg-emerald-100 dark:border-emerald-400 dark:bg-emerald-900`,changed:`border-amber-600 bg-amber-100 dark:border-amber-400 dark:bg-amber-900`,context:`border-zinc-400 bg-zinc-100 dark:border-zinc-500 dark:bg-zinc-800`,removed:`border-red-600 bg-red-100 dark:border-red-400 dark:bg-red-900`},sh=48,ch=16,lh={attribute:{label:`is`,className:`text-zinc-600 dark:text-zinc-300`},expects:{label:`expects`,className:`text-amber-700 dark:text-amber-400`},assigns:{label:`asks to set`,className:`text-blue-700 dark:text-blue-400`},removes:{label:`asks to unset`,className:`text-rose-700 line-through dark:text-rose-400`}};function uh({uri:e,text:t,dispatch:n,sha256:r}){let i=th(e);return i===void 0||n===void 0?(0,o.jsx)(`span`,{"data-followable":`no`,children:t}):i.kind===`workspace-file`?(0,o.jsx)(`button`,{type:`button`,"data-followable":`workspace-file`,className:`text-left underline decoration-dotted underline-offset-2 hover:decoration-solid`,onClick:()=>n({kind:`openFile`,path:i.path,...r===void 0?{}:{sha256:r}}),children:t}):(0,o.jsx)(`a`,{"data-followable":`external-url`,className:`underline decoration-dotted underline-offset-2 hover:decoration-solid`,href:i.url,target:`_blank`,rel:`noreferrer`,children:t})}function dh({item:e,traces:t,dispatch:n}){let r=[...e.attributes.map(([e,t])=>[`attribute`,e,Me(t)]),...e.expectations.map(([e,t])=>[`expects`,e,Me(t)]),...e.assignments.map(([e,t])=>[`assigns`,e,Me(t)]),...e.removedAttributes.map(e=>[`removes`,e,``])],i=t??[];if(r.length===0&&e.locations.length===0&&e.artifacts.length===0&&i.length===0)return null;let s=[r.length>0?`${r.length} attribute${r.length===1?``:`s`}`:``,i.length>0?`${i.length} relation${i.length===1?``:`s`}`:``,e.locations.length>0?`${e.locations.length} location${e.locations.length===1?``:`s`}`:``,e.artifacts.length>0?`${e.artifacts.length} artifact${e.artifacts.length===1?``:`s`}`:``].filter(Boolean);return(0,o.jsxs)(`details`,{className:`mt-1 text-[11px]`,"data-testid":`structured-enrichment`,children:[(0,o.jsx)(`summary`,{className:`cursor-pointer text-zinc-500 dark:text-zinc-400`,children:s.join(`, `)}),(0,o.jsxs)(`dl`,{className:`mt-1 grid grid-cols-[auto_auto_1fr] gap-x-2 gap-y-0.5`,children:[r.map(([e,t,n],r)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium ${lh[e].className}`,"data-claim":e,children:lh[e].label}),(0,o.jsx)(`dd`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:t}),(0,o.jsx)(`dd`,{className:`break-words text-zinc-600 dark:text-zinc-300`,children:n})]},`${e}-${t}-${r}`)),i.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-violet-700 dark:text-violet-400`,"data-claim":`relates`,children:e.kind}),(0,o.jsxs)(`dd`,{className:`col-span-2 break-words text-zinc-600 dark:text-zinc-300`,children:[e.fromLabel,` → `,e.toLabel,e.toRow===void 0&&e.toRef!==void 0?` (outside this document)`:``]})]},`trace-${t}`)),e.locations.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`location`,children:`at`}),(0,o.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,o.jsx)(uh,{uri:e.uri,text:Ne(e),dispatch:n})})]},`location-${t}`)),e.artifacts.map((e,t)=>(0,o.jsxs)(a.Fragment,{children:[(0,o.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`artifact`,children:e.rel}),(0,o.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,o.jsx)(uh,{uri:e.uri,text:Pe(e),dispatch:n,sha256:e.sha256})})]},`artifact-${t}`))]})]})}function fh({data:e,hidden:t,setHidden:n,rows:r,traces:i=[],dispatch:s}){let[c,l]=(0,a.useState)(null),u=(0,a.useRef)(null),d=(0,a.useCallback)(()=>[...u.current?.querySelectorAll(`th`)??[]].map(e=>Math.max(sh,Math.round(e.getBoundingClientRect().width))),[]),f=(0,a.useCallback)((e,t)=>l(n=>{let r=n??d(),i=[...r];return i[e]=Math.max(sh,Math.round(t(r[e]??sh))),i}),[d]);function p(e,t){e.preventDefault();let n=e.clientX,r=c??d();l(r);let i=e=>{let i=r[t]??sh;f(t,()=>i+(e.clientX-n))},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}let m=c?.reduce((e,t)=>e+t,0),h=(e,t,n)=>(0,o.jsx)(`div`,{role:n?`separator`:`presentation`,"aria-orientation":n?`vertical`:void 0,"aria-label":n?`Resize column ${t}`:void 0,"aria-hidden":!n||void 0,tabIndex:n?0:void 0,onPointerDown:t=>p(t,e),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?ch:-16;f(e,e=>e+n)},className:`absolute -right-px top-0 h-full w-1.5 cursor-col-resize touch-none hover:bg-zinc-400 focus:bg-zinc-400 focus:outline-none dark:hover:bg-zinc-500 dark:focus:bg-zinc-500`}),g=Fc(e),_=(e,t)=>r?.[t]?.role??Ic(e,g),v=[...new Set(e.rows.map(_).filter(e=>e!==void 0))].sort((e,t)=>Pc.indexOf(e)-Pc.indexOf(t)),y=e.rows.map((e,t)=>({row:e,index:t})).filter(({row:e,index:n})=>{let r=_(e,n);return r===void 0||!t.has(nl(`role`,r))}),b=new Map;for(let e of i)for(let t of[e.fromRow,e.toRow]){if(t===void 0)continue;let n=b.get(t);n===void 0?b.set(t,[e]):n.includes(e)||n.push(e)}let x=e=>{let r=new Set(t),i=nl(`role`,e);r.has(i)?r.delete(i):r.add(i),n(r)};return(0,o.jsxs)(`div`,{className:`overflow-x-auto`,children:[v.length>0&&(0,o.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-[11px]`,"data-testid":`table-role-key`,children:v.map(e=>{let n=t.has(nl(`role`,e));return(0,o.jsxs)(`button`,{type:`button`,onClick:()=>x(e),"aria-pressed":!n,className:`flex items-center gap-1 rounded border border-zinc-300 px-1.5 py-0.5 dark:border-zinc-700 ${n?`opacity-50`:``}`,children:[(0,o.jsx)(`span`,{"data-role-swatch":e,className:`inline-block h-3 w-3 rounded-sm border-2 ${oh[e]}`}),(0,o.jsxs)(`span`,{children:[Nc[e],n?` (hidden)`:``]})]},e)})}),(0,o.jsxs)(`table`,{className:`border-collapse text-xs ${c?``:`w-full`}`,style:m===void 0?void 0:{tableLayout:`fixed`,width:m},children:[(0,o.jsx)(`colgroup`,{children:e.columns.map((e,t)=>(0,o.jsx)(`col`,{style:c?{width:c[t]}:void 0},t))}),(0,o.jsx)(`thead`,{children:(0,o.jsx)(`tr`,{ref:u,children:e.columns.map((e,t)=>(0,o.jsxs)(`th`,{className:`relative border border-zinc-300 px-2 py-1 text-left font-medium dark:border-zinc-700`,children:[(0,o.jsx)(`span`,{className:`block truncate`,children:e}),h(t,e,!0)]},t))})}),(0,o.jsx)(`tbody`,{children:y.map(({row:t,index:n},i)=>{let{cells:a,heading:c}=ce(t),l=r?.[n],u=l?.role??Ic(t,g),d=l?.id===void 0?[]:b.get(l.id)??[];if(c!==void 0){let t=Math.min(Math.max(l?.depth??1,1),6);return(0,o.jsx)(`tr`,{"data-row-heading":t,className:u===void 0?void 0:ah[u],children:(0,o.jsx)(`th`,{scope:`colgroup`,colSpan:e.columns.length,style:{paddingLeft:`${.5+(t-1)*.75}rem`},className:`border border-zinc-200 bg-zinc-50 py-1 text-left font-semibold dark:border-zinc-800 dark:bg-zinc-900 ${t===1?`text-xs`:`text-[11px] font-medium`} ${u===`removed`?`line-through`:``}`,children:c})},i)}return(0,o.jsx)(`tr`,{className:u===void 0?void 0:ah[u],"data-row-role":u,"data-row-kind":l?.kind,"data-row-ref":l?.ref,children:a.map((t,n)=>(0,o.jsxs)(`td`,{className:`relative border border-zinc-200 px-2 py-1 align-top break-words dark:border-zinc-800 ${u===`removed`?`line-through`:``}`,children:[t===null?(0,o.jsx)(`span`,{className:`opacity-40`,children:`—`}):String(t),n===0&&l!==void 0?(0,o.jsx)(dh,{item:l,traces:d,dispatch:s}):null,h(n,e.columns[n]??``,!1)]},n))},i)})})]})]})}function ph(e,t){if(e===void 0)return JSON.stringify(t,null,2);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function mh(e,t=` `){let n=[],r=(e,r)=>{for(let i of r)n.push(`${t}${e}: ${i}`)};return r(`attribute`,e.attributes.map(([e,t])=>je(e,t))),r(`expects`,e.expectations.map(([e,t])=>je(e,t))),r(`asks to set`,e.assignments.map(([e,t])=>je(e,t))),r(`asks to unset`,e.removedAttributes),r(`at`,e.locations.map(e=>Ne(e))),r(`artifact`,e.artifacts.map(e=>Pe(e))),n}function hh(e){let t=e.profile===void 0?``:` "${e.profile}"`;if(e.state===`unchecked`)return`Could not be checked against this project's profile${t}: the project's profile registry cannot be used right now.`;if(e.state===`strays`)return`Does not conform to this project's profile${t} as it stands now.`;let n=e.openValues,r=e.findings??0,i=[n===0?void 0:`${n} value${n===1?``:`s`} outside its open enumerations`,r===0?void 0:`${r} finding${r===1?``:`s`} to check`].filter(e=>e!==void 0);return`Conforms to this project's profile${t}${i.length===0?``:`, with ${i.join(` and `)}`}.`}function gh(e,t,n=rl,r){let i=Xc(e,t),a=[];if(i.profile!==void 0&&a.push(`Profile: ${i.profile}`),r!==void 0&&a.push(`Conformance: ${hh(r)}`),i.target!==void 0){let e=i.target.revision===void 0?``:`, prepared against ${i.target.revision}`;a.push(`Proposes changes to ${i.target.ref}${e}`),a.push(`Expectations below are the producer's; the receiving authority checks them before applying.`)}for(let e of i.artifacts)a.push(`Artifact — ${Pe(e)}`);if(a.length>0&&a.push(``),e.kind===`timeline`)return a.push(...vt(e.data)),a.join(`
513
+ `);if(i.columns!==void 0&&i.rows!==void 0){let e=e=>e!==void 0&&n.has(nl(`role`,e)),t=i.rows.filter(t=>e(t.role));t.length>0&&(a.push(`Filtered view — ${t.length} of ${i.rows.length} rows hidden (${[...new Set(t.map(e=>Nc[e.role]))].join(`, `)}).`),a.push(``)),a.push(i.columns.join(` | `));for(let t of i.rows){if(e(t.role))continue;if(t.heading!==void 0){a.push(``),a.push(`${`#`.repeat(t.depth??1)} ${t.heading}${t.role===void 0?``:` (${Nc[t.role]})`}`);continue}let n=t.cells.map(e=>e===null?``:String(e)).join(` | `),r=t.kind===void 0?``:` [${t.kind}]`;a.push(`${n}${r}${t.role===void 0?``:` (${Nc[t.role]})`}`);for(let e of t.changes)a.push(` ${Ae(e)}`);a.push(...mh(t))}if(i.traces.length>0){a.push(``);for(let e of i.traces){let t=e.label===void 0?``:`: ${e.label}`;a.push(`${e.fromLabel} —${e.kind}${t}→ ${e.toLabel}`)}}}else{if(a.push([`${i.things.length} ${i.thingNoun}s`,`${i.links.length} ${i.linkNoun}s`,...i.containers.length>0?[`${i.containers.length} containers`]:[]].join(`, `)),a.push(``),i.containers.length>0){for(let e of i.containers){let t=i.things.filter(t=>t.container===e.id);a.push(`${e.label}: ${t.length===0?`no members`:t.map(e=>e.label).join(`, `)}`)}a.push(``)}let e=new Map(i.containers.map(e=>[e.id,e.label]));for(let t of i.things){let n=t.container===void 0?void 0:e.get(t.container);a.push([t.label,t.kind===void 0?``:` [${t.kind}]`,n===void 0?``:` in ${n}`,t.role===`unchanged`?``:` (${Mc[t.role]})`,t.changes.length===0?``:` — ${t.changes.map(Ae).join(`, `)}`].join(``)),a.push(...mh(t))}i.links.length>0&&a.push(``),i.links.forEach((e,t)=>{let n=[e.kind,e.label].filter(e=>e!==void 0&&e!==``),r=n.length===0?`→`:`—${n.join(`: `)}→`;a.push([i.linkNoun===`message`?`${t+1}. `:``,`${e.fromLabel} ${r} ${e.toLabel}`,e.isLoop?` (to itself)`:``,e.role===`unchanged`?``:` (${Mc[e.role]})`,e.changes.length===0?``:` — ${e.changes.map(Ae).join(`, `)}`].join(``)),a.push(...mh(e))})}if(i.removals.length>0){a.push(``);for(let e of i.removals)a.push(`removed ${e.type}: ${e.ref}`)}return a.join(`
514
+ `)}function _h(e,t){let n=e=>{if(e===void 0)return;let n=t.data,r=[...n.nodes??[],...n.participants??[]].find(t=>t.id===e||t.ref===e);return r===void 0?e:Zc(r)},r=t.data,i=[...r.nodes??[],...r.participants??[],...r.edges??[],...r.messages??[]].find(t=>`ref`in t&&t.ref===e.ref),a=e.from!==void 0||e.to!==void 0?`${n(e.from)??`?`} → ${n(e.to)??`?`}`:i!==void 0&&`from`in i?`${n(i.from)} → ${n(i.to)}`:void 0,o=e.label??(i===void 0?void 0:i.label),s=e.kind??(i===void 0?void 0:i.kind),c=[o,s===void 0?void 0:`[${s}]`,a].filter(e=>e!==void 0&&e!==``);return c.length===0?e.ref:`${c.join(` `)} (${e.ref})`}var vh=C;function yh(e){let t=e.target;if(typeof t!=`object`||!t)return;let n=t.revision;return typeof n==`string`?n:void 0}function bh(e){let t=e.target;if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.ref==`string`)return t.ref}var xh=`The arrangement beside this document is not used: `;function Sh({envelope:e,source:t,rawOutput:n,dispatch:r,conformance:i,exportRef:s,file:c}){let l=(0,a.useContext)($m),[u,d]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,x]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),E=(0,a.useRef)(null),ee=(0,a.useRef)(null),{fileIo:D}=Np(),[te,ne]=(0,a.useState)(Sl),re=(0,a.useRef)(0),[ie,ae]=(0,a.useState)(!1),[oe,se]=(0,a.useState)(!1),ce=(0,a.useRef)(``),[le,ue]=(0,a.useState)(void 0),de=c===void 0||e.kind!==`graph`?void 0:wl(c.path);(0,a.useEffect)(()=>{if(ne(Sl()),ae(!1),ue(void 0),de===void 0||D===void 0)return;let e=!0,t=()=>{let t=re.current,n=()=>e&&re.current===t;return D.read(de).then(e=>{if(!n())return;let t=Al(e.content);ne(t.ok?t.arrangement:Sl()),ae(!t.ok),ue(e=>t.ok?e?.startsWith(xh)?void 0:e:`${xh}${t.reason}.`)},()=>{n()&&(ne(Sl()),ae(!1))})};t();let n=D.onChanged(de,()=>void t());return()=>{e=!1,n()}},[de,D]);let[O,fe]=(0,a.useState)(rl),[pe,me]=(0,a.useState)(void 0),[he,ge]=(0,a.useState)(void 0),[_e,ve]=(0,a.useState)(void 0),ye=(0,a.useRef)(null),be=(0,a.useMemo)(()=>Qc(e),[e]),xe=e.target!==void 0,k=e.removals??[],A=(0,a.useMemo)(()=>Xc(e,xe),[e,xe]),Se=(0,a.useMemo)(()=>e.kind===`graph`?xp(e.data,O):`landscape`,[e,O]),Ce=he??``,we=te.views[Ce],Te=pe??we?.orientation??Se,Ee=we!==void 0&&(we.orientation===void 0||we.orientation===Te)?we:void 0,De=(e,t=Ce)=>{re.current+=1;let n={...te.views};e===void 0?delete n[t]:n[t]=e;let r={...te,views:n};ne(r),c!==void 0&&(ie?ue(`This arrangement is not kept: the arrangement file beside the document cannot be read, and is left as it is. Fix or remove it to keep moves.`):!c.writable||D?.keepArrangement===void 0?ue(`This arrangement is not kept: the document is outside the writable zone.`):(ue(void 0),D.keepArrangement(c.path,Il(r)).then(()=>void 0,e=>ue(`This arrangement was not kept: ${e.message}.`))))},Oe=(0,a.useMemo)(()=>e.kind===`graph`&&c!==void 0&&Ee!==void 0?Ap(e.data,{hidden:O,orientation:Te,arrangement:Ee}):[],[e,c,Ee,O,Te]),ke=(0,a.useMemo)(()=>e.kind===`graph`?al(e):[],[e]),Ae=ke.find(e=>e.id===he),je=Ae!==void 0&&!sl(O,ol(e.data,Ae)),Me=t=>{let n=ke.find(e=>e.id===t);ge(n?.id),fe(n===void 0?rl:ol(e.data,n))},Ne=()=>{me(e=>m(e??Te))},Fe=e.kind===`graph`?(0,o.jsx)(rh,{data:e.data,isProposal:xe,arrangement:Ee,onArrange:De,hidden:O,setHidden:fe,orientation:Te,viewpoint:Ae}):e.kind===`sequence`?(0,o.jsx)(ih,{data:e.data,isProposal:xe}):e.kind===`timeline`?(0,o.jsx)(Zm,{data:e.data,appearance:l,display:_e??Ym(e.data),onDisplayChange:t=>ve(n=>t(n??Ym(e.data))),exportRef:ye}):(0,o.jsx)(fh,{data:e.data,hidden:O,setHidden:fe,rows:A.rows,traces:A.traces,dispatch:r}),Ie=`${e.kind}-${bh(e)??`diagram`}.svg`.replace(/[^\w.-]+/g,`-`),Le=`${e.kind}-${bh(e)??`data`}`.replace(/[^\w.-]+/g,`-`),Re=()=>Qp(e.data,O,A.rows),ze=e.kind===`table`?Re().withheld:0;function Be(e){let t=e.cloneNode(!0);for(let e of t.querySelectorAll(`[data-hit]`))e.remove();for(let e of[t,...t.querySelectorAll(`[style]`)])e.style.removeProperty(`cursor`),e.style.removeProperty(`touch-action`),e.style.removeProperty(`fill`),e.style.removeProperty(`stroke`),e.getAttribute(`style`)===``&&e.removeAttribute(`style`);return t}function Ve(){let e=(ee.current??E.current)?.querySelector(`svg`);return e?new XMLSerializer().serializeToString(Be(e)):void 0}(0,a.useImperativeHandle)(s,()=>e.kind===`timeline`?{svg:()=>ye.current?.svg?.()}:e.kind===`graph`||e.kind===`sequence`?{svg:He}:e.kind===`table`?{xlsx:()=>void am(Re(),`${Le}.xlsx`),markdown:()=>rm(e.data,O,A.rows)}:null);function He(){let e=Ve();if(e===void 0)return;let t=URL.createObjectURL(new Blob([e],{type:`image/svg+xml`})),n=document.createElement(`a`);n.href=t,n.download=Ie,n.click(),URL.revokeObjectURL(t),T(`SVG downloaded`),window.setTimeout(()=>T(null),2500)}async function Ue(){let e=Ve();e!==void 0&&(T(await Bt(e)?`SVG markup copied`:`could not copy`),window.setTimeout(()=>T(null),2500))}return(0,o.jsxs)(`div`,{className:`space-y-3 text-sm`,"data-testid":`structured-document`,children:[xe&&(0,o.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-proposal-note`,children:[`Proposed changes to `,(0,o.jsx)(`span`,{className:`font-mono`,children:bh(e)}),yh(e)===void 0?null:(0,o.jsxs)(o.Fragment,{children:[`, prepared against `,(0,o.jsx)(`span`,{className:`font-mono`,children:yh(e)})]}),`. Anything not mentioned is left as it is; anything shown without a change is here for context.`]}),A.profile===void 0?null:(0,o.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-profile`,children:[`Vocabulary: `,(0,o.jsx)(`span`,{className:`font-mono`,children:A.profile}),(0,o.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— names what the kinds and attributes mean; not resolved here`})]}),i===void 0?null:(0,o.jsx)(`p`,{className:i.state===`conforms`?`text-xs text-emerald-700 dark:text-emerald-400`:`text-xs text-amber-700 dark:text-amber-400`,"data-testid":`structured-conformance`,"data-state":i.state,children:hh(i)}),A.artifacts.length>0&&(0,o.jsx)(`ul`,{className:`text-xs text-zinc-500`,"data-testid":`structured-document-artifacts`,children:A.artifacts.map((e,t)=>(0,o.jsx)(`li`,{className:`break-all font-mono`,children:Pe(e)},t))}),A.traces.length>0&&(0,o.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-relation-key`,children:[`Relations:`,` `,[...new Set(A.traces.map(e=>e.kind))].map((e,t)=>(0,o.jsxs)(`span`,{className:`font-mono`,children:[t>0?`, `:``,e]},e)),(0,o.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— declared by the producer; nothing is inferred about what is missing`})]}),(O.size>0||Ae!==void 0)&&(0,o.jsxs)(`p`,{"data-testid":`structured-filtered`,className:`flex flex-wrap items-center gap-2 rounded border border-amber-300 bg-amber-50 px-2 py-1 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[Ae!==void 0&&(0,o.jsxs)(`span`,{"data-testid":`structured-viewpoint`,children:[`Viewpoint: `,(0,o.jsx)(`strong`,{children:Ae.label}),` — `,Ae.concern,je?` Adjusted with the key.`:``]}),O.size>0&&(0,o.jsxs)(`span`,{children:[`Filtered view — `,[...O].map(e=>e.replace(/^(element|relationship|role):/,``)).join(`, `),` hidden.`,` `,xe?`The full proposal still applies.`:``]}),(0,o.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>Me(``),children:`show everything`})]}),(0,o.jsx)(`div`,{ref:E,className:`overflow-x-auto`,children:oe&&e.kind===`graph`?(0,o.jsx)(qp,{data:e.data,hidden:O,orientation:Te,arrangement:Ee,onArrange:e=>De(e,ce.current),onNote:ue,onDone:()=>se(!1)}):Fe}),le!==void 0&&(0,o.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-300`,"data-testid":`structured-arrangement-note`,children:le}),Oe.length>0&&(0,o.jsxs)(`details`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,"data-testid":`structured-arrangement-check`,children:[(0,o.jsxs)(`summary`,{className:`cursor-pointer`,children:[Oe.length,` `,Oe.length===1?`thing`:`things`,` to look at in this arrangement`]}),(0,o.jsx)(`ul`,{className:`mt-1 list-disc space-y-0.5 pl-5`,children:Oe.map((e,t)=>(0,o.jsx)(`li`,{children:e.message},t))})]}),(0,o.jsx)(f,{label:`${e.kind} view`,open:u,onClose:()=>d(!1),containerRef:ee,anchorRef:E,actions:(e.kind===`graph`||e.kind===`sequence`)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,onClick:He,className:vh,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,onClick:Ue,className:vh,children:`copy markup`}),S!==null&&(0,o.jsx)(`span`,{className:`text-xs text-zinc-500`,children:S})]}),children:Fe}),k.length>0&&(0,o.jsx)(`ul`,{className:`space-y-1`,"data-testid":`structured-removals`,children:k.map((t,n)=>(0,o.jsxs)(`li`,{"data-relationship-role":`removed`,className:`rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-200`,children:[(0,o.jsx)(`span`,{className:`line-through`,children:_h(t,e)}),_h(t,e)===t.ref&&(0,o.jsx)(`span`,{className:`ml-2 not-italic opacity-70`,"data-testid":`removal-undescribed`,children:`— the proposal does not say what this is`}),(0,o.jsx)(`span`,{className:`ml-2 font-mono opacity-60`,children:t.type})]},n))}),(0,o.jsxs)(`div`,{className:w,children:[ke.length>0&&(0,o.jsxs)(`label`,{className:`flex items-center gap-1 text-zinc-500`,children:[`viewpoint`,(0,o.jsxs)(`select`,{"data-testid":`viewpoint-select`,className:`rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300`,value:Ae?.id??``,onChange:e=>Me(e.target.value),disabled:oe,title:oe?`Leave the touch-up to switch viewpoint`:void 0,children:[(0,o.jsx)(`option`,{value:``,children:`Whole document`}),ke.map(e=>(0,o.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,o.jsx)(`button`,{type:`button`,className:C,"aria-label":`Show ${e.kind} view at full size`,onClick:()=>d(!0),children:`⤢ enlarge`}),e.kind===`graph`&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,"data-testid":`diagram-orientation`,title:Te===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${m(Te)}`,onClick:Ne,disabled:oe,children:Te===`portrait`?`↔ landscape`:`↕ portrait`}),e.kind===`graph`&&c?.writable===!0&&!oe&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,title:`Move boxes, wire ends, bends and labels in draw.io's touch-up; kept beside the document, which is not changed`,onClick:()=>{ce.current=Ce,se(!0)},children:`✎ arrange in draw.io`}),e.kind===`table`?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ze===0?`Save as .csv — opens in any spreadsheet`:`Save as .csv — ${ze} hidden rows are left out`,onClick:()=>im(Re(),`${Le}.csv`),children:`⤓ download CSV`}),(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ze===0?`Save as .xlsx — one sheet, values typed as they are declared`:`Save as .xlsx — ${ze} hidden rows are left out`,onClick:()=>void am(Re(),`${Le}.xlsx`),children:`⤓ download XLSX`}),(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ze===0?`Save as .md — each chapter a heading, its rows a table`:`Save as .md — ${ze} hidden rows are left out`,onClick:()=>om(e.data,O,A.rows,`${Le}.md`),children:`⤓ download Markdown`}),ze>0&&(0,o.jsxs)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,"data-testid":`table-export-narrowed`,children:[`exports `,ze,` rows fewer than the table declares`]})]}):e.kind===`timeline`?null:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,title:`Save as .svg — insert it as a picture in a document`,onClick:He,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:`Copy the SVG markup, for somewhere that takes it directly`,onClick:()=>void Ue(),children:`copy markup`})]}),(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>h(e=>!e),children:[p?`hide`:`show`,` text equivalent`]}),be!==void 0&&(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>_(e=>!e),children:[g?`hide`:`show`,` derived diagram syntax`]}),(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>x(e=>!e),children:[b?`hide`:`show`,` envelope`]}),n!==void 0&&(0,o.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>y(e=>!e),children:[v?`hide`:`show`,` original output`]}),S!==null&&(0,o.jsx)(`span`,{role:`status`,className:`text-emerald-600 dark:text-emerald-400`,children:S})]}),p&&(0,o.jsx)(`pre`,{"data-testid":`structured-text-equivalent`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:gh(e,xe,O,i)}),g&&be!==void 0&&(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`Derived from the structured data above. It is an export, not the source.`}),(0,o.jsx)(`pre`,{"data-testid":`structured-derived-export`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:be})]}),b&&(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`The validated document this view is drawn from. It is not sent to the model.`}),(0,o.jsx)(`pre`,{"data-testid":`structured-envelope`,className:`max-h-80 overflow-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:t})]}),v&&n!==void 0&&(0,o.jsx)(`pre`,{"data-testid":`structured-raw-output`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:n})]})}function Ch({item:e,dispatch:t}){let n=yl(e.structured);return n===void 0?null:(0,o.jsx)(Sh,{envelope:n,source:ph(e.structured,n),rawOutput:e.output,dispatch:t,...e.structuredConformance===void 0?{}:{conformance:e.structuredConformance}})}var wh={id:`structured-exchange`,match:e=>yl(e.structured)!==void 0,stable:!1,showsRawReveal:!0,startsExpanded:!0,Expanded:Ch},Th=class extends a.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`[pi-outpost] viewer crashed:`,e,t.componentStack)}render(){return this.state.failed?(0,o.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,o.jsxs)(`p`,{className:`max-w-md text-center text-sm text-zinc-600 dark:text-zinc-400`,children:[this.props.label??`This file`,` could not be displayed. Close and reopen it to try again.`]})}):this.props.children}},Eh=(0,a.createContext)({});function Dh(e){let t=D(e.children,`json`);return t===null?(0,o.jsx)(ne,{...e}):(0,o.jsx)(Oh,{code:t,pre:e})}function Oh({code:e,pre:t}){let n=(0,a.useContext)(Eh),r=(0,a.useMemo)(()=>bl(e),[e]);if(r.status===`not-a-document`)return(0,o.jsx)(ne,{...t});if(r.status===`valid`){let t=n[zt(e)];return(0,o.jsx)(Th,{label:`This diagram`,children:(0,o.jsx)(`div`,{className:`my-2`,"data-testid":`reply-structured-exchange`,children:(0,o.jsx)(Sh,{envelope:r.envelope,source:e,...t?{conformance:t}:{}})})})}return(0,o.jsxs)(`div`,{children:[(0,o.jsxs)(`p`,{"data-testid":`reply-structured-exchange-refused`,className:`mb-1 text-xs text-amber-700 dark:text-amber-400`,children:[`This structured-exchange document could not be drawn: `,kh(r)]}),(0,o.jsx)(ne,{...t})]})}function kh(e){if(e.status===`unsupported-version`)return`${e.schema} is not a version this application implements.`;let t=e.status===`invalid`?e.issues[0]:e.issue;return t===void 0?`it does not satisfy the schema it declares.`:`${t.message} (${t.rule}${t.path?` at ${t.path}`:``})`}function Ah(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function jh(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Mh=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nh=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ph={};function Fh(e,t){return((t||Ph).jsx?Nh:Mh).test(e)}var Ih=/[ \t\n\f\r]/g;function Lh(e){return typeof e==`object`?e.type===`text`&&Rh(e.value):Rh(e)}function Rh(e){return e.replace(Ih,``)===``}var zh=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};zh.prototype.normal={},zh.prototype.property={},zh.prototype.space=void 0;function Bh(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new zh(n,r,t)}function Vh(e){return e.toLowerCase()}var Hh=class{constructor(e,t){this.attribute=t,this.property=e}};Hh.prototype.attribute=``,Hh.prototype.booleanish=!1,Hh.prototype.boolean=!1,Hh.prototype.commaOrSpaceSeparated=!1,Hh.prototype.commaSeparated=!1,Hh.prototype.defined=!1,Hh.prototype.mustUseProperty=!1,Hh.prototype.number=!1,Hh.prototype.overloadedBoolean=!1,Hh.prototype.property=``,Hh.prototype.spaceSeparated=!1,Hh.prototype.space=void 0;var Uh=e.n({boolean:()=>P,booleanish:()=>Gh,commaOrSpaceSeparated:()=>Yh,commaSeparated:()=>Jh,number:()=>F,overloadedBoolean:()=>Kh,spaceSeparated:()=>qh}),Wh=0,P=Xh(),Gh=Xh(),Kh=Xh(),F=Xh(),qh=Xh(),Jh=Xh(),Yh=Xh();function Xh(){return 2**++Wh}var Zh=Object.keys(Uh),Qh=class extends Hh{constructor(e,t,n,r){let i=-1;if(super(e,t),$h(this,`space`,r),typeof n==`number`)for(;++i<Zh.length;){let e=Zh[i];$h(this,Zh[i],(n&Uh[e])===Uh[e])}}};Qh.prototype.defined=!0;function $h(e,t,n){n&&(e[t]=n)}function eg(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Qh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Vh(r)]=r,n[Vh(a.attribute)]=r}return new zh(t,n,e.space)}var tg=eg({properties:{ariaActiveDescendant:null,ariaAtomic:Gh,ariaAutoComplete:null,ariaBusy:Gh,ariaChecked:Gh,ariaColCount:F,ariaColIndex:F,ariaColSpan:F,ariaControls:qh,ariaCurrent:null,ariaDescribedBy:qh,ariaDetails:null,ariaDisabled:Gh,ariaDropEffect:qh,ariaErrorMessage:null,ariaExpanded:Gh,ariaFlowTo:qh,ariaGrabbed:Gh,ariaHasPopup:null,ariaHidden:Gh,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qh,ariaLevel:F,ariaLive:null,ariaModal:Gh,ariaMultiLine:Gh,ariaMultiSelectable:Gh,ariaOrientation:null,ariaOwns:qh,ariaPlaceholder:null,ariaPosInSet:F,ariaPressed:Gh,ariaReadOnly:Gh,ariaRelevant:null,ariaRequired:Gh,ariaRoleDescription:qh,ariaRowCount:F,ariaRowIndex:F,ariaRowSpan:F,ariaSelected:Gh,ariaSetSize:F,ariaSort:null,ariaValueMax:F,ariaValueMin:F,ariaValueNow:F,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ng(e,t){return t in e?e[t]:t}function rg(e,t){return ng(e,t.toLowerCase())}var ig=eg({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Jh,acceptCharset:qh,accessKey:qh,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:qh,autoFocus:P,autoPlay:P,blocking:qh,capture:null,charSet:null,checked:P,cite:null,className:qh,closedBy:null,colorSpace:null,cols:F,colSpan:F,command:null,commandFor:null,content:null,contentEditable:Gh,controls:P,controlsList:qh,coords:F|Jh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:Kh,draggable:Gh,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:qh,height:F,hidden:Kh,high:F,href:null,hrefLang:null,htmlFor:qh,httpEquiv:qh,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:qh,itemRef:qh,itemScope:P,itemType:qh,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:F,manifest:null,max:null,maxLength:F,media:null,method:null,min:null,minLength:F,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:P,optimum:F,pattern:null,ping:qh,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:qh,required:P,reversed:P,rows:F,rowSpan:F,sandbox:qh,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:F,sizes:null,slot:null,span:F,spellCheck:Gh,src:null,srcDoc:null,srcLang:null,srcSet:null,start:F,step:null,style:null,tabIndex:F,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:Gh,width:F,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:qh,axis:null,background:null,bgColor:null,border:F,borderColor:null,bottomMargin:F,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:F,leftMargin:F,link:null,longDesc:null,lowSrc:null,marginHeight:F,marginWidth:F,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:F,rules:null,scheme:null,scrolling:Gh,standby:null,summary:null,text:null,topMargin:F,valueType:null,version:null,vAlign:null,vLink:null,vSpace:F,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:Jh,part:qh,prefix:null,property:null,results:F,security:null,unselectable:null},space:`html`,transform:rg}),ag=eg({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Yh,accentHeight:F,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:F,amplitude:F,arabicForm:null,ascent:F,attributeName:null,attributeType:null,azimuth:F,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:F,by:null,calcMode:null,capHeight:F,className:qh,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:F,diffuseConstant:F,direction:null,display:null,dur:null,divisor:F,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:F,enableBackground:null,end:null,event:null,exponent:F,externalResourcesRequired:null,fill:null,fillOpacity:F,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jh,g2:Jh,glyphName:Jh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:F,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:F,horizOriginX:F,horizOriginY:F,id:null,ideographic:F,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:F,k:F,k1:F,k2:F,k3:F,k4:F,kernelMatrix:Yh,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:F,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:F,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:F,overlineThickness:F,paintOrder:null,panose1:null,path:null,pathLength:F,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qh,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:F,pointsAtY:F,pointsAtZ:F,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Yh,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Yh,rev:Yh,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Yh,requiredFeatures:Yh,requiredFonts:Yh,requiredFormats:Yh,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:F,specularExponent:F,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:F,strikethroughThickness:F,string:null,stroke:null,strokeDashArray:Yh,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:F,strokeOpacity:F,strokeWidth:null,style:null,surfaceScale:F,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Yh,tabIndex:F,tableValues:null,target:null,targetX:F,targetY:F,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Yh,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:F,underlineThickness:F,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:F,values:null,vAlphabetic:F,vMathematical:F,vectorEffect:null,vHanging:F,vIdeographic:F,version:null,vertAdvY:F,vertOriginX:F,vertOriginY:F,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:F,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ng}),og=eg({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),sg=eg({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:rg}),cg=eg({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),lg={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},ug=/[A-Z]/g,dg=/-[a-z]/g,fg=/^data[-\w.:]+$/i;function pg(e,t){let n=Vh(t),r=t,i=Hh;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&fg.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(dg,hg);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!dg.test(e)){let n=e.replace(ug,mg);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Qh}return new i(r,t)}function mg(e){return`-`+e.toLowerCase()}function hg(e){return e.charAt(1).toUpperCase()}var gg=Bh([tg,ig,og,sg,cg],`html`),_g=Bh([tg,ag,og,sg,cg],`svg`);function vg(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function yg(e){return e.join(` `).trim()}var bg=e.t(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
515
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),xg=e.t(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(bg());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Sg=e.t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Cg=e.t(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(xg()),i=Sg();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),wg=Eg(`end`),Tg=Eg(`start`);function Eg(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Dg(e){let t=Tg(e),n=wg(e);if(t&&n)return{start:t,end:n}}var Og=e.r(Cg(),1),kg={}.hasOwnProperty,Ag=new Map,jg=/[A-Z]/g,Mg=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ng=new Set([`td`,`th`]),Pg=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Fg(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Kg(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Gg(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?_g:gg,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ig(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ig(e,t,n){if(t.type===`element`)return Lg(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Rg(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Bg(e,t,n);if(t.type===`mdxjsEsm`)return zg(e,t);if(t.type===`root`)return Vg(e,t,n);if(t.type===`text`)return Hg(e,t)}function Lg(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=_g,e.schema=i),e.ancestors.push(t);let a=Qg(e,t.tagName,!1),o=qg(e,t),s=Yg(e,t);return Mg.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Lh(e)})),Ug(e,o,a,t),Wg(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Rg(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$g(e,t.position)}function zg(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$g(e,t.position)}function Bg(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=_g,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Qg(e,t.name,!0),o=Jg(e,t),s=Yg(e,t);return Ug(e,o,a,t),Wg(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vg(e,t,n){let r={};return Wg(r,Yg(e,t)),e.create(t,e.Fragment,r,n)}function Hg(e,t){return t.value}function Ug(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wg(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Gg(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Kg(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Tg(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function qg(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&kg.call(t.properties,i)){let a=Xg(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ng.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Jg(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $g(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else $g(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Yg(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ag;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ig(e,a,o);s!==void 0&&n.push(s)}return n}function Xg(e,t,n){let r=pg(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?jh(n):yg(n)),r.property===`style`){let t=typeof n==`object`?n:Zg(e,String(n));return e.stylePropertyNameCase===`css`&&(t=e_(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?lg[r.property]||r.property:r.attribute,n]}}function Zg(e,n){try{return(0,Og.default)(n,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let r=n,i=new t.f("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw i.file=e.filePath||void 0,i.url=Pg+`#cannot-parse-style-attribute`,i}}function Qg(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Fh(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Fh(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return kg.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$g(e)}function $g(e,n){let r=new t.f("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Pg+`#cannot-handle-mdx-estrees-without-createevaluater`,r}function e_(e){let t={},n;for(n in e)kg.call(e,n)&&(t[t_(n)]=e[n]);return t}function t_(e){let t=e.replace(jg,n_);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function n_(e){return`-`+e.toLowerCase()}var r_={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]};function i_(e){let n=[],r=-1,i=0,a=0;for(;++r<e.length;){let o=e.charCodeAt(r),s=``;if(o===37&&t.d(e.charCodeAt(r+1))&&t.d(e.charCodeAt(r+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(r+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),a=1):s=`�`}else s=String.fromCharCode(o);s&&=(n.push(e.slice(i,r),encodeURIComponent(s)),i=r+a+1,``),a&&=(r+=a,0)}return n.join(``)+e.slice(i)}function a_(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function o_(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
516
+ `}]}function s_(e,t){let n=t.value?t.value+`
517
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function c_(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l_(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u_(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=i_(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function d_(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function f_(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p_(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function m_(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p_(e,t);let i={src:i_(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function h_(e,t){let n={src:i_(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function g_(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function __(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p_(e,t);let i={href:i_(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function v_(e,t){let n={href:i_(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function y_(e,t,n){let r=e.all(t),i=n?b_(n):x_(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
518
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
519
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function b_(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=x_(n[r])}return t}function x_(e){return e.spread??e.children.length>1}function S_(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function C_(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w_(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function T_(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E_(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Tg(t.children[1]),o=wg(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function D_(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function O_(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var k_=9,A_=32;function j_(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(M_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(M_(t.slice(i),i>0,!1)),a.join(``)}function M_(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===k_||t===A_;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===k_||t===A_;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function N_(e,t){let n={type:`text`,value:j_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function P_(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var F_={blockquote:a_,break:o_,code:s_,delete:c_,emphasis:l_,footnoteReference:u_,heading:d_,html:f_,imageReference:m_,image:h_,inlineCode:g_,linkReference:__,link:v_,listItem:y_,list:S_,paragraph:C_,root:w_,strong:T_,table:E_,tableCell:O_,tableRow:D_,text:N_,thematicBreak:P_,toml:I_,yaml:I_,definition:I_,footnoteDefinition:I_};function I_(){}var{defineProperty:L_}=Object,R_=typeof self==`object`?self:globalThis,z_=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new R_[e](t)},B_=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?L_(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof R_[e]==`function`?z_(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(z_(a,o),i)};return r},V_=e=>B_(new Map,e)(0),H_=``,{toString:U_}={},{keys:W_,is:G_}=Object,K_=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=U_.call(e).slice(8,-1);switch(n){case`Array`:return[1,H_];case`Object`:return[2,H_];case`Date`:return[3,H_];case`RegExp`:return[4,H_];case`Map`:return[5,H_];case`Set`:return[6,H_];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},q_=([e,t])=>e===0&&(t===`function`||t===`symbol`),J_=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=K_(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&G_(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of W_(o))(e||!q_(K_(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?H_:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(q_(K_(n))||q_(K_(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!q_(K_(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},Y_=(e,{json:t,lossy:n}={})=>{let r=[];return J_(!(t||n),!!t,new Map,r)(e),r},X_=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?V_(Y_(e,t)):structuredClone(e):(e,t)=>V_(Y_(e,t));function Z_(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Q_(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function $_(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Z_,r=e.options.footnoteBackLabel||Q_,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=i_(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...X_(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
520
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
521
+ `}]}}var ev={}.hasOwnProperty,tv={};function nv(e,n){let r=n||tv,i=new Map,a=new Map,o={all:c,applyData:iv,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],handlers:{...F_,...r.handlers},one:s,options:r,patch:rv,wrap:ov};return t.o(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(e,t){let n=e.type,r=o.handlers[n];if(ev.call(o.handlers,n)&&r)return r(o,e,t);if(o.options.passThrough&&o.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=X_(n);return r.children=o.all(e),r}return X_(e)}return(o.options.unknownHandler||av)(o,e,t)}function c(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=o.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=sv(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=sv(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function rv(e,t){e.position&&(t.position=Dg(e))}function iv(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,X_(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function av(e,t){let n=t.data||{},r=`value`in t&&!(ev.call(n,`hProperties`)||ev.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ov(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
522
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
523
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
524
+ `}),n}function sv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cv(e,t){let n=nv(e,t),r=n.one(e,void 0),i=$_(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
525
+ `},i)),a}function lv(e,t){return e&&`run`in e?async function(n,r){let i=cv(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cv(n,{file:r,...e||t})}}var uv=[],dv={allowDangerousHtml:!0},fv=/^(https?|ircs?|mailto|xmpp)$/i,pv=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function mv(e){let t=hv(e),n=gv(e);return _v(t.runSync(t.parse(n),n),e)}function hv(e){let n=e.rehypePlugins||uv,r=e.remarkPlugins||uv,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dv}:dv;return t.i().use(t.u).use(r).use(lv,i).use(n)}function gv(e){let n=e.children||``,r=new t.a;return typeof n==`string`?r.value=n:``+n,r}function _v(e,n){let r=n.allowedElements,i=n.allowElement,a=n.components,s=n.disallowedElements,c=n.skipHtml,l=n.unwrapDisallowed,u=n.urlTransform||vv;for(let e of pv)Object.hasOwn(n,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return t.o(e,d),Fg(e,{Fragment:o.Fragment,components:a,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function d(e,t,n){if(e.type===`raw`&&n&&typeof t==`number`)return c?n.children.splice(t,1):n.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in r_)if(Object.hasOwn(r_,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=r_[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=u(String(n||``),t,e))}}if(e.type===`element`){let a=r?!r.includes(e.tagName):s?s.includes(e.tagName):!1;if(!a&&i&&typeof t==`number`&&(a=!i(e,t,n)),a&&n&&typeof t==`number`)return l&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}function vv(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||fv.test(e.slice(0,t))?e:``}var yv=/[#.]/g;function bv(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){yv.lastIndex=i;let e=yv.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function xv(e,t,n){let r=n?Dv(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=bv(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Sv(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Cv(e,o.properties,t,n)}for(let e of a)wv(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Sv(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Cv(e,t,n,r){let i=pg(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?vg(r):i.commaSeparated?Ah(r):i.commaOrSpaceSeparated?vg(Ah(r).join(` `)):Tv(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Ev(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Tv(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function wv(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)wv(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?wv(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function Tv(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||Vh(n)===Vh(t)))return!0}return n}function Ev(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Dv(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Ov=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),kv=xv(gg,`div`),Av=xv(_g,`g`,Ov);function jv(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=Mv(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=Mv(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function Mv(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
526
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var Nv={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},Pv={}.hasOwnProperty,Fv=Object.prototype;function Iv(e,t){let n=t||{};return Lv({file:n.file||void 0,location:!1,schema:n.space===`svg`?_g:gg,verbose:n.verbose||!1},e)}function Lv(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},Bv(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:Rv(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=jv(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},Bv(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},Bv(e,r,n),n}default:return n=zv(e,t),n}}function Rv(e,t){let n=-1,r=[];for(;++n<t.length;){let i=Lv(e,t[n]);r.push(i)}return r}function zv(e,t){let n=e.schema;e.schema=t.namespaceURI===Nv.svg?_g:gg;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;Pv.call(Fv,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?Av:kv)(t.tagName,i,Rv(e,t.childNodes));if(Bv(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&Hv(r.startTag),o=r&&r.endTag&&Hv(r.endTag),s=Lv(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function Bv(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=Vv(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Vv(e,t,n){let r=Hv(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)Pv.call(n.attrs,i)&&(r[pg(e.schema,i).property]=Hv(n.attrs[i]));n.startTag;let a=Hv(n.startTag),o=n.endTag?Hv(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function Hv(e){let t=Uv({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Uv({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Uv(e){return e.line&&e.column?e:void 0}var Wv=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),I;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(I||={});var Gv={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function Kv(e){return e>=55296&&e<=57343}function qv(e){return e>=56320&&e<=57343}function Jv(e,t){return(e-55296)*1024+9216+t}function Yv(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Xv(e){return e>=64976&&e<=65007||Wv.has(e)}var L;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(L||={});var Zv=65536,Qv=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Zv,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(qv(t))return this.pos++,this._addGap(),Jv(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(L.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let n=this.html.charCodeAt(t);return n===I.CARRIAGE_RETURN?I.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let e=this.html.charCodeAt(this.pos);return e===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):e===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Kv(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===I.LINE_FEED||e===I.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Yv(e)?this._err(L.controlCharacterInInputStream):Xv(e)&&this._err(L.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},R;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(R||={});function $v(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var ey=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),ty=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function ny(e){return e>=55296&&e<=57343||e>1114111?65533:ty.get(e)??e}var ry;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(ry||={});var iy=32,ay;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(ay||={});function oy(e){return e>=ry.ZERO&&e<=ry.NINE}function sy(e){return e>=ry.UPPER_A&&e<=ry.UPPER_F||e>=ry.LOWER_A&&e<=ry.LOWER_F}function cy(e){return e>=ry.UPPER_A&&e<=ry.UPPER_Z||e>=ry.LOWER_A&&e<=ry.LOWER_Z||oy(e)}function ly(e){return e===ry.EQUALS||cy(e)}var uy;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(uy||={});var dy;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(dy||={});var fy=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=uy.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=dy.Strict}startEntity(e){this.decodeMode=e,this.state=uy.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case uy.EntityStart:return e.charCodeAt(t)===ry.NUM?(this.state=uy.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=uy.NamedEntity,this.stateNamedEntity(e,t));case uy.NumericStart:return this.stateNumericStart(e,t);case uy.NumericDecimal:return this.stateNumericDecimal(e,t);case uy.NumericHex:return this.stateNumericHex(e,t);case uy.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|iy)===ry.LOWER_X?(this.state=uy.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=uy.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(oy(r)||sy(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(oy(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ry.SEMI)this.consumed+=1;else if(this.decodeMode===dy.Strict)return 0;return this.emitCodePoint(ny(this.result),this.consumed),this.errors&&(e!==ry.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&ay.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=py(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===dy.Attribute&&(i===0||ly(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&ay.VALUE_LENGTH)>>14,i!==0){if(a===ry.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==dy.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&ay.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~ay.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case uy.NamedEntity:return this.result!==0&&(this.decodeMode!==dy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case uy.NumericDecimal:return this.emitNumericEntity(0,2);case uy.NumericHex:return this.emitNumericEntity(0,3);case uy.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case uy.EntityStart:return 0}}};function py(e,t,n,r){let i=(t&ay.BRANCH_LENGTH)>>7,a=t&ay.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var z;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(z||={});var my;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(my||={});var hy;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(hy||={});var B;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(B||={});var V;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(V||={});var gy=new Map([[B.A,V.A],[B.ADDRESS,V.ADDRESS],[B.ANNOTATION_XML,V.ANNOTATION_XML],[B.APPLET,V.APPLET],[B.AREA,V.AREA],[B.ARTICLE,V.ARTICLE],[B.ASIDE,V.ASIDE],[B.B,V.B],[B.BASE,V.BASE],[B.BASEFONT,V.BASEFONT],[B.BGSOUND,V.BGSOUND],[B.BIG,V.BIG],[B.BLOCKQUOTE,V.BLOCKQUOTE],[B.BODY,V.BODY],[B.BR,V.BR],[B.BUTTON,V.BUTTON],[B.CAPTION,V.CAPTION],[B.CENTER,V.CENTER],[B.CODE,V.CODE],[B.COL,V.COL],[B.COLGROUP,V.COLGROUP],[B.DD,V.DD],[B.DESC,V.DESC],[B.DETAILS,V.DETAILS],[B.DIALOG,V.DIALOG],[B.DIR,V.DIR],[B.DIV,V.DIV],[B.DL,V.DL],[B.DT,V.DT],[B.EM,V.EM],[B.EMBED,V.EMBED],[B.FIELDSET,V.FIELDSET],[B.FIGCAPTION,V.FIGCAPTION],[B.FIGURE,V.FIGURE],[B.FONT,V.FONT],[B.FOOTER,V.FOOTER],[B.FOREIGN_OBJECT,V.FOREIGN_OBJECT],[B.FORM,V.FORM],[B.FRAME,V.FRAME],[B.FRAMESET,V.FRAMESET],[B.H1,V.H1],[B.H2,V.H2],[B.H3,V.H3],[B.H4,V.H4],[B.H5,V.H5],[B.H6,V.H6],[B.HEAD,V.HEAD],[B.HEADER,V.HEADER],[B.HGROUP,V.HGROUP],[B.HR,V.HR],[B.HTML,V.HTML],[B.I,V.I],[B.IMG,V.IMG],[B.IMAGE,V.IMAGE],[B.INPUT,V.INPUT],[B.IFRAME,V.IFRAME],[B.KEYGEN,V.KEYGEN],[B.LABEL,V.LABEL],[B.LI,V.LI],[B.LINK,V.LINK],[B.LISTING,V.LISTING],[B.MAIN,V.MAIN],[B.MALIGNMARK,V.MALIGNMARK],[B.MARQUEE,V.MARQUEE],[B.MATH,V.MATH],[B.MENU,V.MENU],[B.META,V.META],[B.MGLYPH,V.MGLYPH],[B.MI,V.MI],[B.MO,V.MO],[B.MN,V.MN],[B.MS,V.MS],[B.MTEXT,V.MTEXT],[B.NAV,V.NAV],[B.NOBR,V.NOBR],[B.NOFRAMES,V.NOFRAMES],[B.NOEMBED,V.NOEMBED],[B.NOSCRIPT,V.NOSCRIPT],[B.OBJECT,V.OBJECT],[B.OL,V.OL],[B.OPTGROUP,V.OPTGROUP],[B.OPTION,V.OPTION],[B.P,V.P],[B.PARAM,V.PARAM],[B.PLAINTEXT,V.PLAINTEXT],[B.PRE,V.PRE],[B.RB,V.RB],[B.RP,V.RP],[B.RT,V.RT],[B.RTC,V.RTC],[B.RUBY,V.RUBY],[B.S,V.S],[B.SCRIPT,V.SCRIPT],[B.SEARCH,V.SEARCH],[B.SECTION,V.SECTION],[B.SELECT,V.SELECT],[B.SOURCE,V.SOURCE],[B.SMALL,V.SMALL],[B.SPAN,V.SPAN],[B.STRIKE,V.STRIKE],[B.STRONG,V.STRONG],[B.STYLE,V.STYLE],[B.SUB,V.SUB],[B.SUMMARY,V.SUMMARY],[B.SUP,V.SUP],[B.TABLE,V.TABLE],[B.TBODY,V.TBODY],[B.TEMPLATE,V.TEMPLATE],[B.TEXTAREA,V.TEXTAREA],[B.TFOOT,V.TFOOT],[B.TD,V.TD],[B.TH,V.TH],[B.THEAD,V.THEAD],[B.TITLE,V.TITLE],[B.TR,V.TR],[B.TRACK,V.TRACK],[B.TT,V.TT],[B.U,V.U],[B.UL,V.UL],[B.SVG,V.SVG],[B.VAR,V.VAR],[B.WBR,V.WBR],[B.XMP,V.XMP]]);function _y(e){return gy.get(e)??V.UNKNOWN}var H=V,vy={[z.HTML]:new Set([H.ADDRESS,H.APPLET,H.AREA,H.ARTICLE,H.ASIDE,H.BASE,H.BASEFONT,H.BGSOUND,H.BLOCKQUOTE,H.BODY,H.BR,H.BUTTON,H.CAPTION,H.CENTER,H.COL,H.COLGROUP,H.DD,H.DETAILS,H.DIR,H.DIV,H.DL,H.DT,H.EMBED,H.FIELDSET,H.FIGCAPTION,H.FIGURE,H.FOOTER,H.FORM,H.FRAME,H.FRAMESET,H.H1,H.H2,H.H3,H.H4,H.H5,H.H6,H.HEAD,H.HEADER,H.HGROUP,H.HR,H.HTML,H.IFRAME,H.IMG,H.INPUT,H.LI,H.LINK,H.LISTING,H.MAIN,H.MARQUEE,H.MENU,H.META,H.NAV,H.NOEMBED,H.NOFRAMES,H.NOSCRIPT,H.OBJECT,H.OL,H.P,H.PARAM,H.PLAINTEXT,H.PRE,H.SCRIPT,H.SECTION,H.SELECT,H.SOURCE,H.STYLE,H.SUMMARY,H.TABLE,H.TBODY,H.TD,H.TEMPLATE,H.TEXTAREA,H.TFOOT,H.TH,H.THEAD,H.TITLE,H.TR,H.TRACK,H.UL,H.WBR,H.XMP]),[z.MATHML]:new Set([H.MI,H.MO,H.MN,H.MS,H.MTEXT,H.ANNOTATION_XML]),[z.SVG]:new Set([H.TITLE,H.FOREIGN_OBJECT,H.DESC]),[z.XLINK]:new Set,[z.XML]:new Set,[z.XMLNS]:new Set},yy=new Set([H.H1,H.H2,H.H3,H.H4,H.H5,H.H6]);B.STYLE,B.SCRIPT,B.XMP,B.IFRAME,B.NOEMBED,B.NOFRAMES,B.PLAINTEXT;var U;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(U||={});var by={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function xy(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function Sy(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function Cy(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function wy(e){return Cy(e)||Sy(e)}function Ty(e){return wy(e)||xy(e)}function Ey(e){return e+32}function Dy(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function Oy(e){return Dy(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function ky(e){return e===I.NULL?L.nullCharacterReference:e>1114111?L.characterReferenceOutsideUnicodeRange:Kv(e)?L.surrogateCharacterReference:Xv(e)?L.noncharacterCharacterReference:Yv(e)||e===I.CARRIAGE_RETURN?L.controlCharacterReference:null}var Ay=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new Qv(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new fy(ey,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(L.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(L.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=ky(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:R.START_TAG,tagName:``,tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:R.END_TAG,tagName:``,tagID:V.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:R.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:R.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if($v(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(L.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=_y(e.tagName),e.type===R.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(L.endTagWithAttributes),e.selfClosing&&this._err(L.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case R.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case R.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case R.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:R.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Dy(e)?R.WHITESPACE_CHARACTER:e===I.NULL?R.NULL_CHARACTER:R.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(R.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?dy.Attribute:dy.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case U.DATA:this._stateData(e);break;case U.RCDATA:this._stateRcdata(e);break;case U.RAWTEXT:this._stateRawtext(e);break;case U.SCRIPT_DATA:this._stateScriptData(e);break;case U.PLAINTEXT:this._statePlaintext(e);break;case U.TAG_OPEN:this._stateTagOpen(e);break;case U.END_TAG_OPEN:this._stateEndTagOpen(e);break;case U.TAG_NAME:this._stateTagName(e);break;case U.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case U.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case U.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case U.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case U.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case U.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case U.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case U.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case U.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case U.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case U.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case U.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case U.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case U.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case U.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case U.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case U.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case U.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case U.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case U.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case U.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case U.BOGUS_COMMENT:this._stateBogusComment(e);break;case U.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case U.COMMENT_START:this._stateCommentStart(e);break;case U.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case U.COMMENT:this._stateComment(e);break;case U.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case U.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case U.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case U.COMMENT_END:this._stateCommentEnd(e);break;case U.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case U.DOCTYPE:this._stateDoctype(e);break;case U.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case U.DOCTYPE_NAME:this._stateDoctypeName(e);break;case U.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case U.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case U.CDATA_SECTION:this._stateCdataSection(e);break;case U.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case U.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case U.CHARACTER_REFERENCE:this._stateCharacterReference();break;case U.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case I.LESS_THAN_SIGN:this.state=U.TAG_OPEN;break;case I.AMPERSAND:this._startCharacterReference();break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitCodePoint(e);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case I.AMPERSAND:this._startCharacterReference();break;case I.LESS_THAN_SIGN:this.state=U.RCDATA_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case I.LESS_THAN_SIGN:this.state=U.RAWTEXT_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(wy(e))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(e);else switch(e){case I.EXCLAMATION_MARK:this.state=U.MARKUP_DECLARATION_OPEN;break;case I.SOLIDUS:this.state=U.END_TAG_OPEN;break;case I.QUESTION_MARK:this._err(L.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(e);break;case I.EOF:this._err(L.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(L.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=U.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(wy(e))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(e);else switch(e){case I.GREATER_THAN_SIGN:this._err(L.missingEndTagName),this.state=U.DATA;break;case I.EOF:this._err(L.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(L.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this.state=U.BEFORE_ATTRIBUTE_NAME;break;case I.SOLIDUS:this.state=U.SELF_CLOSING_START_TAG;break;case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentTagToken();break;case I.NULL:this._err(L.unexpectedNullCharacter),t.tagName+=`�`;break;case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(Sy(e)?Ey(e):e)}}_stateRcdataLessThanSign(e){e===I.SOLIDUS?this.state=U.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=U.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){wy(e)?(this.state=U.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=U.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=U.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=U.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=U.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===I.SOLIDUS?this.state=U.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=U.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){wy(e)?(this.state=U.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=U.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case I.SOLIDUS:this.state=U.SCRIPT_DATA_END_TAG_OPEN;break;case I.EXCLAMATION_MARK:this.state=U.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=U.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){wy(e)?(this.state=U.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===I.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===I.HYPHEN_MINUS?(this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=U.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case I.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case I.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case I.HYPHEN_MINUS:this._emitChars(`-`);break;case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case I.GREATER_THAN_SIGN:this.state=U.SCRIPT_DATA,this._emitChars(`>`);break;case I.NULL:this._err(L.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===I.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:wy(e)?(this._emitChars(`<`),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){wy(e)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Gv.SCRIPT,!1)&&Oy(this.preprocessor.peek(Gv.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Gv.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case I.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case I.NULL:this._err(L.unexpectedNullCharacter),this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case I.HYPHEN_MINUS:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case I.NULL:this._err(L.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case I.HYPHEN_MINUS:this._emitChars(`-`);break;case I.LESS_THAN_SIGN:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case I.GREATER_THAN_SIGN:this.state=U.SCRIPT_DATA,this._emitChars(`>`);break;case I.NULL:this._err(L.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case I.EOF:this._err(L.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===I.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Gv.SCRIPT,!1)&&Oy(this.preprocessor.peek(Gv.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Gv.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=U.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case I.EQUALS_SIGN:this._err(L.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=U.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:this._leaveAttrName(),this.state=U.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case I.EQUALS_SIGN:this._leaveAttrName(),this.state=U.BEFORE_ATTRIBUTE_VALUE;break;case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:this._err(L.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case I.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(Sy(e)?Ey(e):e)}}_stateAfterAttributeName(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:this.state=U.SELF_CLOSING_START_TAG;break;case I.EQUALS_SIGN:this.state=U.BEFORE_ATTRIBUTE_VALUE;break;case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentTagToken();break;case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=U.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:this.state=U.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case I.APOSTROPHE:this.state=U.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case I.GREATER_THAN_SIGN:this._err(L.missingAttributeValue),this.state=U.DATA,this.emitCurrentTagToken();break;default:this.state=U.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case I.QUOTATION_MARK:this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case I.AMPERSAND:this._startCharacterReference();break;case I.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case I.APOSTROPHE:this.state=U.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case I.AMPERSAND:this._startCharacterReference();break;case I.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break;case I.AMPERSAND:this._startCharacterReference();break;case I.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break;case I.NULL:this._err(L.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:this._err(L.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this._leaveAttrValue(),this.state=U.BEFORE_ATTRIBUTE_NAME;break;case I.SOLIDUS:this._leaveAttrValue(),this.state=U.SELF_CLOSING_START_TAG;break;case I.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=U.DATA,this.emitCurrentTagToken();break;case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this._err(L.missingWhitespaceBetweenAttributes),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case I.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=U.DATA,this.emitCurrentTagToken();break}case I.EOF:this._err(L.eofInTag),this._emitEOFToken();break;default:this._err(L.unexpectedSolidusInTag),this.state=U.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentComment(t);break;case I.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case I.NULL:this._err(L.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Gv.DASH_DASH,!0)?(this._createCommentToken(Gv.DASH_DASH.length+1),this.state=U.COMMENT_START):this._consumeSequenceIfMatch(Gv.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Gv.DOCTYPE.length+1),this.state=U.DOCTYPE):this._consumeSequenceIfMatch(Gv.CDATA_START,!0)?this.inForeignNode?this.state=U.CDATA_SECTION:(this._err(L.cdataInHtmlContent),this._createCommentToken(Gv.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=U.BOGUS_COMMENT):this._ensureHibernation()||(this._err(L.incorrectlyOpenedComment),this._createCommentToken(2),this.state=U.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case I.HYPHEN_MINUS:this.state=U.COMMENT_START_DASH;break;case I.GREATER_THAN_SIGN:{this._err(L.abruptClosingOfEmptyComment),this.state=U.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=U.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case I.HYPHEN_MINUS:this.state=U.COMMENT_END;break;case I.GREATER_THAN_SIGN:this._err(L.abruptClosingOfEmptyComment),this.state=U.DATA,this.emitCurrentComment(t);break;case I.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=U.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case I.HYPHEN_MINUS:this.state=U.COMMENT_END_DASH;break;case I.LESS_THAN_SIGN:t.data+=`<`,this.state=U.COMMENT_LESS_THAN_SIGN;break;case I.NULL:this._err(L.unexpectedNullCharacter),t.data+=`�`;break;case I.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case I.EXCLAMATION_MARK:t.data+=`!`,this.state=U.COMMENT_LESS_THAN_SIGN_BANG;break;case I.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=U.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===I.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=U.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===I.HYPHEN_MINUS?this.state=U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=U.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==I.GREATER_THAN_SIGN&&e!==I.EOF&&this._err(L.nestedComment),this.state=U.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case I.HYPHEN_MINUS:this.state=U.COMMENT_END;break;case I.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=U.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentComment(t);break;case I.EXCLAMATION_MARK:this.state=U.COMMENT_END_BANG;break;case I.HYPHEN_MINUS:t.data+=`-`;break;case I.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=U.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case I.HYPHEN_MINUS:t.data+=`--!`,this.state=U.COMMENT_END_DASH;break;case I.GREATER_THAN_SIGN:this._err(L.incorrectlyClosedComment),this.state=U.DATA,this.emitCurrentComment(t);break;case I.EOF:this._err(L.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=U.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this.state=U.BEFORE_DOCTYPE_NAME;break;case I.GREATER_THAN_SIGN:this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case I.EOF:{this._err(L.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(L.missingWhitespaceBeforeDoctypeName),this.state=U.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Sy(e))this._createDoctypeToken(String.fromCharCode(Ey(e))),this.state=U.DOCTYPE_NAME;else switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:this._err(L.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=U.DOCTYPE_NAME;break;case I.GREATER_THAN_SIGN:{this._err(L.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=U.DATA;break}case I.EOF:{this._err(L.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=U.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this.state=U.AFTER_DOCTYPE_NAME;break;case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.NULL:this._err(L.unexpectedNullCharacter),t.name+=`�`;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(Sy(e)?Ey(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(Gv.PUBLIC,!1)?this.state=U.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Gv.SYSTEM,!1)?this.state=U.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(L.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this.state=U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case I.QUOTATION_MARK:this._err(L.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case I.APOSTROPHE:this._err(L.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case I.GREATER_THAN_SIGN:this._err(L.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case I.APOSTROPHE:t.publicId=``,this.state=U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case I.GREATER_THAN_SIGN:this._err(L.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case I.QUOTATION_MARK:this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case I.NULL:this._err(L.unexpectedNullCharacter),t.publicId+=`�`;break;case I.GREATER_THAN_SIGN:this._err(L.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case I.APOSTROPHE:this.state=U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case I.NULL:this._err(L.unexpectedNullCharacter),t.publicId+=`�`;break;case I.GREATER_THAN_SIGN:this._err(L.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this.state=U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case I.GREATER_THAN_SIGN:this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.QUOTATION_MARK:this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case I.APOSTROPHE:this._err(L.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.QUOTATION_MARK:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case I.APOSTROPHE:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:this.state=U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case I.QUOTATION_MARK:this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case I.APOSTROPHE:this._err(L.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case I.GREATER_THAN_SIGN:this._err(L.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case I.APOSTROPHE:t.systemId=``,this.state=U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case I.GREATER_THAN_SIGN:this._err(L.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.DATA,this.emitCurrentDoctype(t);break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case I.QUOTATION_MARK:this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case I.NULL:this._err(L.unexpectedNullCharacter),t.systemId+=`�`;break;case I.GREATER_THAN_SIGN:this._err(L.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case I.APOSTROPHE:this.state=U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case I.NULL:this._err(L.unexpectedNullCharacter),t.systemId+=`�`;break;case I.GREATER_THAN_SIGN:this._err(L.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.EOF:this._err(L.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(L.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=U.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case I.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=U.DATA;break;case I.NULL:this._err(L.unexpectedNullCharacter);break;case I.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case I.RIGHT_SQUARE_BRACKET:this.state=U.CDATA_SECTION_BRACKET;break;case I.EOF:this._err(L.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===I.RIGHT_SQUARE_BRACKET?this.state=U.CDATA_SECTION_END:(this._emitChars(`]`),this.state=U.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case I.GREATER_THAN_SIGN:this.state=U.DATA;break;case I.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=U.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ty(this.preprocessor.peek(1))?U.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Ty(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===I.SEMICOLON&&this._err(L.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},jy=new Set([V.DD,V.DT,V.LI,V.OPTGROUP,V.OPTION,V.P,V.RB,V.RP,V.RT,V.RTC]),My=new Set([...jy,V.CAPTION,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]),Ny=new Set([V.APPLET,V.CAPTION,V.HTML,V.MARQUEE,V.OBJECT,V.TABLE,V.TD,V.TEMPLATE,V.TH]),Py=new Set([...Ny,V.OL,V.UL]),Fy=new Set([...Ny,V.BUTTON]),Iy=new Set([V.ANNOTATION_XML,V.MI,V.MN,V.MO,V.MS,V.MTEXT]),Ly=new Set([V.DESC,V.FOREIGN_OBJECT,V.TITLE]),Ry=new Set([V.TR,V.TEMPLATE,V.HTML]),zy=new Set([V.TBODY,V.TFOOT,V.THEAD,V.TEMPLATE,V.HTML]),By=new Set([V.TABLE,V.TEMPLATE,V.HTML]),Vy=new Set([V.TD,V.TH]),Hy=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=V.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===V.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===z.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==z.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(yy,z.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Vy,z.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(By,z.HTML)}clearBackToTableBodyContext(){this.clearBackTo(zy,z.HTML)}clearBackToTableRowContext(){this.clearBackTo(Ry,z.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===V.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===V.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case z.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case z.SVG:if(Ly.has(r))return!1;break;case z.MATHML:if(Iy.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Ny)}hasInListItemScope(e){return this.hasInDynamicScope(e,Py)}hasInButtonScope(e){return this.hasInDynamicScope(e,Fy)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case z.HTML:if(yy.has(t))return!0;if(Ny.has(t))return!1;break;case z.SVG:if(Ly.has(t))return!1;break;case z.MATHML:if(Iy.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===z.HTML)switch(this.tagIDs[t]){case e:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===z.HTML)switch(this.tagIDs[e]){case V.TBODY:case V.THEAD:case V.TFOOT:return!0;case V.TABLE:case V.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===z.HTML)switch(this.tagIDs[t]){case e:return!0;case V.OPTION:case V.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&jy.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&My.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&My.has(this.currentTagId);)this.pop()}},Uy=3,Wy;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(Wy||={});var Gy={type:Wy.Marker},Ky=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===Wy.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Uy)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Uy)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=Uy&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(Gy)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Wy.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Wy.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Gy);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===Wy.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===Wy.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Wy.Element&&t.element===e)}},qy={createDocument(){return{nodeName:`#document`,mode:hy.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};qy.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(qy.isTextNode(n)){n.value+=t;return}}qy.appendChild(e,qy.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&qy.isTextNode(r)?r.value+=t:qy.insertBefore(e,qy.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Jy=`html`,Yy=`about:legacy-compat`,Xy=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Zy=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Qy=[...Zy,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],$y=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),eb=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],tb=[...eb,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function nb(e,t){return t.some(t=>e.startsWith(t))}function rb(e){return e.name===Jy&&e.publicId===null&&(e.systemId===null||e.systemId===Yy)}function ib(e){if(e.name!==Jy)return hy.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Xy)return hy.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),$y.has(n))return hy.QUIRKS;let e=t===null?Qy:Zy;if(nb(n,e))return hy.QUIRKS;if(e=t===null?eb:tb,nb(n,e))return hy.LIMITED_QUIRKS}return hy.NO_QUIRKS}var ab={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},ob=`definitionurl`,sb=`definitionURL`,cb=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),lb=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:z.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:z.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:z.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:z.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:z.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:z.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:z.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:z.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:z.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:z.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:z.XMLNS}]]),ub=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),db=new Set([V.B,V.BIG,V.BLOCKQUOTE,V.BODY,V.BR,V.CENTER,V.CODE,V.DD,V.DIV,V.DL,V.DT,V.EM,V.EMBED,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HR,V.I,V.IMG,V.LI,V.LISTING,V.MENU,V.META,V.NOBR,V.OL,V.P,V.PRE,V.RUBY,V.S,V.SMALL,V.SPAN,V.STRONG,V.STRIKE,V.SUB,V.SUP,V.TABLE,V.TT,V.U,V.UL,V.VAR]);function fb(e){let t=e.tagID;return t===V.FONT&&e.attrs.some(({name:e})=>e===my.COLOR||e===my.SIZE||e===my.FACE)||db.has(t)}function pb(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===ob){e.attrs[t].name=sb;break}}function mb(e){for(let t=0;t<e.attrs.length;t++){let n=cb.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function hb(e){for(let t=0;t<e.attrs.length;t++){let n=lb.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function gb(e){let t=ub.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=_y(e.tagName))}function _b(e,t){return t===z.MATHML&&(e===V.MI||e===V.MO||e===V.MN||e===V.MS||e===V.MTEXT)}function vb(e,t,n){if(t===z.MATHML&&e===V.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===my.ENCODING){let t=n[e].value.toLowerCase();return t===ab.TEXT_HTML||t===ab.APPLICATION_XML}}return t===z.SVG&&(e===V.FOREIGN_OBJECT||e===V.DESC||e===V.TITLE)}function yb(e,t,n,r){return(!r||r===z.HTML)&&vb(e,t,n)||(!r||r===z.MATHML)&&_b(e,t)}var bb=`hidden`,xb=8,Sb=3,W;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(W||={});var Cb={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},wb=new Set([V.TABLE,V.TBODY,V.TFOOT,V.THEAD,V.TR]),Tb={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:qy,onParseError:null},Eb=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=W.INITIAL,this.originalInsertionMode=W.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Tb,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Ay(this.options,this),this.activeFormattingElements=new Ky(this.treeAdapter),this.fragmentContextID=n?_y(this.treeAdapter.getTagName(n)):V.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Hy(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...Tb,...t};e??=n.treeAdapter.createElement(B.TEMPLATE,z.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,z.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===V.TEMPLATE&&i.tmplInsertionModeStack.unshift(W.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Cb,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===z.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,z.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=W.TEXT}switchToPlaintextParsing(){this.insertionMode=W.TEXT,this.originalInsertionMode=W.IN_BODY,this.tokenizer.state=by.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===B.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===z.HTML)switch(this.fragmentContextID){case V.TITLE:case V.TEXTAREA:this.tokenizer.state=by.RCDATA;break;case V.STYLE:case V.XMP:case V.IFRAME:case V.NOEMBED:case V.NOFRAMES:case V.NOSCRIPT:this.tokenizer.state=by.RAWTEXT;break;case V.SCRIPT:this.tokenizer.state=by.SCRIPT_DATA;break;case V.PLAINTEXT:this.tokenizer.state=by.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,z.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,z.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(B.HTML,z.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,V.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===R.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===V.SVG&&this.treeAdapter.getTagName(t)===B.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===z.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===V.MGLYPH||e.tagID===V.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,z.HTML)}_processToken(e){switch(e.type){case R.CHARACTER:this.onCharacter(e);break;case R.NULL_CHARACTER:this.onNullCharacter(e);break;case R.COMMENT:this.onComment(e);break;case R.DOCTYPE:this.onDoctype(e);break;case R.START_TAG:this._processStartTag(e);break;case R.END_TAG:this.onEndTag(e);break;case R.EOF:this.onEof(e);break;case R.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return yb(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===Wy.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=W.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(V.P),this.openElements.popUntilTagNamePopped(V.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case V.TR:this.insertionMode=W.IN_ROW;return;case V.TBODY:case V.THEAD:case V.TFOOT:this.insertionMode=W.IN_TABLE_BODY;return;case V.CAPTION:this.insertionMode=W.IN_CAPTION;return;case V.COLGROUP:this.insertionMode=W.IN_COLUMN_GROUP;return;case V.TABLE:this.insertionMode=W.IN_TABLE;return;case V.BODY:this.insertionMode=W.IN_BODY;return;case V.FRAMESET:this.insertionMode=W.IN_FRAMESET;return;case V.SELECT:this._resetInsertionModeForSelect(e);return;case V.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case V.HTML:this.insertionMode=this.headElement?W.AFTER_HEAD:W.BEFORE_HEAD;return;case V.TD:case V.TH:if(e>0){this.insertionMode=W.IN_CELL;return}break;case V.HEAD:if(e>0){this.insertionMode=W.IN_HEAD;return}}this.insertionMode=W.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===V.TEMPLATE)break;if(e===V.TABLE){this.insertionMode=W.IN_SELECT_IN_TABLE;return}}this.insertionMode=W.IN_SELECT}_isElementCausesFosterParenting(e){return wb.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case V.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===z.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case V.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return vy[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)WS(this,e);else switch(this.insertionMode){case W.INITIAL:zb(this,e);break;case W.BEFORE_HTML:Hb(this,e);break;case W.BEFORE_HEAD:Gb(this,e);break;case W.IN_HEAD:Yb(this,e);break;case W.IN_HEAD_NO_SCRIPT:Qb(this,e);break;case W.AFTER_HEAD:tx(this,e);break;case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:ix(this,e);break;case W.TEXT:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:$x(this,e);break;case W.IN_TABLE_TEXT:fS(this,e);break;case W.IN_COLUMN_GROUP:yS(this,e);break;case W.AFTER_BODY:FS(this,e);break;case W.AFTER_AFTER_BODY:VS(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)US(this,e);else switch(this.insertionMode){case W.INITIAL:zb(this,e);break;case W.BEFORE_HTML:Hb(this,e);break;case W.BEFORE_HEAD:Gb(this,e);break;case W.IN_HEAD:Yb(this,e);break;case W.IN_HEAD_NO_SCRIPT:Qb(this,e);break;case W.AFTER_HEAD:tx(this,e);break;case W.TEXT:this._insertCharacters(e);break;case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:$x(this,e);break;case W.IN_COLUMN_GROUP:yS(this,e);break;case W.AFTER_BODY:FS(this,e);break;case W.AFTER_AFTER_BODY:VS(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)Pb(this,e);else switch(this.insertionMode){case W.INITIAL:case W.BEFORE_HTML:case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_TEMPLATE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:Pb(this,e);break;case W.IN_TABLE_TEXT:pS(this,e);break;case W.AFTER_BODY:Fb(this,e);break;case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:Ib(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case W.INITIAL:Rb(this,e);break;case W.BEFORE_HEAD:case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:this._err(e,L.misplacedDoctype);break;case W.IN_TABLE_TEXT:pS(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,L.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?KS(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case W.INITIAL:zb(this,e);break;case W.BEFORE_HTML:Bb(this,e);break;case W.BEFORE_HEAD:Ub(this,e);break;case W.IN_HEAD:Kb(this,e);break;case W.IN_HEAD_NO_SCRIPT:Xb(this,e);break;case W.AFTER_HEAD:$b(this,e);break;case W.IN_BODY:Lx(this,e);break;case W.IN_TABLE:cS(this,e);break;case W.IN_TABLE_TEXT:pS(this,e);break;case W.IN_CAPTION:hS(this,e);break;case W.IN_COLUMN_GROUP:_S(this,e);break;case W.IN_TABLE_BODY:bS(this,e);break;case W.IN_ROW:SS(this,e);break;case W.IN_CELL:wS(this,e);break;case W.IN_SELECT:ES(this,e);break;case W.IN_SELECT_IN_TABLE:OS(this,e);break;case W.IN_TEMPLATE:AS(this,e);break;case W.AFTER_BODY:NS(this,e);break;case W.IN_FRAMESET:IS(this,e);break;case W.AFTER_FRAMESET:RS(this,e);break;case W.AFTER_AFTER_BODY:BS(this,e);break;case W.AFTER_AFTER_FRAMESET:HS(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?qS(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case W.INITIAL:zb(this,e);break;case W.BEFORE_HTML:Vb(this,e);break;case W.BEFORE_HEAD:Wb(this,e);break;case W.IN_HEAD:qb(this,e);break;case W.IN_HEAD_NO_SCRIPT:Zb(this,e);break;case W.AFTER_HEAD:ex(this,e);break;case W.IN_BODY:Yx(this,e);break;case W.TEXT:Zx(this,e);break;case W.IN_TABLE:lS(this,e);break;case W.IN_TABLE_TEXT:pS(this,e);break;case W.IN_CAPTION:gS(this,e);break;case W.IN_COLUMN_GROUP:vS(this,e);break;case W.IN_TABLE_BODY:xS(this,e);break;case W.IN_ROW:CS(this,e);break;case W.IN_CELL:TS(this,e);break;case W.IN_SELECT:DS(this,e);break;case W.IN_SELECT_IN_TABLE:kS(this,e);break;case W.IN_TEMPLATE:jS(this,e);break;case W.AFTER_BODY:PS(this,e);break;case W.IN_FRAMESET:LS(this,e);break;case W.AFTER_FRAMESET:zS(this,e);break;case W.AFTER_AFTER_BODY:VS(this,e)}}onEof(e){switch(this.insertionMode){case W.INITIAL:zb(this,e);break;case W.BEFORE_HTML:Hb(this,e);break;case W.BEFORE_HEAD:Gb(this,e);break;case W.IN_HEAD:Yb(this,e);break;case W.IN_HEAD_NO_SCRIPT:Qb(this,e);break;case W.AFTER_HEAD:tx(this,e);break;case W.IN_BODY:case W.IN_TABLE:case W.IN_CAPTION:case W.IN_COLUMN_GROUP:case W.IN_TABLE_BODY:case W.IN_ROW:case W.IN_CELL:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:Xx(this,e);break;case W.TEXT:Qx(this,e);break;case W.IN_TABLE_TEXT:pS(this,e);break;case W.IN_TEMPLATE:MS(this,e);break;case W.AFTER_BODY:case W.IN_FRAMESET:case W.AFTER_FRAMESET:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:Lb(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===I.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case W.IN_HEAD:case W.IN_HEAD_NO_SCRIPT:case W.AFTER_HEAD:case W.TEXT:case W.IN_COLUMN_GROUP:case W.IN_SELECT:case W.IN_SELECT_IN_TABLE:case W.IN_FRAMESET:case W.AFTER_FRAMESET:this._insertCharacters(e);break;case W.IN_BODY:case W.IN_CAPTION:case W.IN_CELL:case W.IN_TEMPLATE:case W.AFTER_BODY:case W.AFTER_AFTER_BODY:case W.AFTER_AFTER_FRAMESET:rx(this,e);break;case W.IN_TABLE:case W.IN_TABLE_BODY:case W.IN_ROW:$x(this,e);break;case W.IN_TABLE_TEXT:dS(this,e)}}};function Db(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Jx(e,t),n}function Ob(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function kb(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Sb;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Ab(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Ab(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function jb(e,t,n){let r=_y(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===V.TEMPLATE&&i===z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Mb(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Nb(e,t){for(let n=0;n<xb;n++){let n=Db(e,t);if(!n)break;let r=Ob(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=kb(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&jb(e,a,i),Mb(e,r,n)}}function Pb(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Fb(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Ib(e,t){e._appendCommentNode(t,e.document)}function Lb(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Rb(e,t){e._setDocumentType(t);let n=t.forceQuirks?hy.QUIRKS:ib(t);rb(t)||e._err(t,L.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=W.BEFORE_HTML}function zb(e,t){e._err(t,L.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,hy.QUIRKS),e.insertionMode=W.BEFORE_HTML,e._processToken(t)}function Bb(e,t){t.tagID===V.HTML?(e._insertElement(t,z.HTML),e.insertionMode=W.BEFORE_HEAD):Hb(e,t)}function Vb(e,t){let n=t.tagID;(n===V.HTML||n===V.HEAD||n===V.BODY||n===V.BR)&&Hb(e,t)}function Hb(e,t){e._insertFakeRootElement(),e.insertionMode=W.BEFORE_HEAD,e._processToken(t)}function Ub(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.HEAD:e._insertElement(t,z.HTML),e.headElement=e.openElements.current,e.insertionMode=W.IN_HEAD;break;default:Gb(e,t)}}function Wb(e,t){let n=t.tagID;n===V.HEAD||n===V.BODY||n===V.HTML||n===V.BR?Gb(e,t):e._err(t,L.endTagWithoutMatchingOpenElement)}function Gb(e,t){e._insertFakeElement(B.HEAD,V.HEAD),e.headElement=e.openElements.current,e.insertionMode=W.IN_HEAD,e._processToken(t)}function Kb(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.TITLE:e._switchToTextParsing(t,by.RCDATA);break;case V.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,by.RAWTEXT):(e._insertElement(t,z.HTML),e.insertionMode=W.IN_HEAD_NO_SCRIPT);break;case V.NOFRAMES:case V.STYLE:e._switchToTextParsing(t,by.RAWTEXT);break;case V.SCRIPT:e._switchToTextParsing(t,by.SCRIPT_DATA);break;case V.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=W.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(W.IN_TEMPLATE);break;case V.HEAD:e._err(t,L.misplacedStartTagForHeadElement);break;default:Yb(e,t)}}function qb(e,t){switch(t.tagID){case V.HEAD:e.openElements.pop(),e.insertionMode=W.AFTER_HEAD;break;case V.BODY:case V.BR:case V.HTML:Yb(e,t);break;case V.TEMPLATE:Jb(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function Jb(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==V.TEMPLATE&&e._err(t,L.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(V.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,L.endTagWithoutMatchingOpenElement)}function Yb(e,t){e.openElements.pop(),e.insertionMode=W.AFTER_HEAD,e._processToken(t)}function Xb(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.BASEFONT:case V.BGSOUND:case V.HEAD:case V.LINK:case V.META:case V.NOFRAMES:case V.STYLE:Kb(e,t);break;case V.NOSCRIPT:e._err(t,L.nestedNoscriptInHead);break;default:Qb(e,t)}}function Zb(e,t){switch(t.tagID){case V.NOSCRIPT:e.openElements.pop(),e.insertionMode=W.IN_HEAD;break;case V.BR:Qb(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function Qb(e,t){let n=t.type===R.EOF?L.openElementsLeftAfterEof:L.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=W.IN_HEAD,e._processToken(t)}function $b(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.BODY:e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=W.IN_BODY;break;case V.FRAMESET:e._insertElement(t,z.HTML),e.insertionMode=W.IN_FRAMESET;break;case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:e._err(t,L.abandonedHeadElementChild),e.openElements.push(e.headElement,V.HEAD),Kb(e,t),e.openElements.remove(e.headElement);break;case V.HEAD:e._err(t,L.misplacedStartTagForHeadElement);break;default:tx(e,t)}}function ex(e,t){switch(t.tagID){case V.BODY:case V.HTML:case V.BR:tx(e,t);break;case V.TEMPLATE:Jb(e,t);break;default:e._err(t,L.endTagWithoutMatchingOpenElement)}}function tx(e,t){e._insertFakeElement(B.BODY,V.BODY),e.insertionMode=W.IN_BODY,nx(e,t)}function nx(e,t){switch(t.type){case R.CHARACTER:ix(e,t);break;case R.WHITESPACE_CHARACTER:rx(e,t);break;case R.COMMENT:Pb(e,t);break;case R.START_TAG:Lx(e,t);break;case R.END_TAG:Yx(e,t);break;case R.EOF:Xx(e,t)}}function rx(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function ix(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function ax(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ox(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function sx(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,z.HTML),e.insertionMode=W.IN_FRAMESET)}function cx(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function lx(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&yy.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,z.HTML)}function ux(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function dx(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),n||(e.formElement=e.openElements.current))}function fx(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===V.LI&&r===V.LI||(n===V.DD||n===V.DT)&&(r===V.DD||r===V.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==V.ADDRESS&&r!==V.DIV&&r!==V.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML)}function px(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.tokenizer.state=by.PLAINTEXT}function mx(e,t){e.openElements.hasInScope(V.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(V.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1}function hx(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(B.A);n&&(Nb(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gx(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function _x(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(V.NOBR)&&(Nb(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function vx(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function yx(e,t){e.treeAdapter.getDocumentMode(e.document)!==hy.QUIRKS&&e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=W.IN_TABLE}function bx(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function xx(e){let t=$v(e,my.TYPE);return t!=null&&t.toLowerCase()===bb}function Sx(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,z.HTML),xx(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Cx(e,t){e._appendElement(t,z.HTML),t.ackSelfClosing=!0}function wx(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._appendElement(t,z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Tx(e,t){t.tagName=B.IMG,t.tagID=V.IMG,bx(e,t)}function Ex(e,t){e._insertElement(t,z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=by.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=W.TEXT}function Dx(e,t){e.openElements.hasInButtonScope(V.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,by.RAWTEXT)}function Ox(e,t){e.framesetOk=!1,e._switchToTextParsing(t,by.RAWTEXT)}function kx(e,t){e._switchToTextParsing(t,by.RAWTEXT)}function Ax(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===W.IN_TABLE||e.insertionMode===W.IN_CAPTION||e.insertionMode===W.IN_TABLE_BODY||e.insertionMode===W.IN_ROW||e.insertionMode===W.IN_CELL?W.IN_SELECT_IN_TABLE:W.IN_SELECT}function jx(e,t){e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function Mx(e,t){e.openElements.hasInScope(V.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,z.HTML)}function Nx(e,t){e.openElements.hasInScope(V.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(V.RTC),e._insertElement(t,z.HTML)}function Px(e,t){e._reconstructActiveFormattingElements(),pb(t),hb(t),t.selfClosing?e._appendElement(t,z.MATHML):e._insertElement(t,z.MATHML),t.ackSelfClosing=!0}function Fx(e,t){e._reconstructActiveFormattingElements(),mb(t),hb(t),t.selfClosing?e._appendElement(t,z.SVG):e._insertElement(t,z.SVG),t.ackSelfClosing=!0}function Ix(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,z.HTML)}function Lx(e,t){switch(t.tagID){case V.I:case V.S:case V.B:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.SMALL:case V.STRIKE:case V.STRONG:gx(e,t);break;case V.A:hx(e,t);break;case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:lx(e,t);break;case V.P:case V.DL:case V.OL:case V.UL:case V.DIV:case V.DIR:case V.NAV:case V.MAIN:case V.MENU:case V.ASIDE:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.DETAILS:case V.ADDRESS:case V.ARTICLE:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:cx(e,t);break;case V.LI:case V.DD:case V.DT:fx(e,t);break;case V.BR:case V.IMG:case V.WBR:case V.AREA:case V.EMBED:case V.KEYGEN:bx(e,t);break;case V.HR:wx(e,t);break;case V.RB:case V.RTC:Mx(e,t);break;case V.RT:case V.RP:Nx(e,t);break;case V.PRE:case V.LISTING:ux(e,t);break;case V.XMP:Dx(e,t);break;case V.SVG:Fx(e,t);break;case V.HTML:ax(e,t);break;case V.BASE:case V.LINK:case V.META:case V.STYLE:case V.TITLE:case V.SCRIPT:case V.BGSOUND:case V.BASEFONT:case V.TEMPLATE:Kb(e,t);break;case V.BODY:ox(e,t);break;case V.FORM:dx(e,t);break;case V.NOBR:_x(e,t);break;case V.MATH:Px(e,t);break;case V.TABLE:yx(e,t);break;case V.INPUT:Sx(e,t);break;case V.PARAM:case V.TRACK:case V.SOURCE:Cx(e,t);break;case V.IMAGE:Tx(e,t);break;case V.BUTTON:mx(e,t);break;case V.APPLET:case V.OBJECT:case V.MARQUEE:vx(e,t);break;case V.IFRAME:Ox(e,t);break;case V.SELECT:Ax(e,t);break;case V.OPTION:case V.OPTGROUP:jx(e,t);break;case V.NOEMBED:case V.NOFRAMES:kx(e,t);break;case V.FRAMESET:sx(e,t);break;case V.TEXTAREA:Ex(e,t);break;case V.NOSCRIPT:e.options.scriptingEnabled?kx(e,t):Ix(e,t);break;case V.PLAINTEXT:px(e,t);break;case V.COL:case V.TH:case V.TD:case V.TR:case V.HEAD:case V.FRAME:case V.TBODY:case V.TFOOT:case V.THEAD:case V.CAPTION:case V.COLGROUP:break;default:Ix(e,t)}}function Rx(e,t){if(e.openElements.hasInScope(V.BODY)&&(e.insertionMode=W.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function zx(e,t){e.openElements.hasInScope(V.BODY)&&(e.insertionMode=W.AFTER_BODY,PS(e,t))}function Bx(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Vx(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(V.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(V.FORM):n&&e.openElements.remove(n))}function Hx(e){e.openElements.hasInButtonScope(V.P)||e._insertFakeElement(B.P,V.P),e._closePElement()}function Ux(e){e.openElements.hasInListItemScope(V.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(V.LI),e.openElements.popUntilTagNamePopped(V.LI))}function Wx(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Gx(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Kx(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function qx(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(B.BR,V.BR),e.openElements.pop(),e.framesetOk=!1}function Jx(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==V.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Yx(e,t){switch(t.tagID){case V.A:case V.B:case V.I:case V.S:case V.U:case V.EM:case V.TT:case V.BIG:case V.CODE:case V.FONT:case V.NOBR:case V.SMALL:case V.STRIKE:case V.STRONG:Nb(e,t);break;case V.P:Hx(e);break;case V.DL:case V.UL:case V.OL:case V.DIR:case V.DIV:case V.NAV:case V.PRE:case V.MAIN:case V.MENU:case V.ASIDE:case V.BUTTON:case V.CENTER:case V.FIGURE:case V.FOOTER:case V.HEADER:case V.HGROUP:case V.DIALOG:case V.ADDRESS:case V.ARTICLE:case V.DETAILS:case V.SEARCH:case V.SECTION:case V.SUMMARY:case V.LISTING:case V.FIELDSET:case V.BLOCKQUOTE:case V.FIGCAPTION:Bx(e,t);break;case V.LI:Ux(e);break;case V.DD:case V.DT:Wx(e,t);break;case V.H1:case V.H2:case V.H3:case V.H4:case V.H5:case V.H6:Gx(e);break;case V.BR:qx(e);break;case V.BODY:Rx(e,t);break;case V.HTML:zx(e,t);break;case V.FORM:Vx(e);break;case V.APPLET:case V.OBJECT:case V.MARQUEE:Kx(e,t);break;case V.TEMPLATE:Jb(e,t);break;default:Jx(e,t)}}function Xx(e,t){e.tmplInsertionModeStack.length>0?MS(e,t):Lb(e,t)}function Zx(e,t){var n;t.tagID===V.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Qx(e,t){e._err(t,L.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function $x(e,t){if(e.openElements.currentTagId!==void 0&&wb.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=W.IN_TABLE_TEXT,t.type){case R.CHARACTER:fS(e,t);break;case R.WHITESPACE_CHARACTER:dS(e,t)}else uS(e,t)}function eS(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,z.HTML),e.insertionMode=W.IN_CAPTION}function tS(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=W.IN_COLUMN_GROUP}function nS(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(B.COLGROUP,V.COLGROUP),e.insertionMode=W.IN_COLUMN_GROUP,_S(e,t)}function rS(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,z.HTML),e.insertionMode=W.IN_TABLE_BODY}function iS(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(B.TBODY,V.TBODY),e.insertionMode=W.IN_TABLE_BODY,bS(e,t)}function aS(e,t){e.openElements.hasInTableScope(V.TABLE)&&(e.openElements.popUntilTagNamePopped(V.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function oS(e,t){xx(t)?e._appendElement(t,z.HTML):uS(e,t),t.ackSelfClosing=!0}function sS(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function cS(e,t){switch(t.tagID){case V.TD:case V.TH:case V.TR:iS(e,t);break;case V.STYLE:case V.SCRIPT:case V.TEMPLATE:Kb(e,t);break;case V.COL:nS(e,t);break;case V.FORM:sS(e,t);break;case V.TABLE:aS(e,t);break;case V.TBODY:case V.TFOOT:case V.THEAD:rS(e,t);break;case V.INPUT:oS(e,t);break;case V.CAPTION:eS(e,t);break;case V.COLGROUP:tS(e,t);break;default:uS(e,t)}}function lS(e,t){switch(t.tagID){case V.TABLE:e.openElements.hasInTableScope(V.TABLE)&&(e.openElements.popUntilTagNamePopped(V.TABLE),e._resetInsertionMode());break;case V.TEMPLATE:Jb(e,t);break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:uS(e,t)}}function uS(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,nx(e,t),e.fosterParentingEnabled=n}function dS(e,t){e.pendingCharacterTokens.push(t)}function fS(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function pS(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)uS(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var mS=new Set([V.CAPTION,V.COL,V.COLGROUP,V.TBODY,V.TD,V.TFOOT,V.TH,V.THEAD,V.TR]);function hS(e,t){let n=t.tagID;mS.has(n)?e.openElements.hasInTableScope(V.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(V.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=W.IN_TABLE,cS(e,t)):Lx(e,t)}function gS(e,t){let n=t.tagID;switch(n){case V.CAPTION:case V.TABLE:e.openElements.hasInTableScope(V.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(V.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=W.IN_TABLE,n===V.TABLE&&lS(e,t));break;case V.BODY:case V.COL:case V.COLGROUP:case V.HTML:case V.TBODY:case V.TD:case V.TFOOT:case V.TH:case V.THEAD:case V.TR:break;default:Yx(e,t)}}function _S(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.COL:e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.TEMPLATE:Kb(e,t);break;default:yS(e,t)}}function vS(e,t){switch(t.tagID){case V.COLGROUP:e.openElements.currentTagId===V.COLGROUP&&(e.openElements.pop(),e.insertionMode=W.IN_TABLE);break;case V.TEMPLATE:Jb(e,t);break;case V.COL:break;default:yS(e,t)}}function yS(e,t){e.openElements.currentTagId===V.COLGROUP&&(e.openElements.pop(),e.insertionMode=W.IN_TABLE,e._processToken(t))}function bS(e,t){switch(t.tagID){case V.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,z.HTML),e.insertionMode=W.IN_ROW;break;case V.TH:case V.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(B.TR,V.TR),e.insertionMode=W.IN_ROW,SS(e,t);break;case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE,cS(e,t));break;default:cS(e,t)}}function xS(e,t){let n=t.tagID;switch(t.tagID){case V.TBODY:case V.TFOOT:case V.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE);break;case V.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE,lS(e,t));break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:case V.TR:break;default:lS(e,t)}}function SS(e,t){switch(t.tagID){case V.TH:case V.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,z.HTML),e.insertionMode=W.IN_CELL,e.activeFormattingElements.insertMarker();break;case V.CAPTION:case V.COL:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:e.openElements.hasInTableScope(V.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE_BODY,bS(e,t));break;default:cS(e,t)}}function CS(e,t){switch(t.tagID){case V.TR:e.openElements.hasInTableScope(V.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE_BODY);break;case V.TABLE:e.openElements.hasInTableScope(V.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE_BODY,xS(e,t));break;case V.TBODY:case V.TFOOT:case V.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(V.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=W.IN_TABLE_BODY,xS(e,t));break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:case V.TD:case V.TH:break;default:lS(e,t)}}function wS(e,t){let n=t.tagID;mS.has(n)?(e.openElements.hasInTableScope(V.TD)||e.openElements.hasInTableScope(V.TH))&&(e._closeTableCell(),SS(e,t)):Lx(e,t)}function TS(e,t){let n=t.tagID;switch(n){case V.TD:case V.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=W.IN_ROW);break;case V.TABLE:case V.TBODY:case V.TFOOT:case V.THEAD:case V.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),CS(e,t));break;case V.BODY:case V.CAPTION:case V.COL:case V.COLGROUP:case V.HTML:break;default:Yx(e,t)}}function ES(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.OPTION:e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e._insertElement(t,z.HTML);break;case V.OPTGROUP:e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e.openElements.currentTagId===V.OPTGROUP&&e.openElements.pop(),e._insertElement(t,z.HTML);break;case V.HR:e.openElements.currentTagId===V.OPTION&&e.openElements.pop(),e.openElements.currentTagId===V.OPTGROUP&&e.openElements.pop(),e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.INPUT:case V.KEYGEN:case V.TEXTAREA:case V.SELECT:e.openElements.hasInSelectScope(V.SELECT)&&(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode(),t.tagID!==V.SELECT&&e._processStartTag(t));break;case V.SCRIPT:case V.TEMPLATE:Kb(e,t)}}function DS(e,t){switch(t.tagID){case V.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===V.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===V.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===V.OPTGROUP&&e.openElements.pop();break;case V.OPTION:e.openElements.currentTagId===V.OPTION&&e.openElements.pop();break;case V.SELECT:e.openElements.hasInSelectScope(V.SELECT)&&(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode());break;case V.TEMPLATE:Jb(e,t)}}function OS(e,t){let n=t.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ES(e,t)}function kS(e,t){let n=t.tagID;n===V.CAPTION||n===V.TABLE||n===V.TBODY||n===V.TFOOT||n===V.THEAD||n===V.TR||n===V.TD||n===V.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(V.SELECT),e._resetInsertionMode(),e.onEndTag(t)):DS(e,t)}function AS(e,t){switch(t.tagID){case V.BASE:case V.BASEFONT:case V.BGSOUND:case V.LINK:case V.META:case V.NOFRAMES:case V.SCRIPT:case V.STYLE:case V.TEMPLATE:case V.TITLE:Kb(e,t);break;case V.CAPTION:case V.COLGROUP:case V.TBODY:case V.TFOOT:case V.THEAD:e.tmplInsertionModeStack[0]=W.IN_TABLE,e.insertionMode=W.IN_TABLE,cS(e,t);break;case V.COL:e.tmplInsertionModeStack[0]=W.IN_COLUMN_GROUP,e.insertionMode=W.IN_COLUMN_GROUP,_S(e,t);break;case V.TR:e.tmplInsertionModeStack[0]=W.IN_TABLE_BODY,e.insertionMode=W.IN_TABLE_BODY,bS(e,t);break;case V.TD:case V.TH:e.tmplInsertionModeStack[0]=W.IN_ROW,e.insertionMode=W.IN_ROW,SS(e,t);break;default:e.tmplInsertionModeStack[0]=W.IN_BODY,e.insertionMode=W.IN_BODY,Lx(e,t)}}function jS(e,t){t.tagID===V.TEMPLATE&&Jb(e,t)}function MS(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(V.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Lb(e,t)}function NS(e,t){t.tagID===V.HTML?Lx(e,t):FS(e,t)}function PS(e,t){if(t.tagID===V.HTML){if(e.fragmentContext||(e.insertionMode=W.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===V.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else FS(e,t)}function FS(e,t){e.insertionMode=W.IN_BODY,nx(e,t)}function IS(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.FRAMESET:e._insertElement(t,z.HTML);break;case V.FRAME:e._appendElement(t,z.HTML),t.ackSelfClosing=!0;break;case V.NOFRAMES:Kb(e,t)}}function LS(e,t){t.tagID===V.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==V.FRAMESET&&(e.insertionMode=W.AFTER_FRAMESET))}function RS(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.NOFRAMES:Kb(e,t)}}function zS(e,t){t.tagID===V.HTML&&(e.insertionMode=W.AFTER_AFTER_FRAMESET)}function BS(e,t){t.tagID===V.HTML?Lx(e,t):VS(e,t)}function VS(e,t){e.insertionMode=W.IN_BODY,nx(e,t)}function HS(e,t){switch(t.tagID){case V.HTML:Lx(e,t);break;case V.NOFRAMES:Kb(e,t)}}function US(e,t){t.chars=`�`,e._insertCharacters(t)}function WS(e,t){e._insertCharacters(t),e.framesetOk=!1}function GS(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==z.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function KS(e,t){if(fb(t))GS(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===z.MATHML?pb(t):r===z.SVG&&(gb(t),mb(t)),hb(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function qS(e,t){if(t.tagID===V.P||t.tagID===V.BR)GS(e),e._endTagOutsideForeignContent(t);else for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===z.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}B.AREA,B.BASE,B.BASEFONT,B.BGSOUND,B.BR,B.COL,B.EMBED,B.FRAME,B.HR,B.IMG,B.INPUT,B.KEYGEN,B.LINK,B.META,B.PARAM,B.SOURCE,B.TRACK,B.WBR;function JS(e,t){return Eb.parse(e,t)}function YS(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=Eb.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var XS={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},ZS=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,QS=/-[a-z]/g,$S=/%c(?:([-+])(\d+))?/g,eC=/%x/g,tC={2:!0,1:!1,0:null},nC={};function rC(e,n){let r=n||nC,i=r.onerror,a=e instanceof t.a?e:new t.a(e),o=r.fragment?YS:JS,s=String(a);return Iv(o(s,{sourceCodeLocationInfo:!0,onParseError:r.onerror?c:null,scriptingEnabled:!1}),{file:a,space:r.space,verbose:r.verbose});function c(e){let n=e.code,o=iC(n),c=r[o]??!0,l=typeof c==`number`?c:+!!c;if(l){let r=XS[o],s=new t.f(u(r.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:n,source:`hast-util-from-html`});a.path&&(s.file=a.path,s.name=a.path+`:`+s.name),s.fatal=tC[l],s.note=u(r.description),s.url=r.url===!1?void 0:ZS+n,i(s)}function u(t){return t.replace($S,n).replace(eC,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return oC(s.charAt(e.startOffset+i))}function r(){return sC(s.charCodeAt(e.startOffset))}}}}function iC(e){return e.replace(QS,aC)}function aC(e){return e.charAt(1).toUpperCase()}function oC(e){return e==="`"?"` ` `":e}function sC(e){return`0x`+e.toString(16).toUpperCase()}function cC(e,n){let r=(n||{}).force||!1;t.o(e,i);function i(e){r?delete e.position:e.position=void 0}}function lC(e,t){let n=rC(e,t);return cC(n,{force:!0}),delete n.data,n}var uC=(function(e,n,r){let i=t.l(r);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof n==`number`){if(n<0||n===1/0)throw Error(`Expected positive finite number as index`)}else if(n=e.children.indexOf(n),n<0)throw Error(`Expected child node or index`);for(;++n<e.children.length;)if(i(e.children[n],n,e))return e.children[n]}),dC=(function(e){if(e==null)return hC;if(typeof e==`string`)return pC(e);if(typeof e==`object`)return fC(e);if(typeof e==`function`)return mC(e);throw Error("Expected function, string, or array as `test`")});function fC(e){let t=[],n=-1;for(;++n<e.length;)t[n]=dC(e[n]);return mC(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function pC(e){return mC(t);function t(t){return t.tagName===e}}function mC(e){return t;function t(t,n,r){return!!(gC(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hC(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function gC(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var _C=/\n/g,vC=/[\t ]+/g,yC=dC(`br`),bC=dC(NC),xC=dC(`p`),SC=dC(`tr`),CC=dC([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,MC,PC]),wC=dC(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function TC(e,t){let n=t||{},r=`children`in e?e.children:[],i=wC(e),a=jC(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...OC(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...EC(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?yC(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
527
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function EC(e,t,n){return e.type===`element`?DC(e,t,n):e.type===`text`?n.whitespace===`normal`?OC(e,n):kC(e):[]}function DC(e,t,n){let r=jC(e,n),i=e.children||[],a=-1,o=[];if(CC(e))return o;let s,c;for(yC(e)||SC(e)&&uC(t,e,SC)?c=`
528
+ `:xC(e)?(s=2,c=2):wC(e)&&(s=1,c=1);++a<i.length;)o=o.concat(EC(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?yC(i[a+1]):c}));return bC(e)&&uC(t,e,bC)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function OC(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){_C.lastIndex=a;let e=_C.exec(n),i=e&&`index`in e?e.index:n.length;r.push(AC(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function kC(e){return[String(e.value)]}function AC(e,t,n){let r=[],i=0,a;for(;i<e.length;){vC.lastIndex=i;let n=vC.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function jC(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`}}return t.whitespace}function MC(e){return!!(e.properties||{}).hidden}function NC(e){return e.tagName===`td`||e.tagName===`th`}function PC(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var FC={},IC=[];function LC(e){let n=e||FC;return function(e,r){t.c(e,`element`,function(e,a){let o=Array.isArray(e.properties.className)?e.properties.className:IC,s=o.includes(`language-math`),c=o.includes(`math-display`),l=o.includes(`math-inline`),u=c;if(!s&&!c&&!l)return;let d=a[a.length-1],f=e;if(e.tagName===`code`&&s&&d&&d.type===`element`&&d.tagName===`pre`&&(f=d,d=a[a.length-2],u=!0),!d)return;let p=TC(f,{whitespace:`pre`}),m;try{m=i.t.renderToString(p,{...n,displayMode:u,throwOnError:!0})}catch(t){let o=t,s=o.name.toLowerCase();r.message(`Could not render math with KaTeX`,{ancestors:[...a,e],cause:o,place:e.position,ruleId:s,source:`rehype-katex`});try{m=i.t.renderToString(p,{...n,displayMode:u,strict:`ignore`,throwOnError:!1})}catch{m=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(n.errorColor||`#cc0000`),title:String(t)},children:[{type:`text`,value:p}]}]}}typeof m==`string`&&(m=lC(m,{fragment:!0}).children);let h=d.children.indexOf(f);return d.children.splice(h,1,...m),t.s})}}var RC={}.hasOwnProperty;function zC(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&RC.call(t,e)){let n=String(t[e]);i=RC.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var BC={},VC={}.hasOwnProperty,HC=zC(`type`,{handlers:{root:WC,element:YC,text:qC,comment:JC,doctype:KC}});function UC(e,t){let n=(t||BC).space;return HC(e,n===`svg`?_g:gg)}function WC(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=ZC(e.children,n,t),QC(e,n),n}function GC(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=ZC(e.children,n,t),QC(e,n),n}function KC(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return QC(e,t),t}function qC(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return QC(e,t),t}function JC(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return QC(e,t),t}function YC(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=_g);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&VC.call(e.properties,a)){let t=XC(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Nv[o],childNodes:[],parentNode:null};return s.childNodes=ZC(e.children,s,r),QC(e,s),e.tagName===`template`&&e.content&&(s.content=GC(e.content,r)),s}function XC(e,t,n){let r=pg(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?jh(n):yg(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Nv[r.space]}return i}function ZC(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=HC(e[r],n);a.parentNode=t,i.push(a)}return i}function QC(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var $C=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],ew=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),G;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(G||={});var tw={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function nw(e){return e>=55296&&e<=57343}function rw(e){return e>=56320&&e<=57343}function iw(e,t){return(e-55296)*1024+9216+t}function aw(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function ow(e){return e>=64976&&e<=65007||ew.has(e)}var K;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(K||={});var sw=65536,cw=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=sw,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(rw(t))return this.pos++,this._addGap(),iw(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(K.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let n=this.html.charCodeAt(t);return n===G.CARRIAGE_RETURN?G.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let e=this.html.charCodeAt(this.pos);return e===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):e===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,nw(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===G.LINE_FEED||e===G.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){aw(e)?this._err(K.controlCharacterInInputStream):ow(e)&&this._err(K.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},q;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(q||={});function lw(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var uw=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),dw=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function fw(e){return e>=55296&&e<=57343||e>1114111?65533:dw.get(e)??e}var pw;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(pw||={});var mw=32,hw;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(hw||={});function gw(e){return e>=pw.ZERO&&e<=pw.NINE}function _w(e){return e>=pw.UPPER_A&&e<=pw.UPPER_F||e>=pw.LOWER_A&&e<=pw.LOWER_F}function vw(e){return e>=pw.UPPER_A&&e<=pw.UPPER_Z||e>=pw.LOWER_A&&e<=pw.LOWER_Z||gw(e)}function yw(e){return e===pw.EQUALS||vw(e)}var bw;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(bw||={});var xw;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(xw||={});var Sw=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=bw.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=xw.Strict}startEntity(e){this.decodeMode=e,this.state=bw.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case bw.EntityStart:return e.charCodeAt(t)===pw.NUM?(this.state=bw.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=bw.NamedEntity,this.stateNamedEntity(e,t));case bw.NumericStart:return this.stateNumericStart(e,t);case bw.NumericDecimal:return this.stateNumericDecimal(e,t);case bw.NumericHex:return this.stateNumericHex(e,t);case bw.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|mw)===pw.LOWER_X?(this.state=bw.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=bw.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(gw(r)||_w(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(gw(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===pw.SEMI)this.consumed+=1;else if(this.decodeMode===xw.Strict)return 0;return this.emitCodePoint(fw(this.result),this.consumed),this.errors&&(e!==pw.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&hw.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Cw(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===xw.Attribute&&(i===0||yw(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&hw.VALUE_LENGTH)>>14,i!==0){if(a===pw.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==xw.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&hw.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~hw.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case bw.NamedEntity:return this.result!==0&&(this.decodeMode!==xw.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case bw.NumericDecimal:return this.emitNumericEntity(0,2);case bw.NumericHex:return this.emitNumericEntity(0,3);case bw.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case bw.EntityStart:return 0}}};function Cw(e,t,n,r){let i=(t&hw.BRANCH_LENGTH)>>7,a=t&hw.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var J;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(J||={});var ww;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(ww||={});var Tw;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(Tw||={});var Y;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(Y||={});var X;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(X||={});var Ew=new Map([[Y.A,X.A],[Y.ADDRESS,X.ADDRESS],[Y.ANNOTATION_XML,X.ANNOTATION_XML],[Y.APPLET,X.APPLET],[Y.AREA,X.AREA],[Y.ARTICLE,X.ARTICLE],[Y.ASIDE,X.ASIDE],[Y.B,X.B],[Y.BASE,X.BASE],[Y.BASEFONT,X.BASEFONT],[Y.BGSOUND,X.BGSOUND],[Y.BIG,X.BIG],[Y.BLOCKQUOTE,X.BLOCKQUOTE],[Y.BODY,X.BODY],[Y.BR,X.BR],[Y.BUTTON,X.BUTTON],[Y.CAPTION,X.CAPTION],[Y.CENTER,X.CENTER],[Y.CODE,X.CODE],[Y.COL,X.COL],[Y.COLGROUP,X.COLGROUP],[Y.DD,X.DD],[Y.DESC,X.DESC],[Y.DETAILS,X.DETAILS],[Y.DIALOG,X.DIALOG],[Y.DIR,X.DIR],[Y.DIV,X.DIV],[Y.DL,X.DL],[Y.DT,X.DT],[Y.EM,X.EM],[Y.EMBED,X.EMBED],[Y.FIELDSET,X.FIELDSET],[Y.FIGCAPTION,X.FIGCAPTION],[Y.FIGURE,X.FIGURE],[Y.FONT,X.FONT],[Y.FOOTER,X.FOOTER],[Y.FOREIGN_OBJECT,X.FOREIGN_OBJECT],[Y.FORM,X.FORM],[Y.FRAME,X.FRAME],[Y.FRAMESET,X.FRAMESET],[Y.H1,X.H1],[Y.H2,X.H2],[Y.H3,X.H3],[Y.H4,X.H4],[Y.H5,X.H5],[Y.H6,X.H6],[Y.HEAD,X.HEAD],[Y.HEADER,X.HEADER],[Y.HGROUP,X.HGROUP],[Y.HR,X.HR],[Y.HTML,X.HTML],[Y.I,X.I],[Y.IMG,X.IMG],[Y.IMAGE,X.IMAGE],[Y.INPUT,X.INPUT],[Y.IFRAME,X.IFRAME],[Y.KEYGEN,X.KEYGEN],[Y.LABEL,X.LABEL],[Y.LI,X.LI],[Y.LINK,X.LINK],[Y.LISTING,X.LISTING],[Y.MAIN,X.MAIN],[Y.MALIGNMARK,X.MALIGNMARK],[Y.MARQUEE,X.MARQUEE],[Y.MATH,X.MATH],[Y.MENU,X.MENU],[Y.META,X.META],[Y.MGLYPH,X.MGLYPH],[Y.MI,X.MI],[Y.MO,X.MO],[Y.MN,X.MN],[Y.MS,X.MS],[Y.MTEXT,X.MTEXT],[Y.NAV,X.NAV],[Y.NOBR,X.NOBR],[Y.NOFRAMES,X.NOFRAMES],[Y.NOEMBED,X.NOEMBED],[Y.NOSCRIPT,X.NOSCRIPT],[Y.OBJECT,X.OBJECT],[Y.OL,X.OL],[Y.OPTGROUP,X.OPTGROUP],[Y.OPTION,X.OPTION],[Y.P,X.P],[Y.PARAM,X.PARAM],[Y.PLAINTEXT,X.PLAINTEXT],[Y.PRE,X.PRE],[Y.RB,X.RB],[Y.RP,X.RP],[Y.RT,X.RT],[Y.RTC,X.RTC],[Y.RUBY,X.RUBY],[Y.S,X.S],[Y.SCRIPT,X.SCRIPT],[Y.SEARCH,X.SEARCH],[Y.SECTION,X.SECTION],[Y.SELECT,X.SELECT],[Y.SOURCE,X.SOURCE],[Y.SMALL,X.SMALL],[Y.SPAN,X.SPAN],[Y.STRIKE,X.STRIKE],[Y.STRONG,X.STRONG],[Y.STYLE,X.STYLE],[Y.SUB,X.SUB],[Y.SUMMARY,X.SUMMARY],[Y.SUP,X.SUP],[Y.TABLE,X.TABLE],[Y.TBODY,X.TBODY],[Y.TEMPLATE,X.TEMPLATE],[Y.TEXTAREA,X.TEXTAREA],[Y.TFOOT,X.TFOOT],[Y.TD,X.TD],[Y.TH,X.TH],[Y.THEAD,X.THEAD],[Y.TITLE,X.TITLE],[Y.TR,X.TR],[Y.TRACK,X.TRACK],[Y.TT,X.TT],[Y.U,X.U],[Y.UL,X.UL],[Y.SVG,X.SVG],[Y.VAR,X.VAR],[Y.WBR,X.WBR],[Y.XMP,X.XMP]]);function Dw(e){return Ew.get(e)??X.UNKNOWN}var Z=X,Ow={[J.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[J.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[J.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[J.XLINK]:new Set,[J.XML]:new Set,[J.XMLNS]:new Set},kw=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT;var Q;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(Q||={});var Aw={DATA:Q.DATA,RCDATA:Q.RCDATA,RAWTEXT:Q.RAWTEXT,SCRIPT_DATA:Q.SCRIPT_DATA,PLAINTEXT:Q.PLAINTEXT,CDATA_SECTION:Q.CDATA_SECTION};function jw(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function Mw(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function Nw(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function Pw(e){return Nw(e)||Mw(e)}function Fw(e){return Pw(e)||jw(e)}function Iw(e){return e+32}function Lw(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function Rw(e){return Lw(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function zw(e){return e===G.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:nw(e)?K.surrogateCharacterReference:ow(e)?K.noncharacterCharacterReference:aw(e)||e===G.CARRIAGE_RETURN?K.controlCharacterReference:null}var Bw=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=Q.DATA,this.returnState=Q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new cw(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Sw(uw,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=zw(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:q.START_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:q.END_TAG,tagName:``,tagID:X.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:q.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:q.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(lw(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(K.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=Dw(e.tagName),e.type===q.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(K.endTagWithAttributes),e.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case q.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case q.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case q.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:q.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Lw(e)?q.WHITESPACE_CHARACTER:e===G.NULL?q.NULL_CHARACTER:q.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(q.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?xw.Attribute:xw.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Q.DATA:this._stateData(e);break;case Q.RCDATA:this._stateRcdata(e);break;case Q.RAWTEXT:this._stateRawtext(e);break;case Q.SCRIPT_DATA:this._stateScriptData(e);break;case Q.PLAINTEXT:this._statePlaintext(e);break;case Q.TAG_OPEN:this._stateTagOpen(e);break;case Q.END_TAG_OPEN:this._stateEndTagOpen(e);break;case Q.TAG_NAME:this._stateTagName(e);break;case Q.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case Q.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case Q.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case Q.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case Q.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case Q.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case Q.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case Q.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case Q.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case Q.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case Q.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case Q.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case Q.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case Q.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case Q.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case Q.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case Q.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case Q.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case Q.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case Q.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case Q.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case Q.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case Q.BOGUS_COMMENT:this._stateBogusComment(e);break;case Q.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case Q.COMMENT_START:this._stateCommentStart(e);break;case Q.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case Q.COMMENT:this._stateComment(e);break;case Q.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case Q.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case Q.COMMENT_END:this._stateCommentEnd(e);break;case Q.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case Q.DOCTYPE:this._stateDoctype(e);break;case Q.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case Q.DOCTYPE_NAME:this._stateDoctypeName(e);break;case Q.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case Q.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case Q.CDATA_SECTION:this._stateCdataSection(e);break;case Q.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case Q.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case Q.CHARACTER_REFERENCE:this._stateCharacterReference();break;case Q.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Q.TAG_OPEN;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitCodePoint(e);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case G.AMPERSAND:this._startCharacterReference();break;case G.LESS_THAN_SIGN:this.state=Q.RCDATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case G.LESS_THAN_SIGN:this.state=Q.RAWTEXT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Pw(e))this._createStartTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case G.EXCLAMATION_MARK:this.state=Q.MARKUP_DECLARATION_OPEN;break;case G.SOLIDUS:this.state=Q.END_TAG_OPEN;break;case G.QUESTION_MARK:this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e);break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=Q.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Pw(e))this._createEndTagToken(),this.state=Q.TAG_NAME,this._stateTagName(e);else switch(e){case G.GREATER_THAN_SIGN:this._err(K.missingEndTagName),this.state=Q.DATA;break;case G.EOF:this._err(K.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(K.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.tagName+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(Mw(e)?Iw(e):e)}}_stateRcdataLessThanSign(e){e===G.SOLIDUS?this.state=Q.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Pw(e)?(this.state=Q.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=Q.BEFORE_ATTRIBUTE_NAME,!1;case G.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=Q.SELF_CLOSING_START_TAG,!1;case G.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=Q.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===G.SOLIDUS?this.state=Q.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Pw(e)?(this.state=Q.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case G.SOLIDUS:this.state=Q.SCRIPT_DATA_END_TAG_OPEN;break;case G.EXCLAMATION_MARK:this.state=Q.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Pw(e)?(this.state=Q.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===G.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===G.HYPHEN_MINUS?(this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=Q.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case G.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===G.SOLIDUS?this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Pw(e)?(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Pw(e)?(this.state=Q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(tw.SCRIPT,!1)&&Rw(this.preprocessor.peek(tw.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<tw.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case G.HYPHEN_MINUS:this._emitChars(`-`);break;case G.LESS_THAN_SIGN:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case G.GREATER_THAN_SIGN:this.state=Q.SCRIPT_DATA,this._emitChars(`>`);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case G.EOF:this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===G.SOLIDUS?(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(tw.SCRIPT,!1)&&Rw(this.preprocessor.peek(tw.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<tw.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=Q.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=Q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._err(K.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=Q.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:case G.SOLIDUS:case G.GREATER_THAN_SIGN:case G.EOF:this._leaveAttrName(),this.state=Q.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case G.EQUALS_SIGN:this._leaveAttrName(),this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:this._err(K.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(Mw(e)?Iw(e):e)}}_stateAfterAttributeName(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.SOLIDUS:this.state=Q.SELF_CLOSING_START_TAG;break;case G.EQUALS_SIGN:this.state=Q.BEFORE_ATTRIBUTE_VALUE;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=Q.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:this.state=Q.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case G.APOSTROPHE:this.state=Q.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingAttributeValue),this.state=Q.DATA,this.emitCurrentTagToken();break;default:this.state=Q.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case G.QUOTATION_MARK:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case G.APOSTROPHE:this.state=Q.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case G.AMPERSAND:this._startCharacterReference();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case G.AMPERSAND:this._startCharacterReference();break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case G.QUOTATION_MARK:case G.APOSTROPHE:case G.LESS_THAN_SIGN:case G.EQUALS_SIGN:case G.GRAVE_ACCENT:this._err(K.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this._leaveAttrValue(),this.state=Q.BEFORE_ATTRIBUTE_NAME;break;case G.SOLIDUS:this._leaveAttrValue(),this.state=Q.SELF_CLOSING_START_TAG;break;case G.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=Q.DATA,this.emitCurrentTagToken();break;case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.missingWhitespaceBetweenAttributes),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case G.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=Q.DATA,this.emitCurrentTagToken();break}case G.EOF:this._err(K.eofInTag),this._emitEOFToken();break;default:this._err(K.unexpectedSolidusInTag),this.state=Q.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(tw.DASH_DASH,!0)?(this._createCommentToken(tw.DASH_DASH.length+1),this.state=Q.COMMENT_START):this._consumeSequenceIfMatch(tw.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(tw.DOCTYPE.length+1),this.state=Q.DOCTYPE):this._consumeSequenceIfMatch(tw.CDATA_START,!0)?this.inForeignNode?this.state=Q.CDATA_SECTION:(this._err(K.cdataInHtmlContent),this._createCommentToken(tw.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=Q.BOGUS_COMMENT):this._ensureHibernation()||(this._err(K.incorrectlyOpenedComment),this._createCommentToken(2),this.state=Q.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_START_DASH;break;case G.GREATER_THAN_SIGN:{this._err(K.abruptClosingOfEmptyComment),this.state=Q.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case G.GREATER_THAN_SIGN:this._err(K.abruptClosingOfEmptyComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_END_DASH;break;case G.LESS_THAN_SIGN:t.data+=`<`,this.state=Q.COMMENT_LESS_THAN_SIGN;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.data+=`�`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case G.EXCLAMATION_MARK:t.data+=`!`,this.state=Q.COMMENT_LESS_THAN_SIGN_BANG;break;case G.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===G.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=Q.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===G.HYPHEN_MINUS?this.state=Q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=Q.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==G.GREATER_THAN_SIGN&&e!==G.EOF&&this._err(K.nestedComment),this.state=Q.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:this.state=Q.COMMENT_END;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EXCLAMATION_MARK:this.state=Q.COMMENT_END_BANG;break;case G.HYPHEN_MINUS:t.data+=`-`;break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=Q.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case G.HYPHEN_MINUS:t.data+=`--!`,this.state=Q.COMMENT_END_DASH;break;case G.GREATER_THAN_SIGN:this._err(K.incorrectlyClosedComment),this.state=Q.DATA,this.emitCurrentComment(t);break;case G.EOF:this._err(K.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=Q.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(K.missingWhitespaceBeforeDoctypeName),this.state=Q.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Mw(e))this._createDoctypeToken(String.fromCharCode(Iw(e))),this.state=Q.DOCTYPE_NAME;else switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.NULL:this._err(K.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=Q.DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:{this._err(K.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=Q.DATA;break}case G.EOF:{this._err(K.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=Q.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.AFTER_DOCTYPE_NAME;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.NULL:this._err(K.unexpectedNullCharacter),t.name+=`�`;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(Mw(e)?Iw(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(tw.PUBLIC,!1)?this.state=Q.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(tw.SYSTEM,!1)?this.state=Q.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(K.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.publicId=``,this.state=Q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.publicId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case G.GREATER_THAN_SIGN:this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:this.state=Q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.QUOTATION_MARK:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:this._err(K.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.QUOTATION_MARK:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case G.APOSTROPHE:t.systemId=``,this.state=Q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case G.GREATER_THAN_SIGN:this._err(K.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.DATA,this.emitCurrentDoctype(t);break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case G.QUOTATION_MARK:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case G.APOSTROPHE:this.state=Q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case G.NULL:this._err(K.unexpectedNullCharacter),t.systemId+=`�`;break;case G.GREATER_THAN_SIGN:this._err(K.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case G.SPACE:case G.LINE_FEED:case G.TABULATION:case G.FORM_FEED:break;case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.EOF:this._err(K.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(K.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=Q.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case G.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=Q.DATA;break;case G.NULL:this._err(K.unexpectedNullCharacter);break;case G.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case G.RIGHT_SQUARE_BRACKET:this.state=Q.CDATA_SECTION_BRACKET;break;case G.EOF:this._err(K.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===G.RIGHT_SQUARE_BRACKET?this.state=Q.CDATA_SECTION_END:(this._emitChars(`]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case G.GREATER_THAN_SIGN:this.state=Q.DATA;break;case G.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=Q.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(G.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Fw(this.preprocessor.peek(1))?Q.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Fw(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===G.SEMICOLON&&this._err(K.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},Vw=new Set([X.DD,X.DT,X.LI,X.OPTGROUP,X.OPTION,X.P,X.RB,X.RP,X.RT,X.RTC]),Hw=new Set([...Vw,X.CAPTION,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]),Uw=new Set([X.APPLET,X.CAPTION,X.HTML,X.MARQUEE,X.OBJECT,X.TABLE,X.TD,X.TEMPLATE,X.TH]),Ww=new Set([...Uw,X.OL,X.UL]),Gw=new Set([...Uw,X.BUTTON]),Kw=new Set([X.ANNOTATION_XML,X.MI,X.MN,X.MO,X.MS,X.MTEXT]),qw=new Set([X.DESC,X.FOREIGN_OBJECT,X.TITLE]),Jw=new Set([X.TR,X.TEMPLATE,X.HTML]),Yw=new Set([X.TBODY,X.TFOOT,X.THEAD,X.TEMPLATE,X.HTML]),Xw=new Set([X.TABLE,X.TEMPLATE,X.HTML]),Zw=new Set([X.TD,X.TH]),Qw=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=X.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===X.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===J.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==J.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(kw,J.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Zw,J.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Xw,J.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Yw,J.HTML)}clearBackToTableRowContext(){this.clearBackTo(Jw,J.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===X.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===X.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case J.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case J.SVG:if(qw.has(r))return!1;break;case J.MATHML:if(Kw.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Uw)}hasInListItemScope(e){return this.hasInDynamicScope(e,Ww)}hasInButtonScope(e){return this.hasInDynamicScope(e,Gw)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case J.HTML:if(kw.has(t))return!0;if(Uw.has(t))return!1;break;case J.SVG:if(qw.has(t))return!1;break;case J.MATHML:if(Kw.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===J.HTML)switch(this.tagIDs[e]){case X.TBODY:case X.THEAD:case X.TFOOT:return!0;case X.TABLE:case X.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===J.HTML)switch(this.tagIDs[t]){case e:return!0;case X.OPTION:case X.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Vw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Hw.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Hw.has(this.currentTagId);)this.pop()}},$w=3,eT;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(eT||={});var tT={type:eT.Marker},nT=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===eT.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<$w)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<$w)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=$w&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(tT)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:eT.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:eT.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(tT);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===eT.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===eT.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===eT.Element&&t.element===e)}},rT={createDocument(){return{nodeName:`#document`,mode:Tw.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};rT.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(rT.isTextNode(n)){n.value+=t;return}}rT.appendChild(e,rT.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&rT.isTextNode(r)?r.value+=t:rT.insertBefore(e,rT.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},iT=`html`,aT=`about:legacy-compat`,oT=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,sT=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),cT=[...sT,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],lT=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),uT=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],dT=[...uT,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function fT(e,t){return t.some(t=>e.startsWith(t))}function pT(e){return e.name===iT&&e.publicId===null&&(e.systemId===null||e.systemId===aT)}function mT(e){if(e.name!==iT)return Tw.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===oT)return Tw.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),lT.has(n))return Tw.QUIRKS;let e=t===null?cT:sT;if(fT(n,e))return Tw.QUIRKS;if(e=t===null?uT:dT,fT(n,e))return Tw.LIMITED_QUIRKS}return Tw.NO_QUIRKS}var hT={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},gT=`definitionurl`,_T=`definitionURL`,vT=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),yT=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:J.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:J.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:J.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:J.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:J.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:J.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:J.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:J.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:J.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:J.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:J.XMLNS}]]),bT=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),xT=new Set([X.B,X.BIG,X.BLOCKQUOTE,X.BODY,X.BR,X.CENTER,X.CODE,X.DD,X.DIV,X.DL,X.DT,X.EM,X.EMBED,X.H1,X.H2,X.H3,X.H4,X.H5,X.H6,X.HEAD,X.HR,X.I,X.IMG,X.LI,X.LISTING,X.MENU,X.META,X.NOBR,X.OL,X.P,X.PRE,X.RUBY,X.S,X.SMALL,X.SPAN,X.STRONG,X.STRIKE,X.SUB,X.SUP,X.TABLE,X.TT,X.U,X.UL,X.VAR]);function ST(e){let t=e.tagID;return t===X.FONT&&e.attrs.some(({name:e})=>e===ww.COLOR||e===ww.SIZE||e===ww.FACE)||xT.has(t)}function CT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===gT){e.attrs[t].name=_T;break}}function wT(e){for(let t=0;t<e.attrs.length;t++){let n=vT.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function TT(e){for(let t=0;t<e.attrs.length;t++){let n=yT.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function ET(e){let t=bT.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Dw(e.tagName))}function DT(e,t){return t===J.MATHML&&(e===X.MI||e===X.MO||e===X.MN||e===X.MS||e===X.MTEXT)}function OT(e,t,n){if(t===J.MATHML&&e===X.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===ww.ENCODING){let t=n[e].value.toLowerCase();return t===hT.TEXT_HTML||t===hT.APPLICATION_XML}}return t===J.SVG&&(e===X.FOREIGN_OBJECT||e===X.DESC||e===X.TITLE)}function kT(e,t,n,r){return(!r||r===J.HTML)&&OT(e,t,n)||(!r||r===J.MATHML)&&DT(e,t)}var AT=`hidden`,jT=8,MT=3,$;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})($||={});var NT={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},PT=new Set([X.TABLE,X.TBODY,X.TFOOT,X.THEAD,X.TR]),FT={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:rT,onParseError:null},IT=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...FT,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Bw(this.options,this),this.activeFormattingElements=new nT(this.treeAdapter),this.fragmentContextID=n?Dw(this.treeAdapter.getTagName(n)):X.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Qw(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...FT,...t};e??=n.treeAdapter.createElement(Y.TEMPLATE,J.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,J.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===X.TEMPLATE&&i.tmplInsertionModeStack.unshift($.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??NT,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===J.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,J.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=Aw.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Y.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===J.HTML)switch(this.fragmentContextID){case X.TITLE:case X.TEXTAREA:this.tokenizer.state=Aw.RCDATA;break;case X.STYLE:case X.XMP:case X.IFRAME:case X.NOEMBED:case X.NOFRAMES:case X.NOSCRIPT:this.tokenizer.state=Aw.RAWTEXT;break;case X.SCRIPT:this.tokenizer.state=Aw.SCRIPT_DATA;break;case X.PLAINTEXT:this.tokenizer.state=Aw.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,J.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,J.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(Y.HTML,J.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,X.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===q.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===X.SVG&&this.treeAdapter.getTagName(t)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===J.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===X.MGLYPH||e.tagID===X.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,J.HTML)}_processToken(e){switch(e.type){case q.CHARACTER:this.onCharacter(e);break;case q.NULL_CHARACTER:this.onNullCharacter(e);break;case q.COMMENT:this.onComment(e);break;case q.DOCTYPE:this.onDoctype(e);break;case q.START_TAG:this._processStartTag(e);break;case q.END_TAG:this.onEndTag(e);break;case q.EOF:this.onEof(e);break;case q.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return kT(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===eT.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(X.P),this.openElements.popUntilTagNamePopped(X.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case X.TR:this.insertionMode=$.IN_ROW;return;case X.TBODY:case X.THEAD:case X.TFOOT:this.insertionMode=$.IN_TABLE_BODY;return;case X.CAPTION:this.insertionMode=$.IN_CAPTION;return;case X.COLGROUP:this.insertionMode=$.IN_COLUMN_GROUP;return;case X.TABLE:this.insertionMode=$.IN_TABLE;return;case X.BODY:this.insertionMode=$.IN_BODY;return;case X.FRAMESET:this.insertionMode=$.IN_FRAMESET;return;case X.SELECT:this._resetInsertionModeForSelect(e);return;case X.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case X.HTML:this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return;case X.TD:case X.TH:if(e>0){this.insertionMode=$.IN_CELL;return}break;case X.HEAD:if(e>0){this.insertionMode=$.IN_HEAD;return}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===X.TEMPLATE)break;if(e===X.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(e){return PT.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case X.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===J.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case X.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return Ow[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)eO(this,e);else switch(this.insertionMode){case $.INITIAL:YT(this,e);break;case $.BEFORE_HTML:QT(this,e);break;case $.BEFORE_HEAD:tE(this,e);break;case $.IN_HEAD:aE(this,e);break;case $.IN_HEAD_NO_SCRIPT:cE(this,e);break;case $.AFTER_HEAD:dE(this,e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:mE(this,e);break;case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:lD(this,e);break;case $.IN_TABLE_TEXT:SD(this,e);break;case $.IN_COLUMN_GROUP:kD(this,e);break;case $.AFTER_BODY:GD(this,e);break;case $.AFTER_AFTER_BODY:ZD(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)$D(this,e);else switch(this.insertionMode){case $.INITIAL:YT(this,e);break;case $.BEFORE_HTML:QT(this,e);break;case $.BEFORE_HEAD:tE(this,e);break;case $.IN_HEAD:aE(this,e);break;case $.IN_HEAD_NO_SCRIPT:cE(this,e);break;case $.AFTER_HEAD:dE(this,e);break;case $.TEXT:this._insertCharacters(e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:lD(this,e);break;case $.IN_COLUMN_GROUP:kD(this,e);break;case $.AFTER_BODY:GD(this,e);break;case $.AFTER_AFTER_BODY:ZD(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)WT(this,e);else switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:WT(this,e);break;case $.IN_TABLE_TEXT:CD(this,e);break;case $.AFTER_BODY:GT(this,e);break;case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:KT(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:JT(this,e);break;case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:this._err(e,K.misplacedDoctype);break;case $.IN_TABLE_TEXT:CD(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?nO(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:YT(this,e);break;case $.BEFORE_HTML:XT(this,e);break;case $.BEFORE_HEAD:$T(this,e);break;case $.IN_HEAD:nE(this,e);break;case $.IN_HEAD_NO_SCRIPT:oE(this,e);break;case $.AFTER_HEAD:lE(this,e);break;case $.IN_BODY:qE(this,e);break;case $.IN_TABLE:vD(this,e);break;case $.IN_TABLE_TEXT:CD(this,e);break;case $.IN_CAPTION:TD(this,e);break;case $.IN_COLUMN_GROUP:DD(this,e);break;case $.IN_TABLE_BODY:AD(this,e);break;case $.IN_ROW:MD(this,e);break;case $.IN_CELL:PD(this,e);break;case $.IN_SELECT:ID(this,e);break;case $.IN_SELECT_IN_TABLE:RD(this,e);break;case $.IN_TEMPLATE:BD(this,e);break;case $.AFTER_BODY:UD(this,e);break;case $.IN_FRAMESET:KD(this,e);break;case $.AFTER_FRAMESET:JD(this,e);break;case $.AFTER_AFTER_BODY:XD(this,e);break;case $.AFTER_AFTER_FRAMESET:QD(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?rO(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case $.INITIAL:YT(this,e);break;case $.BEFORE_HTML:ZT(this,e);break;case $.BEFORE_HEAD:eE(this,e);break;case $.IN_HEAD:rE(this,e);break;case $.IN_HEAD_NO_SCRIPT:sE(this,e);break;case $.AFTER_HEAD:uE(this,e);break;case $.IN_BODY:aD(this,e);break;case $.TEXT:sD(this,e);break;case $.IN_TABLE:yD(this,e);break;case $.IN_TABLE_TEXT:CD(this,e);break;case $.IN_CAPTION:ED(this,e);break;case $.IN_COLUMN_GROUP:OD(this,e);break;case $.IN_TABLE_BODY:jD(this,e);break;case $.IN_ROW:ND(this,e);break;case $.IN_CELL:FD(this,e);break;case $.IN_SELECT:LD(this,e);break;case $.IN_SELECT_IN_TABLE:zD(this,e);break;case $.IN_TEMPLATE:VD(this,e);break;case $.AFTER_BODY:WD(this,e);break;case $.IN_FRAMESET:qD(this,e);break;case $.AFTER_FRAMESET:YD(this,e);break;case $.AFTER_AFTER_BODY:ZD(this,e)}}onEof(e){switch(this.insertionMode){case $.INITIAL:YT(this,e);break;case $.BEFORE_HTML:QT(this,e);break;case $.BEFORE_HEAD:tE(this,e);break;case $.IN_HEAD:aE(this,e);break;case $.IN_HEAD_NO_SCRIPT:cE(this,e);break;case $.AFTER_HEAD:dE(this,e);break;case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:oD(this,e);break;case $.TEXT:cD(this,e);break;case $.IN_TABLE_TEXT:CD(this,e);break;case $.IN_TEMPLATE:HD(this,e);break;case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:qT(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===G.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:this._insertCharacters(e);break;case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:pE(this,e);break;case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:lD(this,e);break;case $.IN_TABLE_TEXT:xD(this,e)}}};function LT(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):iD(e,t),n}function RT(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function zT(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=MT;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=BT(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function BT(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function VT(e,t,n){let r=Dw(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===X.TEMPLATE&&i===J.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function HT(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function UT(e,t){for(let n=0;n<jT;n++){let n=LT(e,t);if(!n)break;let r=RT(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=zT(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&VT(e,a,i),HT(e,r,n)}}function WT(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function GT(e,t){e._appendCommentNode(t,e.openElements.items[0])}function KT(e,t){e._appendCommentNode(t,e.document)}function qT(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function JT(e,t){e._setDocumentType(t);let n=t.forceQuirks?Tw.QUIRKS:mT(t);pT(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function YT(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Tw.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function XT(e,t){t.tagID===X.HTML?(e._insertElement(t,J.HTML),e.insertionMode=$.BEFORE_HEAD):QT(e,t)}function ZT(e,t){let n=t.tagID;(n===X.HTML||n===X.HEAD||n===X.BODY||n===X.BR)&&QT(e,t)}function QT(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function $T(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.HEAD:e._insertElement(t,J.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break;default:tE(e,t)}}function eE(e,t){let n=t.tagID;n===X.HEAD||n===X.BODY||n===X.HTML||n===X.BR?tE(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function tE(e,t){e._insertFakeElement(Y.HEAD,X.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function nE(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TITLE:e._switchToTextParsing(t,Aw.RCDATA);break;case X.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Aw.RAWTEXT):(e._insertElement(t,J.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break;case X.NOFRAMES:case X.STYLE:e._switchToTextParsing(t,Aw.RAWTEXT);break;case X.SCRIPT:e._switchToTextParsing(t,Aw.SCRIPT_DATA);break;case X.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break;case X.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:aE(e,t)}}function rE(e,t){switch(t.tagID){case X.HEAD:e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break;case X.BODY:case X.BR:case X.HTML:aE(e,t);break;case X.TEMPLATE:iE(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function iE(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==X.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function aE(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function oE(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.BASEFONT:case X.BGSOUND:case X.HEAD:case X.LINK:case X.META:case X.NOFRAMES:case X.STYLE:nE(e,t);break;case X.NOSCRIPT:e._err(t,K.nestedNoscriptInHead);break;default:cE(e,t)}}function sE(e,t){switch(t.tagID){case X.NOSCRIPT:e.openElements.pop(),e.insertionMode=$.IN_HEAD;break;case X.BR:cE(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function cE(e,t){let n=t.type===q.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function lE(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.BODY:e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break;case X.FRAMESET:e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET;break;case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,X.HEAD),nE(e,t),e.openElements.remove(e.headElement);break;case X.HEAD:e._err(t,K.misplacedStartTagForHeadElement);break;default:dE(e,t)}}function uE(e,t){switch(t.tagID){case X.BODY:case X.HTML:case X.BR:dE(e,t);break;case X.TEMPLATE:iE(e,t);break;default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function dE(e,t){e._insertFakeElement(Y.BODY,X.BODY),e.insertionMode=$.IN_BODY,fE(e,t)}function fE(e,t){switch(t.type){case q.CHARACTER:mE(e,t);break;case q.WHITESPACE_CHARACTER:pE(e,t);break;case q.COMMENT:WT(e,t);break;case q.START_TAG:qE(e,t);break;case q.END_TAG:aD(e,t);break;case q.EOF:oD(e,t)}}function pE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function mE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function hE(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function gE(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function _E(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_FRAMESET)}function vE(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function yE(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&kw.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,J.HTML)}function bE(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function xE(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),n||(e.formElement=e.openElements.current))}function SE(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===X.LI&&r===X.LI||(n===X.DD||n===X.DT)&&(r===X.DD||r===X.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==X.ADDRESS&&r!==X.DIV&&r!==X.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML)}function CE(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.tokenizer.state=Aw.PLAINTEXT}function wE(e,t){e.openElements.hasInScope(X.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1}function TE(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(UT(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function EE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function DE(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(X.NOBR)&&(UT(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,J.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function OE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function kE(e,t){e.treeAdapter.getDocumentMode(e.document)!==Tw.QUIRKS&&e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function AE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function jE(e){let t=lw(e,ww.TYPE);return t!=null&&t.toLowerCase()===AT}function ME(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,J.HTML),jE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function NE(e,t){e._appendElement(t,J.HTML),t.ackSelfClosing=!0}function PE(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._appendElement(t,J.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function FE(e,t){t.tagName=Y.IMG,t.tagID=X.IMG,AE(e,t)}function IE(e,t){e._insertElement(t,J.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Aw.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function LE(e,t){e.openElements.hasInButtonScope(X.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Aw.RAWTEXT)}function RE(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Aw.RAWTEXT)}function zE(e,t){e._switchToTextParsing(t,Aw.RAWTEXT)}function BE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function VE(e,t){e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function HE(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,J.HTML)}function UE(e,t){e.openElements.hasInScope(X.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(X.RTC),e._insertElement(t,J.HTML)}function WE(e,t){e._reconstructActiveFormattingElements(),CT(t),TT(t),t.selfClosing?e._appendElement(t,J.MATHML):e._insertElement(t,J.MATHML),t.ackSelfClosing=!0}function GE(e,t){e._reconstructActiveFormattingElements(),wT(t),TT(t),t.selfClosing?e._appendElement(t,J.SVG):e._insertElement(t,J.SVG),t.ackSelfClosing=!0}function KE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,J.HTML)}function qE(e,t){switch(t.tagID){case X.I:case X.S:case X.B:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.SMALL:case X.STRIKE:case X.STRONG:EE(e,t);break;case X.A:TE(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:yE(e,t);break;case X.P:case X.DL:case X.OL:case X.UL:case X.DIV:case X.DIR:case X.NAV:case X.MAIN:case X.MENU:case X.ASIDE:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.DETAILS:case X.ADDRESS:case X.ARTICLE:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:vE(e,t);break;case X.LI:case X.DD:case X.DT:SE(e,t);break;case X.BR:case X.IMG:case X.WBR:case X.AREA:case X.EMBED:case X.KEYGEN:AE(e,t);break;case X.HR:PE(e,t);break;case X.RB:case X.RTC:HE(e,t);break;case X.RT:case X.RP:UE(e,t);break;case X.PRE:case X.LISTING:bE(e,t);break;case X.XMP:LE(e,t);break;case X.SVG:GE(e,t);break;case X.HTML:hE(e,t);break;case X.BASE:case X.LINK:case X.META:case X.STYLE:case X.TITLE:case X.SCRIPT:case X.BGSOUND:case X.BASEFONT:case X.TEMPLATE:nE(e,t);break;case X.BODY:gE(e,t);break;case X.FORM:xE(e,t);break;case X.NOBR:DE(e,t);break;case X.MATH:WE(e,t);break;case X.TABLE:kE(e,t);break;case X.INPUT:ME(e,t);break;case X.PARAM:case X.TRACK:case X.SOURCE:NE(e,t);break;case X.IMAGE:FE(e,t);break;case X.BUTTON:wE(e,t);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:OE(e,t);break;case X.IFRAME:RE(e,t);break;case X.SELECT:BE(e,t);break;case X.OPTION:case X.OPTGROUP:VE(e,t);break;case X.NOEMBED:case X.NOFRAMES:zE(e,t);break;case X.FRAMESET:_E(e,t);break;case X.TEXTAREA:IE(e,t);break;case X.NOSCRIPT:e.options.scriptingEnabled?zE(e,t):KE(e,t);break;case X.PLAINTEXT:CE(e,t);break;case X.COL:case X.TH:case X.TD:case X.TR:case X.HEAD:case X.FRAME:case X.TBODY:case X.TFOOT:case X.THEAD:case X.CAPTION:case X.COLGROUP:break;default:KE(e,t)}}function JE(e,t){if(e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function YE(e,t){e.openElements.hasInScope(X.BODY)&&(e.insertionMode=$.AFTER_BODY,WD(e,t))}function XE(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function ZE(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(X.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(X.FORM):n&&e.openElements.remove(n))}function QE(e){e.openElements.hasInButtonScope(X.P)||e._insertFakeElement(Y.P,X.P),e._closePElement()}function $E(e){e.openElements.hasInListItemScope(X.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(X.LI),e.openElements.popUntilTagNamePopped(X.LI))}function eD(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function tD(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function nD(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function rD(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,X.BR),e.openElements.pop(),e.framesetOk=!1}function iD(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==X.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function aD(e,t){switch(t.tagID){case X.A:case X.B:case X.I:case X.S:case X.U:case X.EM:case X.TT:case X.BIG:case X.CODE:case X.FONT:case X.NOBR:case X.SMALL:case X.STRIKE:case X.STRONG:UT(e,t);break;case X.P:QE(e);break;case X.DL:case X.UL:case X.OL:case X.DIR:case X.DIV:case X.NAV:case X.PRE:case X.MAIN:case X.MENU:case X.ASIDE:case X.BUTTON:case X.CENTER:case X.FIGURE:case X.FOOTER:case X.HEADER:case X.HGROUP:case X.DIALOG:case X.ADDRESS:case X.ARTICLE:case X.DETAILS:case X.SEARCH:case X.SECTION:case X.SUMMARY:case X.LISTING:case X.FIELDSET:case X.BLOCKQUOTE:case X.FIGCAPTION:XE(e,t);break;case X.LI:$E(e);break;case X.DD:case X.DT:eD(e,t);break;case X.H1:case X.H2:case X.H3:case X.H4:case X.H5:case X.H6:tD(e);break;case X.BR:rD(e);break;case X.BODY:JE(e,t);break;case X.HTML:YE(e,t);break;case X.FORM:ZE(e);break;case X.APPLET:case X.OBJECT:case X.MARQUEE:nD(e,t);break;case X.TEMPLATE:iE(e,t);break;default:iD(e,t)}}function oD(e,t){e.tmplInsertionModeStack.length>0?HD(e,t):qT(e,t)}function sD(e,t){var n;t.tagID===X.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function cD(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function lD(e,t){if(e.openElements.currentTagId!==void 0&&PT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case q.CHARACTER:SD(e,t);break;case q.WHITESPACE_CHARACTER:xD(e,t)}else bD(e,t)}function uD(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CAPTION}function dD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function fD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,X.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,DD(e,t)}function pD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_TABLE_BODY}function mD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,X.TBODY),e.insertionMode=$.IN_TABLE_BODY,AD(e,t)}function hD(e,t){e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function gD(e,t){jE(t)?e._appendElement(t,J.HTML):bD(e,t),t.ackSelfClosing=!0}function _D(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,J.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function vD(e,t){switch(t.tagID){case X.TD:case X.TH:case X.TR:mD(e,t);break;case X.STYLE:case X.SCRIPT:case X.TEMPLATE:nE(e,t);break;case X.COL:fD(e,t);break;case X.FORM:_D(e,t);break;case X.TABLE:hD(e,t);break;case X.TBODY:case X.TFOOT:case X.THEAD:pD(e,t);break;case X.INPUT:gD(e,t);break;case X.CAPTION:uD(e,t);break;case X.COLGROUP:dD(e,t);break;default:bD(e,t)}}function yD(e,t){switch(t.tagID){case X.TABLE:e.openElements.hasInTableScope(X.TABLE)&&(e.openElements.popUntilTagNamePopped(X.TABLE),e._resetInsertionMode());break;case X.TEMPLATE:iE(e,t);break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:bD(e,t)}}function bD(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,fE(e,t),e.fosterParentingEnabled=n}function xD(e,t){e.pendingCharacterTokens.push(t)}function SD(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function CD(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)bD(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var wD=new Set([X.CAPTION,X.COL,X.COLGROUP,X.TBODY,X.TD,X.TFOOT,X.TH,X.THEAD,X.TR]);function TD(e,t){let n=t.tagID;wD.has(n)?e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,vD(e,t)):qE(e,t)}function ED(e,t){let n=t.tagID;switch(n){case X.CAPTION:case X.TABLE:e.openElements.hasInTableScope(X.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(X.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===X.TABLE&&yD(e,t));break;case X.BODY:case X.COL:case X.COLGROUP:case X.HTML:case X.TBODY:case X.TD:case X.TFOOT:case X.TH:case X.THEAD:case X.TR:break;default:aD(e,t)}}function DD(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.COL:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.TEMPLATE:nE(e,t);break;default:kD(e,t)}}function OD(e,t){switch(t.tagID){case X.COLGROUP:e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TEMPLATE:iE(e,t);break;case X.COL:break;default:kD(e,t)}}function kD(e,t){e.openElements.currentTagId===X.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function AD(e,t){switch(t.tagID){case X.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_ROW;break;case X.TH:case X.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,X.TR),e.insertionMode=$.IN_ROW,MD(e,t);break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,vD(e,t));break;default:vD(e,t)}}function jD(e,t){let n=t.tagID;switch(t.tagID){case X.TBODY:case X.TFOOT:case X.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break;case X.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,yD(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:case X.TR:break;default:yD(e,t)}}function MD(e,t){switch(t.tagID){case X.TH:case X.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,J.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break;case X.CAPTION:case X.COL:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,AD(e,t));break;default:vD(e,t)}}function ND(e,t){switch(t.tagID){case X.TR:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break;case X.TABLE:e.openElements.hasInTableScope(X.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,jD(e,t));break;case X.TBODY:case X.TFOOT:case X.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(X.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,jD(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:case X.TD:case X.TH:break;default:yD(e,t)}}function PD(e,t){let n=t.tagID;wD.has(n)?(e.openElements.hasInTableScope(X.TD)||e.openElements.hasInTableScope(X.TH))&&(e._closeTableCell(),MD(e,t)):qE(e,t)}function FD(e,t){let n=t.tagID;switch(n){case X.TD:case X.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break;case X.TABLE:case X.TBODY:case X.TFOOT:case X.THEAD:case X.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ND(e,t));break;case X.BODY:case X.CAPTION:case X.COL:case X.COLGROUP:case X.HTML:break;default:aD(e,t)}}function ID(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.OPTGROUP:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._insertElement(t,J.HTML);break;case X.HR:e.openElements.currentTagId===X.OPTION&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop(),e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.INPUT:case X.KEYGEN:case X.TEXTAREA:case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),t.tagID!==X.SELECT&&e._processStartTag(t));break;case X.SCRIPT:case X.TEMPLATE:nE(e,t)}}function LD(e,t){switch(t.tagID){case X.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===X.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===X.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===X.OPTGROUP&&e.openElements.pop();break;case X.OPTION:e.openElements.currentTagId===X.OPTION&&e.openElements.pop();break;case X.SELECT:e.openElements.hasInSelectScope(X.SELECT)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode());break;case X.TEMPLATE:iE(e,t)}}function RD(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ID(e,t)}function zD(e,t){let n=t.tagID;n===X.CAPTION||n===X.TABLE||n===X.TBODY||n===X.TFOOT||n===X.THEAD||n===X.TR||n===X.TD||n===X.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(X.SELECT),e._resetInsertionMode(),e.onEndTag(t)):LD(e,t)}function BD(e,t){switch(t.tagID){case X.BASE:case X.BASEFONT:case X.BGSOUND:case X.LINK:case X.META:case X.NOFRAMES:case X.SCRIPT:case X.STYLE:case X.TEMPLATE:case X.TITLE:nE(e,t);break;case X.CAPTION:case X.COLGROUP:case X.TBODY:case X.TFOOT:case X.THEAD:e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,vD(e,t);break;case X.COL:e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,DD(e,t);break;case X.TR:e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,AD(e,t);break;case X.TD:case X.TH:e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,MD(e,t);break;default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,qE(e,t)}}function VD(e,t){t.tagID===X.TEMPLATE&&iE(e,t)}function HD(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(X.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):qT(e,t)}function UD(e,t){t.tagID===X.HTML?qE(e,t):GD(e,t)}function WD(e,t){if(t.tagID===X.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===X.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else GD(e,t)}function GD(e,t){e.insertionMode=$.IN_BODY,fE(e,t)}function KD(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.FRAMESET:e._insertElement(t,J.HTML);break;case X.FRAME:e._appendElement(t,J.HTML),t.ackSelfClosing=!0;break;case X.NOFRAMES:nE(e,t)}}function qD(e,t){t.tagID===X.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==X.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function JD(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.NOFRAMES:nE(e,t)}}function YD(e,t){t.tagID===X.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function XD(e,t){t.tagID===X.HTML?qE(e,t):ZD(e,t)}function ZD(e,t){e.insertionMode=$.IN_BODY,fE(e,t)}function QD(e,t){switch(t.tagID){case X.HTML:qE(e,t);break;case X.NOFRAMES:nE(e,t)}}function $D(e,t){t.chars=`�`,e._insertCharacters(t)}function eO(e,t){e._insertCharacters(t),e.framesetOk=!1}function tO(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==J.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function nO(e,t){if(ST(t))tO(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===J.MATHML?CT(t):r===J.SVG&&(ET(t),wT(t)),TT(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function rO(e,t){if(t.tagID===X.P||t.tagID===X.BR)tO(e),e._endTagOutsideForeignContent(t);else for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===J.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR;var iO=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,aO=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),oO={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function sO(e,n){let r=xO(e),i=zC(`type`,{handlers:{root:lO,element:uO,text:dO,comment:mO,doctype:fO,raw:hO},unknown:gO}),a={parser:r?new IT(oO):IT.getFragmentParser(void 0,oO),handle(e){i(e,a)},stitches:!1,options:n||{}};i(e,a),_O(a,Tg());let o=Iv(r?a.parser.document:a.parser.getFragment(),{file:a.options.file});return a.stitches&&t.o(o,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),o.type===`root`&&o.children.length===1&&o.children[0].type===e.type?o.children[0]:o}function cO(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function lO(e,t){cO(e.children,t)}function uO(e,t){yO(e,t),cO(e.children,t),bO(e,t)}function dO(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:q.CHARACTER,chars:e.value,location:SO(e)};_O(t,Tg(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function fO(e,t){let n={type:q.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:SO(e)};_O(t,Tg(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function pO(e,t){t.stitches=!0;let n=CO(e);`children`in e&&`children`in n&&(n.children=sO({type:`root`,children:e.children},t.options).children),mO({type:`comment`,value:{stitch:n}},t)}function mO(e,t){let n=e.value,r={type:q.COMMENT,data:n,location:SO(e)};_O(t,Tg(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function hO(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,vO(t,Tg(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(iO,`&lt;$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function gO(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))pO(n,t);else{let e=``;throw aO.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function _O(e,t){vO(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Aw.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function vO(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function yO(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Aw.PLAINTEXT)return;_O(t,Tg(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Nv.html;i===Nv.html&&n===`svg`&&(i=Nv.svg);let a=UC({...e,children:[]},{space:i===Nv.svg?`svg`:`html`}),o={type:q.START_TAG,tagName:n,tagID:Dw(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:SO(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function bO(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&$C.includes(n)||t.parser.tokenizer.state===Aw.PLAINTEXT)return;_O(t,wg(e));let r={type:q.END_TAG,tagName:n,tagID:Dw(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:SO(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Aw.RCDATA||t.parser.tokenizer.state===Aw.RAWTEXT||t.parser.tokenizer.state===Aw.SCRIPT_DATA)&&(t.parser.tokenizer.state=Aw.DATA)}function xO(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function SO(e){let t=Tg(e)||{line:void 0,column:void 0,offset:void 0},n=wg(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function CO(e){return`children`in e?X_({...e,children:[]}):X_(e)}function wO(e){return function(t,n){return sO(t,{...e,file:n})}}var TO=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],EO={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...TO,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...TO],h2:[[`className`,`sr-only`]],img:[...TO,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...TO,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...TO],table:[...TO],ul:[...TO,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},DO={}.hasOwnProperty;function OO(e,t){let n={type:`root`,children:[]},r=kO({schema:t?{...EO,...t}:EO,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function kO(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return AO(e,n);case`doctype`:return jO(e,n);case`element`:return MO(e,n);case`root`:return NO(e,n);case`text`:return PO(e,n)}}}function AO(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return VO(r,t),r}}function jO(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return VO(e,t),e}}function MO(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=FO(e,t.children),i=IO(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&DO.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return VO(o,t),o}function NO(e,t){let n={type:`root`,children:FO(e,t.children)};return VO(n,t),n}function PO(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return VO(n,t),n}function FO(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=kO(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function IO(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&DO.call(r,n)?r[n]:void 0,o=r&&DO.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(DO.call(s,l)){let t=s[l],n=LO(e,HO(a,l),l,t);n??=LO(e,HO(o,l),l,t),n!=null&&(c[l]=n)}if(i&&DO.call(i,n)){let e=i[n];for(l in e)DO.call(e,l)&&!DO.call(c,l)&&(c[l]=e[l])}return c}function LO(e,t,n,r){return t?Array.isArray(r)?RO(e,t,n,r):zO(e,t,n,r):void 0}function RO(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=zO(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function zO(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&BO(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function BO(e,t,n){let r=e.schema.protocols&&DO.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function VO(e,t){let n=Dg(t);t.data&&(e.data=X_(t.data)),n&&(e.position=n)}function HO(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function UO(e){return function(t){return OO(t,e)}}var WO=class extends Error{reason;constructor(e,t){super(e),this.name=`FileIoError`,this.reason=t}},GO=class extends Error{};function KO(e){let t=[],n=/<diagram(?=[\s/>])[^>]*?(\/?)>/g,r;for(;(r=n.exec(e))!==null;){let i=r.index,a=i+r[0].length;if(r[1]===`/`){t.push({start:i,end:a,innerStart:a,innerEnd:a});continue}let o=e.indexOf(`</diagram>`,a);if(o===-1)throw new GO(`a <diagram> element is not closed`);t.push({start:i,end:o+10,innerStart:a,innerEnd:o}),n.lastIndex=o+10}return t}function qO(e,t){let n=e.lastIndexOf(`
529
+ `,t-1)+1;return/^[ \t]*/.exec(e.slice(n,t))[0]}function JO(e,t){return e.trim().split(/\r?\n/).map(e=>t+e).join(`
530
+ `)}function YO(e,t,n){if(!/^\s*<mxGraphModel[\s>]/.test(n))throw new GO(`the page to save is not an <mxGraphModel>`);let r=e.includes(`\r
531
+ `)?`\r
532
+ `:`
533
+ `,i=KO(e);if(i.length===0){let i=e.search(/<mxGraphModel[\s>]/),a=e.lastIndexOf(`</mxGraphModel>`);if(i===-1||a===-1||t!==0)throw new GO(`the file has no page to put this one in`);let o=a+15;return e.slice(0,i)+JO(n,qO(e,i)).trimStart().split(`
534
+ `).join(r)+e.slice(o)}let a=i[t];if(a===void 0)throw new GO(`the file has no page ${t+1}`);let o=qO(e,a.start),s=JO(n,o+` `).split(`
535
+ `).join(r),c=e.slice(a.start,a.innerStart).replace(/\s*\/>$/,`>`);return e.slice(0,a.start)+c+r+s+r+o+`</diagram>`+e.slice(a.end)}function XO(e){let t=new DOMParser().parseFromString(e,`application/xml`).documentElement;if(t.nodeName===`parsererror`||t.getElementsByTagName(`parsererror`).length>0)throw Error(`it is not a draw.io diagram (not XML)`);if(t.nodeName!==`mxfile`&&t.nodeName!==`mxGraphModel`)throw Error(`it is not a draw.io diagram (its root is <${t.nodeName}>)`);return t}function ZO(e){return[...e.children].filter(e=>e.nodeName===`diagram`)}function QO(e){let t=XO(e);if(t.nodeName===`mxGraphModel`)return[`Page 1`];let n=ZO(t);if(n.length===0)throw Error(`it holds no page`);return n.map((e,t)=>e.getAttribute(`name`)?.trim()||`Page ${t+1}`)}function $O(e,t){if(t===void 0||t.trim()===``)return 0;let n=QO(e),r=t.trim(),i=n.indexOf(r),a=i>=0?i:/^\d+$/.test(r)?Number(r)-1:-1;if(a<0||a>=n.length)throw Error(`it has no page "${r}"; its pages are ${n.map(e=>`"${e}"`).join(`, `)}`);return a}function ek(e,t){let n=XO(e),r=$O(e,t);if(n.nodeName===`mxGraphModel`)return e;let i=n.cloneNode(!1);return i.appendChild(ZO(n)[r].cloneNode(!0)),new XMLSerializer().serializeToString(i)}function tk(e,t){let n=e.split(`/`).slice(0,-1),r=t.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)}var nk={dirty:!1,canUndo:!1,canRedo:!1},rk=`Discard the unsaved touch-ups to this diagram?`;function ik(e){return e.slice(e.lastIndexOf(`/`)+1).replace(/\.(drawio|dio)$/i,``)||`diagram`}function ak(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n}));try{let t=document.createElement(`a`);t.href=r,t.download=e,t.click()}finally{URL.revokeObjectURL(r)}}function ok(e,t){let n=t?.trim().replace(/[^\p{L}\p{N}._-]+/gu,`-`).replace(/^-+|-+$/g,``);return`${ik(e)}${n?`-${n}`:``}.svg`}function sk(e,t,n){let{fileIo:r}=Np(),[i,o]=(0,a.useState)({status:`loading`}),s=(0,a.useRef)(0),c=(0,a.useCallback)(()=>{if(!t)return;if(r===void 0){o({status:`failed`,message:`files cannot be read here`});return}let n=++s.current;r.read(e).then(({content:e})=>{n===s.current&&o({status:`loaded`,content:e})},e=>{n===s.current&&o({status:`failed`,message:e instanceof Error?e.message:String(e)})})},[t,r,e]);return(0,a.useEffect)(()=>{n&&c()},[c,n]),(0,a.useEffect)(()=>{if(t&&n&&r!==void 0)return r.onChanged(e,c)},[t,n,r,e,c]),i}function ck(e,t){let[n,r]=(0,a.useState)(!t||typeof IntersectionObserver>`u`);return(0,a.useEffect)(()=>{if(n||e.current===null)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)},{rootMargin:`600px 0px`});return t.observe(e.current),()=>t.disconnect()},[n,e]),n}function lk({path:e,xml:t,variant:n,fallback:r,onTouchUpDirtyChange:i,page:s,startTouchUp:c=!1,onEscape:l}){let{serverUrl:u,fileIo:d,onOpenFile:p}=Np(),m=(0,a.useRef)(null),h=ck(m,n===`reply`),g=sk(e,t===void 0,h),_=t??(g.status===`loaded`?g.content:null),v=(0,a.useRef)(null),y=(0,a.useRef)(null),[b,x]=(0,a.useState)(!1),[S,T]=(0,a.useState)(null),[E,ee]=(0,a.useState)(null),[D,te]=(0,a.useState)(null),ne=(0,a.useRef)(null),[re,ie]=(0,a.useState)(nk),[ae,oe]=(0,a.useState)(!1),se=(0,a.useRef)(!1),[ce,le]=(0,a.useState)(null),[ue,de]=(0,a.useState)(null),O=e=>e===`inline`?v:y,fe=e=>D===e&&ne.current!==null?ne.current.content:_,pe=d!==void 0,me=D!==null&&re.dirty,he=(0,a.useMemo)(()=>{if(s===void 0||_===null)return{index:0,problem:null};try{return{index:$O(_,s),problem:null}}catch(e){return{index:0,problem:e instanceof Error?e.message:String(e)}}},[s,_]),ge=(0,a.useRef)(!1);(0,a.useEffect)(()=>{c&&!ge.current&&_!==null&&he.problem===null&&(ge.current=!0,ve(`inline`))});let _e=(0,a.useRef)(null);(0,a.useEffect)(()=>{D===null||re.dirty||ne.current===null||_===null||_===ne.current.content||(_e.current=D,ne.current=null,ie(nk),te(null))},[_,D,re.dirty]),(0,a.useEffect)(()=>{if(D!==null||_e.current===null)return;let e=_e.current;_e.current=null,ve(e)}),(0,a.useEffect)(()=>{i?.(me)},[me,i]),(0,a.useEffect)(()=>()=>i?.(!1),[i]);async function ve(t){if(d!==void 0&&D===null){le(null),de(null);try{ne.current=await d.read(e),ie(nk),te(t)}catch(e){le({message:e instanceof Error?e.message:String(e),conflict:!1})}}}function ye(){return me&&!window.confirm(rk)?!1:(te(null),ie(nk),le(null),de(null),ne.current=null,!0)}async function be(){let t=D,n=ne.current;if(!(t===null||n===null||d===void 0||se.current)){se.current=!0,oe(!0),le(null);try{let r=await O(t).current.save(),i=YO(n.content,r.page,r.xml),{mtimeMs:a}=await d.write(e,i,n.mtimeMs);ne.current={content:i,mtimeMs:a},O(t).current?.markClean()}catch(e){let t=e instanceof WO&&e.reason===`conflict`;le({message:t?`The file changed on disk, or was removed, since this touch-up began, so it was not saved. Leave without saving to see what is there now.`:`Could not save: ${e instanceof Error?e.message:String(e)}`,conflict:t})}finally{se.current=!1,oe(!1)}}}async function xe(t){ee(null);try{let n=await O(t).current.exportSvg();ak(ok(e,n.name),n.svg,`image/svg+xml;charset=utf-8`)}catch(e){ee(e instanceof Error?e.message:String(e))}}function k(){(D!==`enlarged`||ye())&&x(!1)}let A=(0,a.useCallback)(()=>de(`Save or undo the touch-ups on this page before turning to another.`),[]),Se=(0,a.useRef)(ye);Se.current=ye;let Ce=(0,a.useRef)(k);Ce.current=k;let we=(0,a.useRef)(D);we.current=D;let Te=(0,a.useRef)(b);Te.current=b;let Ee=(0,a.useRef)(l);Ee.current=l;let De=(0,a.useCallback)(()=>{Ee.current?Ee.current():we.current===null?Te.current&&Ce.current():Se.current()},[]);(0,a.useEffect)(()=>{if(D===null)return;function e(e){e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),Ee.current?Ee.current():Se.current())}return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[D]);function Oe(t){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null||S!==null,onClick:()=>void xe(t),title:`Save the page shown as .svg — insert it as a picture in a document`,children:`⤓ download SVG`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>_!==null&&ak(e.slice(e.lastIndexOf(`/`)+1),_,`application/xml;charset=utf-8`),title:`Save the .drawio file, to open or share it`,children:`⤓ download .drawio`})]})}function ke(e){return D===e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.dirty||ae,onClick:()=>void be(),children:ae?`saving…`:`✓ save`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canUndo,onClick:()=>O(e).current?.undo(),title:`Undo (⌘Z / Ctrl+Z)`,children:`↶ undo`}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.canRedo,onClick:()=>O(e).current?.redo(),title:`Redo (⇧⌘Z / Ctrl+Y)`,children:`↷ redo`}),(0,o.jsxs)(`label`,{className:`inline-flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400`,title:`How the selected wires are drawn — or every wire of the page when none is selected — and new wires too`,children:[`wires`,(0,o.jsxs)(`select`,{className:C,"aria-label":`Wire style`,value:re.wireStyle??`orthogonal`,onChange:t=>{let n=t.target.value;n!==`mixed`&&O(e).current?.setWireStyle(n)},children:[(0,o.jsx)(`option`,{value:`straight`,children:`straight`}),(0,o.jsx)(`option`,{value:`orthogonal`,children:`orthogonal`}),(0,o.jsx)(`option`,{value:`curved`,children:`curved`}),re.wireStyle===`mixed`&&(0,o.jsx)(`option`,{value:`mixed`,disabled:!0,children:`mixed`})]})]}),(0,o.jsx)(`button`,{type:`button`,className:C,disabled:!re.bends,onClick:()=>O(e).current?.removeBends(),title:`Remove the bends of the selected wires — or of every wire of the page when none is selected — and let draw.io route them. Double-click a bend to remove just that one.`,children:`remove bends`}),(0,o.jsx)(`button`,{type:`button`,className:C,onClick:()=>ye(),title:`Leave touch-up (Escape); unsaved touch-ups are asked about first`,children:`done`}),(0,o.jsx)(`span`,{className:`text-xs text-zinc-400`,"data-testid":`drawio-touchup-status`,children:re.dirty?`● unsaved`:`touching up — drag boxes and wire ends, double-click a label`})]}):pe&&D===null&&S===null?(0,o.jsx)(`button`,{type:`button`,className:C,disabled:_===null,onClick:()=>void ve(e),title:`Move boxes, re-attach wires and fix labels here; anything more in draw.io`,children:`✎ touch up`}):null}function Ae(e){return(0,o.jsxs)(o.Fragment,{children:[D===e&&ce&&(0,o.jsx)(`span`,{role:`alert`,"data-testid":`drawio-touchup-problem`,className:`text-red-600 dark:text-red-400`,children:ce.message}),D===e&&ue&&(0,o.jsx)(`span`,{role:`status`,className:`text-amber-700 dark:text-amber-300`,children:ue}),D===null&&ce&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not start touch-up: `,ce.message]}),E&&(0,o.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,E]})]})}if(n===`reply`&&g.status===`failed`)return(0,o.jsxs)(`div`,{ref:m,role:`alert`,"data-testid":`drawio-block-missing`,className:`my-2 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be shown: `,g.message]});let je=r??(0,o.jsxs)(`p`,{className:`px-3 py-2 text-xs text-zinc-500`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` could not be drawn.`]}),Me=(0,o.jsxs)(`div`,{className:`${w} ${n===`reply`?`order-3`:`shrink-0 px-3 py-1.5`}`,children:[D!==`inline`&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,disabled:_===null||D!==null,onClick:()=>x(!0),"aria-label":`Show diagram at full size`,children:`⤢ enlarge`}),D!==`inline`&&Oe(`inline`),n===`reply`&&p&&(0,o.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,onClick:()=>p(e),title:`Open the file in the file viewer`,children:`↗ open`}),n===`viewer`&&ke(`inline`),Ae(`inline`)]});return(0,o.jsxs)(`div`,{ref:m,"data-testid":n===`reply`?`drawio-block-reply`:`drawio-block-viewer`,className:n===`reply`?`my-2 flex flex-col gap-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`:`flex h-full flex-col`,children:[n===`viewer`&&Me,he.problem!==null&&(0,o.jsxs)(`p`,{role:`alert`,"data-testid":`drawio-block-page-problem`,className:`px-3 py-1.5 text-xs text-amber-800 dark:text-amber-200`,children:[`The diagram `,(0,o.jsx)(`code`,{children:e}),` `,he.problem,`; its first page is shown.`]}),_===null||!h?(0,o.jsx)(`div`,{className:`h-80 animate-pulse rounded bg-zinc-100 dark:bg-zinc-800/60`,"data-testid":`drawio-block-loading`,"aria-label":`Loading ${e}`}):(0,o.jsx)(Wp,{ref:v,xml:fe(`inline`),serverUrl:u,title:e,fallback:je,editing:D===`inline`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,onRendered:T,className:n===`reply`?`flex h-80 flex-col`:`flex min-h-[24rem] flex-1 flex-col`,page:s===void 0?void 0:he.index}),n===`reply`&&Me,(0,o.jsx)(f,{label:e,testId:`drawio-enlarged`,open:b,onClose:k,anchorRef:m,actions:(0,o.jsxs)(o.Fragment,{children:[Oe(`enlarged`),ke(`enlarged`),Ae(`enlarged`)]}),children:_!==null&&(0,o.jsx)(`div`,{style:{width:`90vw`,height:`75vh`},children:(0,o.jsx)(Wp,{ref:y,xml:fe(`enlarged`),serverUrl:u,title:`${e}, full size`,fallback:je,editing:D===`enlarged`,onTouchUpChange:ie,onPageLocked:A,onEscape:De,className:`flex h-full flex-col`})})})]})}function uk(e){return e===`className`||Array.isArray(e)&&e[0]===`className`}function dk(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r.filter(e=>!uk(e));return t[`*`]=[...t[`*`]??[],`className`],t}var fk={...EO,tagNames:[...new Set([...EO.tagNames??[],`details`,`summary`])],attributes:dk(EO.attributes??{})},pk=[wO,[UO,fk],LC],mk=[t.n,t.t];function hk(e){let t=n.c(``,e);try{return decodeURIComponent(t)}catch{return t}}function gk(e){return typeof e==`string`&&e!==``&&!n.r(e)&&n.n(e.split(/[?#]/)[0])}function _k({text:e}){let[t,n]=(0,a.useState)(!1);return(0,o.jsxs)(`div`,{className:`my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40`,children:[(0,o.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-500`,children:[(0,o.jsx)(`span`,{className:`italic`,children:`thinking`}),(0,o.jsx)(`span`,{className:`ml-auto`,children:t?`▾`:`▸`})]}),t&&(0,o.jsx)(`div`,{className:`whitespace-pre-wrap border-t border-zinc-200 px-3 py-2 text-xs italic text-zinc-500 dark:border-zinc-800/80`,children:e})]})}function vk({item:e,serverUrl:r=``,token:i=null,workspace:s,onOpenFile:c,hideReasoning:l=!1}){let d=l?e.blocks.filter(e=>e.type!==`thinking`):e.blocks,f=e.blocks.filter(e=>e.type===`text`).map(e=>e.text).join(`
536
+
537
+ `).trim(),p=(0,a.useRef)(c);p.current=c;let m=(0,a.useMemo)(()=>{function e({src:e,alt:t,...a}){if(gk(e))return(0,o.jsx)(lk,{path:hk(e),variant:`reply`});let c=typeof e==`string`&&e!==``&&!n.r(e)?n.o(r,n.c(``,e),i,void 0,s):e;return(0,o.jsx)(`img`,{...a,src:c,alt:t??``,loading:`lazy`,className:`max-h-96 max-w-full rounded-lg object-contain`})}function t({href:e,children:t,...r}){if(typeof e==`string`&&e!==``&&!n.r(e)&&p.current){let i=n.c(``,e);return(0,o.jsx)(`a`,{...r,href:e,onClick:e=>{e.preventDefault(),p.current?.(i)},children:t})}return(0,o.jsx)(`a`,{...r,href:e,target:`_blank`,rel:`noreferrer`,children:t})}function a({node:e,children:t,...n}){let r=(e?.children??[]).filter(e=>e.type!==`text`||(e.value??``).trim()!==``);return r.length>0&&r.every(e=>e.type===`element`&&e.tagName===`img`&&gk(e.properties?.src))?(0,o.jsx)(`div`,{className:`my-2`,children:t}):(0,o.jsx)(`p`,{...n,children:t})}return{pre:Dh,img:e,a:t,p:a}},[r,i,s]);return d.length===0&&!e.errorMessage?null:(0,o.jsxs)(`div`,{className:`group max-w-none`,children:[f&&!e.streaming&&(0,o.jsx)(`div`,{className:`flex justify-end opacity-0 transition-opacity group-hover:opacity-100`,children:(0,o.jsx)(u,{text:f})}),d.map((e,n)=>e.type===`thinking`?(0,o.jsx)(_k,{text:e.text},e.contentIndex??n):(0,o.jsx)(`div`,{className:`prose-chat`,children:(0,o.jsx)(mv,{remarkPlugins:mk,rehypePlugins:pk,components:m,children:t.g(e.text)})},e.contentIndex??n)),e.errorMessage&&(0,o.jsx)(`div`,{className:`mt-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.errorMessage})]})}var yk=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],bk=`worktree`,xk=class extends Error{kind;constructor(e,t){super(e),this.name=`HistoryError`,this.kind=t}};async function Sk(e,t){let n=[];for(;;){let r=await e(n.length,50);if(r.items.length===0||(n.unshift(...r.items),t?.(n.length),r.remaining===0))return n}}Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Wp}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return Lh}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return Th}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return bl}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return pg}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return Eh}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return mv}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return vk}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return gg}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ek}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return WO}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return UO}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return LC}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return zC}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return bk}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Mp}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return QO}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return $C}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Sk}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return fk}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return wO}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return yk}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return lk}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return xk}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return tk}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return lv}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return jh}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return _g}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return l}});