@angular/material 17.0.0-next.7 → 17.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_index.scss +1 -1
- package/button/_button-theme.scss +49 -51
- package/button/_icon-button-theme.scss +12 -31
- package/button/index.d.ts +0 -2
- package/chips/index.d.ts +2 -3
- package/core/index.d.ts +2 -3
- package/core/tokens/m2/mat/_sort.scss +60 -0
- package/core/tokens/m2/mat/_tree.scss +62 -0
- package/core/tokens/m2/mdc/{_button-filled.scss → _filled-button.scss} +1 -1
- package/core/tokens/m2/mdc/_icon-button.scss +19 -6
- package/core/tokens/m2/mdc/{_button-protected.scss → _protected-button.scss} +1 -1
- package/core/tokens/m2/mdc/_text-button.scss +103 -0
- package/divider/_divider-theme.scss +4 -1
- package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
- package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
- package/esm2022/autocomplete/autocomplete.mjs +4 -4
- package/esm2022/autocomplete/module.mjs +5 -5
- package/esm2022/badge/badge-module.mjs +5 -5
- package/esm2022/badge/badge.mjs +4 -4
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
- package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
- package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
- package/esm2022/button/button-base.mjs +19 -24
- package/esm2022/button/button.mjs +9 -9
- package/esm2022/button/fab.mjs +13 -13
- package/esm2022/button/icon-button.mjs +9 -9
- package/esm2022/button/module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
- package/esm2022/button-toggle/button-toggle.mjs +8 -8
- package/esm2022/card/card.mjs +43 -43
- package/esm2022/card/module.mjs +5 -5
- package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
- package/esm2022/checkbox/checkbox.mjs +5 -5
- package/esm2022/checkbox/module.mjs +9 -9
- package/esm2022/chips/chip-action.mjs +4 -4
- package/esm2022/chips/chip-edit-input.mjs +4 -4
- package/esm2022/chips/chip-grid.mjs +4 -4
- package/esm2022/chips/chip-icons.mjs +10 -10
- package/esm2022/chips/chip-input.mjs +4 -4
- package/esm2022/chips/chip-listbox.mjs +4 -4
- package/esm2022/chips/chip-option.mjs +7 -8
- package/esm2022/chips/chip-row.mjs +8 -9
- package/esm2022/chips/chip-set.mjs +4 -4
- package/esm2022/chips/chip.mjs +6 -7
- package/esm2022/chips/module.mjs +8 -9
- package/esm2022/core/common-behaviors/common-module.mjs +5 -5
- package/esm2022/core/datetime/index.mjs +9 -9
- package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
- package/esm2022/core/error/error-options.mjs +7 -7
- package/esm2022/core/line/line.mjs +8 -8
- package/esm2022/core/option/index.mjs +6 -7
- package/esm2022/core/option/optgroup.mjs +4 -4
- package/esm2022/core/option/option.mjs +8 -9
- package/esm2022/core/private/ripple-loader.mjs +4 -4
- package/esm2022/core/ripple/index.mjs +5 -5
- package/esm2022/core/ripple/ripple.mjs +4 -4
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
- package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +5 -5
- package/esm2022/datepicker/calendar.mjs +13 -14
- package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
- package/esm2022/datepicker/date-range-input.mjs +4 -4
- package/esm2022/datepicker/date-range-picker.mjs +4 -4
- package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
- package/esm2022/datepicker/date-selection-model.mjs +10 -10
- package/esm2022/datepicker/datepicker-actions.mjs +10 -10
- package/esm2022/datepicker/datepicker-base.mjs +7 -7
- package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
- package/esm2022/datepicker/datepicker-input.mjs +4 -4
- package/esm2022/datepicker/datepicker-intl.mjs +4 -4
- package/esm2022/datepicker/datepicker-module.mjs +5 -5
- package/esm2022/datepicker/datepicker-toggle.mjs +9 -10
- package/esm2022/datepicker/datepicker.mjs +4 -4
- package/esm2022/datepicker/month-view.mjs +6 -7
- package/esm2022/datepicker/multi-year-view.mjs +4 -4
- package/esm2022/datepicker/year-view.mjs +4 -4
- package/esm2022/dialog/dialog-container.mjs +4 -4
- package/esm2022/dialog/dialog-content-directives.mjs +13 -13
- package/esm2022/dialog/dialog.mjs +4 -4
- package/esm2022/dialog/module.mjs +5 -5
- package/esm2022/divider/divider-module.mjs +5 -5
- package/esm2022/divider/divider.mjs +5 -5
- package/esm2022/expansion/accordion.mjs +4 -4
- package/esm2022/expansion/expansion-module.mjs +7 -8
- package/esm2022/expansion/expansion-panel-content.mjs +4 -4
- package/esm2022/expansion/expansion-panel-header.mjs +11 -12
- package/esm2022/expansion/expansion-panel.mjs +9 -9
- package/esm2022/form-field/directives/error.mjs +4 -4
- package/esm2022/form-field/directives/floating-label.mjs +4 -4
- package/esm2022/form-field/directives/hint.mjs +4 -4
- package/esm2022/form-field/directives/label.mjs +4 -4
- package/esm2022/form-field/directives/line-ripple.mjs +4 -4
- package/esm2022/form-field/directives/notched-outline.mjs +4 -4
- package/esm2022/form-field/directives/prefix.mjs +4 -4
- package/esm2022/form-field/directives/suffix.mjs +4 -4
- package/esm2022/form-field/form-field-control.mjs +4 -4
- package/esm2022/form-field/form-field.mjs +6 -6
- package/esm2022/form-field/module.mjs +5 -5
- package/esm2022/grid-list/grid-list-module.mjs +5 -5
- package/esm2022/grid-list/grid-list.mjs +4 -4
- package/esm2022/grid-list/grid-tile.mjs +16 -16
- package/esm2022/icon/icon-module.mjs +5 -5
- package/esm2022/icon/icon-registry.mjs +4 -4
- package/esm2022/icon/icon.mjs +4 -4
- package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
- package/esm2022/input/input.mjs +4 -4
- package/esm2022/input/module.mjs +5 -5
- package/esm2022/list/action-list.mjs +4 -4
- package/esm2022/list/list-base.mjs +7 -7
- package/esm2022/list/list-item-sections.mjs +19 -19
- package/esm2022/list/list-module.mjs +5 -5
- package/esm2022/list/list-option.mjs +6 -6
- package/esm2022/list/list.mjs +7 -7
- package/esm2022/list/nav-list.mjs +4 -4
- package/esm2022/list/selection-list.mjs +4 -4
- package/esm2022/list/subheader.mjs +4 -4
- package/esm2022/menu/menu-content.mjs +4 -4
- package/esm2022/menu/menu-item.mjs +6 -7
- package/esm2022/menu/menu-trigger.mjs +4 -4
- package/esm2022/menu/menu.mjs +4 -4
- package/esm2022/menu/module.mjs +5 -5
- package/esm2022/paginator/module.mjs +6 -7
- package/esm2022/paginator/paginator-intl.mjs +4 -4
- package/esm2022/paginator/paginator.mjs +10 -11
- package/esm2022/progress-bar/module.mjs +5 -5
- package/esm2022/progress-bar/progress-bar.mjs +4 -4
- package/esm2022/progress-spinner/module.mjs +5 -5
- package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
- package/esm2022/radio/module.mjs +5 -5
- package/esm2022/radio/radio.mjs +8 -8
- package/esm2022/select/module.mjs +5 -5
- package/esm2022/select/select.mjs +9 -9
- package/esm2022/sidenav/drawer.mjs +12 -13
- package/esm2022/sidenav/sidenav-module.mjs +7 -8
- package/esm2022/sidenav/sidenav.mjs +12 -13
- package/esm2022/slide-toggle/module.mjs +10 -11
- package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
- package/esm2022/slide-toggle/slide-toggle.mjs +5 -6
- package/esm2022/slider/module.mjs +6 -7
- package/esm2022/slider/slider-input.mjs +7 -7
- package/esm2022/slider/slider-thumb.mjs +6 -7
- package/esm2022/slider/slider.mjs +6 -7
- package/esm2022/snack-bar/module.mjs +5 -5
- package/esm2022/snack-bar/simple-snack-bar.mjs +5 -6
- package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
- package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
- package/esm2022/snack-bar/snack-bar.mjs +4 -4
- package/esm2022/sort/sort-header-intl.mjs +4 -4
- package/esm2022/sort/sort-header.mjs +5 -6
- package/esm2022/sort/sort-module.mjs +6 -7
- package/esm2022/sort/sort.mjs +4 -4
- package/esm2022/stepper/step-content.mjs +4 -4
- package/esm2022/stepper/step-header.mjs +5 -5
- package/esm2022/stepper/step-label.mjs +4 -4
- package/esm2022/stepper/stepper-button.mjs +7 -7
- package/esm2022/stepper/stepper-icon.mjs +4 -4
- package/esm2022/stepper/stepper-intl.mjs +4 -4
- package/esm2022/stepper/stepper-module.mjs +5 -5
- package/esm2022/stepper/stepper.mjs +8 -8
- package/esm2022/table/cell.mjs +22 -22
- package/esm2022/table/module.mjs +5 -5
- package/esm2022/table/row.mjs +22 -22
- package/esm2022/table/table.mjs +7 -7
- package/esm2022/table/text-column.mjs +4 -4
- package/esm2022/tabs/module.mjs +5 -5
- package/esm2022/tabs/paginated-tab-header.mjs +4 -4
- package/esm2022/tabs/tab-body.mjs +7 -7
- package/esm2022/tabs/tab-content.mjs +4 -4
- package/esm2022/tabs/tab-group.mjs +6 -6
- package/esm2022/tabs/tab-header.mjs +4 -4
- package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
- package/esm2022/tabs/tab-label.mjs +4 -4
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
- package/esm2022/tabs/tab.mjs +4 -4
- package/esm2022/toolbar/toolbar-module.mjs +5 -5
- package/esm2022/toolbar/toolbar.mjs +8 -8
- package/esm2022/tooltip/module.mjs +5 -5
- package/esm2022/tooltip/tooltip.mjs +7 -7
- package/esm2022/tree/node.mjs +10 -10
- package/esm2022/tree/outlet.mjs +4 -4
- package/esm2022/tree/padding.mjs +4 -4
- package/esm2022/tree/toggle.mjs +4 -4
- package/esm2022/tree/tree-module.mjs +5 -5
- package/esm2022/tree/tree.mjs +5 -5
- package/expansion/_expansion-theme.scss +4 -1
- package/expansion/index.d.ts +4 -5
- package/fesm2022/autocomplete.mjs +13 -13
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +7 -7
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +10 -10
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +11 -11
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +50 -55
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card.mjs +46 -46
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +15 -15
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +53 -54
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +59 -60
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +89 -89
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +22 -22
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +8 -8
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion.mjs +31 -32
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +36 -36
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +22 -22
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +7 -7
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +10 -10
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input.mjs +7 -7
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list.mjs +51 -51
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +23 -23
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +17 -19
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +7 -7
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +7 -7
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio.mjs +11 -11
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select.mjs +12 -12
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +29 -30
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +16 -18
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +22 -24
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +26 -27
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort.mjs +15 -17
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper.mjs +33 -33
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +55 -55
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs.mjs +42 -42
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +11 -11
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +10 -10
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree.mjs +26 -26
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +11 -1
- package/package.json +2 -2
- package/paginator/index.d.ts +4 -5
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +1227 -499
- package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
- package/schematics/ng-update/index_bundled.js +328 -26
- package/schematics/ng-update/index_bundled.js.map +4 -4
- package/sidenav/index.d.ts +3 -4
- package/slide-toggle/index.d.ts +1 -2
- package/slider/index.d.ts +1 -2
- package/sort/_sort-theme.scss +21 -23
- package/sort/index.d.ts +2 -3
- package/tree/_tree-theme.scss +13 -26
- package/tree/_tree-variables.scss +0 -14
|
@@ -3075,9 +3075,9 @@ var require_source_map = __commonJS({
|
|
|
3075
3075
|
}
|
|
3076
3076
|
});
|
|
3077
3077
|
|
|
3078
|
-
// node_modules/nanoid/non-secure/index.cjs
|
|
3078
|
+
// node_modules/postcss/node_modules/nanoid/non-secure/index.cjs
|
|
3079
3079
|
var require_non_secure = __commonJS({
|
|
3080
|
-
"node_modules/nanoid/non-secure/index.cjs"(exports, module2) {
|
|
3080
|
+
"node_modules/postcss/node_modules/nanoid/non-secure/index.cjs"(exports, module2) {
|
|
3081
3081
|
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
3082
3082
|
var customAlphabet = (alphabet, defaultSize = 21) => {
|
|
3083
3083
|
return (size = defaultSize) => {
|
|
@@ -6396,14 +6396,14 @@ var require_scss_syntax = __commonJS({
|
|
|
6396
6396
|
}
|
|
6397
6397
|
});
|
|
6398
6398
|
|
|
6399
|
-
// bazel-out/
|
|
6399
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/index.mjs
|
|
6400
6400
|
var mdc_migration_exports = {};
|
|
6401
6401
|
__export(mdc_migration_exports, {
|
|
6402
6402
|
default: () => mdc_migration_default
|
|
6403
6403
|
});
|
|
6404
6404
|
module.exports = __toCommonJS(mdc_migration_exports);
|
|
6405
6405
|
|
|
6406
|
-
// bazel-out/
|
|
6406
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/style-migrator.js
|
|
6407
6407
|
var END_OF_SELECTOR_REGEX = "(?!-)";
|
|
6408
6408
|
var MIXIN_ARGUMENTS_REGEX = "\\(((\\s|.)*)\\)";
|
|
6409
6409
|
var StyleMigrator = class {
|
|
@@ -6479,7 +6479,7 @@ var StyleMigrator = class {
|
|
|
6479
6479
|
}
|
|
6480
6480
|
};
|
|
6481
6481
|
|
|
6482
|
-
// bazel-out/
|
|
6482
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/autocomplete/autocomplete-styles.js
|
|
6483
6483
|
var AutocompleteStylesMigrator = class extends StyleMigrator {
|
|
6484
6484
|
constructor() {
|
|
6485
6485
|
super(...arguments);
|
|
@@ -6503,7 +6503,7 @@ var AutocompleteStylesMigrator = class extends StyleMigrator {
|
|
|
6503
6503
|
}
|
|
6504
6504
|
};
|
|
6505
6505
|
|
|
6506
|
-
// bazel-out/
|
|
6506
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/button/button-styles.js
|
|
6507
6507
|
var ButtonStylesMigrator = class extends StyleMigrator {
|
|
6508
6508
|
constructor() {
|
|
6509
6509
|
super(...arguments);
|
|
@@ -6539,7 +6539,7 @@ var ButtonStylesMigrator = class extends StyleMigrator {
|
|
|
6539
6539
|
}
|
|
6540
6540
|
};
|
|
6541
6541
|
|
|
6542
|
-
// bazel-out/
|
|
6542
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/card/card-styles.js
|
|
6543
6543
|
var CardStylesMigrator = class extends StyleMigrator {
|
|
6544
6544
|
constructor() {
|
|
6545
6545
|
super(...arguments);
|
|
@@ -6578,7 +6578,7 @@ var CardStylesMigrator = class extends StyleMigrator {
|
|
|
6578
6578
|
}
|
|
6579
6579
|
};
|
|
6580
6580
|
|
|
6581
|
-
// bazel-out/
|
|
6581
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/template-migrator.js
|
|
6582
6582
|
var TemplateMigrator = class {
|
|
6583
6583
|
};
|
|
6584
6584
|
|
|
@@ -8547,6 +8547,9 @@ var Identifiers = _Identifiers;
|
|
|
8547
8547
|
(() => {
|
|
8548
8548
|
_Identifiers.deferPrefetchOnViewport = { name: "\u0275\u0275deferPrefetchOnViewport", moduleName: CORE };
|
|
8549
8549
|
})();
|
|
8550
|
+
(() => {
|
|
8551
|
+
_Identifiers.deferEnableTimerScheduling = { name: "\u0275\u0275deferEnableTimerScheduling", moduleName: CORE };
|
|
8552
|
+
})();
|
|
8550
8553
|
(() => {
|
|
8551
8554
|
_Identifiers.conditional = { name: "\u0275\u0275conditional", moduleName: CORE };
|
|
8552
8555
|
})();
|
|
@@ -8874,6 +8877,9 @@ var Identifiers = _Identifiers;
|
|
|
8874
8877
|
(() => {
|
|
8875
8878
|
_Identifiers.setClassMetadataAsync = { name: "\u0275setClassMetadataAsync", moduleName: CORE };
|
|
8876
8879
|
})();
|
|
8880
|
+
(() => {
|
|
8881
|
+
_Identifiers.setClassDebugInfo = { name: "\u0275setClassDebugInfo", moduleName: CORE };
|
|
8882
|
+
})();
|
|
8877
8883
|
(() => {
|
|
8878
8884
|
_Identifiers.queryRefresh = { name: "\u0275\u0275queryRefresh", moduleName: CORE };
|
|
8879
8885
|
})();
|
|
@@ -9384,7 +9390,14 @@ var AbstractEmitterVisitor = class {
|
|
|
9384
9390
|
return null;
|
|
9385
9391
|
}
|
|
9386
9392
|
visitInvokeFunctionExpr(expr, ctx) {
|
|
9393
|
+
const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr;
|
|
9394
|
+
if (shouldParenthesize) {
|
|
9395
|
+
ctx.print(expr.fn, "(");
|
|
9396
|
+
}
|
|
9387
9397
|
expr.fn.visitExpression(this, ctx);
|
|
9398
|
+
if (shouldParenthesize) {
|
|
9399
|
+
ctx.print(expr.fn, ")");
|
|
9400
|
+
}
|
|
9388
9401
|
ctx.print(expr, `(`);
|
|
9389
9402
|
this.visitAllExpressions(expr.args, ctx, ",");
|
|
9390
9403
|
ctx.print(expr, `)`);
|
|
@@ -9678,7 +9691,7 @@ function wrapReference(value) {
|
|
|
9678
9691
|
}
|
|
9679
9692
|
function refsToArray(refs, shouldForwardDeclare) {
|
|
9680
9693
|
const values = literalArr(refs.map((ref) => ref.value));
|
|
9681
|
-
return shouldForwardDeclare ?
|
|
9694
|
+
return shouldForwardDeclare ? arrowFn([], values) : values;
|
|
9682
9695
|
}
|
|
9683
9696
|
function createMayBeForwardRefExpression(expression, forwardRef) {
|
|
9684
9697
|
return { expression, forwardRef };
|
|
@@ -9693,7 +9706,7 @@ function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
|
|
|
9693
9706
|
}
|
|
9694
9707
|
}
|
|
9695
9708
|
function generateForwardRef(expr) {
|
|
9696
|
-
return importExpr(Identifiers.forwardRef).callFn([
|
|
9709
|
+
return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
|
|
9697
9710
|
}
|
|
9698
9711
|
var R3FactoryDelegateType;
|
|
9699
9712
|
(function(R3FactoryDelegateType2) {
|
|
@@ -9750,7 +9763,7 @@ function compileFactoryFunction(meta) {
|
|
|
9750
9763
|
}
|
|
9751
9764
|
let factoryFn = fn([new FnParam("t", DYNAMIC_TYPE)], body, INFERRED_TYPE, void 0, `${meta.name}_Factory`);
|
|
9752
9765
|
if (baseFactoryVar !== null) {
|
|
9753
|
-
factoryFn =
|
|
9766
|
+
factoryFn = arrowFn([], [
|
|
9754
9767
|
new DeclareVarStmt(baseFactoryVar.name),
|
|
9755
9768
|
new ReturnStatement(factoryFn)
|
|
9756
9769
|
]).callFn([], void 0, true);
|
|
@@ -10020,12 +10033,13 @@ var DeferredBlockError = class {
|
|
|
10020
10033
|
}
|
|
10021
10034
|
};
|
|
10022
10035
|
var DeferredBlock = class {
|
|
10023
|
-
constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10036
|
+
constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
|
|
10024
10037
|
this.children = children;
|
|
10025
10038
|
this.placeholder = placeholder;
|
|
10026
10039
|
this.loading = loading;
|
|
10027
10040
|
this.error = error2;
|
|
10028
10041
|
this.sourceSpan = sourceSpan;
|
|
10042
|
+
this.mainBlockSpan = mainBlockSpan;
|
|
10029
10043
|
this.startSourceSpan = startSourceSpan;
|
|
10030
10044
|
this.endSourceSpan = endSourceSpan;
|
|
10031
10045
|
this.triggers = triggers;
|
|
@@ -10040,20 +10054,18 @@ var DeferredBlock = class {
|
|
|
10040
10054
|
this.visitTriggers(this.definedTriggers, this.triggers, visitor);
|
|
10041
10055
|
this.visitTriggers(this.definedPrefetchTriggers, this.prefetchTriggers, visitor);
|
|
10042
10056
|
visitAll$1(visitor, this.children);
|
|
10043
|
-
this.placeholder
|
|
10044
|
-
|
|
10045
|
-
this.error && visitor.visitDeferredBlockError(this.error);
|
|
10057
|
+
const remainingBlocks = [this.placeholder, this.loading, this.error].filter((x) => x !== null);
|
|
10058
|
+
visitAll$1(visitor, remainingBlocks);
|
|
10046
10059
|
}
|
|
10047
10060
|
visitTriggers(keys, triggers, visitor) {
|
|
10048
|
-
|
|
10049
|
-
visitor.visitDeferredTrigger(triggers[key]);
|
|
10050
|
-
}
|
|
10061
|
+
visitAll$1(visitor, keys.map((k) => triggers[k]));
|
|
10051
10062
|
}
|
|
10052
10063
|
};
|
|
10053
10064
|
var SwitchBlock = class {
|
|
10054
|
-
constructor(expression, cases, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10065
|
+
constructor(expression, cases, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10055
10066
|
this.expression = expression;
|
|
10056
10067
|
this.cases = cases;
|
|
10068
|
+
this.unknownBlocks = unknownBlocks;
|
|
10057
10069
|
this.sourceSpan = sourceSpan;
|
|
10058
10070
|
this.startSourceSpan = startSourceSpan;
|
|
10059
10071
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -10063,18 +10075,19 @@ var SwitchBlock = class {
|
|
|
10063
10075
|
}
|
|
10064
10076
|
};
|
|
10065
10077
|
var SwitchBlockCase = class {
|
|
10066
|
-
constructor(expression, children, sourceSpan, startSourceSpan) {
|
|
10078
|
+
constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10067
10079
|
this.expression = expression;
|
|
10068
10080
|
this.children = children;
|
|
10069
10081
|
this.sourceSpan = sourceSpan;
|
|
10070
10082
|
this.startSourceSpan = startSourceSpan;
|
|
10083
|
+
this.endSourceSpan = endSourceSpan;
|
|
10071
10084
|
}
|
|
10072
10085
|
visit(visitor) {
|
|
10073
10086
|
return visitor.visitSwitchBlockCase(this);
|
|
10074
10087
|
}
|
|
10075
10088
|
};
|
|
10076
10089
|
var ForLoopBlock = class {
|
|
10077
|
-
constructor(item, expression, trackBy, contextVariables, children, empty, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10090
|
+
constructor(item, expression, trackBy, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
|
|
10078
10091
|
this.item = item;
|
|
10079
10092
|
this.expression = expression;
|
|
10080
10093
|
this.trackBy = trackBy;
|
|
@@ -10082,6 +10095,7 @@ var ForLoopBlock = class {
|
|
|
10082
10095
|
this.children = children;
|
|
10083
10096
|
this.empty = empty;
|
|
10084
10097
|
this.sourceSpan = sourceSpan;
|
|
10098
|
+
this.mainBlockSpan = mainBlockSpan;
|
|
10085
10099
|
this.startSourceSpan = startSourceSpan;
|
|
10086
10100
|
this.endSourceSpan = endSourceSpan;
|
|
10087
10101
|
}
|
|
@@ -10090,10 +10104,11 @@ var ForLoopBlock = class {
|
|
|
10090
10104
|
}
|
|
10091
10105
|
};
|
|
10092
10106
|
var ForLoopBlockEmpty = class {
|
|
10093
|
-
constructor(children, sourceSpan, startSourceSpan) {
|
|
10107
|
+
constructor(children, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10094
10108
|
this.children = children;
|
|
10095
10109
|
this.sourceSpan = sourceSpan;
|
|
10096
10110
|
this.startSourceSpan = startSourceSpan;
|
|
10111
|
+
this.endSourceSpan = endSourceSpan;
|
|
10097
10112
|
}
|
|
10098
10113
|
visit(visitor) {
|
|
10099
10114
|
return visitor.visitForLoopBlockEmpty(this);
|
|
@@ -10111,17 +10126,27 @@ var IfBlock = class {
|
|
|
10111
10126
|
}
|
|
10112
10127
|
};
|
|
10113
10128
|
var IfBlockBranch = class {
|
|
10114
|
-
constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan) {
|
|
10129
|
+
constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
10115
10130
|
this.expression = expression;
|
|
10116
10131
|
this.children = children;
|
|
10117
10132
|
this.expressionAlias = expressionAlias;
|
|
10118
10133
|
this.sourceSpan = sourceSpan;
|
|
10119
10134
|
this.startSourceSpan = startSourceSpan;
|
|
10135
|
+
this.endSourceSpan = endSourceSpan;
|
|
10120
10136
|
}
|
|
10121
10137
|
visit(visitor) {
|
|
10122
10138
|
return visitor.visitIfBlockBranch(this);
|
|
10123
10139
|
}
|
|
10124
10140
|
};
|
|
10141
|
+
var UnknownBlock = class {
|
|
10142
|
+
constructor(name, sourceSpan) {
|
|
10143
|
+
this.name = name;
|
|
10144
|
+
this.sourceSpan = sourceSpan;
|
|
10145
|
+
}
|
|
10146
|
+
visit(visitor) {
|
|
10147
|
+
return visitor.visitUnknownBlock(this);
|
|
10148
|
+
}
|
|
10149
|
+
};
|
|
10125
10150
|
var Template = class {
|
|
10126
10151
|
constructor(tagName, attributes, inputs, outputs, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
10127
10152
|
this.tagName = tagName;
|
|
@@ -10604,7 +10629,12 @@ var DefinitionMap = class {
|
|
|
10604
10629
|
}
|
|
10605
10630
|
set(key, value) {
|
|
10606
10631
|
if (value) {
|
|
10607
|
-
this.values.
|
|
10632
|
+
const existing = this.values.find((value2) => value2.key === key);
|
|
10633
|
+
if (existing) {
|
|
10634
|
+
existing.value = value;
|
|
10635
|
+
} else {
|
|
10636
|
+
this.values.push({ key, value, quoted: false });
|
|
10637
|
+
}
|
|
10608
10638
|
}
|
|
10609
10639
|
}
|
|
10610
10640
|
toLiteralMap() {
|
|
@@ -10703,10 +10733,7 @@ function compileInjectable(meta, resolveForwardRefs) {
|
|
|
10703
10733
|
delegateType: R3FactoryDelegateType.Function
|
|
10704
10734
|
}));
|
|
10705
10735
|
} else {
|
|
10706
|
-
result = {
|
|
10707
|
-
statements: [],
|
|
10708
|
-
expression: fn([], [new ReturnStatement(meta.useFactory.callFn([]))])
|
|
10709
|
-
};
|
|
10736
|
+
result = { statements: [], expression: arrowFn([], meta.useFactory.callFn([])) };
|
|
10710
10737
|
}
|
|
10711
10738
|
} else if (meta.useValue !== void 0) {
|
|
10712
10739
|
result = compileFactoryFunction(__spreadProps(__spreadValues({}, factoryMeta), {
|
|
@@ -10750,7 +10777,7 @@ function delegateToFactory(type, useType, unwrapForwardRefs) {
|
|
|
10750
10777
|
return createFactoryFunction(unwrappedType);
|
|
10751
10778
|
}
|
|
10752
10779
|
function createFactoryFunction(type) {
|
|
10753
|
-
return
|
|
10780
|
+
return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
|
|
10754
10781
|
}
|
|
10755
10782
|
var UNUSABLE_INTERPOLATION_REGEXPS = [
|
|
10756
10783
|
/^\s*$/,
|
|
@@ -13025,7 +13052,7 @@ var ShadowCss = class {
|
|
|
13025
13052
|
while ((res = sep.exec(selector)) !== null) {
|
|
13026
13053
|
const separator = res[1];
|
|
13027
13054
|
const part2 = selector.slice(startIndex, res.index).trim();
|
|
13028
|
-
if (part2.match(
|
|
13055
|
+
if (part2.match(/__esc-ph-(\d+)__/) && ((_a2 = selector[res.index + 1]) == null ? void 0 : _a2.match(/[a-fA-F\d]/))) {
|
|
13029
13056
|
continue;
|
|
13030
13057
|
}
|
|
13031
13058
|
shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
|
|
@@ -13047,7 +13074,12 @@ var SafeSelector = class {
|
|
|
13047
13074
|
this.placeholders = [];
|
|
13048
13075
|
this.index = 0;
|
|
13049
13076
|
selector = this._escapeRegexMatches(selector, /(\[[^\]]*\])/g);
|
|
13050
|
-
selector =
|
|
13077
|
+
selector = selector.replace(/(\\.)/g, (_, keep) => {
|
|
13078
|
+
const replaceBy = `__esc-ph-${this.index}__`;
|
|
13079
|
+
this.placeholders.push(keep);
|
|
13080
|
+
this.index++;
|
|
13081
|
+
return replaceBy;
|
|
13082
|
+
});
|
|
13051
13083
|
this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
|
|
13052
13084
|
const replaceBy = `__ph-${this.index}__`;
|
|
13053
13085
|
this.placeholders.push(exp);
|
|
@@ -13056,7 +13088,7 @@ var SafeSelector = class {
|
|
|
13056
13088
|
});
|
|
13057
13089
|
}
|
|
13058
13090
|
restore(content) {
|
|
13059
|
-
return content.replace(
|
|
13091
|
+
return content.replace(/__(?:ph|esc-ph)-(\d+)__/g, (_ph, index2) => this.placeholders[+index2]);
|
|
13060
13092
|
}
|
|
13061
13093
|
content() {
|
|
13062
13094
|
return this._content;
|
|
@@ -13097,7 +13129,6 @@ var _commentRe = /\/\*[\s\S]*?\*\//g;
|
|
|
13097
13129
|
var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=/g;
|
|
13098
13130
|
var COMMENT_PLACEHOLDER = "%COMMENT%";
|
|
13099
13131
|
var _commentWithHashPlaceHolderRe = new RegExp(COMMENT_PLACEHOLDER, "g");
|
|
13100
|
-
var _placeholderRe = /__ph-(\d+)__/g;
|
|
13101
13132
|
var BLOCK_PLACEHOLDER = "%BLOCK%";
|
|
13102
13133
|
var _ruleRe = new RegExp(`(\\s*(?:${COMMENT_PLACEHOLDER}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`, "g");
|
|
13103
13134
|
var CONTENT_PAIRS = /* @__PURE__ */ new Map([["{", "}"]]);
|
|
@@ -13272,14 +13303,21 @@ var OpKind;
|
|
|
13272
13303
|
OpKind2[OpKind2["Pipe"] = 23] = "Pipe";
|
|
13273
13304
|
OpKind2[OpKind2["Attribute"] = 24] = "Attribute";
|
|
13274
13305
|
OpKind2[OpKind2["ExtractedAttribute"] = 25] = "ExtractedAttribute";
|
|
13275
|
-
OpKind2[OpKind2["
|
|
13276
|
-
OpKind2[OpKind2["
|
|
13277
|
-
OpKind2[OpKind2["
|
|
13278
|
-
OpKind2[OpKind2["
|
|
13279
|
-
OpKind2[OpKind2["
|
|
13280
|
-
OpKind2[OpKind2["
|
|
13281
|
-
OpKind2[OpKind2["
|
|
13282
|
-
OpKind2[OpKind2["
|
|
13306
|
+
OpKind2[OpKind2["Defer"] = 26] = "Defer";
|
|
13307
|
+
OpKind2[OpKind2["DeferSecondaryBlock"] = 27] = "DeferSecondaryBlock";
|
|
13308
|
+
OpKind2[OpKind2["DeferOn"] = 28] = "DeferOn";
|
|
13309
|
+
OpKind2[OpKind2["ExtractedMessage"] = 29] = "ExtractedMessage";
|
|
13310
|
+
OpKind2[OpKind2["HostProperty"] = 30] = "HostProperty";
|
|
13311
|
+
OpKind2[OpKind2["Namespace"] = 31] = "Namespace";
|
|
13312
|
+
OpKind2[OpKind2["ProjectionDef"] = 32] = "ProjectionDef";
|
|
13313
|
+
OpKind2[OpKind2["Projection"] = 33] = "Projection";
|
|
13314
|
+
OpKind2[OpKind2["I18nStart"] = 34] = "I18nStart";
|
|
13315
|
+
OpKind2[OpKind2["I18n"] = 35] = "I18n";
|
|
13316
|
+
OpKind2[OpKind2["I18nEnd"] = 36] = "I18nEnd";
|
|
13317
|
+
OpKind2[OpKind2["I18nExpression"] = 37] = "I18nExpression";
|
|
13318
|
+
OpKind2[OpKind2["I18nApply"] = 38] = "I18nApply";
|
|
13319
|
+
OpKind2[OpKind2["Icu"] = 39] = "Icu";
|
|
13320
|
+
OpKind2[OpKind2["IcuUpdate"] = 40] = "IcuUpdate";
|
|
13283
13321
|
})(OpKind || (OpKind = {}));
|
|
13284
13322
|
var ExpressionKind;
|
|
13285
13323
|
(function(ExpressionKind2) {
|
|
@@ -13304,6 +13342,7 @@ var ExpressionKind;
|
|
|
13304
13342
|
ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 18] = "ReadTemporaryExpr";
|
|
13305
13343
|
ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 19] = "SanitizerExpr";
|
|
13306
13344
|
ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 20] = "SlotLiteralExpr";
|
|
13345
|
+
ExpressionKind2[ExpressionKind2["ConditionalCase"] = 21] = "ConditionalCase";
|
|
13307
13346
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
13308
13347
|
var SemanticVariableKind;
|
|
13309
13348
|
(function(SemanticVariableKind2) {
|
|
@@ -13325,6 +13364,12 @@ var SanitizerFn;
|
|
|
13325
13364
|
SanitizerFn2[SanitizerFn2["ResourceUrl"] = 4] = "ResourceUrl";
|
|
13326
13365
|
SanitizerFn2[SanitizerFn2["IframeAttribute"] = 5] = "IframeAttribute";
|
|
13327
13366
|
})(SanitizerFn || (SanitizerFn = {}));
|
|
13367
|
+
var DeferSecondaryKind;
|
|
13368
|
+
(function(DeferSecondaryKind2) {
|
|
13369
|
+
DeferSecondaryKind2[DeferSecondaryKind2["Loading"] = 0] = "Loading";
|
|
13370
|
+
DeferSecondaryKind2[DeferSecondaryKind2["Placeholder"] = 1] = "Placeholder";
|
|
13371
|
+
DeferSecondaryKind2[DeferSecondaryKind2["Error"] = 2] = "Error";
|
|
13372
|
+
})(DeferSecondaryKind || (DeferSecondaryKind = {}));
|
|
13328
13373
|
var BindingKind;
|
|
13329
13374
|
(function(BindingKind2) {
|
|
13330
13375
|
BindingKind2[BindingKind2["Attribute"] = 0] = "Attribute";
|
|
@@ -13335,11 +13380,17 @@ var BindingKind;
|
|
|
13335
13380
|
BindingKind2[BindingKind2["I18n"] = 5] = "I18n";
|
|
13336
13381
|
BindingKind2[BindingKind2["Animation"] = 6] = "Animation";
|
|
13337
13382
|
})(BindingKind || (BindingKind = {}));
|
|
13383
|
+
var I18nParamResolutionTime;
|
|
13384
|
+
(function(I18nParamResolutionTime2) {
|
|
13385
|
+
I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
|
|
13386
|
+
I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
|
|
13387
|
+
})(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
|
|
13338
13388
|
var ConsumesSlot = Symbol("ConsumesSlot");
|
|
13339
13389
|
var DependsOnSlotContext = Symbol("DependsOnSlotContext");
|
|
13340
13390
|
var UsesSlotIndex = Symbol("UsesSlotIndex");
|
|
13341
13391
|
var ConsumesVarsTrait = Symbol("ConsumesVars");
|
|
13342
13392
|
var UsesVarOffset = Symbol("UsesVarOffset");
|
|
13393
|
+
var HasConst = Symbol("HasConst");
|
|
13343
13394
|
var TRAIT_CONSUMES_SLOT = {
|
|
13344
13395
|
[ConsumesSlot]: true,
|
|
13345
13396
|
slot: null,
|
|
@@ -13347,7 +13398,7 @@ var TRAIT_CONSUMES_SLOT = {
|
|
|
13347
13398
|
};
|
|
13348
13399
|
var TRAIT_USES_SLOT_INDEX = {
|
|
13349
13400
|
[UsesSlotIndex]: true,
|
|
13350
|
-
|
|
13401
|
+
targetSlot: null
|
|
13351
13402
|
};
|
|
13352
13403
|
var TRAIT_DEPENDS_ON_SLOT_CONTEXT = {
|
|
13353
13404
|
[DependsOnSlotContext]: true
|
|
@@ -13359,6 +13410,10 @@ var TRAIT_USES_VAR_OFFSET = {
|
|
|
13359
13410
|
[UsesVarOffset]: true,
|
|
13360
13411
|
varOffset: null
|
|
13361
13412
|
};
|
|
13413
|
+
var TRAIT_HAS_CONST = {
|
|
13414
|
+
[HasConst]: true,
|
|
13415
|
+
constIndex: null
|
|
13416
|
+
};
|
|
13362
13417
|
function hasConsumesSlotTrait(op) {
|
|
13363
13418
|
return op[ConsumesSlot] === true;
|
|
13364
13419
|
}
|
|
@@ -13374,6 +13429,9 @@ function hasUsesVarOffsetTrait(expr) {
|
|
|
13374
13429
|
function hasUsesSlotIndexTrait(value) {
|
|
13375
13430
|
return value[UsesSlotIndex] === true;
|
|
13376
13431
|
}
|
|
13432
|
+
function hasConstTrait(value) {
|
|
13433
|
+
return value[HasConst] === true;
|
|
13434
|
+
}
|
|
13377
13435
|
function createStatementOp(statement) {
|
|
13378
13436
|
return __spreadValues({
|
|
13379
13437
|
kind: OpKind.Statement,
|
|
@@ -13393,11 +13451,12 @@ var NEW_OP = {
|
|
|
13393
13451
|
prev: null,
|
|
13394
13452
|
next: null
|
|
13395
13453
|
};
|
|
13396
|
-
function createInterpolateTextOp(xref, interpolation, sourceSpan) {
|
|
13454
|
+
function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
|
|
13397
13455
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
13398
13456
|
kind: OpKind.InterpolateText,
|
|
13399
13457
|
target: xref,
|
|
13400
13458
|
interpolation,
|
|
13459
|
+
i18nPlaceholders,
|
|
13401
13460
|
sourceSpan
|
|
13402
13461
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
13403
13462
|
}
|
|
@@ -13489,15 +13548,41 @@ function createAdvanceOp(delta, sourceSpan) {
|
|
|
13489
13548
|
sourceSpan
|
|
13490
13549
|
}, NEW_OP);
|
|
13491
13550
|
}
|
|
13492
|
-
function createConditionalOp(target, test, sourceSpan) {
|
|
13493
|
-
return __spreadValues(__spreadValues(__spreadValues({
|
|
13551
|
+
function createConditionalOp(target, test, conditions, sourceSpan) {
|
|
13552
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
13494
13553
|
kind: OpKind.Conditional,
|
|
13495
13554
|
target,
|
|
13496
13555
|
test,
|
|
13497
|
-
conditions
|
|
13556
|
+
conditions,
|
|
13498
13557
|
processed: null,
|
|
13558
|
+
sourceSpan,
|
|
13559
|
+
contextValue: null
|
|
13560
|
+
}, NEW_OP), TRAIT_USES_SLOT_INDEX), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
|
|
13561
|
+
}
|
|
13562
|
+
function createI18nExpressionOp(owner, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
|
|
13563
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
13564
|
+
kind: OpKind.I18nExpression,
|
|
13565
|
+
owner,
|
|
13566
|
+
target: owner,
|
|
13567
|
+
expression,
|
|
13568
|
+
i18nPlaceholder,
|
|
13569
|
+
resolutionTime,
|
|
13570
|
+
sourceSpan
|
|
13571
|
+
}, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
|
|
13572
|
+
}
|
|
13573
|
+
function createI18nApplyOp(target, sourceSpan) {
|
|
13574
|
+
return __spreadValues(__spreadValues({
|
|
13575
|
+
kind: OpKind.I18nApply,
|
|
13576
|
+
target,
|
|
13577
|
+
sourceSpan
|
|
13578
|
+
}, NEW_OP), TRAIT_USES_SLOT_INDEX);
|
|
13579
|
+
}
|
|
13580
|
+
function createIcuUpdateOp(xref, sourceSpan) {
|
|
13581
|
+
return __spreadValues({
|
|
13582
|
+
kind: OpKind.IcuUpdate,
|
|
13583
|
+
xref,
|
|
13499
13584
|
sourceSpan
|
|
13500
|
-
}, NEW_OP)
|
|
13585
|
+
}, NEW_OP);
|
|
13501
13586
|
}
|
|
13502
13587
|
var _a;
|
|
13503
13588
|
var _b;
|
|
@@ -13544,7 +13629,7 @@ var _ReferenceExpr = class extends ExpressionBase {
|
|
|
13544
13629
|
this.offset = offset;
|
|
13545
13630
|
this.kind = ExpressionKind.Reference;
|
|
13546
13631
|
this[_a] = true;
|
|
13547
|
-
this.
|
|
13632
|
+
this.targetSlot = null;
|
|
13548
13633
|
}
|
|
13549
13634
|
visitExpression() {
|
|
13550
13635
|
}
|
|
@@ -13558,7 +13643,7 @@ var _ReferenceExpr = class extends ExpressionBase {
|
|
|
13558
13643
|
}
|
|
13559
13644
|
clone() {
|
|
13560
13645
|
const expr = new _ReferenceExpr(this.target, this.offset);
|
|
13561
|
-
expr.
|
|
13646
|
+
expr.targetSlot = this.targetSlot;
|
|
13562
13647
|
return expr;
|
|
13563
13648
|
}
|
|
13564
13649
|
};
|
|
@@ -13784,7 +13869,7 @@ var _PipeBindingExpr = class extends ExpressionBase {
|
|
|
13784
13869
|
this[_d] = true;
|
|
13785
13870
|
this[_e] = true;
|
|
13786
13871
|
this[_f] = true;
|
|
13787
|
-
this.
|
|
13872
|
+
this.targetSlot = null;
|
|
13788
13873
|
this.varOffset = null;
|
|
13789
13874
|
}
|
|
13790
13875
|
visitExpression(visitor, context) {
|
|
@@ -13805,7 +13890,7 @@ var _PipeBindingExpr = class extends ExpressionBase {
|
|
|
13805
13890
|
}
|
|
13806
13891
|
clone() {
|
|
13807
13892
|
const r = new _PipeBindingExpr(this.target, this.name, this.args.map((a) => a.clone()));
|
|
13808
|
-
r.
|
|
13893
|
+
r.targetSlot = this.targetSlot;
|
|
13809
13894
|
r.varOffset = this.varOffset;
|
|
13810
13895
|
return r;
|
|
13811
13896
|
}
|
|
@@ -13825,7 +13910,7 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
|
|
|
13825
13910
|
this[_g] = true;
|
|
13826
13911
|
this[_h] = true;
|
|
13827
13912
|
this[_j] = true;
|
|
13828
|
-
this.
|
|
13913
|
+
this.targetSlot = null;
|
|
13829
13914
|
this.varOffset = null;
|
|
13830
13915
|
}
|
|
13831
13916
|
visitExpression(visitor, context) {
|
|
@@ -13842,7 +13927,7 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
|
|
|
13842
13927
|
}
|
|
13843
13928
|
clone() {
|
|
13844
13929
|
const r = new _PipeBindingVariadicExpr(this.target, this.name, this.args.clone(), this.numArgs);
|
|
13845
|
-
r.
|
|
13930
|
+
r.targetSlot = this.targetSlot;
|
|
13846
13931
|
r.varOffset = this.varOffset;
|
|
13847
13932
|
return r;
|
|
13848
13933
|
}
|
|
@@ -14050,18 +14135,20 @@ var _SlotLiteralExpr = class extends ExpressionBase {
|
|
|
14050
14135
|
this.target = target;
|
|
14051
14136
|
this.kind = ExpressionKind.SlotLiteralExpr;
|
|
14052
14137
|
this[_k] = true;
|
|
14053
|
-
this.
|
|
14138
|
+
this.targetSlot = null;
|
|
14054
14139
|
}
|
|
14055
14140
|
visitExpression(visitor, context) {
|
|
14056
14141
|
}
|
|
14057
14142
|
isEquivalent(e) {
|
|
14058
|
-
return e instanceof _SlotLiteralExpr && e.target === this.target && e.
|
|
14143
|
+
return e instanceof _SlotLiteralExpr && e.target === this.target && e.targetSlot === this.targetSlot;
|
|
14059
14144
|
}
|
|
14060
14145
|
isConstant() {
|
|
14061
14146
|
return true;
|
|
14062
14147
|
}
|
|
14063
14148
|
clone() {
|
|
14064
|
-
|
|
14149
|
+
const copy = new _SlotLiteralExpr(this.target);
|
|
14150
|
+
copy.targetSlot = this.targetSlot;
|
|
14151
|
+
return copy;
|
|
14065
14152
|
}
|
|
14066
14153
|
transformInternalExpressions() {
|
|
14067
14154
|
}
|
|
@@ -14070,6 +14157,34 @@ var SlotLiteralExpr = _SlotLiteralExpr;
|
|
|
14070
14157
|
(() => {
|
|
14071
14158
|
_k = UsesSlotIndex;
|
|
14072
14159
|
})();
|
|
14160
|
+
var ConditionalCaseExpr = class extends ExpressionBase {
|
|
14161
|
+
constructor(expr, target, alias = null) {
|
|
14162
|
+
super();
|
|
14163
|
+
this.expr = expr;
|
|
14164
|
+
this.target = target;
|
|
14165
|
+
this.alias = alias;
|
|
14166
|
+
this.kind = ExpressionKind.ConditionalCase;
|
|
14167
|
+
}
|
|
14168
|
+
visitExpression(visitor, context) {
|
|
14169
|
+
if (this.expr !== null) {
|
|
14170
|
+
this.expr.visitExpression(visitor, context);
|
|
14171
|
+
}
|
|
14172
|
+
}
|
|
14173
|
+
isEquivalent(e) {
|
|
14174
|
+
return e instanceof ConditionalCaseExpr && e.expr === this.expr;
|
|
14175
|
+
}
|
|
14176
|
+
isConstant() {
|
|
14177
|
+
return true;
|
|
14178
|
+
}
|
|
14179
|
+
clone() {
|
|
14180
|
+
return new ConditionalCaseExpr(this.expr, this.target);
|
|
14181
|
+
}
|
|
14182
|
+
transformInternalExpressions(transform2, flags) {
|
|
14183
|
+
if (this.expr !== null) {
|
|
14184
|
+
this.expr = transformExpressionsInExpression(this.expr, transform2, flags);
|
|
14185
|
+
}
|
|
14186
|
+
}
|
|
14187
|
+
};
|
|
14073
14188
|
function visitExpressionsInOp(op, visitor) {
|
|
14074
14189
|
transformExpressionsInOp(op, (expr, flags) => {
|
|
14075
14190
|
visitor(expr, flags);
|
|
@@ -14109,6 +14224,9 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
14109
14224
|
}
|
|
14110
14225
|
op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform2, flags);
|
|
14111
14226
|
break;
|
|
14227
|
+
case OpKind.I18nExpression:
|
|
14228
|
+
op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
|
|
14229
|
+
break;
|
|
14112
14230
|
case OpKind.InterpolateText:
|
|
14113
14231
|
transformExpressionsInInterpolation(op.interpolation, transform2, flags);
|
|
14114
14232
|
break;
|
|
@@ -14120,14 +14238,17 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
14120
14238
|
break;
|
|
14121
14239
|
case OpKind.Conditional:
|
|
14122
14240
|
for (const condition of op.conditions) {
|
|
14123
|
-
if (condition
|
|
14241
|
+
if (condition.expr === null) {
|
|
14124
14242
|
continue;
|
|
14125
14243
|
}
|
|
14126
|
-
condition
|
|
14244
|
+
condition.expr = transformExpressionsInExpression(condition.expr, transform2, flags);
|
|
14127
14245
|
}
|
|
14128
14246
|
if (op.processed !== null) {
|
|
14129
14247
|
op.processed = transformExpressionsInExpression(op.processed, transform2, flags);
|
|
14130
14248
|
}
|
|
14249
|
+
if (op.contextValue !== null) {
|
|
14250
|
+
op.contextValue = transformExpressionsInExpression(op.contextValue, transform2, flags);
|
|
14251
|
+
}
|
|
14131
14252
|
break;
|
|
14132
14253
|
case OpKind.Listener:
|
|
14133
14254
|
for (const innerOp of op.handlerOps) {
|
|
@@ -14143,17 +14264,20 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
14143
14264
|
transformExpressionsInStatement(statement, transform2, flags);
|
|
14144
14265
|
}
|
|
14145
14266
|
break;
|
|
14267
|
+
case OpKind.I18n:
|
|
14146
14268
|
case OpKind.I18nStart:
|
|
14147
|
-
for (const placeholder
|
|
14148
|
-
op.
|
|
14269
|
+
for (const [placeholder, expression] of op.params) {
|
|
14270
|
+
op.params.set(placeholder, transformExpressionsInExpression(expression, transform2, flags));
|
|
14149
14271
|
}
|
|
14150
14272
|
break;
|
|
14273
|
+
case OpKind.Defer:
|
|
14274
|
+
case OpKind.DeferSecondaryBlock:
|
|
14275
|
+
case OpKind.DeferOn:
|
|
14151
14276
|
case OpKind.Projection:
|
|
14152
14277
|
case OpKind.ProjectionDef:
|
|
14153
14278
|
case OpKind.Element:
|
|
14154
14279
|
case OpKind.ElementStart:
|
|
14155
14280
|
case OpKind.ElementEnd:
|
|
14156
|
-
case OpKind.I18n:
|
|
14157
14281
|
case OpKind.I18nEnd:
|
|
14158
14282
|
case OpKind.Container:
|
|
14159
14283
|
case OpKind.ContainerStart:
|
|
@@ -14165,6 +14289,9 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
14165
14289
|
case OpKind.Pipe:
|
|
14166
14290
|
case OpKind.Advance:
|
|
14167
14291
|
case OpKind.Namespace:
|
|
14292
|
+
case OpKind.I18nApply:
|
|
14293
|
+
case OpKind.Icu:
|
|
14294
|
+
case OpKind.IcuUpdate:
|
|
14168
14295
|
break;
|
|
14169
14296
|
default:
|
|
14170
14297
|
throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
|
|
@@ -14363,7 +14490,7 @@ var _OpList = class {
|
|
|
14363
14490
|
const last = prev;
|
|
14364
14491
|
if (oldPrev !== null) {
|
|
14365
14492
|
oldPrev.next = first;
|
|
14366
|
-
first.prev =
|
|
14493
|
+
first.prev = oldPrev;
|
|
14367
14494
|
}
|
|
14368
14495
|
if (oldNext !== null) {
|
|
14369
14496
|
oldNext.prev = last;
|
|
@@ -14445,7 +14572,7 @@ var elementContainerOpKinds = /* @__PURE__ */ new Set([
|
|
|
14445
14572
|
function isElementOrContainerOp(op) {
|
|
14446
14573
|
return elementContainerOpKinds.has(op.kind);
|
|
14447
14574
|
}
|
|
14448
|
-
function createElementStartOp(tag, xref, namespace,
|
|
14575
|
+
function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan) {
|
|
14449
14576
|
return __spreadValues(__spreadValues({
|
|
14450
14577
|
kind: OpKind.ElementStart,
|
|
14451
14578
|
xref,
|
|
@@ -14454,23 +14581,23 @@ function createElementStartOp(tag, xref, namespace, i18n2, sourceSpan) {
|
|
|
14454
14581
|
localRefs: [],
|
|
14455
14582
|
nonBindable: false,
|
|
14456
14583
|
namespace,
|
|
14457
|
-
|
|
14584
|
+
i18nPlaceholder,
|
|
14458
14585
|
sourceSpan
|
|
14459
14586
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
14460
14587
|
}
|
|
14461
|
-
function createTemplateOp(xref, tag, namespace,
|
|
14588
|
+
function createTemplateOp(xref, tag, namespace, generatedInBlock, i18nPlaceholder, sourceSpan) {
|
|
14462
14589
|
return __spreadValues(__spreadValues({
|
|
14463
14590
|
kind: OpKind.Template,
|
|
14464
14591
|
xref,
|
|
14465
14592
|
attributes: null,
|
|
14466
14593
|
tag,
|
|
14467
|
-
|
|
14594
|
+
block: generatedInBlock,
|
|
14468
14595
|
decls: null,
|
|
14469
14596
|
vars: null,
|
|
14470
14597
|
localRefs: [],
|
|
14471
14598
|
nonBindable: false,
|
|
14472
14599
|
namespace,
|
|
14473
|
-
|
|
14600
|
+
i18nPlaceholder,
|
|
14474
14601
|
sourceSpan
|
|
14475
14602
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
14476
14603
|
}
|
|
@@ -14542,7 +14669,7 @@ function createProjectionDefOp(def) {
|
|
|
14542
14669
|
}, NEW_OP);
|
|
14543
14670
|
}
|
|
14544
14671
|
function createProjectionOp(xref, selector) {
|
|
14545
|
-
return __spreadValues(__spreadValues(
|
|
14672
|
+
return __spreadValues(__spreadValues({
|
|
14546
14673
|
kind: OpKind.Projection,
|
|
14547
14674
|
xref,
|
|
14548
14675
|
selector,
|
|
@@ -14550,9 +14677,8 @@ function createProjectionOp(xref, selector) {
|
|
|
14550
14677
|
attributes: null,
|
|
14551
14678
|
localRefs: [],
|
|
14552
14679
|
nonBindable: false,
|
|
14553
|
-
i18n: void 0,
|
|
14554
14680
|
sourceSpan: null
|
|
14555
|
-
}, NEW_OP), TRAIT_CONSUMES_SLOT)
|
|
14681
|
+
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
14556
14682
|
}
|
|
14557
14683
|
function createExtractedAttributeOp(target, bindingKind, name, expression) {
|
|
14558
14684
|
return __spreadValues({
|
|
@@ -14563,6 +14689,34 @@ function createExtractedAttributeOp(target, bindingKind, name, expression) {
|
|
|
14563
14689
|
expression
|
|
14564
14690
|
}, NEW_OP);
|
|
14565
14691
|
}
|
|
14692
|
+
function createDeferOp(xref, main, sourceSpan) {
|
|
14693
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
14694
|
+
kind: OpKind.Defer,
|
|
14695
|
+
xref,
|
|
14696
|
+
target: main,
|
|
14697
|
+
loading: null,
|
|
14698
|
+
placeholder: null,
|
|
14699
|
+
error: null,
|
|
14700
|
+
sourceSpan
|
|
14701
|
+
}, NEW_OP), TRAIT_CONSUMES_SLOT), TRAIT_USES_SLOT_INDEX);
|
|
14702
|
+
}
|
|
14703
|
+
function createDeferSecondaryOp(deferOp, secondaryView, secondaryBlockKind) {
|
|
14704
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
14705
|
+
kind: OpKind.DeferSecondaryBlock,
|
|
14706
|
+
deferOp,
|
|
14707
|
+
target: secondaryView,
|
|
14708
|
+
secondaryBlockKind,
|
|
14709
|
+
constValue: null,
|
|
14710
|
+
makeExpression: literalOrArrayLiteral$1
|
|
14711
|
+
}, NEW_OP), TRAIT_USES_SLOT_INDEX), TRAIT_HAS_CONST);
|
|
14712
|
+
}
|
|
14713
|
+
function createDeferOnOp(xref, sourceSpan) {
|
|
14714
|
+
return __spreadValues(__spreadValues({
|
|
14715
|
+
kind: OpKind.DeferOn,
|
|
14716
|
+
xref,
|
|
14717
|
+
sourceSpan
|
|
14718
|
+
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
14719
|
+
}
|
|
14566
14720
|
function createExtractedMessageOp(owner, expression, statements) {
|
|
14567
14721
|
return __spreadValues({
|
|
14568
14722
|
kind: OpKind.ExtractedMessage,
|
|
@@ -14571,13 +14725,17 @@ function createExtractedMessageOp(owner, expression, statements) {
|
|
|
14571
14725
|
statements
|
|
14572
14726
|
}, NEW_OP);
|
|
14573
14727
|
}
|
|
14574
|
-
function createI18nStartOp(xref,
|
|
14728
|
+
function createI18nStartOp(xref, message, root2) {
|
|
14575
14729
|
return __spreadValues(__spreadValues({
|
|
14576
14730
|
kind: OpKind.I18nStart,
|
|
14577
14731
|
xref,
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14732
|
+
root: root2 != null ? root2 : xref,
|
|
14733
|
+
message,
|
|
14734
|
+
params: /* @__PURE__ */ new Map(),
|
|
14735
|
+
postprocessingParams: /* @__PURE__ */ new Map(),
|
|
14736
|
+
messageIndex: null,
|
|
14737
|
+
subTemplateIndex: null,
|
|
14738
|
+
needsPostprocessing: false
|
|
14581
14739
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
14582
14740
|
}
|
|
14583
14741
|
function createI18nEndOp(xref) {
|
|
@@ -14586,6 +14744,20 @@ function createI18nEndOp(xref) {
|
|
|
14586
14744
|
xref
|
|
14587
14745
|
}, NEW_OP);
|
|
14588
14746
|
}
|
|
14747
|
+
function createIcuOp(xref, message, sourceSpan) {
|
|
14748
|
+
return __spreadValues({
|
|
14749
|
+
kind: OpKind.Icu,
|
|
14750
|
+
xref,
|
|
14751
|
+
message,
|
|
14752
|
+
sourceSpan
|
|
14753
|
+
}, NEW_OP);
|
|
14754
|
+
}
|
|
14755
|
+
function literalOrArrayLiteral$1(value) {
|
|
14756
|
+
if (Array.isArray(value)) {
|
|
14757
|
+
return literalArr(value.map(literalOrArrayLiteral$1));
|
|
14758
|
+
}
|
|
14759
|
+
return literal(value, INFERRED_TYPE);
|
|
14760
|
+
}
|
|
14589
14761
|
function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
|
|
14590
14762
|
return __spreadValues(__spreadValues({
|
|
14591
14763
|
kind: OpKind.HostProperty,
|
|
@@ -14595,6 +14767,7 @@ function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan)
|
|
|
14595
14767
|
sourceSpan
|
|
14596
14768
|
}, TRAIT_CONSUMES_VARS), NEW_OP);
|
|
14597
14769
|
}
|
|
14770
|
+
var CTX_REF = "CTX_REF_MARKER";
|
|
14598
14771
|
var CompilationJobKind;
|
|
14599
14772
|
(function(CompilationJobKind2) {
|
|
14600
14773
|
CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
|
|
@@ -14705,6 +14878,8 @@ function phaseVarCounting(job) {
|
|
|
14705
14878
|
if (hasConsumesVarsTrait(op)) {
|
|
14706
14879
|
varCount += varsUsedByOp(op);
|
|
14707
14880
|
}
|
|
14881
|
+
}
|
|
14882
|
+
for (const op of unit.ops()) {
|
|
14708
14883
|
visitExpressionsInOp(op, (expr) => {
|
|
14709
14884
|
if (!isIrExpression(expr)) {
|
|
14710
14885
|
return;
|
|
@@ -14753,6 +14928,9 @@ function varsUsedByOp(op) {
|
|
|
14753
14928
|
return slots;
|
|
14754
14929
|
case OpKind.InterpolateText:
|
|
14755
14930
|
return op.interpolation.expressions.length;
|
|
14931
|
+
case OpKind.I18nExpression:
|
|
14932
|
+
case OpKind.Conditional:
|
|
14933
|
+
return 1;
|
|
14756
14934
|
default:
|
|
14757
14935
|
throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
|
|
14758
14936
|
}
|
|
@@ -14805,6 +14983,44 @@ function removeAnys(e) {
|
|
|
14805
14983
|
}
|
|
14806
14984
|
return e;
|
|
14807
14985
|
}
|
|
14986
|
+
function phaseApplyI18nExpressions(job) {
|
|
14987
|
+
for (const unit of job.units) {
|
|
14988
|
+
for (const op of unit.update) {
|
|
14989
|
+
if (op.kind === OpKind.I18nExpression && needsApplication(op)) {
|
|
14990
|
+
OpList.insertAfter(createI18nApplyOp(op.owner, null), op);
|
|
14991
|
+
}
|
|
14992
|
+
}
|
|
14993
|
+
}
|
|
14994
|
+
}
|
|
14995
|
+
function needsApplication(op) {
|
|
14996
|
+
var _a2;
|
|
14997
|
+
if (((_a2 = op.next) == null ? void 0 : _a2.kind) !== OpKind.I18nExpression) {
|
|
14998
|
+
return true;
|
|
14999
|
+
}
|
|
15000
|
+
if (op.next.owner !== op.owner) {
|
|
15001
|
+
return true;
|
|
15002
|
+
}
|
|
15003
|
+
return false;
|
|
15004
|
+
}
|
|
15005
|
+
function phaseAssignI18nSlotDependencies(job) {
|
|
15006
|
+
const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
|
|
15007
|
+
let lastSlotConsumer = null;
|
|
15008
|
+
for (const unit of job.units) {
|
|
15009
|
+
for (const op of unit.create) {
|
|
15010
|
+
if (op.kind === OpKind.I18nEnd) {
|
|
15011
|
+
i18nLastSlotConsumers.set(op.xref, lastSlotConsumer);
|
|
15012
|
+
}
|
|
15013
|
+
if (hasConsumesSlotTrait(op)) {
|
|
15014
|
+
lastSlotConsumer = op.xref;
|
|
15015
|
+
}
|
|
15016
|
+
}
|
|
15017
|
+
for (const op of unit.update) {
|
|
15018
|
+
if (op.kind === OpKind.I18nExpression) {
|
|
15019
|
+
op.target = i18nLastSlotConsumers.get(op.owner);
|
|
15020
|
+
}
|
|
15021
|
+
}
|
|
15022
|
+
}
|
|
15023
|
+
}
|
|
14808
15024
|
function getElementsByXrefId(unit) {
|
|
14809
15025
|
const elements = /* @__PURE__ */ new Map();
|
|
14810
15026
|
for (const op of unit.create) {
|
|
@@ -14929,14 +15145,20 @@ function phaseBindingSpecialization(job) {
|
|
|
14929
15145
|
}
|
|
14930
15146
|
}
|
|
14931
15147
|
var CHAINABLE = /* @__PURE__ */ new Set([
|
|
14932
|
-
Identifiers.
|
|
14933
|
-
Identifiers.
|
|
15148
|
+
Identifiers.attribute,
|
|
15149
|
+
Identifiers.classProp,
|
|
14934
15150
|
Identifiers.element,
|
|
14935
|
-
Identifiers.
|
|
15151
|
+
Identifiers.elementContainer,
|
|
15152
|
+
Identifiers.elementContainerEnd,
|
|
15153
|
+
Identifiers.elementContainerStart,
|
|
15154
|
+
Identifiers.elementEnd,
|
|
15155
|
+
Identifiers.elementStart,
|
|
14936
15156
|
Identifiers.hostProperty,
|
|
14937
|
-
Identifiers.
|
|
15157
|
+
Identifiers.i18nExp,
|
|
15158
|
+
Identifiers.listener,
|
|
15159
|
+
Identifiers.listener,
|
|
15160
|
+
Identifiers.property,
|
|
14938
15161
|
Identifiers.styleProp,
|
|
14939
|
-
Identifiers.attribute,
|
|
14940
15162
|
Identifiers.stylePropInterpolate1,
|
|
14941
15163
|
Identifiers.stylePropInterpolate2,
|
|
14942
15164
|
Identifiers.stylePropInterpolate3,
|
|
@@ -14946,13 +15168,8 @@ var CHAINABLE = /* @__PURE__ */ new Set([
|
|
|
14946
15168
|
Identifiers.stylePropInterpolate7,
|
|
14947
15169
|
Identifiers.stylePropInterpolate8,
|
|
14948
15170
|
Identifiers.stylePropInterpolateV,
|
|
14949
|
-
Identifiers.classProp,
|
|
14950
|
-
Identifiers.listener,
|
|
14951
|
-
Identifiers.elementContainerStart,
|
|
14952
|
-
Identifiers.elementContainerEnd,
|
|
14953
|
-
Identifiers.elementContainer,
|
|
14954
|
-
Identifiers.listener,
|
|
14955
15171
|
Identifiers.syntheticHostListener,
|
|
15172
|
+
Identifiers.syntheticHostProperty,
|
|
14956
15173
|
Identifiers.templateCreate
|
|
14957
15174
|
]);
|
|
14958
15175
|
function phaseChaining(job) {
|
|
@@ -14998,19 +15215,28 @@ function phaseConditionals(job) {
|
|
|
14998
15215
|
continue;
|
|
14999
15216
|
}
|
|
15000
15217
|
let test;
|
|
15001
|
-
const defaultCase = op.conditions.findIndex((
|
|
15218
|
+
const defaultCase = op.conditions.findIndex((cond) => cond.expr === null);
|
|
15002
15219
|
if (defaultCase >= 0) {
|
|
15003
|
-
const
|
|
15220
|
+
const xref = op.conditions.splice(defaultCase, 1)[0].target;
|
|
15004
15221
|
test = new SlotLiteralExpr(xref);
|
|
15005
15222
|
} else {
|
|
15006
15223
|
test = literal(-1);
|
|
15007
15224
|
}
|
|
15008
|
-
let tmp = new AssignTemporaryExpr(op.test, job.allocateXrefId());
|
|
15225
|
+
let tmp = op.test == null ? null : new AssignTemporaryExpr(op.test, job.allocateXrefId());
|
|
15009
15226
|
for (let i = op.conditions.length - 1; i >= 0; i--) {
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15227
|
+
let conditionalCase = op.conditions[i];
|
|
15228
|
+
if (conditionalCase.expr === null) {
|
|
15229
|
+
continue;
|
|
15230
|
+
}
|
|
15231
|
+
if (tmp !== null) {
|
|
15232
|
+
const useTmp = i === 0 ? tmp : new ReadTemporaryExpr(tmp.xref);
|
|
15233
|
+
conditionalCase.expr = new BinaryOperatorExpr(BinaryOperator.Identical, useTmp, conditionalCase.expr);
|
|
15234
|
+
} else if (conditionalCase.alias !== null) {
|
|
15235
|
+
const caseExpressionTemporaryXref = job.allocateXrefId();
|
|
15236
|
+
conditionalCase.expr = new AssignTemporaryExpr(conditionalCase.expr, caseExpressionTemporaryXref);
|
|
15237
|
+
op.contextValue = new ReadTemporaryExpr(caseExpressionTemporaryXref);
|
|
15238
|
+
}
|
|
15239
|
+
test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.target), test);
|
|
15014
15240
|
}
|
|
15015
15241
|
op.processed = test;
|
|
15016
15242
|
}
|
|
@@ -15066,15 +15292,16 @@ var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
|
15066
15292
|
["||", BinaryOperator.Or],
|
|
15067
15293
|
["+", BinaryOperator.Plus]
|
|
15068
15294
|
]);
|
|
15069
|
-
var NAMESPACES = /* @__PURE__ */ new Map([["svg", Namespace.SVG], ["math", Namespace.Math]]);
|
|
15070
15295
|
function namespaceForKey(namespacePrefixKey) {
|
|
15071
15296
|
var _a2;
|
|
15297
|
+
const NAMESPACES = /* @__PURE__ */ new Map([["svg", Namespace.SVG], ["math", Namespace.Math]]);
|
|
15072
15298
|
if (namespacePrefixKey === null) {
|
|
15073
15299
|
return Namespace.HTML;
|
|
15074
15300
|
}
|
|
15075
15301
|
return (_a2 = NAMESPACES.get(namespacePrefixKey)) != null ? _a2 : Namespace.HTML;
|
|
15076
15302
|
}
|
|
15077
15303
|
function keyForNamespace(namespace) {
|
|
15304
|
+
const NAMESPACES = /* @__PURE__ */ new Map([["svg", Namespace.SVG], ["math", Namespace.Math]]);
|
|
15078
15305
|
for (const [k, n] of NAMESPACES.entries()) {
|
|
15079
15306
|
if (n === namespace) {
|
|
15080
15307
|
return k;
|
|
@@ -15231,6 +15458,7 @@ var REPLACEMENTS = /* @__PURE__ */ new Map([
|
|
|
15231
15458
|
[OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
|
|
15232
15459
|
[OpKind.I18nEnd, [OpKind.I18nStart, OpKind.I18n]]
|
|
15233
15460
|
]);
|
|
15461
|
+
var IGNORED_OP_KINDS = /* @__PURE__ */ new Set([OpKind.Pipe]);
|
|
15234
15462
|
function phaseEmptyElements(job) {
|
|
15235
15463
|
for (const unit of job.units) {
|
|
15236
15464
|
for (const op of unit.create) {
|
|
@@ -15239,8 +15467,12 @@ function phaseEmptyElements(job) {
|
|
|
15239
15467
|
continue;
|
|
15240
15468
|
}
|
|
15241
15469
|
const [startKind, mergedKind] = opReplacements;
|
|
15242
|
-
|
|
15243
|
-
|
|
15470
|
+
let prevOp = op.prev;
|
|
15471
|
+
while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) {
|
|
15472
|
+
prevOp = prevOp.prev;
|
|
15473
|
+
}
|
|
15474
|
+
if (prevOp !== null && prevOp.kind === startKind) {
|
|
15475
|
+
prevOp.kind = mergedKind;
|
|
15244
15476
|
OpList.remove(op);
|
|
15245
15477
|
}
|
|
15246
15478
|
}
|
|
@@ -15410,29 +15642,27 @@ function phaseGenerateAdvance(job) {
|
|
|
15410
15642
|
}
|
|
15411
15643
|
}
|
|
15412
15644
|
}
|
|
15413
|
-
function
|
|
15645
|
+
function phaseGenerateProjectionDef(job) {
|
|
15646
|
+
const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
|
|
15647
|
+
const selectors = [];
|
|
15648
|
+
let projectionSlotIndex = 0;
|
|
15414
15649
|
for (const unit of job.units) {
|
|
15415
|
-
const elements = getElementsByXrefId(unit);
|
|
15416
15650
|
for (const op of unit.create) {
|
|
15417
|
-
|
|
15418
|
-
|
|
15419
|
-
|
|
15420
|
-
if (start.i18n instanceof Message) {
|
|
15421
|
-
const id = job.allocateXrefId();
|
|
15422
|
-
OpList.insertAfter(createI18nStartOp(id, start.i18n), start);
|
|
15423
|
-
OpList.insertBefore(createI18nEndOp(id), op);
|
|
15424
|
-
}
|
|
15425
|
-
break;
|
|
15426
|
-
case OpKind.Template:
|
|
15427
|
-
if (op.i18n !== void 0) {
|
|
15428
|
-
const id = job.allocateXrefId();
|
|
15429
|
-
OpList.insertBefore(createI18nStartOp(id, op.i18n), op);
|
|
15430
|
-
OpList.insertAfter(createI18nEndOp(id), op);
|
|
15431
|
-
}
|
|
15432
|
-
break;
|
|
15651
|
+
if (op.kind === OpKind.Projection) {
|
|
15652
|
+
selectors.push(op.selector);
|
|
15653
|
+
op.projectionSlotIndex = projectionSlotIndex++;
|
|
15433
15654
|
}
|
|
15434
15655
|
}
|
|
15435
15656
|
}
|
|
15657
|
+
if (selectors.length > 0) {
|
|
15658
|
+
let defExpr = null;
|
|
15659
|
+
if (selectors.length > 1 || selectors[0] !== "*") {
|
|
15660
|
+
const def = selectors.map((s) => s === "*" ? s : parseSelectorToR3Selector(s));
|
|
15661
|
+
defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share);
|
|
15662
|
+
}
|
|
15663
|
+
job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share);
|
|
15664
|
+
job.root.create.prepend([createProjectionDefOp(defExpr)]);
|
|
15665
|
+
}
|
|
15436
15666
|
}
|
|
15437
15667
|
function phaseGenerateVariables(job) {
|
|
15438
15668
|
recursivelyProcessView(job.root, null);
|
|
@@ -15473,7 +15703,6 @@ function getScopeForView(view, parent) {
|
|
|
15473
15703
|
}
|
|
15474
15704
|
for (const op of view.create) {
|
|
15475
15705
|
switch (op.kind) {
|
|
15476
|
-
case OpKind.Element:
|
|
15477
15706
|
case OpKind.ElementStart:
|
|
15478
15707
|
case OpKind.Template:
|
|
15479
15708
|
if (!Array.isArray(op.localRefs)) {
|
|
@@ -15502,7 +15731,9 @@ function generateVariablesInScopeForView(view, scope) {
|
|
|
15502
15731
|
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr()));
|
|
15503
15732
|
}
|
|
15504
15733
|
for (const [name, value] of view.job.views.get(scope.view).contextVariables) {
|
|
15505
|
-
|
|
15734
|
+
const context = new ContextExpr(scope.view);
|
|
15735
|
+
const variable2 = value === CTX_REF ? context : new ReadPropExpr(context, value);
|
|
15736
|
+
newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable2));
|
|
15506
15737
|
}
|
|
15507
15738
|
for (const ref of scope.references) {
|
|
15508
15739
|
newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.offset)));
|
|
@@ -15512,15 +15743,38 @@ function generateVariablesInScopeForView(view, scope) {
|
|
|
15512
15743
|
}
|
|
15513
15744
|
return newOps;
|
|
15514
15745
|
}
|
|
15746
|
+
function phaseConstTraitCollection(job) {
|
|
15747
|
+
const collectGlobalConsts = (e) => {
|
|
15748
|
+
if (e instanceof ExpressionBase && hasConstTrait(e)) {
|
|
15749
|
+
const ea = e;
|
|
15750
|
+
if (ea.constValue !== null) {
|
|
15751
|
+
ea.constIndex = job.addConst(ea.constValue);
|
|
15752
|
+
}
|
|
15753
|
+
}
|
|
15754
|
+
return e;
|
|
15755
|
+
};
|
|
15756
|
+
for (const unit of job.units) {
|
|
15757
|
+
for (const op of unit.ops()) {
|
|
15758
|
+
if (hasConstTrait(op) && op.constValue !== null) {
|
|
15759
|
+
op.constIndex = job.addConst(op.makeExpression(op.constValue));
|
|
15760
|
+
}
|
|
15761
|
+
transformExpressionsInOp(op, collectGlobalConsts, VisitorContextFlag.None);
|
|
15762
|
+
}
|
|
15763
|
+
}
|
|
15764
|
+
}
|
|
15515
15765
|
var STYLE_DOT = "style.";
|
|
15516
15766
|
var CLASS_DOT = "class.";
|
|
15517
15767
|
var STYLE_BANG = "style!";
|
|
15518
15768
|
var CLASS_BANG = "class!";
|
|
15769
|
+
var BANG_IMPORTANT = "!important";
|
|
15519
15770
|
function phaseHostStylePropertyParsing(job) {
|
|
15520
15771
|
for (const op of job.root.update) {
|
|
15521
15772
|
if (op.kind !== OpKind.Binding) {
|
|
15522
15773
|
continue;
|
|
15523
15774
|
}
|
|
15775
|
+
if (op.name.endsWith(BANG_IMPORTANT)) {
|
|
15776
|
+
op.name = op.name.substring(0, op.name.length - BANG_IMPORTANT.length);
|
|
15777
|
+
}
|
|
15524
15778
|
if (op.name.startsWith(STYLE_DOT)) {
|
|
15525
15779
|
op.bindingKind = BindingKind.StyleProperty;
|
|
15526
15780
|
op.name = op.name.substring(STYLE_DOT.length);
|
|
@@ -15564,6 +15818,24 @@ function parseProperty$1(name) {
|
|
|
15564
15818
|
}
|
|
15565
15819
|
return { property: property2, suffix };
|
|
15566
15820
|
}
|
|
15821
|
+
function phaseI18nConstCollection(job) {
|
|
15822
|
+
const messageConstIndices = {};
|
|
15823
|
+
for (const unit of job.units) {
|
|
15824
|
+
for (const op of unit.create) {
|
|
15825
|
+
if (op.kind === OpKind.ExtractedMessage) {
|
|
15826
|
+
messageConstIndices[op.owner] = job.addConst(op.expression, op.statements);
|
|
15827
|
+
OpList.remove(op);
|
|
15828
|
+
}
|
|
15829
|
+
}
|
|
15830
|
+
}
|
|
15831
|
+
for (const unit of job.units) {
|
|
15832
|
+
for (const op of unit.create) {
|
|
15833
|
+
if (op.kind === OpKind.I18nStart) {
|
|
15834
|
+
op.messageIndex = messageConstIndices[op.root];
|
|
15835
|
+
}
|
|
15836
|
+
}
|
|
15837
|
+
}
|
|
15838
|
+
}
|
|
15567
15839
|
function mapLiteral(obj, quoted = false) {
|
|
15568
15840
|
return literalMap(Object.keys(obj).map((key) => ({
|
|
15569
15841
|
key,
|
|
@@ -17344,7 +17616,7 @@ function getHtmlTagDefinition(tagName) {
|
|
|
17344
17616
|
var _a2, _b2;
|
|
17345
17617
|
if (!TAG_DEFINITIONS) {
|
|
17346
17618
|
DEFAULT_TAG_DEFINITION = new HtmlTagDefinition({ canSelfClose: true });
|
|
17347
|
-
TAG_DEFINITIONS = {
|
|
17619
|
+
TAG_DEFINITIONS = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
17348
17620
|
"base": new HtmlTagDefinition({ isVoid: true }),
|
|
17349
17621
|
"meta": new HtmlTagDefinition({ isVoid: true }),
|
|
17350
17622
|
"area": new HtmlTagDefinition({ isVoid: true }),
|
|
@@ -17419,9 +17691,9 @@ function getHtmlTagDefinition(tagName) {
|
|
|
17419
17691
|
contentType: { default: TagContentType.ESCAPABLE_RAW_TEXT, svg: TagContentType.PARSABLE_DATA }
|
|
17420
17692
|
}),
|
|
17421
17693
|
"textarea": new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true })
|
|
17422
|
-
};
|
|
17694
|
+
});
|
|
17423
17695
|
new DomElementSchemaRegistry().allKnownElementNames().forEach((knownTagName) => {
|
|
17424
|
-
if (!TAG_DEFINITIONS
|
|
17696
|
+
if (!TAG_DEFINITIONS[knownTagName] && getNsPrefix(knownTagName) === null) {
|
|
17425
17697
|
TAG_DEFINITIONS[knownTagName] = new HtmlTagDefinition({ canSelfClose: false });
|
|
17426
17698
|
}
|
|
17427
17699
|
});
|
|
@@ -19855,6 +20127,7 @@ var _ControlFlowError = class {
|
|
|
19855
20127
|
};
|
|
19856
20128
|
var _Tokenizer = class {
|
|
19857
20129
|
constructor(_file, _getTagDefinition, options) {
|
|
20130
|
+
var _a2;
|
|
19858
20131
|
this._getTagDefinition = _getTagDefinition;
|
|
19859
20132
|
this._currentTokenStart = null;
|
|
19860
20133
|
this._currentTokenType = null;
|
|
@@ -19870,7 +20143,7 @@ var _Tokenizer = class {
|
|
|
19870
20143
|
this._cursor = options.escapedString ? new EscapedCharacterCursor(_file, range) : new PlainCharacterCursor(_file, range);
|
|
19871
20144
|
this._preserveLineEndings = options.preserveLineEndings || false;
|
|
19872
20145
|
this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
|
|
19873
|
-
this._tokenizeBlocks = options.tokenizeBlocks
|
|
20146
|
+
this._tokenizeBlocks = (_a2 = options.tokenizeBlocks) != null ? _a2 : true;
|
|
19874
20147
|
try {
|
|
19875
20148
|
this._cursor.init();
|
|
19876
20149
|
} catch (e) {
|
|
@@ -19912,7 +20185,7 @@ var _Tokenizer = class {
|
|
|
19912
20185
|
this.handleError(e);
|
|
19913
20186
|
}
|
|
19914
20187
|
}
|
|
19915
|
-
this._beginToken(
|
|
20188
|
+
this._beginToken(29);
|
|
19916
20189
|
this._endToken([]);
|
|
19917
20190
|
}
|
|
19918
20191
|
_getBlockName() {
|
|
@@ -19932,17 +20205,24 @@ var _Tokenizer = class {
|
|
|
19932
20205
|
}
|
|
19933
20206
|
_consumeBlockStart(start) {
|
|
19934
20207
|
this._beginToken(24, start);
|
|
19935
|
-
this._endToken([this._getBlockName()]);
|
|
20208
|
+
const startToken = this._endToken([this._getBlockName()]);
|
|
19936
20209
|
if (this._cursor.peek() === $LPAREN) {
|
|
19937
20210
|
this._cursor.advance();
|
|
19938
20211
|
this._consumeBlockParameters();
|
|
19939
20212
|
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
19940
|
-
this.
|
|
19941
|
-
|
|
20213
|
+
if (this._attemptCharCode($RPAREN)) {
|
|
20214
|
+
this._attemptCharCodeUntilFn(isNotWhitespace);
|
|
20215
|
+
} else {
|
|
20216
|
+
startToken.type = 28;
|
|
20217
|
+
return;
|
|
20218
|
+
}
|
|
20219
|
+
}
|
|
20220
|
+
if (this._attemptCharCode($LBRACE)) {
|
|
20221
|
+
this._beginToken(25);
|
|
20222
|
+
this._endToken([]);
|
|
20223
|
+
} else {
|
|
20224
|
+
startToken.type = 28;
|
|
19942
20225
|
}
|
|
19943
|
-
this._beginToken(25);
|
|
19944
|
-
this._requireCharCode($LBRACE);
|
|
19945
|
-
this._endToken([]);
|
|
19946
20226
|
}
|
|
19947
20227
|
_consumeBlockEnd(start) {
|
|
19948
20228
|
this._beginToken(26, start);
|
|
@@ -20772,7 +21052,7 @@ var _TreeBuilder = class {
|
|
|
20772
21052
|
this._advance();
|
|
20773
21053
|
}
|
|
20774
21054
|
build() {
|
|
20775
|
-
while (this._peek.type !==
|
|
21055
|
+
while (this._peek.type !== 29) {
|
|
20776
21056
|
if (this._peek.type === 0 || this._peek.type === 4) {
|
|
20777
21057
|
this._consumeStartTag(this._advance());
|
|
20778
21058
|
} else if (this._peek.type === 3) {
|
|
@@ -20794,6 +21074,9 @@ var _TreeBuilder = class {
|
|
|
20794
21074
|
} else if (this._peek.type === 26) {
|
|
20795
21075
|
this._closeVoidElement();
|
|
20796
21076
|
this._consumeBlockClose(this._advance());
|
|
21077
|
+
} else if (this._peek.type === 28) {
|
|
21078
|
+
this._closeVoidElement();
|
|
21079
|
+
this._consumeIncompleteBlock(this._advance());
|
|
20797
21080
|
} else {
|
|
20798
21081
|
this._advance();
|
|
20799
21082
|
}
|
|
@@ -20858,7 +21141,7 @@ var _TreeBuilder = class {
|
|
|
20858
21141
|
if (!exp)
|
|
20859
21142
|
return null;
|
|
20860
21143
|
const end = this._advance();
|
|
20861
|
-
exp.push({ type:
|
|
21144
|
+
exp.push({ type: 29, parts: [], sourceSpan: end.sourceSpan });
|
|
20862
21145
|
const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);
|
|
20863
21146
|
expansionCaseParser.build();
|
|
20864
21147
|
if (expansionCaseParser.errors.length > 0) {
|
|
@@ -20894,7 +21177,7 @@ var _TreeBuilder = class {
|
|
|
20894
21177
|
return null;
|
|
20895
21178
|
}
|
|
20896
21179
|
}
|
|
20897
|
-
if (this._peek.type ===
|
|
21180
|
+
if (this._peek.type === 29) {
|
|
20898
21181
|
this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
|
|
20899
21182
|
return null;
|
|
20900
21183
|
}
|
|
@@ -21046,14 +21329,25 @@ var _TreeBuilder = class {
|
|
|
21046
21329
|
const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
21047
21330
|
const block = new Block(token.parts[0], parameters, [], span, startSpan);
|
|
21048
21331
|
this._pushContainer(block, false);
|
|
21049
|
-
return block;
|
|
21050
21332
|
}
|
|
21051
21333
|
_consumeBlockClose(token) {
|
|
21052
|
-
const previousContainer = this._getContainer();
|
|
21053
21334
|
if (!this._popContainer(null, Block, token.sourceSpan)) {
|
|
21054
|
-
|
|
21055
|
-
|
|
21335
|
+
this.errors.push(TreeError.create(null, token.sourceSpan, `Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.`));
|
|
21336
|
+
}
|
|
21337
|
+
}
|
|
21338
|
+
_consumeIncompleteBlock(token) {
|
|
21339
|
+
const parameters = [];
|
|
21340
|
+
while (this._peek.type === 27) {
|
|
21341
|
+
const paramToken = this._advance();
|
|
21342
|
+
parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan));
|
|
21056
21343
|
}
|
|
21344
|
+
const end = this._peek.sourceSpan.fullStart;
|
|
21345
|
+
const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
21346
|
+
const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
|
|
21347
|
+
const block = new Block(token.parts[0], parameters, [], span, startSpan);
|
|
21348
|
+
this._pushContainer(block, false);
|
|
21349
|
+
this._popContainer(null, Block, null);
|
|
21350
|
+
this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block "${token.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`));
|
|
21057
21351
|
}
|
|
21058
21352
|
_getContainer() {
|
|
21059
21353
|
return this._containerStack.length > 0 ? this._containerStack[this._containerStack.length - 1] : null;
|
|
@@ -21403,20 +21697,31 @@ function phaseI18nMessageExtraction(job) {
|
|
|
21403
21697
|
const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
|
|
21404
21698
|
for (const unit of job.units) {
|
|
21405
21699
|
for (const op of unit.create) {
|
|
21406
|
-
if (op.kind === OpKind.I18nStart
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21700
|
+
if (op.kind === OpKind.I18nStart) {
|
|
21701
|
+
if (op.xref === op.root) {
|
|
21702
|
+
const params = new Map([...op.params.entries()].sort());
|
|
21703
|
+
const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX));
|
|
21704
|
+
const closureVar = i18nGenerateClosureVar(job.pool, op.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
|
|
21705
|
+
let transformFn = void 0;
|
|
21706
|
+
if (op.needsPostprocessing) {
|
|
21707
|
+
const extraTransformFnParams = [];
|
|
21708
|
+
if (op.postprocessingParams.size > 0) {
|
|
21709
|
+
extraTransformFnParams.push(literalMap([...op.postprocessingParams.entries()].map(([key, value]) => ({ key, value, quoted: true }))));
|
|
21710
|
+
}
|
|
21711
|
+
transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
|
|
21712
|
+
}
|
|
21713
|
+
const statements = getTranslationDeclStmts$1(op.message, mainVar, closureVar, params, transformFn);
|
|
21714
|
+
unit.create.push(createExtractedMessageOp(op.xref, mainVar, statements));
|
|
21715
|
+
}
|
|
21412
21716
|
}
|
|
21413
21717
|
}
|
|
21414
21718
|
}
|
|
21415
21719
|
}
|
|
21416
|
-
function getTranslationDeclStmts$1(message, variable2, closureVar, params
|
|
21720
|
+
function getTranslationDeclStmts$1(message, variable2, closureVar, params, transformFn) {
|
|
21721
|
+
const paramsObject = Object.fromEntries(params);
|
|
21417
21722
|
const statements = [
|
|
21418
21723
|
declareI18nVariable(variable2),
|
|
21419
|
-
ifStmt(createClosureModeGuard$1(), createGoogleGetMsgStatements(variable2, message, closureVar,
|
|
21724
|
+
ifStmt(createClosureModeGuard$1(), createGoogleGetMsgStatements(variable2, message, closureVar, paramsObject), createLocalizeStatements(variable2, message, formatI18nPlaceholderNamesInMap(paramsObject, false)))
|
|
21420
21725
|
];
|
|
21421
21726
|
if (transformFn) {
|
|
21422
21727
|
statements.push(new ExpressionStatement(variable2.set(transformFn(variable2))));
|
|
@@ -21440,23 +21745,83 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
|
|
|
21440
21745
|
return variable(name);
|
|
21441
21746
|
}
|
|
21442
21747
|
function phaseI18nTextExtraction(job) {
|
|
21748
|
+
var _a2;
|
|
21443
21749
|
for (const unit of job.units) {
|
|
21444
|
-
let
|
|
21750
|
+
let currentI18nId = null;
|
|
21751
|
+
const textNodes = /* @__PURE__ */ new Map();
|
|
21445
21752
|
for (const op of unit.create) {
|
|
21446
21753
|
switch (op.kind) {
|
|
21447
21754
|
case OpKind.I18nStart:
|
|
21448
|
-
|
|
21755
|
+
currentI18nId = op.xref;
|
|
21449
21756
|
break;
|
|
21450
21757
|
case OpKind.I18nEnd:
|
|
21451
|
-
|
|
21758
|
+
currentI18nId = null;
|
|
21452
21759
|
break;
|
|
21453
21760
|
case OpKind.Text:
|
|
21454
|
-
if (
|
|
21761
|
+
if (currentI18nId !== null) {
|
|
21762
|
+
textNodes.set(op.xref, currentI18nId);
|
|
21455
21763
|
OpList.remove(op);
|
|
21456
21764
|
}
|
|
21457
21765
|
break;
|
|
21458
21766
|
}
|
|
21459
21767
|
}
|
|
21768
|
+
for (const op of unit.update) {
|
|
21769
|
+
switch (op.kind) {
|
|
21770
|
+
case OpKind.InterpolateText:
|
|
21771
|
+
if (!textNodes.has(op.target)) {
|
|
21772
|
+
continue;
|
|
21773
|
+
}
|
|
21774
|
+
const i18nBlockId = textNodes.get(op.target);
|
|
21775
|
+
const ops = [];
|
|
21776
|
+
for (let i = 0; i < op.interpolation.expressions.length; i++) {
|
|
21777
|
+
const expr = op.interpolation.expressions[i];
|
|
21778
|
+
const placeholder = op.i18nPlaceholders[i];
|
|
21779
|
+
ops.push(createI18nExpressionOp(i18nBlockId, expr, placeholder.name, I18nParamResolutionTime.Creation, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
|
|
21780
|
+
}
|
|
21781
|
+
if (ops.length > 0) {
|
|
21782
|
+
}
|
|
21783
|
+
OpList.replaceWithMany(op, ops);
|
|
21784
|
+
break;
|
|
21785
|
+
}
|
|
21786
|
+
}
|
|
21787
|
+
}
|
|
21788
|
+
}
|
|
21789
|
+
function phaseIcuExtraction(job) {
|
|
21790
|
+
for (const unit of job.units) {
|
|
21791
|
+
const icus = /* @__PURE__ */ new Map();
|
|
21792
|
+
let currentI18nId = null;
|
|
21793
|
+
for (const op of unit.create) {
|
|
21794
|
+
switch (op.kind) {
|
|
21795
|
+
case OpKind.I18nStart:
|
|
21796
|
+
currentI18nId = op.xref;
|
|
21797
|
+
break;
|
|
21798
|
+
case OpKind.I18nEnd:
|
|
21799
|
+
currentI18nId = null;
|
|
21800
|
+
break;
|
|
21801
|
+
case OpKind.Icu:
|
|
21802
|
+
if (currentI18nId === null) {
|
|
21803
|
+
throw Error("Unexpected ICU outside of an i18n block.");
|
|
21804
|
+
}
|
|
21805
|
+
icus.set(op.xref, { message: op.message, i18nBlockId: currentI18nId });
|
|
21806
|
+
OpList.remove(op);
|
|
21807
|
+
break;
|
|
21808
|
+
}
|
|
21809
|
+
}
|
|
21810
|
+
for (const op of unit.update) {
|
|
21811
|
+
switch (op.kind) {
|
|
21812
|
+
case OpKind.IcuUpdate:
|
|
21813
|
+
const { message, i18nBlockId } = icus.get(op.xref);
|
|
21814
|
+
const icuNode = message.nodes.find((n) => n instanceof Icu);
|
|
21815
|
+
if (icuNode === void 0) {
|
|
21816
|
+
throw Error("Could not find ICU in i18n AST");
|
|
21817
|
+
}
|
|
21818
|
+
if (icuNode.expressionPlaceholder === void 0) {
|
|
21819
|
+
throw Error("ICU is missing an i18n placeholder");
|
|
21820
|
+
}
|
|
21821
|
+
OpList.replace(op, createI18nExpressionOp(i18nBlockId, new LexicalReadExpr(icuNode.expression), icuNode.expressionPlaceholder, I18nParamResolutionTime.Postproccessing, null));
|
|
21822
|
+
break;
|
|
21823
|
+
}
|
|
21824
|
+
}
|
|
21460
21825
|
}
|
|
21461
21826
|
}
|
|
21462
21827
|
function phaseLocalRefs(job) {
|
|
@@ -21464,7 +21829,6 @@ function phaseLocalRefs(job) {
|
|
|
21464
21829
|
for (const op of unit.create) {
|
|
21465
21830
|
switch (op.kind) {
|
|
21466
21831
|
case OpKind.ElementStart:
|
|
21467
|
-
case OpKind.Element:
|
|
21468
21832
|
case OpKind.Template:
|
|
21469
21833
|
if (!Array.isArray(op.localRefs)) {
|
|
21470
21834
|
throw new Error(`AssertionError: expected localRefs to be an array still`);
|
|
@@ -21492,7 +21856,7 @@ function phaseNamespace(job) {
|
|
|
21492
21856
|
for (const unit of job.units) {
|
|
21493
21857
|
let activeNamespace = Namespace.HTML;
|
|
21494
21858
|
for (const op of unit.create) {
|
|
21495
|
-
if (op.kind !== OpKind.
|
|
21859
|
+
if (op.kind !== OpKind.ElementStart) {
|
|
21496
21860
|
continue;
|
|
21497
21861
|
}
|
|
21498
21862
|
if (op.namespace !== activeNamespace) {
|
|
@@ -21581,7 +21945,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
21581
21945
|
if (op.handlerFnName !== null) {
|
|
21582
21946
|
break;
|
|
21583
21947
|
}
|
|
21584
|
-
if (!op.hostListener && op.
|
|
21948
|
+
if (!op.hostListener && op.targetSlot === null) {
|
|
21585
21949
|
throw new Error(`Expected a slot to be assigned`);
|
|
21586
21950
|
}
|
|
21587
21951
|
let animation = "";
|
|
@@ -21592,7 +21956,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
21592
21956
|
if (op.hostListener) {
|
|
21593
21957
|
op.handlerFnName = `${baseName}_${animation}${op.name}_HostBindingHandler`;
|
|
21594
21958
|
} else {
|
|
21595
|
-
op.handlerFnName = `${unit.fnName}_${op.tag.replace("-", "_")}_${animation}${op.name}_${op.
|
|
21959
|
+
op.handlerFnName = `${unit.fnName}_${op.tag.replace("-", "_")}_${animation}${op.name}_${op.targetSlot}_listener`;
|
|
21596
21960
|
}
|
|
21597
21961
|
op.handlerFnName = sanitizeIdentifier(op.handlerFnName);
|
|
21598
21962
|
break;
|
|
@@ -21607,7 +21971,8 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
21607
21971
|
if (op.slot === null) {
|
|
21608
21972
|
throw new Error(`Expected slot to be assigned`);
|
|
21609
21973
|
}
|
|
21610
|
-
|
|
21974
|
+
const tagToken = op.tag === null ? "" : "_" + prefixWithNamespace(op.tag, op.namespace);
|
|
21975
|
+
addNamesToView(childView, `${baseName}${tagToken}_${op.slot}`, state, compatibility);
|
|
21611
21976
|
break;
|
|
21612
21977
|
case OpKind.StyleProp:
|
|
21613
21978
|
op.name = normalizeStylePropName(op.name);
|
|
@@ -21719,29 +22084,6 @@ function phaseNgContainer(job) {
|
|
|
21719
22084
|
}
|
|
21720
22085
|
}
|
|
21721
22086
|
}
|
|
21722
|
-
function phaseNoListenersOnTemplates(job) {
|
|
21723
|
-
for (const unit of job.units) {
|
|
21724
|
-
let inTemplate = false;
|
|
21725
|
-
for (const op of unit.create) {
|
|
21726
|
-
switch (op.kind) {
|
|
21727
|
-
case OpKind.Template:
|
|
21728
|
-
inTemplate = true;
|
|
21729
|
-
break;
|
|
21730
|
-
case OpKind.ElementStart:
|
|
21731
|
-
case OpKind.Element:
|
|
21732
|
-
case OpKind.ContainerStart:
|
|
21733
|
-
case OpKind.Container:
|
|
21734
|
-
inTemplate = false;
|
|
21735
|
-
break;
|
|
21736
|
-
case OpKind.Listener:
|
|
21737
|
-
if (inTemplate) {
|
|
21738
|
-
OpList.remove(op);
|
|
21739
|
-
}
|
|
21740
|
-
break;
|
|
21741
|
-
}
|
|
21742
|
-
}
|
|
21743
|
-
}
|
|
21744
|
-
}
|
|
21745
22087
|
function lookupElement$1(elements, xref) {
|
|
21746
22088
|
const el = elements.get(xref);
|
|
21747
22089
|
if (el === void 0) {
|
|
@@ -21784,6 +22126,74 @@ function phaseNullishCoalescing(job) {
|
|
|
21784
22126
|
}
|
|
21785
22127
|
}
|
|
21786
22128
|
}
|
|
22129
|
+
function kindTest(kind) {
|
|
22130
|
+
return (op) => op.kind === kind;
|
|
22131
|
+
}
|
|
22132
|
+
var CREATE_ORDERING = [
|
|
22133
|
+
{ test: (op) => op.kind === OpKind.Listener && op.hostListener && op.isAnimationListener },
|
|
22134
|
+
{ test: (op) => op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) }
|
|
22135
|
+
];
|
|
22136
|
+
var UPDATE_ORDERING = [
|
|
22137
|
+
{ test: (op) => op.kind === OpKind.HostProperty && op.expression instanceof Interpolation },
|
|
22138
|
+
{ test: (op) => op.kind === OpKind.HostProperty && !(op.expression instanceof Interpolation) },
|
|
22139
|
+
{ test: kindTest(OpKind.StyleMap), transform: keepLast },
|
|
22140
|
+
{ test: kindTest(OpKind.ClassMap), transform: keepLast },
|
|
22141
|
+
{ test: kindTest(OpKind.StyleProp) },
|
|
22142
|
+
{ test: kindTest(OpKind.ClassProp) },
|
|
22143
|
+
{ test: (op) => op.kind === OpKind.Property && op.expression instanceof Interpolation },
|
|
22144
|
+
{ test: (op) => op.kind === OpKind.Property && !(op.expression instanceof Interpolation) },
|
|
22145
|
+
{ test: kindTest(OpKind.Attribute) }
|
|
22146
|
+
];
|
|
22147
|
+
var handledOpKinds = /* @__PURE__ */ new Set([
|
|
22148
|
+
OpKind.Listener,
|
|
22149
|
+
OpKind.StyleMap,
|
|
22150
|
+
OpKind.ClassMap,
|
|
22151
|
+
OpKind.StyleProp,
|
|
22152
|
+
OpKind.ClassProp,
|
|
22153
|
+
OpKind.Property,
|
|
22154
|
+
OpKind.HostProperty,
|
|
22155
|
+
OpKind.Attribute
|
|
22156
|
+
]);
|
|
22157
|
+
function phaseOrdering(job) {
|
|
22158
|
+
for (const unit of job.units) {
|
|
22159
|
+
let opsToOrder = [];
|
|
22160
|
+
for (const op of unit.create) {
|
|
22161
|
+
if (handledOpKinds.has(op.kind)) {
|
|
22162
|
+
opsToOrder.push(op);
|
|
22163
|
+
OpList.remove(op);
|
|
22164
|
+
} else {
|
|
22165
|
+
OpList.insertBefore(reorder(opsToOrder, CREATE_ORDERING), op);
|
|
22166
|
+
opsToOrder = [];
|
|
22167
|
+
}
|
|
22168
|
+
}
|
|
22169
|
+
unit.create.push(reorder(opsToOrder, CREATE_ORDERING));
|
|
22170
|
+
opsToOrder = [];
|
|
22171
|
+
for (const op of unit.update) {
|
|
22172
|
+
if (handledOpKinds.has(op.kind)) {
|
|
22173
|
+
opsToOrder.push(op);
|
|
22174
|
+
OpList.remove(op);
|
|
22175
|
+
} else {
|
|
22176
|
+
OpList.insertBefore(reorder(opsToOrder, UPDATE_ORDERING), op);
|
|
22177
|
+
opsToOrder = [];
|
|
22178
|
+
}
|
|
22179
|
+
}
|
|
22180
|
+
unit.update.push(reorder(opsToOrder, UPDATE_ORDERING));
|
|
22181
|
+
}
|
|
22182
|
+
}
|
|
22183
|
+
function reorder(ops, ordering) {
|
|
22184
|
+
const groups = Array.from(ordering, () => new Array());
|
|
22185
|
+
for (const op of ops) {
|
|
22186
|
+
const groupIndex = ordering.findIndex((o) => o.test(op));
|
|
22187
|
+
groups[groupIndex].push(op);
|
|
22188
|
+
}
|
|
22189
|
+
return groups.flatMap((group, i) => {
|
|
22190
|
+
const transform2 = ordering[i].transform;
|
|
22191
|
+
return transform2 ? transform2(group) : group;
|
|
22192
|
+
});
|
|
22193
|
+
}
|
|
22194
|
+
function keepLast(ops) {
|
|
22195
|
+
return ops.slice(ops.length - 1);
|
|
22196
|
+
}
|
|
21787
22197
|
function phaseParseExtractedStyles(cpl) {
|
|
21788
22198
|
for (const unit of cpl.units) {
|
|
21789
22199
|
for (const op of unit.create) {
|
|
@@ -21805,6 +22215,28 @@ function phaseParseExtractedStyles(cpl) {
|
|
|
21805
22215
|
}
|
|
21806
22216
|
}
|
|
21807
22217
|
}
|
|
22218
|
+
function phaseRemoveContentSelectors(job) {
|
|
22219
|
+
for (const unit of job.units) {
|
|
22220
|
+
const elements = getElementsByXrefId(unit);
|
|
22221
|
+
for (const op of unit.update) {
|
|
22222
|
+
switch (op.kind) {
|
|
22223
|
+
case OpKind.Binding:
|
|
22224
|
+
const target = lookupElement(elements, op.target);
|
|
22225
|
+
if (op.name.toLowerCase() === "select" && target.kind === OpKind.Projection) {
|
|
22226
|
+
OpList.remove(op);
|
|
22227
|
+
}
|
|
22228
|
+
continue;
|
|
22229
|
+
}
|
|
22230
|
+
}
|
|
22231
|
+
}
|
|
22232
|
+
}
|
|
22233
|
+
function lookupElement(elements, xref) {
|
|
22234
|
+
const el = elements.get(xref);
|
|
22235
|
+
if (el === void 0) {
|
|
22236
|
+
throw new Error("All attributes should have an element-like target.");
|
|
22237
|
+
}
|
|
22238
|
+
return el;
|
|
22239
|
+
}
|
|
21808
22240
|
function phasePipeCreation(job) {
|
|
21809
22241
|
for (const unit of job.units) {
|
|
21810
22242
|
processPipeBindingsInView(unit);
|
|
@@ -21861,73 +22293,40 @@ function phasePipeVariadic(job) {
|
|
|
21861
22293
|
}
|
|
21862
22294
|
}
|
|
21863
22295
|
}
|
|
21864
|
-
function
|
|
21865
|
-
|
|
22296
|
+
function phasePropagateI18nBlocks(job) {
|
|
22297
|
+
propagateI18nBlocksToTemplates(job.root, 0);
|
|
21866
22298
|
}
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
OpKind.Property,
|
|
21889
|
-
OpKind.HostProperty,
|
|
21890
|
-
OpKind.Attribute
|
|
21891
|
-
]);
|
|
21892
|
-
function phaseOrdering(job) {
|
|
21893
|
-
for (const unit of job.units) {
|
|
21894
|
-
let opsToOrder = [];
|
|
21895
|
-
for (const op of unit.create) {
|
|
21896
|
-
if (handledOpKinds.has(op.kind)) {
|
|
21897
|
-
opsToOrder.push(op);
|
|
21898
|
-
OpList.remove(op);
|
|
21899
|
-
} else {
|
|
21900
|
-
OpList.insertBefore(reorder(opsToOrder, CREATE_ORDERING), op);
|
|
21901
|
-
opsToOrder = [];
|
|
21902
|
-
}
|
|
21903
|
-
}
|
|
21904
|
-
unit.create.push(reorder(opsToOrder, CREATE_ORDERING));
|
|
21905
|
-
opsToOrder = [];
|
|
21906
|
-
for (const op of unit.update) {
|
|
21907
|
-
if (handledOpKinds.has(op.kind)) {
|
|
21908
|
-
opsToOrder.push(op);
|
|
21909
|
-
OpList.remove(op);
|
|
21910
|
-
} else {
|
|
21911
|
-
OpList.insertBefore(reorder(opsToOrder, UPDATE_ORDERING), op);
|
|
21912
|
-
opsToOrder = [];
|
|
21913
|
-
}
|
|
22299
|
+
function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
|
|
22300
|
+
let i18nBlock = null;
|
|
22301
|
+
for (const op of unit.create) {
|
|
22302
|
+
switch (op.kind) {
|
|
22303
|
+
case OpKind.I18nStart:
|
|
22304
|
+
op.subTemplateIndex = subTemplateIndex === 0 ? null : subTemplateIndex;
|
|
22305
|
+
i18nBlock = op;
|
|
22306
|
+
break;
|
|
22307
|
+
case OpKind.I18nEnd:
|
|
22308
|
+
i18nBlock = null;
|
|
22309
|
+
break;
|
|
22310
|
+
case OpKind.Template:
|
|
22311
|
+
const templateView = unit.job.views.get(op.xref);
|
|
22312
|
+
if (op.i18nPlaceholder !== void 0) {
|
|
22313
|
+
if (i18nBlock === null) {
|
|
22314
|
+
throw Error("Expected template with i18n placeholder to be in an i18n block.");
|
|
22315
|
+
}
|
|
22316
|
+
subTemplateIndex++;
|
|
22317
|
+
wrapTemplateWithI18n(templateView, i18nBlock);
|
|
22318
|
+
}
|
|
22319
|
+
propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
|
|
21914
22320
|
}
|
|
21915
|
-
unit.update.push(reorder(opsToOrder, UPDATE_ORDERING));
|
|
21916
22321
|
}
|
|
21917
22322
|
}
|
|
21918
|
-
function
|
|
21919
|
-
|
|
21920
|
-
|
|
21921
|
-
const
|
|
21922
|
-
|
|
22323
|
+
function wrapTemplateWithI18n(unit, parentI18n) {
|
|
22324
|
+
var _a2;
|
|
22325
|
+
if (((_a2 = unit.create.head.next) == null ? void 0 : _a2.kind) !== OpKind.I18nStart) {
|
|
22326
|
+
const id = unit.job.allocateXrefId();
|
|
22327
|
+
OpList.insertAfter(createI18nStartOp(id, parentI18n.message, parentI18n.root), unit.create.head);
|
|
22328
|
+
OpList.insertBefore(createI18nEndOp(id), unit.create.tail);
|
|
21923
22329
|
}
|
|
21924
|
-
return groups.flatMap((group, i) => {
|
|
21925
|
-
const transform2 = ordering[i].transform;
|
|
21926
|
-
return transform2 ? transform2(group) : group;
|
|
21927
|
-
});
|
|
21928
|
-
}
|
|
21929
|
-
function keepLast(ops) {
|
|
21930
|
-
return ops.slice(ops.length - 1);
|
|
21931
22330
|
}
|
|
21932
22331
|
function phasePureFunctionExtraction(job) {
|
|
21933
22332
|
for (const view of job.units) {
|
|
@@ -21958,15 +22357,15 @@ var PureFunctionConstant = class extends GenericKeyFn {
|
|
|
21958
22357
|
toSharedConstantDeclaration(declName, keyExpr) {
|
|
21959
22358
|
const fnParams = [];
|
|
21960
22359
|
for (let idx = 0; idx < this.numArgs; idx++) {
|
|
21961
|
-
fnParams.push(new FnParam("
|
|
22360
|
+
fnParams.push(new FnParam("a" + idx));
|
|
21962
22361
|
}
|
|
21963
22362
|
const returnExpr = transformExpressionsInExpression(keyExpr, (expr) => {
|
|
21964
22363
|
if (!(expr instanceof PureFunctionParameterExpr)) {
|
|
21965
22364
|
return expr;
|
|
21966
22365
|
}
|
|
21967
|
-
return variable("
|
|
22366
|
+
return variable("a" + expr.index);
|
|
21968
22367
|
}, VisitorContextFlag.None);
|
|
21969
|
-
return new
|
|
22368
|
+
return new DeclareVarStmt(declName, new ArrowFunctionExpr(fnParams, returnExpr), void 0, StmtModifier.Final);
|
|
21970
22369
|
}
|
|
21971
22370
|
};
|
|
21972
22371
|
function phasePureLiteralStructures(job) {
|
|
@@ -22049,7 +22448,7 @@ function elementContainerEnd() {
|
|
|
22049
22448
|
}
|
|
22050
22449
|
function template(slot, templateFnRef, decls, vars, tag, constIndex, sourceSpan) {
|
|
22051
22450
|
const args = [literal(slot), templateFnRef, literal(decls), literal(vars)];
|
|
22052
|
-
if (tag !== null) {
|
|
22451
|
+
if (tag !== null || constIndex !== null) {
|
|
22053
22452
|
args.push(literal(tag));
|
|
22054
22453
|
if (constIndex !== null) {
|
|
22055
22454
|
args.push(literal(constIndex));
|
|
@@ -22123,6 +22522,25 @@ function text(slot, initialValue, sourceSpan) {
|
|
|
22123
22522
|
}
|
|
22124
22523
|
return call(Identifiers.text, args, sourceSpan);
|
|
22125
22524
|
}
|
|
22525
|
+
function defer(selfSlot, primarySlot, dependencyResolverFn, loadingSlot, placeholderSlot, errorSlot, loadingConfigIndex, placeholderConfigIndex, sourceSpan) {
|
|
22526
|
+
const args = [
|
|
22527
|
+
literal(selfSlot),
|
|
22528
|
+
literal(primarySlot),
|
|
22529
|
+
literal(dependencyResolverFn),
|
|
22530
|
+
literal(loadingSlot),
|
|
22531
|
+
literal(placeholderSlot),
|
|
22532
|
+
literal(errorSlot),
|
|
22533
|
+
literal(loadingConfigIndex),
|
|
22534
|
+
literal(placeholderConfigIndex)
|
|
22535
|
+
];
|
|
22536
|
+
while (args[args.length - 1].value === null) {
|
|
22537
|
+
args.pop();
|
|
22538
|
+
}
|
|
22539
|
+
return call(Identifiers.defer, args, sourceSpan);
|
|
22540
|
+
}
|
|
22541
|
+
function deferOn(sourceSpan) {
|
|
22542
|
+
return call(Identifiers.deferOnIdle, [], sourceSpan);
|
|
22543
|
+
}
|
|
22126
22544
|
function projectionDef(def) {
|
|
22127
22545
|
return call(Identifiers.projectionDef, def ? [def] : [], null);
|
|
22128
22546
|
}
|
|
@@ -22136,11 +22554,19 @@ function projection(slot, projectionSlotIndex, attributes) {
|
|
|
22136
22554
|
}
|
|
22137
22555
|
return call(Identifiers.projection, args, null);
|
|
22138
22556
|
}
|
|
22139
|
-
function i18nStart(slot, constIndex) {
|
|
22140
|
-
|
|
22557
|
+
function i18nStart(slot, constIndex, subTemplateIndex) {
|
|
22558
|
+
const args = [literal(slot), literal(constIndex)];
|
|
22559
|
+
if (subTemplateIndex !== null) {
|
|
22560
|
+
args.push(literal(subTemplateIndex));
|
|
22561
|
+
}
|
|
22562
|
+
return call(Identifiers.i18nStart, args, null);
|
|
22141
22563
|
}
|
|
22142
|
-
function i18n(slot) {
|
|
22143
|
-
|
|
22564
|
+
function i18n(slot, constIndex, subTemplateIndex) {
|
|
22565
|
+
const args = [literal(slot), literal(constIndex)];
|
|
22566
|
+
if (subTemplateIndex) {
|
|
22567
|
+
args.push(literal(subTemplateIndex));
|
|
22568
|
+
}
|
|
22569
|
+
return call(Identifiers.i18n, args, null);
|
|
22144
22570
|
}
|
|
22145
22571
|
function i18nEnd() {
|
|
22146
22572
|
return call(Identifiers.i18nEnd, [], null);
|
|
@@ -22215,6 +22641,12 @@ function textInterpolate(strings, expressions, sourceSpan) {
|
|
|
22215
22641
|
}
|
|
22216
22642
|
return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
22217
22643
|
}
|
|
22644
|
+
function i18nExp(expr, sourceSpan) {
|
|
22645
|
+
return call(Identifiers.i18nExp, [expr], sourceSpan);
|
|
22646
|
+
}
|
|
22647
|
+
function i18nApply(slot, sourceSpan) {
|
|
22648
|
+
return call(Identifiers.i18nApply, [literal(slot)], sourceSpan);
|
|
22649
|
+
}
|
|
22218
22650
|
function propertyInterpolate(name, strings, expressions, sanitizer, sourceSpan) {
|
|
22219
22651
|
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
22220
22652
|
const extraArgs = [];
|
|
@@ -22279,8 +22711,12 @@ function call(instruction, args, sourceSpan) {
|
|
|
22279
22711
|
const expr = importExpr(instruction).callFn(args, sourceSpan);
|
|
22280
22712
|
return createStatementOp(new ExpressionStatement(expr, sourceSpan));
|
|
22281
22713
|
}
|
|
22282
|
-
function conditional(slot, condition) {
|
|
22283
|
-
|
|
22714
|
+
function conditional(slot, condition, contextValue, sourceSpan) {
|
|
22715
|
+
const args = [literal(slot), condition];
|
|
22716
|
+
if (contextValue !== null) {
|
|
22717
|
+
args.push(contextValue);
|
|
22718
|
+
}
|
|
22719
|
+
return call(Identifiers.conditional, args, sourceSpan);
|
|
22284
22720
|
}
|
|
22285
22721
|
var TEXT_INTERPOLATE_CONFIG = {
|
|
22286
22722
|
constant: [
|
|
@@ -22445,6 +22881,7 @@ function phaseReify(cpl) {
|
|
|
22445
22881
|
}
|
|
22446
22882
|
}
|
|
22447
22883
|
function reifyCreateOperations(unit, ops) {
|
|
22884
|
+
var _a2, _b2, _c2, _d2;
|
|
22448
22885
|
for (const op of ops) {
|
|
22449
22886
|
transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
|
|
22450
22887
|
switch (op.kind) {
|
|
@@ -22470,20 +22907,20 @@ function reifyCreateOperations(unit, ops) {
|
|
|
22470
22907
|
OpList.replace(op, elementContainerEnd());
|
|
22471
22908
|
break;
|
|
22472
22909
|
case OpKind.I18nStart:
|
|
22473
|
-
OpList.replace(op, i18nStart(op.slot, op.messageIndex));
|
|
22910
|
+
OpList.replace(op, i18nStart(op.slot, op.messageIndex, op.subTemplateIndex));
|
|
22474
22911
|
break;
|
|
22475
22912
|
case OpKind.I18nEnd:
|
|
22476
22913
|
OpList.replace(op, i18nEnd());
|
|
22477
22914
|
break;
|
|
22478
22915
|
case OpKind.I18n:
|
|
22479
|
-
OpList.replace(op, i18n(op.slot));
|
|
22916
|
+
OpList.replace(op, i18n(op.slot, op.messageIndex, op.subTemplateIndex));
|
|
22480
22917
|
break;
|
|
22481
22918
|
case OpKind.Template:
|
|
22482
22919
|
if (!(unit instanceof ViewCompilationUnit)) {
|
|
22483
22920
|
throw new Error(`AssertionError: must be compiling a component`);
|
|
22484
22921
|
}
|
|
22485
22922
|
const childView = unit.job.views.get(op.xref);
|
|
22486
|
-
OpList.replace(op, template(op.slot, variable(childView.fnName), childView.decls, childView.vars, op.
|
|
22923
|
+
OpList.replace(op, template(op.slot, variable(childView.fnName), childView.decls, childView.vars, op.block ? null : op.tag, op.attributes, op.sourceSpan));
|
|
22487
22924
|
break;
|
|
22488
22925
|
case OpKind.DisableBindings:
|
|
22489
22926
|
OpList.replace(op, disableBindings());
|
|
@@ -22518,6 +22955,15 @@ function reifyCreateOperations(unit, ops) {
|
|
|
22518
22955
|
break;
|
|
22519
22956
|
}
|
|
22520
22957
|
break;
|
|
22958
|
+
case OpKind.Defer:
|
|
22959
|
+
OpList.replace(op, defer(op.slot, op.targetSlot, null, op.loading && op.loading.targetSlot, op.placeholder && op.placeholder.targetSlot, op.error && op.error.targetSlot, (_b2 = (_a2 = op.loading) == null ? void 0 : _a2.constIndex) != null ? _b2 : null, (_d2 = (_c2 = op.placeholder) == null ? void 0 : _c2.constIndex) != null ? _d2 : null, op.sourceSpan));
|
|
22960
|
+
break;
|
|
22961
|
+
case OpKind.DeferSecondaryBlock:
|
|
22962
|
+
OpList.remove(op);
|
|
22963
|
+
break;
|
|
22964
|
+
case OpKind.DeferOn:
|
|
22965
|
+
OpList.replace(op, deferOn(op.sourceSpan));
|
|
22966
|
+
break;
|
|
22521
22967
|
case OpKind.ProjectionDef:
|
|
22522
22968
|
OpList.replace(op, projectionDef(op.def));
|
|
22523
22969
|
break;
|
|
@@ -22572,6 +23018,12 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
22572
23018
|
OpList.replace(op, classMap(op.expression, op.sourceSpan));
|
|
22573
23019
|
}
|
|
22574
23020
|
break;
|
|
23021
|
+
case OpKind.I18nExpression:
|
|
23022
|
+
OpList.replace(op, i18nExp(op.expression, op.sourceSpan));
|
|
23023
|
+
break;
|
|
23024
|
+
case OpKind.I18nApply:
|
|
23025
|
+
OpList.replace(op, i18nApply(op.targetSlot, op.sourceSpan));
|
|
23026
|
+
break;
|
|
22575
23027
|
case OpKind.InterpolateText:
|
|
22576
23028
|
OpList.replace(op, textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan));
|
|
22577
23029
|
break;
|
|
@@ -22603,10 +23055,10 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
22603
23055
|
if (op.processed === null) {
|
|
22604
23056
|
throw new Error(`Conditional test was not set.`);
|
|
22605
23057
|
}
|
|
22606
|
-
if (op.
|
|
23058
|
+
if (op.targetSlot === null) {
|
|
22607
23059
|
throw new Error(`Conditional slot was not set.`);
|
|
22608
23060
|
}
|
|
22609
|
-
OpList.replace(op, conditional(op.
|
|
23061
|
+
OpList.replace(op, conditional(op.targetSlot, op.processed, op.contextValue, op.sourceSpan));
|
|
22610
23062
|
break;
|
|
22611
23063
|
case OpKind.Statement:
|
|
22612
23064
|
break;
|
|
@@ -22623,7 +23075,7 @@ function reifyIrExpression(expr) {
|
|
|
22623
23075
|
case ExpressionKind.NextContext:
|
|
22624
23076
|
return nextContext(expr.steps);
|
|
22625
23077
|
case ExpressionKind.Reference:
|
|
22626
|
-
return reference(expr.
|
|
23078
|
+
return reference(expr.targetSlot + 1 + expr.offset);
|
|
22627
23079
|
case ExpressionKind.LexicalRead:
|
|
22628
23080
|
throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);
|
|
22629
23081
|
case ExpressionKind.RestoreView:
|
|
@@ -22658,13 +23110,13 @@ function reifyIrExpression(expr) {
|
|
|
22658
23110
|
case ExpressionKind.PureFunctionParameterExpr:
|
|
22659
23111
|
throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`);
|
|
22660
23112
|
case ExpressionKind.PipeBinding:
|
|
22661
|
-
return pipeBind(expr.
|
|
23113
|
+
return pipeBind(expr.targetSlot, expr.varOffset, expr.args);
|
|
22662
23114
|
case ExpressionKind.PipeBindingVariadic:
|
|
22663
|
-
return pipeBindV(expr.
|
|
23115
|
+
return pipeBindV(expr.targetSlot, expr.varOffset, expr.args);
|
|
22664
23116
|
case ExpressionKind.SanitizerExpr:
|
|
22665
23117
|
return importExpr(sanitizerIdentifierMap.get(expr.fn));
|
|
22666
23118
|
case ExpressionKind.SlotLiteralExpr:
|
|
22667
|
-
return literal(expr.
|
|
23119
|
+
return literal(expr.targetSlot);
|
|
22668
23120
|
default:
|
|
22669
23121
|
throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
|
|
22670
23122
|
}
|
|
@@ -22759,38 +23211,186 @@ function resolveDollarEvent(unit, ops) {
|
|
|
22759
23211
|
}
|
|
22760
23212
|
}
|
|
22761
23213
|
var ESCAPE = "\uFFFD";
|
|
23214
|
+
var ELEMENT_MARKER = "#";
|
|
23215
|
+
var TEMPLATE_MARKER = "*";
|
|
23216
|
+
var TAG_CLOSE_MARKER = "/";
|
|
23217
|
+
var CONTEXT_MARKER = ":";
|
|
23218
|
+
var LIST_START_MARKER = "[";
|
|
23219
|
+
var LIST_END_MARKER = "]";
|
|
23220
|
+
var LIST_DELIMITER = "|";
|
|
23221
|
+
var I18nParamValueFlags;
|
|
23222
|
+
(function(I18nParamValueFlags2) {
|
|
23223
|
+
I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
|
|
23224
|
+
I18nParamValueFlags2[I18nParamValueFlags2["ElementTag"] = 1] = "ElementTag";
|
|
23225
|
+
I18nParamValueFlags2[I18nParamValueFlags2["TemplateTag"] = 2] = "TemplateTag";
|
|
23226
|
+
I18nParamValueFlags2[I18nParamValueFlags2["OpenTag"] = 4] = "OpenTag";
|
|
23227
|
+
I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 8] = "CloseTag";
|
|
23228
|
+
})(I18nParamValueFlags || (I18nParamValueFlags = {}));
|
|
23229
|
+
var I18nPlaceholderParams = class {
|
|
23230
|
+
constructor() {
|
|
23231
|
+
this.values = /* @__PURE__ */ new Map();
|
|
23232
|
+
}
|
|
23233
|
+
addValue(placeholder, value, subTemplateIndex, resolutionTime, flags) {
|
|
23234
|
+
var _a2;
|
|
23235
|
+
const placeholderValues = (_a2 = this.values.get(placeholder)) != null ? _a2 : [];
|
|
23236
|
+
placeholderValues.push({ value, subTemplateIndex, resolutionTime, flags });
|
|
23237
|
+
this.values.set(placeholder, placeholderValues);
|
|
23238
|
+
}
|
|
23239
|
+
saveToOp(op) {
|
|
23240
|
+
for (const [placeholder, placeholderValues] of this.values) {
|
|
23241
|
+
const creationValues = placeholderValues.filter(({ resolutionTime }) => resolutionTime === I18nParamResolutionTime.Creation);
|
|
23242
|
+
if (creationValues.length > 1) {
|
|
23243
|
+
op.needsPostprocessing = true;
|
|
23244
|
+
}
|
|
23245
|
+
const serializedCreationValues = this.serializeValues(creationValues);
|
|
23246
|
+
if (serializedCreationValues !== null) {
|
|
23247
|
+
op.params.set(placeholder, literal(serializedCreationValues));
|
|
23248
|
+
}
|
|
23249
|
+
const serializedPostprocessingValues = this.serializeValues(placeholderValues.filter(({ resolutionTime }) => resolutionTime === I18nParamResolutionTime.Postproccessing));
|
|
23250
|
+
if (serializedPostprocessingValues !== null) {
|
|
23251
|
+
op.needsPostprocessing = true;
|
|
23252
|
+
op.postprocessingParams.set(placeholder, literal(serializedPostprocessingValues));
|
|
23253
|
+
}
|
|
23254
|
+
}
|
|
23255
|
+
}
|
|
23256
|
+
merge(other) {
|
|
23257
|
+
for (const [placeholder, otherValues] of other.values) {
|
|
23258
|
+
const currentValues = this.values.get(placeholder) || [];
|
|
23259
|
+
const flags = otherValues[0].flags;
|
|
23260
|
+
if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
|
|
23261
|
+
this.values.set(placeholder, [...otherValues, ...currentValues]);
|
|
23262
|
+
} else {
|
|
23263
|
+
this.values.set(placeholder, [...currentValues, ...otherValues]);
|
|
23264
|
+
}
|
|
23265
|
+
}
|
|
23266
|
+
}
|
|
23267
|
+
serializeValues(values) {
|
|
23268
|
+
if (values.length === 0) {
|
|
23269
|
+
return null;
|
|
23270
|
+
}
|
|
23271
|
+
const serializedValues = values.map((value) => this.serializeValue(value));
|
|
23272
|
+
return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
|
|
23273
|
+
}
|
|
23274
|
+
serializeValue(value) {
|
|
23275
|
+
let tagMarker = "";
|
|
23276
|
+
let closeMarker = "";
|
|
23277
|
+
if (value.flags & I18nParamValueFlags.ElementTag) {
|
|
23278
|
+
tagMarker = ELEMENT_MARKER;
|
|
23279
|
+
} else if (value.flags & I18nParamValueFlags.TemplateTag) {
|
|
23280
|
+
tagMarker = TEMPLATE_MARKER;
|
|
23281
|
+
}
|
|
23282
|
+
if (tagMarker !== "") {
|
|
23283
|
+
closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
|
|
23284
|
+
}
|
|
23285
|
+
const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
|
|
23286
|
+
if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
|
|
23287
|
+
return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
|
|
23288
|
+
}
|
|
23289
|
+
return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
|
|
23290
|
+
}
|
|
23291
|
+
};
|
|
22762
23292
|
function phaseResolveI18nPlaceholders(job) {
|
|
23293
|
+
const params = /* @__PURE__ */ new Map();
|
|
23294
|
+
const i18nOps = /* @__PURE__ */ new Map();
|
|
23295
|
+
resolvePlaceholders(job, params, i18nOps);
|
|
23296
|
+
propagatePlaceholders(params, i18nOps);
|
|
23297
|
+
for (const [xref, i18nOpParams] of params) {
|
|
23298
|
+
i18nOpParams.saveToOp(i18nOps.get(xref));
|
|
23299
|
+
}
|
|
23300
|
+
for (const op of i18nOps.values()) {
|
|
23301
|
+
if (op.xref === op.root) {
|
|
23302
|
+
for (const placeholder in op.message.placeholders) {
|
|
23303
|
+
if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
|
|
23304
|
+
throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
|
|
23305
|
+
}
|
|
23306
|
+
}
|
|
23307
|
+
}
|
|
23308
|
+
}
|
|
23309
|
+
}
|
|
23310
|
+
function resolvePlaceholders(job, params, i18nOps) {
|
|
22763
23311
|
for (const unit of job.units) {
|
|
22764
|
-
|
|
22765
|
-
let
|
|
22766
|
-
let closeTags = [];
|
|
23312
|
+
const elements = /* @__PURE__ */ new Map();
|
|
23313
|
+
let currentI18nOp = null;
|
|
22767
23314
|
for (const op of unit.create) {
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
|
|
22774
|
-
|
|
22775
|
-
|
|
22776
|
-
|
|
22777
|
-
|
|
22778
|
-
|
|
22779
|
-
|
|
22780
|
-
|
|
22781
|
-
|
|
22782
|
-
|
|
22783
|
-
|
|
22784
|
-
|
|
22785
|
-
|
|
23315
|
+
switch (op.kind) {
|
|
23316
|
+
case OpKind.I18nStart:
|
|
23317
|
+
i18nOps.set(op.xref, op);
|
|
23318
|
+
currentI18nOp = op.kind === OpKind.I18nStart ? op : null;
|
|
23319
|
+
break;
|
|
23320
|
+
case OpKind.I18nEnd:
|
|
23321
|
+
currentI18nOp = null;
|
|
23322
|
+
break;
|
|
23323
|
+
case OpKind.ElementStart:
|
|
23324
|
+
if (op.i18nPlaceholder !== void 0) {
|
|
23325
|
+
if (currentI18nOp === null) {
|
|
23326
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
23327
|
+
}
|
|
23328
|
+
elements.set(op.xref, op);
|
|
23329
|
+
const { startName, closeName } = op.i18nPlaceholder;
|
|
23330
|
+
let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
|
|
23331
|
+
if (closeName === "") {
|
|
23332
|
+
flags |= I18nParamValueFlags.CloseTag;
|
|
23333
|
+
}
|
|
23334
|
+
addParam(params, currentI18nOp, startName, op.slot, currentI18nOp.subTemplateIndex, I18nParamResolutionTime.Creation, flags);
|
|
23335
|
+
}
|
|
23336
|
+
break;
|
|
23337
|
+
case OpKind.ElementEnd:
|
|
23338
|
+
const startOp = elements.get(op.xref);
|
|
23339
|
+
if (startOp && startOp.i18nPlaceholder !== void 0) {
|
|
23340
|
+
if (currentI18nOp === null) {
|
|
23341
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
23342
|
+
}
|
|
23343
|
+
const { closeName } = startOp.i18nPlaceholder;
|
|
23344
|
+
if (closeName !== "") {
|
|
23345
|
+
addParam(params, currentI18nOp, closeName, startOp.slot, currentI18nOp.subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
|
|
23346
|
+
}
|
|
23347
|
+
}
|
|
23348
|
+
break;
|
|
23349
|
+
case OpKind.Template:
|
|
23350
|
+
if (op.i18nPlaceholder !== void 0) {
|
|
23351
|
+
if (currentI18nOp === null) {
|
|
23352
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
23353
|
+
}
|
|
23354
|
+
const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentI18nOp, op);
|
|
23355
|
+
addParam(params, currentI18nOp, op.i18nPlaceholder.startName, op.slot, subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.TemplateTag);
|
|
23356
|
+
addParam(params, currentI18nOp, op.i18nPlaceholder.closeName, op.slot, subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
|
|
23357
|
+
}
|
|
23358
|
+
break;
|
|
23359
|
+
}
|
|
23360
|
+
}
|
|
23361
|
+
const i18nBlockPlaceholderIndices = /* @__PURE__ */ new Map();
|
|
23362
|
+
for (const op of unit.update) {
|
|
23363
|
+
if (op.kind === OpKind.I18nExpression) {
|
|
23364
|
+
const i18nOp = i18nOps.get(op.owner);
|
|
23365
|
+
let index2 = i18nBlockPlaceholderIndices.get(op.owner) || 0;
|
|
23366
|
+
if (!i18nOp) {
|
|
23367
|
+
throw Error("Cannot find corresponding i18nStart for i18nExpr");
|
|
23368
|
+
}
|
|
23369
|
+
addParam(params, i18nOp, op.i18nPlaceholder, index2++, i18nOp.subTemplateIndex, op.resolutionTime);
|
|
23370
|
+
i18nBlockPlaceholderIndices.set(op.owner, index2);
|
|
22786
23371
|
}
|
|
22787
23372
|
}
|
|
22788
|
-
|
|
22789
|
-
|
|
23373
|
+
}
|
|
23374
|
+
}
|
|
23375
|
+
function addParam(params, i18nOp, placeholder, value, subTemplateIndex, resolutionTime, flags = I18nParamValueFlags.None) {
|
|
23376
|
+
const i18nOpParams = params.get(i18nOp.xref) || new I18nPlaceholderParams();
|
|
23377
|
+
i18nOpParams.addValue(placeholder, value, subTemplateIndex, resolutionTime, flags);
|
|
23378
|
+
params.set(i18nOp.xref, i18nOpParams);
|
|
23379
|
+
}
|
|
23380
|
+
function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
|
|
23381
|
+
for (const childOp of job.views.get(op.xref).create) {
|
|
23382
|
+
if (childOp.kind === OpKind.I18nStart) {
|
|
23383
|
+
return childOp.subTemplateIndex;
|
|
22790
23384
|
}
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
23385
|
+
}
|
|
23386
|
+
return i18nOp.subTemplateIndex;
|
|
23387
|
+
}
|
|
23388
|
+
function propagatePlaceholders(params, i18nOps) {
|
|
23389
|
+
for (const [xref, opParams] of params) {
|
|
23390
|
+
const op = i18nOps.get(xref);
|
|
23391
|
+
if (op.xref !== op.root) {
|
|
23392
|
+
const rootParams = params.get(op.root) || new I18nPlaceholderParams();
|
|
23393
|
+
rootParams.merge(opParams);
|
|
22794
23394
|
}
|
|
22795
23395
|
}
|
|
22796
23396
|
}
|
|
@@ -22887,7 +23487,8 @@ function phaseResolveSanitizers(job) {
|
|
|
22887
23487
|
}
|
|
22888
23488
|
}
|
|
22889
23489
|
function isIframeElement$1(op) {
|
|
22890
|
-
|
|
23490
|
+
var _a2;
|
|
23491
|
+
return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
|
|
22891
23492
|
}
|
|
22892
23493
|
function phaseSaveRestoreView(job) {
|
|
22893
23494
|
for (const view of job.views.values()) {
|
|
@@ -22952,23 +23553,23 @@ function phaseSlotAllocation(job) {
|
|
|
22952
23553
|
const childView = job.views.get(op.xref);
|
|
22953
23554
|
op.decls = childView.decls;
|
|
22954
23555
|
}
|
|
22955
|
-
if (hasUsesSlotIndexTrait(op) && op.
|
|
23556
|
+
if (hasUsesSlotIndexTrait(op) && op.targetSlot === null) {
|
|
22956
23557
|
if (!slotMap.has(op.target)) {
|
|
22957
23558
|
throw new Error(`AssertionError: no slot allocated for ${OpKind[op.kind]} target ${op.target}`);
|
|
22958
23559
|
}
|
|
22959
|
-
op.
|
|
23560
|
+
op.targetSlot = slotMap.get(op.target);
|
|
22960
23561
|
}
|
|
22961
23562
|
visitExpressionsInOp(op, (expr) => {
|
|
22962
23563
|
if (!isIrExpression(expr)) {
|
|
22963
23564
|
return;
|
|
22964
23565
|
}
|
|
22965
|
-
if (!hasUsesSlotIndexTrait(expr) || expr.
|
|
23566
|
+
if (!hasUsesSlotIndexTrait(expr) || expr.targetSlot !== null) {
|
|
22966
23567
|
return;
|
|
22967
23568
|
}
|
|
22968
23569
|
if (!slotMap.has(expr.target)) {
|
|
22969
23570
|
throw new Error(`AssertionError: no slot allocated for ${expr.constructor.name} target ${expr.target}`);
|
|
22970
23571
|
}
|
|
22971
|
-
expr.
|
|
23572
|
+
expr.targetSlot = slotMap.get(expr.target);
|
|
22972
23573
|
});
|
|
22973
23574
|
}
|
|
22974
23575
|
}
|
|
@@ -23003,39 +23604,52 @@ function phaseStyleBindingSpecialization(cpl) {
|
|
|
23003
23604
|
}
|
|
23004
23605
|
function phaseTemporaryVariables(cpl) {
|
|
23005
23606
|
for (const unit of cpl.units) {
|
|
23006
|
-
|
|
23007
|
-
|
|
23008
|
-
|
|
23009
|
-
|
|
23010
|
-
|
|
23011
|
-
|
|
23012
|
-
|
|
23607
|
+
unit.create.prepend(generateTemporaries(unit.create));
|
|
23608
|
+
unit.update.prepend(generateTemporaries(unit.update));
|
|
23609
|
+
}
|
|
23610
|
+
}
|
|
23611
|
+
function generateTemporaries(ops) {
|
|
23612
|
+
let opCount = 0;
|
|
23613
|
+
let generatedStatements = [];
|
|
23614
|
+
for (const op of ops) {
|
|
23615
|
+
const finalReads = /* @__PURE__ */ new Map();
|
|
23616
|
+
visitExpressionsInOp(op, (expr, flag) => {
|
|
23617
|
+
if (flag & VisitorContextFlag.InChildOperation) {
|
|
23618
|
+
return;
|
|
23619
|
+
}
|
|
23620
|
+
if (expr instanceof ReadTemporaryExpr) {
|
|
23621
|
+
finalReads.set(expr.xref, expr);
|
|
23622
|
+
}
|
|
23623
|
+
});
|
|
23624
|
+
let count = 0;
|
|
23625
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
23626
|
+
const released = /* @__PURE__ */ new Set();
|
|
23627
|
+
const defs = /* @__PURE__ */ new Map();
|
|
23628
|
+
visitExpressionsInOp(op, (expr, flag) => {
|
|
23629
|
+
if (flag & VisitorContextFlag.InChildOperation) {
|
|
23630
|
+
return;
|
|
23631
|
+
}
|
|
23632
|
+
if (expr instanceof AssignTemporaryExpr) {
|
|
23633
|
+
if (!assigned.has(expr.xref)) {
|
|
23634
|
+
assigned.add(expr.xref);
|
|
23635
|
+
defs.set(expr.xref, `tmp_${opCount}_${count++}`);
|
|
23013
23636
|
}
|
|
23014
|
-
|
|
23015
|
-
|
|
23016
|
-
|
|
23017
|
-
|
|
23018
|
-
|
|
23019
|
-
visitExpressionsInOp(op, (expr) => {
|
|
23020
|
-
if (expr instanceof AssignTemporaryExpr) {
|
|
23021
|
-
if (!assigned.has(expr.xref)) {
|
|
23022
|
-
assigned.add(expr.xref);
|
|
23023
|
-
defs.set(expr.xref, `tmp_${opCount}_${count++}`);
|
|
23024
|
-
}
|
|
23025
|
-
assignName(defs, expr);
|
|
23026
|
-
} else if (expr instanceof ReadTemporaryExpr) {
|
|
23027
|
-
if (finalReads.get(expr.xref) === expr) {
|
|
23028
|
-
released.add(expr.xref);
|
|
23029
|
-
count--;
|
|
23030
|
-
}
|
|
23031
|
-
assignName(defs, expr);
|
|
23637
|
+
assignName(defs, expr);
|
|
23638
|
+
} else if (expr instanceof ReadTemporaryExpr) {
|
|
23639
|
+
if (finalReads.get(expr.xref) === expr) {
|
|
23640
|
+
released.add(expr.xref);
|
|
23641
|
+
count--;
|
|
23032
23642
|
}
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23643
|
+
assignName(defs, expr);
|
|
23644
|
+
}
|
|
23645
|
+
});
|
|
23646
|
+
generatedStatements.push(...Array.from(new Set(defs.values())).map((name) => createStatementOp(new DeclareVarStmt(name))));
|
|
23647
|
+
opCount++;
|
|
23648
|
+
if (op.kind === OpKind.Listener) {
|
|
23649
|
+
op.handlerOps.prepend(generateTemporaries(op.handlerOps));
|
|
23036
23650
|
}
|
|
23037
|
-
unit.update.prepend(generatedStatements);
|
|
23038
23651
|
}
|
|
23652
|
+
return generatedStatements;
|
|
23039
23653
|
}
|
|
23040
23654
|
function assignName(names, expr) {
|
|
23041
23655
|
const name = names.get(expr.xref);
|
|
@@ -23245,6 +23859,9 @@ function tryInlineVariableInitializer(id, initializer, target, declFences) {
|
|
|
23245
23859
|
function allowConservativeInlining(decl2, target) {
|
|
23246
23860
|
switch (decl2.variable.kind) {
|
|
23247
23861
|
case SemanticVariableKind.Identifier:
|
|
23862
|
+
if (decl2.initializer instanceof ReadVarExpr && decl2.initializer.name === "ctx") {
|
|
23863
|
+
return true;
|
|
23864
|
+
}
|
|
23248
23865
|
return false;
|
|
23249
23866
|
case SemanticVariableKind.Context:
|
|
23250
23867
|
return target.kind === OpKind.Variable;
|
|
@@ -23252,82 +23869,44 @@ function allowConservativeInlining(decl2, target) {
|
|
|
23252
23869
|
return true;
|
|
23253
23870
|
}
|
|
23254
23871
|
}
|
|
23255
|
-
function
|
|
23256
|
-
const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
|
|
23257
|
-
const selectors = [];
|
|
23258
|
-
let projectionSlotIndex = 0;
|
|
23259
|
-
for (const unit of job.units) {
|
|
23260
|
-
for (const op of unit.create) {
|
|
23261
|
-
if (op.kind === OpKind.Projection) {
|
|
23262
|
-
selectors.push(op.selector);
|
|
23263
|
-
op.projectionSlotIndex = projectionSlotIndex++;
|
|
23264
|
-
}
|
|
23265
|
-
}
|
|
23266
|
-
}
|
|
23267
|
-
if (selectors.length > 0) {
|
|
23268
|
-
let defExpr = null;
|
|
23269
|
-
if (selectors.length > 1 || selectors[0] !== "*") {
|
|
23270
|
-
const def = selectors.map((s) => s === "*" ? s : parseSelectorToR3Selector(s));
|
|
23271
|
-
defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share);
|
|
23272
|
-
}
|
|
23273
|
-
job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share);
|
|
23274
|
-
job.root.create.prepend([createProjectionDefOp(defExpr)]);
|
|
23275
|
-
}
|
|
23276
|
-
}
|
|
23277
|
-
function phaseI18nConstCollection(job) {
|
|
23278
|
-
const messageConstIndices = {};
|
|
23872
|
+
function phaseWrapIcus(job) {
|
|
23279
23873
|
for (const unit of job.units) {
|
|
23874
|
+
let currentI18nOp = null;
|
|
23280
23875
|
for (const op of unit.create) {
|
|
23281
|
-
if (op.kind === OpKind.ExtractedMessage) {
|
|
23282
|
-
messageConstIndices[op.owner] = job.addConst(op.expression, op.statements);
|
|
23283
|
-
OpList.remove(op);
|
|
23284
|
-
}
|
|
23285
|
-
}
|
|
23286
|
-
}
|
|
23287
|
-
for (const unit of job.units) {
|
|
23288
|
-
for (const op of unit.create) {
|
|
23289
|
-
if (op.kind === OpKind.I18nStart && messageConstIndices[op.xref] !== void 0) {
|
|
23290
|
-
op.messageIndex = messageConstIndices[op.xref];
|
|
23291
|
-
}
|
|
23292
|
-
}
|
|
23293
|
-
}
|
|
23294
|
-
}
|
|
23295
|
-
function phaseRemoveContentSelectors(job) {
|
|
23296
|
-
for (const unit of job.units) {
|
|
23297
|
-
const elements = getElementsByXrefId(unit);
|
|
23298
|
-
for (const op of unit.update) {
|
|
23299
23876
|
switch (op.kind) {
|
|
23300
|
-
case OpKind.
|
|
23301
|
-
|
|
23302
|
-
|
|
23303
|
-
|
|
23877
|
+
case OpKind.I18nStart:
|
|
23878
|
+
currentI18nOp = op;
|
|
23879
|
+
break;
|
|
23880
|
+
case OpKind.I18nEnd:
|
|
23881
|
+
currentI18nOp = null;
|
|
23882
|
+
break;
|
|
23883
|
+
case OpKind.Icu:
|
|
23884
|
+
if (currentI18nOp === null) {
|
|
23885
|
+
const id = job.allocateXrefId();
|
|
23886
|
+
OpList.insertBefore(createI18nStartOp(id, op.message), op);
|
|
23887
|
+
OpList.insertAfter(createI18nEndOp(id), op);
|
|
23304
23888
|
}
|
|
23305
|
-
|
|
23889
|
+
break;
|
|
23306
23890
|
}
|
|
23307
23891
|
}
|
|
23308
23892
|
}
|
|
23309
23893
|
}
|
|
23310
|
-
function lookupElement(elements, xref) {
|
|
23311
|
-
const el = elements.get(xref);
|
|
23312
|
-
if (el === void 0) {
|
|
23313
|
-
throw new Error("All attributes should have an element-like target.");
|
|
23314
|
-
}
|
|
23315
|
-
return el;
|
|
23316
|
-
}
|
|
23317
23894
|
var phases = [
|
|
23318
23895
|
{ kind: CompilationJobKind.Tmpl, fn: phaseRemoveContentSelectors },
|
|
23319
|
-
{ kind: CompilationJobKind.Tmpl, fn: phaseGenerateI18nBlocks },
|
|
23320
|
-
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nTextExtraction },
|
|
23321
23896
|
{ kind: CompilationJobKind.Host, fn: phaseHostStylePropertyParsing },
|
|
23322
23897
|
{ kind: CompilationJobKind.Tmpl, fn: phaseNamespace },
|
|
23323
23898
|
{ kind: CompilationJobKind.Both, fn: phaseStyleBindingSpecialization },
|
|
23324
23899
|
{ kind: CompilationJobKind.Both, fn: phaseBindingSpecialization },
|
|
23900
|
+
{ kind: CompilationJobKind.Tmpl, fn: phasePropagateI18nBlocks },
|
|
23901
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseWrapIcus },
|
|
23325
23902
|
{ kind: CompilationJobKind.Both, fn: phaseAttributeExtraction },
|
|
23326
23903
|
{ kind: CompilationJobKind.Both, fn: phaseParseExtractedStyles },
|
|
23327
23904
|
{ kind: CompilationJobKind.Tmpl, fn: phaseRemoveEmptyBindings },
|
|
23328
23905
|
{ kind: CompilationJobKind.Tmpl, fn: phaseConditionals },
|
|
23329
|
-
{ kind: CompilationJobKind.Tmpl, fn: phaseNoListenersOnTemplates },
|
|
23330
23906
|
{ kind: CompilationJobKind.Tmpl, fn: phasePipeCreation },
|
|
23907
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nTextExtraction },
|
|
23908
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseIcuExtraction },
|
|
23909
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseApplyI18nExpressions },
|
|
23331
23910
|
{ kind: CompilationJobKind.Tmpl, fn: phasePipeVariadic },
|
|
23332
23911
|
{ kind: CompilationJobKind.Both, fn: phasePureLiteralStructures },
|
|
23333
23912
|
{ kind: CompilationJobKind.Tmpl, fn: phaseGenerateProjectionDef },
|
|
@@ -23346,7 +23925,9 @@ var phases = [
|
|
|
23346
23925
|
{ kind: CompilationJobKind.Tmpl, fn: phaseResolveI18nPlaceholders },
|
|
23347
23926
|
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nMessageExtraction },
|
|
23348
23927
|
{ kind: CompilationJobKind.Tmpl, fn: phaseI18nConstCollection },
|
|
23928
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseConstTraitCollection },
|
|
23349
23929
|
{ kind: CompilationJobKind.Both, fn: phaseConstCollection },
|
|
23930
|
+
{ kind: CompilationJobKind.Tmpl, fn: phaseAssignI18nSlotDependencies },
|
|
23350
23931
|
{ kind: CompilationJobKind.Both, fn: phaseVarCounting },
|
|
23351
23932
|
{ kind: CompilationJobKind.Tmpl, fn: phaseGenerateAdvance },
|
|
23352
23933
|
{ kind: CompilationJobKind.Both, fn: phaseVariableOptimization },
|
|
@@ -23531,35 +24112,54 @@ function ingestNodes(unit, template2) {
|
|
|
23531
24112
|
ingestText(unit, node);
|
|
23532
24113
|
} else if (node instanceof BoundText) {
|
|
23533
24114
|
ingestBoundText(unit, node);
|
|
24115
|
+
} else if (node instanceof IfBlock) {
|
|
24116
|
+
ingestIfBlock(unit, node);
|
|
23534
24117
|
} else if (node instanceof SwitchBlock) {
|
|
23535
24118
|
ingestSwitchBlock(unit, node);
|
|
24119
|
+
} else if (node instanceof DeferredBlock) {
|
|
24120
|
+
ingestDeferBlock(unit, node);
|
|
24121
|
+
} else if (node instanceof Icu$1) {
|
|
24122
|
+
ingestIcu(unit, node);
|
|
23536
24123
|
} else {
|
|
23537
24124
|
throw new Error(`Unsupported template node: ${node.constructor.name}`);
|
|
23538
24125
|
}
|
|
23539
24126
|
}
|
|
23540
24127
|
}
|
|
23541
24128
|
function ingestElement(unit, element2) {
|
|
24129
|
+
if (element2.i18n !== void 0 && !(element2.i18n instanceof Message || element2.i18n instanceof TagPlaceholder)) {
|
|
24130
|
+
throw Error(`Unhandled i18n metadata type for element: ${element2.i18n.constructor.name}`);
|
|
24131
|
+
}
|
|
23542
24132
|
const staticAttributes = {};
|
|
23543
24133
|
for (const attr of element2.attributes) {
|
|
23544
24134
|
staticAttributes[attr.name] = attr.value;
|
|
23545
24135
|
}
|
|
23546
24136
|
const id = unit.job.allocateXrefId();
|
|
23547
24137
|
const [namespaceKey, elementName] = splitNsName(element2.name);
|
|
23548
|
-
const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n, element2.startSourceSpan);
|
|
24138
|
+
const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan);
|
|
23549
24139
|
unit.create.push(startOp);
|
|
23550
24140
|
ingestBindings(unit, startOp, element2);
|
|
23551
24141
|
ingestReferences(startOp, element2);
|
|
23552
24142
|
ingestNodes(unit, element2.children);
|
|
23553
|
-
|
|
24143
|
+
const endOp = createElementEndOp(id, element2.endSourceSpan);
|
|
24144
|
+
unit.create.push(endOp);
|
|
24145
|
+
if (element2.i18n instanceof Message) {
|
|
24146
|
+
const i18nBlockId = unit.job.allocateXrefId();
|
|
24147
|
+
OpList.insertAfter(createI18nStartOp(i18nBlockId, element2.i18n), startOp);
|
|
24148
|
+
OpList.insertBefore(createI18nEndOp(i18nBlockId), endOp);
|
|
24149
|
+
}
|
|
23554
24150
|
}
|
|
23555
24151
|
function ingestTemplate(unit, tmpl) {
|
|
24152
|
+
if (tmpl.i18n !== void 0 && !(tmpl.i18n instanceof Message || tmpl.i18n instanceof TagPlaceholder)) {
|
|
24153
|
+
throw Error(`Unhandled i18n metadata type for template: ${tmpl.i18n.constructor.name}`);
|
|
24154
|
+
}
|
|
23556
24155
|
const childView = unit.job.allocateView(unit.xref);
|
|
23557
24156
|
let tagNameWithoutNamespace = tmpl.tagName;
|
|
23558
24157
|
let namespacePrefix = "";
|
|
23559
24158
|
if (tmpl.tagName) {
|
|
23560
24159
|
[namespacePrefix, tagNameWithoutNamespace] = splitNsName(tmpl.tagName);
|
|
23561
24160
|
}
|
|
23562
|
-
const
|
|
24161
|
+
const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
|
|
24162
|
+
const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, namespaceForKey(namespacePrefix), false, i18nPlaceholder, tmpl.startSourceSpan);
|
|
23563
24163
|
unit.create.push(tplOp);
|
|
23564
24164
|
ingestBindings(unit, tplOp, tmpl);
|
|
23565
24165
|
ingestReferences(tplOp, tmpl);
|
|
@@ -23567,11 +24167,16 @@ function ingestTemplate(unit, tmpl) {
|
|
|
23567
24167
|
for (const { name, value } of tmpl.variables) {
|
|
23568
24168
|
childView.contextVariables.set(name, value);
|
|
23569
24169
|
}
|
|
24170
|
+
if (isPlainTemplate(tmpl) && tmpl.i18n instanceof Message) {
|
|
24171
|
+
const id = unit.job.allocateXrefId();
|
|
24172
|
+
OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
|
|
24173
|
+
OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
|
|
24174
|
+
}
|
|
23570
24175
|
}
|
|
23571
24176
|
function ingestContent(unit, content) {
|
|
23572
24177
|
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector);
|
|
23573
24178
|
for (const attr of content.attributes) {
|
|
23574
|
-
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan,
|
|
24179
|
+
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
|
|
23575
24180
|
}
|
|
23576
24181
|
unit.create.push(op);
|
|
23577
24182
|
}
|
|
@@ -23579,6 +24184,7 @@ function ingestText(unit, text2) {
|
|
|
23579
24184
|
unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, text2.sourceSpan));
|
|
23580
24185
|
}
|
|
23581
24186
|
function ingestBoundText(unit, text2) {
|
|
24187
|
+
var _a2;
|
|
23582
24188
|
let value = text2.value;
|
|
23583
24189
|
if (value instanceof ASTWithSource) {
|
|
23584
24190
|
value = value.ast;
|
|
@@ -23586,27 +24192,101 @@ function ingestBoundText(unit, text2) {
|
|
|
23586
24192
|
if (!(value instanceof Interpolation$1)) {
|
|
23587
24193
|
throw new Error(`AssertionError: expected Interpolation for BoundText node, got ${value.constructor.name}`);
|
|
23588
24194
|
}
|
|
24195
|
+
if (text2.i18n !== void 0 && !(text2.i18n instanceof Container)) {
|
|
24196
|
+
throw Error(`Unhandled i18n metadata type for text interpolation: ${(_a2 = text2.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
24197
|
+
}
|
|
24198
|
+
const i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder) : [];
|
|
23589
24199
|
const textXref = unit.job.allocateXrefId();
|
|
23590
24200
|
unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
|
|
23591
24201
|
const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
|
|
23592
|
-
unit.update.push(createInterpolateTextOp(textXref, new Interpolation(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan))), text2.sourceSpan));
|
|
24202
|
+
unit.update.push(createInterpolateTextOp(textXref, new Interpolation(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan))), i18nPlaceholders, text2.sourceSpan));
|
|
24203
|
+
}
|
|
24204
|
+
function ingestIfBlock(unit, ifBlock) {
|
|
24205
|
+
let firstXref = null;
|
|
24206
|
+
let conditions = [];
|
|
24207
|
+
for (const ifCase of ifBlock.branches) {
|
|
24208
|
+
const cView = unit.job.allocateView(unit.xref);
|
|
24209
|
+
if (ifCase.expressionAlias !== null) {
|
|
24210
|
+
cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
|
|
24211
|
+
}
|
|
24212
|
+
if (firstXref === null) {
|
|
24213
|
+
firstXref = cView.xref;
|
|
24214
|
+
}
|
|
24215
|
+
unit.create.push(createTemplateOp(cView.xref, "Conditional", Namespace.HTML, true, void 0, ifCase.sourceSpan));
|
|
24216
|
+
const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
|
|
24217
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, cView.xref, ifCase.expressionAlias);
|
|
24218
|
+
conditions.push(conditionalCaseExpr);
|
|
24219
|
+
ingestNodes(cView, ifCase.children);
|
|
24220
|
+
}
|
|
24221
|
+
const conditional2 = createConditionalOp(firstXref, null, conditions, ifBlock.sourceSpan);
|
|
24222
|
+
unit.update.push(conditional2);
|
|
23593
24223
|
}
|
|
23594
24224
|
function ingestSwitchBlock(unit, switchBlock) {
|
|
23595
24225
|
let firstXref = null;
|
|
23596
24226
|
let conditions = [];
|
|
23597
24227
|
for (const switchCase of switchBlock.cases) {
|
|
23598
24228
|
const cView = unit.job.allocateView(unit.xref);
|
|
23599
|
-
if (
|
|
24229
|
+
if (firstXref === null) {
|
|
23600
24230
|
firstXref = cView.xref;
|
|
23601
|
-
|
|
24231
|
+
}
|
|
24232
|
+
unit.create.push(createTemplateOp(cView.xref, "Case", Namespace.HTML, true, void 0, switchCase.sourceSpan));
|
|
23602
24233
|
const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
|
|
23603
|
-
|
|
24234
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, cView.xref);
|
|
24235
|
+
conditions.push(conditionalCaseExpr);
|
|
23604
24236
|
ingestNodes(cView, switchCase.children);
|
|
23605
24237
|
}
|
|
23606
|
-
const conditional2 = createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job,
|
|
23607
|
-
conditional2.conditions = conditions;
|
|
24238
|
+
const conditional2 = createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan);
|
|
23608
24239
|
unit.update.push(conditional2);
|
|
23609
24240
|
}
|
|
24241
|
+
function ingestDeferView(unit, suffix, children, sourceSpan) {
|
|
24242
|
+
if (children === void 0) {
|
|
24243
|
+
return null;
|
|
24244
|
+
}
|
|
24245
|
+
const secondaryView = unit.job.allocateView(unit.xref);
|
|
24246
|
+
ingestNodes(secondaryView, children);
|
|
24247
|
+
const templateOp = createTemplateOp(secondaryView.xref, `Defer${suffix}`, Namespace.HTML, true, void 0, sourceSpan);
|
|
24248
|
+
unit.create.push(templateOp);
|
|
24249
|
+
return templateOp;
|
|
24250
|
+
}
|
|
24251
|
+
function ingestDeferBlock(unit, deferBlock) {
|
|
24252
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
24253
|
+
const main = ingestDeferView(unit, "", deferBlock.children, deferBlock.sourceSpan);
|
|
24254
|
+
const loading = ingestDeferView(unit, "Loading", (_a2 = deferBlock.loading) == null ? void 0 : _a2.children, (_b2 = deferBlock.loading) == null ? void 0 : _b2.sourceSpan);
|
|
24255
|
+
const placeholder = ingestDeferView(unit, "Placeholder", (_c2 = deferBlock.placeholder) == null ? void 0 : _c2.children, (_d2 = deferBlock.placeholder) == null ? void 0 : _d2.sourceSpan);
|
|
24256
|
+
const error2 = ingestDeferView(unit, "Error", (_e2 = deferBlock.error) == null ? void 0 : _e2.children, (_f2 = deferBlock.error) == null ? void 0 : _f2.sourceSpan);
|
|
24257
|
+
const deferOp = createDeferOp(unit.job.allocateXrefId(), main.xref, deferBlock.sourceSpan);
|
|
24258
|
+
unit.create.push(deferOp);
|
|
24259
|
+
if (loading && deferBlock.loading) {
|
|
24260
|
+
deferOp.loading = createDeferSecondaryOp(deferOp.xref, loading.xref, DeferSecondaryKind.Loading);
|
|
24261
|
+
if (deferBlock.loading.afterTime !== null || deferBlock.loading.minimumTime !== null) {
|
|
24262
|
+
deferOp.loading.constValue = [deferBlock.loading.minimumTime, deferBlock.loading.afterTime];
|
|
24263
|
+
}
|
|
24264
|
+
unit.create.push(deferOp.loading);
|
|
24265
|
+
}
|
|
24266
|
+
if (placeholder && deferBlock.placeholder) {
|
|
24267
|
+
deferOp.placeholder = createDeferSecondaryOp(deferOp.xref, placeholder.xref, DeferSecondaryKind.Placeholder);
|
|
24268
|
+
if (deferBlock.placeholder.minimumTime !== null) {
|
|
24269
|
+
deferOp.placeholder.constValue = [deferBlock.placeholder.minimumTime];
|
|
24270
|
+
}
|
|
24271
|
+
unit.create.push(deferOp.placeholder);
|
|
24272
|
+
}
|
|
24273
|
+
if (error2 && deferBlock.error) {
|
|
24274
|
+
deferOp.error = createDeferSecondaryOp(deferOp.xref, error2.xref, DeferSecondaryKind.Error);
|
|
24275
|
+
unit.create.push(deferOp.error);
|
|
24276
|
+
}
|
|
24277
|
+
const deferOnOp = createDeferOnOp(unit.job.allocateXrefId(), null);
|
|
24278
|
+
unit.create.push(deferOnOp);
|
|
24279
|
+
}
|
|
24280
|
+
function ingestIcu(unit, icu) {
|
|
24281
|
+
var _a2;
|
|
24282
|
+
if (icu.i18n instanceof Message) {
|
|
24283
|
+
const xref = unit.job.allocateXrefId();
|
|
24284
|
+
unit.create.push(createIcuOp(xref, icu.i18n, null));
|
|
24285
|
+
unit.update.push(createIcuUpdateOp(xref, null));
|
|
24286
|
+
} else {
|
|
24287
|
+
throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
24288
|
+
}
|
|
24289
|
+
}
|
|
23610
24290
|
function convertAst(ast, job, baseSourceSpan) {
|
|
23611
24291
|
if (ast instanceof ASTWithSource) {
|
|
23612
24292
|
return convertAst(ast.ast, job, baseSourceSpan);
|
|
@@ -23669,21 +24349,31 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
23669
24349
|
throw new Error(`Unhandled expression type: ${ast.constructor.name}`);
|
|
23670
24350
|
}
|
|
23671
24351
|
}
|
|
24352
|
+
function isPlainTemplate(tmpl) {
|
|
24353
|
+
var _a2;
|
|
24354
|
+
return splitNsName((_a2 = tmpl.tagName) != null ? _a2 : "")[1] === "ng-template";
|
|
24355
|
+
}
|
|
23672
24356
|
function ingestBindings(unit, op, element2) {
|
|
24357
|
+
let flags = BindingFlags.None;
|
|
23673
24358
|
if (element2 instanceof Template) {
|
|
24359
|
+
flags |= BindingFlags.OnNgTemplateElement;
|
|
24360
|
+
if (element2 instanceof Template && isPlainTemplate(element2)) {
|
|
24361
|
+
flags |= BindingFlags.BindingTargetsTemplate;
|
|
24362
|
+
}
|
|
24363
|
+
const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
|
|
23674
24364
|
for (const attr of element2.templateAttrs) {
|
|
23675
24365
|
if (attr instanceof TextAttribute) {
|
|
23676
|
-
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan,
|
|
24366
|
+
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue);
|
|
23677
24367
|
} else {
|
|
23678
|
-
ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan,
|
|
24368
|
+
ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags);
|
|
23679
24369
|
}
|
|
23680
24370
|
}
|
|
23681
24371
|
}
|
|
23682
24372
|
for (const attr of element2.attributes) {
|
|
23683
|
-
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan,
|
|
24373
|
+
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue);
|
|
23684
24374
|
}
|
|
23685
24375
|
for (const input of element2.inputs) {
|
|
23686
|
-
ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan,
|
|
24376
|
+
ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags);
|
|
23687
24377
|
}
|
|
23688
24378
|
for (const output of element2.outputs) {
|
|
23689
24379
|
let listenerOp;
|
|
@@ -23692,6 +24382,10 @@ function ingestBindings(unit, op, element2) {
|
|
|
23692
24382
|
throw Error("Animation listener should have a phase");
|
|
23693
24383
|
}
|
|
23694
24384
|
}
|
|
24385
|
+
if (element2 instanceof Template && !isPlainTemplate(element2)) {
|
|
24386
|
+
unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
|
|
24387
|
+
continue;
|
|
24388
|
+
}
|
|
23695
24389
|
listenerOp = createListenerOp(op.xref, output.name, op.tag, output.phase, false, output.sourceSpan);
|
|
23696
24390
|
let handlerExprs;
|
|
23697
24391
|
let handler = output.handler;
|
|
@@ -23723,10 +24417,22 @@ var BINDING_KINDS = /* @__PURE__ */ new Map([
|
|
|
23723
24417
|
[3, BindingKind.StyleProperty],
|
|
23724
24418
|
[4, BindingKind.Animation]
|
|
23725
24419
|
]);
|
|
23726
|
-
|
|
24420
|
+
var BindingFlags;
|
|
24421
|
+
(function(BindingFlags2) {
|
|
24422
|
+
BindingFlags2[BindingFlags2["None"] = 0] = "None";
|
|
24423
|
+
BindingFlags2[BindingFlags2["TextValue"] = 1] = "TextValue";
|
|
24424
|
+
BindingFlags2[BindingFlags2["BindingTargetsTemplate"] = 2] = "BindingTargetsTemplate";
|
|
24425
|
+
BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
|
|
24426
|
+
BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
|
|
24427
|
+
})(BindingFlags || (BindingFlags = {}));
|
|
24428
|
+
function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags) {
|
|
23727
24429
|
if (value instanceof ASTWithSource) {
|
|
23728
24430
|
value = value.ast;
|
|
23729
24431
|
}
|
|
24432
|
+
if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
|
|
24433
|
+
view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null));
|
|
24434
|
+
return;
|
|
24435
|
+
}
|
|
23730
24436
|
let expression;
|
|
23731
24437
|
if (value instanceof Interpolation$1) {
|
|
23732
24438
|
expression = new Interpolation(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)));
|
|
@@ -23736,7 +24442,7 @@ function ingestBinding(view, xref, name, value, type, unit, securityContext, sou
|
|
|
23736
24442
|
expression = value;
|
|
23737
24443
|
}
|
|
23738
24444
|
const kind = BINDING_KINDS.get(type);
|
|
23739
|
-
view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext,
|
|
24445
|
+
view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), sourceSpan));
|
|
23740
24446
|
}
|
|
23741
24447
|
function ingestReferences(op, element2) {
|
|
23742
24448
|
assertIsArray(op.localRefs);
|
|
@@ -24559,10 +25265,10 @@ function normalizeNgContentSelect(selectAttr) {
|
|
|
24559
25265
|
return selectAttr;
|
|
24560
25266
|
}
|
|
24561
25267
|
var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+(.*)/;
|
|
24562
|
-
var FOR_LOOP_TRACK_PATTERN = /^track\s+(
|
|
25268
|
+
var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
|
|
24563
25269
|
var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
|
|
24564
25270
|
var ELSE_IF_PATTERN = /^else[^\S\r\n]+if/;
|
|
24565
|
-
var FOR_LOOP_LET_PATTERN = /^let\s+(
|
|
25271
|
+
var FOR_LOOP_LET_PATTERN = /^let\s+([\S\s]*)/;
|
|
24566
25272
|
var ALLOWED_FOR_LOOP_LET_VARIABLES = /* @__PURE__ */ new Set(["$index", "$first", "$last", "$even", "$odd", "$count"]);
|
|
24567
25273
|
function isConnectedForLoopBlock(name) {
|
|
24568
25274
|
return name === "empty";
|
|
@@ -24573,30 +25279,36 @@ function isConnectedIfLoopBlock(name) {
|
|
|
24573
25279
|
function createIfBlock(ast, connectedBlocks, visitor, bindingParser) {
|
|
24574
25280
|
const errors = validateIfConnectedBlocks(connectedBlocks);
|
|
24575
25281
|
const branches = [];
|
|
24576
|
-
if (errors.length > 0) {
|
|
24577
|
-
return { node: null, errors };
|
|
24578
|
-
}
|
|
24579
25282
|
const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser);
|
|
24580
25283
|
if (mainBlockParams !== null) {
|
|
24581
|
-
branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan));
|
|
25284
|
+
branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan));
|
|
24582
25285
|
}
|
|
24583
25286
|
for (const block of connectedBlocks) {
|
|
24584
|
-
const children = visitAll(visitor, block.children, block.children);
|
|
24585
25287
|
if (ELSE_IF_PATTERN.test(block.name)) {
|
|
24586
25288
|
const params = parseConditionalBlockParameters(block, errors, bindingParser);
|
|
24587
25289
|
if (params !== null) {
|
|
24588
|
-
|
|
25290
|
+
const children = visitAll(visitor, block.children, block.children);
|
|
25291
|
+
branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan));
|
|
24589
25292
|
}
|
|
24590
25293
|
} else if (block.name === "else") {
|
|
24591
|
-
|
|
25294
|
+
const children = visitAll(visitor, block.children, block.children);
|
|
25295
|
+
branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan));
|
|
24592
25296
|
}
|
|
24593
25297
|
}
|
|
25298
|
+
const ifBlockStartSourceSpan = branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan;
|
|
25299
|
+
const ifBlockEndSourceSpan = branches.length > 0 ? branches[branches.length - 1].endSourceSpan : ast.endSourceSpan;
|
|
25300
|
+
let wholeSourceSpan = ast.sourceSpan;
|
|
25301
|
+
const lastBranch = branches[branches.length - 1];
|
|
25302
|
+
if (lastBranch !== void 0) {
|
|
25303
|
+
wholeSourceSpan = new ParseSourceSpan(ifBlockStartSourceSpan.start, lastBranch.sourceSpan.end);
|
|
25304
|
+
}
|
|
24594
25305
|
return {
|
|
24595
|
-
node: new IfBlock(branches,
|
|
25306
|
+
node: new IfBlock(branches, wholeSourceSpan, ast.startSourceSpan, ifBlockEndSourceSpan),
|
|
24596
25307
|
errors
|
|
24597
25308
|
};
|
|
24598
25309
|
}
|
|
24599
25310
|
function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
25311
|
+
var _a2, _b2;
|
|
24600
25312
|
const errors = [];
|
|
24601
25313
|
const params = parseForLoopParameters(ast, errors, bindingParser);
|
|
24602
25314
|
let node = null;
|
|
@@ -24608,7 +25320,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
24608
25320
|
} else if (block.parameters.length > 0) {
|
|
24609
25321
|
errors.push(new ParseError(block.sourceSpan, "@empty block cannot have parameters"));
|
|
24610
25322
|
} else {
|
|
24611
|
-
empty = new ForLoopBlockEmpty(visitAll(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan);
|
|
25323
|
+
empty = new ForLoopBlockEmpty(visitAll(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
|
|
24612
25324
|
}
|
|
24613
25325
|
} else {
|
|
24614
25326
|
errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block "${block.name}"`));
|
|
@@ -24618,25 +25330,29 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
24618
25330
|
if (params.trackBy === null) {
|
|
24619
25331
|
errors.push(new ParseError(ast.sourceSpan, '@for loop must have a "track" expression'));
|
|
24620
25332
|
} else {
|
|
24621
|
-
|
|
25333
|
+
const endSpan = (_a2 = empty == null ? void 0 : empty.endSourceSpan) != null ? _a2 : ast.endSourceSpan;
|
|
25334
|
+
const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, (_b2 = endSpan == null ? void 0 : endSpan.end) != null ? _b2 : ast.sourceSpan.end);
|
|
25335
|
+
node = new ForLoopBlock(params.itemName, params.expression, params.trackBy, params.context, visitAll(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan);
|
|
24622
25336
|
}
|
|
24623
25337
|
}
|
|
24624
25338
|
return { node, errors };
|
|
24625
25339
|
}
|
|
24626
25340
|
function createSwitchBlock(ast, visitor, bindingParser) {
|
|
24627
25341
|
const errors = validateSwitchBlock(ast);
|
|
24628
|
-
|
|
24629
|
-
return { node: null, errors };
|
|
24630
|
-
}
|
|
24631
|
-
const primaryExpression = parseBlockParameterToBinding(ast.parameters[0], bindingParser);
|
|
25342
|
+
const primaryExpression = ast.parameters.length > 0 ? parseBlockParameterToBinding(ast.parameters[0], bindingParser) : bindingParser.parseBinding("", false, ast.sourceSpan, 0);
|
|
24632
25343
|
const cases = [];
|
|
25344
|
+
const unknownBlocks = [];
|
|
24633
25345
|
let defaultCase = null;
|
|
24634
25346
|
for (const node of ast.children) {
|
|
24635
25347
|
if (!(node instanceof Block)) {
|
|
24636
25348
|
continue;
|
|
24637
25349
|
}
|
|
25350
|
+
if ((node.name !== "case" || node.parameters.length === 0) && node.name !== "default") {
|
|
25351
|
+
unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan));
|
|
25352
|
+
continue;
|
|
25353
|
+
}
|
|
24638
25354
|
const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
|
|
24639
|
-
const ast2 = new SwitchBlockCase(expression, visitAll(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan);
|
|
25355
|
+
const ast2 = new SwitchBlockCase(expression, visitAll(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
|
|
24640
25356
|
if (expression === null) {
|
|
24641
25357
|
defaultCase = ast2;
|
|
24642
25358
|
} else {
|
|
@@ -24647,7 +25363,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
|
|
|
24647
25363
|
cases.push(defaultCase);
|
|
24648
25364
|
}
|
|
24649
25365
|
return {
|
|
24650
|
-
node: new SwitchBlock(primaryExpression, cases, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan),
|
|
25366
|
+
node: new SwitchBlock(primaryExpression, cases, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan),
|
|
24651
25367
|
errors
|
|
24652
25368
|
};
|
|
24653
25369
|
}
|
|
@@ -24689,7 +25405,8 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
24689
25405
|
}
|
|
24690
25406
|
for (const variableName of ALLOWED_FOR_LOOP_LET_VARIABLES) {
|
|
24691
25407
|
if (!result.context.hasOwnProperty(variableName)) {
|
|
24692
|
-
|
|
25408
|
+
const emptySpanAfterForBlockStart = new ParseSourceSpan(block.startSourceSpan.end, block.startSourceSpan.end);
|
|
25409
|
+
result.context[variableName] = new Variable(variableName, variableName, emptySpanAfterForBlockStart, emptySpanAfterForBlockStart);
|
|
24693
25410
|
}
|
|
24694
25411
|
}
|
|
24695
25412
|
return result;
|
|
@@ -25093,7 +25810,15 @@ function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
25093
25810
|
const errors = [];
|
|
25094
25811
|
const { placeholder, loading, error: error2 } = parseConnectedBlocks(connectedBlocks, errors, visitor);
|
|
25095
25812
|
const { triggers, prefetchTriggers } = parsePrimaryTriggers(ast.parameters, bindingParser, errors, placeholder);
|
|
25096
|
-
|
|
25813
|
+
let lastEndSourceSpan = ast.endSourceSpan;
|
|
25814
|
+
let endOfLastSourceSpan = ast.sourceSpan.end;
|
|
25815
|
+
if (connectedBlocks.length > 0) {
|
|
25816
|
+
const lastConnectedBlock = connectedBlocks[connectedBlocks.length - 1];
|
|
25817
|
+
lastEndSourceSpan = lastConnectedBlock.endSourceSpan;
|
|
25818
|
+
endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end;
|
|
25819
|
+
}
|
|
25820
|
+
const mainDeferredSourceSpan = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan);
|
|
25821
|
+
const node = new DeferredBlock(visitAll(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, mainDeferredSourceSpan, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan);
|
|
25097
25822
|
return { node, errors };
|
|
25098
25823
|
}
|
|
25099
25824
|
function parseConnectedBlocks(connectedBlocks, errors, visitor) {
|
|
@@ -25393,23 +26118,6 @@ var HtmlAstToIvyAst = class {
|
|
|
25393
26118
|
if (this.processedNodes.has(block)) {
|
|
25394
26119
|
return null;
|
|
25395
26120
|
}
|
|
25396
|
-
if (!this.options.enabledBlockTypes.has(block.name)) {
|
|
25397
|
-
let errorMessage;
|
|
25398
|
-
if (isConnectedDeferLoopBlock(block.name)) {
|
|
25399
|
-
errorMessage = `@${block.name} block can only be used after an @defer block.`;
|
|
25400
|
-
this.processedNodes.add(block);
|
|
25401
|
-
} else if (isConnectedForLoopBlock(block.name)) {
|
|
25402
|
-
errorMessage = `@${block.name} block can only be used after an @for block.`;
|
|
25403
|
-
this.processedNodes.add(block);
|
|
25404
|
-
} else if (isConnectedIfLoopBlock(block.name)) {
|
|
25405
|
-
errorMessage = `@${block.name} block can only be used after an @if or @else if block.`;
|
|
25406
|
-
this.processedNodes.add(block);
|
|
25407
|
-
} else {
|
|
25408
|
-
errorMessage = `Unrecognized block @${block.name}.`;
|
|
25409
|
-
}
|
|
25410
|
-
this.reportError(errorMessage, block.sourceSpan);
|
|
25411
|
-
return null;
|
|
25412
|
-
}
|
|
25413
26121
|
let result = null;
|
|
25414
26122
|
switch (block.name) {
|
|
25415
26123
|
case "defer":
|
|
@@ -25425,9 +26133,22 @@ var HtmlAstToIvyAst = class {
|
|
|
25425
26133
|
result = createIfBlock(block, this.findConnectedBlocks(index2, context, isConnectedIfLoopBlock), this, this.bindingParser);
|
|
25426
26134
|
break;
|
|
25427
26135
|
default:
|
|
26136
|
+
let errorMessage;
|
|
26137
|
+
if (isConnectedDeferLoopBlock(block.name)) {
|
|
26138
|
+
errorMessage = `@${block.name} block can only be used after an @defer block.`;
|
|
26139
|
+
this.processedNodes.add(block);
|
|
26140
|
+
} else if (isConnectedForLoopBlock(block.name)) {
|
|
26141
|
+
errorMessage = `@${block.name} block can only be used after an @for block.`;
|
|
26142
|
+
this.processedNodes.add(block);
|
|
26143
|
+
} else if (isConnectedIfLoopBlock(block.name)) {
|
|
26144
|
+
errorMessage = `@${block.name} block can only be used after an @if or @else if block.`;
|
|
26145
|
+
this.processedNodes.add(block);
|
|
26146
|
+
} else {
|
|
26147
|
+
errorMessage = `Unrecognized block @${block.name}.`;
|
|
26148
|
+
}
|
|
25428
26149
|
result = {
|
|
25429
|
-
node:
|
|
25430
|
-
errors: [new ParseError(block.sourceSpan,
|
|
26150
|
+
node: new UnknownBlock(block.name, block.sourceSpan),
|
|
26151
|
+
errors: [new ParseError(block.sourceSpan, errorMessage)]
|
|
25431
26152
|
};
|
|
25432
26153
|
break;
|
|
25433
26154
|
}
|
|
@@ -25882,6 +26603,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
25882
26603
|
this.visitIfBlockBranch = invalid;
|
|
25883
26604
|
this.visitSwitchBlockCase = invalid;
|
|
25884
26605
|
this.visitForLoopBlockEmpty = invalid;
|
|
26606
|
+
this.visitUnknownBlock = invalid;
|
|
25885
26607
|
this._bindingScope = parentBindingScope.nestedScope(level);
|
|
25886
26608
|
this.fileBasedI18nSuffix = relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_") + "_";
|
|
25887
26609
|
this._valueConverter = new ValueConverter(constantPool, () => this.allocateDataSlot(), (numSlots) => this.allocatePureFunctionSlots(numSlots), (name, localName, slot, value) => {
|
|
@@ -26422,13 +27144,10 @@ var TemplateDefinitionBuilder = class {
|
|
|
26422
27144
|
visitIfBlock(block) {
|
|
26423
27145
|
this.allocateBindingSlots(null);
|
|
26424
27146
|
const branchData = block.branches.map(({ expression, expressionAlias, children, sourceSpan }) => {
|
|
26425
|
-
const processedExpression = expression === null ? null : expression.visit(this._valueConverter);
|
|
26426
27147
|
const variables = expressionAlias !== null ? [new Variable(expressionAlias.name, DIRECT_CONTEXT_REFERENCE, expressionAlias.sourceSpan, expressionAlias.keySpan)] : void 0;
|
|
26427
|
-
|
|
26428
|
-
|
|
26429
|
-
|
|
26430
|
-
alias: expressionAlias
|
|
26431
|
-
};
|
|
27148
|
+
const index2 = this.createEmbeddedTemplateFn(null, children, "_Conditional", sourceSpan, variables);
|
|
27149
|
+
const processedExpression = expression === null ? null : expression.visit(this._valueConverter);
|
|
27150
|
+
return { index: index2, expression: processedExpression, alias: expressionAlias };
|
|
26432
27151
|
});
|
|
26433
27152
|
const containerIndex = branchData[0].index;
|
|
26434
27153
|
const paramsCallback = () => {
|
|
@@ -26459,15 +27178,14 @@ var TemplateDefinitionBuilder = class {
|
|
|
26459
27178
|
this.updateInstructionWithAdvance(containerIndex, block.branches[0].sourceSpan, Identifiers.conditional, paramsCallback);
|
|
26460
27179
|
}
|
|
26461
27180
|
visitSwitchBlock(block) {
|
|
26462
|
-
const blockExpression = block.expression.visit(this._valueConverter);
|
|
26463
|
-
this.allocateBindingSlots(null);
|
|
26464
27181
|
const caseData = block.cases.map((currentCase) => {
|
|
26465
|
-
|
|
26466
|
-
|
|
26467
|
-
|
|
26468
|
-
};
|
|
27182
|
+
const index2 = this.createEmbeddedTemplateFn(null, currentCase.children, "_Case", currentCase.sourceSpan);
|
|
27183
|
+
const expression = currentCase.expression === null ? null : currentCase.expression.visit(this._valueConverter);
|
|
27184
|
+
return { index: index2, expression };
|
|
26469
27185
|
});
|
|
26470
27186
|
const containerIndex = caseData[0].index;
|
|
27187
|
+
const blockExpression = block.expression.visit(this._valueConverter);
|
|
27188
|
+
this.allocateBindingSlots(null);
|
|
26471
27189
|
this.updateInstructionWithAdvance(containerIndex, block.sourceSpan, Identifiers.conditional, () => {
|
|
26472
27190
|
const generateCases = (caseIndex) => {
|
|
26473
27191
|
if (caseIndex > caseData.length - 1) {
|
|
@@ -26505,11 +27223,12 @@ var TemplateDefinitionBuilder = class {
|
|
|
26505
27223
|
literal(placeholderIndex),
|
|
26506
27224
|
literal(errorIndex),
|
|
26507
27225
|
(loadingConsts == null ? void 0 : loadingConsts.length) ? this.addToConsts(literalArr(loadingConsts)) : TYPED_NULL_EXPR,
|
|
26508
|
-
placeholderConsts ? this.addToConsts(placeholderConsts) : TYPED_NULL_EXPR
|
|
27226
|
+
placeholderConsts ? this.addToConsts(placeholderConsts) : TYPED_NULL_EXPR,
|
|
27227
|
+
(loadingConsts == null ? void 0 : loadingConsts.length) || placeholderConsts ? importExpr(Identifiers.deferEnableTimerScheduling) : TYPED_NULL_EXPR
|
|
26509
27228
|
]));
|
|
27229
|
+
this.allocateDataSlot();
|
|
26510
27230
|
this.createDeferTriggerInstructions(deferredIndex, triggers, metadata, false);
|
|
26511
27231
|
this.createDeferTriggerInstructions(deferredIndex, prefetchTriggers, metadata, true);
|
|
26512
|
-
this.allocateDataSlot();
|
|
26513
27232
|
}
|
|
26514
27233
|
createDeferredDepsFunction(name, metadata) {
|
|
26515
27234
|
if (metadata.deps.length === 0) {
|
|
@@ -26579,10 +27298,12 @@ var TemplateDefinitionBuilder = class {
|
|
|
26579
27298
|
visitForLoopBlock(block) {
|
|
26580
27299
|
const blockIndex = this.allocateDataSlot();
|
|
26581
27300
|
const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [block.item, block.contextVariables.$index, block.contextVariables.$count]);
|
|
26582
|
-
const emptyData = block.empty === null ? null : this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty");
|
|
26583
27301
|
const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
|
|
26584
|
-
|
|
26585
|
-
|
|
27302
|
+
let emptyData = null;
|
|
27303
|
+
if (block.empty !== null) {
|
|
27304
|
+
emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty");
|
|
27305
|
+
this.allocateBindingSlots(null);
|
|
27306
|
+
}
|
|
26586
27307
|
this.registerComputedLoopVariables(block, primaryData.scope);
|
|
26587
27308
|
this.creationInstruction(block.sourceSpan, Identifiers.repeaterCreate, () => {
|
|
26588
27309
|
const params = [
|
|
@@ -26599,6 +27320,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
26599
27320
|
}
|
|
26600
27321
|
return params;
|
|
26601
27322
|
});
|
|
27323
|
+
const value = block.expression.visit(this._valueConverter);
|
|
26602
27324
|
this.updateInstruction(block.sourceSpan, Identifiers.repeater, () => [literal(blockIndex), this.convertPropertyBinding(value)]);
|
|
26603
27325
|
}
|
|
26604
27326
|
registerComputedLoopVariables(block, bindingScope) {
|
|
@@ -27257,6 +27979,7 @@ function getTextInterpolationExpression(interpolation) {
|
|
|
27257
27979
|
}
|
|
27258
27980
|
}
|
|
27259
27981
|
function parseTemplate(template2, templateUrl, options = {}) {
|
|
27982
|
+
var _a2;
|
|
27260
27983
|
const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
|
|
27261
27984
|
const bindingParser = makeBindingParser(interpolationConfig);
|
|
27262
27985
|
const htmlParser = new HtmlParser();
|
|
@@ -27264,7 +27987,7 @@ function parseTemplate(template2, templateUrl, options = {}) {
|
|
|
27264
27987
|
leadingTriviaChars: LEADING_TRIVIA_CHARS
|
|
27265
27988
|
}, options), {
|
|
27266
27989
|
tokenizeExpansionForms: true,
|
|
27267
|
-
tokenizeBlocks: options.
|
|
27990
|
+
tokenizeBlocks: (_a2 = options.enableBlockSyntax) != null ? _a2 : true
|
|
27268
27991
|
}));
|
|
27269
27992
|
if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors && parseResult.errors.length > 0) {
|
|
27270
27993
|
const parsedTemplate2 = {
|
|
@@ -27306,10 +28029,7 @@ function parseTemplate(template2, templateUrl, options = {}) {
|
|
|
27306
28029
|
rootNodes = visitAll(new I18nMetaVisitor(interpolationConfig, false), rootNodes);
|
|
27307
28030
|
}
|
|
27308
28031
|
}
|
|
27309
|
-
const { nodes, errors, styleUrls, styles, ngContentSelectors, commentNodes } = htmlAstToRender3Ast(rootNodes, bindingParser, {
|
|
27310
|
-
collectCommentNodes: !!options.collectCommentNodes,
|
|
27311
|
-
enabledBlockTypes: options.enabledBlockTypes || /* @__PURE__ */ new Set()
|
|
27312
|
-
});
|
|
28032
|
+
const { nodes, errors, styleUrls, styles, ngContentSelectors, commentNodes } = htmlAstToRender3Ast(rootNodes, bindingParser, { collectCommentNodes: !!options.collectCommentNodes });
|
|
27313
28033
|
errors.push(...parseResult.errors, ...i18nMetaResult.errors);
|
|
27314
28034
|
const parsedTemplate = {
|
|
27315
28035
|
interpolationConfig,
|
|
@@ -27506,7 +28226,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
27506
28226
|
if (constExpressions.length > 0) {
|
|
27507
28227
|
let constsExpr = literalArr(constExpressions);
|
|
27508
28228
|
if (prepareStatements.length > 0) {
|
|
27509
|
-
constsExpr =
|
|
28229
|
+
constsExpr = arrowFn([], [...prepareStatements, new ReturnStatement(constsExpr)]);
|
|
27510
28230
|
}
|
|
27511
28231
|
definitionMap.set("consts", constsExpr);
|
|
27512
28232
|
}
|
|
@@ -27522,7 +28242,10 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
|
|
|
27522
28242
|
definitionMap.set("vars", literal(tpl.root.vars));
|
|
27523
28243
|
if (tpl.consts.length > 0) {
|
|
27524
28244
|
if (tpl.constsInitializers.length > 0) {
|
|
27525
|
-
definitionMap.set("consts",
|
|
28245
|
+
definitionMap.set("consts", arrowFn([], [
|
|
28246
|
+
...tpl.constsInitializers,
|
|
28247
|
+
new ReturnStatement(literalArr(tpl.consts))
|
|
28248
|
+
]));
|
|
27526
28249
|
} else {
|
|
27527
28250
|
definitionMap.set("consts", literalArr(tpl.consts));
|
|
27528
28251
|
}
|
|
@@ -27587,10 +28310,10 @@ function compileDeclarationList(list2, mode) {
|
|
|
27587
28310
|
case 0:
|
|
27588
28311
|
return list2;
|
|
27589
28312
|
case 1:
|
|
27590
|
-
return
|
|
28313
|
+
return arrowFn([], list2);
|
|
27591
28314
|
case 2:
|
|
27592
28315
|
const resolvedList = list2.prop("map").callFn([importExpr(Identifiers.resolveForwardRef)]);
|
|
27593
|
-
return
|
|
28316
|
+
return arrowFn([], resolvedList);
|
|
27594
28317
|
case 3:
|
|
27595
28318
|
throw new Error(`Unsupported with an array of pre-resolved dependencies`);
|
|
27596
28319
|
}
|
|
@@ -28113,6 +28836,8 @@ var Scope = class {
|
|
|
28113
28836
|
}
|
|
28114
28837
|
visitDeferredTrigger(trigger) {
|
|
28115
28838
|
}
|
|
28839
|
+
visitUnknownBlock(block) {
|
|
28840
|
+
}
|
|
28116
28841
|
maybeDeclare(thing) {
|
|
28117
28842
|
if (!this.namedEntities.has(thing.name)) {
|
|
28118
28843
|
this.namedEntities.set(thing.name, thing);
|
|
@@ -28271,6 +28996,8 @@ var DirectiveBinder = class {
|
|
|
28271
28996
|
}
|
|
28272
28997
|
visitDeferredTrigger(trigger) {
|
|
28273
28998
|
}
|
|
28999
|
+
visitUnknownBlock(block) {
|
|
29000
|
+
}
|
|
28274
29001
|
};
|
|
28275
29002
|
var TemplateBinder = class extends RecursiveAstVisitor {
|
|
28276
29003
|
constructor(bindings, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, rootNode, level) {
|
|
@@ -28358,6 +29085,10 @@ var TemplateBinder = class extends RecursiveAstVisitor {
|
|
|
28358
29085
|
}
|
|
28359
29086
|
visitTextAttribute(attribute2) {
|
|
28360
29087
|
}
|
|
29088
|
+
visitUnknownBlock(block) {
|
|
29089
|
+
}
|
|
29090
|
+
visitDeferredTrigger() {
|
|
29091
|
+
}
|
|
28361
29092
|
visitIcu(icu) {
|
|
28362
29093
|
Object.keys(icu.vars).forEach((key) => icu.vars[key].visit(this));
|
|
28363
29094
|
Object.keys(icu.placeholders).forEach((key) => icu.placeholders[key].visit(this));
|
|
@@ -28369,17 +29100,15 @@ var TemplateBinder = class extends RecursiveAstVisitor {
|
|
|
28369
29100
|
event.handler.visit(this);
|
|
28370
29101
|
}
|
|
28371
29102
|
visitDeferredBlock(deferred) {
|
|
29103
|
+
var _a2, _b2;
|
|
28372
29104
|
this.deferBlocks.add(deferred);
|
|
28373
29105
|
this.ingestScopedNode(deferred);
|
|
29106
|
+
(_a2 = deferred.triggers.when) == null ? void 0 : _a2.value.visit(this);
|
|
29107
|
+
(_b2 = deferred.prefetchTriggers.when) == null ? void 0 : _b2.value.visit(this);
|
|
28374
29108
|
deferred.placeholder && this.visitNode(deferred.placeholder);
|
|
28375
29109
|
deferred.loading && this.visitNode(deferred.loading);
|
|
28376
29110
|
deferred.error && this.visitNode(deferred.error);
|
|
28377
29111
|
}
|
|
28378
|
-
visitDeferredTrigger(trigger) {
|
|
28379
|
-
if (trigger instanceof BoundDeferredTrigger) {
|
|
28380
|
-
trigger.value.visit(this);
|
|
28381
|
-
}
|
|
28382
|
-
}
|
|
28383
29112
|
visitDeferredBlockPlaceholder(block) {
|
|
28384
29113
|
this.ingestScopedNode(block);
|
|
28385
29114
|
}
|
|
@@ -28583,7 +29312,6 @@ function extractScopedNodeEntities(rootScope) {
|
|
|
28583
29312
|
}
|
|
28584
29313
|
var ResourceLoader = class {
|
|
28585
29314
|
};
|
|
28586
|
-
var enabledBlockTypes;
|
|
28587
29315
|
var CompilerFacadeImpl = class {
|
|
28588
29316
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
28589
29317
|
this.jitEvaluator = jitEvaluator;
|
|
@@ -28959,7 +29687,7 @@ function convertPipeDeclarationToMetadata(pipe2) {
|
|
|
28959
29687
|
}
|
|
28960
29688
|
function parseJitTemplate(template2, typeName, sourceMapUrl, preserveWhitespaces, interpolation) {
|
|
28961
29689
|
const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
|
|
28962
|
-
const parsed = parseTemplate(template2, sourceMapUrl, { preserveWhitespaces, interpolationConfig
|
|
29690
|
+
const parsed = parseTemplate(template2, sourceMapUrl, { preserveWhitespaces, interpolationConfig });
|
|
28963
29691
|
if (parsed.errors !== null) {
|
|
28964
29692
|
const errors = parsed.errors.map((err) => err.toString()).join(", ");
|
|
28965
29693
|
throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`);
|
|
@@ -29134,7 +29862,7 @@ function publishFacade(global) {
|
|
|
29134
29862
|
const ng = global.ng || (global.ng = {});
|
|
29135
29863
|
ng.\u0275compilerFacade = new CompilerFacadeImpl();
|
|
29136
29864
|
}
|
|
29137
|
-
var VERSION = new Version("17.0.0-
|
|
29865
|
+
var VERSION = new Version("17.0.0-rc.0");
|
|
29138
29866
|
var _VisitorMode;
|
|
29139
29867
|
(function(_VisitorMode2) {
|
|
29140
29868
|
_VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
|
|
@@ -29170,7 +29898,7 @@ var FactoryTarget;
|
|
|
29170
29898
|
})(FactoryTarget || (FactoryTarget = {}));
|
|
29171
29899
|
publishFacade(_global);
|
|
29172
29900
|
|
|
29173
|
-
// bazel-out/
|
|
29901
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/tree-traversal.js
|
|
29174
29902
|
function visitElements(nodes, preorderCallback = () => {
|
|
29175
29903
|
}, postorderCallback = () => {
|
|
29176
29904
|
}) {
|
|
@@ -29250,7 +29978,7 @@ function replaceAt(str, offset, oldSubstr, newSubstr) {
|
|
|
29250
29978
|
return prefix + newSubstr + suffix;
|
|
29251
29979
|
}
|
|
29252
29980
|
|
|
29253
|
-
// bazel-out/
|
|
29981
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/card/card-template.js
|
|
29254
29982
|
var CardTemplateMigrator = class extends TemplateMigrator {
|
|
29255
29983
|
getUpdates(ast) {
|
|
29256
29984
|
const updates = [];
|
|
@@ -29267,7 +29995,7 @@ var CardTemplateMigrator = class extends TemplateMigrator {
|
|
|
29267
29995
|
}
|
|
29268
29996
|
};
|
|
29269
29997
|
|
|
29270
|
-
// bazel-out/
|
|
29998
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/checkbox/checkbox-styles.js
|
|
29271
29999
|
var CheckboxStylesMigrator = class extends StyleMigrator {
|
|
29272
30000
|
constructor() {
|
|
29273
30001
|
super(...arguments);
|
|
@@ -29291,7 +30019,7 @@ var CheckboxStylesMigrator = class extends StyleMigrator {
|
|
|
29291
30019
|
}
|
|
29292
30020
|
};
|
|
29293
30021
|
|
|
29294
|
-
// bazel-out/
|
|
30022
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/chips/chips-styles.js
|
|
29295
30023
|
var ChipsStylesMigrator = class extends StyleMigrator {
|
|
29296
30024
|
constructor() {
|
|
29297
30025
|
super(...arguments);
|
|
@@ -29322,7 +30050,7 @@ var ChipsStylesMigrator = class extends StyleMigrator {
|
|
|
29322
30050
|
}
|
|
29323
30051
|
};
|
|
29324
30052
|
|
|
29325
|
-
// bazel-out/
|
|
30053
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/chips/chips-template.js
|
|
29326
30054
|
var ChipsTemplateMigrator = class extends TemplateMigrator {
|
|
29327
30055
|
constructor() {
|
|
29328
30056
|
super(...arguments);
|
|
@@ -29402,7 +30130,7 @@ var ChipsTemplateMigrator = class extends TemplateMigrator {
|
|
|
29402
30130
|
}
|
|
29403
30131
|
};
|
|
29404
30132
|
|
|
29405
|
-
// bazel-out/
|
|
30133
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/dialog/dialog-styles.js
|
|
29406
30134
|
var DialogStylesMigrator = class extends StyleMigrator {
|
|
29407
30135
|
constructor() {
|
|
29408
30136
|
super(...arguments);
|
|
@@ -29432,7 +30160,7 @@ var DialogStylesMigrator = class extends StyleMigrator {
|
|
|
29432
30160
|
}
|
|
29433
30161
|
};
|
|
29434
30162
|
|
|
29435
|
-
// bazel-out/
|
|
30163
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/form-field/form-field-styles.js
|
|
29436
30164
|
var FormFieldStylesMigrator = class extends StyleMigrator {
|
|
29437
30165
|
constructor() {
|
|
29438
30166
|
super(...arguments);
|
|
@@ -29489,7 +30217,7 @@ var FormFieldStylesMigrator = class extends StyleMigrator {
|
|
|
29489
30217
|
}
|
|
29490
30218
|
};
|
|
29491
30219
|
|
|
29492
|
-
// bazel-out/
|
|
30220
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/input/input-styles.js
|
|
29493
30221
|
var InputStylesMigrator = class extends StyleMigrator {
|
|
29494
30222
|
constructor() {
|
|
29495
30223
|
super(...arguments);
|
|
@@ -29513,7 +30241,7 @@ var InputStylesMigrator = class extends StyleMigrator {
|
|
|
29513
30241
|
}
|
|
29514
30242
|
};
|
|
29515
30243
|
|
|
29516
|
-
// bazel-out/
|
|
30244
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/list/list-styles.js
|
|
29517
30245
|
var ListStylesMigrator = class extends StyleMigrator {
|
|
29518
30246
|
constructor() {
|
|
29519
30247
|
super(...arguments);
|
|
@@ -29544,7 +30272,7 @@ var ListStylesMigrator = class extends StyleMigrator {
|
|
|
29544
30272
|
}
|
|
29545
30273
|
};
|
|
29546
30274
|
|
|
29547
|
-
// bazel-out/
|
|
30275
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/menu/menu-styles.js
|
|
29548
30276
|
var MenuStylesMigrator = class extends StyleMigrator {
|
|
29549
30277
|
constructor() {
|
|
29550
30278
|
super(...arguments);
|
|
@@ -29577,7 +30305,7 @@ var MenuStylesMigrator = class extends StyleMigrator {
|
|
|
29577
30305
|
}
|
|
29578
30306
|
};
|
|
29579
30307
|
|
|
29580
|
-
// bazel-out/
|
|
30308
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/paginator/paginator-styles.js
|
|
29581
30309
|
var PaginatorStylesMigrator = class extends StyleMigrator {
|
|
29582
30310
|
constructor() {
|
|
29583
30311
|
super(...arguments);
|
|
@@ -29623,7 +30351,7 @@ var PaginatorStylesMigrator = class extends StyleMigrator {
|
|
|
29623
30351
|
}
|
|
29624
30352
|
};
|
|
29625
30353
|
|
|
29626
|
-
// bazel-out/
|
|
30354
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/progress-bar/progress-bar-styles.js
|
|
29627
30355
|
var ProgressBarStylesMigrator = class extends StyleMigrator {
|
|
29628
30356
|
constructor() {
|
|
29629
30357
|
super(...arguments);
|
|
@@ -29647,7 +30375,7 @@ var ProgressBarStylesMigrator = class extends StyleMigrator {
|
|
|
29647
30375
|
}
|
|
29648
30376
|
};
|
|
29649
30377
|
|
|
29650
|
-
// bazel-out/
|
|
30378
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/progress-spinner/progress-spinner-styles.js
|
|
29651
30379
|
var ProgressSpinnerStylesMigrator = class extends StyleMigrator {
|
|
29652
30380
|
constructor() {
|
|
29653
30381
|
super(...arguments);
|
|
@@ -29674,7 +30402,7 @@ var ProgressSpinnerStylesMigrator = class extends StyleMigrator {
|
|
|
29674
30402
|
}
|
|
29675
30403
|
};
|
|
29676
30404
|
|
|
29677
|
-
// bazel-out/
|
|
30405
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/radio/radio-styles.js
|
|
29678
30406
|
var RadioStylesMigrator = class extends StyleMigrator {
|
|
29679
30407
|
constructor() {
|
|
29680
30408
|
super(...arguments);
|
|
@@ -29701,7 +30429,7 @@ var RadioStylesMigrator = class extends StyleMigrator {
|
|
|
29701
30429
|
}
|
|
29702
30430
|
};
|
|
29703
30431
|
|
|
29704
|
-
// bazel-out/
|
|
30432
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/select/select-styles.js
|
|
29705
30433
|
var SelectStylesMigrator = class extends StyleMigrator {
|
|
29706
30434
|
constructor() {
|
|
29707
30435
|
super(...arguments);
|
|
@@ -29732,7 +30460,7 @@ var SelectStylesMigrator = class extends StyleMigrator {
|
|
|
29732
30460
|
}
|
|
29733
30461
|
};
|
|
29734
30462
|
|
|
29735
|
-
// bazel-out/
|
|
30463
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/slide-toggle/slide-toggle-styles.js
|
|
29736
30464
|
var SlideToggleStylesMigrator = class extends StyleMigrator {
|
|
29737
30465
|
constructor() {
|
|
29738
30466
|
super(...arguments);
|
|
@@ -29756,7 +30484,7 @@ var SlideToggleStylesMigrator = class extends StyleMigrator {
|
|
|
29756
30484
|
}
|
|
29757
30485
|
};
|
|
29758
30486
|
|
|
29759
|
-
// bazel-out/
|
|
30487
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-styles.js
|
|
29760
30488
|
var SliderStylesMigrator = class extends StyleMigrator {
|
|
29761
30489
|
constructor() {
|
|
29762
30490
|
super(...arguments);
|
|
@@ -29780,7 +30508,7 @@ var SliderStylesMigrator = class extends StyleMigrator {
|
|
|
29780
30508
|
}
|
|
29781
30509
|
};
|
|
29782
30510
|
|
|
29783
|
-
// bazel-out/
|
|
30511
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/snack-bar/snack-bar-styles.js
|
|
29784
30512
|
var SnackBarMigrator = class extends StyleMigrator {
|
|
29785
30513
|
constructor() {
|
|
29786
30514
|
super(...arguments);
|
|
@@ -29813,7 +30541,7 @@ var SnackBarMigrator = class extends StyleMigrator {
|
|
|
29813
30541
|
}
|
|
29814
30542
|
};
|
|
29815
30543
|
|
|
29816
|
-
// bazel-out/
|
|
30544
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/table/table-styles.js
|
|
29817
30545
|
var TableStylesMigrator = class extends StyleMigrator {
|
|
29818
30546
|
constructor() {
|
|
29819
30547
|
super(...arguments);
|
|
@@ -29854,7 +30582,7 @@ var TableStylesMigrator = class extends StyleMigrator {
|
|
|
29854
30582
|
}
|
|
29855
30583
|
};
|
|
29856
30584
|
|
|
29857
|
-
// bazel-out/
|
|
30585
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/tabs/tabs-styles.js
|
|
29858
30586
|
var TabsStylesMigrator = class extends StyleMigrator {
|
|
29859
30587
|
constructor() {
|
|
29860
30588
|
super(...arguments);
|
|
@@ -29885,7 +30613,7 @@ var TabsStylesMigrator = class extends StyleMigrator {
|
|
|
29885
30613
|
}
|
|
29886
30614
|
};
|
|
29887
30615
|
|
|
29888
|
-
// bazel-out/
|
|
30616
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/tooltip/tooltip-styles.js
|
|
29889
30617
|
var TooltipStylesMigrator = class extends StyleMigrator {
|
|
29890
30618
|
constructor() {
|
|
29891
30619
|
super(...arguments);
|
|
@@ -29919,7 +30647,7 @@ var TooltipStylesMigrator = class extends StyleMigrator {
|
|
|
29919
30647
|
}
|
|
29920
30648
|
};
|
|
29921
30649
|
|
|
29922
|
-
// bazel-out/
|
|
30650
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/optgroup/optgroup-styles.js
|
|
29923
30651
|
var OptgroupStylesMigrator = class extends StyleMigrator {
|
|
29924
30652
|
constructor() {
|
|
29925
30653
|
super(...arguments);
|
|
@@ -29952,7 +30680,7 @@ var OptgroupStylesMigrator = class extends StyleMigrator {
|
|
|
29952
30680
|
}
|
|
29953
30681
|
};
|
|
29954
30682
|
|
|
29955
|
-
// bazel-out/
|
|
30683
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/option/option-styles.js
|
|
29956
30684
|
var OptionStylesMigrator = class extends StyleMigrator {
|
|
29957
30685
|
constructor() {
|
|
29958
30686
|
super(...arguments);
|
|
@@ -30005,7 +30733,7 @@ var OptionStylesMigrator = class extends StyleMigrator {
|
|
|
30005
30733
|
}
|
|
30006
30734
|
};
|
|
30007
30735
|
|
|
30008
|
-
// bazel-out/
|
|
30736
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/form-field/form-field-template.js
|
|
30009
30737
|
var FormFieldTemplateMigrator = class extends TemplateMigrator {
|
|
30010
30738
|
getUpdates(ast) {
|
|
30011
30739
|
const updates = [];
|
|
@@ -30022,7 +30750,7 @@ var FormFieldTemplateMigrator = class extends TemplateMigrator {
|
|
|
30022
30750
|
}
|
|
30023
30751
|
};
|
|
30024
30752
|
|
|
30025
|
-
// bazel-out/
|
|
30753
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/slider/slider-template.js
|
|
30026
30754
|
var SliderTemplateMigrator = class extends TemplateMigrator {
|
|
30027
30755
|
getUpdates(ast) {
|
|
30028
30756
|
const updates = [];
|
|
@@ -30141,7 +30869,7 @@ var SliderTemplateMigrator = class extends TemplateMigrator {
|
|
|
30141
30869
|
}
|
|
30142
30870
|
};
|
|
30143
30871
|
|
|
30144
|
-
// bazel-out/
|
|
30872
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/typography-hierarchy/constants.js
|
|
30145
30873
|
var mappings = [
|
|
30146
30874
|
["display-4", "headline-1"],
|
|
30147
30875
|
["display-3", "headline-2"],
|
|
@@ -30158,7 +30886,7 @@ var RENAMED_TYPOGRAPHY_LEVELS = new Map(mappings);
|
|
|
30158
30886
|
var RENAMED_TYPOGRAPHY_CLASSES = new Map(mappings.map((m) => ["mat-" + m[0], "mat-" + m[1]]));
|
|
30159
30887
|
var COMBINED_TYPOGRAPHY_LEVELS = /* @__PURE__ */ new Map([["input", "body-1"]]);
|
|
30160
30888
|
|
|
30161
|
-
// bazel-out/
|
|
30889
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/typography-hierarchy/typography-hierarchy-template.js
|
|
30162
30890
|
var TypographyHierarchyTemplateMigrator = class extends TemplateMigrator {
|
|
30163
30891
|
getUpdates(ast) {
|
|
30164
30892
|
const updates = [];
|
|
@@ -30201,7 +30929,7 @@ var TypographyHierarchyTemplateMigrator = class extends TemplateMigrator {
|
|
|
30201
30929
|
}
|
|
30202
30930
|
};
|
|
30203
30931
|
|
|
30204
|
-
// bazel-out/
|
|
30932
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/components/typography-hierarchy/typography-hierarchy-styles.js
|
|
30205
30933
|
var TypographyHierarchyStylesMigrator = class extends StyleMigrator {
|
|
30206
30934
|
constructor() {
|
|
30207
30935
|
super();
|
|
@@ -30222,7 +30950,7 @@ var TypographyHierarchyStylesMigrator = class extends StyleMigrator {
|
|
|
30222
30950
|
}
|
|
30223
30951
|
};
|
|
30224
30952
|
|
|
30225
|
-
// bazel-out/
|
|
30953
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/index.js
|
|
30226
30954
|
var LEGACY_MODULES = new Set([
|
|
30227
30955
|
"legacy-autocomplete",
|
|
30228
30956
|
"legacy-autocomplete/testing",
|
|
@@ -30376,14 +31104,14 @@ var PERMANENT_MIGRATORS = [
|
|
|
30376
31104
|
];
|
|
30377
31105
|
var CORE_COMPONENTS = ["option", "optgroup"];
|
|
30378
31106
|
|
|
30379
|
-
// bazel-out/
|
|
31107
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/index.mjs
|
|
30380
31108
|
var import_schematics4 = require("@angular/cdk/schematics");
|
|
30381
31109
|
|
|
30382
|
-
// bazel-out/
|
|
31110
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/ts-migration/runtime-migration.js
|
|
30383
31111
|
var import_schematics3 = require("@angular/cdk/schematics");
|
|
30384
31112
|
var ts = __toESM(require("typescript"));
|
|
30385
31113
|
|
|
30386
|
-
// bazel-out/
|
|
31114
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/theming-styles.js
|
|
30387
31115
|
var import_schematics = require("@angular/cdk/schematics");
|
|
30388
31116
|
var import_path = require("path");
|
|
30389
31117
|
|
|
@@ -30426,7 +31154,7 @@ var scss_syntax_default = import_scss_syntax.default;
|
|
|
30426
31154
|
var stringify3 = import_scss_syntax.default.stringify;
|
|
30427
31155
|
var parse3 = import_scss_syntax.default.parse;
|
|
30428
31156
|
|
|
30429
|
-
// bazel-out/
|
|
31157
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/theming-styles.js
|
|
30430
31158
|
var COMPONENTS_MIXIN_NAME = /\.([^(;]*)/;
|
|
30431
31159
|
var ThemingStylesMigration = class extends import_schematics.Migration {
|
|
30432
31160
|
constructor() {
|
|
@@ -30710,17 +31438,17 @@ function extractValueRange(content, colonIndex) {
|
|
|
30710
31438
|
return start > -1 && end > -1 ? { start, end, fullEnd } : null;
|
|
30711
31439
|
}
|
|
30712
31440
|
|
|
30713
|
-
// bazel-out/
|
|
31441
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/template-migration.js
|
|
30714
31442
|
var import_schematics2 = require("@angular/cdk/schematics");
|
|
30715
31443
|
|
|
30716
|
-
// bazel-out/
|
|
31444
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/migration-utilities/update.js
|
|
30717
31445
|
function writeUpdates(content, updates) {
|
|
30718
31446
|
updates.sort((a, b) => b.offset - a.offset);
|
|
30719
31447
|
updates.forEach((update) => content = update.updateFn(content));
|
|
30720
31448
|
return content;
|
|
30721
31449
|
}
|
|
30722
31450
|
|
|
30723
|
-
// bazel-out/
|
|
31451
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/template-migration.js
|
|
30724
31452
|
var TemplateMigration = class extends import_schematics2.Migration {
|
|
30725
31453
|
constructor() {
|
|
30726
31454
|
super(...arguments);
|
|
@@ -30748,7 +31476,7 @@ var TemplateMigration = class extends import_schematics2.Migration {
|
|
|
30748
31476
|
}
|
|
30749
31477
|
};
|
|
30750
31478
|
|
|
30751
|
-
// bazel-out/
|
|
31479
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/rules/ts-migration/runtime-migration.js
|
|
30752
31480
|
var RuntimeCodeMigration = class extends import_schematics3.Migration {
|
|
30753
31481
|
constructor() {
|
|
30754
31482
|
super(...arguments);
|
|
@@ -30977,7 +31705,7 @@ var RuntimeCodeMigration = class extends import_schematics3.Migration {
|
|
|
30977
31705
|
}
|
|
30978
31706
|
};
|
|
30979
31707
|
|
|
30980
|
-
// bazel-out/
|
|
31708
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/mdc-migration/index.mjs
|
|
30981
31709
|
var migrationGroups = [
|
|
30982
31710
|
["autocomplete", "form-field", "input", "option", "optgroup", "select"],
|
|
30983
31711
|
["button"],
|
|
@@ -31073,7 +31801,7 @@ ${[...componentsToMigrate].join("\n")}`);
|
|
|
31073
31801
|
* found in the LICENSE file at https://angular.io/license
|
|
31074
31802
|
*/
|
|
31075
31803
|
/**
|
|
31076
|
-
* @license Angular v17.0.0-
|
|
31804
|
+
* @license Angular v17.0.0-rc.0
|
|
31077
31805
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
31078
31806
|
* License: MIT
|
|
31079
31807
|
*/
|