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AM,EAAM,OAAO,EAAM,MAAK,EAAS,SAAU,MAAK,EAAO,EAAG,MAAK,EAAU,MAAK,EAAS,UAC7F,GAAI,EAIH,OAHI,MAAK,GAAiB,MAAK,IAC/B,MAAK,GAAkB,OACvB,MAAK,EAAkB,EAAM,GAG9B,MAAK,GAAkB,EACvB,MAAM,EAAW,YAAY,EAAM,MAAK,EAAS,SAAU,MAAK,EAAO,GACvE,GAAI,EAGH,OAFA,MAAK,SACL,MAAK,EAAuB,EAAM,GAGnC,MAAK,IACL,MAAK,EAAa,MAAK,EAAY,GACpC,CACA,EAAA,GACC,GAAI,KAAK,aAAc,CACtB,MAAM,IAAE,GAAQ,KAAK,aACrB,MAAM,cAAc,CACnB,KAAM,EAAI,KACV,IAAK,EAAI,KACP,EAAI,SACR,CACA,GAAI,KAAK,kBAAmB,CAC3B,MAAM,SAAE,EAAQ,QAAE,GAAY,KAAK,kBACnC,MAAM,mBAAmB,EAAQ,IAAK,EAAS,SAChD,CACA,GAAI,MAAK,EAAY,OAAQ,CAC5B,MAAM,EAAY,MAAK,EAAY,MAAK,EAAY,OAAS,GAC7D,MAAM,YAAY,EAAU,WAAW,KAAM,EAAU,IAAI,MAAO,EAAU,SAC7E,CACD,CACA,KAAA,GACC,MAAM,EAAQ,MAAK,EAAU,MAAM,eAC7B,EAAc,EAAM,OAC1B,KAAO,MAAK,EAAQ,GAAa,CAChC,MAAM,EAAO,EAAM,MAAK,GACxB,MAAK,IACL,MAAK,EAAa,EACnB,CACA,MAAK,GACN,UAEQ,cAAe,SAAU","file":"/npm/edge-lexer@6.0.4/build/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/edge-lexer@6.0.4/build/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { n as TagTypes, t as MustacheTypes } from \"./enums-Bj4v9G-x.js\";\nimport { EdgeError } from \"edge-error\";\nvar Scanner = class {\n\t#pattern;\n\t#tolaretionCounts = 0;\n\t#tolerateLhs = \"\";\n\t#tolerateRhs = \"\";\n\t#patternLength = 0;\n\tclosed = false;\n\tmatch = \"\";\n\tleftOver = \"\";\n\tloc;\n\tconstructor(pattern, toleratePair, line, col) {\n\t\tthis.#tolerateLhs = toleratePair[0];\n\t\tthis.#tolerateRhs = toleratePair[1];\n\t\tthis.#patternLength = pattern.length;\n\t\tthis.#pattern = pattern;\n\t\tthis.loc = {\n\t\t\tline,\n\t\t\tcol\n\t\t};\n\t}\n\t#matchesPattern(chars, iterationCount) {\n\t\tfor (let i = 0; i < this.#patternLength; i++) if (this.#pattern[i] !== chars[iterationCount + i]) return false;\n\t\treturn true;\n\t}\n\tscan(chunk) {\n\t\tif (chunk === \"\\n\") {\n\t\t\tthis.loc.line++;\n\t\t\tthis.loc.col = 0;\n\t\t\tthis.match += \"\\n\";\n\t\t\treturn;\n\t\t}\n\t\tif (!chunk.trim()) return;\n\t\tconst chunkLength = chunk.length;\n\t\tlet iterations = 0;\n\t\twhile (iterations < chunkLength) {\n\t\t\tconst char = chunk[iterations];\n\t\t\tif (this.#tolaretionCounts === 0 && this.#matchesPattern(chunk, iterations)) {\n\t\t\t\titerations += this.#patternLength;\n\t\t\t\tthis.closed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (char === this.#tolerateLhs) this.#tolaretionCounts++;\n\t\t\tif (char === this.#tolerateRhs) this.#tolaretionCounts--;\n\t\t\tthis.match += char;\n\t\t\titerations++;\n\t\t}\n\t\tif (this.closed) {\n\t\t\tthis.loc.col += iterations;\n\t\t\tthis.leftOver = chunk.slice(iterations);\n\t\t}\n\t}\n};\nconst TAG_REGEX = /^(\\s*)(@{1,2})(!)?([a-zA-Z._]+)(\\s{0,2})/;\nfunction getTag(content, filename, line, col, tags, claimTag) {\n\tconst match = TAG_REGEX.exec(content);\n\tif (!match) return null;\n\tconst name = match[4];\n\tlet tag = tags[name];\n\tif (!tag && claimTag) tag = claimTag(name);\n\tif (!tag) return null;\n\tconst escaped = match[2] === \"@@\";\n\tconst selfclosed = !!match[3];\n\tconst whitespaceLeft = match[1].length;\n\tconst whitespaceRight = match[5].length;\n\tconst seekable = tag.seekable;\n\tconst block = tag.block;\n\tconst noNewLine = !!tag.noNewLine;\n\tcol += whitespaceLeft + match[2].length + name.length + whitespaceRight;\n\tif (selfclosed) col++;\n\tconst hasBrace = seekable && content[col] === \"(\";\n\treturn {\n\t\tname,\n\t\tfilename,\n\t\tseekable,\n\t\tselfclosed,\n\t\tblock,\n\t\tline,\n\t\tcol,\n\t\tescaped,\n\t\thasBrace,\n\t\tnoNewLine\n\t};\n}\nfunction getMustache(content, filename, line, col) {\n\tconst mustacheIndex = content.indexOf(\"{{\");\n\tif (mustacheIndex === -1) return null;\n\tconst realCol = mustacheIndex;\n\tconst isComment = content[mustacheIndex + 2] === \"-\" && content[mustacheIndex + 3] === \"-\";\n\tif (isComment) return {\n\t\tisComment,\n\t\tfilename,\n\t\tline,\n\t\tcol: col + realCol,\n\t\trealCol\n\t};\n\treturn {\n\t\tisComment,\n\t\tsafe: content[mustacheIndex + 2] === \"{\",\n\t\tfilename,\n\t\tescaped: content[mustacheIndex - 1] === \"@\",\n\t\tline,\n\t\tcol: col + realCol,\n\t\trealCol\n\t};\n}\nfunction cannotSeekStatement(chars, pos, filename) {\n\treturn new EdgeError(`Unexpected token \"${chars}\"`, \"E_CANNOT_SEEK_STATEMENT\", {\n\t\tline: pos.line,\n\t\tcol: pos.col,\n\t\tfilename\n\t});\n}\nfunction unclosedParen(pos, filename) {\n\treturn new EdgeError(\"Missing token \\\")\\\"\", \"E_UNCLOSED_PAREN\", {\n\t\tline: pos.line,\n\t\tcol: pos.col,\n\t\tfilename\n\t});\n}\nfunction unopenedParen(pos, filename) {\n\treturn new EdgeError(\"Missing token \\\"(\\\"\", \"E_UNOPENED_PAREN\", {\n\t\tline: pos.line,\n\t\tcol: pos.col,\n\t\tfilename\n\t});\n}\nfunction unclosedCurlyBrace(pos, filename) {\n\treturn new EdgeError(\"Missing token \\\"}\\\"\", \"E_UNCLOSED_CURLY_BRACE\", {\n\t\tline: pos.line,\n\t\tcol: pos.col,\n\t\tfilename\n\t});\n}\nfunction unclosedTag(tag, pos, filename) {\n\treturn new EdgeError(`Unclosed tag ${tag}`, \"E_UNCLOSED_TAG\", {\n\t\tline: pos.line,\n\t\tcol: pos.col,\n\t\tfilename\n\t});\n}\nvar Tokenizer = class {\n\t#line = 0;\n\t#isLastLineATag = false;\n\t#dropNewLine = false;\n\t#openedTags = [];\n\t#options;\n\t#template;\n\t#tagsDef;\n\ttokens = [];\n\ttagStatement = null;\n\tmustacheStatement = null;\n\tconstructor(template, tagsDef, options) {\n\t\tthis.#template = template;\n\t\tthis.#tagsDef = tagsDef;\n\t\tthis.#options = options;\n\t}\n\t#getRawNode(text) {\n\t\treturn {\n\t\t\ttype: \"raw\",\n\t\t\tvalue: text,\n\t\t\tfilename: this.#options.filename,\n\t\t\tline: this.#line\n\t\t};\n\t}\n\t#getNewLineNode(line) {\n\t\treturn {\n\t\t\ttype: \"newline\",\n\t\t\tfilename: this.#options.filename,\n\t\t\tline: (line || this.#line) - 1\n\t\t};\n\t}\n\t#getTagNode(tag, jsArg, closingLoc) {\n\t\treturn {\n\t\t\ttype: tag.escaped ? TagTypes.ETAG : TagTypes.TAG,\n\t\t\tfilename: tag.filename,\n\t\t\tproperties: {\n\t\t\t\tname: tag.name,\n\t\t\t\tjsArg,\n\t\t\t\tselfclosed: tag.selfclosed\n\t\t\t},\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\tline: tag.line,\n\t\t\t\t\tcol: tag.col\n\t\t\t\t},\n\t\t\t\tend: closingLoc\n\t\t\t},\n\t\t\tchildren: []\n\t\t};\n\t}\n\t#consumeTag(tag, jsArg, loc) {\n\t\tif (tag.block && !tag.selfclosed) this.#openedTags.push(this.#getTagNode(tag, jsArg, loc));\n\t\telse this.#consumeNode(this.#getTagNode(tag, jsArg, loc));\n\t}\n\t#handleTagOpening(line, tag) {\n\t\tif (tag.seekable && !tag.hasBrace) throw unopenedParen({\n\t\t\tline: tag.line,\n\t\t\tcol: tag.col\n\t\t}, tag.filename);\n\t\tif (!tag.seekable) {\n\t\t\tthis.#consumeTag(tag, \"\", {\n\t\t\t\tline: tag.line,\n\t\t\t\tcol: tag.col\n\t\t\t});\n\t\t\tif (tag.noNewLine || line.endsWith(\"~\")) this.#dropNewLine = true;\n\t\t\treturn;\n\t\t}\n\t\ttag.col += 1;\n\t\tthis.tagStatement = {\n\t\t\ttag,\n\t\t\tscanner: new Scanner(\")\", [\"(\", \")\"], this.#line, tag.col)\n\t\t};\n\t\tthis.#feedCharsToCurrentTag(line.slice(tag.col));\n\t}\n\t#feedCharsToCurrentTag(content) {\n\t\tconst { tag, scanner } = this.tagStatement;\n\t\tscanner.scan(content);\n\t\tif (!scanner.closed) return;\n\t\tthis.#consumeTag(tag, scanner.match, scanner.loc);\n\t\tif (scanner.leftOver.trim() === \"~\") {\n\t\t\tthis.tagStatement = null;\n\t\t\tthis.#dropNewLine = true;\n\t\t\treturn;\n\t\t}\n\t\tif (scanner.leftOver.trim()) throw cannotSeekStatement(scanner.leftOver, scanner.loc, tag.filename);\n\t\tif (tag.noNewLine) this.#dropNewLine = true;\n\t\tthis.tagStatement = null;\n\t}\n\t#getMustacheType(mustache) {\n\t\tif (mustache.safe) return mustache.escaped ? MustacheTypes.ESMUSTACHE : MustacheTypes.SMUSTACHE;\n\t\treturn mustache.escaped ? MustacheTypes.EMUSTACHE : MustacheTypes.MUSTACHE;\n\t}\n\t#getMustacheNode(mustache, jsArg, closingLoc) {\n\t\treturn {\n\t\t\ttype: this.#getMustacheType(mustache),\n\t\t\tfilename: mustache.filename,\n\t\t\tproperties: { jsArg },\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\tline: mustache.line,\n\t\t\t\t\tcol: mustache.col\n\t\t\t\t},\n\t\t\t\tend: closingLoc\n\t\t\t}\n\t\t};\n\t}\n\t#getCommentNode(comment, value, closingLoc) {\n\t\treturn {\n\t\t\ttype: \"comment\",\n\t\t\tfilename: comment.filename,\n\t\t\tvalue,\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\tline: comment.line,\n\t\t\t\t\tcol: comment.col\n\t\t\t\t},\n\t\t\t\tend: closingLoc\n\t\t\t}\n\t\t};\n\t}\n\t#handleMustacheOpening(line, mustache) {\n\t\tconst pattern = mustache.isComment ? \"--}}\" : mustache.safe ? \"}}}\" : \"}}\";\n\t\tconst textLeftIndex = mustache.isComment || !mustache.escaped ? mustache.realCol : mustache.realCol - 1;\n\t\tif (textLeftIndex > 0) this.#consumeNode(this.#getRawNode(line.slice(0, textLeftIndex)));\n\t\tmustache.col += pattern.length;\n\t\tmustache.realCol += pattern.length;\n\t\tthis.mustacheStatement = {\n\t\t\tmustache,\n\t\t\tscanner: new Scanner(pattern, [\"{\", \"}\"], mustache.line, mustache.col)\n\t\t};\n\t\tthis.#feedCharsToCurrentMustache(line.slice(mustache.realCol));\n\t}\n\t#feedCharsToCurrentMustache(content) {\n\t\tconst { mustache, scanner } = this.mustacheStatement;\n\t\tscanner.scan(content);\n\t\tif (!scanner.closed) return;\n\t\tif (mustache.isComment) this.#consumeNode(this.#getCommentNode(mustache, scanner.match, scanner.loc));\n\t\telse this.#consumeNode(this.#getMustacheNode(mustache, scanner.match, scanner.loc));\n\t\tif (scanner.leftOver.trim()) {\n\t\t\tconst anotherMustache = getMustache(scanner.leftOver, this.#options.filename, scanner.loc.line, scanner.loc.col);\n\t\t\tif (anotherMustache) {\n\t\t\t\tthis.#handleMustacheOpening(scanner.leftOver, anotherMustache);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#consumeNode(this.#getRawNode(scanner.leftOver));\n\t\t}\n\t\tthis.mustacheStatement = null;\n\t}\n\t#isClosingTag(line) {\n\t\tif (!this.#openedTags.length) return false;\n\t\tline = line.trim();\n\t\tconst endStatement = `@end${this.#openedTags[this.#openedTags.length - 1].properties.name}`;\n\t\treturn line === endStatement || line === `${endStatement}~` || line === \"@end\" || line === \"@end~\";\n\t}\n\t#consumeNode(tag) {\n\t\tif (this.#openedTags.length) {\n\t\t\tthis.#openedTags[this.#openedTags.length - 1].children.push(tag);\n\t\t\treturn;\n\t\t}\n\t\tthis.tokens.push(tag);\n\t}\n\t#pushNewLine(line) {\n\t\tif ((line || this.#line) === 1) return;\n\t\tif (this.#dropNewLine) {\n\t\t\tthis.#dropNewLine = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.#consumeNode(this.#getNewLineNode(line));\n\t}\n\t#processText(line) {\n\t\tif (typeof this.#options.onLine === \"function\") line = this.#options.onLine(line);\n\t\tif (this.tagStatement) {\n\t\t\tthis.#feedCharsToCurrentTag(\"\\n\");\n\t\t\tthis.#feedCharsToCurrentTag(line);\n\t\t\treturn;\n\t\t}\n\t\tif (this.mustacheStatement) {\n\t\t\tthis.#feedCharsToCurrentMustache(\"\\n\");\n\t\t\tthis.#feedCharsToCurrentMustache(line);\n\t\t\treturn;\n\t\t}\n\t\tif (this.#isClosingTag(line)) {\n\t\t\tthis.#consumeNode(this.#openedTags.pop());\n\t\t\tif (line.endsWith(\"~\")) this.#dropNewLine = true;\n\t\t\treturn;\n\t\t}\n\t\tconst tag = getTag(line, this.#options.filename, this.#line, 0, this.#tagsDef, this.#options.claimTag);\n\t\tif (tag) {\n\t\t\tif (this.#isLastLineATag) this.#pushNewLine();\n\t\t\tthis.#isLastLineATag = true;\n\t\t\tthis.#handleTagOpening(line, tag);\n\t\t\treturn;\n\t\t}\n\t\tthis.#isLastLineATag = false;\n\t\tconst mustache = getMustache(line, this.#options.filename, this.#line, 0);\n\t\tif (mustache) {\n\t\t\tthis.#pushNewLine();\n\t\t\tthis.#handleMustacheOpening(line, mustache);\n\t\t\treturn;\n\t\t}\n\t\tthis.#pushNewLine();\n\t\tthis.#consumeNode(this.#getRawNode(line));\n\t}\n\t#checkForErrors() {\n\t\tif (this.tagStatement) {\n\t\t\tconst { tag } = this.tagStatement;\n\t\t\tthrow unclosedParen({\n\t\t\t\tline: tag.line,\n\t\t\t\tcol: tag.col\n\t\t\t}, tag.filename);\n\t\t}\n\t\tif (this.mustacheStatement) {\n\t\t\tconst { mustache, scanner } = this.mustacheStatement;\n\t\t\tthrow unclosedCurlyBrace(scanner.loc, mustache.filename);\n\t\t}\n\t\tif (this.#openedTags.length) {\n\t\t\tconst openedTag = this.#openedTags[this.#openedTags.length - 1];\n\t\t\tthrow unclosedTag(openedTag.properties.name, openedTag.loc.start, openedTag.filename);\n\t\t}\n\t}\n\tparse() {\n\t\tconst lines = this.#template.split(/\\r\\n|\\r|\\n/g);\n\t\tconst linesLength = lines.length;\n\t\twhile (this.#line < linesLength) {\n\t\t\tconst line = lines[this.#line];\n\t\t\tthis.#line++;\n\t\t\tthis.#processText(line);\n\t\t}\n\t\tthis.#checkForErrors();\n\t}\n};\nexport { MustacheTypes, TagTypes, Tokenizer };\n"]}