isorite 0.15.0 → 0.17.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.
- package/dist/main.js +507 -62
- package/guide/out-of-the-base/web-and-code-links.md +3 -1
- package/package.json +1 -1
- package/web/_app/immutable/assets/0.DVQOzs4l.css +1 -0
- package/web/_app/immutable/assets/4.Dn5sJ8uq.css +1 -0
- package/web/_app/immutable/assets/5.DJhOSn7C.css +1 -0
- package/web/_app/immutable/assets/NoteList.Wxp_AH0Y.css +1 -0
- package/web/_app/immutable/chunks/{BAVnZFPa.js → 0KrpTYPM.js} +1 -1
- package/web/_app/immutable/chunks/{f7mFVWQS.js → 1MewxdCy.js} +1 -1
- package/web/_app/immutable/chunks/{DFo4P1vU.js → 1W6iRjg5.js} +1 -1
- package/web/_app/immutable/chunks/{BQeONalw.js → 2BcU70Iq.js} +1 -1
- package/web/_app/immutable/chunks/{CVqwkR8N.js → B-04K_Pl.js} +1 -1
- package/web/_app/immutable/chunks/{B_x6_Y3m.js → BBU5FdEo.js} +1 -1
- package/web/_app/immutable/chunks/{Djo-ijeo.js → BBhr3bLI.js} +1 -1
- package/web/_app/immutable/chunks/{CSKABQj2.js → BCsFs14H.js} +1 -1
- package/web/_app/immutable/chunks/BJOSVfg-.js +1 -0
- package/web/_app/immutable/chunks/{zasx25UV.js → BNlziJ_1.js} +3 -3
- package/web/_app/immutable/chunks/{BPpUSQ2Y.js → BbvUCVY_.js} +1 -1
- package/web/_app/immutable/chunks/{e7GRa0yc.js → BjLgp18-.js} +1 -1
- package/web/_app/immutable/chunks/{OG9GsKke.js → Bx_Vz2qr.js} +1 -1
- package/web/_app/immutable/chunks/{D7jLdCNu.js → C2EzU0qX.js} +1 -1
- package/web/_app/immutable/chunks/{DH_19--P.js → C2QvvHIN.js} +1 -1
- package/web/_app/immutable/chunks/{DJQ6favH.js → CAuYgj5q.js} +1 -1
- package/web/_app/immutable/chunks/{hjSZ041d.js → CB6ztdCQ.js} +1 -1
- package/web/_app/immutable/chunks/CHjmZsHD.js +1 -0
- package/web/_app/immutable/chunks/CM4EA3Wo.js +1 -0
- package/web/_app/immutable/chunks/{BsY4iMci.js → CMN7rSZK.js} +1 -1
- package/web/_app/immutable/chunks/CQhfj5-f.js +9 -0
- package/web/_app/immutable/chunks/{CSTv2fL0.js → CRbUrapz.js} +1 -1
- package/web/_app/immutable/chunks/{BLzZIf7l.js → CabmfniL.js} +1 -1
- package/web/_app/immutable/chunks/{C9Qdslk3.js → CcRcjPTM.js} +1 -1
- package/web/_app/immutable/chunks/{BDJlNL-I.js → CccIbhmH.js} +85 -85
- package/web/_app/immutable/chunks/{C1FDDux-.js → CdD6waB-.js} +1 -1
- package/web/_app/immutable/chunks/{CwHHpacD.js → CfTuc06U.js} +1 -1
- package/web/_app/immutable/chunks/{Mwr1r9aw.js → Cl-Xmm9N.js} +1 -1
- package/web/_app/immutable/chunks/{DxRGLDbV.js → CmFzeyfe.js} +1 -1
- package/web/_app/immutable/chunks/{CUNetmvQ.js → Cn7j5NKi.js} +1 -1
- package/web/_app/immutable/chunks/{DWwu8a1P.js → CpJ4vfn-.js} +1 -1
- package/web/_app/immutable/chunks/{MrW4zd8l.js → CwcA6hab.js} +1 -1
- package/web/_app/immutable/chunks/{AnnzTlE8.js → CxEu-Di8.js} +1 -1
- package/web/_app/immutable/chunks/{CUB9vnd0.js → DEwfz-Il.js} +1 -1
- package/web/_app/immutable/chunks/DH2bqH7t.js +517 -0
- package/web/_app/immutable/chunks/{CZSmkKvQ.js → DJHLXLij.js} +1 -1
- package/web/_app/immutable/chunks/{Kem7IXj7.js → DK9wjWIk.js} +1 -1
- package/web/_app/immutable/chunks/{BLe29cGh.js → DMTkA0aK.js} +1 -1
- package/web/_app/immutable/chunks/{D1MhxXyn.js → DMpFmiFg.js} +1 -1
- package/web/_app/immutable/chunks/{DW5uy3Jw.js → DQJRaTNz.js} +1 -1
- package/web/_app/immutable/chunks/{DJT73ARj.js → DRKiKCov.js} +1 -1
- package/web/_app/immutable/chunks/{DEQsS4Ez.js → DS7XcdHs.js} +1 -1
- package/web/_app/immutable/chunks/{0B47b24t.js → D_xpsaTJ.js} +1 -1
- package/web/_app/immutable/chunks/{LbnMg2Kc.js → Ddw9FbDu.js} +1 -1
- package/web/_app/immutable/chunks/{D4EpFhYZ.js → DeazQJkV.js} +1 -1
- package/web/_app/immutable/chunks/{Ch5Z7cbP.js → Df3spPXn.js} +1 -1
- package/web/_app/immutable/chunks/{1j--pDqt.js → DfLI-CvW.js} +1 -1
- package/web/_app/immutable/chunks/{Bytzbt5l.js → Dns-yz2Q.js} +1 -1
- package/web/_app/immutable/chunks/{mhWk5y4o.js → DqZ4UzUH.js} +1 -1
- package/web/_app/immutable/chunks/{BtcGx-KQ.js → DrPF-vh8.js} +1 -1
- package/web/_app/immutable/chunks/{DAVMwq6b.js → Ds9L6FPB.js} +1 -1
- package/web/_app/immutable/chunks/{CWc-mNzo.js → Dzu8v7nB.js} +1 -1
- package/web/_app/immutable/chunks/IECP4ppk.js +1 -0
- package/web/_app/immutable/chunks/NgkOM4d0.js +1 -0
- package/web/_app/immutable/chunks/{ZTEErEOd.js → ZDjPMhAb.js} +1 -1
- package/web/_app/immutable/chunks/ZDkogIhD.js +1 -0
- package/web/_app/immutable/chunks/{CcE14TDI.js → _zY4mrA0.js} +1 -1
- package/web/_app/immutable/chunks/{B7LnLClC.js → fpNFwizw.js} +1 -1
- package/web/_app/immutable/chunks/{BZX8cNYL.js → qfBACIi9.js} +1 -1
- package/web/_app/immutable/chunks/{Cpjqsnqr.js → rv_cF9pp.js} +1 -1
- package/web/_app/immutable/chunks/{DY0M2GMn.js → sBy91tGs.js} +1 -1
- package/web/_app/immutable/chunks/{BiHyHFlW.js → vGOSIW7X.js} +1 -1
- package/web/_app/immutable/chunks/{Ih6r6QR2.js → yYKJ4mbq.js} +1 -1
- package/web/_app/immutable/chunks/{DbtvzL7r.js → yy6sD_us.js} +1 -1
- package/web/_app/immutable/entry/app.CX19wIuG.js +2 -0
- package/web/_app/immutable/entry/start.DaiosA4i.js +1 -0
- package/web/_app/immutable/nodes/0.B6_Ycc14.js +3 -0
- package/web/_app/immutable/nodes/1.JA1sPybf.js +1 -0
- package/web/_app/immutable/nodes/2.DN2phYmE.js +1 -0
- package/web/_app/immutable/nodes/3.CbnLNp2F.js +1 -0
- package/web/_app/immutable/nodes/4.CIsG7Kdu.js +3 -0
- package/web/_app/immutable/nodes/5.D__u9ji8.js +19 -0
- package/web/_app/immutable/nodes/6.DBP0fpLt.js +1 -0
- package/web/_app/immutable/nodes/7.DuaH9aUr.js +1 -0
- package/web/_app/immutable/workers/worker-C_nKscAW.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/fonts/LythMono-LICENSE.md +112 -0
- package/web/fonts/lyth-mono-latin-bold.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-bolditalic.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-italic.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-regular.woff2 +0 -0
- package/web/index.html +19 -17
- package/web/_app/immutable/assets/0.CtWz9d2A.css +0 -1
- package/web/_app/immutable/assets/4.fOHsAKBF.css +0 -1
- package/web/_app/immutable/assets/NoteList.E6jC-AtZ.css +0 -1
- package/web/_app/immutable/chunks/B7Bf3hc7.js +0 -1
- package/web/_app/immutable/chunks/B9TKPEJD.js +0 -1
- package/web/_app/immutable/chunks/C7qBBO-i.js +0 -1
- package/web/_app/immutable/chunks/DtEVmiYo.js +0 -1
- package/web/_app/immutable/chunks/Dx_7xlS4.js +0 -523
- package/web/_app/immutable/chunks/wD7RSG2d.js +0 -1
- package/web/_app/immutable/entry/app.Av5W3V8v.js +0 -2
- package/web/_app/immutable/entry/start.CbpxCvWi.js +0 -1
- package/web/_app/immutable/nodes/0.BTVYyqUm.js +0 -3
- package/web/_app/immutable/nodes/1.DR-b7PMP.js +0 -1
- package/web/_app/immutable/nodes/2.BePyTqoa.js +0 -1
- package/web/_app/immutable/nodes/3.D2rfIXQP.js +0 -1
- package/web/_app/immutable/nodes/4.7tuUcODS.js +0 -15
- package/web/_app/immutable/nodes/5.Cs9hcGU9.js +0 -1
- package/web/_app/immutable/nodes/6.DzvF0ZPt.js +0 -1
- package/web/_app/immutable/workers/worker-CWkpeSVG.js +0 -1
- /package/web/_app/immutable/assets/{6.C00vyVPo.css → 7.C00vyVPo.css} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DIGvaVgJ.js","./BxTFtVqu.js","./yxd8jSz3.js","./Cq5C893B.js","./C6Btt2Xs.js","./DtbnBenW.js","./D_aBVMvK.js","./Bbt0DTmZ.js","./K_3X9lyC.js","./BBU5FdEo.js","./CDAjAYjS.js","./_rHYGvON.js","./DeazQJkV.js","./NgkOM4d0.js","./Bffqt7tx.js","./BWonG38x.js","./BEHa2uNW.js","./BPW39P52.js","./Ds8Pkiic.js","./CPF5uNy5.js","./DLa7NjNO.js","./DXiLM1-G.js","./CygcOYNo.js","./GwMd3KmG.js","./Cp5ooBfH.js","./Bu8mWwtz.js","./BBhr3bLI.js","./CMN7rSZK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{vt as e}from"./CxEu-Di8.js";import{t}from"./CRzLMJPS.js";import{A as n,B as r,C as i,D as a,F as o,J as s,M as c,O as l,Q as u,S as d,Y as f,_ as p,a as m,b as h,bt as ee,c as te,d as ne,g as re,gt as g,ht as ie,i as ae,j as oe,k as se,lt as _,mt as v,o as y,p as ce,s as le,vt as ue,yt as b}from"./BxTFtVqu.js";import{t as de}from"./yxd8jSz3.js";var fe=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[v.contextHash,r]]}addChild(e,t){e.prop(v.contextHash)!=this.hash&&(e=new b(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new b(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new b(g.none,e,t,n,this.hashProp)})}},x;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(x||={});var pe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},me=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return C(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function he(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==x.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=x.BulletList||be(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ge={[x.Blockquote](e,t,n){return n.next==62&&(n.markers.push(I(x.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(S(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[x.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[x.OrderedList]:he,[x.BulletList]:he,[x.Document](){return!0}};function S(e){return e==32||e==9||e==10||e==13}function C(e,t=0){for(;t<e.length&&S(e.charCodeAt(t));)t++;return t}function _e(e,t,n){for(;t>n&&S(e.charCodeAt(t-1));)t--;return t}function ve(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function ye(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function be(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!S(n))return-1}return n&&e.next==45&&Ce(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Ae.SetextHeading)>-1||r<3?-1:1}function xe(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||S(e.text.charCodeAt(e.pos+1)))&&(!n||xe(t,x.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!S(e.text.charCodeAt(r+1))||n&&!xe(t,x.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function Se(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function Ce(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&S(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,we=/-->/,Te=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,we],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function Ee(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function De(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function O(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==x.CodeText?e[r].to=n:e.push(I(x.CodeText,t,n))}var k={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(O(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){O(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==x.CodeText?O(o,e.from,e.to):o.push(e);s=[]}O(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&O(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=x.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(x.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ve(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=_e(t.text,t.text.length,o),c=[I(x.CodeMark,r,r+a)];o<s&&c.push(I(x.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&O(c,e.lineStart-1,e.lineStart),c.push(I(x.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(O(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(O(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(x.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ye(t);return n<0?!1:(e.startContext(x.Blockquote,t.pos),e.addNode(x.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(be(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(x.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=x.BulletList&&e.startContext(x.BulletList,t.basePos,t.next);let r=De(t,t.pos+1);return e.startContext(x.ListItem,t.basePos,r-t.baseIndent),e.addNode(x.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=x.OrderedList&&e.startContext(x.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=De(t,t.pos+n);return e.startContext(x.ListItem,t.basePos,r-t.baseIndent),e.addNode(x.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=Se(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=_e(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!S(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(x.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(x.HeaderMark,o-r,a-r);let c=s.finish(x.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Ee(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==we?x.CommentBlock:i==Te?x.ProcessingInstructionBlock:x.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Oe=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
3
|
+
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&C(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,I(x.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Ue(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(I(x.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Ve(e,C(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=C(e,this.pos),n=0;if(t>this.pos){let r=He(e,t,this.start);if(r){let t=A(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=A(e,this.pos),n>0&&n<e.length?n:-1}else return A(e,this.pos)}};function A(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!S(n))return-1}return t}var ke=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:Ce(t),i=t.next;if(r<0)return!1;let a=I(x.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,I(i==61?x.SetextHeading1:x.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Ae={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Oe(t):null},SetextHeading(){return new ke}},je=[(e,t)=>Se(t)>=0,(e,t)=>ve(t)>=0,(e,t)=>ye(t)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>be(t,e,!0)>=0,(e,t)=>Ee(t,e,!0)>=0],Me={text:``,end:0},Ne=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new me,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=fe.create(x.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ge(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new pe(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
4
|
+
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Ke(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Me;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+x[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
5
|
+
`?``:t;else{let e=t.indexOf(`
|
|
6
|
+
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=fe.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new b(this.parser.nodeSet.types[e],P,P,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(G(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Pe(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=G(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(x.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?I(this.parser.getNodeType(e),t,n,r):new Re(e,t)}get buffer(){return new Le(this.parser.nodeSet)}};function Pe(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=Pe(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new b(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var Fe=class e extends ue{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Ne(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let r=M(t);if(!r)return this;let{nodeSet:i,skipContextMarkup:a}=this,o=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),c=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),f=this.endLeafBlock.slice(),p=this.wrappers;if(j(r.defineNodes)){a=Object.assign({},a);let e=i.types.slice(),t;for(let n of r.defineNodes){let{name:r,block:i,composite:o,style:s}=typeof n==`string`?{name:n}:n;if(e.some(e=>e.name==r))continue;o&&(a[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,u=o?[`Block`,`BlockContext`]:i?c>=x.ATXHeading1&&c<=x.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(g.define({id:c,name:r,props:u&&[[v.group,u]]})),s&&(t||={},Array.isArray(s)||s instanceof l?t[r]=s:Object.assign(t,s))}i=new ie(e),t&&(i=i.extend(n(t)))}if(j(r.props)&&(i=i.extend(...r.props)),j(r.remove))for(let e of r.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(o[t]=s[t]=void 0),n>-1&&(u[n]=void 0)}if(j(r.parseBlock))for(let e of r.parseBlock){let t=c.indexOf(e.name);if(t>-1)o[t]=e.parse,s[t]=e.leaf;else{let t=e.before?N(c,e.before):e.after?N(c,e.after)+1:c.length-1;o.splice(t,0,e.parse),s.splice(t,0,e.leaf),c.splice(t,0,e.name)}e.endLeaf&&f.push(e.endLeaf)}if(j(r.parseInline))for(let e of r.parseInline){let t=d.indexOf(e.name);if(t>-1)u[t]=e.parse;else{let t=e.before?N(d,e.before):e.after?N(d,e.after)+1:d.length-1;u.splice(t,0,e.parse),d.splice(t,0,e.name)}}return r.wrap&&(p=p.concat(r.wrap)),new e(i,o,s,c,f,a,u,d,p)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new W(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function j(e){return e!=null&&e.length>0}function M(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=M(e[0]);if(e.length==1)return t;let n=M(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||P).concat(t||P),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function N(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Ie=[g.none];for(let e=1,t;t=x[e];e++)Ie[e]=g.define({id:e,name:t,props:e>=x.Escape?[]:[[v.group,e in ge?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var P=[],Le=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return b.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},F=class{constructor(e,t,n,r=P){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Le(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Re=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return P}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function I(e,t,n,r){return new F(e,t,n,r)}var L={resolve:`Emphasis`,mark:`EmphasisMark`},R={resolve:`Emphasis`,mark:`EmphasisMark`},z={},B={},V=class{constructor(e,t,n,r,i=n-t){this.type=e,this.from=t,this.to=n,this.side=r,this.size=i}},ze=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{H=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var U={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(ze.charCodeAt(t)==r)return e.append(I(x.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(I(x.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(I(x.InlineCode,n,r+1,[I(x.CodeMark,n,n+i),I(x.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(I(x.Autolink,n,n+1+i[0].length,[I(x.LinkMark,n,n+1),I(x.URL,n+1,n+i[0].length),I(x.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(I(x.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(I(x.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(I(x.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=H.test(i),s=H.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new V(t==95?L:R,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(I(x.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(I(x.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new V(z,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new V(B,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof V&&(r.type==z||r.type==B)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Be(e,i,r.type==z?x.Link:x.Image,r.from,n+1);if(r.type==z)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof V&&t.type==z&&(t.side=0)}return a.to}}return-1}};function Be(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(I(x.LinkMark,r,r+(n==x.Image?2:1))),t.push(I(x.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=Ve(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=He(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(I(x.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(I(x.LinkMark,n,s)))}else if(o==91){let n=Ue(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return I(n,r,s,t)}function Ve(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return I(x.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(S(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?I(x.URL,t+n,i+n):i==e.length&&null}}function He(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return I(x.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function Ue(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&I(x.LinkLabel,t+n,a+1+n);else{if(r&&!S(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var W=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new V(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof V&&(t.type==z||t.type==B))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof V&&n.type.resolve&&n.side&2))continue;let r=n.type==L||n.type==R,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof V&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.size+n.size)%3==0&&(e.size%3||n.size%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof F&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new V(a.type,a.from,l,a.side,a.size):null,(this.parts[t]=r&&n.to!=u?new V(n.type,u,n.to,n.side,n.size):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof F&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof V&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof V?t:null}skipSpace(e){return C(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?I(this.parser.getNodeType(e),t,n,r):new Re(e,t)}};W.linkStart=z,W.imageStart=B,W.emphasisAsterisk=R,W.emphasisUnderscore=L;function G(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof F&&(n[r]=new F(t.type,t.from,t.to,G(t.children,[e])))}else n.splice(r++,0,e)}return n}var We=[x.CodeBlock,x.ListItem,x.OrderedList,x.BulletList],Ge=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
7
|
+
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(v.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r||t.to-n>e.to){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=Ke(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new b(e.parser.nodeSet.types[x.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(We.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function Ke(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var qe=n({"Blockquote/...":c.quote,HorizontalRule:c.contentSeparator,"ATXHeading1/... SetextHeading1/...":c.heading1,"ATXHeading2/... SetextHeading2/...":c.heading2,"ATXHeading3/...":c.heading3,"ATXHeading4/...":c.heading4,"ATXHeading5/...":c.heading5,"ATXHeading6/...":c.heading6,"Comment CommentBlock":c.comment,Escape:c.escape,Entity:c.character,"Emphasis/...":c.emphasis,"StrongEmphasis/...":c.strong,"Link/... Image/...":c.link,"OrderedList/... BulletList/...":c.list,"BlockQuote/...":c.quote,"InlineCode CodeText":c.monospace,"URL Autolink":c.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":c.processingInstruction,"CodeInfo LinkLabel":c.labelName,LinkTitle:c.string,Paragraph:c.content}),Je=new Fe(new ie(Ie).extend(qe),Object.keys(k).map(e=>k[e]),Object.keys(k).map(e=>Ae[e]),Object.keys(k),je,ge,Object.keys(U).map(e=>U[e]),Object.keys(U),[]);function Ye(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function Xe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:ee((e,r)=>{let i=e.type.id;if(t&&(i==x.CodeBlock||i==x.FencedCode)){let n=``;if(i==x.FencedCode){let t=e.node.getChild(x.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==x.CodeText,bracketed:i==x.FencedCode}}else if(n&&(i==x.HTMLBlock||i==x.HTMLTag||i==x.CommentBlock))return{parser:n,overlay:Ye(e.node,e.from,e.to)};return null})}}var Ze={resolve:`Strikethrough`,mark:`StrikethroughMark`},Qe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":c.strikethrough}},{name:`StrikethroughMark`,style:c.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=H.test(r),c=H.test(i);return e.addDelimiter(Ze,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function K(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function $e(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var et=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,tt=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&et.test(r=t.text.slice(t.pos))){let i=[];K(e,n.content,0,i,n.start)==K(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];K(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},nt={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":c.heading}},`TableRow`,{name:`TableCell`,style:c.content},{name:`TableDelimiter`,style:c.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return $e(t.content,0)?new tt:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof tt)||!$e(t.text,t.basePos))return!1;let r=e.peekLine();return et.test(r)&&K(e,t.text,t.basePos)==K(e,r,t.basePos)},before:`SetextHeading`}]},rt=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},it={defineNodes:[{name:`Task`,block:!0,style:c.list},{name:`TaskMarker`,style:c.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new rt:null},after:`SetextHeading`}]},at=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,ot=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,st=/[\w-]+\.[\w-]+($|[/:])/,ct=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,lt=/\/[a-zA-Z\d@.]+/gy;function ut(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function dt(e,t){ot.lastIndex=t;let n=ot.exec(e);if(!n||st.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ut(e,t,r,`)`)>ut(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ft(e,t){ct.lastIndex=t;let n=ct.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var pt=[nt,it,Qe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;at.lastIndex=r;let i=at.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=dt(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ft(e.text,r):(a=ft(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(lt.lastIndex=a,i=lt.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function mt(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),S(s))break}return-1}}var ht={defineNodes:[{name:`Superscript`,style:c.special(c.content)},{name:`SuperscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Superscript`,parse:mt(94,`Superscript`,`SuperscriptMark`)}]},gt={defineNodes:[{name:`Subscript`,style:c.special(c.content)},{name:`SubscriptMark`,style:c.processingInstruction}],parseInline:[{name:`Subscript`,parse:mt(126,`Subscript`,`SubscriptMark`)}]},_t={defineNodes:[{name:`Emoji`,style:c.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},vt=e({html:()=>q,htmlCompletionSource:()=>St}),yt=g.define({id:0,name:`Document`,top:!0}),bt=class extends ue{createParse(e,t,n){let r=n[0]?.from??0,i=n[n.length-1]?.to??e.length;return{parsedPos:i,stoppedAt:null,stopAt(){},advance:()=>new b(yt,[],[],i-r)}}},xt=new ae(ne(),new bt,[],`html`);function q(e){return new y(xt)}function St(){return null}var Ct=e({commonmarkLanguage:()=>At,deleteMarkupBackward:()=>Ut,insertNewlineContinueMarkup:()=>Rt,insertNewlineContinueMarkupCommand:()=>Lt,markdown:()=>Kt,markdownKeymap:()=>Wt,markdownLanguage:()=>X,pasteURLAsLink:()=>Zt}),wt=ne({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Tt=new v,Et=Je.configure({props:[re.add(e=>!e.is(`Block`)||e.is(`Document`)||J(e)!=null||Dt(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Tt.add(J),h.add({Document:()=>null}),i.add({Document:wt})]});function J(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Dt(e){return e.name==`OrderedList`||e.name==`BulletList`}function Ot(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=J(e.type))!=null&&r<=t)break;n=e}return n.to}var kt=p.of((e,t,n)=>{for(let r=a(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Tt);if(e==null)continue;let t=Ot(r,e);if(t>n)return{from:n,to:t}}return null});function Y(e){return new ae(wt,e,[],`markdown`)}var At=Y(Et),X=Y(Et.configure([pt,gt,ht,_t,{props:[re.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function jt(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):m.matchLanguageName(e,n,!0),t instanceof m)return t.support?t.support.language.parser:le.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var Mt=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+Pt(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Nt(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new Mt(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new Mt(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new Mt(i.parent,s,s+t,a[1],e,n,i))}}return r}function Pt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Ft(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Pt(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function It(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(d)!=` `)return e;let r=_(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Lt=(e={})=>({state:t,dispatch:n})=>{let r=a(t),{doc:i}=t,o=null,c=t.changeByRange(n=>{if(!n.empty||!X.isActiveAt(t,n.from,-1)&&!X.isActiveAt(t,n.from,1))return o={range:n};let a=n.from,c=i.lineAt(a),l=Nt(r.resolveInner(a,-1),i);for(;l.length&&l[l.length-1].from>a-c.from;)l.pop();if(!l.length)return o={range:n};let u=l[l.length-1];if(u.to-u.spaceAfter.length>a-c.from)return o={range:n};let d=a>=u.to-u.spaceAfter.length&&!/\S/.test(c.text.slice(u.to));if(u.item&&d){if(u.item.from<c.from&&!/^[\s>]*$/.test(c.text.slice(0,u.to)))return o={range:n};let r=u.node.firstChild,d=u.node.getChild(`ListItem`,`ListItem`);if(r.to>=a||d&&d.to<a||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||e.nonTightLists===!1){let e=l.length>1?l[l.length-2]:null,t,n=``;e&&e.item?(t=c.from+e.from,n=e.marker(i,1)):t=c.from+(e?e.to:0);let r=[{from:t,to:a,insert:n}];return u.node.name==`OrderedList`&&Ft(u.item,i,r,-2),e&&e.node.name==`OrderedList`&&Ft(e.item,i,r),{range:s.cursor(t+n.length),changes:r}}{let e=Vt(l,t,c);return{range:s.cursor(a+e.length+1),changes:{from:c.from,insert:e+t.lineBreak}}}}if(u.node.name==`Blockquote`&&d&&c.from){let e=i.lineAt(c.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==u.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:c.from+u.from,to:c.to}]);return{range:n.map(i),changes:i}}}let f=[];u.node.name==`OrderedList`&&Ft(u.item,i,f);let p=u.item&&u.item.from<c.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=u.to)for(let e=0,t=l.length-1;e<=t;e++)m+=e==t&&!p?l[e].marker(i,1):l[e].blank(e<t?_(c.text,4,l[e+1].from)-m.length:null);let h=a;for(;h>c.from&&/\s/.test(c.text.charAt(h-c.from-1));)h--;return m=It(m,t),Bt(u.node,t.doc)&&(m=Vt(l,t,c)+t.lineBreak+m),f.push({from:h,to:a,insert:t.lineBreak+m}),{range:s.cursor(h+m.length+1),changes:f}});return!o&&(n(t.update(c,{scrollIntoView:!0,userEvent:`input`})),!0)},Rt=Lt();function zt(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Bt(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Vt(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?_(n.text,4,e[t+1].from)-r.length:null,t<i);return It(r,t)}function Ht(e,t){let n=e.resolveInner(t,-1),r=t;zt(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(zt(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var Ut=({state:e,dispatch:t})=>{let n=a(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&X.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Nt(Ht(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:s.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(_(t.text,4,n.to)-_(t.text,4,n.from));return r==t.from&&(i=It(i,e)),{range:s.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:s.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},Wt=[{key:`Enter`,run:Rt},{key:`Backspace`,run:Ut}],Gt=q({matchClosingTags:!1});function Kt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:a}=At,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=Gt}=e;if(!(a instanceof Fe))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],d=[c.support,kt],f;s&&d.push(Zt),n instanceof y?(d.push(n.support),f=n.language):n&&(f=n);let p=t||f?jt(t,f):void 0;l.push(Xe({codeParser:p,htmlParser:c.language.parser})),i&&d.push(u.high(r.of(Wt)));let m=Y(a.configure(l));return o&&d.push(m.data.of({autocomplete:qt})),new y(m,d)}function qt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=a(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:Yt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var Jt=null;function Yt(){if(Jt)return Jt;let e=St(new de(f.create({extensions:Gt}),0,!0));return Jt=e?e.options:[]}var Xt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Zt=o.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!X.isActiveAt(t.state,n.from,1)))return!1;let i=a(t.state),o=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||Xt.test(e.name))&&(o=!0)},leave:e=>{e.to<n.to&&(o=!0)}}),!o&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});function Z(e){return new y(te.define(e))}function Q(e){return t(()=>import(`./DIGvaVgJ.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2,3]),import.meta.url)}var Qt=[m.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return t(()=>import(`./C6Btt2Xs.js`).then(e=>e.cpp()),__vite__mapDeps([4,1,3]),import.meta.url)}}),m.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return t(()=>import(`./C6Btt2Xs.js`).then(e=>e.cpp()),__vite__mapDeps([4,1,3]),import.meta.url)}}),m.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return Q(`Cassandra`)}}),m.of({name:`CSS`,extensions:[`css`],load(){return t(()=>import(`./DtbnBenW.js`).then(e=>e.css()),__vite__mapDeps([5,1,3]),import.meta.url)}}),m.of({name:`Go`,extensions:[`go`],load(){return t(()=>import(`./D_aBVMvK.js`).then(e=>e.go()),__vite__mapDeps([6,1,2,3]),import.meta.url)}}),m.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return t(()=>Promise.resolve().then(()=>vt).then(e=>e.html()),void 0,import.meta.url)}}),m.of({name:`Java`,extensions:[`java`],load(){return t(()=>import(`./Bbt0DTmZ.js`).then(e=>e.java()),__vite__mapDeps([7,1,3]),import.meta.url)}}),m.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript()),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return t(()=>import(`./BBU5FdEo.js`).then(e=>e.jinja()),__vite__mapDeps([9,1,3]),import.meta.url)}}),m.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return t(()=>import(`./CDAjAYjS.js`).then(e=>e.json()),__vite__mapDeps([10,1,3]),import.meta.url)}}),m.of({name:`JSX`,extensions:[`jsx`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`LESS`,extensions:[`less`],load(){return t(()=>import(`./_rHYGvON.js`).then(e=>e.less()),__vite__mapDeps([11,1,3,5]),import.meta.url)}}),m.of({name:`Liquid`,extensions:[`liquid`],load(){return t(()=>import(`./DeazQJkV.js`).then(e=>e.liquid()),__vite__mapDeps([12,1,3]),import.meta.url)}}),m.of({name:`MariaDB SQL`,load(){return Q(`MariaSQL`)}}),m.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return t(()=>Promise.resolve().then(()=>Ct).then(e=>e.markdown()),void 0,import.meta.url)}}),m.of({name:`MS SQL`,load(){return Q(`MSSQL`)}}),m.of({name:`MySQL`,load(){return Q(`MySQL`)}}),m.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return t(()=>import(`./NgkOM4d0.js`).then(e=>e.php()),__vite__mapDeps([13,1,3]),import.meta.url)}}),m.of({name:`PLSQL`,extensions:[`pls`],load(){return Q(`PLSQL`)}}),m.of({name:`PostgreSQL`,load(){return Q(`PostgreSQL`)}}),m.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return t(()=>import(`./Bffqt7tx.js`).then(e=>e.python()),__vite__mapDeps([14,1,2,3]),import.meta.url)}}),m.of({name:`Rust`,extensions:[`rs`],load(){return t(()=>import(`./BWonG38x.js`).then(e=>e.rust()),__vite__mapDeps([15,1,3]),import.meta.url)}}),m.of({name:`Sass`,extensions:[`sass`],load(){return t(()=>import(`./BEHa2uNW.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([16,1,3,5]),import.meta.url)}}),m.of({name:`SCSS`,extensions:[`scss`],load(){return t(()=>import(`./BEHa2uNW.js`).then(e=>e.sass()),__vite__mapDeps([16,1,3,5]),import.meta.url)}}),m.of({name:`SQL`,extensions:[`sql`],load(){return Q(`StandardSQL`)}}),m.of({name:`SQLite`,load(){return Q(`SQLite`)}}),m.of({name:`TSX`,extensions:[`tsx`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return t(()=>import(`./K_3X9lyC.js`).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([8,1,2,3]),import.meta.url)}}),m.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return t(()=>import(`./BPW39P52.js`).then(e=>e.wast()),__vite__mapDeps([17,1,3]),import.meta.url)}}),m.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return t(()=>import(`./Ds8Pkiic.js`).then(e=>e.xml()),__vite__mapDeps([18,1,3]),import.meta.url)}}),m.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return t(()=>import(`./CPF5uNy5.js`).then(e=>e.yaml()),__vite__mapDeps([19,1,3]),import.meta.url)}}),m.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return t(()=>import(`./gfMMiTNf.js`).then(e=>Z(e.apl)),[],import.meta.url)}}),m.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return t(()=>import(`./C_eisQCp.js`).then(e=>Z(e.asciiArmor)),[],import.meta.url)}}),m.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return t(()=>import(`./DCl_8MCW.js`).then(e=>Z(e.asn1({}))),[],import.meta.url)}}),m.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return t(()=>import(`./BEn0Cwpx.js`).then(e=>Z(e.asterisk)),[],import.meta.url)}}),m.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return t(()=>import(`./D5EjA2JK.js`).then(e=>Z(e.brainfuck)),[],import.meta.url)}}),m.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return t(()=>import(`./DHLQUbN7.js`).then(e=>Z(e.cobol)),[],import.meta.url)}}),m.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.csharp)),[],import.meta.url)}}),m.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`ClojureScript`,extensions:[`cljs`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return t(()=>import(`./CnaYoQib.js`).then(e=>Z(e.gss)),[],import.meta.url)}}),m.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return t(()=>import(`./84nbDH0I.js`).then(e=>Z(e.cmake)),[],import.meta.url)}}),m.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return t(()=>import(`./De_zI4J0.js`).then(e=>Z(e.coffeeScript)),[],import.meta.url)}}),m.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return t(()=>import(`./DgAKBe0r.js`).then(e=>Z(e.commonLisp)),[],import.meta.url)}}),m.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return t(()=>import(`./p9eYesGn.js`).then(e=>Z(e.cypher)),[],import.meta.url)}}),m.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return t(()=>import(`./B_1Jd8HM.js`).then(e=>Z(e.cython)),[],import.meta.url)}}),m.of({name:`Crystal`,extensions:[`cr`],load(){return t(()=>import(`./Bsdphhtm.js`).then(e=>Z(e.crystal)),[],import.meta.url)}}),m.of({name:`D`,extensions:[`d`],load(){return t(()=>import(`./DWkQyNnU.js`).then(e=>Z(e.d)),[],import.meta.url)}}),m.of({name:`Dart`,extensions:[`dart`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.dart)),[],import.meta.url)}}),m.of({name:`diff`,extensions:[`diff`,`patch`],load(){return t(()=>import(`./ChtP43wD.js`).then(e=>Z(e.diff)),[],import.meta.url)}}),m.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return t(()=>import(`./DLa7NjNO.js`).then(e=>Z(e.dockerFile)),__vite__mapDeps([20,21]),import.meta.url)}}),m.of({name:`DTD`,extensions:[`dtd`],load(){return t(()=>import(`./DTF72YNO.js`).then(e=>Z(e.dtd)),[],import.meta.url)}}),m.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return t(()=>import(`./S7ucR4pR.js`).then(e=>Z(e.dylan)),[],import.meta.url)}}),m.of({name:`EBNF`,load(){return t(()=>import(`./D4c0_ac3.js`).then(e=>Z(e.ebnf)),[],import.meta.url)}}),m.of({name:`ECL`,extensions:[`ecl`],load(){return t(()=>import(`./BVIeWmwY.js`).then(e=>Z(e.ecl)),[],import.meta.url)}}),m.of({name:`edn`,extensions:[`edn`],load(){return t(()=>import(`./BflJGmDX.js`).then(e=>Z(e.clojure)),[],import.meta.url)}}),m.of({name:`Eiffel`,extensions:[`e`],load(){return t(()=>import(`./BEjRio4Q.js`).then(e=>Z(e.eiffel)),[],import.meta.url)}}),m.of({name:`Elm`,extensions:[`elm`],load(){return t(()=>import(`./Cshzl8qu.js`).then(e=>Z(e.elm)),[],import.meta.url)}}),m.of({name:`Erlang`,extensions:[`erl`],load(){return t(()=>import(`./BV0c4Hdn.js`).then(e=>Z(e.erlang)),[],import.meta.url)}}),m.of({name:`Esper`,load(){return t(()=>import(`./DuQMFDvy.js`).then(e=>Z(e.esper)),[],import.meta.url)}}),m.of({name:`Factor`,extensions:[`factor`],load(){return t(()=>import(`./CygcOYNo.js`).then(e=>Z(e.factor)),__vite__mapDeps([22,21]),import.meta.url)}}),m.of({name:`FCL`,load(){return t(()=>import(`./ClOhbFR7.js`).then(e=>Z(e.fcl)),[],import.meta.url)}}),m.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return t(()=>import(`./D6RzAl64.js`).then(e=>Z(e.forth)),[],import.meta.url)}}),m.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return t(()=>import(`./Bt6PBEDR.js`).then(e=>Z(e.fortran)),[],import.meta.url)}}),m.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.fSharp)),[],import.meta.url)}}),m.of({name:`Gas`,extensions:[`s`],load(){return t(()=>import(`./BHEdbvp9.js`).then(e=>Z(e.gas)),[],import.meta.url)}}),m.of({name:`Gherkin`,extensions:[`feature`],load(){return t(()=>import(`./oBAE_ms0.js`).then(e=>Z(e.gherkin)),[],import.meta.url)}}),m.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return t(()=>import(`./CUpZ7dEl.js`).then(e=>Z(e.groovy)),[],import.meta.url)}}),m.of({name:`Haskell`,extensions:[`hs`],load(){return t(()=>import(`./BRsoo5mP.js`).then(e=>Z(e.haskell)),[],import.meta.url)}}),m.of({name:`Haxe`,extensions:[`hx`],load(){return t(()=>import(`./DjVOVvNP.js`).then(e=>Z(e.haxe)),[],import.meta.url)}}),m.of({name:`HXML`,extensions:[`hxml`],load(){return t(()=>import(`./DjVOVvNP.js`).then(e=>Z(e.hxml)),[],import.meta.url)}}),m.of({name:`HTTP`,load(){return t(()=>import(`./CLVgA2GD.js`).then(e=>Z(e.http)),[],import.meta.url)}}),m.of({name:`IDL`,extensions:[`pro`],load(){return t(()=>import(`./BUZw3wgd.js`).then(e=>Z(e.idl)),[],import.meta.url)}}),m.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return t(()=>import(`./Bu8mWwtz.js`).then(e=>Z(e.jsonld)),[],import.meta.url)}}),m.of({name:`Julia`,extensions:[`jl`],load(){return t(()=>import(`./CQfgDRfP.js`).then(e=>Z(e.julia)),[],import.meta.url)}}),m.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.kotlin)),[],import.meta.url)}}),m.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return t(()=>import(`./BXxG0Yva.js`).then(e=>Z(e.liveScript)),[],import.meta.url)}}),m.of({name:`Lua`,extensions:[`lua`],load(){return t(()=>import(`./DPCEkfD_.js`).then(e=>Z(e.lua)),[],import.meta.url)}}),m.of({name:`mIRC`,extensions:[`mrc`],load(){return t(()=>import(`./C9zpzAZU.js`).then(e=>Z(e.mirc)),[],import.meta.url)}}),m.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return t(()=>import(`./u8YMmbU0.js`).then(e=>Z(e.mathematica)),[],import.meta.url)}}),m.of({name:`Modelica`,extensions:[`mo`],load(){return t(()=>import(`./CqHI_q-D.js`).then(e=>Z(e.modelica)),[],import.meta.url)}}),m.of({name:`MUMPS`,extensions:[`mps`],load(){return t(()=>import(`./BSzj6Xyz.js`).then(e=>Z(e.mumps)),[],import.meta.url)}}),m.of({name:`Mbox`,extensions:[`mbox`],load(){return t(()=>import(`./BEMVcqjs.js`).then(e=>Z(e.mbox)),[],import.meta.url)}}),m.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return t(()=>import(`./8H7HVH4w.js`).then(e=>Z(e.nginx)),[],import.meta.url)}}),m.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return t(()=>import(`./GwMd3KmG.js`).then(e=>Z(e.nsis)),__vite__mapDeps([23,21]),import.meta.url)}}),m.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return t(()=>import(`./CzMBulkp.js`).then(e=>Z(e.ntriples)),[],import.meta.url)}}),m.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.objectiveC)),[],import.meta.url)}}),m.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.objectiveCpp)),[],import.meta.url)}}),m.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.oCaml)),[],import.meta.url)}}),m.of({name:`Octave`,extensions:[`m`],load(){return t(()=>import(`./D2Q8cUp1.js`).then(e=>Z(e.octave)),[],import.meta.url)}}),m.of({name:`Oz`,extensions:[`oz`],load(){return t(()=>import(`./BwTct_5T.js`).then(e=>Z(e.oz)),[],import.meta.url)}}),m.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return t(()=>import(`./Dp_KdFgX.js`).then(e=>Z(e.pascal)),[],import.meta.url)}}),m.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return t(()=>import(`./BkSkiI9m.js`).then(e=>Z(e.perl)),[],import.meta.url)}}),m.of({name:`Pig`,extensions:[`pig`],load(){return t(()=>import(`./AF4Hwhju.js`).then(e=>Z(e.pig)),[],import.meta.url)}}),m.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return t(()=>import(`./D8WpQPaX.js`).then(e=>Z(e.powerShell)),[],import.meta.url)}}),m.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return t(()=>import(`./C357ku5U.js`).then(e=>Z(e.properties)),[],import.meta.url)}}),m.of({name:`ProtoBuf`,extensions:[`proto`],load(){return t(()=>import(`./D1ij_kNL.js`).then(e=>Z(e.protobuf)),[],import.meta.url)}}),m.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return t(()=>import(`./Cp5ooBfH.js`).then(e=>Z(e.pug)),__vite__mapDeps([24,25]),import.meta.url)}}),m.of({name:`Puppet`,extensions:[`pp`],load(){return t(()=>import(`./BZyAS7I4.js`).then(e=>Z(e.puppet)),[],import.meta.url)}}),m.of({name:`Q`,extensions:[`q`],load(){return t(()=>import(`./B9NhS7L_.js`).then(e=>Z(e.q)),[],import.meta.url)}}),m.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return t(()=>import(`./CxDmU1I4.js`).then(e=>Z(e.r)),[],import.meta.url)}}),m.of({name:`RPM Changes`,load(){return t(()=>import(`./gpDK5sbt.js`).then(e=>Z(e.rpmChanges)),[],import.meta.url)}}),m.of({name:`RPM Spec`,extensions:[`spec`],load(){return t(()=>import(`./gpDK5sbt.js`).then(e=>Z(e.rpmSpec)),[],import.meta.url)}}),m.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return t(()=>import(`./ChfNwlCY.js`).then(e=>Z(e.ruby)),[],import.meta.url)}}),m.of({name:`SAS`,extensions:[`sas`],load(){return t(()=>import(`./C2OyD2Y6.js`).then(e=>Z(e.sas)),[],import.meta.url)}}),m.of({name:`Scala`,extensions:[`scala`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.scala)),[],import.meta.url)}}),m.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return t(()=>import(`./D9qYN0V5.js`).then(e=>Z(e.scheme)),[],import.meta.url)}}),m.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return t(()=>import(`./DwuoZtxw.js`).then(e=>Z(e.shell)),[],import.meta.url)}}),m.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return t(()=>import(`./tLWDfEkZ.js`).then(e=>Z(e.sieve)),[],import.meta.url)}}),m.of({name:`Smalltalk`,extensions:[`st`],load(){return t(()=>import(`./BLp5-jwC.js`).then(e=>Z(e.smalltalk)),[],import.meta.url)}}),m.of({name:`Solr`,load(){return t(()=>import(`./B78wSQJQ.js`).then(e=>Z(e.solr)),[],import.meta.url)}}),m.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return t(()=>import(`./B45xgp2S.js`).then(e=>Z(e.sml)),[],import.meta.url)}}),m.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return t(()=>import(`./Dz-mlCAC.js`).then(e=>Z(e.sparql)),[],import.meta.url)}}),m.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return t(()=>import(`./CTIncYxj.js`).then(e=>Z(e.spreadsheet)),[],import.meta.url)}}),m.of({name:`Squirrel`,extensions:[`nut`],load(){return t(()=>import(`./xvONpD0Z.js`).then(e=>Z(e.squirrel)),[],import.meta.url)}}),m.of({name:`Stylus`,extensions:[`styl`],load(){return t(()=>import(`./BOVgKnng.js`).then(e=>Z(e.stylus)),[],import.meta.url)}}),m.of({name:`Swift`,extensions:[`swift`],load(){return t(()=>import(`./DKB6_1j6.js`).then(e=>Z(e.swift)),[],import.meta.url)}}),m.of({name:`sTeX`,load(){return t(()=>import(`./DNzd62Q_.js`).then(e=>Z(e.stex)),[],import.meta.url)}}),m.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return t(()=>import(`./DNzd62Q_.js`).then(e=>Z(e.stex)),[],import.meta.url)}}),m.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return t(()=>import(`./CjI9Y6RI.js`).then(e=>Z(e.verilog)),[],import.meta.url)}}),m.of({name:`Tcl`,extensions:[`tcl`],load(){return t(()=>import(`./BGfruO1u.js`).then(e=>Z(e.tcl)),[],import.meta.url)}}),m.of({name:`Textile`,extensions:[`textile`],load(){return t(()=>import(`./C4jVoHG1.js`).then(e=>Z(e.textile)),[],import.meta.url)}}),m.of({name:`TiddlyWiki`,load(){return t(()=>import(`./VlUiK86J.js`).then(e=>Z(e.tiddlyWiki)),[],import.meta.url)}}),m.of({name:`Tiki wiki`,load(){return t(()=>import(`./DTszW0OQ.js`).then(e=>Z(e.tiki)),[],import.meta.url)}}),m.of({name:`TOML`,extensions:[`toml`],load(){return t(()=>import(`./BPTmHmyx.js`).then(e=>Z(e.toml)),[],import.meta.url)}}),m.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return t(()=>import(`./C2dAgh7P.js`).then(e=>Z(e.troff)),[],import.meta.url)}}),m.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return t(()=>import(`./PPSTk1ow.js`).then(e=>Z(e.ttcn)),[],import.meta.url)}}),m.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return t(()=>import(`./2b4Gb5sE.js`).then(e=>Z(e.ttcnCfg)),[],import.meta.url)}}),m.of({name:`Turtle`,extensions:[`ttl`],load(){return t(()=>import(`./Cx3rYX2g.js`).then(e=>Z(e.turtle)),[],import.meta.url)}}),m.of({name:`Web IDL`,extensions:[`webidl`],load(){return t(()=>import(`./D5jiJvOU.js`).then(e=>Z(e.webIDL)),[],import.meta.url)}}),m.of({name:`VB.NET`,extensions:[`vb`],load(){return t(()=>import(`./BthdM_4N.js`).then(e=>Z(e.vb)),[],import.meta.url)}}),m.of({name:`VBScript`,extensions:[`vbs`],load(){return t(()=>import(`./D9f6rSsU.js`).then(e=>Z(e.vbScript)),[],import.meta.url)}}),m.of({name:`Velocity`,extensions:[`vtl`],load(){return t(()=>import(`./CqftRsjg.js`).then(e=>Z(e.velocity)),[],import.meta.url)}}),m.of({name:`Verilog`,extensions:[`v`],load(){return t(()=>import(`./CjI9Y6RI.js`).then(e=>Z(e.verilog)),[],import.meta.url)}}),m.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return t(()=>import(`./kS471soi.js`).then(e=>Z(e.vhdl)),[],import.meta.url)}}),m.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return t(()=>import(`./BKJx4mf9.js`).then(e=>Z(e.xQuery)),[],import.meta.url)}}),m.of({name:`Yacas`,extensions:[`ys`],load(){return t(()=>import(`./CXXgtw0p.js`).then(e=>Z(e.yacas)),[],import.meta.url)}}),m.of({name:`Z80`,extensions:[`z80`],load(){return t(()=>import(`./Co3PbHdE.js`).then(e=>Z(e.z80)),[],import.meta.url)}}),m.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.mscgen)),[],import.meta.url)}}),m.of({name:`Xù`,extensions:[`xu`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.xu)),[],import.meta.url)}}),m.of({name:`MsGenny`,extensions:[`msgenny`],load(){return t(()=>import(`./qgSLujhx.js`).then(e=>Z(e.msgenny)),[],import.meta.url)}}),m.of({name:`Vue`,extensions:[`vue`],load(){return t(()=>import(`./BBhr3bLI.js`).then(e=>e.vue()),__vite__mapDeps([26,1,3,8,2]),import.meta.url)}}),m.of({name:`Angular Template`,load(){return t(()=>import(`./CMN7rSZK.js`).then(e=>e.angular()),__vite__mapDeps([27,1,3,8,2]),import.meta.url)}})],$t=oe([{tag:c.keyword,class:`tok-k`},{tag:[c.string,c.regexp,c.special(c.string)],class:`tok-s`},{tag:[c.number,c.bool,c.null,c.atom],class:`tok-n`},{tag:[c.typeName,c.className,c.namespace],class:`tok-t`},{tag:c.comment,class:`tok-c`}]),en={style:e=>$t.style(e),scope:e=>e.prop(i)!==X.data};function tn(e){let t=e.trim().split(/\s/)[0]??``;return t?m.matchLanguageName(Qt,t,!1):null}var $=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`);function nn(e,t){let n=tn(t)?.support;if(!n)return null;let r=``,i=ce(f.create({doc:e,extensions:[n]}),e.length,500)??n.language.parser.parse(e);return se(e,i,en,(e,t)=>{r+=t?`<span class="${t}">${$(e)}</span>`:$(e)},()=>{r+=`
|
|
8
|
+
`}),r}async function rn(e,t){let n=tn(t);if(!n)return null;try{await n.load()}catch{return null}return nn(e,t)}async function an(e,t){let n=m.matchFilename(Qt,t);if(!n)return null;try{await n.load()}catch{return null}let r=n.support;if(!r)return null;let i=``,a=ce(f.create({doc:e,extensions:[r]}),e.length,500)??r.language.parser.parse(e);return se(e,a,en,(e,t)=>{i+=t?`<span class="${t}">${$(e)}</span>`:$(e)},()=>{i+=`
|
|
9
|
+
`}),i}function on(e,t){let n=()=>{for(let t of e.querySelectorAll(`pre > code[class*='language-']:not([data-coloured])`)){let e=/language-(\S+)/.exec(t.className)?.[1]??``,n=t.textContent??``;t.dataset.coloured=``,rn(n,e).then(e=>{e!==null&&t.textContent===n&&(t.innerHTML=e)})}};return n(),{update:n}}export{Qt as a,q as c,nn as i,on as n,Kt as o,an as r,X as s,en as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,F as t,
|
|
1
|
+
import{E as e,F as t,J as n,M as r,Q as i,T as a,V as o,at as s,f as c,i as l,it as u,lt as d,mt as f,nt as p,q as m,rt as h,ut as g,v as _}from"./CxEu-Di8.js";import"./xihTtKlq.js";function v(e){let t=e*9301+49297;return()=>((t=t*16807%2147483647)-1)/2147483646}var y=[`F[+F][-F]F`,`FF[+F][-F]F`,`F[+F][-F][F]`,`F[++F][--F]F`,`F[+F][-F]F[+F][-F]`,`F[+FF][-FF]F`,`FF[+F][-F][++F][--F]`,`F[+F[+F][-F]][-F[+F][-F]]F`],b=[3,4,5,6,6,6,7,8,8];function x(e){let t=v(e+1),n=b[Math.floor(t()*b.length)],r=y[Math.floor(t()*y.length)],i=180/n*(t()<.5?1:2)*(n<=4&&t()<.5?.5:1),a=r.length>14?2:t()<.55?3:2,o=`F`;for(let e=0;e<a;e++)o=o.replace(/F/g,r);let s=[],c=[],l=0,u=0,d=0,f=0,p=0;for(let e of o)if(e===`F`){let e=l+Math.cos(d*Math.PI/180),t=u+Math.sin(d*Math.PI/180);s.push([l,u,e,t,f]),l=e,u=t,f++,p=Math.max(p,Math.hypot(l,u))}else e===`+`?d+=i:e===`-`?d-=i:e===`[`?c.push([l,u,d,f]):e===`]`&&([l,u,d,f]=c.pop());return{n,segs:s,scale:21/Math.max(p,1),steps:Math.max(...s.map(e=>e[4]))+1,width:Math.min(1.4,Math.max(.6,30/s.length*n/6+.55))}}var S=Array.from({length:100},(e,t)=>x(t*7919+13));function C(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0)%S.length}function w(e){let t=[];for(let n=0;n<e.n;n++){let r=(n*360/e.n-90)*Math.PI/180,i=Math.cos(r),a=Math.sin(r),o=(t,n)=>[(t*i-n*a)*e.scale,(t*a+n*i)*e.scale];for(let[n,r,i,a,s]of e.segs){let[c,l]=o(n,r),[u,d]=o(i,a);t.push({x1:+c.toFixed(2),y1:+l.toFixed(2),x2:+u.toFixed(2),y2:+d.toFixed(2),out:s/e.steps})}}return t}var T=t(`<line class="svelte-45eg1y"></line>`),E=t(`<svg viewBox="-24 -24 48 48"><g></g></svg>`);function D(t,p){g(p,!0);let v=l(p,`size`,3,44),y=l(p,`growing`,3,!1),b=l(p,`label`,3,``),x=s(()=>S[C(p.id)]),D=s(()=>v()>=40?1:.45),O=s(()=>w(o(x)).filter(e=>e.out<o(D)).sort((e,t)=>e.out-t.out)),k=s(()=>{let e=Math.max(...o(O).map(e=>Math.hypot(e.x2,e.y2)));return e>0?21/e:1}),A=s(()=>v()>=40?.75+o(x).width*.3:1.1),j=u(1);n(()=>{if(!y()||matchMedia(`(prefers-reduced-motion: reduce)`).matches){h(j,1);return}let e=performance.now(),t=0,n=r=>{let i=Math.floor((r-e)/1e3*24)*1e3/24%2200;h(j,Math.min(1,i/1100),!0),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)});let M=s(()=>o(j)>=1?o(O).length:o(O).findIndex(e=>e.out/o(D)>o(j))+1||o(O).length);var N=E();let P;var F=i(N);a(F,21,()=>o(O).slice(0,o(M)),e,(e,t)=>{var n=T();m(()=>{c(n,`x1`,o(t).x1),c(n,`y1`,o(t).y1),c(n,`x2`,o(t).x2),c(n,`y2`,o(t).y2)}),r(e,n)}),f(F),f(N),m(()=>{P=_(N,0,`crystal svelte-45eg1y`,null,P,{growing:y()}),c(N,`width`,v()),c(N,`height`,v()),c(N,`role`,b()?`img`:void 0),c(N,`aria-label`,b()||void 0),c(N,`aria-hidden`,b()?void 0:`true`),c(F,`transform`,`scale(${o(k)??``})`),c(F,`stroke-width`,o(A))}),r(t,N),d()}var O=new class{#e=u(p(typeof document>`u`?``:document.documentElement.dataset.ground??``));get chosen(){return o(this.#e)}set chosen(e){h(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.ground=e:delete document.documentElement.dataset.ground;try{e?localStorage.setItem(`isorite.ground`,e):localStorage.removeItem(`isorite.ground`)}catch{}}},k=[[``,`the system's`],[`lapis`,`lapis`],[`quartz`,`quartz`]],A=new class{#e=u(p(typeof document>`u`?``:document.documentElement.dataset.code??``));get chosen(){return o(this.#e)}set chosen(e){h(this.#e,e,!0)}choose(e){this.chosen=e,e?document.documentElement.dataset.code=e:delete document.documentElement.dataset.code;try{e?localStorage.setItem(`isorite.code`,e):localStorage.removeItem(`isorite.code`)}catch{}}},j=[[``,`in colour`],[`ink`,`in ink`]];export{D as a,O as i,k as n,A as r,j as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,c as t,h as n,m as r,o as i,t as a,x as o}from"./
|
|
1
|
+
import{a as e,c as t,h as n,m as r,o as i,t as a,x as o}from"./DS7XcdHs.js";var s=/\s/;function c(e,t,n,r,i=0){let a=[];for(let o of e.split(`
|
|
2
2
|
`)){let e=Array.from(o);e.length===0&&a.push(``);let c=0;for(;c<e.length;){let o=a=>t.width(e.slice(c,c+a).join(``),n,i)<=r,l=1;for(;l<e.length-c&&o(l);)l=Math.min(e.length-c,l*2);let u=1;for(;u<l;){let e=Math.ceil((u+l)/2);o(e)?u=e:l=e-1}let d=u,f=c+d<e.length;if(f&&!s.test(e[c+d])){for(let t=d-1;t>0;t--)if(s.test(e[c+t])){d=t+1;break}}let p=e.slice(c,c+d).join(``);for(a.push(f&&p.trimEnd()||p),c+=d;f&&c<e.length&&s.test(e[c]);)c++}}e===``&&(a.length=0);let o=a.map(e=>t.width(e,n,i)),c=0;for(let e of o)c=Math.max(c,e);let l=Math.round(n*1.5);return{lines:a.map((e,t)=>[{text:e,style:i,width:o[t]}]),widths:o,width:c,height:a.length*l,size:n,lineHeight:l}}function l(e,t,r){if(e.width<=r)return e;let i=[],a=[];for(let n=0;n<e.lines.length;n++){if(e.widths[n]<=r){i.push(e.lines[n]),a.push(e.widths[n]);continue}let o=[],s=0,c=()=>{i.push(o),a.push(s),o=[],s=0};for(let i of e.lines[n])if(i.icon!==void 0||i.math)o.length&&s+i.width>r&&c(),o.push(i),s+=i.width;else for(let n of Array.from(i.text)){let a=o[o.length-1],l=a&&a.icon===void 0&&a.math===void 0&&a.style===i.style,u=t.width(l?a.text+n:n,e.size,i.style)-(l?a.width:0);o.length&&s+u>r&&(c(),a=void 0,u=t.width(n,e.size,i.style)),a&&a.icon===void 0&&a.math===void 0&&a.style===i.style?(a.text+=n,a.width+=u):o.push({text:n,style:i.style,width:u}),s+=u}(o.length||!e.lines[n].length)&&c()}let o=0;for(let e of a)o=Math.max(o,e);let s={...e,lines:i,widths:a,width:o,height:i.length*e.lineHeight};return e.heights?n(s):s}function u(n,s,c,l){let u=t(n),d=`<text`+a(l,u),f=``;for(let t=0;t<n.lines.length;t++){let a=n.lines[t],p=c+(t+.5)*n.lineHeight;if(a.some(e=>e.icon!==void 0)){let e=n.widths[t];f+=i({...n,lines:[a],widths:[e],width:e,height:n.lineHeight},s+e/2,p,l);continue}let m=``;for(let t of a){let n=r(t.style&~u);m+=n?`<tspan${n}>${e(t.text)}</tspan>`:e(t.text)}m!==``&&(f+=`${d} x="${o(s)}" y="${o(p+n.size*.35)}" text-anchor="start" xml:space="preserve">${m}</text>`)}return f}export{u as n,l as r,c as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,d as r,i,o as a,r as o,s,u as c,v as l,x as u}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,d as r,i,o as a,r as o,s,u as c,v as l,x as u}from"./DS7XcdHs.js";import{a as d,o as f,t as p}from"./DciMwFJ1.js";import{a as m,i as h,l as g,s as _}from"./DK9wjWIk.js";import{n as v}from"./CdD6waB-.js";import{n as y}from"./_zY4mrA0.js";import{o as b,t as ee}from"./DrPF-vh8.js";import{t as x}from"./BZmnMkFw.js";import{t as S}from"./D6QVYUu9.js";import{i as te,n as ne,r as re,t as ie}from"./DQJRaTNz.js";import{i as ae,n as oe,r as se,t as C}from"./Bx_Vz2qr.js";import{_ as w,d as T,g as E,h as D,s as O,u as ce}from"./BNlziJ_1.js";function k(e){return e===`#`||e===`+`||e===`~`||e===`-`}var A=class{id=``;memberType;visibility=``;classifier=``;parameters=``;returnType=``;constructor(e,t){this.memberType=t,(t!==`method`||!this.parseMethod(e))&&this.parseAttribute(e),this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim()}parseMethod(e){let t=e.length;for(let n=0;n<t;){let r=n;for(;r<t&&!w(e.charCodeAt(r));)r++;let i=r-1;for(;i>n&&e.charCodeAt(i)!==41;)i--;let a=i-1;for(;a>n&&e.charCodeAt(a)!==40;)a--;if(a>n){let r=e[n],o=k(r)&&a>n+1;o&&(this.visibility=r),this.id=e.slice(o?n+1:n,a),this.parameters=e.slice(a+1,i).trim();let s=i+1,c=``;if(s<t){let t=e[s];(t===`$`||t===`*`||t.trim()===``)&&(c=t.trim(),s++)}let l=s;for(;l<t&&!w(e.charCodeAt(l));)l++;if(this.returnType=e.slice(s,l).trim(),c===``){let e=this.returnType.slice(-1);(e===`$`||e===`*`)&&(c=e,this.returnType=this.returnType.slice(0,-1))}return this.classifier=c,!0}n=r+1}return this.memberType=`attribute`,!1}parseAttribute(e){let t=e.slice(0,1),n=e.slice(-1);k(t)&&(this.visibility=t),(n===`$`||n===`*`)&&(this.classifier=n),this.id=e.substring(this.visibility===``?0:1,this.classifier===``?e.length:e.length-1)}getDisplayDetails(){let e=this.visibility+x(this.id);return this.memberType===`method`&&(e+=`(${x(this.parameters.trim())})`,this.returnType&&(e+=` : `+x(this.returnType))),{displayText:e.trim(),cssStyle:this.parseClassifier()}}parseClassifier(){return this.classifier===`*`?`font-style:italic;`:this.classifier===`$`?`text-decoration:underline;`:``}},j={LINE:0,DOTTED_LINE:1},M={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},N=`classId-`;function P(e){let t=e.indexOf(`~`);if(t<=0)return{className:e,type:``};let n=e.indexOf(`~`,t+1);return{className:e.slice(0,t),type:e.slice(t+1,n===-1?e.length:n)}}function le(e){let t=e.charCodeAt(0);return P(t>=48&&t<=57?N+e:e).className}var F=class{type=`class`;lineType=j;relationType=M;direction=`TB`;classes=new Map;relations=[];notes=new Map;namespaces=new Map;interfaces=[];styleClasses=new Map;title;accTitle;accDescr;namespaceStack=[];withCssClass=new Map;addClass(e){let{className:t,type:n}=P(e);if(this.classes.has(t))return;let r={id:t,type:n,label:t,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[]};this.classes.set(t,r),this.tag(r,`default`)}tag(e,t){let n=this.withCssClass.get(t);n?n.add(e):this.withCssClass.set(t,new Set([e]))}ensure(e){return this.addClass(e),this.classes.get(P(e).className)}setClassLabel(e,t){this.ensure(e).label=t}addRelation(e){let{type1:t,type2:n}=e.relation;t===M.LOLLIPOP&&n===`none`?(this.addClass(e.id2),e.id1=this.addInterface(e.id1,e.id2)):n===M.LOLLIPOP&&t===`none`?(this.addClass(e.id1),e.id2=this.addInterface(e.id2,e.id1)):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=P(e.id1).className,e.id2=P(e.id2).className,e.relationTitle1=e.relationTitle1.trim(),e.relationTitle2=e.relationTitle2.trim(),this.relations.push(e)}addInterface(e,t){let n=`interface${this.interfaces.length}`;return this.interfaces.push({id:n,label:e,classId:t}),n}addAnnotation(e,t){this.ensure(e).annotations.push(t)}addMember(e,t){let n=this.ensure(e);if(typeof t!=`string`)return;let r=t.trim();if(r.startsWith(`<<`)&&r.endsWith(`>>`))n.annotations.push(r.substring(2,r.length-2));else if(r.indexOf(`)`)>0){let e=new A(r,`method`);(e.memberType===`method`?n.methods:n.members).push(e)}else r&&n.members.push(new A(r,`attribute`))}addMembers(e,t){if(Array.isArray(t)){t.reverse();for(let n of t)this.addMember(e,n)}}addNote(e,t){let n=this.notes.size,r=`note${n}`;return this.notes.set(r,{id:r,class:t,text:e,index:n}),r}cleanupLabel(e){return(e.startsWith(`:`)?e.substring(1):e).trim()}setCssClass(e,t){for(let n of e.split(`,`)){let e=this.classes.get(le(n));if(e!==void 0){e.cssClasses+=` `+t;for(let n of t.split(` `))this.tag(e,n)}}}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);if(e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),!t)continue;for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n);let r=this.withCssClass.get(n);if(r===void 0)continue;let i=t.flatMap(e=>e.split(`,`));for(let e of r)for(let t of i)e.styles.push(t)}}setTooltip(e,t){if(t!==void 0)for(let n of e.split(`,`)){let e=this.classes.get(P(n).className);e&&(e.tooltip=t)}}setLink(e,t,n){let r=T(t).trim();for(let t of e.split(`,`)){let e=this.classes.get(le(t));e&&(e.link=r?b(r):void 0,e.linkTarget=typeof n==`string`?n:`_blank`)}this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){for(let t of e.split(`,`)){let e=this.classes.get(P(t).className);e&&(e.haveCallback=!0)}this.setCssClass(e,`clickable`)}setDirection(e){this.direction=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}addNamespace(e,t){let n=this.namespaceStack[this.namespaceStack.length-1],r=n?`${n}.${e}`:e;this.namespaceStack.push(r);let i=this.namespaces.get(r);if(i)return i.explicit=!0,t&&(i.label=t),r;let a=n||void 0,o=n?n.length+1:0;for(;;){let e=r.indexOf(`.`,o),n=e===-1,i=n?r:r.slice(0,e),s=this.namespaces.get(i);if(s===void 0){let c=r.slice(o,n?r.length:e);s={id:i,label:n&&t?t:c,classes:new Map,notes:new Map,children:new Map,parent:a,explicit:n},this.namespaces.set(i,s)}else n&&(s.explicit=!0);let c=a?this.namespaces.get(a):void 0;if(c&&(c.children.has(i)||c.children.set(i,s),s.parent??=a),n)return r;a=i,o=e+1}}popNamespace(){this.namespaceStack.pop()}addClassesToNamespace(e,t,n){let r=this.namespaces.get(e);if(r!==void 0){for(let n of t){let{className:t}=P(n),i=this.classes.get(t);i!==void 0&&(i.parent=e,r.classes.set(t,i))}for(let t of n){let n=this.notes.get(t);n!==void 0&&(n.parent=e,r.notes.set(t,n))}}}setCssStyle(e,t){let n=this.classes.get(e);if(t&&n)for(let e of t)for(let t of e.split(`,`))n.styles.push(t)}},ue=`$end.INVALID.CLASS_DIAGRAM.NEWLINE.EOF.SQS.STR.SQE.DOT.GENERICTYPE.LABEL.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.STRUCT_START.STRUCT_STOP.NAMESPACE.STYLE_SEPARATOR.ANNOTATION_START.ANNOTATION_END.CLASS.MEMBER.NOTE_FOR.NOTE.CLASSDEF.ALPHA.COMMA.direction_tb.direction_bt.direction_rl.direction_lr.AGGREGATION.EXTENSION.COMPOSITION.DEPENDENCY.LOLLIPOP.LINE.DOTTED_LINE.CALLBACK.LINK.LINK_TARGET.CLICK.CALLBACK_NAME.CALLBACK_ARGS.HREF.STYLE.CSSCLASS.COLON.BRKT.PCT.MINUS.UNICODE_TEXT.BQUOTE_STR.EDGE_STATE.EOF_IN_STRUCT.OPEN_IN_STRUCT.PLUS.EQUALS.PUNCTUATION`.split(`.`),de=[4,6,4,9,44,45,12,14,15,4,56,4,56],fe=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],I=/[\n\r\u2028\u2029]/g;function L(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=e.indexOf(`direction`),l=-1,u=0,d=(t,a,o)=>(n.push(t),r.push(e.slice(a,o)),i.push(a),s=o,!0),f=e=>{a.push(o),o=e},p=()=>{a.length>0&&(o=a.pop())},m=t=>e.startsWith(t,s)&&!E(e.charCodeAt(s+t.length)),h=n=>{for(;n<t&&D(e.charCodeAt(n));)n++;return n},g=n=>{let r=e.indexOf(n,s);return r===-1?t:r},_=n=>{let r=s,i=-1;for(let n=e.charCodeAt(r);r<t&&D(n);n=e.charCodeAt(++r))n===10&&(i=r);i<0?s=r:(n&&p(),d(3,s,i+1))},v=t=>{switch(t){case 99:if(m(`cssClass`))return d(48,s,s+8);if(m(`callback`))return d(40,s,s+8);if(m(`click`))return d(43,s,s+5);break;case 108:if(m(`link`))return d(41,s,s+4);break;case 110:if(m(`note for`))return d(24,s,s+8);if(m(`note`))return d(25,s,s+4);break;case 60:if(e.charCodeAt(s+1)===60)return d(20,s,s+2);break;case 62:if(e.charCodeAt(s+1)===62)return d(21,s,s+2);break;case 104:if(m(`href`))return d(46,s,s+4)}return!1},y=n=>{if(v(n))return!0;let r=e.charCodeAt(s+1);switch(n){case 34:return f(1),s++,!0;case 126:return f(3),s++,!0;case 96:return f(2),s++,!0;case 95:if(m(`_self`))return d(42,s,s+5);if(m(`_blank`))return d(42,s,s+6);if(m(`_parent`))return d(42,s,s+7);if(m(`_top`))return d(42,s,s+4);break;case 60:return r===124?d(34,s,s+2):d(36,s,s+1);case 124:return r===62&&d(34,s,s+2);case 62:return d(36,s,s+1);case 42:return d(35,s,s+1);case 111:if(!E(r))return d(33,s,s+1);break;case 40:return r===41&&d(37,s,s+2);case 45:return r===45?d(38,s,s+2):d(52,s,s+1);case 46:return r===46?d(39,s,s+2):d(8,s,s+1);case 58:{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===58||t===10||t===59)break;n++}return n>s+1?d(10,s,n):r===58&&e.charCodeAt(s+2)===58&&d(19,s,s+3)}case 43:return d(58,s,s+1);case 37:return d(51,s,s+1);case 61:return d(59,s,s+1);case 91:return d(5,s,s+1);case 93:return d(7,s,s+1);case 33:case 35:case 36:case 38:case 39:case 44:case 63:case 92:case 47:return d(60,s,s+1)}if(E(n)){let t=s+1;for(;E(e.charCodeAt(t));)t++;return d(27,s,t)}return S(n)&&d(53,s,s+1)},b=()=>{if(c===-1||s<u||(c<s&&(c=e.indexOf(`direction`,s)),c===-1)||(l<s&&(I.lastIndex=s,l=I.test(e)?I.lastIndex-1:t),c>=l))return!1;for(let t=0;t<4;t++){let n=fe[t];if(n.lastIndex=s,n.test(e))return d(29+t,s,n.lastIndex)}return u=l,!1},ee=n=>{if(b())return!0;if(D(n))return _(!1),!0;switch(n){case 37:if(e.charCodeAt(s+1)===37){let n=g(`
|
|
3
3
|
`);for(;n<t&&(e.charCodeAt(n)===10||e.charCodeAt(n)===13);)n++;return s=n,!0}break;case 97:{let t=e.startsWith(`accTitle`,s);if(!t&&!e.startsWith(`accDescr`,s))break;let n=h(s+8),r=e.charCodeAt(n);if(r===58)return d(t?11:13,s,h(n+1)),f(t?6:7),!0;if(r===123&&!t)return s=h(n+1),f(8),!0;break}case 99:if(m(`classDiagram-v2`))return d(2,s,s+15);if(m(`classDiagram`))return d(2,s,s+12);if(e.startsWith(`call`,s)&&D(e.charCodeAt(s+4)))return s=h(s+4),f(4),!0;if(m(`classDef`))return d(26,s,s+8);if(m(`class`))return f(9),d(22,s,s+5);break;case 91:if(e.startsWith(`*]`,s+1))return d(55,s,s+3);break;case 115:if(m(`style`))return d(47,s,s+5);break;case 110:if(m(`namespace`))return f(11),d(18,s,s+9);break;case 44:return d(28,s,s+1);case 35:return d(50,s,s+1)}return y(n)||n===58&&d(49,s,s+1)};for(;;){if(s>=t){n.push(de[o]),r.push(``),i.push(t);break}let a=e.charCodeAt(s),c=!0;switch(o){case 0:c=ee(a);break;case 9:D(a)?_(!0):a===125?(p(),p(),d(17,s,s+1)):a===123?(f(10),d(16,s,s+1)):c=y(a);break;case 10:if(a===34)f(1),s++;else if(a===125)p(),d(17,s,s+1);else if(a===91&&e.startsWith(`*]`,s+1))d(55,s,s+3);else if(a===123)d(57,s,s+1);else if(a===10)s++;else{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===123||t===125||t===10)break;n++}d(23,s,n)}break;case 11:D(a)?_(!0):a===123?(f(12),d(16,s,s+1)):a===125?p():a===110&&m(`namespace`)?(f(11),d(18,s,s+9)):c=y(a);break;case 12:D(a)?_(!1):a===125?(p(),d(17,s,s+1)):a===110&&m(`namespace`)?(f(11),d(18,s,s+9)):a===91&&e.startsWith(`*]`,s+1)?d(55,s,s+3):a===99&&m(`class`)?(f(9),d(22,s,s+5)):c=y(a);break;case 1:a===34?(p(),s++):d(6,s,g(`"`));break;case 3:if(a===34)f(1),s++;else{if(v(a))break;a===126?(p(),s++):d(9,s,g(`~`))}break;case 2:if(a===34)f(1),s++;else{if(v(a))break;a===126?(f(3),s++):a===96?(p(),s++):d(54,s,g("`"))}break;case 4:if(a===40){let t=h(s+1);p(),e.charCodeAt(t)===41?s=t+1:(f(5),s++)}else d(44,s,g(`(`));break;case 5:a===41?(p(),s++):d(45,s,g(`)`));break;case 6:case 7:d(o===6?12:14,s,g(`
|
|
4
4
|
`)),p();break;case 8:a===125?(p(),s++):d(15,s,g(`}`))}if(!c)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}return n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var R=61,z=new Uint8Array(R);for(let e of[53,27,52])z[e]=1;var pe=new Uint8Array(R);for(let e of[27,49,50,47,51,10])pe[e]=1;var B=new Uint8Array(R);B[33]=1,B[34]=2,B[35]=3,B[36]=4,B[37]=5;var V=`'UNICODE_TEXT', 'NUM', 'ALPHA', 'MINUS', 'BQUOTE_STR'`;function me(e,t){let{types:n,texts:r,starts:i}=L(e),a=0,o=t=>{let r=n[a];throw r===1?O(`class`,e,i[a],``,!0):O(`class`,e,i[a],`Expecting ${t}, got '${ue[r]}'`)},s=e=>(n[a]!==e&&o(`'${ue[e]}'`),r[a++]),c=()=>(z[n[a]]===0&&o(`'UNICODE_TEXT', 'NUM', 'ALPHA', 'MINUS'`),r[a++]),l=e=>{let t=``;for(;;){if(n[a]===54){t+=r[a++];break}z[n[a]]===0&&o(V),t+=r[a++];let e=n[a];if(e===8)t+=`.`,a++;else if(z[e]===0&&e!==54)break}return e&&n[a]===9&&(t+=`~`+r[a++]+`~`),t},u=()=>{a++;let e=s(6);return s(7),e},d=()=>{n[a]!==23&&o(`'STRUCT_STOP', 'MEMBER'`);let e=[];for(;n[a]===23;)e.push(r[a++]);return s(17),e.reverse()},f=()=>{a++;let e=l(!0);switch(t.addClass(e),n[a]===5&&t.setClassLabel(e,u()),n[a]){case 19:{a++;let r=c();t.setCssClass(e,r),n[a]===16&&(a++,t.addMembers(e,d()));break}case 16:a++,n[a]===17?a++:t.addMembers(e,d());break;case 20:{a++;let r=c();s(21),t.addAnnotation(e,r),n[a]===16&&(a++,n[a]===17?a++:t.addMembers(e,d()));break}}return e},p=()=>{if(n[a++]===25)return t.addNote(s(6));let e=l(!0);return t.addNote(s(6),e)},m=()=>{let e=[];for(;;){a++;let r=l(!1),i=n[a]===5?t.addNamespace(r,u()):t.addNamespace(r);s(16),n[a]===3&&a++,e.push({id:i,classes:[],notes:[]});let c=!0;for(;c;){let r=e[e.length-1],i=n[a];if(i===18)break;for(i===22?r.classes.push(f()):i===25||i===24?r.notes.push(p()):o(`'NAMESPACE', 'CLASS', 'NOTE_FOR', 'NOTE'`);;){if(n[a]===3){let e=n[a+1];if(e===18||e===22||e===25||e===24){a++;break}a++}s(17);let r=e.pop();if(t.addClassesToNamespace(r.id,r.classes,r.notes),t.popNamespace(),e.length===0){c=!1;break}}}if(e.length===0)return}},h=()=>{let e=B[n[a]];return e===0?`none`:(a++,e-1)},g=()=>{let e=l(!0),i=n[a];if(i===10){t.addMember(e,t.cleanupLabel(r[a++]));return}let s=`none`;if(i===6)s=r[a++],i=n[a];else if(B[i]===0&&i!==38&&i!==39)return;let c=h();i=n[a],i!==38&&i!==39&&o(`'AGGREGATION', 'EXTENSION', 'COMPOSITION', 'DEPENDENCY', 'LOLLIPOP', 'LINE', 'DOTTED_LINE'`),a++;let u=h(),d=n[a]===6?r[a++]:`none`,f={id1:e,id2:l(!0),relation:{type1:c,type2:u,lineType:i===38?0:1},relationTitle1:s,relationTitle2:d};n[a]===10&&(f.title=t.cleanupLabel(r[a++])),t.addRelation(f)},_=()=>{let e=[];for(;;){pe[n[a]]===0&&o(`'ALPHA', 'NUM', 'COLON', 'UNIT', 'SPACE', 'BRKT', 'STYLE', 'PCT', 'LABEL'`);let t=r[a++];for(;pe[n[a]]===1;)t+=r[a++];if(e.push(t),n[a]!==28)return e;a++}},v=e=>{n[a]===6&&t.setTooltip(e,r[a++])},y=e=>{let i=s(6),o=n[a]===6?r[a++]:void 0;n[a]===42?t.setLink(e,i,r[a++]):t.setLink(e,i),o!==void 0&&t.setTooltip(e,o)},b=()=>{let e=n[a];switch(e){case 53:case 27:case 52:case 54:g();return;case 18:m();return;case 22:f();return;case 23:a++;return;case 20:{a++;let e=c();s(21),t.addAnnotation(l(!0),e);return}case 40:{a++;let e=l(!0);t.setClickEvent(e,s(6)),v(e);return}case 41:a++,y(l(!0));return;case 43:{a++;let e=l(!0);if(n[a]===46){a++,y(e);return}let i=s(44);n[a]===45?t.setClickEvent(e,i,r[a++]):t.setClickEvent(e,i),v(e);return}case 47:{a++;let e=s(27);t.setCssStyle(e,_());return}case 48:{a++;let e=s(6);t.setCssClass(e,s(27));return}case 25:case 24:p();return;case 26:{a++;let e=[s(27)];for(;n[a]===28;)a++,e.push(s(27));t.defineClass(e,_());return}case 29:case 30:case 31:case 32:a++,t.setDirection(e===29?`TB`:e===30?`BT`:e===31?`RL`:`LR`);return;case 11:a++,t.setAccTitle(s(12).trim());return;case 13:a++,t.setAccDescription(s(14).trim());return;case 15:t.setAccDescription(r[a++].trim());return}o(`'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'NAMESPACE', 'ANNOTATION_START', 'CLASS', 'MEMBER', 'NOTE_FOR', 'NOTE', 'CLASSDEF', 'direction_tb', 'CALLBACK', 'LINK', 'CLICK', 'STYLE', 'CSSCLASS', 'ALPHA', 'MINUS', 'BQUOTE_STR'`)},ee=n[a]===2;for(ee&&(a++,s(3));b(),!(n[a]!==3||(a++,n[a]===4||n[a]===0)););ee&&s(4),s(0)}function he(e,t,n,r){let i=Int32Array.from(e,(e,t)=>t),a=e=>{for(;i[e]!==e;)i[e]=i[i[e]],e=i[e];return e},o=(e,t)=>{i[a(e)]=a(t)};for(let t=0;t<e.length;t++)e[t].parent>=0&&o(t,e[t].parent);for(let e of t)o(e.src,e.dst);let s=new Map,c=(e,t,n,r=0,i=0)=>{e.left=Math.min(e.left,t-r/2),e.top=Math.min(e.top,n-i/2),e.right=Math.max(e.right,t+r/2),e.bottom=Math.max(e.bottom,n+i/2)};for(let t=0;t<e.length;t++){let n=a(t),r=s.get(n);r||(r={nodes:[],edges:[],left:1/0,top:1/0,right:-1/0,bottom:-1/0},s.set(n,r));let i=e[t];r.nodes.push(i),c(r,i.x,i.y,i.w,i.h)}if(s.size<2)return;for(let e of t){let t=s.get(a(e.src));t.edges.push(e);for(let n=0;n<e.route.length;n+=3)c(t,e.route[n],e.route[n+1]);e.labelW>0&&c(t,e.labelX,e.labelY,e.labelW,e.labelH)}let l=0,u=0,d=0,f=0,p=1/0,m=-1/0,h=[];for(let e of s.values()){let t=e.right-e.left,i=e.bottom-e.top;l>0&&l+t>n&&(u+=d+r,l=0,d=0),h.push(l-e.left,u-e.top),p=Math.min(p,e.left),m=Math.max(m,e.right),f=Math.max(f,l+t),d=Math.max(d,i),l+=t+r}if(f>=m-p)return;let g=0;for(let e of s.values())oe(e.nodes,e.edges,h[g++],h[g++]);return{width:f,height:u+d}}var H=[`aggregation`,`extension`,`composition`,`dependency`,`lollipop`];function U(e){return typeof e==`number`&&H[e]||`none`}function ge(e,t=!0){let n=[],r=[],i=new Map,a=new Map,o=new Map,s=new Map,c=n=>{if(t||n===void 0)return n;let r=[],i=n,a;for(;i;){if(s.has(i)){a=s.get(i);break}let t=e.namespaces.get(i);if(t===void 0)break;if(t.explicit){a=i;break}r.push(i),i=t.parent}for(let e of r)s.set(e,a);return a},l=e=>e===void 0?-1:i.get(e)??-1;for(let r of e.namespaces.values())!t&&!r.explicit||(i.set(r.id,n.length),n.push({id:r.id,label:t?r.label:r.id,isGroup:!0,shape:`rect`,parentId:t?r.parent:void 0,parent:-1}));for(let e of n)e.parent=l(e.parentId);let u=0;for(let t of e.classes.values()){let e=c(t.parent);a.set(t.id,n.length),n.push({id:t.id,label:t.label,isGroup:!1,shape:`classBox`,parentId:e,parent:l(e),classNode:t,colorIndex:u++})}for(let t of e.notes.values()){let e=c(t.parent),i=t.class===void 0?void 0:a.get(t.class);i!==void 0&&r.push({id:`edgeNote${t.index}`,start:t.id,end:n[i].id,source:n.length,target:i,label:void 0,arrowTypeStart:`none`,arrowTypeEnd:`none`,startLabelRight:``,endLabelLeft:``,pattern:`dotted`,classes:`relation`}),n.push({id:t.id,label:t.text,isGroup:!1,shape:`note`,parentId:e,parent:l(e)})}for(let t of e.interfaces){let e=a.get(t.classId);o.set(t.id,n.length),n.push({id:t.id,label:t.label,isGroup:!1,shape:`interface`,parentId:void 0,parent:e===void 0?-1:n[e].parent})}let d=0;for(let t of e.relations){d++;let{type1:e,type2:n}=t.relation,i=e===M.LOLLIPOP&&n===`none`?o:a,s=i===a&&n===M.LOLLIPOP&&e===`none`?o:a;r.push({id:`id_${t.id1}_${t.id2}_${d}`,start:t.id1,end:t.id2,source:i.get(t.id1)??-1,target:s.get(t.id2)??-1,label:t.title,arrowTypeStart:U(e),arrowTypeEnd:U(n),startLabelRight:t.relationTitle1===`none`?``:t.relationTitle1,endLabelLeft:t.relationTitle2===`none`?``:t.relationTitle2,pattern:t.relation.lineType===1?`dashed`:`solid`,classes:`relation`})}return{nodes:n,edges:r}}var W=12,G=16,K=6,q=5;function _e(e){switch(e){case`extension`:return W;case`composition`:case`aggregation`:return G;case`lollipop`:return 2*q;case`dependency`:return m(`arrow_point`)}return 0}function ve(e,t,n,r,i,a){let o=-i,s=r;switch(e){case`extension`:{let e=t-r*W,a=n-i*W;return`<path class="pele-marker" d="M${u(t)},${u(n)}L${u(e+o*K)},${u(a+s*K)}L${u(e-o*K)},${u(a-s*K)}Z" stroke-linejoin="round"/>`}case`composition`:case`aggregation`:{let c=t-r*G/2,l=n-i*G/2,d=K-1;return`<path class="pele-marker" d="M${u(t)},${u(n)}L${u(c+o*d)},${u(l+s*d)}L${u(t-r*G)},${u(n-i*G)}L${u(c-o*d)},${u(l-s*d)}Z" stroke-linejoin="round"${e===`composition`?` fill="${a}"`:``}/>`}case`lollipop`:return`<circle class="pele-marker" cx="${u(t-r*q)}" cy="${u(n-i*q)}" r="${q}"/>`;case`dependency`:return _(`arrow_point`,t,n,r,i,a)}return``}var ye=40,be=16,xe=56,J=20,Se=26,Ce=12,we=8,Te=6,Ee=10,De=64,Oe=8,ke=`var(--_l)`,Ae=new Set([`_self`,`_blank`,`_parent`,`_top`]);function je(e,t,n){let r=e[t];return typeof r==`number`&&r>0?Math.min(r,2e3):n}var Me=[],Ne=[];function Pe(e,t,n){let r=T(e.getDisplayDetails().displayText).trim();return{text:r,width:t.width(r,n,e.classifier===`*`?2:0),classifier:e.classifier}}function Fe(e,t,n){let r=r=>f(n,i=>Ie(e,t,n,r,i));return d(e.direction)?p(n,r):r(!1)}function Ie(d,f,p,m,_){let b=f.class??{},S=ge(d,b.hierarchicalNamespaces!==!1),oe=b.hideEmptyMembersBox===!0,w=p.fontSize??16,E=Math.round(w*.875),D=Math.round(w*.8),O=Math.round(D*1.4),k=p.measurer??ce(p.fontFamily,p.fontFamilyMono),A=p.padding??8,j=(e,t)=>{if(!e.includes(`$$`))return;let n=c(e,!1,k,t,4e3);return n.lines.some(l)?n:void 0},M=e=>e?j(e,D)?.width??k.width(T(e),D,0):0,N=m?`TB`:se(d.direction),P=new Map,le=new Map,F=new Map,ue=e=>{let t=P.get(e);if(t===void 0){let n=s([e]);t=n.shape===``&&n.text===``?``:e.slice(0,e.indexOf(`:`)).trim().toLowerCase(),P.set(e,t)}t!==``&&F.set(t,e)},de=e=>{F.clear();let t=le.get(e.cssClasses);if(t===void 0){for(let t of e.cssClasses.split(` `)){let e=d.styleClasses.get(t);if(e)for(let t of e.styles)for(let e of t.split(`,`))ue(e)}t=[...F],le.set(e.cssClasses,t)}else for(let[e,n]of t)F.set(e,n);for(let t of e.styles)ue(t);return s(F.size===0?Ne:[...F.values()])},fe=new Int32Array(S.nodes.length);for(let e of S.nodes)e.parent>=0&&fe[e.parent]++;let I=new Uint8Array(S.nodes.length);for(let e of S.edges){if(e.source<0||e.target<0)continue;let t=S.nodes[e.source].parent,n=S.nodes[e.target].parent;if(t!==n){for(let e=t;e>=0&&I[e]===0;e=S.nodes[e].parent)I[e]=1;for(let e=n;e>=0&&I[e]===0;e=S.nodes[e].parent)I[e]=1}}let L=[],R=[];S.nodes.forEach((e,t)=>{let n,r;if(e.isGroup){let i=c(e.label,!1,k,w,4e3);n=z(e,i,0,0,w),fe[t]>0?(r=C(0,0),r.isGroup=!0,r.padX=J,r.padTop=i.height>0?i.height+16:J,r.padBottom=J,r.minW=i.width+2*J-12+(I[t]===1&&!_?Math.min(i.width+24,240):0)):(n.w=Math.max(i.width+2*J,80),n.h=i.height+2*J,r=C(n.w,n.h))}else if(e.classNode)n=pe(e,e.classNode),r=C(n.w,n.h);else if(e.shape===`note`){let t=c(e.label,!0,k,E,260);n=z(e,t,Math.max(t.width+2*Ce,40),t.height+2*we,E),r=C(n.w,n.h)}else{let t=c(e.label,!1,k,E,200);n=z(e,t,Math.max(t.width,12)+4,Math.max(t.height,12),E),r=C(n.w,n.h)}r.parent=e.parent,r.seq=t,L.push(n),R.push(r)});function z(e,t,n,r,i){return{node:e,style:s(Ne),label:t,w:n,h:r,loops:0,annotations:Ne,attributes:Me,methods:Me,titleH:0,attributesH:0,fontSize:i}}function pe(e,t){let n=de(t),r=n.fontSize??w,i=Math.round(r*.875),a=Math.round(i*1.5),o=t.type?`<`+x(t.type).replace(/</g,`<`).replace(/>/g,`>`)+`>`:``,s=c(t.label+o,!1,k,r,4e3,1|(n.italic?2:0)),l=t.annotations.length>0?t.annotations.map(e=>j(`«${e.trim()}»`,D)??`«${T(e).trim()}»`):Ne,u=t.members.length>0?t.members.map(e=>Pe(e,k,i)):Me,d=t.methods.length>0?t.methods.map(e=>Pe(e,k,i)):Me,f=s.width,p=0;for(let e of l)f=Math.max(f,typeof e==`string`?k.width(e,D,0):e.width),p+=typeof e==`string`?O:Math.max(O,e.height);for(let e of u)f=Math.max(f,e.width);for(let e of d)f=Math.max(f,e.width);let m=!(oe&&u.length===0&&d.length===0),h=e=>m?e>0?2*Te+e*a:Ee:0,g=2*we+p+Math.max(s.height,Math.round(r*1.5)),_=h(u.length);return{node:e,style:n,label:s,w:Math.max(f+2*Ce,De),h:g+_+h(d.length),loops:0,annotations:l,attributes:u,methods:d,titleH:g,attributesH:_,fontSize:r}}let B=[],V=[],me=[],H=[],U=[],W=new Float64Array(L.length*4),G=(e,t,n)=>{W[e*4+t]++,n>W[e*4+t+1]&&(W[e*4+t+1]=n)};for(let e of S.edges){if(e.source<0||e.target<0)continue;let t=c(e.label,!0,k,E,200),n=M(e.startLabelRight),r=M(e.endLabelLeft);e.source===e.target?(L[e.source].loops++,R[e.source].w+=2*(Se+(t.width>0?t.width+12:0))):(G(e.source,0,n),G(e.target,2,r)),H.push(n),U.push(r),V.push(e),me.push(t),B.push({src:e.source,dst:e.target,minlen:1,labelW:t.width>0?t.width+12:0,labelH:t.height>0?t.height+4:0,route:[],labelX:0,labelY:0})}if(N===`TB`||N===`BT`)for(let e=0;e<L.length;e++){if(!L[e].node.classNode)continue;let t=0;for(let n=0;n<4;n+=2){let r=W[e*4+n],i=W[e*4+n+1];r>1&&(t=Math.max(t,(r-1)*(i>0?i+24:14)+24))}t=Math.min(t,480),t>L[e].w&&(R[e].w+=t-L[e].w,L[e].w=t)}let K=!1;for(let e=0;e<V.length&&!K;e++)K=H[e]>0||U[e]>0;let q=0;if(N===`TB`||N===`BT`){let e=e=>e?Math.max(O,j(e,D)?.height??0):0;for(let t of V)q=Math.max(q,e(t.startLabelRight)+e(t.endLabelLeft)-2*O)}let Fe=ae(R,B,N,{nodeSep:je(b,`nodeSpacing`,ye),edgeSep:be,rankSep:je(b,`rankSpacing`,K?xe+16:xe)+q,portSep:20,apart:!0}),Ie=new Map,Y=[],Le=(e,t,n,r,i)=>{let a=e.route,o=R[n],s=y(a,t,o);if(s<0)return;let c=(o.w-L[n].w)/2;s===1?a[t]-=c:s===3&&(a[t]+=c);let l=s&1,u=a[(t===0?3:t-3)+l],d=u-a[t+l],f={route:a,at:t,toward:u,order:i,room:r,side:s,after:l?d>0:d>=0},p=n*4+s,m=Ie.get(p);return m?m.push(f):Ie.set(p,[f]),f},Re=[],ze=[];for(let e=0;e<B.length;e++){let t=B[e],n=t.src!==t.dst&&t.route.length>=6;Re.push(n?Le(t,0,t.src,H[e],e):void 0),ze.push(n?Le(t,t.route.length-3,t.dst,U[e],e):void 0)}let Be=(e,t,n)=>{for(let r=R[e].parent,i=0;r>=0&&i<1e4;r=R[r].parent,i++){let e=R[r],i=Math.abs(t-e.x),a=Math.abs(n-e.y);if(Math.abs(a-e.h/2)<.5&&i<=e.w/2+.5||Math.abs(i-e.w/2)<.5&&a<=e.h/2+.5)return!0}return!1},Ve=[];for(let[e,t]of Ie){if(t.length<2)continue;let n=e>>2,r=e&1,i=r?L[n].h:L[n].w;t.sort((e,t)=>e.toward-t.toward||e.order-t.order);let a=0;for(let e=0;e+1<t.length;e++){let n=t[e],i=t[e+1],o=r?20:24;n.room>0&&n.after&&(o+=r?O+6:n.room),i.room>0&&!i.after&&(o+=r?O+6:i.room),Ve[e]=o,a+=o}let o=Math.min(1,(i-24)/a);if(o<=0)continue;let s=(r?R[n].y:R[n].x)-a*o/2;for(let e=0;e<t.length;e++){let{route:i,at:a}=t[e],c=a===0?3:-3,l=a+c,u=-1;for(let e=l;e>=0&&e<i.length&&Math.abs(i[e+r]-i[l+r])<.5;e+=c)if(Be(n,i[e],i[e+1])){u=e;break}if(u>=0&&Math.abs(i[l+r]-s)<=24)for(let e=l;e!==u+c;e+=c)i[e+r]=s;i[a+r]=s,s+=Ve[e]*o}}let He=(e,t,n,r)=>{if(t===void 0||n<=0)return;let i=t.side&1,a=r?0:e.length-3,o=a+1-i,s=Math.abs(e[(r?3:a-3)+1-i]-e[o]),c=Math.min(i?n+10:O+6,s*.35);if(c<4)return;let l=[e[a],e[a+1],e[a+2]];l[1-i]+=(t.side===0||t.side===3?-1:1)*c,e.splice(r?3:a,0,l[0],l[1],l[2])};for(let e=0;e<B.length;e++)He(B[e].route,Re[e],H[e],!0),He(B[e].route,ze[e],U[e],!1);let X=0,Z=0,Ue=Fe.width,We=Fe.height,Ge=(e,t,n,r,i,a,o)=>{if(!t)return;let s=j(t,D),c=s?Math.max(O,s.height):O,l=r,u=i;a&1?(l+=(a===3?-1:1)*(5+n/2),u+=(o?1:-1)*(7+c/2)):(l+=(o?1:-1)*(9+n/2),u+=(a===0?-1:1)*(3+c/2)),Y.push({text:T(t),math:s,x:l,y:u,w:n,h:c,parent:e}),X=Math.min(X,l-n/2),Ue=Math.max(Ue,l+n/2),Z=Math.min(Z,u-c/2),We=Math.max(We,u+c/2)},Ke=new Map,qe=new Int32Array(B.length);for(let e=0;e<B.length;e++){let t=B[e],n=V[e],r=t.route;if(t.src===t.dst){let r=Ke.get(t.src)??0;Ke.set(t.src,r+1),qe[e]=r;let i=R[t.src],a=L[t.src],o=i.x+a.w/2,s=Math.min(a.h/2-4,8+r*6);Ge(t.src,n.startLabelRight,H[e],o,i.y-s,1,!1),Ge(t.dst,n.endLabelLeft,U[e],o,i.y+s,1,!0),t.labelX=i.x+a.w/2+Se+r*8+4+t.labelW/2,t.labelY=i.y}else if(r.length>=6){let i=r.length-3,a=Re[e],o=ze[e];Ge(t.src,n.startLabelRight,H[e],r[0],r[1],a?a.side:2,!a||a.after),Ge(t.dst,n.endLabelLeft,U[e],r[i],r[i+1],o?o.side:0,!o||o.after)}}let Je=p.maxWidth;if(Je!==void 0&&Je>0&&Ue-X+2*A>Je){let e=Y.map(e=>({...C(e.w,e.h,e.parent),x:e.x,y:e.y})),t=he(R.concat(e),B,Math.max(1,Je-2*A),je(b,`nodeSpacing`,ye));t&&(Y.forEach((t,n)=>{t.x=e[n].x,t.y=e[n].y}),X=Z=0,Ue=t.width,We=t.height)}let Q=A-X,$=A-Z,Ye=Math.ceil(Ue-X+2*A),Xe=Math.ceil(We-Z+2*A),Ze=[],Qe=new Map;if(S.nodes.length>0&&S.nodes[0].isGroup)for(let e of B)re(Qe,e.route);let $e=``,et=``,tt=``;for(let e=0;e<L.length;e++){let t=L[e],n=R[e],r=t.node,s=n.x+Q,c=n.y+$,l=i(r.id),d=n.isGroup?n.w:t.w,f=n.isGroup?n.h:t.h;if(r.isGroup){let r=n.isGroup?ne(n,t.label.width,Qe,J):n.x,i=c-f/2+8+t.label.height/2,p=` class="pele-cluster-label" fill="var(--_m)"`,m=n.isGroup&&te(n,t.label.width,r,Qe);m&&(et+=ie(t.label,r+Q,i,p,l,S.nodes,e)),$e+=`<g class="pele-cluster pele-namespace" data-id="${l}"><rect x="${u(s-d/2)}" y="${u(c-f/2)}" width="${u(d)}" height="${u(f)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${o}/>`+(m?``:a(t.label,r+Q,i,p))+`</g>`;continue}let m=` transform="translate(${u(s)},${u(c)})"`;if(r.classNode)tt+=nt(t,r.classNode,l,m);else if(r.shape===`note`){let e=d/2,n=-f/2;tt+=`<g class="pele-node pele-note" data-id="${l}"${m}><path d="M${u(-e)},${u(n)}H${u(e-Oe)}L${u(e)},${u(n+Oe)}V${u(-n)}H${u(-e)}Z" fill="var(--_a)" stroke="var(--_b)" stroke-linejoin="round"/><path d="M${u(e-Oe)},${u(n)}V${u(n+Oe)}H${u(e)}" fill="none" stroke="var(--_b)" stroke-linejoin="round"/>`+a(t.label,0,0,` class="pele-label" font-size="${E}"`,p.icons)+`</g>`}else tt+=`<g class="pele-node pele-interface" data-id="${l}"${m}>`+a(t.label,0,0,` class="pele-label" font-size="${E}"`,p.icons)+`</g>`}function nt(e,o,s,c){let{w:l,h:d,style:f}=e,m=-l/2,h=-d/2,g=Math.round(e.fontSize*.875),_=Math.round(g*1.5),v=`<rect x="${u(m)}" y="${u(h)}" width="${u(l)}" height="${u(d)}" fill="var(--_s)" stroke="var(--_b)"${r(f.shape)}/>`,y=h+e.titleH,b=y+e.attributesH;if(d>e.titleH){let e=f.stroke?` style="stroke:${t(f.stroke)}"`:``;v+=`<path class="pele-divider" d="M${u(m)},${u(y)}H${u(-m)}M${u(m)},${u(b)}H${u(-m)}" fill="none" stroke="var(--_b)"${e}/>`}let x=h+we;for(let n of e.annotations)if(typeof n==`string`)v+=`<text class="pele-annotation" x="0" y="${u(x+O/2+D*.35)}" text-anchor="middle" font-size="${D}" fill="var(--_m)">${t(n)}</text>`,x+=O;else{let e=Math.max(O,n.height);v+=a(n,0,x+e/2,` class="pele-annotation" font-size="${D}" fill="var(--_m)"`,p.icons),x+=e}let S=e.fontSize===w?``:` font-size="${u(e.fontSize)}"`;v+=a(e.label,0,(x+y-we)/2,` class="pele-label"${S} font-weight="var(--_hw)"${f.text}`,p.icons);let te=(e,n,r)=>{let i=``,a=r+Te+_/2+g*.35;for(let r of e){let e=r.classifier===`$`?` pele-static"${f.text?f.text.slice(0,-1)+`text-decoration:underline"`:` style="text-decoration:underline"`}`:r.classifier===`*`?` pele-abstract" font-style="italic"${f.text}`:`"${f.text}`;i+=`<text class="pele-member pele-${n}${e} x="${u(m+Ce)}" y="${u(a)}">${t(r.text)}</text>`,a+=_}return i};return(e.attributes.length>0||e.methods.length>0)&&(v+=`<g class="pele-members" font-size="${g}">${te(e.attributes,`attribute`,y)}${te(e.methods,`method`,b)}</g>`),o.tooltip&&(v=`<title>${i(o.tooltip)}</title>`+v),o.link&&(v=ee(v,o.link,o.id,Ze,p,o.linkTarget&&Ae.has(o.linkTarget)?` target="${o.linkTarget}"`:``)),`<g class="pele-node pele-class${n(o.cssClasses.replace(/^default\s?/,``))}" data-id="${s}"${c}>${v}</g>`}let rt=``,it=``;for(let e=0;e<B.length;e++){let t=B[e],n=V[e],r=me[e],a=n.arrowTypeStart,o=n.arrowTypeEnd,s=_e(a),c=_e(o),l;if(t.src===t.dst){let n=R[t.src],r=L[t.src],i=qe[e],a=n.x+Q+r.w/2,o=n.y+$,d=Math.min(r.h/2-4,8+i*6),f=Se+i*8;l={d:`M${u(a+s)},${u(o-d)}C${u(a+f+s)},${u(o-d)} ${u(a+f+c)},${u(o+d)} ${u(a+c)},${u(o+d)}`,sx:a,sy:o-d,sdx:-1,sdy:0,ex:a,ey:o+d,edx:-1,edy:0}}else{let e=t.route;for(let t=0;t<e.length;t+=3)e[t]+=Q,e[t+1]+=$;l=g(e,void 0,s,c)}let d=n.pattern===`dashed`?` stroke-dasharray="6 4"`:n.pattern===`dotted`?` stroke-dasharray="2 4"`:``;if(rt+=`<g class="pele-edge${n.pattern===`dotted`?` pele-note-edge`:` pele-relation`}" data-id="${i(n.id)}"><path d="${l.d}"${d}/>`+ve(a,l.sx,l.sy,l.sdx,l.sdy,ke)+ve(o,l.ex,l.ey,l.edx,l.edy,ke)+`</g>`,r.width>0){let e=t.labelX+Q,i=t.labelY+$;it+=h(n.id,r,e,i,``,p.icons)}}let at=``;for(let e of Y)at+=e.math?a(e.math,e.x+Q,e.y+$,` class="pele-cardinality"`,p.icons):`<text class="pele-cardinality" x="${u(e.x+Q)}" y="${u(e.y+$+D*.35)}" text-anchor="middle">${t(e.text)}</text>`;let ot=v(d.title,k,w,A,Ye,Xe,($e?`<g class="pele-clusters">${$e}</g>`:``)+(rt?`<g class="pele-edges" fill="none" stroke="${ke}" stroke-linecap="round">${rt}</g>`:``)+(et?`<g class="pele-cluster-titles">${et}</g>`:``)+(it?`<g class="pele-edge-labels" font-size="${E}">${it}</g>`:``)+(at?`<g class="pele-cardinalities" font-size="${D}" fill="var(--_m)">${at}</g>`:``)+`<g class="pele-nodes">${tt}</g>`);return{svg:e(`class`,ot.width,ot.height,w,p,d,ot.content),width:ot.width,height:ot.height,links:Ze}}var Y={type:`class`,math:!0,parse(e,t,n){let r=new F;return n&&(r.title=n),me(e,r),r},render:Fe};export{Y as classDiagram};
|