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B,GAAiB,MACrF,KAAK,EAAI,6BAA6B,4BAA4B,GAAe,OAGpF,EAAQ,qBAAuB,EAAsB,QAAQ,OAC9D,MAAM,yBAAyB,EAAsB,OAAO,IAEhE,MAAO,CACH,MACA,eACA,YAAa,KACb,SAAU,CACN,2BAA4B,6BAA6B,2BACzD,8BAA+B,6BAA6B,+BAGxE,CACA,SAAS,MAAM,EAAM,GACjB,OAAO,eAAe,EAAM,GAAS,GACzC,CA1DA,QAAQ,mBAAqB,mBA4D7B,QAAQ,QAAU,QAAQ,mBAAmB,QAC7C,QAAQ,KAAO,CACX,KAAM,iCACN,QAAS,QAAQ","file":"/npm/@angular-eslint/template-parser@20.6.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@angular-eslint/template-parser@20.6.0/dist/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","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.meta = exports.version = exports.TemplateParseError = void 0;\nexports.createTemplateParseError = createTemplateParseError;\nexports.parseForESLint = parseForESLint;\nexports.parse = parse;\nconst bundled_angular_compiler_1 = require(\"@angular-eslint/bundled-angular-compiler\");\nconst eslint_scope_1 = require(\"eslint-scope\");\nconst convert_source_span_to_loc_1 = require(\"./convert-source-span-to-loc\");\nconst KEYS = {\n    ASTWithSource: ['ast'],\n    Binary: ['left', 'right'],\n    BoundAttribute: ['value'],\n    BoundEvent: ['handler'],\n    BoundText: ['value'],\n    Call: ['receiver', 'args'],\n    SafeCall: ['receiver', 'args'],\n    Conditional: ['condition', 'trueExp', 'falseExp'],\n    Element: ['children', 'inputs', 'outputs', 'attributes'],\n    Interpolation: ['expressions'],\n    PrefixNot: ['expression'],\n    Program: ['templateNodes'],\n    PropertyRead: ['receiver'],\n    Template: ['templateAttrs', 'children', 'inputs'],\n    BindingPipe: ['exp'],\n    DeferredBlock: [\n        'children',\n        'placeholder',\n        'loading',\n        'error',\n        'triggers',\n        'prefetchTriggers',\n    ],\n    DeferredBlockLoading: ['children'],\n    DeferredBlockError: ['children'],\n    DeferredBlockPlaceholder: ['children'],\n    Object: ['when'],\n    BoundDeferredTrigger: ['value'],\n    IfBlock: ['branches'],\n    IfBlockBranch: ['children', 'expression'],\n    SwitchBlock: ['cases', 'expression'],\n    SwitchBlockCase: ['children', 'expression'],\n    ForLoopBlock: ['children', 'empty', 'expression', 'trackBy'],\n    ForLoopBlockEmpty: ['children'],\n    Content: ['children'],\n    LetDeclaration: ['value'],\n    ParenthesizedExpression: ['expression'],\n};\nfunction fallbackKeysFilter(key) {\n    let value = null;\n    return (key !== 'comments' &&\n        key !== 'leadingComments' &&\n        key !== 'loc' &&\n        key !== 'parent' &&\n        key !== 'range' &&\n        key !== 'tokens' &&\n        key !== 'trailingComments' &&\n        (value = this[key]) !== null &&\n        typeof value === 'object' &&\n        (typeof value.type === 'string' || Array.isArray(value)));\n}\nfunction getFallbackKeys(node) {\n    return Object.keys(node).filter(fallbackKeysFilter, node);\n}\nfunction isNode(node) {\n    return (node !== null &&\n        typeof node === 'object' &&\n        typeof node.type === 'string');\n}\n/**\n * Get line offsets for a source code string (cached for performance)\n */\nlet lineOffsetsCache = null;\nfunction getLineOffsets(sourceCode) {\n    if (!lineOffsetsCache) {\n        lineOffsetsCache = new Map();\n    }\n    let offsets = lineOffsetsCache.get(sourceCode);\n    if (!offsets) {\n        offsets = [0];\n        for (let i = 0; i < sourceCode.length; i++) {\n            if (sourceCode[i] === '\\n') {\n                offsets.push(i + 1);\n            }\n        }\n        lineOffsetsCache.set(sourceCode, offsets);\n    }\n    return offsets;\n}\n/**\n * Convert absolute offsets to line/column positions\n */\nfunction convertAbsoluteSourceSpanToLoc(sourceCode, span) {\n    const lineOffsets = getLineOffsets(sourceCode);\n    // Binary search for start line\n    let startLine = 0;\n    let left = 0;\n    let right = lineOffsets.length - 1;\n    while (left <= right) {\n        const mid = Math.floor((left + right) / 2);\n        if (lineOffsets[mid] <= span.start) {\n            startLine = mid;\n            left = mid + 1;\n        }\n        else {\n            right = mid - 1;\n        }\n    }\n    const startColumn = span.start - lineOffsets[startLine];\n    // Binary search for end line\n    let endLine = startLine; // Start from startLine as optimization\n    left = startLine;\n    right = lineOffsets.length - 1;\n    while (left <= right) {\n        const mid = Math.floor((left + right) / 2);\n        if (lineOffsets[mid] <= span.end) {\n            endLine = mid;\n            left = mid + 1;\n        }\n        else {\n            right = mid - 1;\n        }\n    }\n    const endColumn = span.end - lineOffsets[endLine];\n    return {\n        start: { line: startLine + 1, column: startColumn },\n        end: { line: endLine + 1, column: endColumn },\n    };\n}\n/**\n * ESLint requires all Nodes to have `type` and `loc` properties before it can\n * work with the custom AST.\n */\nfunction preprocessNode(node, sourceCode) {\n    let i = 0;\n    let j = 0;\n    const keys = KEYS[node.type] || getFallbackKeys(node);\n    if (!node.loc) {\n        if (node.sourceSpan &&\n            node.sourceSpan.start &&\n            typeof node.sourceSpan.start.line === 'number') {\n            // Regular ParseSourceSpan\n            node.loc = (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(node.sourceSpan);\n        }\n        else if (node.sourceSpan &&\n            typeof node.sourceSpan.start === 'number' &&\n            sourceCode) {\n            // AbsoluteSourceSpan\n            node.loc = convertAbsoluteSourceSpanToLoc(sourceCode, node.sourceSpan);\n        }\n    }\n    for (i = 0; i < keys.length; ++i) {\n        const child = node[keys[i]];\n        if (child == null) {\n            continue;\n        }\n        const isArr = Array.isArray(child);\n        if (child.type !== undefined) {\n            // Angular sometimes uses a prop called type already\n            child.__originalType = child.type;\n        }\n        if (!isArr && !child.type) {\n            child.type = child.constructor.name;\n        }\n        if (isArr) {\n            for (j = 0; j < child.length; ++j) {\n                const c = child[j];\n                if (c.type !== undefined) {\n                    // Angular sometimes uses a prop called type already\n                    c.__originalType = c.type;\n                }\n                // Pay attention to the condition `typeof c.type === number`,\n                // Angular compiler sets `type` property for some AST nodes,\n                // e.g. for the `BoundAttribute`, which is a `BindingType`.\n                if (!c.type || typeof c.type === 'number') {\n                    c.type = c.constructor.name;\n                }\n                if (isNode(c)) {\n                    preprocessNode(c, sourceCode);\n                }\n            }\n        }\n        else if (isNode(child)) {\n            preprocessNode(child, sourceCode);\n        }\n    }\n}\nfunction getStartSourceSpanFromAST(ast) {\n    let startSourceSpan = null;\n    ast.templateNodes.forEach((node) => {\n        const nodeSourceSpan = node.startSourceSpan || node.sourceSpan;\n        if (!startSourceSpan) {\n            startSourceSpan = nodeSourceSpan;\n            return;\n        }\n        if (nodeSourceSpan &&\n            nodeSourceSpan.start.offset < startSourceSpan.start.offset) {\n            startSourceSpan = nodeSourceSpan;\n            return;\n        }\n    });\n    return startSourceSpan;\n}\nfunction getEndSourceSpanFromAST(ast) {\n    let endSourceSpan = null;\n    ast.templateNodes.forEach((node) => {\n        const nodeSourceSpan = node.endSourceSpan || node.sourceSpan;\n        if (!endSourceSpan) {\n            endSourceSpan = nodeSourceSpan;\n            return;\n        }\n        if (nodeSourceSpan &&\n            nodeSourceSpan.end.offset > endSourceSpan.end.offset) {\n            endSourceSpan = nodeSourceSpan;\n            return;\n        }\n    });\n    return endSourceSpan;\n}\nfunction convertNgAstCommentsToTokens(comments) {\n    const commentTokens = comments.map((comment) => {\n        return {\n            // In an HTML context, effectively all our comments are Block comments\n            type: 'Block',\n            value: comment.value,\n            loc: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(comment.sourceSpan),\n            range: [comment.sourceSpan.start.offset, comment.sourceSpan.end.offset],\n        };\n    });\n    /**\n     * ESLint requires this to be sorted by Token#range[0]\n     * https://eslint.org/docs/developer-guide/working-with-custom-parsers\n     */\n    return commentTokens.sort((a, b) => a.range[0] - b.range[0]);\n}\nclass TemplateParseError extends Error {\n    fileName;\n    index;\n    lineNumber;\n    column;\n    constructor(message, fileName, index, lineNumber, column) {\n        super(message);\n        this.fileName = fileName;\n        this.index = index;\n        this.lineNumber = lineNumber;\n        this.column = column;\n        Object.defineProperty(this, 'name', {\n            value: new.target.name,\n            enumerable: false,\n            configurable: true,\n        });\n    }\n}\nexports.TemplateParseError = TemplateParseError;\nfunction createTemplateParseError(parseError) {\n    const message = parseError.msg;\n    const fileName = parseError.span.start.file.url;\n    const index = parseError.span.start.offset;\n    const lineNumber = parseError.span.start.line + 1;\n    const column = parseError.span.start.col + 1;\n    return new TemplateParseError(message, fileName, index, lineNumber, column);\n}\nfunction parseForESLint(code, options) {\n    const angularCompilerResult = (0, bundled_angular_compiler_1.parseTemplate)(code, options.filePath, {\n        preserveWhitespaces: true,\n        preserveLineEndings: true,\n        collectCommentNodes: true,\n    });\n    let ngAstCommentNodes = [];\n    if (Array.isArray(angularCompilerResult.commentNodes)) {\n        ngAstCommentNodes = angularCompilerResult.commentNodes;\n    }\n    const ast = {\n        type: 'Program',\n        comments: convertNgAstCommentsToTokens(ngAstCommentNodes),\n        tokens: [],\n        range: [0, 0],\n        loc: {\n            start: { line: 0, column: 0 },\n            end: { line: 0, column: 0 },\n        },\n        templateNodes: angularCompilerResult.nodes,\n        value: code,\n    };\n    const scopeManager = new eslint_scope_1.ScopeManager({});\n    new eslint_scope_1.Scope(scopeManager, 'module', null, ast, false);\n    preprocessNode(ast, code);\n    const startSourceSpan = getStartSourceSpanFromAST(ast);\n    const endSourceSpan = getEndSourceSpanFromAST(ast);\n    if (startSourceSpan && endSourceSpan) {\n        ast.range = [startSourceSpan.start.offset, endSourceSpan.end.offset];\n        ast.loc = {\n            start: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(startSourceSpan).start,\n            end: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(endSourceSpan).end,\n        };\n    }\n    if (!options.suppressParseErrors && angularCompilerResult.errors?.length) {\n        throw createTemplateParseError(angularCompilerResult.errors[0]);\n    }\n    return {\n        ast,\n        scopeManager,\n        visitorKeys: KEYS,\n        services: {\n            convertNodeSourceSpanToLoc: convert_source_span_to_loc_1.convertNodeSourceSpanToLoc,\n            convertElementSourceSpanToLoc: convert_source_span_to_loc_1.convertElementSourceSpanToLoc,\n        },\n    };\n}\nfunction parse(code, options) {\n    return parseForESLint(code, options).ast;\n}\n// NOTE - we cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder\nexports.version = require('../package.json').version;\nexports.meta = {\n    name: 'angular-eslint/template-parser',\n    version: exports.version,\n};\n"]}