@fabiofiorita/porcelain 0.63.3 → 0.63.4
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/README.md +1 -1
- package/main/daemon/server.js +30 -31
- package/package.json +1 -1
- package/renderer/assets/{browser-D-Rg-BIo.js → browser-DjHhN4s0.js} +1 -1
- package/renderer/assets/{canvas-view-Cz453A93.js → canvas-view-DhzIJ8ZV.js} +1 -1
- package/renderer/assets/{changeset-view-DHcK8sLz.js → changeset-view-yBQtdgrZ.js} +1 -1
- package/renderer/assets/{commit-view-CrMso5cW.js → commit-view-Cz3IR74x.js} +1 -1
- package/renderer/assets/{diff-mode-toggle-3TFZaE1Q.js → diff-mode-toggle-DTeqhuLC.js} +1 -1
- package/renderer/assets/{diff-view-Pw0xhH0H.js → diff-view-DqanYaSe.js} +1 -1
- package/renderer/assets/{file-content-B6nyA731.js → file-content-BX3OYiQC.js} +1 -1
- package/renderer/assets/{html-view-D6rirPQ3.js → html-view-BPOrX4do.js} +1 -1
- package/renderer/assets/{hunks-view-B-yEGm1C.js → hunks-view-CXQMQon9.js} +1 -1
- package/renderer/assets/index-CuWbxCsX.js +282 -0
- package/renderer/assets/{search-view-CNcS4ke0.js → search-view-BDExg3Xl.js} +1 -1
- package/renderer/assets/{surface-CcEyZSbi.js → surface-BsSU1Fob.js} +1 -1
- package/renderer/assets/{unfold-vertical-CFNk2zKI.js → unfold-vertical-CIpACs4g.js} +1 -1
- package/renderer/assets/{virtual-rows-BJzRJBis.js → virtual-rows-CsZNdhfp.js} +1 -1
- package/renderer/index.html +1 -1
- package/renderer/assets/index-FyOkjrWd.js +0 -282
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as V,r as ke,ad as Qr,bn as Gr,B as Xr,b5 as Yr,aq as Jr,ao as Kr,a8 as Zr,ap as ei,ay as ti,bo as Bn,bp as Ft,bq as ni,br as ri,bs as ii,bt as li,bu as oi,bv as Jt,a7 as Kt,n as ai,a6 as ui,T as jn}from"./index-
|
|
1
|
+
import{j as V,r as ke,ad as Qr,bn as Gr,B as Xr,b5 as Yr,aq as Jr,ao as Kr,a8 as Zr,ap as ei,ay as ti,bo as Bn,bp as Ft,bq as ni,br as ri,bs as ii,bt as li,bu as oi,bv as Jt,a7 as Kt,n as ai,a6 as ui,T as jn}from"./index-CuWbxCsX.js";const si={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};function bt(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(bt).join(""):ke.isValidElement(e)?bt(e.props.children):""}function ci(e){const n=ke.Children.toArray(e);if(n.length!==1)return null;const t=n[0];return!ke.isValidElement(t)||t.type!=="code"?null:{className:t.props.className,code:bt(t.props.children)}}const fi=/(?:^|\s)language-(\S+)/;function hi(e){return e?.match(fi)?.[1]??null}function pi({code:e,language:n}){const[t,r]=ke.useState(!1),i=e.replace(/\n$/,""),o=i.split(`
|
|
2
2
|
`),l=Qr(i,Gr(n)),a=async()=>{await ei(i),r(!0),setTimeout(()=>r(!1),1500)};return V.jsxs("div",{className:"not-prose overflow-hidden rounded-lg border border-border bg-muted/40",children:[V.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[V.jsx("span",{className:"truncate font-mono text-2xs text-muted-foreground",children:n??"text"}),V.jsx(Xr,{type:"button",variant:"ghost",size:"icon-xs",className:"text-muted-foreground hover:text-foreground",onClick:()=>{Kr(()=>a(),u=>{ti("Copy code",u)})},"aria-label":t?"Copied":"Copy code",children:t?V.jsx(Yr,{className:"size-3"}):V.jsx(Jr,{className:"size-3"})})]}),V.jsx("div",{className:"overflow-x-auto px-3 py-2.5",children:V.jsx("code",{className:"grid font-mono text-xs-minus leading-relaxed text-foreground/90",children:o.map((u,s)=>V.jsx(Zr,{tokens:l?.[s]??null,text:u},s))})})]})}function mi({node:e,children:n,...t}){const r=ci(n);return r?V.jsx(pi,{code:r.code,language:hi(r.className)}):V.jsx("pre",{...t,children:n})}const gi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,di=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi={};function Zt(e,n){return(xi.jsx?di:gi).test(e)}var Se={},rt,en;function ki(){if(en)return rt;en=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
3
3
|
`,s="/",f="*",c="",p="comment",h="declaration";function d(C,x){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];x=x||{};var E=1,S=1;function L(_){var A=_.match(n);A&&(E+=A.length);var H=_.lastIndexOf(u);S=~H?_.length-H:S+_.length}function D(){var _={line:E,column:S};return function(A){return A.position=new b(_),M(),A}}function b(_){this.start=_,this.end={line:E,column:S},this.source=x.source}b.prototype.content=C;function v(_){var A=new Error(x.source+":"+E+":"+S+": "+_);if(A.reason=_,A.filename=x.source,A.line=E,A.column=S,A.source=C,!x.silent)throw A}function B(_){var A=_.exec(C);if(A){var H=A[0];return L(H),C=C.slice(H.length),A}}function M(){B(t)}function k(_){var A;for(_=_||[];A=T();)A!==!1&&_.push(A);return _}function T(){var _=D();if(!(s!=C.charAt(0)||f!=C.charAt(1))){for(var A=2;c!=C.charAt(A)&&(f!=C.charAt(A)||s!=C.charAt(A+1));)++A;if(A+=2,c===C.charAt(A-1))return v("End of comment missing");var H=C.slice(2,A-2);return S+=2,L(H),C=C.slice(A),S+=2,_({type:p,comment:H})}}function z(){var _=D(),A=B(r);if(A){if(T(),!B(i))return v("property missing ':'");var H=B(o),U=_({type:h,property:w(A[0].replace(e,c)),value:H?w(H[0].replace(e,c)):c});return B(l),U}}function j(){var _=[];k(_);for(var A;A=z();)A!==!1&&(_.push(A),k(_));return _}return M(),j()}function w(C){return C?C.replace(a,c):c}return rt=d,rt}var tn;function yi(){if(tn)return Se;tn=1;var e=Se&&Se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Se,"__esModule",{value:!0}),Se.default=t;const n=e(ki());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return Se}var Pe={},nn;function bi(){if(nn)return Pe;nn=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||t.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,l))};return Pe.camelCase=u,Pe}var Le,rn;function wi(){if(rn)return Le;rn=1;var e=Le&&Le.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(yi()),t=bi();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(l[(0,t.camelCase)(a,o)]=u)}),l}return r.default=r,Le=r,Le}var Ci=wi();const Si=Bn(Ci),Hn=$n("end"),_t=$n("start");function $n(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ei(e){const n=_t(e),t=Hn(e);if(n&&t)return{start:n,end:t}}function ve(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ln(e.position):"start"in e||"end"in e?ln(e):"line"in e||"column"in e?wt(e):""}function wt(e){return on(e&&e.line)+":"+on(e&&e.column)}function ln(e){return wt(e&&e.start)+"-"+wt(e&&e.end)}function on(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ve(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Pt={}.hasOwnProperty,Ii=new Map,Ai=/[A-Z]/g,Ti=new Set(["table","tbody","thead","tfoot","tr"]),zi=new Set(["td","th"]),qn="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Fi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Oi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ri(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Ft:ni,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Vn(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Vn(e,n,t){if(n.type==="element")return _i(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Pi(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Di(e,n,t);if(n.type==="mdxjsEsm")return Li(e,n);if(n.type==="root")return Ni(e,n,t);if(n.type==="text")return vi(e,n)}function _i(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ft,e.schema=i),e.ancestors.push(n);const o=Wn(e,n.tagName,!1),l=Mi(e,n);let a=Dt(e,n);return Ti.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!ri(u):!0})),Un(e,l,o,n),Lt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Pi(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Me(e,n.position)}function Li(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Me(e,n.position)}function Di(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Ft,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Wn(e,n.name,!0),l=Bi(e,n),a=Dt(e,n);return Un(e,l,o,n),Lt(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Ni(e,n,t){const r={};return Lt(r,Dt(e,n)),e.create(n,e.Fragment,r,t)}function vi(e,n){return n.value}function Un(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Lt(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Ri(e,n,t){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?t:n;return a?s(o,l,a):s(o,l)}}function Oi(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),u=_t(r);return n(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Mi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Pt.call(n.properties,i)){const o=ji(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&zi.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Bi(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Me(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Me(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function Dt(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Ii;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=Vn(e,o,l);a!==void 0&&t.push(a)}return t}function ji(e,n,t){const r=ii(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?li(t):oi(t)),r.property==="style"){let i=typeof t=="object"?t:Hi(e,String(t));return e.stylePropertyNameCase==="css"&&(i=$i(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?si[r.property]||r.property:r.attribute,t]}}function Hi(e,n){try{return Si(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new G("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=qn+"#cannot-parse-style-attribute",i}}function Wn(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=Zt(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Zt(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Pt.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Me(e)}function Me(e,n){const t=new G("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=qn+"#cannot-handle-mdx-estrees-without-createevaluater",t}function $i(e){const n={};let t;for(t in e)Pt.call(e,t)&&(n[qi(t)]=e[t]);return n}function qi(e){let n=e.replace(Ai,Vi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Vi(e){return"-"+e.toLowerCase()}const it={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Ui={};function Nt(e,n){const t=Ui,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Qn(e,r,i)}function Qn(e,n,t){if(Wi(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return an(e.children,n,t)}return Array.isArray(e)?an(e,n,t):""}function an(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Qn(e[i],n,t);return r.join("")}function Wi(e){return!!(e&&typeof e=="object")}const un=document.createElement("i");function vt(e){const n="&"+e+";";un.innerHTML=n;const t=un.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function K(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function Z(e,n){return e.length>0?(K(e,e.length,0,n),e):n}const sn={}.hasOwnProperty;function Gn(e){const n={};let t=-1;for(;++t<e.length;)Qi(n,e[t]);return n}function Qi(e,n){let t;for(t in n){const i=(sn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){sn.call(i,l)||(i[l]=[]);const a=o[l];Gi(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Gi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);K(e,0,0,r)}function Xn(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ie(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const X=me(/[A-Za-z]/),Q=me(/[\dA-Za-z]/),Xi=me(/[#-'*+\--9=?A-Z^-~]/);function Ge(e){return e!==null&&(e<32||e===127)}const Ct=me(/\d/),Yi=me(/[\dA-Fa-f]/),Ji=me(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function N(e){return e===-2||e===-1||e===32}const Ke=me(new RegExp("\\p{P}|\\p{S}","u")),ye=me(/\s/);function me(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Te(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&Q(e.charCodeAt(t+1))&&Q(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function O(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return N(u)?(e.enter(t),a(u)):n(u)}function a(u){return N(u)&&o++<i?(e.consume(u),a):(e.exit(t),n(u))}}const Ki={tokenize:Zi};function Zi(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),O(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return F(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const el={tokenize:tl},cn={tokenize:nl};function tl(e){const n=this,t=[];let r=0,i,o,l;return a;function a(S){if(r<t.length){const L=t[r];return n.containerState=L[1],e.attempt(L[0].continuation,u,s)(S)}return s(S)}function u(S){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&E();const L=n.events.length;let D=L,b;for(;D--;)if(n.events[D][0]==="exit"&&n.events[D][1].type==="chunkFlow"){b=n.events[D][1].end;break}x(r);let v=L;for(;v<n.events.length;)n.events[v][1].end={...b},v++;return K(n.events,D+1,0,n.events.slice(L)),n.events.length=v,s(S)}return a(S)}function s(S){if(r===t.length){if(!i)return p(S);if(i.currentConstruct&&i.currentConstruct.concrete)return d(S);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(cn,f,c)(S)}function f(S){return i&&E(),x(r),p(S)}function c(S){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,d(S)}function p(S){return n.containerState={},e.attempt(cn,h,d)(S)}function h(S){return r++,t.push([n.currentConstruct,n.containerState]),p(S)}function d(S){if(S===null){i&&E(),x(0),e.consume(S);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(S)}function w(S){if(S===null){C(e.exit("chunkFlow"),!0),x(0),e.consume(S);return}return F(S)?(e.consume(S),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(S),w)}function C(S,L){const D=n.sliceStream(S);if(L&&D.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(D),n.parser.lazy[S.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const v=n.events.length;let B=v,M,k;for(;B--;)if(n.events[B][0]==="exit"&&n.events[B][1].type==="chunkFlow"){if(M){k=n.events[B][1].end;break}M=!0}for(x(r),b=v;b<n.events.length;)n.events[b][1].end={...k},b++;K(n.events,B+1,0,n.events.slice(v)),n.events.length=b}}function x(S){let L=t.length;for(;L-- >S;){const D=t[L];n.containerState=D[1],D[0].exit.call(n,e)}t.length=S}function E(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function nl(e,n,t){return O(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ae(e){if(e===null||q(e)||ye(e))return 1;if(Ke(e))return 2}function Ze(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const St={name:"attention",resolveAll:rl,tokenize:il};function rl(e,n){let t=-1,r,i,o,l,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};fn(c,-u),fn(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=Z(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=Z(s,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),s=Z(s,Ze(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=Z(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=Z(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,K(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function il(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ae(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Ae(u),c=!f||f===2&&i||t.includes(u),p=!i||i===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),n(u)}}function fn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ll={name:"autolink",tokenize:ol};function ol(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return X(h)?(e.consume(h),l):h===64?t(h):s(h)}function l(h){return h===43||h===45||h===46||Q(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||Q(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||Ge(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):Xi(h)?(e.consume(h),s):t(h)}function f(h){return Q(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||Q(h))&&r++<63){const d=h===45?p:c;return e.consume(h),d}return t(h)}}const je={partial:!0,tokenize:al};function al(e,n,t){return r;function r(o){return N(o)?O(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||F(o)?n(o):t(o)}}const Yn={continuation:{tokenize:sl},exit:cl,name:"blockQuote",tokenize:ul};function ul(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return N(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function sl(e,n,t){const r=this;return i;function i(l){return N(l)?O(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Yn,n,t)(l)}}function cl(e){e.exit("blockQuote")}const Jn={name:"characterEscape",tokenize:fl};function fl(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Ji(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const Kn={name:"characterReference",tokenize:hl};function hl(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=Q,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Yi,f):(e.enter("characterReferenceValue"),o=7,l=Ct,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===Q&&!vt(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const hn={partial:!0,tokenize:ml},pn={concrete:!0,name:"codeFenced",tokenize:pl};function pl(e,n,t){const r=this,i={partial:!0,tokenize:D};let o=0,l=0,a;return u;function u(b){return s(b)}function s(b){const v=r.events[r.events.length-1];return o=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?t(b):(e.exit("codeFencedFenceSequence"),N(b)?O(e,c,"whitespace")(b):c(b))}function c(b){return b===null||F(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(hn,w,L)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||F(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):N(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),O(e,h,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),p)}function h(b){return b===null||F(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===null||F(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?t(b):(e.consume(b),d)}function w(b){return e.attempt(i,L,C)(b)}function C(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),x}function x(b){return o>0&&N(b)?O(e,E,"linePrefix",o+1)(b):E(b)}function E(b){return b===null||F(b)?e.check(hn,w,L)(b):(e.enter("codeFlowValue"),S(b))}function S(b){return b===null||F(b)?(e.exit("codeFlowValue"),E(b)):(e.consume(b),S)}function L(b){return e.exit("codeFenced"),n(b)}function D(b,v,B){let M=0;return k;function k(A){return b.enter("lineEnding"),b.consume(A),b.exit("lineEnding"),T}function T(A){return b.enter("codeFencedFence"),N(A)?O(b,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):z(A)}function z(A){return A===a?(b.enter("codeFencedFenceSequence"),j(A)):B(A)}function j(A){return A===a?(M++,b.consume(A),j):M>=l?(b.exit("codeFencedFenceSequence"),N(A)?O(b,_,"whitespace")(A):_(A)):B(A)}function _(A){return A===null||F(A)?(b.exit("codeFencedFence"),v(A)):B(A)}}}function ml(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const lt={name:"codeIndented",tokenize:dl},gl={partial:!0,tokenize:xl};function dl(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),O(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):t(s)}function l(s){return s===null?u(s):F(s)?e.attempt(gl,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||F(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function xl(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):F(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):O(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):F(l)?i(l):t(l)}}const kl={name:"codeText",previous:bl,resolve:yl,tokenize:wl};function yl(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function bl(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wl(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):F(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||F(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",s(c))}}class Cl{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&De(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),De(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),De(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);De(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);De(this.left,t.reverse())}}}function De(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Zn(e){const n={};let t=-1,r,i,o,l,a,u,s;const f=new Cl(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Sl(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return K(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Sl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=t,d=0,w=0;const C=[w];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(w=p+1,C.push(w),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):C.pop(),p=C.length;p--;){const x=a.slice(C[p],C[p+1]),E=o.pop();u.push([E,E+x.length-1]),e.splice(E,2,x)}for(u.reverse(),p=-1;++p<u.length;)s[d+u[p][0]]=d+u[p][1],d+=u[p][1]-u[p][0]-1;return s}const El={resolve:Al,tokenize:Tl},Il={partial:!0,tokenize:zl};function Al(e){return Zn(e),e}function Tl(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):F(a)?e.check(Il,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function zl(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),O(e,o,"linePrefix")}function o(l){if(l===null||F(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function er(e,n,t,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||Ge(x)?t(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||F(x)?t(x):(e.consume(x),x===92?d:h)}function d(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function w(x){return!f&&(x===null||x===41||q(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(x)):f<s&&x===40?(e.consume(x),f++,w):x===41?(e.consume(x),f--,w):x===null||x===32||x===40||Ge(x)?t(x):(e.consume(x),x===92?C:w)}function C(x){return x===40||x===41||x===92?(e.consume(x),w):w(x)}}function tr(e,n,t,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):F(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||F(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!N(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function nr(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):t(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?t(p):F(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),O(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||F(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Re(e,n){let t;return r;function r(i){return F(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):N(i)?O(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Fl={name:"definition",tokenize:Pl},_l={partial:!0,tokenize:Ll};function Pl(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return tr.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ie(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return q(h)?Re(e,s)(h):s(h)}function s(h){return er(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(_l,c,c)(h)}function c(h){return N(h)?O(e,p,"whitespace")(h):p(h)}function p(h){return h===null||F(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Ll(e,n,t){return r;function r(a){return q(a)?Re(e,i)(a):t(a)}function i(a){return nr(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return N(a)?O(e,l,"whitespace")(a):l(a)}function l(a){return a===null||F(a)?n(a):t(a)}}const Dl={name:"hardBreakEscape",tokenize:Nl};function Nl(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return F(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const vl={name:"headingAtx",resolve:Rl,tokenize:Ol};function Rl(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},K(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function Ol(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||q(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||F(f)?(e.exit("atxHeading"),n(f)):N(f)?O(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||q(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Ml=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mn=["pre","script","style","textarea"],Bl={concrete:!0,name:"htmlFlow",resolveTo:$l,tokenize:ql},jl={partial:!0,tokenize:Ul},Hl={partial:!0,tokenize:Vl};function $l(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function ql(e,n,t){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,w):g===63?(e.consume(g),i=3,r.interrupt?n:m):X(g)?(e.consume(g),l=String.fromCharCode(g),C):t(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):X(g)?(e.consume(g),i=4,r.interrupt?n:m):t(g)}function h(g){return g===45?(e.consume(g),r.interrupt?n:m):t(g)}function d(g){const ne="CDATA[";return g===ne.charCodeAt(a++)?(e.consume(g),a===ne.length?r.interrupt?n:z:d):t(g)}function w(g){return X(g)?(e.consume(g),l=String.fromCharCode(g),C):t(g)}function C(g){if(g===null||g===47||g===62||q(g)){const ne=g===47,ge=l.toLowerCase();return!ne&&!o&&mn.includes(ge)?(i=1,r.interrupt?n(g):z(g)):Ml.includes(l.toLowerCase())?(i=6,ne?(e.consume(g),x):r.interrupt?n(g):z(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):o?E(g):S(g))}return g===45||Q(g)?(e.consume(g),l+=String.fromCharCode(g),C):t(g)}function x(g){return g===62?(e.consume(g),r.interrupt?n:z):t(g)}function E(g){return N(g)?(e.consume(g),E):k(g)}function S(g){return g===47?(e.consume(g),k):g===58||g===95||X(g)?(e.consume(g),L):N(g)?(e.consume(g),S):k(g)}function L(g){return g===45||g===46||g===58||g===95||Q(g)?(e.consume(g),L):D(g)}function D(g){return g===61?(e.consume(g),b):N(g)?(e.consume(g),D):S(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),u=g,v):N(g)?(e.consume(g),b):B(g)}function v(g){return g===u?(e.consume(g),u=null,M):g===null||F(g)?t(g):(e.consume(g),v)}function B(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||q(g)?D(g):(e.consume(g),B)}function M(g){return g===47||g===62||N(g)?S(g):t(g)}function k(g){return g===62?(e.consume(g),T):t(g)}function T(g){return g===null||F(g)?z(g):N(g)?(e.consume(g),T):t(g)}function z(g){return g===45&&i===2?(e.consume(g),H):g===60&&i===1?(e.consume(g),U):g===62&&i===4?(e.consume(g),te):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),ae):F(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(jl,ue,j)(g)):g===null||F(g)?(e.exit("htmlFlowData"),j(g)):(e.consume(g),z)}function j(g){return e.check(Hl,_,ue)(g)}function _(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),A}function A(g){return g===null||F(g)?j(g):(e.enter("htmlFlowData"),z(g))}function H(g){return g===45?(e.consume(g),m):z(g)}function U(g){return g===47?(e.consume(g),l="",ee):z(g)}function ee(g){if(g===62){const ne=l.toLowerCase();return mn.includes(ne)?(e.consume(g),te):z(g)}return X(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),ee):z(g)}function ae(g){return g===93?(e.consume(g),m):z(g)}function m(g){return g===62?(e.consume(g),te):g===45&&i===2?(e.consume(g),m):z(g)}function te(g){return g===null||F(g)?(e.exit("htmlFlowData"),ue(g)):(e.consume(g),te)}function ue(g){return e.exit("htmlFlow"),n(g)}}function Vl(e,n,t){const r=this;return i;function i(l){return F(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Ul(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(je,n,t)}}const Wl={name:"htmlText",tokenize:Ql};function Ql(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),D):m===63?(e.consume(m),S):X(m)?(e.consume(m),B):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):X(m)?(e.consume(m),E):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):F(m)?(l=c,U(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?H(m):m===45?p(m):c(m)}function d(m){const te="CDATA[";return m===te.charCodeAt(o++)?(e.consume(m),o===te.length?w:d):t(m)}function w(m){return m===null?t(m):m===93?(e.consume(m),C):F(m)?(l=w,U(m)):(e.consume(m),w)}function C(m){return m===93?(e.consume(m),x):w(m)}function x(m){return m===62?H(m):m===93?(e.consume(m),x):w(m)}function E(m){return m===null||m===62?H(m):F(m)?(l=E,U(m)):(e.consume(m),E)}function S(m){return m===null?t(m):m===63?(e.consume(m),L):F(m)?(l=S,U(m)):(e.consume(m),S)}function L(m){return m===62?H(m):S(m)}function D(m){return X(m)?(e.consume(m),b):t(m)}function b(m){return m===45||Q(m)?(e.consume(m),b):v(m)}function v(m){return F(m)?(l=v,U(m)):N(m)?(e.consume(m),v):H(m)}function B(m){return m===45||Q(m)?(e.consume(m),B):m===47||m===62||q(m)?M(m):t(m)}function M(m){return m===47?(e.consume(m),H):m===58||m===95||X(m)?(e.consume(m),k):F(m)?(l=M,U(m)):N(m)?(e.consume(m),M):H(m)}function k(m){return m===45||m===46||m===58||m===95||Q(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),z):F(m)?(l=T,U(m)):N(m)?(e.consume(m),T):M(m)}function z(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,j):F(m)?(l=z,U(m)):N(m)?(e.consume(m),z):(e.consume(m),_)}function j(m){return m===i?(e.consume(m),i=void 0,A):m===null?t(m):F(m)?(l=j,U(m)):(e.consume(m),j)}function _(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||q(m)?M(m):(e.consume(m),_)}function A(m){return m===47||m===62||q(m)?M(m):t(m)}function H(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function U(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ee}function ee(m){return N(m)?O(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ae(m)}function ae(m){return e.enter("htmlTextData"),l(m)}}const Rt={name:"labelEnd",resolveAll:Jl,resolveTo:Kl,tokenize:Zl},Gl={tokenize:eo},Xl={tokenize:to},Yl={tokenize:no};function Jl(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&K(e,0,e.length,t),e}function Kl(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=Z(a,e.slice(o+1,o+r+3)),a=Z(a,[["enter",f,n]]),a=Z(a,Ze(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=Z(a,[["exit",f,n],e[l-2],e[l-1],["exit",s,n]]),a=Z(a,e.slice(l+1)),a=Z(a,[["exit",u,n]]),K(e,o,e.length,a),e}function Zl(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(ie(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):t(p)}function u(p){return p===40?e.attempt(Gl,f,l?f:c)(p):p===91?e.attempt(Xl,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(Yl,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function eo(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return q(c)?Re(e,o)(c):o(c)}function o(c){return c===41?f(c):er(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return q(c)?Re(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?nr(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return q(c)?Re(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function to(e,n,t){const r=this;return i;function i(a){return tr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ie(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function no(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ro={name:"labelStartImage",resolveAll:Rt.resolveAll,tokenize:io};function io(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const lo={name:"labelStartLink",resolveAll:Rt.resolveAll,tokenize:oo};function oo(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const ot={name:"lineEnding",tokenize:ao};function ao(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),O(e,n,"linePrefix")}}const Qe={name:"thematicBreak",tokenize:uo};function uo(e,n,t){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||F(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),N(s)?O(e,a,"whitespace")(s):a(s))}}const Y={continuation:{tokenize:ho},exit:mo,name:"list",tokenize:fo},so={partial:!0,tokenize:go},co={partial:!0,tokenize:po};function fo(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ct(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Qe,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return Ct(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(je,r.interrupt?t:f,e.attempt(so,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return N(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function ho(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(je,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,O(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!N(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(co,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,O(e,e.attempt(Y,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function po(e,n,t){const r=this;return O(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function mo(e){e.exit(this.containerState.type)}function go(e,n,t){const r=this;return O(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!N(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const gn={name:"setextUnderline",resolveTo:xo,tokenize:ko};function xo(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function ko(e,n,t){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):t(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),N(s)?O(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||F(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const yo={tokenize:bo};function bo(e){const n=this,t=e.attempt(je,r,e.attempt(this.parser.constructs.flowInitial,i,O(e,e.attempt(this.parser.constructs.flow,i,e.attempt(El,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const wo={resolveAll:ir()},Co=rr("string"),So=rr("text");function rr(e){return{resolveAll:ir(e==="text"?Eo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ir(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Eo(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Io={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:Yn},Ao={91:Fl},To={[-2]:lt,[-1]:lt,32:lt},zo={35:vl,42:Qe,45:[gn,Qe],60:Bl,61:gn,95:Qe,96:pn,126:pn},Fo={38:Kn,92:Jn},_o={[-5]:ot,[-4]:ot,[-3]:ot,33:ro,38:Kn,42:St,60:[ll,Wl],91:lo,92:[Dl,Jn],93:Rt,95:St,96:kl},Po={null:[St,wo]},Lo={null:[42,95]},Do={null:[]},No=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Lo,contentInitial:Ao,disable:Do,document:Io,flow:zo,flowInitial:To,insideSpan:Po,string:Fo,text:_o},Symbol.toStringTag,{value:"Module"}));function vo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:v(D),check:v(b),consume:E,enter:S,exit:L,interrupt:v(b,{interrupt:!0})},s={code:null,containerState:{},defineSkip:w,events:[],now:d,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(T){return l=Z(l,T),C(),l[l.length-1]!==null?[]:(B(n,0),s.events=Ze(o,s.events,s),s.events)}function p(T,z){return Oo(h(T),z)}function h(T){return Ro(l,T)}function d(){const{_bufferIndex:T,_index:z,line:j,column:_,offset:A}=r;return{_bufferIndex:T,_index:z,line:j,column:_,offset:A}}function w(T){i[T.line]=T.column,k()}function C(){let T;for(;r._index<l.length;){const z=l[r._index];if(typeof z=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<z.length;)x(z.charCodeAt(r._bufferIndex));else x(z)}}function x(T){f=f(T)}function E(T){F(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,k()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function S(T,z){const j=z||{};return j.type=T,j.start=d(),s.events.push(["enter",j,s]),a.push(j),j}function L(T){const z=a.pop();return z.end=d(),s.events.push(["exit",z,s]),z}function D(T,z){B(T,z.from)}function b(T,z){z.restore()}function v(T,z){return j;function j(_,A,H){let U,ee,ae,m;return Array.isArray(_)?ue(_):"tokenize"in _?ue([_]):te(_);function te(W){return ze;function ze(he){const be=he!==null&&W[he],we=he!==null&&W.null,$e=[...Array.isArray(be)?be:be?[be]:[],...Array.isArray(we)?we:we?[we]:[]];return ue($e)(he)}}function ue(W){return U=W,ee=0,W.length===0?H:g(W[ee])}function g(W){return ze;function ze(he){return m=M(),ae=W,W.partial||(s.currentConstruct=W),W.name&&s.parser.constructs.disable.null.includes(W.name)?ge():W.tokenize.call(z?Object.assign(Object.create(s),z):s,u,ne,ge)(he)}}function ne(W){return T(ae,m),A}function ge(W){return m.restore(),++ee<U.length?g(U[ee]):H}}}function B(T,z){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&K(s.events,z,s.events.length-z,T.resolve(s.events.slice(z),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function M(){const T=d(),z=s.previous,j=s.currentConstruct,_=s.events.length,A=Array.from(a);return{from:_,restore:H};function H(){r=T,s.previous=z,s.currentConstruct=j,s.events.length=_,a=A,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ro(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Oo(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
4
4
|
`;break}case-3:{l=`\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as H,a1 as R,a2 as D,a3 as M,r as v,a4 as P,a5 as _,j as t,a6 as L,a7 as b,a8 as $,n as w,a9 as z,aa as F,ab as G,_ as O}from"./index-
|
|
1
|
+
import{a0 as H,a1 as R,a2 as D,a3 as M,r as v,a4 as P,a5 as _,j as t,a6 as L,a7 as b,a8 as $,n as w,a9 as z,aa as F,ab as G,_ as O}from"./index-CuWbxCsX.js";import{V}from"./virtual-rows-CsZNdhfp.js";function A(e){const n=e.match(/^@@\s+-(\d+)(?:,(\d+))?\s+\+(\d+)(?:,(\d+))?\s+@@\s*(.*)$/);return n?{oldStart:Number(n[1]),oldCount:n[2]===void 0?1:Number(n[2]),newStart:Number(n[3]),newCount:n[4]===void 0?1:Number(n[4]),context:n[5]?.trim()||null}:null}function c(e,n){return n<=1?`Line ${e}`:`Lines ${e}–${e+n-1}`}function B(e){const n=A(e);if(!n)return e;const i=n.oldStart===n.newStart&&n.oldCount===n.newCount;let s;return i?s=c(n.newStart,n.newCount):n.oldCount===0?s=`${c(n.newStart,n.newCount)} added`:n.newCount===0?s=`${c(n.oldStart,n.oldCount)} removed`:s=`${c(n.oldStart,n.oldCount)} → ${c(n.newStart,n.newCount).toLowerCase()}`,n.context?`${n.context} · ${s.toLowerCase()}`:s}const T=new Map,U=new Set,I=[],C={add:"bg-diff-add",del:"bg-diff-del",context:""},y={add:"rounded-sm bg-diff-add-emphasis",del:"rounded-sm bg-diff-del-emphasis",context:""};function m({value:e}){return t.jsx("span",{className:"w-10 shrink-0 select-none pr-2 text-right text-muted-foreground/60",children:e??""})}function W(e,n){return n==="right"?e.newLine??void 0:e.kind==="del"?e.oldLine??void 0:void 0}function X(e,n,i){const s=[],o=a=>{for(const d of i)d.beforeHunk===a&&s.push({type:"gap",gap:d})};return e.forEach((a,d)=>{if(o(d),a.header!==""&&s.push({type:"header",text:a.header}),n==="unified")for(const r of a.lines)s.push({type:"unified",line:r});else for(const r of J(a))s.push({type:"split",...r})}),o(e.length),s}function q({gap:e,onExpand:n}){const i=`${e.count} unchanged ${e.count===1?"line":"lines"}`,s=e.expandable&&n!==void 0;return t.jsxs("div",{className:"flex h-5 items-center gap-1 bg-muted/40 px-2 text-muted-foreground",children:[s&&(e.count<=z?t.jsx("button",{type:"button","aria-label":`Expand ${i}`,className:"rounded-sm px-0.5 hover:bg-accent hover:text-foreground",onClick:()=>n(e,"whole"),children:t.jsx(F,{className:"size-3"})}):t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":`Expand up from line ${e.endNew}`,className:"rounded-sm px-0.5 hover:bg-accent hover:text-foreground",onClick:()=>n(e,"up"),children:t.jsx(G,{className:"size-3"})}),t.jsx("button",{type:"button","aria-label":`Expand down from line ${e.startNew}`,className:"rounded-sm px-0.5 hover:bg-accent hover:text-foreground",onClick:()=>n(e,"down"),children:t.jsx(O,{className:"size-3"})})]})),t.jsx("span",{className:"select-none",children:`⋯ ${i}`})]})}function N({row:e,ctx:n}){if(e.type==="gap")return t.jsx(q,{gap:e.gap,onExpand:n.onExpand});if(e.type==="header")return t.jsx("p",{className:"h-5 bg-muted/40 px-2 text-muted-foreground",children:B(e.text)});if(e.type==="unified"){const i=e.line.newLine??e.line.oldLine??void 0,s=n.emphasis.get(e.line),o=k(i!==void 0?n.commentsByLine.get(i):void 0,e.line.kind==="del"?"old":"new"),a=i!==void 0&&n.pendingLines.has(i),d=L(o,a);return t.jsxs("div",{"data-file":n.filePath,"data-line":i,"data-side":e.line.kind==="del"?"old":"new",className:w("relative flex px-2",d??C[e.line.kind]),children:[t.jsx(b,{comments:o}),t.jsx(m,{value:e.line.oldLine}),t.jsx(m,{value:e.line.newLine}),t.jsx($,{tokens:n.tokens.get(e.line)??null,text:e.line.text,emphasis:s?{ranges:s,className:y[e.line.kind]}:void 0,wrap:!0})]})}return t.jsxs("div",{className:"flex divide-x divide-border",children:[t.jsx(j,{line:e.left,side:"left",ctx:n}),t.jsx(j,{line:e.right,side:"right",ctx:n})]})}function J(e){const n=[];let i=[];const s=()=>{for(const o of i)n.push({left:o,right:null});i=[]};for(const o of e.lines)if(o.kind==="del")i.push(o);else if(o.kind==="add"){const a=i.shift();n.push({left:a??null,right:o})}else s(),n.push({left:o,right:o});return s(),n}function j({line:e,side:n,ctx:i}){const s=e?i.emphasis.get(e):void 0,o=e?W(e,n):void 0,a=k(o!==void 0?i.commentsByLine.get(o):void 0,n==="left"?"old":"new"),d=o!==void 0&&i.pendingLines.has(o),r=L(a,d);return t.jsxs("div",{"data-file":i.filePath,"data-line":o,"data-side":n==="left"?"old":"new",className:w("relative flex min-w-0 flex-1",r??(e?C[e.kind]:"")),children:[t.jsx(b,{comments:a}),t.jsx(m,{value:e?e.kind==="add"?e.newLine:e.oldLine:null}),e?t.jsx($,{tokens:i.tokens.get(e)??null,text:e.text,emphasis:s?{ranges:s,className:y[e.kind]}:void 0,wrap:!0}):t.jsx("pre",{className:"flex-1",children:" "})]})}function k(e,n){const i=e?.filter(s=>s.anchor?.kind!=="file"||s.anchor.side===void 0||s.anchor.side===n);return i?.length?i:void 0}function Y({hunks:e,filePath:n,diffMode:i,layout:s="pane",commentIndex:o,pendingLines:a,gaps:d,onExpand:r}){const f=H(),h=R(n),p=D(M()),S=v.useMemo(()=>f&&h?P(f,e,h,p):new Map,[f,h,e,p]),E=v.useMemo(()=>_(e),[e]),x={tokens:S,emphasis:E,commentsByLine:o?.byLine??T,pendingLines:a??U,filePath:n,onExpand:r};if(e.length===0&&(d===void 0||d.length===0))return t.jsx("p",{className:"p-4 font-mono text-xs text-muted-foreground",children:"No changes"});const g=X(e,i,d??I);return s==="content"?t.jsx("div",{className:"text-xs leading-5",children:g.map((l,u)=>t.jsx(N,{row:l,ctx:x},l.type==="gap"?`g:${l.gap.startNew}:${u}`:l.type==="header"?`h:${l.text}:${u}`:l.type==="unified"?`u:${l.line.oldLine}:${l.line.newLine}:${u}`:`s:${l.left?.oldLine}:${l.right?.newLine}:${u}`))}):t.jsx(V,{rows:g,className:"leading-5",fitWidth:!0,dynamicHeight:!0,renderRow:l=>t.jsx(N,{row:l,ctx:x})})}export{Y as H};
|