import{f as q}from"./vendor-micromark-factory-space-BM4zcA-B.js";import{m as h}from"./vendor-micromark-util-character-Cn8n62xE.js";import"./katex-ClxlXyPc.js";const P={tokenize:L,concrete:!0,name:"mathFlow"},k={tokenize:O,partial:!0};function L(n,u,a){const i=this,e=i.events[i.events.length-1],p=e&&e[1].type==="linePrefix"?e[2].sliceSerialize(e[1],!0).length:0;let l=0;return w;function w(t){return n.enter("mathFlow"),n.enter("mathFlowFence"),n.enter("mathFlowFenceSequence"),x(t)}function x(t){return t===36?(n.consume(t),l++,x):l<2?a(t):(n.exit("mathFlowFenceSequence"),q(n,T,"whitespace")(t))}function T(t){return t===null||h(t)?g(t):(n.enter("mathFlowFenceMeta"),n.enter("chunkString",{contentType:"string"}),z(t))}function z(t){return t===null||h(t)?(n.exit("chunkString"),n.exit("mathFlowFenceMeta"),g(t)):t===36?a(t):(n.consume(t),z)}function g(t){return n.exit("mathFlowFence"),i.interrupt?u(t):n.attempt(k,m,S)(t)}function m(t){return n.attempt({tokenize:b,partial:!0},S,y)(t)}function y(t){return(p?q(n,F,"linePrefix",p+1):F)(t)}function F(t){return t===null?S(t):h(t)?n.attempt(k,m,S)(t):(n.enter("mathFlowValue"),r(t))}function r(t){return t===null||h(t)?(n.exit("mathFlowValue"),F(t)):(n.consume(t),r)}function S(t){return n.exit("mathFlow"),u(t)}function b(t,D,s){let E=0;return q(t,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function M(o){return t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),C(o)}function C(o){return o===36?(E++,t.consume(o),C):E