"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../../../../micromark-factory-space@2.0.1/node_modules/micromark-factory-space/index.cjs.js"),l=require("../../../../micromark-util-character@2.1.1/node_modules/micromark-util-character/index.cjs.js"),v={tokenize:O,concrete:!0,name:"mathFlow"},k={tokenize:N,partial:!0};function O(t,a,o){const i=this,u=i.events[i.events.length-1],m=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0;let r=0;return q;function q(n){return t.enter("mathFlow"),t.enter("mathFlowFence"),t.enter("mathFlowFenceSequence"),c(n)}function c(n){return n===36?(t.consume(n),r++,c):r<2?o(n):(t.exit("mathFlowFenceSequence"),h.factorySpace(t,C,"whitespace")(n))}function C(n){return n===null||l.markdownLineEnding(n)?S(n):(t.enter("mathFlowFenceMeta"),t.enter("chunkString",{contentType:"string"}),p(n))}function p(n){return n===null||l.markdownLineEnding(n)?(t.exit("chunkString"),t.exit("mathFlowFenceMeta"),S(n)):n===36?o(n):(t.consume(n),p)}function S(n){return t.exit("mathFlowFence"),i.interrupt?a(n):t.attempt(k,g,F)(n)}function g(n){return t.attempt({tokenize:E,partial:!0},F,L)(n)}function L(n){return(m?h.factorySpace(t,w,"linePrefix",m+1):w)(n)}function w(n){return n===null?F(n):l.markdownLineEnding(n)?t.attempt(k,g,F)(n):(t.enter("mathFlowValue"),s(n))}function s(n){return n===null||l.markdownLineEnding(n)?(t.exit("mathFlowValue"),w(n)):(t.consume(n),s)}function F(n){return t.exit("mathFlow"),a(n)}function E(n,b,x){let z=0;return h.factorySpace(n,M,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function M(e){return n.enter("mathFlowFence"),n.enter("mathFlowFenceSequence"),y(e)}function y(e){return e===36?(z++,n.consume(e),y):z<r?x(e):(n.exit("mathFlowFenceSequence"),h.factorySpace(n,P,"whitespace")(e))}function P(e){return e===null||l.markdownLineEnding(e)?(n.exit("mathFlowFence"),b(e)):x(e)}}}function N(t,a,o){const i=this;return u;function u(r){return r===null?a(r):(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),m)}function m(r){return i.parser.lazy[i.now().line]?o(r):a(r)}}exports.mathFlow=v;
//# sourceMappingURL=math-flow.cjs.js.map
