prettier 2.1.1 → 2.3.0
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/LICENSE +0 -0
- package/README.md +3 -3
- package/bin-prettier.js +12178 -10699
- package/doc.js +1230 -1003
- package/esm/parser-angular.mjs +46 -0
- package/esm/parser-babel.mjs +1 -0
- package/esm/parser-espree.mjs +1 -0
- package/esm/parser-flow.mjs +1 -0
- package/esm/parser-glimmer.mjs +1 -0
- package/esm/parser-graphql.mjs +1 -0
- package/esm/parser-html.mjs +111 -0
- package/esm/parser-markdown.mjs +13 -0
- package/esm/parser-meriyah.mjs +1 -0
- package/esm/parser-postcss.mjs +1 -0
- package/esm/parser-typescript.mjs +1 -0
- package/esm/parser-yaml.mjs +15 -0
- package/esm/standalone.mjs +55 -0
- package/index.js +23217 -16968
- package/package.json +3 -2
- package/parser-angular.js +40 -40
- package/parser-babel.js +1 -1
- package/parser-espree.js +1 -0
- package/parser-flow.js +1 -1
- package/parser-glimmer.js +1 -1
- package/parser-graphql.js +1 -1
- package/parser-html.js +61 -63
- package/parser-markdown.js +3 -9
- package/parser-meriyah.js +1 -0
- package/parser-postcss.js +1 -8
- package/parser-typescript.js +1 -14
- package/parser-yaml.js +2 -2
- package/standalone.js +42 -2
- package/third-party.js +1042 -962
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettier",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Prettier is an opinionated code formatter",
|
|
5
5
|
"bin": "./bin-prettier.js",
|
|
6
6
|
"repository": "prettier/prettier",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"node": ">=10.13.0"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"*.js"
|
|
17
|
+
"*.js",
|
|
18
|
+
"esm/*.mjs"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
20
21
|
"prepublishOnly": "node -e \"assert.equal(require('.').version, require('..').version)\""
|
package/parser-angular.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t="undefined"!=typeof globalThis?globalThis:t||self).prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=e())}(this,(function(){"use strict";function t(e,s){const{ignoreDecorators:n}=s||{};if(!n){const s=e.declaration&&e.declaration.decorators||e.decorators;if(s&&s.length>0)return t(s[0])}return e.range?e.range[0]:e.start}function e(t){const s=t.range?t.range[1]:t.end;return t.typeAnnotation?Math.max(s,e(t.typeAnnotation)):s}var s={locStart:t,locEnd:e,composeLoc:function(s,n=s){const r=t(s);return[r,"number"==typeof n?r+n:e(n)]}};function n(t,e,s){return t(s={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&s.path)}},s.exports),s.exports}var r,i=n((function(t,e){var s=function(){function t(t){this.string=t;for(var e=[0],s=0;s<t.length;)switch(t[s]){case"\n":s+="\n".length,e.push(s);break;case"\r":"\n"===t[s+="\r".length]&&(s+="\n".length),e.push(s);break;default:s++}this.offsets=e}return t.prototype.locationForIndex=function(t){if(t<0||t>this.string.length)return null;for(var e=0,s=this.offsets;s[e+1]<=t;)e++;return{line:e,column:t-s[e]}},t.prototype.indexForLocation=function(t){var e=t.line,s=t.column;return e<0||e>=this.offsets.length||s<0||s>this.lengthOfLine(e)?null:this.offsets[e]+s},t.prototype.lengthOfLine=function(t){var e=this.offsets[t];return(t===this.offsets.length-1?this.string.length:this.offsets[t+1])-e},t}();e.__esModule=!0,e.default=s})),a=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.Context=class{constructor(t){this.text=t,this.locator=new s(this.text)}};class s{constructor(t){this._lineAndColumn=new i.default(t)}locationForIndex(t){const{line:e,column:s}=this._lineAndColumn.locationForIndex(t);return{line:e+1,column:s}}}}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).prettierPlugins=e.prettierPlugins||{},e.prettierPlugins.angular=t())}(this,(function(){"use strict";var e=e=>"string"==typeof e?e.replace((({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")})(),""):e;const t=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141));var n=t,r=t;n.default=r;const s=t=>{if("string"!=typeof t||0===t.length)return 0;if(0===(t=e(t)).length)return 0;t=t.replace(/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g," ");let r=0;for(let e=0;e<t.length;e++){const s=t.codePointAt(e);s<=31||s>=127&&s<=159||(s>=768&&s<=879||(s>65535&&e++,r+=n(s)?2:1))}return r};var i=s,u=s;i.default=u;var a=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};var o=e=>e[e.length-1];function D(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var c=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var s=e[t];r[s[0]]=s[1]}return r},p=void 0!==p?p:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function h(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}var d=h,E=l;function f(e){if(d===setTimeout)return setTimeout(e,0);if((d===h||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}"function"==typeof p.setTimeout&&(d=setTimeout),"function"==typeof p.clearTimeout&&(E=clearTimeout);var C,F=[],v=!1,g=-1;function m(){v&&C&&(v=!1,C.length?F=C.concat(F):g=-1,F.length&&x())}function x(){if(!v){var e=f(m);v=!0;for(var t=F.length;t;){for(C=F,F=[];++g<t;)C&&C[g].run();g=-1,t=F.length}C=null,v=!1,function(e){if(E===clearTimeout)return clearTimeout(e);if((E===l||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(e);try{E(e)}catch(t){try{return E.call(null,e)}catch(t){return E.call(this,e)}}}(e)}}function A(e,t){this.fun=e,this.array=t}A.prototype.run=function(){this.fun.apply(null,this.array)};function y(){}var w=y,S=y,I=y,N=y,B=y,O=y,P=y;var b=p.performance||{},T=b.now||b.mozNow||b.msNow||b.oNow||b.webkitNow||function(){return(new Date).getTime()};var L=new Date;var R={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];F.push(new A(e,t)),1!==F.length||v||f(x)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:w,addListener:S,once:I,off:N,removeListener:B,removeAllListeners:O,emit:P,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*T.call(b),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-L)/1e3}};var k="object"==typeof R&&R.env&&R.env.NODE_DEBUG&&/\bsemver\b/i.test(R.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var M={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};function _(e){var t={exports:{}};return e(t,t.exports),t.exports}var G=_((function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=M,r=(t=e.exports={}).re=[],s=t.src=[],i=t.t={};let u=0;const a=(e,t,n)=>{const a=u++;k(a,t),i[e]=a,s[a]=t,r[a]=new RegExp(t,n?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*"),a("NUMERICIDENTIFIERLOOSE","[0-9]+"),a("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),a("MAINVERSION","(".concat(s[i.NUMERICIDENTIFIER],")\\.")+"(".concat(s[i.NUMERICIDENTIFIER],")\\.")+"(".concat(s[i.NUMERICIDENTIFIER],")")),a("MAINVERSIONLOOSE","(".concat(s[i.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(s[i.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(s[i.NUMERICIDENTIFIERLOOSE],")")),a("PRERELEASEIDENTIFIER","(?:".concat(s[i.NUMERICIDENTIFIER],"|").concat(s[i.NONNUMERICIDENTIFIER],")")),a("PRERELEASEIDENTIFIERLOOSE","(?:".concat(s[i.NUMERICIDENTIFIERLOOSE],"|").concat(s[i.NONNUMERICIDENTIFIER],")")),a("PRERELEASE","(?:-(".concat(s[i.PRERELEASEIDENTIFIER],"(?:\\.").concat(s[i.PRERELEASEIDENTIFIER],")*))")),a("PRERELEASELOOSE","(?:-?(".concat(s[i.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(s[i.PRERELEASEIDENTIFIERLOOSE],")*))")),a("BUILDIDENTIFIER","[0-9A-Za-z-]+"),a("BUILD","(?:\\+(".concat(s[i.BUILDIDENTIFIER],"(?:\\.").concat(s[i.BUILDIDENTIFIER],")*))")),a("FULLPLAIN","v?".concat(s[i.MAINVERSION]).concat(s[i.PRERELEASE],"?").concat(s[i.BUILD],"?")),a("FULL","^".concat(s[i.FULLPLAIN],"$")),a("LOOSEPLAIN","[v=\\s]*".concat(s[i.MAINVERSIONLOOSE]).concat(s[i.PRERELEASELOOSE],"?").concat(s[i.BUILD],"?")),a("LOOSE","^".concat(s[i.LOOSEPLAIN],"$")),a("GTLT","((?:<|>)?=?)"),a("XRANGEIDENTIFIERLOOSE","".concat(s[i.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),a("XRANGEIDENTIFIER","".concat(s[i.NUMERICIDENTIFIER],"|x|X|\\*")),a("XRANGEPLAIN","[v=\\s]*(".concat(s[i.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(s[i.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(s[i.XRANGEIDENTIFIER],")")+"(?:".concat(s[i.PRERELEASE],")?").concat(s[i.BUILD],"?")+")?)?"),a("XRANGEPLAINLOOSE","[v=\\s]*(".concat(s[i.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(s[i.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(s[i.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(s[i.PRERELEASELOOSE],")?").concat(s[i.BUILD],"?")+")?)?"),a("XRANGE","^".concat(s[i.GTLT],"\\s*").concat(s[i.XRANGEPLAIN],"$")),a("XRANGELOOSE","^".concat(s[i.GTLT],"\\s*").concat(s[i.XRANGEPLAINLOOSE],"$")),a("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(n,"})")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:\\.(\\d{1,".concat(n,"}))?")+"(?:$|[^\\d])"),a("COERCERTL",s[i.COERCE],!0),a("LONETILDE","(?:~>?)"),a("TILDETRIM","(\\s*)".concat(s[i.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",a("TILDE","^".concat(s[i.LONETILDE]).concat(s[i.XRANGEPLAIN],"$")),a("TILDELOOSE","^".concat(s[i.LONETILDE]).concat(s[i.XRANGEPLAINLOOSE],"$")),a("LONECARET","(?:\\^)"),a("CARETTRIM","(\\s*)".concat(s[i.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",a("CARET","^".concat(s[i.LONECARET]).concat(s[i.XRANGEPLAIN],"$")),a("CARETLOOSE","^".concat(s[i.LONECARET]).concat(s[i.XRANGEPLAINLOOSE],"$")),a("COMPARATORLOOSE","^".concat(s[i.GTLT],"\\s*(").concat(s[i.LOOSEPLAIN],")$|^$")),a("COMPARATOR","^".concat(s[i.GTLT],"\\s*(").concat(s[i.FULLPLAIN],")$|^$")),a("COMPARATORTRIM","(\\s*)".concat(s[i.GTLT],"\\s*(").concat(s[i.LOOSEPLAIN],"|").concat(s[i.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",a("HYPHENRANGE","^\\s*(".concat(s[i.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(s[i.XRANGEPLAIN],")")+"\\s*$"),a("HYPHENRANGELOOSE","^\\s*(".concat(s[i.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(s[i.XRANGEPLAINLOOSE],")")+"\\s*$"),a("STAR","(<|>)?=?\\s*\\*"),a("GTE0","^\\s*>=\\s*0.0.0\\s*$"),a("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}));const j=["includePrerelease","loose","rtl"];var K=e=>e?"object"!=typeof e?{loose:!0}:j.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const U=/^[0-9]+$/,$=(e,t)=>{const n=U.test(e),r=U.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var W={compareIdentifiers:$,rcompareIdentifiers:(e,t)=>$(t,e)};const{MAX_LENGTH:V,MAX_SAFE_INTEGER:X}=M,{re:q,t:z}=G,{compareIdentifiers:Q}=W;class Y{constructor(e,t){if(t=K(t),e instanceof Y){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: ".concat(e));if(e.length>V)throw new TypeError("version is longer than ".concat(V," characters"));k("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?q[z.LOOSE]:q[z.FULL]);if(!n)throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>X||this.major<0)throw new TypeError("Invalid major version");if(this.minor>X||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>X||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<X)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}toString(){return this.version}compare(e){if(k("SemVer.compare",this.version,this.options,e),!(e instanceof Y)){if("string"==typeof e&&e===this.version)return 0;e=new Y(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Y||(e=new Y(e,this.options)),Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)}comparePre(e){if(e instanceof Y||(e=new Y(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(k("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return Q(n,r)}while(++t)}compareBuild(e){e instanceof Y||(e=new Y(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(k("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return Q(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}var H=Y;var J=(e,t,n)=>new H(e,n).compare(new H(t,n));var Z=(e,t,n)=>J(e,t,n)<0;var ee,te,ne,re,se,ie,ue=(e,t,n)=>J(e,t,n)>=0,ae="2.3.0",oe=_((function(e,t){function n(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function r(){return"undefined"!=typeof WeakMap?new WeakMap:{add:n,delete:n,get:n,set:n,has:function(e){return!1}}}Object.defineProperty(t,"__esModule",{value:!0}),t.outdent=void 0;var s=Object.prototype.hasOwnProperty,i=function(e,t){return s.call(e,t)};function u(e,t){for(var n in t)i(t,n)&&(e[n]=t[n]);return e}var a=/^[ \t]*(?:\r\n|\r|\n)/,o=/(?:\r\n|\r|\n)[ \t]*$/,D=/^(?:[\r\n]|$)/,c=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,p=/^[ \t]*[\r\n][ \t\r\n]*$/;function h(e,t,n){var r=0,s=e[0].match(c);s&&(r=s[1].length);var i=new RegExp("(\\r\\n|\\r|\\n).{0,"+r+"}","g");t&&(e=e.slice(1));var u=n.newline,D=n.trimLeadingNewline,p=n.trimTrailingNewline,h="string"==typeof u,l=e.length;return e.map((function(e,t){return e=e.replace(i,"$1"),0===t&&D&&(e=e.replace(a,"")),t===l-1&&p&&(e=e.replace(o,"")),h&&(e=e.replace(/\r\n|\n|\r/g,(function(e){return u}))),e}))}function l(e,t){for(var n="",r=0,s=e.length;r<s;r++)n+=e[r],r<s-1&&(n+=t[r]);return n}function d(e){return i(e,"raw")&&i(e,"length")}var E=function e(t){var n=r(),s=r();return u((function r(i){for(var a=[],o=1;o<arguments.length;o++)a[o-1]=arguments[o];if(d(i)){var c=i,f=(a[0]===r||a[0]===E)&&p.test(c[0])&&D.test(c[1]),C=f?s:n,F=C.get(c);if(F||(F=h(c,f,t),C.set(c,F)),0===a.length)return F[0];var v=l(F,f?a.slice(1):a);return v}return e(u(u({},t),i||{}))}),{string:function(e){return h([e],!1,t)[0]}})}({trimLeadingNewline:!0,trimTrailingNewline:!0});t.outdent=E,t.default=E;try{e.exports=E,Object.defineProperty(E,"__esModule",{value:!0}),E.default=E,E.outdent=E}catch(e){}}));const{outdent:De}=oe,ce="Config",pe="Editor",he="Other",le="Global",de="Special",Ee={cursorOffset:{since:"1.4.0",category:de,type:"int",default:-1,range:{start:-1,end:Number.POSITIVE_INFINITY,step:1},description:De(ee||(ee=D(["\n Print (to stderr) where a cursor at the given position would move to after formatting.\n This option cannot be used with --range-start and --range-end.\n "]))),cliCategory:pe},endOfLine:{since:"1.15.0",category:le,type:"choice",default:[{since:"1.15.0",value:"auto"},{since:"2.0.0",value:"lf"}],description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:De(te||(te=D(["\n Maintain existing\n (mixed values within one file are normalised by looking at what's used after the first line)\n "])))}]},filepath:{since:"1.4.0",category:de,type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:he,cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{since:"1.8.0",category:de,type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:he},parser:{since:"0.0.10",category:le,type:"choice",default:[{since:"0.0.10",value:"babylon"},{since:"1.13.0",value:void 0}],description:"Which parser to use.",exception:e=>"string"==typeof e||"function"==typeof e,choices:[{value:"flow",description:"Flow"},{value:"babel",since:"1.16.0",description:"JavaScript"},{value:"babel-flow",since:"1.16.0",description:"Flow"},{value:"babel-ts",since:"2.0.0",description:"TypeScript"},{value:"typescript",since:"1.4.0",description:"TypeScript"},{value:"espree",since:"2.2.0",description:"JavaScript"},{value:"meriyah",since:"2.2.0",description:"JavaScript"},{value:"css",since:"1.7.1",description:"CSS"},{value:"less",since:"1.7.1",description:"Less"},{value:"scss",since:"1.7.1",description:"SCSS"},{value:"json",since:"1.5.0",description:"JSON"},{value:"json5",since:"1.13.0",description:"JSON5"},{value:"json-stringify",since:"1.13.0",description:"JSON.stringify"},{value:"graphql",since:"1.5.0",description:"GraphQL"},{value:"markdown",since:"1.8.0",description:"Markdown"},{value:"mdx",since:"1.15.0",description:"MDX"},{value:"vue",since:"1.10.0",description:"Vue"},{value:"yaml",since:"1.14.0",description:"YAML"},{value:"glimmer",since:"2.3.0",description:"Ember / Handlebars"},{value:"html",since:"1.15.0",description:"HTML"},{value:"angular",since:"1.15.0",description:"Angular"},{value:"lwc",since:"1.17.0",description:"Lightning Web Components"}]},plugins:{since:"1.10.0",type:"path",array:!0,default:[{value:[]}],category:le,description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin",cliCategory:ce},pluginSearchDirs:{since:"1.13.0",type:"path",array:!0,default:[{value:[]}],category:le,description:De(ne||(ne=D(["\n Custom directory that contains prettier plugins in node_modules subdirectory.\n Overrides default behavior when plugins are searched relatively to the location of Prettier.\n Multiple values are accepted.\n "]))),exception:e=>"string"==typeof e||"object"==typeof e,cliName:"plugin-search-dir",cliCategory:ce},printWidth:{since:"0.0.0",category:le,type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:Number.POSITIVE_INFINITY,step:1}},rangeEnd:{since:"1.4.0",category:de,type:"int",default:Number.POSITIVE_INFINITY,range:{start:0,end:Number.POSITIVE_INFINITY,step:1},description:De(re||(re=D(["\n Format code ending at a given character offset (exclusive).\n The range will extend forwards to the end of the selected statement.\n This option cannot be used with --cursor-offset.\n "]))),cliCategory:pe},rangeStart:{since:"1.4.0",category:de,type:"int",default:0,range:{start:0,end:Number.POSITIVE_INFINITY,step:1},description:De(se||(se=D(["\n Format code starting at a given character offset.\n The range will extend backwards to the start of the first line containing the selected statement.\n This option cannot be used with --cursor-offset.\n "]))),cliCategory:pe},requirePragma:{since:"1.7.0",category:de,type:"boolean",default:!1,description:De(ie||(ie=D(["\n Require either '@prettier' or '@format' to be present in the file's first docblock comment\n in order for it to be formatted.\n "]))),cliCategory:he},tabWidth:{type:"int",category:le,default:2,description:"Number of spaces per indentation level.",range:{start:0,end:Number.POSITIVE_INFINITY,step:1}},useTabs:{since:"1.0.0",category:le,type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{since:"2.1.0",category:le,type:"choice",default:[{since:"2.1.0",value:"auto"}],description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};const fe={compare:J,lt:Z,gte:ue},Ce=ae,Fe={CATEGORY_CONFIG:ce,CATEGORY_EDITOR:pe,CATEGORY_FORMAT:"Format",CATEGORY_OTHER:he,CATEGORY_OUTPUT:"Output",CATEGORY_GLOBAL:le,CATEGORY_SPECIAL:de,options:Ee}.options;var ve={getSupportInfo:function({plugins:e=[],showUnreleased:t=!1,showDeprecated:n=!1,showInternal:r=!1}={}){const s=Ce.split("-",1)[0],i=e.reduce(((e,t)=>[...e,...t.languages||[]]),[]).filter(D),u=(a=Object.assign({},...e.map((({options:e})=>e)),Fe),o="name",Object.entries(a).map((([e,t])=>Object.assign({[o]:e},t)))).filter((e=>D(e)&&p(e))).sort(((e,t)=>e.name===t.name?0:e.name<t.name?-1:1)).map((function(e){if(r)return e;return function(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(s[n]=e[n]);return s}(e,["cliName","cliCategory","cliDescription"])})).map((t=>{t=Object.assign({},t),Array.isArray(t.default)&&(t.default=1===t.default.length?t.default[0].value:t.default.filter(D).sort(((e,t)=>fe.compare(t.since,e.since)))[0].value),Array.isArray(t.choices)&&(t.choices=t.choices.filter((e=>D(e)&&p(e))),"parser"===t.name&&function(e,t,n){const r=new Set(e.choices.map((e=>e.value)));for(const s of t)if(s.parsers)for(const t of s.parsers)if(!r.has(t)){r.add(t);const i=n.find((e=>e.parsers&&e.parsers[t]));let u=s.name;i&&i.name&&(u+=" (plugin: ".concat(i.name,")")),e.choices.push({value:t,description:u})}}(t,i,e));const n=c(e.filter((e=>e.defaultOptions&&void 0!==e.defaultOptions[t.name])).map((e=>[e.name,e.defaultOptions[t.name]])));return Object.assign({},t,{pluginDefaults:n})}));var a,o;return{languages:i,options:u};function D(e){return t||!("since"in e)||e.since&&fe.gte(s,e.since)}function p(e){return n||!("deprecated"in e)||e.deprecated&&fe.lt(s,e.deprecated)}}};const{getSupportInfo:ge}=ve,me=/[^\x20-\x7F]/;function xe(e){return(t,n,r)=>{const s=r&&r.backwards;if(!1===n)return!1;const{length:i}=t;let u=n;for(;u>=0&&u<i;){const n=t.charAt(u);if(e instanceof RegExp){if(!e.test(n))return u}else if(!e.includes(n))return u;s?u--:u++}return(-1===u||u===i)&&u}}const Ae=xe(/\s/),ye=xe(" \t"),we=xe(",; \t"),Se=xe(/[^\n\r]/);function Ie(e,t){if(!1===t)return!1;if("/"===e.charAt(t)&&"*"===e.charAt(t+1))for(let n=t+2;n<e.length;++n)if("*"===e.charAt(n)&&"/"===e.charAt(n+1))return n+2;return t}function Ne(e,t){return!1!==t&&("/"===e.charAt(t)&&"/"===e.charAt(t+1)?Se(e,t):t)}function Be(e,t,n){const r=n&&n.backwards;if(!1===t)return!1;const s=e.charAt(t);if(r){if("\r"===e.charAt(t-1)&&"\n"===s)return t-2;if("\n"===s||"\r"===s||"\u2028"===s||"\u2029"===s)return t-1}else{if("\r"===s&&"\n"===e.charAt(t+1))return t+2;if("\n"===s||"\r"===s||"\u2028"===s||"\u2029"===s)return t+1}return t}function Oe(e,t,n={}){const r=ye(e,n.backwards?t-1:t,n);return r!==Be(e,r,n)}function Pe(e,t){let n=null,r=t;for(;r!==n;)n=r,r=we(e,r),r=Ie(e,r),r=ye(e,r);return r=Ne(e,r),r=Be(e,r),!1!==r&&Oe(e,r)}function be(e,t){let n=null,r=t;for(;r!==n;)n=r,r=ye(e,r),r=Ie(e,r),r=Ne(e,r),r=Be(e,r);return r}function Te(e,t,n){return be(e,n(t))}function Le(e,t,n=0){let r=0;for(let s=n;s<e.length;++s)"\t"===e[s]?r=r+t-r%t:r++;return r}function Re(e,t){const n=e.slice(1,-1),r={quote:'"',regex:/"/g},s={quote:"'",regex:/'/g},i="'"===t?s:r,u=i===s?r:s;let a=i.quote;if(n.includes(i.quote)||n.includes(u.quote)){a=(n.match(i.regex)||[]).length>(n.match(u.regex)||[]).length?u.quote:i.quote}return a}function ke(e,t,n){const r='"'===t?"'":'"',s=e.replace(/\\([\S\s])|(["'])/g,((e,s,i)=>s===r?s:i===t?"\\"+i:i||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(s)?s:"\\"+s)));return t+s+t}function Me(e,t){(e.comments||(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=function(e){const t=e.type||e.kind||"(unknown type)";let n=String(e.name||e.id&&("object"==typeof e.id?e.id.name:e.id)||e.key&&("object"==typeof e.key?e.key.name:e.key)||e.value&&("object"==typeof e.value?"":String(e.value))||e.operator||"");n.length>20&&(n=n.slice(0,19)+"\u2026");return t+(n?" "+n:"")}(e)}var _e={inferParserByLanguage:function(e,t){const{languages:n}=ge({plugins:t.plugins}),r=n.find((({name:t})=>t.toLowerCase()===e))||n.find((({aliases:t})=>Array.isArray(t)&&t.includes(e)))||n.find((({extensions:t})=>Array.isArray(t)&&t.includes(".".concat(e))));return r&&r.parsers[0]},replaceEndOfLineWith:function(e,t){const n=[];for(const r of e.split("\n"))n.length>0&&n.push(t),n.push(r);return n},getStringWidth:function(e){return e?me.test(e)?i(e):e.length:0},getMaxContinuousCount:function(e,t){const n=e.match(new RegExp("(".concat(a(t),")+"),"g"));return null===n?0:n.reduce(((e,n)=>Math.max(e,n.length/t.length)),0)},getMinNotPresentContinuousCount:function(e,t){const n=e.match(new RegExp("(".concat(a(t),")+"),"g"));if(null===n)return 0;const r=new Map;let s=0;for(const e of n){const n=e.length/t.length;r.set(n,!0),n>s&&(s=n)}for(let e=1;e<s;e++)if(!r.get(e))return e;return s+1},getPenultimate:e=>e[e.length-2],getLast:o,getNextNonSpaceNonCommentCharacterIndexWithStartIndex:be,getNextNonSpaceNonCommentCharacterIndex:Te,getNextNonSpaceNonCommentCharacter:function(e,t,n){return e.charAt(Te(e,t,n))},skip:xe,skipWhitespace:Ae,skipSpaces:ye,skipToLineEnd:we,skipEverythingButNewLine:Se,skipInlineComment:Ie,skipTrailingComment:Ne,skipNewline:Be,isNextLineEmptyAfterIndex:Pe,isNextLineEmpty:function(e,t,n){return Pe(e,n(t))},isPreviousLineEmpty:function(e,t,n){let r=n(t)-1;return r=ye(e,r,{backwards:!0}),r=Be(e,r,{backwards:!0}),r=ye(e,r,{backwards:!0}),r!==Be(e,r,{backwards:!0})},hasNewline:Oe,hasNewlineInRange:function(e,t,n){for(let r=t;r<n;++r)if("\n"===e.charAt(r))return!0;return!1},hasSpaces:function(e,t,n={}){return ye(e,n.backwards?t-1:t,n)!==t},getAlignmentSize:Le,getIndentSize:function(e,t){const n=e.lastIndexOf("\n");return-1===n?0:Le(e.slice(n+1).match(/^[\t ]*/)[0],t)},getPreferredQuote:Re,printString:function(e,t){return ke(e.slice(1,-1),"json"===t.parser||"json5"===t.parser&&"preserve"===t.quoteProps&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Re(e,t.singleQuote?"'":'"'),!("css"===t.parser||"less"===t.parser||"scss"===t.parser||t.__embeddedInHtml))},printNumber:function(e){return e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/,"$1$2$3").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e|$)/,"")},makeString:ke,addLeadingComment:function(e,t){t.leading=!0,t.trailing=!1,Me(e,t)},addDanglingComment:function(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Me(e,t)},addTrailingComment:function(e,t){t.leading=!1,t.trailing=!0,Me(e,t)},isFrontMatterNode:function(e){return e&&"front-matter"===e.type},getShebang:function(e){if(!e.startsWith("#!"))return"";const t=e.indexOf("\n");return-1===t?e:e.slice(0,t)},isNonEmptyArray:function(e){return Array.isArray(e)&&e.length>0},createGroupIdMapper:function(e){const t=new WeakMap;return function(n){return t.has(n)||t.set(n,Symbol(e)),t.get(n)}}};const{isNonEmptyArray:Ge}=_e;function je(e,t){const{ignoreDecorators:n}=t||{};if(!n){const t=e.declaration&&e.declaration.decorators||e.decorators;if(Ge(t))return je(t[0])}return e.range?e.range[0]:e.start}function Ke(e){return e.range?e.range[1]:e.end}function Ue(e,t){return je(e)===je(t)}var $e,We={locStart:je,locEnd:Ke,hasSameLocStart:Ue,hasSameLoc:function(e,t){return Ue(e,t)&&function(e,t){return Ke(e)===Ke(t)}(e,t)}},Ve=_((function(e,t){var n="\n",r=function(){function e(e){this.string=e;for(var t=[0],r=0;r<e.length;)switch(e[r]){case n:r+=n.length,t.push(r);break;case"\r":e[r+="\r".length]===n&&(r+=n.length),t.push(r);break;default:r++}this.offsets=t}return e.prototype.locationForIndex=function(e){if(e<0||e>this.string.length)return null;for(var t=0,n=this.offsets;n[t+1]<=e;)t++;return{line:t,column:e-n[t]}},e.prototype.indexForLocation=function(e){var t=e.line,n=e.column;return t<0||t>=this.offsets.length||n<0||n>this.lengthOfLine(t)?null:this.offsets[t]+n},e.prototype.lengthOfLine=function(e){var t=this.offsets[e];return(e===this.offsets.length-1?this.string.length:this.offsets[e+1])-t},e}();t.__esModule=!0,t.default=r})),Xe=_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;t.Context=class{constructor(e){this.text=e,this.locator=new n(this.text)}};class n{constructor(e){this._lineAndColumn=new Ve.default(e)}locationForIndex(e){const{line:t,column:n}=this._lineAndColumn.locationForIndex(e);return{line:t+1,column:n}}}}));
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class o{constructor(t,e,s,n){this.input=e,this.errLocation=s,this.ctxLocation=n,this.message="Parser Error: ".concat(t," ").concat(s," [").concat(e,"] in ").concat(n)}}class c{constructor(t,e){this.start=t,this.end=e}toAbsolute(t){return new L(t+this.start,t+this.end)}}class h{constructor(t,e){this.span=t,this.sourceSpan=e}visit(t,e=null){return null}toString(){return"AST"}}class p extends h{constructor(t,e,s){super(t,e),this.nameSpan=s}}class u extends h{constructor(t,e,s,n,r){super(t,e),this.prefix=s,this.uninterpretedExpression=n,this.location=r}visit(t,e=null){return t.visitQuote(this,e)}toString(){return"Quote"}}class l extends h{visit(t,e=null){}}class d extends h{visit(t,e=null){return t.visitImplicitReceiver(this,e)}}class f extends h{constructor(t,e,s){super(t,e),this.expressions=s}visit(t,e=null){return t.visitChain(this,e)}}class v extends h{constructor(t,e,s,n,r){super(t,e),this.condition=s,this.trueExp=n,this.falseExp=r}visit(t,e=null){return t.visitConditional(this,e)}}class x extends p{constructor(t,e,s,n,r){super(t,e,s),this.receiver=n,this.name=r}visit(t,e=null){return t.visitPropertyRead(this,e)}}class g extends p{constructor(t,e,s,n,r,i){super(t,e,s),this.receiver=n,this.name=r,this.value=i}visit(t,e=null){return t.visitPropertyWrite(this,e)}}class m extends p{constructor(t,e,s,n,r){super(t,e,s),this.receiver=n,this.name=r}visit(t,e=null){return t.visitSafePropertyRead(this,e)}}class y extends h{constructor(t,e,s,n){super(t,e),this.obj=s,this.key=n}visit(t,e=null){return t.visitKeyedRead(this,e)}}class S extends h{constructor(t,e,s,n,r){super(t,e),this.obj=s,this.key=n,this.value=r}visit(t,e=null){return t.visitKeyedWrite(this,e)}}class w extends p{constructor(t,e,s,n,r,i){super(t,e,i),this.exp=s,this.name=n,this.args=r}visit(t,e=null){return t.visitPipe(this,e)}}class C extends h{constructor(t,e,s){super(t,e),this.value=s}visit(t,e=null){return t.visitLiteralPrimitive(this,e)}}class P extends h{constructor(t,e,s){super(t,e),this.expressions=s}visit(t,e=null){return t.visitLiteralArray(this,e)}}class E extends h{constructor(t,e,s,n){super(t,e),this.keys=s,this.values=n}visit(t,e=null){return t.visitLiteralMap(this,e)}}class A extends h{constructor(t,e,s,n){super(t,e),this.strings=s,this.expressions=n}visit(t,e=null){return t.visitInterpolation(this,e)}}class O extends h{constructor(t,e,s,n,r){super(t,e),this.operation=s,this.left=n,this.right=r}visit(t,e=null){return t.visitBinary(this,e)}}class b extends h{constructor(t,e,s){super(t,e),this.expression=s}visit(t,e=null){return t.visitPrefixNot(this,e)}}class k extends h{constructor(t,e,s){super(t,e),this.expression=s}visit(t,e=null){return t.visitNonNullAssert(this,e)}}class N extends p{constructor(t,e,s,n,r,i){super(t,e,s),this.receiver=n,this.name=r,this.args=i}visit(t,e=null){return t.visitMethodCall(this,e)}}class I extends p{constructor(t,e,s,n,r,i){super(t,e,s),this.receiver=n,this.name=r,this.args=i}visit(t,e=null){return t.visitSafeMethodCall(this,e)}}class _ extends h{constructor(t,e,s,n){super(t,e),this.target=s,this.args=n}visit(t,e=null){return t.visitFunctionCall(this,e)}}class L{constructor(t,e){this.start=t,this.end=e}}class K extends h{constructor(t,e,s,n,r){super(new c(0,null===e?0:e.length),new L(n,null===e?n:n+e.length)),this.ast=t,this.source=e,this.location=s,this.errors=r}visit(t,e=null){return t.visitASTWithSource?t.visitASTWithSource(this,e):this.ast.visit(t,e)}toString(){return"".concat(this.source," in ").concat(this.location)}}class M{constructor(t,e,s){this.sourceSpan=t,this.key=e,this.value=s}}class T{constructor(t,e,s){this.sourceSpan=t,this.key=e,this.value=s}}class B{visit(t,e){t.visit(this,e)}visitBinary(t,e){this.visit(t.left,e),this.visit(t.right,e)}visitChain(t,e){this.visitAll(t.expressions,e)}visitConditional(t,e){this.visit(t.condition,e),this.visit(t.trueExp,e),this.visit(t.falseExp,e)}visitPipe(t,e){this.visit(t.exp,e),this.visitAll(t.args,e)}visitFunctionCall(t,e){t.target&&this.visit(t.target,e),this.visitAll(t.args,e)}visitImplicitReceiver(t,e){}visitInterpolation(t,e){this.visitAll(t.expressions,e)}visitKeyedRead(t,e){this.visit(t.obj,e),this.visit(t.key,e)}visitKeyedWrite(t,e){this.visit(t.obj,e),this.visit(t.key,e),this.visit(t.value,e)}visitLiteralArray(t,e){this.visitAll(t.expressions,e)}visitLiteralMap(t,e){this.visitAll(t.values,e)}visitLiteralPrimitive(t,e){}visitMethodCall(t,e){this.visit(t.receiver,e),this.visitAll(t.args,e)}visitPrefixNot(t,e){this.visit(t.expression,e)}visitNonNullAssert(t,e){this.visit(t.expression,e)}visitPropertyRead(t,e){this.visit(t.receiver,e)}visitPropertyWrite(t,e){this.visit(t.receiver,e),this.visit(t.value,e)}visitSafePropertyRead(t,e){this.visit(t.receiver,e)}visitSafeMethodCall(t,e){this.visit(t.receiver,e),this.visitAll(t.args,e)}visitQuote(t,e){}visitAll(t,e){for(const s of t)this.visit(s,e)}}!function(t){t[t.DEFAULT=0]="DEFAULT",t[t.LITERAL_ATTR=1]="LITERAL_ATTR",t[t.ANIMATION=2]="ANIMATION"}(r||(r={}));var R=Object.freeze({__proto__:null,ParserError:o,ParseSpan:c,AST:h,ASTWithName:p,Quote:u,EmptyExpr:l,ImplicitReceiver:d,Chain:f,Conditional:v,PropertyRead:x,PropertyWrite:g,SafePropertyRead:m,KeyedRead:y,KeyedWrite:S,BindingPipe:w,LiteralPrimitive:C,LiteralArray:P,LiteralMap:E,Interpolation:A,Binary:O,PrefixNot:b,NonNullAssert:k,MethodCall:N,SafeMethodCall:I,FunctionCall:_,AbsoluteSourceSpan:L,ASTWithSource:K,VariableBinding:M,ExpressionBinding:T,RecursiveAstVisitor:B,AstTransformer:class{visitImplicitReceiver(t,e){return t}visitInterpolation(t,e){return new A(t.span,t.sourceSpan,t.strings,this.visitAll(t.expressions))}visitLiteralPrimitive(t,e){return new C(t.span,t.sourceSpan,t.value)}visitPropertyRead(t,e){return new x(t.span,t.sourceSpan,t.nameSpan,t.receiver.visit(this),t.name)}visitPropertyWrite(t,e){return new g(t.span,t.sourceSpan,t.nameSpan,t.receiver.visit(this),t.name,t.value.visit(this))}visitSafePropertyRead(t,e){return new m(t.span,t.sourceSpan,t.nameSpan,t.receiver.visit(this),t.name)}visitMethodCall(t,e){return new N(t.span,t.sourceSpan,t.nameSpan,t.receiver.visit(this),t.name,this.visitAll(t.args))}visitSafeMethodCall(t,e){return new I(t.span,t.sourceSpan,t.nameSpan,t.receiver.visit(this),t.name,this.visitAll(t.args))}visitFunctionCall(t,e){return new _(t.span,t.sourceSpan,t.target.visit(this),this.visitAll(t.args))}visitLiteralArray(t,e){return new P(t.span,t.sourceSpan,this.visitAll(t.expressions))}visitLiteralMap(t,e){return new E(t.span,t.sourceSpan,t.keys,this.visitAll(t.values))}visitBinary(t,e){return new O(t.span,t.sourceSpan,t.operation,t.left.visit(this),t.right.visit(this))}visitPrefixNot(t,e){return new b(t.span,t.sourceSpan,t.expression.visit(this))}visitNonNullAssert(t,e){return new k(t.span,t.sourceSpan,t.expression.visit(this))}visitConditional(t,e){return new v(t.span,t.sourceSpan,t.condition.visit(this),t.trueExp.visit(this),t.falseExp.visit(this))}visitPipe(t,e){return new w(t.span,t.sourceSpan,t.exp.visit(this),t.name,this.visitAll(t.args),t.nameSpan)}visitKeyedRead(t,e){return new y(t.span,t.sourceSpan,t.obj.visit(this),t.key.visit(this))}visitKeyedWrite(t,e){return new S(t.span,t.sourceSpan,t.obj.visit(this),t.key.visit(this),t.value.visit(this))}visitAll(t){const e=[];for(let s=0;s<t.length;++s)e[s]=t[s].visit(this);return e}visitChain(t,e){return new f(t.span,t.sourceSpan,this.visitAll(t.expressions))}visitQuote(t,e){return new u(t.span,t.sourceSpan,t.prefix,t.uninterpretedExpression,t.location)}},AstMemoryEfficientTransformer:class{visitImplicitReceiver(t,e){return t}visitInterpolation(t,e){const s=this.visitAll(t.expressions);return s!==t.expressions?new A(t.span,t.sourceSpan,t.strings,s):t}visitLiteralPrimitive(t,e){return t}visitPropertyRead(t,e){const s=t.receiver.visit(this);return s!==t.receiver?new x(t.span,t.sourceSpan,t.nameSpan,s,t.name):t}visitPropertyWrite(t,e){const s=t.receiver.visit(this),n=t.value.visit(this);return s!==t.receiver||n!==t.value?new g(t.span,t.sourceSpan,t.nameSpan,s,t.name,n):t}visitSafePropertyRead(t,e){const s=t.receiver.visit(this);return s!==t.receiver?new m(t.span,t.sourceSpan,t.nameSpan,s,t.name):t}visitMethodCall(t,e){const s=t.receiver.visit(this),n=this.visitAll(t.args);return s!==t.receiver||n!==t.args?new N(t.span,t.sourceSpan,t.nameSpan,s,t.name,n):t}visitSafeMethodCall(t,e){const s=t.receiver.visit(this),n=this.visitAll(t.args);return s!==t.receiver||n!==t.args?new I(t.span,t.sourceSpan,t.nameSpan,s,t.name,n):t}visitFunctionCall(t,e){const s=t.target&&t.target.visit(this),n=this.visitAll(t.args);return s!==t.target||n!==t.args?new _(t.span,t.sourceSpan,s,n):t}visitLiteralArray(t,e){const s=this.visitAll(t.expressions);return s!==t.expressions?new P(t.span,t.sourceSpan,s):t}visitLiteralMap(t,e){const s=this.visitAll(t.values);return s!==t.values?new E(t.span,t.sourceSpan,t.keys,s):t}visitBinary(t,e){const s=t.left.visit(this),n=t.right.visit(this);return s!==t.left||n!==t.right?new O(t.span,t.sourceSpan,t.operation,s,n):t}visitPrefixNot(t,e){const s=t.expression.visit(this);return s!==t.expression?new b(t.span,t.sourceSpan,s):t}visitNonNullAssert(t,e){const s=t.expression.visit(this);return s!==t.expression?new k(t.span,t.sourceSpan,s):t}visitConditional(t,e){const s=t.condition.visit(this),n=t.trueExp.visit(this),r=t.falseExp.visit(this);return s!==t.condition||n!==t.trueExp||r!==t.falseExp?new v(t.span,t.sourceSpan,s,n,r):t}visitPipe(t,e){const s=t.exp.visit(this),n=this.visitAll(t.args);return s!==t.exp||n!==t.args?new w(t.span,t.sourceSpan,s,t.name,n,t.nameSpan):t}visitKeyedRead(t,e){const s=t.obj.visit(this),n=t.key.visit(this);return s!==t.obj||n!==t.key?new y(t.span,t.sourceSpan,s,n):t}visitKeyedWrite(t,e){const s=t.obj.visit(this),n=t.key.visit(this),r=t.value.visit(this);return s!==t.obj||n!==t.key||r!==t.value?new S(t.span,t.sourceSpan,s,n,r):t}visitAll(t){const e=[];let s=!1;for(let n=0;n<t.length;++n){const r=t[n],i=r.visit(this);e[n]=i,s=s||i!==r}return s?e:t}visitChain(t,e){const s=this.visitAll(t.expressions);return s!==t.expressions?new f(t.span,t.sourceSpan,s):t}visitQuote(t,e){return t}},ParsedProperty:class{constructor(t,e,s,n,i){this.name=t,this.expression=e,this.type=s,this.sourceSpan=n,this.valueSpan=i,this.isLiteral=this.type===r.LITERAL_ATTR,this.isAnimation=this.type===r.ANIMATION}},get ParsedPropertyType(){return r},ParsedEvent:class{constructor(t,e,s,n,r,i){this.name=t,this.targetOrPhase=e,this.type=s,this.handler=n,this.sourceSpan=r,this.handlerSpan=i}},ParsedVariable:class{constructor(t,e,s,n,r){this.name=t,this.value=e,this.sourceSpan=s,this.keySpan=n,this.valueSpan=r}},BoundElementProperty:class{constructor(t,e,s,n,r,i,a){this.name=t,this.type=e,this.securityContext=s,this.value=n,this.unit=r,this.sourceSpan=i,this.valueSpan=a}}});
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
9
|
+
class qe{constructor(e,t,n,r){this.input=t,this.errLocation=n,this.ctxLocation=r,this.message="Parser Error: ".concat(e," ").concat(n," [").concat(t,"] in ").concat(r)}}class ze{constructor(e,t){this.start=e,this.end=t}toAbsolute(e){return new gt(e+this.start,e+this.end)}}class Qe{constructor(e,t){this.span=e,this.sourceSpan=t}visit(e,t=null){return null}toString(){return"AST"}}class Ye extends Qe{constructor(e,t,n){super(e,t),this.nameSpan=n}}class He extends Qe{constructor(e,t,n,r,s){super(e,t),this.prefix=n,this.uninterpretedExpression=r,this.location=s}visit(e,t=null){return e.visitQuote(this,t)}toString(){return"Quote"}}class Je extends Qe{visit(e,t=null){}}class Ze extends Qe{visit(e,t=null){return e.visitImplicitReceiver(this,t)}}class et extends Ze{visit(e,t=null){var n;return null===(n=e.visitThisReceiver)||void 0===n?void 0:n.call(e,this,t)}}class tt extends Qe{constructor(e,t,n){super(e,t),this.expressions=n}visit(e,t=null){return e.visitChain(this,t)}}class nt extends Qe{constructor(e,t,n,r,s){super(e,t),this.condition=n,this.trueExp=r,this.falseExp=s}visit(e,t=null){return e.visitConditional(this,t)}}class rt extends Ye{constructor(e,t,n,r,s){super(e,t,n),this.receiver=r,this.name=s}visit(e,t=null){return e.visitPropertyRead(this,t)}}class st extends Ye{constructor(e,t,n,r,s,i){super(e,t,n),this.receiver=r,this.name=s,this.value=i}visit(e,t=null){return e.visitPropertyWrite(this,t)}}class it extends Ye{constructor(e,t,n,r,s){super(e,t,n),this.receiver=r,this.name=s}visit(e,t=null){return e.visitSafePropertyRead(this,t)}}class ut extends Qe{constructor(e,t,n,r){super(e,t),this.obj=n,this.key=r}visit(e,t=null){return e.visitKeyedRead(this,t)}}class at extends Qe{constructor(e,t,n,r,s){super(e,t),this.obj=n,this.key=r,this.value=s}visit(e,t=null){return e.visitKeyedWrite(this,t)}}class ot extends Ye{constructor(e,t,n,r,s,i){super(e,t,i),this.exp=n,this.name=r,this.args=s}visit(e,t=null){return e.visitPipe(this,t)}}class Dt extends Qe{constructor(e,t,n){super(e,t),this.value=n}visit(e,t=null){return e.visitLiteralPrimitive(this,t)}}class ct extends Qe{constructor(e,t,n){super(e,t),this.expressions=n}visit(e,t=null){return e.visitLiteralArray(this,t)}}class pt extends Qe{constructor(e,t,n,r){super(e,t),this.keys=n,this.values=r}visit(e,t=null){return e.visitLiteralMap(this,t)}}class ht extends Qe{constructor(e,t,n,r){super(e,t),this.strings=n,this.expressions=r}visit(e,t=null){return e.visitInterpolation(this,t)}}class lt extends Qe{constructor(e,t,n,r,s){super(e,t),this.operation=n,this.left=r,this.right=s}visit(e,t=null){return e.visitBinary(this,t)}}class dt extends lt{constructor(e,t,n,r,s,i,u){super(e,t,s,i,u),this.operator=n,this.expr=r}static createMinus(e,t,n){return new dt(e,t,"-",n,"-",new Dt(e,t,0),n)}static createPlus(e,t,n){return new dt(e,t,"+",n,"-",n,new Dt(e,t,0))}visit(e,t=null){return void 0!==e.visitUnary?e.visitUnary(this,t):e.visitBinary(this,t)}}class Et extends Qe{constructor(e,t,n){super(e,t),this.expression=n}visit(e,t=null){return e.visitPrefixNot(this,t)}}class ft extends Qe{constructor(e,t,n){super(e,t),this.expression=n}visit(e,t=null){return e.visitNonNullAssert(this,t)}}class Ct extends Ye{constructor(e,t,n,r,s,i){super(e,t,n),this.receiver=r,this.name=s,this.args=i}visit(e,t=null){return e.visitMethodCall(this,t)}}class Ft extends Ye{constructor(e,t,n,r,s,i){super(e,t,n),this.receiver=r,this.name=s,this.args=i}visit(e,t=null){return e.visitSafeMethodCall(this,t)}}class vt extends Qe{constructor(e,t,n,r){super(e,t),this.target=n,this.args=r}visit(e,t=null){return e.visitFunctionCall(this,t)}}class gt{constructor(e,t){this.start=e,this.end=t}}class mt extends Qe{constructor(e,t,n,r,s){super(new ze(0,null===t?0:t.length),new gt(r,null===t?r:r+t.length)),this.ast=e,this.source=t,this.location=n,this.errors=s}visit(e,t=null){return e.visitASTWithSource?e.visitASTWithSource(this,t):this.ast.visit(e,t)}toString(){return"".concat(this.source," in ").concat(this.location)}}class xt{constructor(e,t,n){this.sourceSpan=e,this.key=t,this.value=n}}class At{constructor(e,t,n){this.sourceSpan=e,this.key=t,this.value=n}}class yt{visit(e,t){e.visit(this,t)}visitUnary(e,t){this.visit(e.expr,t)}visitBinary(e,t){this.visit(e.left,t),this.visit(e.right,t)}visitChain(e,t){this.visitAll(e.expressions,t)}visitConditional(e,t){this.visit(e.condition,t),this.visit(e.trueExp,t),this.visit(e.falseExp,t)}visitPipe(e,t){this.visit(e.exp,t),this.visitAll(e.args,t)}visitFunctionCall(e,t){e.target&&this.visit(e.target,t),this.visitAll(e.args,t)}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){this.visitAll(e.expressions,t)}visitKeyedRead(e,t){this.visit(e.obj,t),this.visit(e.key,t)}visitKeyedWrite(e,t){this.visit(e.obj,t),this.visit(e.key,t),this.visit(e.value,t)}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitLiteralPrimitive(e,t){}visitMethodCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitPrefixNot(e,t){this.visit(e.expression,t)}visitNonNullAssert(e,t){this.visit(e.expression,t)}visitPropertyRead(e,t){this.visit(e.receiver,t)}visitPropertyWrite(e,t){this.visit(e.receiver,t),this.visit(e.value,t)}visitSafePropertyRead(e,t){this.visit(e.receiver,t)}visitSafeMethodCall(e,t){this.visit(e.receiver,t),this.visitAll(e.args,t)}visitQuote(e,t){}visitAll(e,t){for(const n of e)this.visit(n,t)}}!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.LITERAL_ATTR=1]="LITERAL_ATTR",e[e.ANIMATION=2]="ANIMATION"}($e||($e={}));var wt=Object.freeze({__proto__:null,ParserError:qe,ParseSpan:ze,AST:Qe,ASTWithName:Ye,Quote:He,EmptyExpr:Je,ImplicitReceiver:Ze,ThisReceiver:et,Chain:tt,Conditional:nt,PropertyRead:rt,PropertyWrite:st,SafePropertyRead:it,KeyedRead:ut,KeyedWrite:at,BindingPipe:ot,LiteralPrimitive:Dt,LiteralArray:ct,LiteralMap:pt,Interpolation:ht,Binary:lt,Unary:dt,PrefixNot:Et,NonNullAssert:ft,MethodCall:Ct,SafeMethodCall:Ft,FunctionCall:vt,AbsoluteSourceSpan:gt,ASTWithSource:mt,VariableBinding:xt,ExpressionBinding:At,RecursiveAstVisitor:yt,AstTransformer:class{visitImplicitReceiver(e,t){return e}visitThisReceiver(e,t){return e}visitInterpolation(e,t){return new ht(e.span,e.sourceSpan,e.strings,this.visitAll(e.expressions))}visitLiteralPrimitive(e,t){return new Dt(e.span,e.sourceSpan,e.value)}visitPropertyRead(e,t){return new rt(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name)}visitPropertyWrite(e,t){return new st(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,e.value.visit(this))}visitSafePropertyRead(e,t){return new it(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name)}visitMethodCall(e,t){return new Ct(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,this.visitAll(e.args))}visitSafeMethodCall(e,t){return new Ft(e.span,e.sourceSpan,e.nameSpan,e.receiver.visit(this),e.name,this.visitAll(e.args))}visitFunctionCall(e,t){return new vt(e.span,e.sourceSpan,e.target.visit(this),this.visitAll(e.args))}visitLiteralArray(e,t){return new ct(e.span,e.sourceSpan,this.visitAll(e.expressions))}visitLiteralMap(e,t){return new pt(e.span,e.sourceSpan,e.keys,this.visitAll(e.values))}visitUnary(e,t){switch(e.operator){case"+":return dt.createPlus(e.span,e.sourceSpan,e.expr.visit(this));case"-":return dt.createMinus(e.span,e.sourceSpan,e.expr.visit(this));default:throw new Error("Unknown unary operator ".concat(e.operator))}}visitBinary(e,t){return new lt(e.span,e.sourceSpan,e.operation,e.left.visit(this),e.right.visit(this))}visitPrefixNot(e,t){return new Et(e.span,e.sourceSpan,e.expression.visit(this))}visitNonNullAssert(e,t){return new ft(e.span,e.sourceSpan,e.expression.visit(this))}visitConditional(e,t){return new nt(e.span,e.sourceSpan,e.condition.visit(this),e.trueExp.visit(this),e.falseExp.visit(this))}visitPipe(e,t){return new ot(e.span,e.sourceSpan,e.exp.visit(this),e.name,this.visitAll(e.args),e.nameSpan)}visitKeyedRead(e,t){return new ut(e.span,e.sourceSpan,e.obj.visit(this),e.key.visit(this))}visitKeyedWrite(e,t){return new at(e.span,e.sourceSpan,e.obj.visit(this),e.key.visit(this),e.value.visit(this))}visitAll(e){const t=[];for(let n=0;n<e.length;++n)t[n]=e[n].visit(this);return t}visitChain(e,t){return new tt(e.span,e.sourceSpan,this.visitAll(e.expressions))}visitQuote(e,t){return new He(e.span,e.sourceSpan,e.prefix,e.uninterpretedExpression,e.location)}},AstMemoryEfficientTransformer:class{visitImplicitReceiver(e,t){return e}visitThisReceiver(e,t){return e}visitInterpolation(e,t){const n=this.visitAll(e.expressions);return n!==e.expressions?new ht(e.span,e.sourceSpan,e.strings,n):e}visitLiteralPrimitive(e,t){return e}visitPropertyRead(e,t){const n=e.receiver.visit(this);return n!==e.receiver?new rt(e.span,e.sourceSpan,e.nameSpan,n,e.name):e}visitPropertyWrite(e,t){const n=e.receiver.visit(this),r=e.value.visit(this);return n!==e.receiver||r!==e.value?new st(e.span,e.sourceSpan,e.nameSpan,n,e.name,r):e}visitSafePropertyRead(e,t){const n=e.receiver.visit(this);return n!==e.receiver?new it(e.span,e.sourceSpan,e.nameSpan,n,e.name):e}visitMethodCall(e,t){const n=e.receiver.visit(this),r=this.visitAll(e.args);return n!==e.receiver||r!==e.args?new Ct(e.span,e.sourceSpan,e.nameSpan,n,e.name,r):e}visitSafeMethodCall(e,t){const n=e.receiver.visit(this),r=this.visitAll(e.args);return n!==e.receiver||r!==e.args?new Ft(e.span,e.sourceSpan,e.nameSpan,n,e.name,r):e}visitFunctionCall(e,t){const n=e.target&&e.target.visit(this),r=this.visitAll(e.args);return n!==e.target||r!==e.args?new vt(e.span,e.sourceSpan,n,r):e}visitLiteralArray(e,t){const n=this.visitAll(e.expressions);return n!==e.expressions?new ct(e.span,e.sourceSpan,n):e}visitLiteralMap(e,t){const n=this.visitAll(e.values);return n!==e.values?new pt(e.span,e.sourceSpan,e.keys,n):e}visitUnary(e,t){const n=e.expr.visit(this);if(n!==e.expr)switch(e.operator){case"+":return dt.createPlus(e.span,e.sourceSpan,n);case"-":return dt.createMinus(e.span,e.sourceSpan,n);default:throw new Error("Unknown unary operator ".concat(e.operator))}return e}visitBinary(e,t){const n=e.left.visit(this),r=e.right.visit(this);return n!==e.left||r!==e.right?new lt(e.span,e.sourceSpan,e.operation,n,r):e}visitPrefixNot(e,t){const n=e.expression.visit(this);return n!==e.expression?new Et(e.span,e.sourceSpan,n):e}visitNonNullAssert(e,t){const n=e.expression.visit(this);return n!==e.expression?new ft(e.span,e.sourceSpan,n):e}visitConditional(e,t){const n=e.condition.visit(this),r=e.trueExp.visit(this),s=e.falseExp.visit(this);return n!==e.condition||r!==e.trueExp||s!==e.falseExp?new nt(e.span,e.sourceSpan,n,r,s):e}visitPipe(e,t){const n=e.exp.visit(this),r=this.visitAll(e.args);return n!==e.exp||r!==e.args?new ot(e.span,e.sourceSpan,n,e.name,r,e.nameSpan):e}visitKeyedRead(e,t){const n=e.obj.visit(this),r=e.key.visit(this);return n!==e.obj||r!==e.key?new ut(e.span,e.sourceSpan,n,r):e}visitKeyedWrite(e,t){const n=e.obj.visit(this),r=e.key.visit(this),s=e.value.visit(this);return n!==e.obj||r!==e.key||s!==e.value?new at(e.span,e.sourceSpan,n,r,s):e}visitAll(e){const t=[];let n=!1;for(let r=0;r<e.length;++r){const s=e[r],i=s.visit(this);t[r]=i,n=n||i!==s}return n?t:e}visitChain(e,t){const n=this.visitAll(e.expressions);return n!==e.expressions?new tt(e.span,e.sourceSpan,n):e}visitQuote(e,t){return e}},ParsedProperty:class{constructor(e,t,n,r,s,i){this.name=e,this.expression=t,this.type=n,this.sourceSpan=r,this.keySpan=s,this.valueSpan=i,this.isLiteral=this.type===$e.LITERAL_ATTR,this.isAnimation=this.type===$e.ANIMATION}},get ParsedPropertyType(){return $e},ParsedEvent:class{constructor(e,t,n,r,s,i,u){this.name=e,this.targetOrPhase=t,this.type=n,this.handler=r,this.sourceSpan=s,this.handlerSpan=i,this.keySpan=u}},ParsedVariable:class{constructor(e,t,n,r,s){this.name=e,this.value=t,this.sourceSpan=n,this.keySpan=r,this.valueSpan=s}},BoundElementProperty:class{constructor(e,t,n,r,s,i,u,a){this.name=e,this.type=t,this.securityContext=n,this.value=r,this.unit=s,this.sourceSpan=i,this.keySpan=u,this.valueSpan=a}}});
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13
|
+
*
|
|
14
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
15
|
+
* found in the LICENSE file at https://angular.io/license
|
|
16
|
+
*/const St=41,It=125;function Nt(e){return 48<=e&&e<=57}
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright Google LLC All Rights Reserved.
|
|
20
|
+
*
|
|
21
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
22
|
+
* found in the LICENSE file at https://angular.io/license
|
|
23
|
+
*/
|
|
24
|
+
var Bt;!function(e){e[e.Character=0]="Character",e[e.Identifier=1]="Identifier",e[e.Keyword=2]="Keyword",e[e.String=3]="String",e[e.Operator=4]="Operator",e[e.Number=5]="Number",e[e.Error=6]="Error"}(Bt||(Bt={}));const Ot=["var","let","as","null","undefined","true","false","if","else","this"];class Pt{constructor(e,t,n,r,s){this.index=e,this.end=t,this.type=n,this.numValue=r,this.strValue=s}isCharacter(e){return this.type==Bt.Character&&this.numValue==e}isNumber(){return this.type==Bt.Number}isString(){return this.type==Bt.String}isOperator(e){return this.type==Bt.Operator&&this.strValue==e}isIdentifier(){return this.type==Bt.Identifier}isKeyword(){return this.type==Bt.Keyword}isKeywordLet(){return this.type==Bt.Keyword&&"let"==this.strValue}isKeywordAs(){return this.type==Bt.Keyword&&"as"==this.strValue}isKeywordNull(){return this.type==Bt.Keyword&&"null"==this.strValue}isKeywordUndefined(){return this.type==Bt.Keyword&&"undefined"==this.strValue}isKeywordTrue(){return this.type==Bt.Keyword&&"true"==this.strValue}isKeywordFalse(){return this.type==Bt.Keyword&&"false"==this.strValue}isKeywordThis(){return this.type==Bt.Keyword&&"this"==this.strValue}isError(){return this.type==Bt.Error}toNumber(){return this.type==Bt.Number?this.numValue:-1}toString(){switch(this.type){case Bt.Character:case Bt.Identifier:case Bt.Keyword:case Bt.Operator:case Bt.String:case Bt.Error:return this.strValue;case Bt.Number:return this.numValue.toString();default:return null}}}function bt(e,t,n){return new Pt(e,t,Bt.Character,n,String.fromCharCode(n))}function Tt(e,t,n){return new Pt(e,t,Bt.Operator,0,n)}const Lt=new Pt(-1,-1,Bt.Character,0,"");class Rt{constructor(e){this.input=e,this.peek=0,this.index=-1,this.length=e.length,this.advance()}advance(){this.peek=++this.index>=this.length?0:this.input.charCodeAt(this.index)}scanToken(){const e=this.input,t=this.length;let n=this.peek,r=this.index;for(;n<=32;){if(++r>=t){n=0;break}n=e.charCodeAt(r)}if(this.peek=n,this.index=r,r>=t)return null;if(kt(n))return this.scanIdentifier();if(Nt(n))return this.scanNumber(r);const s=r;switch(n){case 46:return this.advance(),Nt(this.peek)?this.scanNumber(s):bt(s,this.index,46);case 40:case St:case 123:case It:case 91:case 93:case 44:case 58:case 59:return this.scanCharacter(s,n);case 39:case 34:return this.scanString();case 35:case 43:case 45:case 42:case 47:case 37:case 94:return this.scanOperator(s,String.fromCharCode(n));case 63:return this.scanComplexOperator(s,"?",46,".");case 60:case 62:return this.scanComplexOperator(s,String.fromCharCode(n),61,"=");case 33:case 61:return this.scanComplexOperator(s,String.fromCharCode(n),61,"=",61,"=");case 38:return this.scanComplexOperator(s,"&",38,"&");case 124:return this.scanComplexOperator(s,"|",124,"|");case 160:for(;(i=this.peek)>=9&&i<=32||160==i;)this.advance();return this.scanToken()}var i;return this.advance(),this.error("Unexpected character [".concat(String.fromCharCode(n),"]"),0)}scanCharacter(e,t){return this.advance(),bt(e,this.index,t)}scanOperator(e,t){return this.advance(),Tt(e,this.index,t)}scanComplexOperator(e,t,n,r,s,i){this.advance();let u=t;return this.peek==n&&(this.advance(),u+=r),null!=s&&this.peek==s&&(this.advance(),u+=i),Tt(e,this.index,u)}scanIdentifier(){const e=this.index;for(this.advance();_t(this.peek);)this.advance();const t=this.input.substring(e,this.index);return Ot.indexOf(t)>-1?(n=e,r=this.index,s=t,new Pt(n,r,Bt.Keyword,0,s)):function(e,t,n){return new Pt(e,t,Bt.Identifier,0,n)}(e,this.index,t);var n,r,s}scanNumber(e){let t=this.index===e;for(this.advance();;){if(Nt(this.peek));else if(46==this.peek)t=!1;else{if(101!=(n=this.peek)&&69!=n)break;if(this.advance(),Gt(this.peek)&&this.advance(),!Nt(this.peek))return this.error("Invalid exponent",-1);t=!1}this.advance()}var n;const r=this.input.substring(e,this.index),s=t?function(e){const t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}(r):parseFloat(r);return i=e,u=this.index,a=s,new Pt(i,u,Bt.Number,a,"");var i,u,a}scanString(){const e=this.index,t=this.peek;this.advance();let n="",r=this.index;const s=this.input;for(;this.peek!=t;)if(92==this.peek){let e;if(n+=s.substring(r,this.index),this.advance(),this.peek=this.peek,117==this.peek){const t=s.substring(this.index+1,this.index+5);if(!/^[0-9a-f]+$/i.test(t))return this.error("Invalid unicode escape [\\u".concat(t,"]"),0);e=parseInt(t,16);for(let e=0;e<5;e++)this.advance()}else e=Kt(this.peek),this.advance();n+=String.fromCharCode(e),r=this.index}else{if(0==this.peek)return this.error("Unterminated quote",0);this.advance()}const i=s.substring(r,this.index);return this.advance(),u=e,a=this.index,o=n+i,new Pt(u,a,Bt.String,0,o);var u,a,o}error(e,t){const n=this.index+t;return function(e,t,n){return new Pt(e,t,Bt.Error,0,n)}(n,this.index,"Lexer Error: ".concat(e," at column ").concat(n," in expression [").concat(this.input,"]"))}}function kt(e){return 97<=e&&e<=122||65<=e&&e<=90||95==e||36==e}function Mt(e){if(0==e.length)return!1;const t=new Rt(e);if(!kt(t.peek))return!1;for(t.advance();0!==t.peek;){if(!_t(t.peek))return!1;t.advance()}return!0}function _t(e){return function(e){return e>=97&&e<=122||e>=65&&e<=90}(e)||Nt(e)||95==e||36==e}function Gt(e){return 45==e||43==e}function jt(e){return 39===e||34===e||96===e}function Kt(e){switch(e){case 110:return 10;case 102:return 12;case 114:return 13;case 116:return 9;case 118:return 11;default:return e}}var Ut=Object.freeze({__proto__:null,get TokenType(){return Bt},Lexer:class{tokenize(e){const t=new Rt(e),n=[];let r=t.scanToken();for(;null!=r;)n.push(r),r=t.scanToken();return n}},Token:Pt,EOF:Lt,isIdentifier:Mt,isQuote:jt});
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright Google LLC All Rights Reserved.
|
|
28
|
+
*
|
|
29
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
30
|
+
* found in the LICENSE file at https://angular.io/license
|
|
31
|
+
*/const $t=[/^\s*$/,/[<>]/,/^[{}]$/,/&(#|[a-z])/i,/^\/\//];
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class
|
|
33
|
+
* @license
|
|
34
|
+
* Copyright Google LLC All Rights Reserved.
|
|
35
|
+
*
|
|
36
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
37
|
+
* found in the LICENSE file at https://angular.io/license
|
|
38
|
+
*/
|
|
39
|
+
class Wt{constructor(e,t){this.start=e,this.end=t}static fromArray(e){return e?(function(e,t){if(!(null==t||Array.isArray(t)&&2==t.length))throw new Error("Expected '".concat(e,"' to be an array, [start, end]."));if(null!=t){const e=t[0],n=t[1];$t.forEach((t=>{if(t.test(e)||t.test(n))throw new Error("['".concat(e,"', '").concat(n,"'] contains unusable interpolation symbol."))}))}}("interpolation",e),new Wt(e[0],e[1])):Vt}}const Vt=new Wt("{{","}}");
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*/class nt{constructor(t,e,s){this.strings=t,this.expressions=e,this.offsets=s}}class rt{constructor(t,e,s){this.templateBindings=t,this.warnings=e,this.errors=s}}const it=ot(et);function at(t){return t===et?it:ot(t)}function ot(t){const e=st(t.start)+"([\\s\\S]*?)"+st(t.end);return new RegExp(e,"g")}class ct{constructor(t){this._lexer=t,this.errors=[],this.simpleExpressionChecker=pt}parseAction(t,e,s,n=et){this._checkNoInterpolation(t,e,n);const r=this._stripComments(t),i=this._lexer.tokenize(this._stripComments(t)),a=new ht(t,e,s,i,r.length,!0,this.errors,t.length-r.length).parseChain();return new K(a,t,e,s,this.errors)}parseBinding(t,e,s,n=et){const r=this._parseBindingAst(t,e,s,n);return new K(r,t,e,s,this.errors)}checkSimpleExpression(t){const e=new this.simpleExpressionChecker;return t.visit(e),e.errors}parseSimpleBinding(t,e,s,n=et){const r=this._parseBindingAst(t,e,s,n),i=this.checkSimpleExpression(r);return i.length>0&&this._reportError("Host binding expression cannot contain ".concat(i.join(" ")),t,e),new K(r,t,e,s,this.errors)}_reportError(t,e,s,n){this.errors.push(new o(t,e,s,n))}_parseBindingAst(t,e,s,n){const r=this._parseQuote(t,e,s);if(null!=r)return r;this._checkNoInterpolation(t,e,n);const i=this._stripComments(t),a=this._lexer.tokenize(i);return new ht(t,e,s,a,i.length,!1,this.errors,t.length-i.length).parseChain()}_parseQuote(t,e,s){if(null==t)return null;const n=t.indexOf(":");if(-1==n)return null;const r=t.substring(0,n).trim();if(!q(r))return null;const i=t.substring(n+1),a=new c(0,t.length);return new u(a,a.toAbsolute(s),r,i,e)}parseTemplateBindings(t,e,s,n,r){const i=this._lexer.tokenize(e);return new ht(e,s,r,i,e.length,!1,this.errors,0).parseTemplateBindings({source:t,span:new L(n,n+t.length)})}parseInterpolation(t,e,s,n=et){const r=this.splitInterpolation(t,e,n);if(null==r)return null;const i=[];for(let n=0;n<r.expressions.length;++n){const a=r.expressions[n],o=this._stripComments(a),c=this._lexer.tokenize(o),h=new ht(t,e,s,c,o.length,!1,this.errors,r.offsets[n]+(a.length-o.length)).parseChain();i.push(h)}const a=new c(0,null==t?0:t.length);return new K(new A(a,a.toAbsolute(s),r.strings,i),t,e,s,this.errors)}splitInterpolation(t,e,s=et){const n=at(s),r=t.split(n);if(r.length<=1)return null;const i=[],a=[],o=[];let c=0;for(let n=0;n<r.length;n++){const h=r[n];n%2==0?(i.push(h),c+=h.length):h.trim().length>0?(c+=s.start.length,a.push(h),o.push(c),c+=h.length+s.end.length):(this._reportError("Blank expressions are not allowed in interpolated strings",t,"at column ".concat(this._findInterpolationErrorColumn(r,n,s)," in"),e),a.push("$implicit"),o.push(c))}return new nt(i,a,o)}wrapLiteralPrimitive(t,e,s){const n=new c(0,null==t?0:t.length);return new K(new C(n,n.toAbsolute(s),t),t,e,s,this.errors)}_stripComments(t){const e=this._commentStart(t);return null!=e?t.substring(0,e).trim():t}_commentStart(t){let e=null;for(let s=0;s<t.length-1;s++){const n=t.charCodeAt(s),r=t.charCodeAt(s+1);if(47===n&&47==r&&null==e)return s;e===n?e=null:null==e&&J(n)&&(e=n)}return null}_checkNoInterpolation(t,e,s){const n=at(s),r=t.split(n);r.length>1&&this._reportError("Got interpolation (".concat(s.start).concat(s.end,") where expression was expected"),t,"at column ".concat(this._findInterpolationErrorColumn(r,1,s)," in"),e)}_findInterpolationErrorColumn(t,e,s){let n="";for(let r=0;r<e;r++)n+=r%2==0?t[r]:"".concat(s.start).concat(t[r]).concat(s.end);return n.length}}class ht{constructor(t,e,s,n,r,i,a,o){this.input=t,this.location=e,this.absoluteOffset=s,this.tokens=n,this.inputLength=r,this.parseAction=i,this.errors=a,this.offset=o,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.sourceSpanCache=new Map,this.index=0}peek(t){const e=this.index+t;return e<this.tokens.length?this.tokens[e]:Q}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){if(this.index>0){return this.peek(-1).end+this.offset}return 0===this.tokens.length?this.inputLength+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(t){return new c(t,this.currentEndIndex)}sourceSpan(t){const e="".concat(t,"@").concat(this.inputIndex);return this.sourceSpanCache.has(e)||this.sourceSpanCache.set(e,this.span(t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(e)}advance(){this.index++}consumeOptionalCharacter(t){return!!this.next.isCharacter(t)&&(this.advance(),!0)}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(t){this.consumeOptionalCharacter(t)||this.error("Missing expected ".concat(String.fromCharCode(t)))}consumeOptionalOperator(t){return!!this.next.isOperator(t)&&(this.advance(),!0)}expectOperator(t){this.consumeOptionalOperator(t)||this.error("Missing expected operator ".concat(t))}expectIdentifierOrKeyword(){const t=this.next;return t.isIdentifier()||t.isKeyword()?(this.advance(),t.toString()):(this.error("Unexpected token ".concat(t,", expected identifier or keyword")),"")}expectIdentifierOrKeywordOrString(){const t=this.next;return t.isIdentifier()||t.isKeyword()||t.isString()?(this.advance(),t.toString()):(this.error("Unexpected token ".concat(t,", expected identifier, keyword, or string")),"")}parseChain(){const t=[],e=this.inputIndex;for(;this.index<this.tokens.length;){const e=this.parsePipe();if(t.push(e),this.consumeOptionalCharacter(59))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else this.index<this.tokens.length&&this.error("Unexpected token '".concat(this.next,"'"))}return 0==t.length?new l(this.span(e),this.sourceSpan(e)):1==t.length?t[0]:new f(this.span(e),this.sourceSpan(e),t)}parsePipe(){let t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{const e=this.inputIndex,s=this.expectIdentifierOrKeyword(),n=this.sourceSpan(e),r=[];for(;this.consumeOptionalCharacter(58);)r.push(this.parseExpression());const{start:i}=t.span;t=new w(this.span(i),this.sourceSpan(i),t,s,r,n)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){const t=this.inputIndex,e=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){const s=this.parsePipe();let n;if(this.consumeOptionalCharacter(58))n=this.parsePipe();else{const e=this.inputIndex,s=this.input.substring(t,e);this.error("Conditional expression ".concat(s," requires all 3 expressions")),n=new l(this.span(t),this.sourceSpan(t))}return new v(this.span(t),this.sourceSpan(t),e,s,n)}return e}parseLogicalOr(){let t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){const e=this.parseLogicalAnd(),{start:s}=t.span;t=new O(this.span(s),this.sourceSpan(s),"||",t,e)}return t}parseLogicalAnd(){let t=this.parseEquality();for(;this.consumeOptionalOperator("&&");){const e=this.parseEquality(),{start:s}=t.span;t=new O(this.span(s),this.sourceSpan(s),"&&",t,e)}return t}parseEquality(){let t=this.parseRelational();for(;this.next.type==F.Operator;){const e=this.next.strValue;switch(e){case"==":case"===":case"!=":case"!==":this.advance();const s=this.parseRelational(),{start:n}=t.span;t=new O(this.span(n),this.sourceSpan(n),e,t,s);continue}break}return t}parseRelational(){let t=this.parseAdditive();for(;this.next.type==F.Operator;){const e=this.next.strValue;switch(e){case"<":case">":case"<=":case">=":this.advance();const s=this.parseAdditive(),{start:n}=t.span;t=new O(this.span(n),this.sourceSpan(n),e,t,s);continue}break}return t}parseAdditive(){let t=this.parseMultiplicative();for(;this.next.type==F.Operator;){const e=this.next.strValue;switch(e){case"+":case"-":this.advance();let s=this.parseMultiplicative();const{start:n}=t.span;t=new O(this.span(n),this.sourceSpan(n),e,t,s);continue}break}return t}parseMultiplicative(){let t=this.parsePrefix();for(;this.next.type==F.Operator;){const e=this.next.strValue;switch(e){case"*":case"%":case"/":this.advance();let s=this.parsePrefix();const{start:n}=t.span;t=new O(this.span(n),this.sourceSpan(n),e,t,s);continue}break}return t}parsePrefix(){if(this.next.type==F.Operator){const t=this.inputIndex,e=this.next.strValue,s=new c(t,t),n=s.toAbsolute(this.absoluteOffset);let r;switch(e){case"+":return this.advance(),r=this.parsePrefix(),new O(this.span(t),this.sourceSpan(t),"-",r,new C(s,n,0));case"-":return this.advance(),r=this.parsePrefix(),new O(this.span(t),this.sourceSpan(t),e,new C(s,n,0),r);case"!":return this.advance(),r=this.parsePrefix(),new b(this.span(t),this.sourceSpan(t),r)}}return this.parseCallChain()}parseCallChain(){let t=this.parsePrimary();const e=t.span.start;for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMemberOrMethodCall(t,!1);else if(this.consumeOptionalOperator("?."))t=this.parseAccessMemberOrMethodCall(t,!0);else if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;const s=this.parsePipe();if(this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("=")){const n=this.parseConditional();t=new S(this.span(e),this.sourceSpan(e),t,s,n)}else t=new y(this.span(e),this.sourceSpan(e),t,s)}else if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const s=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(41),t=new _(this.span(e),this.sourceSpan(e),t,s)}else{if(!this.consumeOptionalOperator("!"))return t;t=new k(this.span(e),this.sourceSpan(e),t)}}parsePrimary(){const t=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const t=this.parsePipe();return this.rparensExpected--,this.expectCharacter(41),t}if(this.next.isKeywordNull())return this.advance(),new C(this.span(t),this.sourceSpan(t),null);if(this.next.isKeywordUndefined())return this.advance(),new C(this.span(t),this.sourceSpan(t),void 0);if(this.next.isKeywordTrue())return this.advance(),new C(this.span(t),this.sourceSpan(t),!0);if(this.next.isKeywordFalse())return this.advance(),new C(this.span(t),this.sourceSpan(t),!1);if(this.next.isKeywordThis())return this.advance(),new d(this.span(t),this.sourceSpan(t));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;const e=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new P(this.span(t),this.sourceSpan(t),e)}if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new d(this.span(t),this.sourceSpan(t)),!1);if(this.next.isNumber()){const e=this.next.toNumber();return this.advance(),new C(this.span(t),this.sourceSpan(t),e)}if(this.next.isString()){const e=this.next.toString();return this.advance(),new C(this.span(t),this.sourceSpan(t),e)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: ".concat(this.input)),new l(this.span(t),this.sourceSpan(t))):(this.error("Unexpected token ".concat(this.next)),new l(this.span(t),this.sourceSpan(t)))}parseExpressionList(t){const e=[];if(!this.next.isCharacter(t))do{e.push(this.parsePipe())}while(this.consumeOptionalCharacter(44));return e}parseLiteralMap(){const t=[],e=[],s=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(125)){this.rbracesExpected++;do{const s=this.next.isString(),n=this.expectIdentifierOrKeywordOrString();t.push({key:n,quoted:s}),this.expectCharacter(58),e.push(this.parsePipe())}while(this.consumeOptionalCharacter(44));this.rbracesExpected--,this.expectCharacter(125)}return new E(this.span(s),this.sourceSpan(s),t,e)}parseAccessMemberOrMethodCall(t,e=!1){const s=t.span.start,n=this.inputIndex,r=this.expectIdentifierOrKeyword(),i=this.sourceSpan(n);if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const n=this.parseCallArguments();this.expectCharacter(41),this.rparensExpected--;const a=this.span(s),o=this.sourceSpan(s);return e?new I(a,o,i,t,r,n):new N(a,o,i,t,r,n)}if(e)return this.consumeOptionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new l(this.span(s),this.sourceSpan(s))):new m(this.span(s),this.sourceSpan(s),i,t,r);if(this.consumeOptionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new l(this.span(s),this.sourceSpan(s));const e=this.parseConditional();return new g(this.span(s),this.sourceSpan(s),i,t,r,e)}return new x(this.span(s),this.sourceSpan(s),i,t,r)}parseCallArguments(){if(this.next.isCharacter(41))return[];const t=[];do{t.push(this.parsePipe())}while(this.consumeOptionalCharacter(44));return t}expectTemplateBindingKey(){let t="",e=!1;const s=this.currentAbsoluteOffset;do{t+=this.expectIdentifierOrKeywordOrString(),e=this.consumeOptionalOperator("-"),e&&(t+="-")}while(e);return{source:t,span:new L(s,s+t.length)}}parseTemplateBindings(t){const e=[];for(e.push(...this.parseDirectiveKeywordBindings(t));this.index<this.tokens.length;){const s=this.parseLetBinding();if(s)e.push(s);else{const s=this.expectTemplateBindingKey(),n=this.parseAsBinding(s);n?e.push(n):(s.source=t.source+s.source[0].toUpperCase()+s.source.substring(1),e.push(...this.parseDirectiveKeywordBindings(s)))}this.consumeStatementTerminator()}return new rt(e,[],this.errors)}parseDirectiveKeywordBindings(t){const e=[];this.consumeOptionalCharacter(58);const s=this.getDirectiveBoundTarget();let n=this.currentAbsoluteOffset;const r=this.parseAsBinding(t);r||(this.consumeStatementTerminator(),n=this.currentAbsoluteOffset);const i=new L(t.span.start,n);return e.push(new T(i,t,s)),r&&e.push(r),e}getDirectiveBoundTarget(){if(this.next===Q||this.peekKeywordAs()||this.peekKeywordLet())return null;const t=this.parsePipe(),{start:e,end:s}=t.span,n=this.input.substring(e,s);return new K(t,n,this.location,this.absoluteOffset+e,this.errors)}parseAsBinding(t){if(!this.peekKeywordAs())return null;this.advance();const e=this.expectTemplateBindingKey();this.consumeStatementTerminator();const s=new L(t.span.start,this.currentAbsoluteOffset);return new M(s,e,t)}parseLetBinding(){if(!this.peekKeywordLet())return null;const t=this.currentAbsoluteOffset;this.advance();const e=this.expectTemplateBindingKey();let s=null;this.consumeOptionalOperator("=")&&(s=this.expectTemplateBindingKey()),this.consumeStatementTerminator();const n=new L(t,this.currentAbsoluteOffset);return new M(n,e,s)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(t,e=null){this.errors.push(new o(t,this.input,this.locationText(e),this.location)),this.skip()}locationText(t=null){return null==t&&(t=this.index),t<this.tokens.length?"at column ".concat(this.tokens[t].index+1," in"):"at the end of the expression"}skip(){let t=this.next;for(;this.index<this.tokens.length&&!t.isCharacter(59)&&(this.rparensExpected<=0||!t.isCharacter(41))&&(this.rbracesExpected<=0||!t.isCharacter(125))&&(this.rbracketsExpected<=0||!t.isCharacter(93));)this.next.isError()&&this.errors.push(new o(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),t=this.next}}class pt{constructor(){this.errors=[]}visitImplicitReceiver(t,e){}visitInterpolation(t,e){}visitLiteralPrimitive(t,e){}visitPropertyRead(t,e){}visitPropertyWrite(t,e){}visitSafePropertyRead(t,e){}visitMethodCall(t,e){}visitSafeMethodCall(t,e){}visitFunctionCall(t,e){}visitLiteralArray(t,e){this.visitAll(t.expressions,e)}visitLiteralMap(t,e){this.visitAll(t.values,e)}visitBinary(t,e){}visitPrefixNot(t,e){}visitNonNullAssert(t,e){}visitConditional(t,e){}visitPipe(t,e){this.errors.push("pipes")}visitKeyedRead(t,e){}visitKeyedWrite(t,e){}visitAll(t,e){return t.map(t=>t.visit(this,e))}visitChain(t,e){}visitQuote(t,e){}}class ut extends B{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}}var lt=Object.freeze({__proto__:null,SplitInterpolation:nt,TemplateBindingParseResult:rt,Parser:ct,IvyParser:class extends ct{constructor(){super(...arguments),this.simpleExpressionChecker=ut}},_ParseAST:ht}),dt=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX="NgEstreeParser";const s=["angular-estree-parser",0];function n(){return new lt.Parser(new Y.Lexer)}function r(t,e){const s=n(),{astInput:r,comments:o}=a(t,s),{ast:c,errors:h}=e(r,s);return i(h),{ast:c,comments:o}}function i(t){if(0!==t.length){const[{message:e}]=t;throw new SyntaxError(e.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function a(t,e){const s=e._commentStart(t);return null===s?{astInput:t,comments:[]}:{astInput:t.slice(0,s),comments:[{type:"Comment",value:t.slice(s+"//".length),span:{start:s,end:t.length}}]}}function o({start:t,end:e},s){let n=t,r=e;for(;r!==n&&/\s/.test(s[r-1]);)r--;for(;n!==r&&/\s/.test(s[n]);)n++;return{start:n,end:r}}function c({start:t,end:e},s){let n=t,r=e;for(;r!==s.length&&/\s/.test(s[r]);)r++;for(;0!==n&&/\s/.test(s[n-1]);)n--;return{start:n,end:r}}function h(t,e){return"("===e[t.start-1]&&")"===e[t.end]?{start:t.start-1,end:t.end+1}:t}e.parseNgBinding=function(t){return r(t,(t,e)=>e.parseBinding(t,...s))},e.parseNgSimpleBinding=function(t){return r(t,(t,e)=>e.parseSimpleBinding(t,...s))},e.parseNgAction=function(t){return r(t,(t,e)=>e.parseAction(t,...s))},e.parseNgTemplateBindings=function(t){const s=n(),{templateBindings:r,errors:a}=s.parseTemplateBindings(e.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX,t,"angular-estree-parser",0,0);return i(a),r},e.parseNgInterpolation=function(t){const e=n(),{astInput:r,comments:o}=a(t,e),{ast:c,errors:h}=e.parseInterpolation("{{"+r+"}}",...s);i(h);const p=c.expressions[0];return function t(e,s){if(!e||"object"!=typeof e)return;if(Array.isArray(e))return e.forEach(e=>t(e,s));for(const n of Object.keys(e)){const r=e[n];"span"===n?s(r):t(r,s)}}(p,t=>{t.start-="{{".length,t.end-="{{".length}),{ast:p,comments:o}},e.getNgType=function(t){return t instanceof R.Binary?"Binary":t instanceof R.BindingPipe?"BindingPipe":t instanceof R.Chain?"Chain":t instanceof R.Conditional?"Conditional":t instanceof R.EmptyExpr?"EmptyExpr":t instanceof R.FunctionCall?"FunctionCall":t instanceof R.ImplicitReceiver?"ImplicitReceiver":t instanceof R.KeyedRead?"KeyedRead":t instanceof R.KeyedWrite?"KeyedWrite":t instanceof R.LiteralArray?"LiteralArray":t instanceof R.LiteralMap?"LiteralMap":t instanceof R.LiteralPrimitive?"LiteralPrimitive":t instanceof R.MethodCall?"MethodCall":t instanceof R.NonNullAssert?"NonNullAssert":t instanceof R.PrefixNot?"PrefixNot":t instanceof R.PropertyRead?"PropertyRead":t instanceof R.PropertyWrite?"PropertyWrite":t instanceof R.Quote?"Quote":t instanceof R.SafeMethodCall?"SafeMethodCall":t instanceof R.SafePropertyRead?"SafePropertyRead":t.type},e.fitSpans=function(t,e,s){let n=0;const r={start:t.start,end:t.end};for(;;){const t=c(r,e),s=h(t,e);if(t.start===s.start&&t.end===s.end)break;r.start=s.start,r.end=s.end,n++}return{hasParens:0!==(s?n-1:n),outerSpan:o(s?{start:r.start+1,end:r.end-1}:r,e),innerSpan:o(t,e)}},e.findFrontChar=function(t,e,s){let n=e;for(;!t.test(s[n]);)if(--n<0)throw new Error("Cannot find front char ".concat(t," from index ").concat(e," in ").concat(JSON.stringify(s)));return n},e.findBackChar=function(t,e,s){let n=e;for(;!t.test(s[n]);)if(++n>=s.length)throw new Error("Cannot find back char ".concat(t," from index ").concat(e," in ").concat(JSON.stringify(s)));return n},e.toLowerCamelCase=function(t){return t.slice(0,1).toLowerCase()+t.slice(1)},e.getLast=function(t){return 0===t.length?void 0:t[t.length-1]}})),ft=n((function(t,e){function s(t,e,s=!1,n=!1){if(!s){const{start:s,end:n}=t;return{start:s,end:n,loc:{start:e.locator.locationForIndex(s),end:e.locator.locationForIndex(n)}}}const{outerSpan:r,innerSpan:i,hasParens:a}=dt.fitSpans(t,e.text,n);return Object.assign({start:i.start,end:i.end,loc:{start:e.locator.locationForIndex(i.start),end:e.locator.locationForIndex(i.end)}},a&&{extra:{parenthesized:!0,parenStart:r.start,parenEnd:r.end}})}Object.defineProperty(e,"__esModule",{value:!0}),e.transform=(t,n,r=!1)=>{const i=dt.getNgType(t);switch(i){case"Binary":{const{left:e,operation:s,right:n}=t,i=n.span.start===n.span.end,o=e.span.start===e.span.end;if(i||o){const s=e.span.start===e.span.end?a(n):a(e);return c("UnaryExpression",{prefix:!0,argument:s,operator:i?"+":"-"},{start:t.span.start,end:x(s)},{hasParentParens:r})}const h=a(e),p=a(n);return c("&&"===s||"||"===s?"LogicalExpression":"BinaryExpression",{left:h,right:p,operator:s},{start:v(h),end:x(p)},{hasParentParens:r})}case"BindingPipe":{const{exp:e,name:s,args:n}=t,i=a(e),o=u(/\S/,u(/\|/,x(i))+1),h=c("Identifier",{name:s},{start:o,end:o+s.length}),p=n.map(a);return c("NGPipeExpression",{left:i,right:h,arguments:p},{start:v(i),end:x(0===p.length?h:dt.getLast(p))},{hasParentParens:r})}case"Chain":{const{expressions:e}=t;return c("NGChainedExpression",{expressions:e.map(a)},t.span,{hasParentParens:r})}case"Comment":{const{value:e}=t;return c("CommentLine",{value:e},t.span,{processSpan:!1})}case"Conditional":{const{condition:e,trueExp:s,falseExp:n}=t,i=a(e),o=a(s),h=a(n);return c("ConditionalExpression",{test:i,consequent:o,alternate:h},{start:v(i),end:x(h)},{hasParentParens:r})}case"EmptyExpr":return c("NGEmptyExpression",{},t.span,{hasParentParens:r});case"FunctionCall":{const{target:e,args:s}=t,n=1===s.length?[o(s[0])]:s.map(a),i=a(e);return c("CallExpression",{callee:i,arguments:n},{start:v(i),end:t.span.end},{hasParentParens:r})}case"ImplicitReceiver":return c("ThisExpression",{},t.span,{hasParentParens:r});case"KeyedRead":{const{obj:e,key:s}=t;return h(e,a(s),{computed:!0,optional:!1},{end:t.span.end,hasParentParens:r})}case"LiteralArray":{const{expressions:e}=t;return c("ArrayExpression",{elements:e.map(a)},t.span,{hasParentParens:r})}case"LiteralMap":{const{keys:e,values:s}=t,n=s.map(t=>a(t)),i=e.map(({key:e,quoted:s},r)=>{const i=n[r],a={start:u(/\S/,0===r?t.span.start+1:u(/,/,x(n[r-1]))+1),end:p(/\S/,p(/:/,v(i)-1)-1)+1},o=s?c("StringLiteral",{value:e},a):c("Identifier",{name:e},a);return c("ObjectProperty",{key:o,value:i,method:!1,shorthand:!1,computed:!1},{start:v(o),end:x(i)})});return c("ObjectExpression",{properties:i},t.span,{hasParentParens:r})}case"LiteralPrimitive":{const{value:e}=t;switch(typeof e){case"boolean":return c("BooleanLiteral",{value:e},t.span,{hasParentParens:r});case"number":return c("NumericLiteral",{value:e},t.span,{hasParentParens:r});case"object":return c("NullLiteral",{},t.span,{hasParentParens:r});case"string":return c("StringLiteral",{value:e},t.span,{hasParentParens:r});case"undefined":return c("Identifier",{name:"undefined"},t.span,{hasParentParens:r});default:throw new Error("Unexpected LiteralPrimitive value type ".concat(typeof e))}}case"MethodCall":case"SafeMethodCall":{const e="SafeMethodCall"===i,{receiver:s,name:n,args:u}=t,l=1===u.length?[o(u[0])]:u.map(a),f=p(/\S/,p(/\(/,(0===l.length?p(/\)/,t.span.end-1):v(l[0]))-1)-1)+1,x=h(s,c("Identifier",{name:n},{start:f-n.length,end:f}),{computed:!1,optional:e}),g=d(x);return c(e||g?"OptionalCallExpression":"CallExpression",{callee:x,arguments:l},{start:v(x),end:t.span.end},{hasParentParens:r})}case"NonNullAssert":{const{expression:e}=t,s=a(e);return c("TSNonNullExpression",{expression:s},{start:v(s),end:t.span.end},{hasParentParens:r})}case"PrefixNot":{const{expression:e}=t,s=a(e);return c("UnaryExpression",{prefix:!0,operator:"!",argument:s},{start:t.span.start,end:x(s)},{hasParentParens:r})}case"PropertyRead":case"SafePropertyRead":{const e="SafePropertyRead"===i,{receiver:s,name:n}=t,a=p(/\S/,t.span.end-1)+1;return h(s,c("Identifier",{name:n},{start:a-n.length,end:a},l(s)?{hasParentParens:r}:{}),{computed:!1,optional:e},{hasParentParens:r})}case"KeyedWrite":{const{obj:e,key:s,value:n}=t,i=a(s),o=a(n),p=h(e,i,{computed:!0,optional:!1},{end:u(/\]/,x(i))+1});return c("AssignmentExpression",{left:p,operator:"=",right:o},{start:v(p),end:x(o)},{hasParentParens:r})}case"PropertyWrite":{const{receiver:e,name:s,value:n}=t,i=a(n),o=p(/\S/,p(/=/,v(i)-1)-1)+1,u=h(e,c("Identifier",{name:s},{start:o-s.length,end:o}),{computed:!1,optional:!1});return c("AssignmentExpression",{left:u,operator:"=",right:i},{start:v(u),end:x(i)},{hasParentParens:r})}case"Quote":{const{prefix:e,uninterpretedExpression:s}=t;return c("NGQuotedExpression",{prefix:e,value:s},t.span,{hasParentParens:r})}default:throw new Error("Unexpected node ".concat(i))}function a(t){return e.transform(t,n)}function o(t){return e.transform(t,n,!0)}function c(t,e,r,{processSpan:i=!0,hasParentParens:a=!1}={}){const o=Object.assign(Object.assign({type:t},s(r,n,i,a)),e);switch(t){case"Identifier":{const t=o;t.loc.identifierName=t.name;break}case"NumericLiteral":{const t=o;t.extra=Object.assign(Object.assign({},t.extra),{raw:n.text.slice(t.start,t.end),rawValue:t.value});break}case"StringLiteral":{const t=o;t.extra=Object.assign(Object.assign({},t.extra),{raw:n.text.slice(t.start,t.end),rawValue:t.value});break}}return o}function h(t,e,s,{end:n=x(e),hasParentParens:r=!1}={}){if(l(t))return e;const i=a(t),o=d(i);return c(s.optional||o?"OptionalMemberExpression":"MemberExpression",Object.assign({object:i,property:e,computed:s.computed},s.optional?{optional:!0}:o?{optional:!1}:null),{start:v(i),end:n},{hasParentParens:r})}function p(t,e){return dt.findFrontChar(t,e,n.text)}function u(t,e){return dt.findBackChar(t,e,n.text)}function l(t){return t.span.start>=t.span.end}function d(t){return("OptionalCallExpression"===t.type||"OptionalMemberExpression"===t.type)&&!f(t)}function f(t){return t.extra&&t.extra.parenthesized}function v(t){return f(t)?t.extra.parenStart:t.start}function x(t){return f(t)?t.extra.parenEnd:t.end}},e.transformSpan=s})),vt=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.transformTemplateBindings=function(t,e){t.forEach((function(t){d(t.key.span),l(t)&&t.value&&d(t.value.span)}));const[s]=t,{key:n}=s,r=0===e.text.slice(s.sourceSpan.start,s.sourceSpan.end).trim().length?t.slice(1):t,i=[];let a=null;for(let t=0;t<r.length;t++){const s=r[t];if(a&&u(a)&&l(s)&&s.value&&s.value.source===a.key.source){const t=h("NGMicrosyntaxKey",{name:s.key.source},s.key.span),n=(t,s)=>Object.assign(Object.assign({},t),ft.transformSpan({start:t.start,end:s},e)),r=e=>Object.assign(Object.assign({},n(e,t.end)),{alias:t}),a=i.pop();if("NGMicrosyntaxExpression"===a.type)i.push(r(a));else{if("NGMicrosyntaxKeyedExpression"!==a.type)throw new Error("Unexpected type ".concat(a.type));{const t=r(a.expression);i.push(n(Object.assign(Object.assign({},a),{expression:t}),t.end))}}}else i.push(o(s,t));a=s}return h("NGMicrosyntax",{body:i},0===i.length?t[0].sourceSpan:{start:i[0].start,end:i[i.length-1].end});function o(t,s){if(u(t)){const{key:e,value:n}=t;return n?0===s?h("NGMicrosyntaxExpression",{expression:c(n.ast),alias:null},n.sourceSpan):h("NGMicrosyntaxKeyedExpression",{key:h("NGMicrosyntaxKey",{name:p(e.source)},e.span),expression:h("NGMicrosyntaxExpression",{expression:c(n.ast),alias:null},n.sourceSpan)},{start:e.span.start,end:n.sourceSpan.end}):h("NGMicrosyntaxKey",{name:p(e.source)},e.span)}{const{key:s,sourceSpan:n}=t;if(/^let\s$/.test(e.text.slice(n.start,n.start+4))){const{value:e}=t;return h("NGMicrosyntaxLet",{key:h("NGMicrosyntaxKey",{name:s.source},s.span),value:e?h("NGMicrosyntaxKey",{name:e.source},e.span):null},{start:n.start,end:e?e.span.end:s.span.end})}{const n=function(t){if(!t.value||t.value.source!==dt.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX)return t.value;const s=dt.findBackChar(/\S/,t.sourceSpan.start,e.text);return{source:"$implicit",span:{start:s,end:s}}}(t);return h("NGMicrosyntaxAs",{key:h("NGMicrosyntaxKey",{name:n.source},n.span),alias:h("NGMicrosyntaxKey",{name:s.source},s.span)},{start:n.span.start,end:s.span.end})}}}function c(t){return ft.transform(t,e)}function h(t,s,n,r=!0){return Object.assign(Object.assign({type:t},ft.transformSpan(n,e,r)),s)}function p(t){return dt.toLowerCamelCase(t.slice(n.source.length))}function u(t){return t instanceof R.ExpressionBinding}function l(t){return t instanceof R.VariableBinding}function d(t){if('"'!==e.text[t.start]&&"'"!==e.text[t.start])return;const s=e.text[t.start];let n=!1;for(let r=t.start+1;r<e.text.length;r++)switch(e.text[r]){case s:if(!n)return void(t.end=r+1);default:n=!1;break;case"\\":n=!n}}}})),xt=n((function(t,e){function s(t,e){const{ast:s,comments:n}=e(t),r=new a.Context(t),i=t=>ft.transform(t,r),o=i(s);return o.comments=n.map(i),o}Object.defineProperty(e,"__esModule",{value:!0}),e.parseBinding=function(t){return s(t,dt.parseNgBinding)},e.parseSimpleBinding=function(t){return s(t,dt.parseNgSimpleBinding)},e.parseInterpolation=function(t){return s(t,dt.parseNgInterpolation)},e.parseAction=function(t){return s(t,dt.parseNgAction)},e.parseTemplateBindings=function(t){return vt.transformTemplateBindings(dt.parseNgTemplateBindings(t),new a.Context(t))}}));const{locStart:gt,locEnd:mt}=s;function yt(t){return{astFormat:"estree",parse:(e,s,n)=>{const r=t(e,xt);return{type:"NGRoot",node:"__ng_action"===n.parser&&"NGChainedExpression"!==r.type?Object.assign({},r,{type:"NGChainedExpression",expressions:[r]}):r}},locStart:gt,locEnd:mt}}return{parsers:{__ng_action:yt((t,e)=>e.parseAction(t)),__ng_binding:yt((t,e)=>e.parseBinding(t)),__ng_interpolation:yt((t,e)=>e.parseInterpolation(t)),__ng_directive:yt((t,e)=>e.parseTemplateBindings(t))}}}));
|
|
41
|
+
* @license
|
|
42
|
+
* Copyright Google LLC All Rights Reserved.
|
|
43
|
+
*
|
|
44
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
45
|
+
* found in the LICENSE file at https://angular.io/license
|
|
46
|
+
*/class Xt{constructor(e,t,n){this.strings=e,this.expressions=t,this.offsets=n}}class qt{constructor(e,t,n){this.templateBindings=e,this.warnings=t,this.errors=n}}class zt{constructor(e){this._lexer=e,this.errors=[],this.simpleExpressionChecker=Ht}parseAction(e,t,n,r=Vt){this._checkNoInterpolation(e,t,r);const s=this._stripComments(e),i=this._lexer.tokenize(this._stripComments(e)),u=new Yt(e,t,n,i,s.length,!0,this.errors,e.length-s.length).parseChain();return new mt(u,e,t,n,this.errors)}parseBinding(e,t,n,r=Vt){const s=this._parseBindingAst(e,t,n,r);return new mt(s,e,t,n,this.errors)}checkSimpleExpression(e){const t=new this.simpleExpressionChecker;return e.visit(t),t.errors}parseSimpleBinding(e,t,n,r=Vt){const s=this._parseBindingAst(e,t,n,r),i=this.checkSimpleExpression(s);return i.length>0&&this._reportError("Host binding expression cannot contain ".concat(i.join(" ")),e,t),new mt(s,e,t,n,this.errors)}_reportError(e,t,n,r){this.errors.push(new qe(e,t,n,r))}_parseBindingAst(e,t,n,r){const s=this._parseQuote(e,t,n);if(null!=s)return s;this._checkNoInterpolation(e,t,r);const i=this._stripComments(e),u=this._lexer.tokenize(i);return new Yt(e,t,n,u,i.length,!1,this.errors,e.length-i.length).parseChain()}_parseQuote(e,t,n){if(null==e)return null;const r=e.indexOf(":");if(-1==r)return null;const s=e.substring(0,r).trim();if(!Mt(s))return null;const i=e.substring(r+1),u=new ze(0,e.length);return new He(u,u.toAbsolute(n),s,i,t)}parseTemplateBindings(e,t,n,r,s){const i=this._lexer.tokenize(t);return new Yt(t,n,s,i,t.length,!1,this.errors,0).parseTemplateBindings({source:e,span:new gt(r,r+e.length)})}parseInterpolation(e,t,n,r=Vt){const{strings:s,expressions:i,offsets:u}=this.splitInterpolation(e,t,r);if(0===i.length)return null;const a=[];for(let r=0;r<i.length;++r){const s=i[r].text,o=this._stripComments(s),D=this._lexer.tokenize(o),c=new Yt(e,t,n,D,o.length,!1,this.errors,u[r]+(s.length-o.length)).parseChain();a.push(c)}return this.createInterpolationAst(s.map((e=>e.text)),a,e,t,n)}parseInterpolationExpression(e,t,n){const r=this._stripComments(e),s=this._lexer.tokenize(r),i=new Yt(e,t,n,s,r.length,!1,this.errors,0).parseChain();return this.createInterpolationAst(["",""],[i],e,t,n)}createInterpolationAst(e,t,n,r,s){const i=new ze(0,n.length),u=new ht(i,i.toAbsolute(s),e,t);return new mt(u,n,r,s,this.errors)}splitInterpolation(e,t,n=Vt){const r=[],s=[],i=[];let u=0,a=!1,o=!1,{start:D,end:c}=n;for(;u<e.length;)if(a){const n=u,r=n+D.length,p=this._getInterpolationEndIndex(e,c,r);if(-1===p){a=!1,o=!0;break}const h=p+c.length,l=e.substring(r,p);0===l.trim().length&&this._reportError("Blank expressions are not allowed in interpolated strings",e,"at column ".concat(u," in"),t),s.push({text:l,start:n,end:h}),i.push(r),u=h,a=!1}else{const t=u;u=e.indexOf(D,u),-1===u&&(u=e.length);const n=e.substring(t,u);r.push({text:n,start:t,end:u}),a=!0}if(!a)if(o){const t=r[r.length-1];t.text+=e.substring(u),t.end=e.length}else r.push({text:e.substring(u),start:u,end:e.length});return new Xt(r,s,i)}wrapLiteralPrimitive(e,t,n){const r=new ze(0,null==e?0:e.length);return new mt(new Dt(r,r.toAbsolute(n),e),e,t,n,this.errors)}_stripComments(e){const t=this._commentStart(e);return null!=t?e.substring(0,t).trim():e}_commentStart(e){let t=null;for(let n=0;n<e.length-1;n++){const r=e.charCodeAt(n),s=e.charCodeAt(n+1);if(47===r&&47==s&&null==t)return n;t===r?t=null:null==t&&jt(r)&&(t=r)}return null}_checkNoInterpolation(e,t,{start:n,end:r}){let s=-1,i=-1;for(const t of this._forEachUnquotedChar(e,0))if(-1===s)e.startsWith(n)&&(s=t);else if(i=this._getInterpolationEndIndex(e,r,t),i>-1)break;s>-1&&i>-1&&this._reportError("Got interpolation (".concat(n).concat(r,") where expression was expected"),e,"at column ".concat(s," in"),t)}_getInterpolationEndIndex(e,t,n){for(const r of this._forEachUnquotedChar(e,n)){if(e.startsWith(t,r))return r;if(e.startsWith("//",r))return e.indexOf(t,r)}return-1}*_forEachUnquotedChar(e,t){let n=null,r=0;for(let s=t;s<e.length;s++){const t=e[s];!jt(e.charCodeAt(s))||null!==n&&n!==t||r%2!=0?null===n&&(yield s):n=null===n?t:null,r="\\"===t?r+1:0}}}var Qt;!function(e){e[e.None=0]="None",e[e.Writable=1]="Writable"}(Qt||(Qt={}));class Yt{constructor(e,t,n,r,s,i,u,a){this.input=e,this.location=t,this.absoluteOffset=n,this.tokens=r,this.inputLength=s,this.parseAction=i,this.errors=u,this.offset=a,this.rparensExpected=0,this.rbracketsExpected=0,this.rbracesExpected=0,this.context=Qt.None,this.sourceSpanCache=new Map,this.index=0}peek(e){const t=this.index+e;return t<this.tokens.length?this.tokens[t]:Lt}get next(){return this.peek(0)}get atEOF(){return this.index>=this.tokens.length}get inputIndex(){return this.atEOF?this.currentEndIndex:this.next.index+this.offset}get currentEndIndex(){if(this.index>0){return this.peek(-1).end+this.offset}return 0===this.tokens.length?this.inputLength+this.offset:this.next.index+this.offset}get currentAbsoluteOffset(){return this.absoluteOffset+this.inputIndex}span(e,t){let n=this.currentEndIndex;return void 0!==t&&t>this.currentEndIndex&&(n=t),new ze(e,n)}sourceSpan(e,t){const n="".concat(e,"@").concat(this.inputIndex,":").concat(t);return this.sourceSpanCache.has(n)||this.sourceSpanCache.set(n,this.span(e,t).toAbsolute(this.absoluteOffset)),this.sourceSpanCache.get(n)}advance(){this.index++}withContext(e,t){this.context|=e;const n=t();return this.context^=e,n}consumeOptionalCharacter(e){return!!this.next.isCharacter(e)&&(this.advance(),!0)}peekKeywordLet(){return this.next.isKeywordLet()}peekKeywordAs(){return this.next.isKeywordAs()}expectCharacter(e){this.consumeOptionalCharacter(e)||this.error("Missing expected ".concat(String.fromCharCode(e)))}consumeOptionalOperator(e){return!!this.next.isOperator(e)&&(this.advance(),!0)}expectOperator(e){this.consumeOptionalOperator(e)||this.error("Missing expected operator ".concat(e))}prettyPrintToken(e){return e===Lt?"end of input":"token ".concat(e)}expectIdentifierOrKeyword(){const e=this.next;return e.isIdentifier()||e.isKeyword()?(this.advance(),e.toString()):(this.error("Unexpected ".concat(this.prettyPrintToken(e),", expected identifier or keyword")),null)}expectIdentifierOrKeywordOrString(){const e=this.next;return e.isIdentifier()||e.isKeyword()||e.isString()?(this.advance(),e.toString()):(this.error("Unexpected ".concat(this.prettyPrintToken(e),", expected identifier, keyword, or string")),"")}parseChain(){const e=[],t=this.inputIndex;for(;this.index<this.tokens.length;){const t=this.parsePipe();if(e.push(t),this.consumeOptionalCharacter(59))for(this.parseAction||this.error("Binding expression cannot contain chained expression");this.consumeOptionalCharacter(59););else this.index<this.tokens.length&&this.error("Unexpected token '".concat(this.next,"'"))}if(0==e.length){const e=this.offset,t=this.offset+this.inputLength;return new Je(this.span(e,t),this.sourceSpan(e,t))}return 1==e.length?e[0]:new tt(this.span(t),this.sourceSpan(t),e)}parsePipe(){const e=this.inputIndex;let t=this.parseExpression();if(this.consumeOptionalOperator("|")){this.parseAction&&this.error("Cannot have a pipe in an action expression");do{const n=this.inputIndex;let r,s,i=this.expectIdentifierOrKeyword();null!==i?r=this.sourceSpan(n):(i="",s=-1!==this.next.index?this.next.index:this.inputLength+this.offset,r=new ze(s,s).toAbsolute(this.absoluteOffset));const u=[];for(;this.consumeOptionalCharacter(58);)u.push(this.parseExpression());t=new ot(this.span(e),this.sourceSpan(e,s),t,i,u,r)}while(this.consumeOptionalOperator("|"))}return t}parseExpression(){return this.parseConditional()}parseConditional(){const e=this.inputIndex,t=this.parseLogicalOr();if(this.consumeOptionalOperator("?")){const n=this.parsePipe();let r;if(this.consumeOptionalCharacter(58))r=this.parsePipe();else{const t=this.inputIndex,n=this.input.substring(e,t);this.error("Conditional expression ".concat(n," requires all 3 expressions")),r=new Je(this.span(e),this.sourceSpan(e))}return new nt(this.span(e),this.sourceSpan(e),t,n,r)}return t}parseLogicalOr(){const e=this.inputIndex;let t=this.parseLogicalAnd();for(;this.consumeOptionalOperator("||");){const n=this.parseLogicalAnd();t=new lt(this.span(e),this.sourceSpan(e),"||",t,n)}return t}parseLogicalAnd(){const e=this.inputIndex;let t=this.parseEquality();for(;this.consumeOptionalOperator("&&");){const n=this.parseEquality();t=new lt(this.span(e),this.sourceSpan(e),"&&",t,n)}return t}parseEquality(){const e=this.inputIndex;let t=this.parseRelational();for(;this.next.type==Bt.Operator;){const n=this.next.strValue;switch(n){case"==":case"===":case"!=":case"!==":this.advance();const r=this.parseRelational();t=new lt(this.span(e),this.sourceSpan(e),n,t,r);continue}break}return t}parseRelational(){const e=this.inputIndex;let t=this.parseAdditive();for(;this.next.type==Bt.Operator;){const n=this.next.strValue;switch(n){case"<":case">":case"<=":case">=":this.advance();const r=this.parseAdditive();t=new lt(this.span(e),this.sourceSpan(e),n,t,r);continue}break}return t}parseAdditive(){const e=this.inputIndex;let t=this.parseMultiplicative();for(;this.next.type==Bt.Operator;){const n=this.next.strValue;switch(n){case"+":case"-":this.advance();let r=this.parseMultiplicative();t=new lt(this.span(e),this.sourceSpan(e),n,t,r);continue}break}return t}parseMultiplicative(){const e=this.inputIndex;let t=this.parsePrefix();for(;this.next.type==Bt.Operator;){const n=this.next.strValue;switch(n){case"*":case"%":case"/":this.advance();let r=this.parsePrefix();t=new lt(this.span(e),this.sourceSpan(e),n,t,r);continue}break}return t}parsePrefix(){if(this.next.type==Bt.Operator){const e=this.inputIndex;let t;switch(this.next.strValue){case"+":return this.advance(),t=this.parsePrefix(),dt.createPlus(this.span(e),this.sourceSpan(e),t);case"-":return this.advance(),t=this.parsePrefix(),dt.createMinus(this.span(e),this.sourceSpan(e),t);case"!":return this.advance(),t=this.parsePrefix(),new Et(this.span(e),this.sourceSpan(e),t)}}return this.parseCallChain()}parseCallChain(){const e=this.inputIndex;let t=this.parsePrimary();for(;;)if(this.consumeOptionalCharacter(46))t=this.parseAccessMemberOrMethodCall(t,e,!1);else if(this.consumeOptionalOperator("?."))t=this.parseAccessMemberOrMethodCall(t,e,!0);else if(this.consumeOptionalCharacter(91))this.withContext(Qt.Writable,(()=>{this.rbracketsExpected++;const n=this.parsePipe();if(n instanceof Je&&this.error("Key access cannot be empty"),this.rbracketsExpected--,this.expectCharacter(93),this.consumeOptionalOperator("=")){const r=this.parseConditional();t=new at(this.span(e),this.sourceSpan(e),t,n,r)}else t=new ut(this.span(e),this.sourceSpan(e),t,n)}));else if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const n=this.parseCallArguments();this.rparensExpected--,this.expectCharacter(St),t=new vt(this.span(e),this.sourceSpan(e),t,n)}else{if(!this.consumeOptionalOperator("!"))return t;t=new ft(this.span(e),this.sourceSpan(e),t)}}parsePrimary(){const e=this.inputIndex;if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const e=this.parsePipe();return this.rparensExpected--,this.expectCharacter(St),e}if(this.next.isKeywordNull())return this.advance(),new Dt(this.span(e),this.sourceSpan(e),null);if(this.next.isKeywordUndefined())return this.advance(),new Dt(this.span(e),this.sourceSpan(e),void 0);if(this.next.isKeywordTrue())return this.advance(),new Dt(this.span(e),this.sourceSpan(e),!0);if(this.next.isKeywordFalse())return this.advance(),new Dt(this.span(e),this.sourceSpan(e),!1);if(this.next.isKeywordThis())return this.advance(),new et(this.span(e),this.sourceSpan(e));if(this.consumeOptionalCharacter(91)){this.rbracketsExpected++;const t=this.parseExpressionList(93);return this.rbracketsExpected--,this.expectCharacter(93),new ct(this.span(e),this.sourceSpan(e),t)}if(this.next.isCharacter(123))return this.parseLiteralMap();if(this.next.isIdentifier())return this.parseAccessMemberOrMethodCall(new Ze(this.span(e),this.sourceSpan(e)),e,!1);if(this.next.isNumber()){const t=this.next.toNumber();return this.advance(),new Dt(this.span(e),this.sourceSpan(e),t)}if(this.next.isString()){const t=this.next.toString();return this.advance(),new Dt(this.span(e),this.sourceSpan(e),t)}return this.index>=this.tokens.length?(this.error("Unexpected end of expression: ".concat(this.input)),new Je(this.span(e),this.sourceSpan(e))):(this.error("Unexpected token ".concat(this.next)),new Je(this.span(e),this.sourceSpan(e)))}parseExpressionList(e){const t=[];do{if(this.next.isCharacter(e))break;t.push(this.parsePipe())}while(this.consumeOptionalCharacter(44));return t}parseLiteralMap(){const e=[],t=[],n=this.inputIndex;if(this.expectCharacter(123),!this.consumeOptionalCharacter(It)){this.rbracesExpected++;do{const n=this.next.isString(),r=this.expectIdentifierOrKeywordOrString();e.push({key:r,quoted:n}),this.expectCharacter(58),t.push(this.parsePipe())}while(this.consumeOptionalCharacter(44));this.rbracesExpected--,this.expectCharacter(It)}return new pt(this.span(n),this.sourceSpan(n),e,t)}parseAccessMemberOrMethodCall(e,t,n=!1){const r=this.inputIndex,s=this.withContext(Qt.Writable,(()=>{var t;const n=null!==(t=this.expectIdentifierOrKeyword())&&void 0!==t?t:"";return 0===n.length&&this.error("Expected identifier for property access",e.span.end),n})),i=this.sourceSpan(r);if(this.consumeOptionalCharacter(40)){this.rparensExpected++;const r=this.parseCallArguments();this.expectCharacter(St),this.rparensExpected--;const u=this.span(t),a=this.sourceSpan(t);return n?new Ft(u,a,i,e,s,r):new Ct(u,a,i,e,s,r)}if(n)return this.consumeOptionalOperator("=")?(this.error("The '?.' operator cannot be used in the assignment"),new Je(this.span(t),this.sourceSpan(t))):new it(this.span(t),this.sourceSpan(t),i,e,s);if(this.consumeOptionalOperator("=")){if(!this.parseAction)return this.error("Bindings cannot contain assignments"),new Je(this.span(t),this.sourceSpan(t));const n=this.parseConditional();return new st(this.span(t),this.sourceSpan(t),i,e,s,n)}return new rt(this.span(t),this.sourceSpan(t),i,e,s)}parseCallArguments(){if(this.next.isCharacter(St))return[];const e=[];do{e.push(this.parsePipe())}while(this.consumeOptionalCharacter(44));return e}expectTemplateBindingKey(){let e="",t=!1;const n=this.currentAbsoluteOffset;do{e+=this.expectIdentifierOrKeywordOrString(),t=this.consumeOptionalOperator("-"),t&&(e+="-")}while(t);return{source:e,span:new gt(n,n+e.length)}}parseTemplateBindings(e){const t=[];for(t.push(...this.parseDirectiveKeywordBindings(e));this.index<this.tokens.length;){const n=this.parseLetBinding();if(n)t.push(n);else{const n=this.expectTemplateBindingKey(),r=this.parseAsBinding(n);r?t.push(r):(n.source=e.source+n.source.charAt(0).toUpperCase()+n.source.substring(1),t.push(...this.parseDirectiveKeywordBindings(n)))}this.consumeStatementTerminator()}return new qt(t,[],this.errors)}parseDirectiveKeywordBindings(e){const t=[];this.consumeOptionalCharacter(58);const n=this.getDirectiveBoundTarget();let r=this.currentAbsoluteOffset;const s=this.parseAsBinding(e);s||(this.consumeStatementTerminator(),r=this.currentAbsoluteOffset);const i=new gt(e.span.start,r);return t.push(new At(i,e,n)),s&&t.push(s),t}getDirectiveBoundTarget(){if(this.next===Lt||this.peekKeywordAs()||this.peekKeywordLet())return null;const e=this.parsePipe(),{start:t,end:n}=e.span,r=this.input.substring(t,n);return new mt(e,r,this.location,this.absoluteOffset+t,this.errors)}parseAsBinding(e){if(!this.peekKeywordAs())return null;this.advance();const t=this.expectTemplateBindingKey();this.consumeStatementTerminator();const n=new gt(e.span.start,this.currentAbsoluteOffset);return new xt(n,t,e)}parseLetBinding(){if(!this.peekKeywordLet())return null;const e=this.currentAbsoluteOffset;this.advance();const t=this.expectTemplateBindingKey();let n=null;this.consumeOptionalOperator("=")&&(n=this.expectTemplateBindingKey()),this.consumeStatementTerminator();const r=new gt(e,this.currentAbsoluteOffset);return new xt(r,t,n)}consumeStatementTerminator(){this.consumeOptionalCharacter(59)||this.consumeOptionalCharacter(44)}error(e,t=null){this.errors.push(new qe(e,this.input,this.locationText(t),this.location)),this.skip()}locationText(e=null){return null==e&&(e=this.index),e<this.tokens.length?"at column ".concat(this.tokens[e].index+1," in"):"at the end of the expression"}skip(){let e=this.next;for(;!(!(this.index<this.tokens.length)||e.isCharacter(59)||e.isOperator("|")||!(this.rparensExpected<=0)&&e.isCharacter(St)||!(this.rbracesExpected<=0)&&e.isCharacter(It)||!(this.rbracketsExpected<=0)&&e.isCharacter(93)||this.context&Qt.Writable&&e.isOperator("="));)this.next.isError()&&this.errors.push(new qe(this.next.toString(),this.input,this.locationText(),this.location)),this.advance(),e=this.next}}class Ht{constructor(){this.errors=[]}visitImplicitReceiver(e,t){}visitThisReceiver(e,t){}visitInterpolation(e,t){}visitLiteralPrimitive(e,t){}visitPropertyRead(e,t){}visitPropertyWrite(e,t){}visitSafePropertyRead(e,t){}visitMethodCall(e,t){}visitSafeMethodCall(e,t){}visitFunctionCall(e,t){}visitLiteralArray(e,t){this.visitAll(e.expressions,t)}visitLiteralMap(e,t){this.visitAll(e.values,t)}visitUnary(e,t){}visitBinary(e,t){}visitPrefixNot(e,t){}visitNonNullAssert(e,t){}visitConditional(e,t){}visitPipe(e,t){this.errors.push("pipes")}visitKeyedRead(e,t){}visitKeyedWrite(e,t){}visitAll(e,t){return e.map((e=>e.visit(this,t)))}visitChain(e,t){}visitQuote(e,t){}}class Jt extends yt{constructor(){super(...arguments),this.errors=[]}visitPipe(){this.errors.push("pipes")}}var Zt=Object.freeze({__proto__:null,SplitInterpolation:Xt,TemplateBindingParseResult:qt,Parser:zt,IvyParser:class extends zt{constructor(){super(...arguments),this.simpleExpressionChecker=Jt}},_ParseAST:Yt}),en=_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getLast=t.toLowerCamelCase=t.findBackChar=t.findFrontChar=t.fitSpans=t.getNgType=t.parseNgInterpolation=t.parseNgTemplateBindings=t.parseNgAction=t.parseNgSimpleBinding=t.parseNgBinding=t.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX=void 0;const n="angular-estree-parser";t.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX="NgEstreeParser";const r=[n,0];function s(){return new Zt.Parser(new Ut.Lexer)}function i(e,t){const n=s(),{astInput:r,comments:i}=o(e,n),{ast:u,errors:D}=t(r,n);return a(D),{ast:u,comments:i}}function u(e,t){if(e&&"object"==typeof e){if(Array.isArray(e))return e.forEach((e=>u(e,t)));for(const n of Object.keys(e)){const r=e[n];"span"===n?t(r):u(r,t)}}}function a(e){if(0!==e.length){const[{message:t}]=e;throw new SyntaxError(t.replace(/^Parser Error: | at column \d+ in [^]*$/g,""))}}function o(e,t){const n=t._commentStart(e);return null===n?{astInput:e,comments:[]}:{astInput:e.slice(0,n),comments:[{type:"Comment",value:e.slice(n+"//".length),span:{start:n,end:e.length}}]}}function D({start:e,end:t},n){let r=e,s=t;for(;s!==r&&/\s/.test(n[s-1]);)s--;for(;r!==s&&/\s/.test(n[r]);)r++;return{start:r,end:s}}function c({start:e,end:t},n){let r=e,s=t;for(;s!==n.length&&/\s/.test(n[s]);)s++;for(;0!==r&&/\s/.test(n[r-1]);)r--;return{start:r,end:s}}function p(e,t){return"("===t[e.start-1]&&")"===t[e.end]?{start:e.start-1,end:e.end+1}:e}t.parseNgBinding=function(e){return i(e,((e,t)=>t.parseBinding(e,...r)))},t.parseNgSimpleBinding=function(e){return i(e,((e,t)=>t.parseSimpleBinding(e,...r)))},t.parseNgAction=function(e){return i(e,((e,t)=>t.parseAction(e,...r)))},t.parseNgTemplateBindings=function(e){const r=s(),{templateBindings:i,errors:u}=r.parseTemplateBindings(t.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX,e,n,0,0);return a(u),i},t.parseNgInterpolation=function(e){const t=s(),{astInput:n,comments:i}=o(e,t),D="{{",{ast:c,errors:p}=t.parseInterpolation(D+n+"}}",...r);a(p);const h=c.expressions[0],l=new Set;return u(h,(e=>{l.has(e)||(e.start-=D.length,e.end-=D.length,l.add(e))})),{ast:h,comments:i}},t.getNgType=function(e){return wt.Unary&&e instanceof wt.Unary?"Unary":e instanceof wt.Binary?"Binary":e instanceof wt.BindingPipe?"BindingPipe":e instanceof wt.Chain?"Chain":e instanceof wt.Conditional?"Conditional":e instanceof wt.EmptyExpr?"EmptyExpr":e instanceof wt.FunctionCall?"FunctionCall":e instanceof wt.ImplicitReceiver?"ImplicitReceiver":e instanceof wt.KeyedRead?"KeyedRead":e instanceof wt.KeyedWrite?"KeyedWrite":e instanceof wt.LiteralArray?"LiteralArray":e instanceof wt.LiteralMap?"LiteralMap":e instanceof wt.LiteralPrimitive?"LiteralPrimitive":e instanceof wt.MethodCall?"MethodCall":e instanceof wt.NonNullAssert?"NonNullAssert":e instanceof wt.PrefixNot?"PrefixNot":e instanceof wt.PropertyRead?"PropertyRead":e instanceof wt.PropertyWrite?"PropertyWrite":e instanceof wt.Quote?"Quote":e instanceof wt.SafeMethodCall?"SafeMethodCall":e instanceof wt.SafePropertyRead?"SafePropertyRead":e.type},t.fitSpans=function(e,t,n){let r=0;const s={start:e.start,end:e.end};for(;;){const e=c(s,t),n=p(e,t);if(e.start===n.start&&e.end===n.end)break;s.start=n.start,s.end=n.end,r++}return{hasParens:0!==(n?r-1:r),outerSpan:D(n?{start:s.start+1,end:s.end-1}:s,t),innerSpan:D(e,t)}},t.findFrontChar=function(e,t,n){let r=t;for(;!e.test(n[r]);)if(--r<0)throw new Error("Cannot find front char ".concat(e," from index ").concat(t," in ").concat(JSON.stringify(n)));return r},t.findBackChar=function(e,t,n){let r=t;for(;!e.test(n[r]);)if(++r>=n.length)throw new Error("Cannot find back char ".concat(e," from index ").concat(t," in ").concat(JSON.stringify(n)));return r},t.toLowerCamelCase=function(e){return e.slice(0,1).toLowerCase()+e.slice(1)},t.getLast=function(e){return 0===e.length?void 0:e[e.length-1]}})),tn=_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.transformSpan=t.transform=void 0;function n(e,t,n=!1,r=!1){if(!n){const{start:n,end:r}=e;return{start:n,end:r,loc:{start:t.locator.locationForIndex(n),end:t.locator.locationForIndex(r)}}}const{outerSpan:s,innerSpan:i,hasParens:u}=en.fitSpans(e,t.text,r);return Object.assign({start:i.start,end:i.end,loc:{start:t.locator.locationForIndex(i.start),end:t.locator.locationForIndex(i.end)}},u&&{extra:{parenthesized:!0,parenStart:s.start,parenEnd:s.end}})}t.transform=(e,r,s=!1)=>{const i=en.getNgType(e);switch(i){case"Unary":{const{operator:t,expr:n}=e;return o("UnaryExpression",{prefix:!0,argument:u(n),operator:t},e.span,{hasParentParens:s})}case"Binary":{const{left:t,operation:n,right:r}=e,i=r.span.start===r.span.end,a=t.span.start===t.span.end;if(i||a){const n=t.span.start===t.span.end?u(r):u(t);return o("UnaryExpression",{prefix:!0,argument:n,operator:i?"+":"-"},{start:e.span.start,end:f(n)},{hasParentParens:s})}const D=u(t),c=u(r);return o("&&"===n||"||"===n?"LogicalExpression":"BinaryExpression",{left:D,right:c,operator:n},{start:E(D),end:f(c)},{hasParentParens:s})}case"BindingPipe":{const{exp:t,name:n,args:r}=e,i=u(t),a=p(/\S/,p(/\|/,f(i))+1),D=o("Identifier",{name:n},{start:a,end:a+n.length}),c=r.map(u);return o("NGPipeExpression",{left:i,right:D,arguments:c},{start:E(i),end:f(0===c.length?D:en.getLast(c))},{hasParentParens:s})}case"Chain":{const{expressions:t}=e;return o("NGChainedExpression",{expressions:t.map(u)},e.span,{hasParentParens:s})}case"Comment":{const{value:t}=e;return o("CommentLine",{value:t},e.span,{processSpan:!1})}case"Conditional":{const{condition:t,trueExp:n,falseExp:r}=e,i=u(t),a=u(n),D=u(r);return o("ConditionalExpression",{test:i,consequent:a,alternate:D},{start:E(i),end:f(D)},{hasParentParens:s})}case"EmptyExpr":return o("NGEmptyExpression",{},e.span,{hasParentParens:s});case"FunctionCall":{const{target:t,args:n}=e,r=1===n.length?[a(n[0])]:n.map(u),i=u(t);return o("CallExpression",{callee:i,arguments:r},{start:E(i),end:e.span.end},{hasParentParens:s})}case"ImplicitReceiver":return o("ThisExpression",{},e.span,{hasParentParens:s});case"KeyedRead":{const{obj:t,key:n}=e;return D(t,u(n),{computed:!0,optional:!1},{end:e.span.end,hasParentParens:s})}case"LiteralArray":{const{expressions:t}=e;return o("ArrayExpression",{elements:t.map(u)},e.span,{hasParentParens:s})}case"LiteralMap":{const{keys:t,values:n}=e,r=n.map((e=>u(e))),i=t.map((({key:t,quoted:n},s)=>{const i=r[s],u={start:p(/\S/,0===s?e.span.start+1:p(/,/,f(r[s-1]))+1),end:c(/\S/,c(/:/,E(i)-1)-1)+1},a=n?o("StringLiteral",{value:t},u):o("Identifier",{name:t},u);return o("ObjectProperty",{key:a,value:i,method:!1,shorthand:!1,computed:!1},{start:E(a),end:f(i)})}));return o("ObjectExpression",{properties:i},e.span,{hasParentParens:s})}case"LiteralPrimitive":{const{value:t}=e;switch(typeof t){case"boolean":return o("BooleanLiteral",{value:t},e.span,{hasParentParens:s});case"number":return o("NumericLiteral",{value:t},e.span,{hasParentParens:s});case"object":return o("NullLiteral",{},e.span,{hasParentParens:s});case"string":return o("StringLiteral",{value:t},e.span,{hasParentParens:s});case"undefined":return o("Identifier",{name:"undefined"},e.span,{hasParentParens:s});default:throw new Error("Unexpected LiteralPrimitive value type ".concat(typeof t))}}case"MethodCall":case"SafeMethodCall":{const t="SafeMethodCall"===i,{receiver:n,name:r,args:p}=e,h=1===p.length?[a(p[0])]:p.map(u),d=c(/\S/,c(/\(/,(0===h.length?c(/\)/,e.span.end-1):E(h[0]))-1)-1)+1,f=D(n,o("Identifier",{name:r},{start:d-r.length,end:d}),{computed:!1,optional:t}),C=l(f);return o(t||C?"OptionalCallExpression":"CallExpression",{callee:f,arguments:h},{start:E(f),end:e.span.end},{hasParentParens:s})}case"NonNullAssert":{const{expression:t}=e,n=u(t);return o("TSNonNullExpression",{expression:n},{start:E(n),end:e.span.end},{hasParentParens:s})}case"PrefixNot":{const{expression:t}=e,n=u(t);return o("UnaryExpression",{prefix:!0,operator:"!",argument:n},{start:e.span.start,end:f(n)},{hasParentParens:s})}case"PropertyRead":case"SafePropertyRead":{const t="SafePropertyRead"===i,{receiver:n,name:r}=e,u=c(/\S/,e.span.end-1)+1;return D(n,o("Identifier",{name:r},{start:u-r.length,end:u},h(n)?{hasParentParens:s}:{}),{computed:!1,optional:t},{hasParentParens:s})}case"KeyedWrite":{const{obj:t,key:n,value:r}=e,i=u(n),a=u(r),c=D(t,i,{computed:!0,optional:!1},{end:p(/\]/,f(i))+1});return o("AssignmentExpression",{left:c,operator:"=",right:a},{start:E(c),end:f(a)},{hasParentParens:s})}case"PropertyWrite":{const{receiver:t,name:n,value:r}=e,i=u(r),a=c(/\S/,c(/=/,E(i)-1)-1)+1,p=D(t,o("Identifier",{name:n},{start:a-n.length,end:a}),{computed:!1,optional:!1});return o("AssignmentExpression",{left:p,operator:"=",right:i},{start:E(p),end:f(i)},{hasParentParens:s})}case"Quote":{const{prefix:t,uninterpretedExpression:n}=e;return o("NGQuotedExpression",{prefix:t,value:n},e.span,{hasParentParens:s})}default:throw new Error("Unexpected node ".concat(i))}function u(e){return t.transform(e,r)}function a(e){return t.transform(e,r,!0)}function o(e,t,s,{processSpan:i=!0,hasParentParens:u=!1}={}){const a=Object.assign(Object.assign({type:e},n(s,r,i,u)),t);switch(e){case"Identifier":{const e=a;e.loc.identifierName=e.name;break}case"NumericLiteral":{const e=a;e.extra=Object.assign(Object.assign({},e.extra),{raw:r.text.slice(e.start,e.end),rawValue:e.value});break}case"StringLiteral":{const e=a;e.extra=Object.assign(Object.assign({},e.extra),{raw:r.text.slice(e.start,e.end),rawValue:e.value});break}}return a}function D(e,t,n,{end:r=f(t),hasParentParens:s=!1}={}){if(h(e))return t;const i=u(e),a=l(i);return o(n.optional||a?"OptionalMemberExpression":"MemberExpression",Object.assign({object:i,property:t,computed:n.computed},n.optional?{optional:!0}:a?{optional:!1}:null),{start:E(i),end:r},{hasParentParens:s})}function c(e,t){return en.findFrontChar(e,t,r.text)}function p(e,t){return en.findBackChar(e,t,r.text)}function h(e){return e.span.start>=e.span.end}function l(e){return("OptionalCallExpression"===e.type||"OptionalMemberExpression"===e.type)&&!d(e)}function d(e){return e.extra&&e.extra.parenthesized}function E(e){return d(e)?e.extra.parenStart:e.start}function f(e){return d(e)?e.extra.parenEnd:e.end}},t.transformSpan=n})),nn=_((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.transformTemplateBindings=void 0,t.transformTemplateBindings=function(e,t){e.forEach((function(e){l(e.key.span),h(e)&&e.value&&l(e.value.span)}));const[n]=e,{key:r}=n,s=0===t.text.slice(n.sourceSpan.start,n.sourceSpan.end).trim().length?e.slice(1):e,i=[];let u=null;for(let e=0;e<s.length;e++){const n=s[e];if(u&&p(u)&&h(n)&&n.value&&n.value.source===u.key.source){const e=D("NGMicrosyntaxKey",{name:n.key.source},n.key.span),r=(e,n)=>Object.assign(Object.assign({},e),tn.transformSpan({start:e.start,end:n},t)),s=t=>Object.assign(Object.assign({},r(t,e.end)),{alias:e}),u=i.pop();if("NGMicrosyntaxExpression"===u.type)i.push(s(u));else{if("NGMicrosyntaxKeyedExpression"!==u.type)throw new Error("Unexpected type ".concat(u.type));{const e=s(u.expression);i.push(r(Object.assign(Object.assign({},u),{expression:e}),e.end))}}}else i.push(a(n,e));u=n}return D("NGMicrosyntax",{body:i},0===i.length?e[0].sourceSpan:{start:i[0].start,end:i[i.length-1].end});function a(e,n){if(p(e)){const{key:t,value:r}=e;return r?0===n?D("NGMicrosyntaxExpression",{expression:o(r.ast),alias:null},r.sourceSpan):D("NGMicrosyntaxKeyedExpression",{key:D("NGMicrosyntaxKey",{name:c(t.source)},t.span),expression:D("NGMicrosyntaxExpression",{expression:o(r.ast),alias:null},r.sourceSpan)},{start:t.span.start,end:r.sourceSpan.end}):D("NGMicrosyntaxKey",{name:c(t.source)},t.span)}{const{key:n,sourceSpan:r}=e;if(/^let\s$/.test(t.text.slice(r.start,r.start+4))){const{value:t}=e;return D("NGMicrosyntaxLet",{key:D("NGMicrosyntaxKey",{name:n.source},n.span),value:t?D("NGMicrosyntaxKey",{name:t.source},t.span):null},{start:r.start,end:t?t.span.end:n.span.end})}{const r=function(e){if(!e.value||e.value.source!==en.NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX)return e.value;const n=en.findBackChar(/\S/,e.sourceSpan.start,t.text);return{source:"$implicit",span:{start:n,end:n}}}(e);return D("NGMicrosyntaxAs",{key:D("NGMicrosyntaxKey",{name:r.source},r.span),alias:D("NGMicrosyntaxKey",{name:n.source},n.span)},{start:r.span.start,end:n.span.end})}}}function o(e){return tn.transform(e,t)}function D(e,n,r,s=!0){return Object.assign(Object.assign({type:e},tn.transformSpan(r,t,s)),n)}function c(e){return en.toLowerCamelCase(e.slice(r.source.length))}function p(e){return e instanceof wt.ExpressionBinding}function h(e){return e instanceof wt.VariableBinding}function l(e){if('"'!==t.text[e.start]&&"'"!==t.text[e.start])return;const n=t.text[e.start];let r=!1;for(let s=e.start+1;s<t.text.length;s++)switch(t.text[s]){case n:if(!r)return void(e.end=s+1);default:r=!1;break;case"\\":r=!r}}}})),rn=_((function(e,t){function n(e,t){const{ast:n,comments:r}=t(e),s=new Xe.Context(e),i=e=>tn.transform(e,s),u=i(n);return u.comments=r.map(i),u}Object.defineProperty(t,"__esModule",{value:!0}),t.parseTemplateBindings=t.parseAction=t.parseInterpolation=t.parseSimpleBinding=t.parseBinding=void 0,t.parseBinding=function(e){return n(e,en.parseNgBinding)},t.parseSimpleBinding=function(e){return n(e,en.parseNgSimpleBinding)},t.parseInterpolation=function(e){return n(e,en.parseNgInterpolation)},t.parseAction=function(e){return n(e,en.parseNgAction)},t.parseTemplateBindings=function(e){return nn.transformTemplateBindings(en.parseNgTemplateBindings(e),new Xe.Context(e))}}));const{locStart:sn,locEnd:un}=We;function an(e){return{astFormat:"estree",parse:(t,n,r)=>{const s=e(t,rn);return{type:"NGRoot",node:"__ng_action"===r.parser&&"NGChainedExpression"!==s.type?Object.assign({},s,{type:"NGChainedExpression",expressions:[s]}):s}},locStart:sn,locEnd:un}}return{parsers:{__ng_action:an(((e,t)=>t.parseAction(e))),__ng_binding:an(((e,t)=>t.parseBinding(e))),__ng_interpolation:an(((e,t)=>t.parseInterpolation(e))),__ng_directive:an(((e,t)=>t.parseTemplateBindings(e)))}}}));
|