@angular/core
Version:
Angular - the core framework
1,522 lines (1,510 loc) • 1.9 MB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve6, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve6(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/index.mjs
var standalone_migration_exports = {};
__export(standalone_migration_exports, {
default: () => standalone_migration_default
});
module.exports = __toCommonJS(standalone_migration_exports);
var import_schematics = require("@angular-devkit/schematics");
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
var import_typescript = __toESM(require("typescript"), 1);
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
var InvalidFileSystem = class {
exists(path4) {
throw makeError();
}
readFile(path4) {
throw makeError();
}
readFileBuffer(path4) {
throw makeError();
}
writeFile(path4, data, exclusive) {
throw makeError();
}
removeFile(path4) {
throw makeError();
}
symlink(target, path4) {
throw makeError();
}
readdir(path4) {
throw makeError();
}
lstat(path4) {
throw makeError();
}
stat(path4) {
throw makeError();
}
pwd() {
throw makeError();
}
chdir(path4) {
throw makeError();
}
extname(path4) {
throw makeError();
}
copyFile(from, to) {
throw makeError();
}
moveFile(from, to) {
throw makeError();
}
ensureDir(path4) {
throw makeError();
}
removeDeep(path4) {
throw makeError();
}
isCaseSensitive() {
throw makeError();
}
resolve(...paths) {
throw makeError();
}
dirname(file) {
throw makeError();
}
join(basePath, ...paths) {
throw makeError();
}
isRoot(path4) {
throw makeError();
}
isRooted(path4) {
throw makeError();
}
relative(from, to) {
throw makeError();
}
basename(filePath, extension) {
throw makeError();
}
realpath(filePath) {
throw makeError();
}
getDefaultLibLocation() {
throw makeError();
}
normalize(path4) {
throw makeError();
}
};
function makeError() {
return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/util.mjs
var TS_DTS_JS_EXTENSION = /(?:\.d)?\.ts$|\.js$/;
function stripExtension(path4) {
return path4.replace(TS_DTS_JS_EXTENSION, "");
}
function getSourceFileOrError(program, fileName) {
const sf = program.getSourceFile(fileName);
if (sf === void 0) {
throw new Error(`Program does not contain "${fileName}" - available files are ${program.getSourceFiles().map((sf2) => sf2.fileName).join(", ")}`);
}
return sf;
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
var fs = new InvalidFileSystem();
function getFileSystem() {
return fs;
}
function setFileSystem(fileSystem) {
fs = fileSystem;
}
function absoluteFrom(path4) {
if (!fs.isRooted(path4)) {
throw new Error(`Internal Error: absoluteFrom(${path4}): path is not absolute`);
}
return fs.resolve(path4);
}
var ABSOLUTE_PATH = Symbol("AbsolutePath");
function absoluteFromSourceFile(sf) {
const sfWithPatch = sf;
if (sfWithPatch[ABSOLUTE_PATH] === void 0) {
sfWithPatch[ABSOLUTE_PATH] = fs.resolve(sfWithPatch.fileName);
}
return sfWithPatch[ABSOLUTE_PATH];
}
function dirname(file) {
return fs.dirname(file);
}
function join(basePath, ...paths) {
return fs.join(basePath, ...paths);
}
function resolve(basePath, ...paths) {
return fs.resolve(basePath, ...paths);
}
function isRooted(path4) {
return fs.isRooted(path4);
}
function relative(from, to) {
return fs.relative(from, to);
}
function isLocalRelativePath(relativePath) {
return !isRooted(relativePath) && !relativePath.startsWith("..");
}
function toRelativeImport(relativePath) {
return isLocalRelativePath(relativePath) ? `./${relativePath}` : relativePath;
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/logical.mjs
var LogicalProjectPath = {
relativePathBetween: function(from, to) {
const relativePath = relative(dirname(resolve(from)), resolve(to));
return toRelativeImport(relativePath);
}
};
var LogicalFileSystem = class {
constructor(rootDirs, compilerHost) {
this.compilerHost = compilerHost;
this.cache = /* @__PURE__ */ new Map();
this.rootDirs = rootDirs.concat([]).sort((a, b) => b.length - a.length);
this.canonicalRootDirs = this.rootDirs.map((dir) => this.compilerHost.getCanonicalFileName(dir));
}
logicalPathOfSf(sf) {
return this.logicalPathOfFile(absoluteFromSourceFile(sf));
}
logicalPathOfFile(physicalFile) {
if (!this.cache.has(physicalFile)) {
const canonicalFilePath = this.compilerHost.getCanonicalFileName(physicalFile);
let logicalFile = null;
for (let i = 0; i < this.rootDirs.length; i++) {
const rootDir = this.rootDirs[i];
const canonicalRootDir = this.canonicalRootDirs[i];
if (isWithinBasePath(canonicalRootDir, canonicalFilePath)) {
logicalFile = this.createLogicalProjectPath(physicalFile, rootDir);
if (logicalFile.indexOf("/node_modules/") !== -1) {
logicalFile = null;
} else {
break;
}
}
}
this.cache.set(physicalFile, logicalFile);
}
return this.cache.get(physicalFile);
}
createLogicalProjectPath(file, rootDir) {
const logicalPath = stripExtension(file.slice(rootDir.length));
return logicalPath.startsWith("/") ? logicalPath : "/" + logicalPath;
}
};
function isWithinBasePath(base, path4) {
return isLocalRelativePath(relative(base, path4));
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
var import_fs = __toESM(require("fs"), 1);
var import_module = __toESM(require("module"), 1);
var p = __toESM(require("path"), 1);
var import_url = require("url");
var import_meta = {};
var NodeJSPathManipulation = class {
pwd() {
return this.normalize(process.cwd());
}
chdir(dir) {
process.chdir(dir);
}
resolve(...paths) {
return this.normalize(p.resolve(...paths));
}
dirname(file) {
return this.normalize(p.dirname(file));
}
join(basePath, ...paths) {
return this.normalize(p.join(basePath, ...paths));
}
isRoot(path4) {
return this.dirname(path4) === this.normalize(path4);
}
isRooted(path4) {
return p.isAbsolute(path4);
}
relative(from, to) {
return this.normalize(p.relative(from, to));
}
basename(filePath, extension) {
return p.basename(filePath, extension);
}
extname(path4) {
return p.extname(path4);
}
normalize(path4) {
return path4.replace(/\\/g, "/");
}
};
var isCommonJS = typeof __filename !== "undefined";
var currentFileUrl = isCommonJS ? null : import_meta.url;
var currentFileName = isCommonJS ? __filename : (0, import_url.fileURLToPath)(currentFileUrl);
var NodeJSReadonlyFileSystem = class extends NodeJSPathManipulation {
constructor() {
super(...arguments);
this._caseSensitive = void 0;
}
isCaseSensitive() {
if (this._caseSensitive === void 0) {
this._caseSensitive = !import_fs.default.existsSync(this.normalize(toggleCase(currentFileName)));
}
return this._caseSensitive;
}
exists(path4) {
return import_fs.default.existsSync(path4);
}
readFile(path4) {
return import_fs.default.readFileSync(path4, "utf8");
}
readFileBuffer(path4) {
return import_fs.default.readFileSync(path4);
}
readdir(path4) {
return import_fs.default.readdirSync(path4);
}
lstat(path4) {
return import_fs.default.lstatSync(path4);
}
stat(path4) {
return import_fs.default.statSync(path4);
}
realpath(path4) {
return this.resolve(import_fs.default.realpathSync(path4));
}
getDefaultLibLocation() {
const requireFn = isCommonJS ? require : import_module.default.createRequire(currentFileUrl);
return this.resolve(requireFn.resolve("typescript"), "..");
}
};
var NodeJSFileSystem = class extends NodeJSReadonlyFileSystem {
writeFile(path4, data, exclusive = false) {
import_fs.default.writeFileSync(path4, data, exclusive ? { flag: "wx" } : void 0);
}
removeFile(path4) {
import_fs.default.unlinkSync(path4);
}
symlink(target, path4) {
import_fs.default.symlinkSync(target, path4);
}
copyFile(from, to) {
import_fs.default.copyFileSync(from, to);
}
moveFile(from, to) {
import_fs.default.renameSync(from, to);
}
ensureDir(path4) {
import_fs.default.mkdirSync(path4, { recursive: true });
}
removeDeep(path4) {
import_fs.default.rmdirSync(path4, { recursive: true });
}
};
function toggleCase(str) {
return str.replace(/\w/g, (ch) => ch.toUpperCase() === ch ? ch.toLowerCase() : ch.toUpperCase());
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/selector.mjs
var _SELECTOR_REGEXP = new RegExp(
`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
"g"
);
var CssSelector = class {
constructor() {
this.element = null;
this.classNames = [];
this.attrs = [];
this.notSelectors = [];
}
static parse(selector) {
const results = [];
const _addResult = (res, cssSel) => {
if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 && cssSel.attrs.length == 0) {
cssSel.element = "*";
}
res.push(cssSel);
};
let cssSelector = new CssSelector();
let match;
let current = cssSelector;
let inNot = false;
_SELECTOR_REGEXP.lastIndex = 0;
while (match = _SELECTOR_REGEXP.exec(selector)) {
if (match[1]) {
if (inNot) {
throw new Error("Nesting :not in a selector is not allowed");
}
inNot = true;
current = new CssSelector();
cssSelector.notSelectors.push(current);
}
const tag = match[2];
if (tag) {
const prefix = match[3];
if (prefix === "#") {
current.addAttribute("id", tag.slice(1));
} else if (prefix === ".") {
current.addClassName(tag.slice(1));
} else {
current.setElement(tag);
}
}
const attribute2 = match[4];
if (attribute2) {
current.addAttribute(current.unescapeAttribute(attribute2), match[6]);
}
if (match[7]) {
inNot = false;
current = cssSelector;
}
if (match[8]) {
if (inNot) {
throw new Error("Multiple selectors in :not are not supported");
}
_addResult(results, cssSelector);
cssSelector = current = new CssSelector();
}
}
_addResult(results, cssSelector);
return results;
}
unescapeAttribute(attr) {
let result = "";
let escaping = false;
for (let i = 0; i < attr.length; i++) {
const char = attr.charAt(i);
if (char === "\\") {
escaping = true;
continue;
}
if (char === "$" && !escaping) {
throw new Error(`Error in attribute selector "${attr}". Unescaped "$" is not supported. Please escape with "\\$".`);
}
escaping = false;
result += char;
}
return result;
}
escapeAttribute(attr) {
return attr.replace(/\\/g, "\\\\").replace(/\$/g, "\\$");
}
isElementSelector() {
return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 && this.notSelectors.length === 0;
}
hasElementSelector() {
return !!this.element;
}
setElement(element2 = null) {
this.element = element2;
}
getAttrs() {
const result = [];
if (this.classNames.length > 0) {
result.push("class", this.classNames.join(" "));
}
return result.concat(this.attrs);
}
addAttribute(name, value = "") {
this.attrs.push(name, value && value.toLowerCase() || "");
}
addClassName(name) {
this.classNames.push(name.toLowerCase());
}
toString() {
let res = this.element || "";
if (this.classNames) {
this.classNames.forEach((klass) => res += `.${klass}`);
}
if (this.attrs) {
for (let i = 0; i < this.attrs.length; i += 2) {
const name = this.escapeAttribute(this.attrs[i]);
const value = this.attrs[i + 1];
res += `[${name}${value ? "=" + value : ""}]`;
}
}
this.notSelectors.forEach((notSelector) => res += `:not(${notSelector})`);
return res;
}
};
var SelectorMatcher = class {
constructor() {
this._elementMap = /* @__PURE__ */ new Map();
this._elementPartialMap = /* @__PURE__ */ new Map();
this._classMap = /* @__PURE__ */ new Map();
this._classPartialMap = /* @__PURE__ */ new Map();
this._attrValueMap = /* @__PURE__ */ new Map();
this._attrValuePartialMap = /* @__PURE__ */ new Map();
this._listContexts = [];
}
static createNotMatcher(notSelectors) {
const notMatcher = new SelectorMatcher();
notMatcher.addSelectables(notSelectors, null);
return notMatcher;
}
addSelectables(cssSelectors, callbackCtxt) {
let listContext = null;
if (cssSelectors.length > 1) {
listContext = new SelectorListContext(cssSelectors);
this._listContexts.push(listContext);
}
for (let i = 0; i < cssSelectors.length; i++) {
this._addSelectable(cssSelectors[i], callbackCtxt, listContext);
}
}
_addSelectable(cssSelector, callbackCtxt, listContext) {
let matcher = this;
const element2 = cssSelector.element;
const classNames = cssSelector.classNames;
const attrs = cssSelector.attrs;
const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext);
if (element2) {
const isTerminal = attrs.length === 0 && classNames.length === 0;
if (isTerminal) {
this._addTerminal(matcher._elementMap, element2, selectable);
} else {
matcher = this._addPartial(matcher._elementPartialMap, element2);
}
}
if (classNames) {
for (let i = 0; i < classNames.length; i++) {
const isTerminal = attrs.length === 0 && i === classNames.length - 1;
const className = classNames[i];
if (isTerminal) {
this._addTerminal(matcher._classMap, className, selectable);
} else {
matcher = this._addPartial(matcher._classPartialMap, className);
}
}
}
if (attrs) {
for (let i = 0; i < attrs.length; i += 2) {
const isTerminal = i === attrs.length - 2;
const name = attrs[i];
const value = attrs[i + 1];
if (isTerminal) {
const terminalMap = matcher._attrValueMap;
let terminalValuesMap = terminalMap.get(name);
if (!terminalValuesMap) {
terminalValuesMap = /* @__PURE__ */ new Map();
terminalMap.set(name, terminalValuesMap);
}
this._addTerminal(terminalValuesMap, value, selectable);
} else {
const partialMap = matcher._attrValuePartialMap;
let partialValuesMap = partialMap.get(name);
if (!partialValuesMap) {
partialValuesMap = /* @__PURE__ */ new Map();
partialMap.set(name, partialValuesMap);
}
matcher = this._addPartial(partialValuesMap, value);
}
}
}
}
_addTerminal(map, name, selectable) {
let terminalList = map.get(name);
if (!terminalList) {
terminalList = [];
map.set(name, terminalList);
}
terminalList.push(selectable);
}
_addPartial(map, name) {
let matcher = map.get(name);
if (!matcher) {
matcher = new SelectorMatcher();
map.set(name, matcher);
}
return matcher;
}
match(cssSelector, matchedCallback) {
let result = false;
const element2 = cssSelector.element;
const classNames = cssSelector.classNames;
const attrs = cssSelector.attrs;
for (let i = 0; i < this._listContexts.length; i++) {
this._listContexts[i].alreadyMatched = false;
}
result = this._matchTerminal(this._elementMap, element2, cssSelector, matchedCallback) || result;
result = this._matchPartial(this._elementPartialMap, element2, cssSelector, matchedCallback) || result;
if (classNames) {
for (let i = 0; i < classNames.length; i++) {
const className = classNames[i];
result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result;
result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result;
}
}
if (attrs) {
for (let i = 0; i < attrs.length; i += 2) {
const name = attrs[i];
const value = attrs[i + 1];
const terminalValuesMap = this._attrValueMap.get(name);
if (value) {
result = this._matchTerminal(terminalValuesMap, "", cssSelector, matchedCallback) || result;
}
result = this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result;
const partialValuesMap = this._attrValuePartialMap.get(name);
if (value) {
result = this._matchPartial(partialValuesMap, "", cssSelector, matchedCallback) || result;
}
result = this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result;
}
}
return result;
}
_matchTerminal(map, name, cssSelector, matchedCallback) {
if (!map || typeof name !== "string") {
return false;
}
let selectables = map.get(name) || [];
const starSelectables = map.get("*");
if (starSelectables) {
selectables = selectables.concat(starSelectables);
}
if (selectables.length === 0) {
return false;
}
let selectable;
let result = false;
for (let i = 0; i < selectables.length; i++) {
selectable = selectables[i];
result = selectable.finalize(cssSelector, matchedCallback) || result;
}
return result;
}
_matchPartial(map, name, cssSelector, matchedCallback) {
if (!map || typeof name !== "string") {
return false;
}
const nestedSelector = map.get(name);
if (!nestedSelector) {
return false;
}
return nestedSelector.match(cssSelector, matchedCallback);
}
};
var SelectorListContext = class {
constructor(selectors) {
this.selectors = selectors;
this.alreadyMatched = false;
}
};
var SelectorContext = class {
constructor(selector, cbContext, listContext) {
this.selector = selector;
this.cbContext = cbContext;
this.listContext = listContext;
this.notSelectors = selector.notSelectors;
}
finalize(cssSelector, callback) {
let result = true;
if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) {
const notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors);
result = !notMatcher.match(cssSelector, null);
}
if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) {
if (this.listContext) {
this.listContext.alreadyMatched = true;
}
callback(this.selector, this.cbContext);
}
return result;
}
};
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/core.mjs
var emitDistinctChangesOnlyDefaultValue = true;
var ViewEncapsulation;
(function(ViewEncapsulation2) {
ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
ViewEncapsulation2[ViewEncapsulation2["None"] = 2] = "None";
ViewEncapsulation2[ViewEncapsulation2["ShadowDom"] = 3] = "ShadowDom";
})(ViewEncapsulation || (ViewEncapsulation = {}));
var ChangeDetectionStrategy;
(function(ChangeDetectionStrategy2) {
ChangeDetectionStrategy2[ChangeDetectionStrategy2["OnPush"] = 0] = "OnPush";
ChangeDetectionStrategy2[ChangeDetectionStrategy2["Default"] = 1] = "Default";
})(ChangeDetectionStrategy || (ChangeDetectionStrategy = {}));
var InputFlags;
(function(InputFlags2) {
InputFlags2[InputFlags2["None"] = 0] = "None";
InputFlags2[InputFlags2["SignalBased"] = 1] = "SignalBased";
InputFlags2[InputFlags2["HasDecoratorInputTransform"] = 2] = "HasDecoratorInputTransform";
})(InputFlags || (InputFlags = {}));
var CUSTOM_ELEMENTS_SCHEMA = {
name: "custom-elements"
};
var NO_ERRORS_SCHEMA = {
name: "no-errors-schema"
};
var SecurityContext;
(function(SecurityContext2) {
SecurityContext2[SecurityContext2["NONE"] = 0] = "NONE";
SecurityContext2[SecurityContext2["HTML"] = 1] = "HTML";
SecurityContext2[SecurityContext2["STYLE"] = 2] = "STYLE";
SecurityContext2[SecurityContext2["SCRIPT"] = 3] = "SCRIPT";
SecurityContext2[SecurityContext2["URL"] = 4] = "URL";
SecurityContext2[SecurityContext2["RESOURCE_URL"] = 5] = "RESOURCE_URL";
})(SecurityContext || (SecurityContext = {}));
var MissingTranslationStrategy;
(function(MissingTranslationStrategy2) {
MissingTranslationStrategy2[MissingTranslationStrategy2["Error"] = 0] = "Error";
MissingTranslationStrategy2[MissingTranslationStrategy2["Warning"] = 1] = "Warning";
MissingTranslationStrategy2[MissingTranslationStrategy2["Ignore"] = 2] = "Ignore";
})(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
function parserSelectorToSimpleSelector(selector) {
const classes = selector.classNames && selector.classNames.length ? [8, ...selector.classNames] : [];
const elementName = selector.element && selector.element !== "*" ? selector.element : "";
return [elementName, ...selector.attrs, ...classes];
}
function parserSelectorToNegativeSelector(selector) {
const classes = selector.classNames && selector.classNames.length ? [8, ...selector.classNames] : [];
if (selector.element) {
return [
1 | 4,
selector.element,
...selector.attrs,
...classes
];
} else if (selector.attrs.length) {
return [1 | 2, ...selector.attrs, ...classes];
} else {
return selector.classNames && selector.classNames.length ? [1 | 8, ...selector.classNames] : [];
}
}
function parserSelectorToR3Selector(selector) {
const positive = parserSelectorToSimpleSelector(selector);
const negative = selector.notSelectors && selector.notSelectors.length ? selector.notSelectors.map((notSelector) => parserSelectorToNegativeSelector(notSelector)) : [];
return positive.concat(...negative);
}
function parseSelectorToR3Selector(selector) {
return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
var output_ast_exports = {};
__export(output_ast_exports, {
ArrayType: () => ArrayType,
ArrowFunctionExpr: () => ArrowFunctionExpr,
BOOL_TYPE: () => BOOL_TYPE,
BinaryOperator: () => BinaryOperator,
BinaryOperatorExpr: () => BinaryOperatorExpr,
BuiltinType: () => BuiltinType,
BuiltinTypeName: () => BuiltinTypeName,
CommaExpr: () => CommaExpr,
ConditionalExpr: () => ConditionalExpr,
DYNAMIC_TYPE: () => DYNAMIC_TYPE,
DeclareFunctionStmt: () => DeclareFunctionStmt,
DeclareVarStmt: () => DeclareVarStmt,
DynamicImportExpr: () => DynamicImportExpr,
Expression: () => Expression,
ExpressionStatement: () => ExpressionStatement,
ExpressionType: () => ExpressionType,
ExternalExpr: () => ExternalExpr,
ExternalReference: () => ExternalReference,
FUNCTION_TYPE: () => FUNCTION_TYPE,
FnParam: () => FnParam,
FunctionExpr: () => FunctionExpr,
INFERRED_TYPE: () => INFERRED_TYPE,
INT_TYPE: () => INT_TYPE,
IfStmt: () => IfStmt,
InstantiateExpr: () => InstantiateExpr,
InvokeFunctionExpr: () => InvokeFunctionExpr,
JSDocComment: () => JSDocComment,
LeadingComment: () => LeadingComment,
LiteralArrayExpr: () => LiteralArrayExpr,
LiteralExpr: () => LiteralExpr,
LiteralMapEntry: () => LiteralMapEntry,
LiteralMapExpr: () => LiteralMapExpr,
LiteralPiece: () => LiteralPiece,
LocalizedString: () => LocalizedString,
MapType: () => MapType,
NONE_TYPE: () => NONE_TYPE,
NULL_EXPR: () => NULL_EXPR,
NUMBER_TYPE: () => NUMBER_TYPE,
NotExpr: () => NotExpr,
PlaceholderPiece: () => PlaceholderPiece,
ReadKeyExpr: () => ReadKeyExpr,
ReadPropExpr: () => ReadPropExpr,
ReadVarExpr: () => ReadVarExpr,
RecursiveAstVisitor: () => RecursiveAstVisitor,
ReturnStatement: () => ReturnStatement,
STRING_TYPE: () => STRING_TYPE,
Statement: () => Statement,
StmtModifier: () => StmtModifier,
TYPED_NULL_EXPR: () => TYPED_NULL_EXPR,
TaggedTemplateExpr: () => TaggedTemplateExpr,
TemplateLiteral: () => TemplateLiteral,
TemplateLiteralElement: () => TemplateLiteralElement,
TransplantedType: () => TransplantedType,
Type: () => Type,
TypeModifier: () => TypeModifier,
TypeofExpr: () => TypeofExpr,
UnaryOperator: () => UnaryOperator,
UnaryOperatorExpr: () => UnaryOperatorExpr,
WrappedNodeExpr: () => WrappedNodeExpr,
WriteKeyExpr: () => WriteKeyExpr,
WritePropExpr: () => WritePropExpr,
WriteVarExpr: () => WriteVarExpr,
areAllEquivalent: () => areAllEquivalent,
arrowFn: () => arrowFn,
expressionType: () => expressionType,
fn: () => fn,
ifStmt: () => ifStmt,
importExpr: () => importExpr,
importType: () => importType,
isNull: () => isNull,
jsDocComment: () => jsDocComment,
leadingComment: () => leadingComment,
literal: () => literal,
literalArr: () => literalArr,
literalMap: () => literalMap,
localizedString: () => localizedString,
not: () => not,
nullSafeIsEquivalent: () => nullSafeIsEquivalent,
taggedTemplate: () => taggedTemplate,
transplantedType: () => transplantedType,
typeofExpr: () => typeofExpr,
unary: () => unary,
variable: () => variable
});
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
var textEncoder;
function digest(message) {
return message.id || computeDigest(message);
}
function computeDigest(message) {
return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
}
function decimalDigest(message) {
return message.id || computeDecimalDigest(message);
}
function computeDecimalDigest(message) {
const visitor = new _SerializerIgnoreIcuExpVisitor();
const parts = message.nodes.map((a) => a.visit(visitor, null));
return computeMsgId(parts.join(""), message.meaning);
}
var _SerializerVisitor = class {
visitText(text2, context) {
return text2.value;
}
visitContainer(container, context) {
return `[${container.children.map((child) => child.visit(this)).join(", ")}]`;
}
visitIcu(icu, context) {
const strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
return `{${icu.expression}, ${icu.type}, ${strCases.join(", ")}}`;
}
visitTagPlaceholder(ph, context) {
return ph.isVoid ? `<ph tag name="${ph.startName}"/>` : `<ph tag name="${ph.startName}">${ph.children.map((child) => child.visit(this)).join(", ")}</ph name="${ph.closeName}">`;
}
visitPlaceholder(ph, context) {
return ph.value ? `<ph name="${ph.name}">${ph.value}</ph>` : `<ph name="${ph.name}"/>`;
}
visitIcuPlaceholder(ph, context) {
return `<ph icu name="${ph.name}">${ph.value.visit(this)}</ph>`;
}
visitBlockPlaceholder(ph, context) {
return `<ph block name="${ph.startName}">${ph.children.map((child) => child.visit(this)).join(", ")}</ph name="${ph.closeName}">`;
}
};
var serializerVisitor = new _SerializerVisitor();
function serializeNodes(nodes) {
return nodes.map((a) => a.visit(serializerVisitor, null));
}
var _SerializerIgnoreIcuExpVisitor = class extends _SerializerVisitor {
visitIcu(icu, context) {
let strCases = Object.keys(icu.cases).map((k) => `${k} {${icu.cases[k].visit(this)}}`);
return `{${icu.type}, ${strCases.join(", ")}}`;
}
};
function sha1(str) {
textEncoder != null ? textEncoder : textEncoder = new TextEncoder();
const utf8 = [...textEncoder.encode(str)];
const words32 = bytesToWords32(utf8, Endian.Big);
const len = utf8.length * 8;
const w = new Uint32Array(80);
let a = 1732584193, b = 4023233417, c = 2562383102, d = 271733878, e = 3285377520;
words32[len >> 5] |= 128 << 24 - len % 32;
words32[(len + 64 >> 9 << 4) + 15] = len;
for (let i = 0; i < words32.length; i += 16) {
const h0 = a, h1 = b, h2 = c, h3 = d, h4 = e;
for (let j = 0; j < 80; j++) {
if (j < 16) {
w[j] = words32[i + j];
} else {
w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
}
const fkVal = fk(j, b, c, d);
const f = fkVal[0];
const k = fkVal[1];
const temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32);
e = d;
d = c;
c = rol32(b, 30);
b = a;
a = temp;
}
a = add32(a, h0);
b = add32(b, h1);
c = add32(c, h2);
d = add32(d, h3);
e = add32(e, h4);
}
return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e);
}
function toHexU32(value) {
return (value >>> 0).toString(16).padStart(8, "0");
}
function fk(index, b, c, d) {
if (index < 20) {
return [b & c | ~b & d, 1518500249];
}
if (index < 40) {
return [b ^ c ^ d, 1859775393];
}
if (index < 60) {
return [b & c | b & d | c & d, 2400959708];
}
return [b ^ c ^ d, 3395469782];
}
function fingerprint(str) {
textEncoder != null ? textEncoder : textEncoder = new TextEncoder();
const utf8 = textEncoder.encode(str);
const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);
let hi = hash32(view, utf8.length, 0);
let lo = hash32(view, utf8.length, 102072);
if (hi == 0 && (lo == 0 || lo == 1)) {
hi = hi ^ 319790063;
lo = lo ^ -1801410264;
}
return BigInt.asUintN(32, BigInt(hi)) << BigInt(32) | BigInt.asUintN(32, BigInt(lo));
}
function computeMsgId(msg, meaning = "") {
let msgFingerprint = fingerprint(msg);
if (meaning) {
msgFingerprint = BigInt.asUintN(64, msgFingerprint << BigInt(1)) | msgFingerprint >> BigInt(63) & BigInt(1);
msgFingerprint += fingerprint(meaning);
}
return BigInt.asUintN(63, msgFingerprint).toString();
}
function hash32(view, length, c) {
let a = 2654435769, b = 2654435769;
let index = 0;
const end = length - 12;
for (; index <= end; index += 12) {
a += view.getUint32(index, true);
b += view.getUint32(index + 4, true);
c += view.getUint32(index + 8, true);
const res = mix(a, b, c);
a = res[0], b = res[1], c = res[2];
}
const remainder = length - index;
c += length;
if (remainder >= 4) {
a += view.getUint32(index, true);
index += 4;
if (remainder >= 8) {
b += view.getUint32(index, true);
index += 4;
if (remainder >= 9) {
c += view.getUint8(index++) << 8;
}
if (remainder >= 10) {
c += view.getUint8(index++) << 16;
}
if (remainder === 11) {
c += view.getUint8(index++) << 24;
}
} else {
if (remainder >= 5) {
b += view.getUint8(index++);
}
if (remainder >= 6) {
b += view.getUint8(index++) << 8;
}
if (remainder === 7) {
b += view.getUint8(index++) << 16;
}
}
} else {
if (remainder >= 1) {
a += view.getUint8(index++);
}
if (remainder >= 2) {
a += view.getUint8(index++) << 8;
}
if (remainder === 3) {
a += view.getUint8(index++) << 16;
}
}
return mix(a, b, c)[2];
}
function mix(a, b, c) {
a -= b;
a -= c;
a ^= c >>> 13;
b -= c;
b -= a;
b ^= a << 8;
c -= a;
c -= b;
c ^= b >>> 13;
a -= b;
a -= c;
a ^= c >>> 12;
b -= c;
b -= a;
b ^= a << 16;
c -= a;
c -= b;
c ^= b >>> 5;
a -= b;
a -= c;
a ^= c >>> 3;
b -= c;
b -= a;
b ^= a << 10;
c -= a;
c -= b;
c ^= b >>> 15;
return [a, b, c];
}
var Endian;
(function(Endian2) {
Endian2[Endian2["Little"] = 0] = "Little";
Endian2[Endian2["Big"] = 1] = "Big";
})(Endian || (Endian = {}));
function add32(a, b) {
return add32to64(a, b)[1];
}
function add32to64(a, b) {
const low = (a & 65535) + (b & 65535);
const high = (a >>> 16) + (b >>> 16) + (low >>> 16);
return [high >>> 16, high << 16 | low & 65535];
}
function rol32(a, count) {
return a << count | a >>> 32 - count;
}
function bytesToWords32(bytes, endian) {
const size = bytes.length + 3 >>> 2;
const words32 = [];
for (let i = 0; i < size; i++) {
words32[i] = wordAt(bytes, i * 4, endian);
}
return words32;
}
function byteAt(bytes, index) {
return index >= bytes.length ? 0 : bytes[index];
}
function wordAt(bytes, index, endian) {
let word = 0;
if (endian === Endian.Big) {
for (let i = 0; i < 4; i++) {
word += byteAt(bytes, index + i) << 24 - 8 * i;
}
} else {
for (let i = 0; i < 4; i++) {
word += byteAt(bytes, index + i) << 8 * i;
}
}
return word;
}
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
var TypeModifier;
(function(TypeModifier2) {
TypeModifier2[TypeModifier2["None"] = 0] = "None";
TypeModifier2[TypeModifier2["Const"] = 1] = "Const";
})(TypeModifier || (TypeModifier = {}));
var Type = class {
constructor(modifiers = TypeModifier.None) {
this.modifiers = modifiers;
}
hasModifier(modifier) {
return (this.modifiers & modifier) !== 0;
}
};
var BuiltinTypeName;
(function(BuiltinTypeName2) {
BuiltinTypeName2[BuiltinTypeName2["Dynamic"] = 0] = "Dynamic";
BuiltinTypeName2[BuiltinTypeName2["Bool"] = 1] = "Bool";
BuiltinTypeName2[BuiltinTypeName2["String"] = 2] = "String";
BuiltinTypeName2[BuiltinTypeName2["Int"] = 3] = "Int";
BuiltinTypeName2[BuiltinTypeName2["Number"] = 4] = "Number";
BuiltinTypeName2[BuiltinTypeName2["Function"] = 5] = "Function";
BuiltinTypeName2[BuiltinTypeName2["Inferred"] = 6] = "Inferred";
BuiltinTypeName2[BuiltinTypeName2["None"] = 7] = "None";
})(BuiltinTypeName || (BuiltinTypeName = {}));
var BuiltinType = class extends Type {
constructor(name, modifiers) {
super(modifiers);
this.name = name;
}
visitType(visitor, context) {
return visitor.visitBuiltinType(this, context);
}
};
var ExpressionType = class extends Type {
constructor(value, modifiers, typeParams = null) {
super(modifiers);
this.value = value;
this.typeParams = typeParams;
}
visitType(visitor, context) {
return visitor.visitExpressionType(this, context);
}
};
var ArrayType = class extends Type {
constructor(of, modifiers) {
super(modifiers);
this.of = of;
}
visitType(visitor, context) {
return visitor.visitArrayType(this, context);
}
};
var MapType = class extends Type {
constructor(valueType, modifiers) {
super(modifiers);
this.valueType = valueType || null;
}
visitType(visitor, context) {
return visitor.visitMapType(this, context);
}
};
var TransplantedType = class extends Type {
constructor(type, modifiers) {
super(modifiers);
this.type = type;
}
visitType(visitor, context) {
return visitor.visitTransplantedType(this, context);
}
};
var DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic);
var INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred);
var BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool);
var INT_TYPE = new BuiltinType(BuiltinTypeName.Int);
var NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number);
var STRING_TYPE = new BuiltinType(BuiltinTypeName.String);
var FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function);
var NONE_TYPE = new BuiltinType(BuiltinTypeName.None);
var UnaryOperator;
(function(UnaryOperator2) {
UnaryOperator2[UnaryOperator2["Minus"] = 0] = "Minus";
UnaryOperator2[UnaryOperator2["Plus"] = 1] = "Plus";
})(UnaryOperator || (UnaryOperator = {}));
var BinaryOperator;
(function(BinaryOperator2) {
BinaryOperator2[BinaryOperator2["Equals"] = 0] = "Equals";
BinaryOperator2[BinaryOperator2["NotEquals"] = 1] = "NotEquals";
BinaryOperator2[BinaryOperator2["Identical"] = 2] = "Identical";
BinaryOperator2[BinaryOperator2["NotIdentical"] = 3] = "NotIdentical";
BinaryOperator2[BinaryOperator2["Minus"] = 4] = "Minus";
BinaryOperator2[BinaryOperator2["Plus"] = 5] = "Plus";
BinaryOperator2[BinaryOperator2["Divide"] = 6] = "Divide";
BinaryOperator2[BinaryOperator2["Multiply"] = 7] = "Multiply";
BinaryOperator2[BinaryOperator2["Modulo"] = 8] = "Modulo";
BinaryOperator2[BinaryOperator2["And"] = 9] = "And";
BinaryOperator2[BinaryOperator2["Or"] = 10] = "Or";
BinaryOperator2[BinaryOperator2["BitwiseOr"] = 11] = "BitwiseOr";
BinaryOperator2[BinaryOperator2["BitwiseAnd"] = 12] = "BitwiseAnd";
BinaryOperator2[BinaryOperator2["Lower"] = 13] = "Lower";
BinaryOperator2[BinaryOperator2["LowerEquals"] = 14] = "LowerEquals";
BinaryOperator2[BinaryOperator2["Bigger"] = 15] = "Bigger";
BinaryOperator2[BinaryOperator2["BiggerEquals"] = 16] = "BiggerEquals";
BinaryOperator2[BinaryOperator2["NullishCoalesce"] = 17] = "NullishCoalesce";
})(BinaryOperator || (BinaryOperator = {}));
function nullSafeIsEquivalent(base, other) {
if (base == null || other == null) {
return base == other;
}
return base.isEquivalent(other);
}
function areAllEquivalentPredicate(base, other, equivalentPredicate) {
const len = base.length;
if (len !== other.length) {
return false;
}
for (let i = 0; i < len; i++) {
if (!equivalentPredicate(base[i], other[i])) {
return false;
}
}
return true;
}
function areAllEquivalent(base, other) {
return areAllEquivalentPredicate(base, other, (baseElement, otherElement) => baseElement.isEquivalent(otherElement));
}
var Expression = class {
constructor(type, sourceSpan) {
this.type = type || null;
this.sourceSpan = sourceSpan || null;
}
prop(name, sourceSpan) {
return new ReadPropExpr(this, name, null, sourceSpan);
}
key(index, type, sourceSpan) {
return new ReadKeyExpr(this, index, type, sourceSpan);
}
callFn(params, sourceSpan, pure) {
return new InvokeFunctionExpr(this, params, null, sourceSpan, pure);
}
instantiate(params, type, sourceSpan) {
return new InstantiateExpr(this, params, type, sourceSpan);
}
conditional(trueCase, falseCase = null, sourceSpan) {
return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan);
}
equals(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan);
}
notEquals(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan);
}
identical(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan);
}
notIdentical(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan);
}
minus(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan);
}
plus(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan);
}
divide(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan);
}
multiply(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan);
}
modulo(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan);
}
and(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan);
}
bitwiseOr(rhs, sourceSpan, parens = true) {
return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan, parens);
}
bitwiseAnd(rhs, sourceSpan, parens = true) {
return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan, parens);
}
or(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan);
}
lower(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan);
}
lowerEquals(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan);
}
bigger(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan);
}
biggerEquals(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan);
}
isBlank(sourceSpan) {
return this.equals(TYPED_NULL_EXPR, sourceSpan);
}
nullishCoalesce(rhs, sourceSpan) {
return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan);
}
toStmt() {
return new ExpressionStatement(this, null);
}
};
var ReadVarExpr = class extends Expression {
constructor(name, type, sourceSpan) {
super(type, sourceSpan);
this.name = name;
}
isEquivalent(e) {
return e instanceof ReadVarExpr && this.name === e.name;
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitReadVarExpr(this, context);
}
clone() {
return new ReadVarExpr(this.name, this.type, this.sourceSpan);
}
set(value) {
return new WriteVarExpr(this.name, value, null, this.sourceSpan);
}
};
var TypeofExpr = class extends Expression {
constructor(expr, type, sourceSpan) {
super(type, sourceSpan);
this.expr = expr;
}
visitExpression(visitor, context) {
return visitor.visitTypeofExpr(this, context);
}
isEquivalent(e) {
return e instanceof TypeofExpr && e.expr.isEquivalent(this.expr);
}
isConstant() {
return this.expr.isConstant();
}
clone() {
return new TypeofExpr(this.expr.clone());
}
};
var WrappedNodeExpr = class extends Expression {
constructor(node, type, sourceSpan) {
super(type, sourceSpan);
this.node = node;
}
isEquivalent(e) {
return e instanceof WrappedNodeExpr && this.node === e.node;
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitWrappedNodeExpr(this, context);
}
clone() {
return new WrappedNodeExpr(this.node, this.type, this.sourceSpan);
}
};
var WriteVarExpr = class extends Expression {
constructor(name, value, type, sourceSpan) {
super(type || value.type, sourceSpan);
this.name = name;
this.value = value;
}
isEquivalent(e) {
return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value);
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitWriteVarExpr(this, context);
}
clone() {
return new WriteVarExpr(this.name, this.value.clone(), this.type, this.sourceSpan);
}
toDeclStmt(type, modifiers) {
return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan);
}
toConstDecl() {
return this.toDeclStmt(INFERRED_TYPE, StmtModifier.Final);
}
};
var WriteKeyExpr = class extends Expression {
constructor(receiver, index, value, type, sourceSpan) {
super(type || value.type, sourceSpan);
this.receiver = receiver;
this.index = index;
this.value = value;
}
isEquivalent(e) {
return e instanceof WriteKeyExpr && this.receiver.isEquivalent(e.receiver) && this.index.isEquivalent(e.index) && this.value.isEquivalent(e.value);
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitWriteKeyExpr(this, context);
}
clone() {
return new WriteKeyExpr(this.receiver.clone(), this.index.clone(), this.value.clone(), this.type, this.sourceSpan);
}
};
var WritePropExpr = class extends Expression {
constructor(receiver, name, value, type, sourceSpan) {
super(type || value.type, sourceSpan);
this.receiver = receiver;
this.name = name;
this.value = value;
}
isEquivalent(e) {
return e instanceof WritePropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.name && this.value.isEquivalent(e.value);
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitWritePropExpr(this, context);
}
clone() {
return new WritePropExpr(this.receiver.clone(), this.name, this.value.clone(), this.type, this.sourceSpan);
}
};
var InvokeFunctionExpr = class extends Expression {
constructor(fn2, args, type, sourceSpan, pure = false) {
super(type, sourceSpan);
this.fn = fn2;
this.args = args;
this.pure = pure;
}
get receiver() {
return this.fn;
}
isEquivalent(e) {
return e instanceof InvokeFunctionExpr && this.fn.isEquivalent(e.fn) && areAllEquivalent(this.args, e.args) && this.pure === e.pure;
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitInvokeFunctionExpr(this, context);
}
clone() {
return new InvokeFunctionExpr(this.fn.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan, this.pure);
}
};
var TaggedTemplateExpr = class extends Expression {
constructor(tag, template2, type, sourceSpan) {
super(type, sourceSpan);
this.tag = tag;
this.template = template2;
}
isEquivalent(e) {
return e instanceof TaggedTemplateExpr && this.tag.isEquivalent(e.tag) && areAllEquivalentPredicate(this.template.elements, e.template.elements, (a, b) => a.text === b.text) && areAllEquivalent(this.template.expressions, e.template.expressions);
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitTaggedTemplateExpr(this, context);
}
clone() {
return new TaggedTemplateExpr(this.tag.clone(), this.template.clone(), this.type, this.sourceSpan);
}
};
var InstantiateExpr = class extends Expression {
constructor(classExpr, args, type, sourceSpan) {
super(type, sourceSpan);
this.classExpr = classExpr;
this.args = args;
}
isEquivalent(e) {
return e instanceof InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) && areAllEquivalent(this.args, e.args);
}
isConstant() {
return false;
}
visitExpression(visitor, context) {
return visitor.visitInstantiateExpr(this, context);
}
clone() {
return new InstantiateExpr(this.classExpr.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan);
}
};
var LiteralExpr = class extends Expression {
constructor(value, type, sourceSpan) {
super(type, sourceSpan);
this.value = value;
}
isEquivalent(e) {
return e instanceof LiteralExpr && this.value === e.value;
}
isConstant() {
return true;
}
visitExpression(visitor, context) {
return visitor.visitLiteralExpr(this, context);
}
clone() {
return new LiteralExpr(this.value, this.type, this.sourceSpan);
}
};
var TemplateLiteral = class {
constructor(elements, expressions) {
this.elements = elements;
this.expressions = expressions;
}
clone() {
return new TemplateLiteral(this.elements.map((el) => el.clone()), this.expressions.map((expr) => expr.clone()));
}
};
var TemplateLiteralElement = class {
constructor(text2, sourceSpan, rawText) {
var _a2;
this.text = text2;
this.sourceSpan = sourceSpan;
this.rawText = (_a2 = rawText != null ? rawText : sourceSpan == null ? void 0 : sourceSpan.toString()) != null ? _a2 : escapeForTemplateLiteral(escapeSlashes(text2));
}
clone() {
return new TemplateLiteralElement(this.text, this.sourceSpan, this.rawText);
}
};
var LiteralPiece = class {
constructor(text2, sourceSpan) {
this.text = text2;
this.sourceSpan = sourceSpan;
}
};
var PlaceholderPiece = class {
constructor(text2, sourceSpan, associatedMessage) {
this.text = text2;
this.sourceSpan = sourceSpan;
this.associatedMessage = asso