@kurtinatlanta/prettier 3.8.0-dev → 3.8.0-hoyt.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +1694 -112
- package/doc.js +112 -110
- package/doc.mjs +112 -110
- package/index.cjs +1 -1
- package/index.mjs +153 -169
- package/internal/experimental-cli.mjs +1 -1
- package/internal/legacy-cli.mjs +2 -2
- package/package.json +2 -2
- package/plugins/acorn.js +7 -7
- package/plugins/acorn.mjs +8 -8
- package/plugins/angular.js +1 -1
- package/plugins/angular.mjs +1 -1
- package/plugins/babel.js +2 -2
- package/plugins/babel.mjs +2 -2
- package/plugins/estree.js +34 -34
- package/plugins/estree.mjs +34 -34
- package/plugins/flow.js +3 -3
- package/plugins/flow.mjs +3 -3
- package/plugins/glimmer.js +1 -1
- package/plugins/glimmer.mjs +1 -1
- package/plugins/graphql.js +1 -1
- package/plugins/graphql.mjs +1 -1
- package/plugins/html.js +1 -1
- package/plugins/html.mjs +1 -1
- package/plugins/markdown.js +62 -55
- package/plugins/markdown.mjs +62 -55
- package/plugins/meriyah.js +4 -4
- package/plugins/meriyah.mjs +4 -4
- package/plugins/postcss.js +31 -31
- package/plugins/postcss.mjs +31 -31
- package/plugins/typescript.js +13 -13
- package/plugins/typescript.mjs +13 -13
- package/plugins/yaml.js +1 -1
- package/plugins/yaml.mjs +1 -1
- package/standalone.js +27 -27
- package/standalone.mjs +27 -27
package/plugins/html.js
CHANGED
|
@@ -21,4 +21,4 @@ If '${e}' is a directive input, make sure the directive is imported by the curre
|
|
|
21
21
|
`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let t=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=t,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(l.TEXT,l.INTERPOLATION,()=>this._isTextEnd(),()=>this._isTagStart())}catch(t){this.handleError(t)}}this._beginToken(l.EOF),this._endToken([])}_getBlockName(){let e=!1,t=this._cursor.clone();return this._attemptCharCodeUntilFn(r=>ct(r)?!e:Wo(r)?(e=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeBlockStart(e){this._requireCharCode(64),this._beginToken(l.BLOCK_OPEN_START,e);let t=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(T),this._attemptCharCode(41))this._attemptCharCodeUntilFn(T);else{t.type=l.INCOMPLETE_BLOCK_OPEN;return}this._attemptCharCode(123)?(this._beginToken(l.BLOCK_OPEN_END),this._endToken([])):t.type=l.INCOMPLETE_BLOCK_OPEN}_consumeBlockEnd(e){this._beginToken(l.BLOCK_CLOSE,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(es);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(l.BLOCK_PARAMETER);let e=this._cursor.clone(),t=null,r=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||t!==null;){let n=this._cursor.peek();if(n===92)this._cursor.advance();else if(n===t)t=null;else if(t===null&&Gt(n))t=n;else if(n===40&&t===null)r++;else if(n===41&&t===null){if(r===0)break;r>0&&r--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(es)}}_consumeLetDeclaration(e){if(this._requireStr("@let"),this._beginToken(l.LET_START,e),ct(this._cursor.peek()))this._attemptCharCodeUntilFn(T);else{let r=this._endToken([this._cursor.getChars(e)]);r.type=l.INCOMPLETE_LET;return}let t=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(T),!this._attemptCharCode(61)){t.type=l.INCOMPLETE_LET;return}this._attemptCharCodeUntilFn(r=>T(r)&&!pt(r)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(l.LET_END),this._endToken([]),this._cursor.advance()):(t.type=l.INCOMPLETE_LET,t.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),t=!1;return this._attemptCharCodeUntilFn(r=>Fe(r)||r===36||r===95||t&&ut(r)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(l.LET_VALUE,e);this._cursor.peek()!==0;){let t=this._cursor.peek();if(t===59)break;Gt(t)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(r=>r===92?(this._cursor.advance(),!1):r===t)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(Vo(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,t=this._cursor.clone()){this._currentTokenStart=t,this._currentTokenType=e}_endToken(e,t){if(this._currentTokenStart===null)throw new ne(this._cursor.getSpan(t),"Programming error - attempted to end a token when there was no start to the token");if(this._currentTokenType===null)throw new ne(this._cursor.getSpan(this._currentTokenStart),"Programming error - attempted to end a token which has no token type");let r={type:this._currentTokenType,parts:e,sourceSpan:(t??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(r),this._currentTokenStart=null,this._currentTokenType=null,r}_createError(e,t){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let r=new ne(t,e);return this._currentTokenStart=null,this._currentTokenType=null,r}handleError(e){if(e instanceof Wr&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof ne)this.errors.push(e);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return Uo(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let t=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(t))}_attemptStr(e){let t=e.length;if(this._cursor.charsLeft()<t)return!1;let r=this._cursor.clone();for(let n=0;n<t;n++)if(!this._attemptCharCode(e.charCodeAt(n)))return this._cursor=r,!1;return!0}_attemptStrCaseInsensitive(e){for(let t=0;t<e.length;t++)if(!this._attemptCharCodeCaseInsensitive(e.charCodeAt(t)))return!1;return!0}_requireStr(e){let t=this._cursor.clone();if(!this._attemptStr(e))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(t))}_requireStrCaseInsensitive(e){let t=this._cursor.clone();if(!this._attemptStrCaseInsensitive(e))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(t))}_attemptCharCodeUntilFn(e){for(;!e(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(e,t){let r=this._cursor.clone();if(this._attemptCharCodeUntilFn(e),this._cursor.diff(r)<t)throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(r))}_attemptUntilChar(e){for(;this._cursor.peek()!==e;)this._cursor.advance()}_readChar(){let e=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),e}_peekStr(e){let t=e.length;if(this._cursor.charsLeft()<t)return!1;let r=this._cursor.clone();for(let n=0;n<t;n++){if(r.peek()!==e.charCodeAt(n))return!1;r.advance()}return!0}_isBlockStart(){return this._cursor.peek()===64&&Mo.some(e=>this._peekStr(e))}_isLetStart(){return this._cursor.peek()===64&&this._peekStr("@let")}_consumeEntity(e){this._beginToken(l.ENCODED_ENTITY);let t=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let r=this._attemptCharCode(120)||this._attemptCharCode(88),n=this._cursor.clone();if(this._attemptCharCodeUntilFn(qo),this._cursor.peek()!=59){this._cursor.advance();let s=r?Fr.HEX:Fr.DEC;throw this._createError(Ro(s,this._cursor.getChars(t)),this._cursor.getSpan())}let i=this._cursor.getChars(n);this._cursor.advance();try{let s=parseInt(i,r?16:10);this._endToken([String.fromCodePoint(s),this._cursor.getChars(t)])}catch{throw this._createError(Ji(this._cursor.getChars(t)),this._cursor.getSpan())}}else{let r=this._cursor.clone();if(this._attemptCharCodeUntilFn(Ho),this._cursor.peek()!=59)this._beginToken(e,t),this._cursor=r,this._endToken(["&"]);else{let n=this._cursor.getChars(r);this._cursor.advance();let i=Te.hasOwnProperty(n)&&Te[n];if(!i)throw this._createError(Ji(n),this._cursor.getSpan(t));this._endToken([i,`&${n};`])}}}_consumeRawText(e,t){this._beginToken(e?l.ESCAPABLE_RAW_TEXT:l.RAW_TEXT);let r=[];for(;;){let n=this._cursor.clone(),i=t();if(this._cursor=n,i)break;e&&this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(r.join(""))]),r.length=0,this._consumeEntity(l.ESCAPABLE_RAW_TEXT),this._beginToken(l.ESCAPABLE_RAW_TEXT)):r.push(this._readChar())}this._endToken([this._processCarriageReturns(r.join(""))])}_consumeComment(e){this._beginToken(l.COMMENT_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(l.COMMENT_END),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(e){this._beginToken(l.COMMENT_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(l.COMMENT_END),this._cursor.advance(),this._endToken([])}_consumeCdata(e){this._beginToken(l.CDATA_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(l.CDATA_END),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(l.DOC_TYPE_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(l.DOC_TYPE_END),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(e){let t=this._cursor.clone(),r="";for(;this._cursor.peek()!==58&&!Fo(this._cursor.peek());)this._cursor.advance();let n;this._cursor.peek()===58?(r=this._cursor.getChars(t),this._cursor.advance(),n=this._cursor.clone()):n=t,this._requireCharCodeUntilFn(e,r===""?0:1);let i=this._cursor.getChars(n);return[r,i]}_consumeTagOpen(e){let t,r,n,i,s=[];try{if(this._selectorlessEnabled&&jt(this._cursor.peek()))i=this._consumeComponentOpenStart(e),[n,r,t]=i.parts,r&&(n+=`:${r}`),t&&(n+=`:${t}`),this._attemptCharCodeUntilFn(T);else{if(!Fe(this._cursor.peek()))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(e));i=this._consumeTagOpenStart(e),r=i.parts[0],t=n=i.parts[1],this._attemptCharCodeUntilFn(T)}for(;!rs(this._cursor.peek());)if(this._selectorlessEnabled&&this._cursor.peek()===64){let o=this._cursor.clone(),c=o.clone();c.advance(),jt(c.peek())&&this._consumeDirective(o,c)}else{let o=this._consumeAttribute();s.push(o)}i.type===l.COMPONENT_OPEN_START?this._consumeComponentOpenEnd():this._consumeTagOpenEnd()}catch(o){if(o instanceof ne){i?i.type=i.type===l.COMPONENT_OPEN_START?l.INCOMPLETE_COMPONENT_OPEN:l.INCOMPLETE_TAG_OPEN:(this._beginToken(l.TEXT,e),this._endToken(["<"]));return}throw o}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===l.TAG_OPEN_END_VOID)return;let a=this._getTagContentType(t,r,this._fullNameStack.length>0,s);this._handleFullNameStackForTagOpen(r,t),a===R.RAW_TEXT?this._consumeRawTextWithTagClose(r,i,n,!1):a===R.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,i,n,!0)}_consumeRawTextWithTagClose(e,t,r,n){this._consumeRawText(n,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(T),!this._attemptStrCaseInsensitive(e&&t.type!==l.COMPONENT_OPEN_START?`${e}:${r}`:r))?!1:(this._attemptCharCodeUntilFn(T),this._attemptCharCode(62))),this._beginToken(t.type===l.COMPONENT_OPEN_START?l.COMPONENT_CLOSE:l.TAG_CLOSE),this._requireCharCodeUntilFn(i=>i===62,3),this._cursor.advance(),this._endToken(t.parts),this._handleFullNameStackForTagClose(e,r)}_consumeTagOpenStart(e){this._beginToken(l.TAG_OPEN_START,e);let t=this._consumePrefixAndName(we);return this._endToken(t)}_consumeComponentOpenStart(e){this._beginToken(l.COMPONENT_OPEN_START,e);let t=this._consumeComponentName();return this._endToken(t)}_consumeComponentName(){let e=this._cursor.clone();for(;ts(this._cursor.peek());)this._cursor.advance();let t=this._cursor.getChars(e),r="",n="";return this._cursor.peek()===58&&(this._cursor.advance(),[r,n]=this._consumePrefixAndName(we)),[t,r,n]}_consumeAttribute(){let[e,t]=this._consumeAttributeName(),r;return this._attemptCharCodeUntilFn(T),this._attemptCharCode(61)&&(this._attemptCharCodeUntilFn(T),r=this._consumeAttributeValue()),this._attemptCharCodeUntilFn(T),{prefix:e,name:t,value:r}}_consumeAttributeName(){let e=this._cursor.peek();if(e===39||e===34)throw this._createError(be(e),this._cursor.getSpan());this._beginToken(l.ATTR_NAME);let t;if(this._openDirectiveCount>0){let n=0;t=i=>{if(this._openDirectiveCount>0){if(i===40)n++;else if(i===41){if(n===0)return!0;n--}}return we(i)}}else if(e===91){let n=0;t=i=>(i===91?n++:i===93&&n--,n<=0?we(i):pt(i))}else t=we;let r=this._consumePrefixAndName(t);return this._endToken(r),r}_consumeAttributeValue(){let e;if(this._cursor.peek()===39||this._cursor.peek()===34){let t=this._cursor.peek();this._consumeQuote(t);let r=()=>this._cursor.peek()===t;e=this._consumeWithInterpolation(l.ATTR_VALUE_TEXT,l.ATTR_VALUE_INTERPOLATION,r,r),this._consumeQuote(t)}else{let t=()=>we(this._cursor.peek());e=this._consumeWithInterpolation(l.ATTR_VALUE_TEXT,l.ATTR_VALUE_INTERPOLATION,t,t)}return e}_consumeQuote(e){this._beginToken(l.ATTR_QUOTE),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){let e=this._attemptCharCode(47)?l.TAG_OPEN_END_VOID:l.TAG_OPEN_END;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeComponentOpenEnd(){let e=this._attemptCharCode(47)?l.COMPONENT_OPEN_END_VOID:l.COMPONENT_OPEN_END;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeTagClose(e){if(this._selectorlessEnabled){let t=e.clone();for(;t.peek()!==62&&!jt(t.peek());)t.advance();if(jt(t.peek())){this._beginToken(l.COMPONENT_CLOSE,e);let r=this._consumeComponentName();this._attemptCharCodeUntilFn(T),this._requireCharCode(62),this._endToken(r);return}}if(this._beginToken(l.TAG_CLOSE,e),this._attemptCharCodeUntilFn(T),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(T),this._requireCharCode(62),this._endToken([]);else{let[t,r]=this._consumePrefixAndName(we);this._attemptCharCodeUntilFn(T),this._requireCharCode(62),this._endToken([t,r]),this._handleFullNameStackForTagClose(t,r)}}_consumeExpansionFormStart(){this._beginToken(l.EXPANSION_FORM_START),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(l.EXPANSION_FORM_START),this._beginToken(l.RAW_TEXT);let e=this._readUntil(44),t=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([t]);else{let n=this._endToken([e]);t!==e&&this.nonNormalizedIcuExpressions.push(n)}this._requireCharCode(44),this._attemptCharCodeUntilFn(T),this._beginToken(l.RAW_TEXT);let r=this._readUntil(44);this._endToken([r]),this._requireCharCode(44),this._attemptCharCodeUntilFn(T)}_consumeExpansionCaseStart(){this._beginToken(l.EXPANSION_CASE_VALUE);let e=this._readUntil(123).trim();this._endToken([e]),this._attemptCharCodeUntilFn(T),this._beginToken(l.EXPANSION_CASE_EXP_START),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(T),this._expansionCaseStack.push(l.EXPANSION_CASE_EXP_START)}_consumeExpansionCaseEnd(){this._beginToken(l.EXPANSION_CASE_EXP_END),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(T),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(l.EXPANSION_FORM_END),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,t,r,n){this._beginToken(e);let i=[];for(;!r();){let a=this._cursor.clone();this._attemptStr(ft.start)?(this._endToken([this._processCarriageReturns(i.join(""))],a),i.length=0,this._consumeInterpolation(t,a,n),this._beginToken(e)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(e),this._beginToken(e)):i.push(this._readChar())}this._inInterpolation=!1;let s=this._processCarriageReturns(i.join(""));return this._endToken([s]),s}_consumeInterpolation(e,t,r){let n=[];this._beginToken(e,t),n.push(ft.start);let i=this._cursor.clone(),s=null,a=!1;for(;this._cursor.peek()!==0&&(r===null||!r());){let o=this._cursor.clone();if(this._isTagStart()){this._cursor=o,n.push(this._getProcessedChars(i,o)),this._endToken(n);return}if(s===null)if(this._attemptStr(ft.end)){n.push(this._getProcessedChars(i,o)),n.push(ft.end),this._endToken(n);return}else this._attemptStr("//")&&(a=!0);let c=this._cursor.peek();this._cursor.advance(),c===92?this._cursor.advance():c===s?s=null:!a&&s===null&&Gt(c)&&(s=c)}n.push(this._getProcessedChars(i,this._cursor)),this._endToken(n)}_consumeDirective(e,t){for(this._requireCharCode(64),this._cursor.advance();ts(this._cursor.peek());)this._cursor.advance();this._beginToken(l.DIRECTIVE_NAME,e);let r=this._cursor.getChars(t);if(this._endToken([r]),this._attemptCharCodeUntilFn(T),this._cursor.peek()===40){for(this._openDirectiveCount++,this._beginToken(l.DIRECTIVE_OPEN),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(T);!rs(this._cursor.peek())&&this._cursor.peek()!==41;)this._consumeAttribute();if(this._attemptCharCodeUntilFn(T),this._openDirectiveCount--,this._cursor.peek()!==41){if(this._cursor.peek()===62||this._cursor.peek()===47)return;throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(e))}this._beginToken(l.DIRECTIVE_CLOSE),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(T)}}_getProcessedChars(e,t){return this._processCarriageReturns(t.getChars(e))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._isLetStart()||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let e=this._cursor.clone();e.advance();let t=e.peek();if(97<=t&&t<=122||65<=t&&t<=90||t===47||t===33)return!0}return!1}_readUntil(e){let t=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(t)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===l.EXPANSION_CASE_EXP_START}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===l.EXPANSION_FORM_START}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;let e=this._cursor.clone(),t=this._attemptStr(ft.start);return this._cursor=e,!t}_handleFullNameStackForTagOpen(e,t){let r=Ee(e,t);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===r)&&this._fullNameStack.push(r)}_handleFullNameStackForTagClose(e,t){let r=Ee(e,t);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===r&&this._fullNameStack.pop()}};function T(e){return!ct(e)||e===0}function we(e){return ct(e)||e===62||e===60||e===47||e===39||e===34||e===61||e===0}function Fo(e){return(e<97||122<e)&&(e<65||90<e)&&(e<48||e>57)}function qo(e){return e===59||e===0||!Fi(e)}function Ho(e){return e===59||e===0||!Fe(e)}function Vo(e){return e!==125}function Uo(e,t){return Zi(e)===Zi(t)}function Zi(e){return e>=97&&e<=122?e-97+65:e}function Wo(e){return Fe(e)||ut(e)||e===95}function es(e){return e!==59&&T(e)}function jt(e){return e===95||e>=65&&e<=90}function ts(e){return Fe(e)||ut(e)||e===95}function rs(e){return e===47||e===62||e===60||e===0}function Go(e){let t=[],r;for(let n=0;n<e.length;n++){let i=e[n];r&&r.type===l.TEXT&&i.type===l.TEXT||r&&r.type===l.ATTR_VALUE_TEXT&&i.type===l.ATTR_VALUE_TEXT?(r.parts[0]+=i.parts[0],r.sourceSpan.end=i.sourceSpan.end):(r=i,t.push(r))}return t}var ss=class qr{constructor(t,r){if(t instanceof qr){this.file=t.file,this.input=t.input,this.end=t.end;let n=t.state;this.state={peek:n.peek,offset:n.offset,line:n.line,column:n.column}}else{if(!r)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=t,this.input=t.content,this.end=r.endPos,this.state={peek:-1,offset:r.startPos,line:r.startLine,column:r.startCol}}}clone(){return new qr(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(t){return this.state.offset-t.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(t,r){t=t||this;let n=t;if(r)for(;this.diff(t)>0&&r.indexOf(t.peek())!==-1;)n===t&&(t=t.clone()),t.advance();let i=this.locationFromCursor(t);return new h(i,this.locationFromCursor(this),n!==t?this.locationFromCursor(n):i)}getChars(t){return this.input.substring(t.state.offset,this.state.offset)}charAt(t){return this.input.charCodeAt(t)}advanceState(t){if(t.offset>=this.end)throw this.state=t,new Wr('Unexpected character "EOF"',this);let r=this.charAt(t.offset);r===10?(t.line++,t.column=0):pt(r)||t.column++,t.offset++,this.updatePeek(t)}updatePeek(t){t.peek=t.offset>=this.end?0:this.charAt(t.offset)}locationFromCursor(t){return new qe(t.file,t.state.offset,t.state.line,t.state.column)}},$o=class Hr extends ss{constructor(t,r){t instanceof Hr?(super(t),this.internalState={...t.internalState}):(super(t,r),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new Hr(this)}getChars(t){let r=t.clone(),n="";for(;r.internalState.offset<this.internalState.offset;)n+=String.fromCodePoint(r.peek()),r.advance();return n}processEscapeSequence(){let t=()=>this.internalState.peek;if(t()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),t()===110)this.state.peek=10;else if(t()===114)this.state.peek=13;else if(t()===118)this.state.peek=11;else if(t()===116)this.state.peek=9;else if(t()===98)this.state.peek=8;else if(t()===102)this.state.peek=12;else if(t()===117)if(this.advanceState(this.internalState),t()===123){this.advanceState(this.internalState);let r=this.clone(),n=0;for(;t()!==125;)this.advanceState(this.internalState),n++;this.state.peek=this.decodeHexDigits(r,n)}else{let r=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,4)}else if(t()===120){this.advanceState(this.internalState);let r=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,2)}else if(Lr(t())){let r="",n=0,i=this.clone();for(;Lr(t())&&n<3;)i=this.clone(),r+=String.fromCodePoint(t()),this.advanceState(this.internalState),n++;this.state.peek=parseInt(r,8),this.internalState=i.internalState}else pt(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(t,r){let n=this.input.slice(t.internalState.offset,t.internalState.offset+r),i=parseInt(n,16);if(isNaN(i))throw t.state=t.internalState,new Wr("Invalid hexadecimal escape sequence",t);return i}},Wr=class extends Error{constructor(e,t){super(e),this.msg=e,this.cursor=t,Object.setPrototypeOf(this,new.target.prototype)}};var N=class ls extends ne{static create(t,r,n){return new ls(t,r,n)}constructor(t,r,n){super(r,n),this.elementName=t}},zo=class{constructor(e,t){this.rootNodes=e,this.errors=t}},cs=class{constructor(e){this.getTagDefinition=e}parse(e,t,r,n=!1,i){let s=m=>(g,...E)=>m(g.toLowerCase(),...E),a=n?this.getTagDefinition:s(this.getTagDefinition),o=m=>a(m).getContentType(),c=n?i:s(i),u=is(e,t,i?(m,g,E,P)=>{let z=c(m,g,E,P);return z!==void 0?z:o(m)}:o,r),p=r&&r.canSelfClose||!1,d=r&&r.allowHtmComponentClosingTags||!1,S=new Yo(u.tokens,a,p,d,n);return S.build(),new zo(S.rootNodes,[...u.errors,...S.errors])}},Yo=class us{constructor(t,r,n,i,s){this.tokens=t,this.tagDefinitionResolver=r,this.canSelfClose=n,this.allowHtmComponentClosingTags=i,this.isTagNameCaseSensitive=s,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==l.EOF;)this._peek.type===l.TAG_OPEN_START||this._peek.type===l.INCOMPLETE_TAG_OPEN?this._consumeElementStartTag(this._advance()):this._peek.type===l.TAG_CLOSE?(this._closeVoidElement(),this._consumeElementEndTag(this._advance())):this._peek.type===l.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===l.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===l.TEXT||this._peek.type===l.RAW_TEXT||this._peek.type===l.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===l.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._peek.type===l.BLOCK_OPEN_START?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===l.BLOCK_CLOSE?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===l.INCOMPLETE_BLOCK_OPEN?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===l.LET_START?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===l.DOC_TYPE_START?this._consumeDocType(this._advance()):this._peek.type===l.INCOMPLETE_LET?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._peek.type===l.COMPONENT_OPEN_START||this._peek.type===l.INCOMPLETE_COMPONENT_OPEN?this._consumeComponentStartTag(this._advance()):this._peek.type===l.COMPONENT_CLOSE?this._consumeComponentEndTag(this._advance()):this._advance();for(let t of this._containerStack)t instanceof ve&&this.errors.push(N.create(t.name,t.sourceSpan,`Unclosed block "${t.name}"`))}_advance(){let t=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],t}_advanceIf(t){return this._peek.type===t?this._advance():null}_consumeCdata(t){let r=this._advance(),n=this._getText(r),i=this._advanceIf(l.CDATA_END);this._addToParent(new Ui(n,new h(t.sourceSpan.start,(i||r).sourceSpan.end),[r]))}_consumeComment(t){let r=this._advanceIf(l.RAW_TEXT),n=this._advanceIf(l.COMMENT_END),i=r!=null?r.parts[0].trim():null,s=n==null?t.sourceSpan:new h(t.sourceSpan.start,n.sourceSpan.end,t.sourceSpan.fullStart);this._addToParent(new zi(i,s))}_consumeDocType(t){let r=this._advanceIf(l.RAW_TEXT),n=this._advanceIf(l.DOC_TYPE_END),i=r!=null?r.parts[0].trim():null,s=new h(t.sourceSpan.start,(n||r||t).sourceSpan.end);this._addToParent(new Yi(i,s))}_consumeExpansion(t){let r=this._advance(),n=this._advance(),i=[];for(;this._peek.type===l.EXPANSION_CASE_VALUE;){let a=this._parseExpansionCase();if(!a)return;i.push(a)}if(this._peek.type!==l.EXPANSION_FORM_END){this.errors.push(N.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let s=new h(t.sourceSpan.start,this._peek.sourceSpan.end,t.sourceSpan.fullStart);this._addToParent(new Wi(r.parts[0],n.parts[0],i,s,r.sourceSpan)),this._advance()}_parseExpansionCase(){let t=this._advance();if(this._peek.type!==l.EXPANSION_CASE_EXP_START)return this.errors.push(N.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let r=this._advance(),n=this._collectExpansionExpTokens(r);if(!n)return null;let i=this._advance();n.push({type:l.EOF,parts:[],sourceSpan:i.sourceSpan});let s=new us(n,this.tagDefinitionResolver,this.canSelfClose,this.allowHtmComponentClosingTags,this.isTagNameCaseSensitive);if(s.build(),s.errors.length>0)return this.errors=this.errors.concat(s.errors),null;let a=new h(t.sourceSpan.start,i.sourceSpan.end,t.sourceSpan.fullStart),o=new h(r.sourceSpan.start,i.sourceSpan.end,r.sourceSpan.fullStart);return new Gi(t.parts[0],s.rootNodes,a,t.sourceSpan,o)}_collectExpansionExpTokens(t){let r=[],n=[l.EXPANSION_CASE_EXP_START];for(;;){if((this._peek.type===l.EXPANSION_FORM_START||this._peek.type===l.EXPANSION_CASE_EXP_START)&&n.push(this._peek.type),this._peek.type===l.EXPANSION_CASE_EXP_END)if(as(n,l.EXPANSION_CASE_EXP_START)){if(n.pop(),n.length===0)return r}else return this.errors.push(N.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===l.EXPANSION_FORM_END)if(as(n,l.EXPANSION_FORM_START))n.pop();else return this.errors.push(N.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===l.EOF)return this.errors.push(N.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;r.push(this._advance())}}_getText(t){let r=t.parts[0];if(r.length>0&&r[0]==`
|
|
22
22
|
`){var n;let i=this._getClosestElementLikeParent();i!=null&&i.children.length==0&&(!((n=this._getTagDefinition(i))===null||n===void 0)&&n.ignoreFirstLf)&&(r=r.substring(1))}return r}_consumeText(t){let r=[t],n=t.sourceSpan,i=t.parts[0];if(i.length>0&&i[0]===`
|
|
23
23
|
`){var s;let a=this._getContainer();a!=null&&a.children.length===0&&(!((s=this._getTagDefinition(a))===null||s===void 0)&&s.ignoreFirstLf)&&(i=i.substring(1),r[0]={type:t.type,sourceSpan:t.sourceSpan,parts:[i]})}for(;this._peek.type===l.INTERPOLATION||this._peek.type===l.TEXT||this._peek.type===l.ENCODED_ENTITY;)t=this._advance(),r.push(t),t.type===l.INTERPOLATION?i+=t.parts.join("").replace(/&([^;]+);/g,os):t.type===l.ENCODED_ENTITY?i+=t.parts[0]:i+=t.parts.join("");if(i.length>0){let a=t.sourceSpan;this._addToParent(new Vi(i,new h(n.start,a.end,n.fullStart,n.details),r))}}_closeVoidElement(){var t;let r=this._getContainer();r!==null&&(!((t=this._getTagDefinition(r))===null||t===void 0)&&t.isVoid)&&this._containerStack.pop()}_consumeElementStartTag(t){var r;let n=[],i=[];this._consumeAttributesAndDirectives(n,i);let s=this._getElementFullName(t,this._getClosestElementLikeParent()),a=this._getTagDefinition(s),o=!1;if(this._peek.type===l.TAG_OPEN_END_VOID){this._advance(),o=!0;let E=this._getTagDefinition(s);this.canSelfClose||E?.canSelfClose||Me(s)!==null||E?.isVoid||this.errors.push(N.create(s,t.sourceSpan,`Only void, custom and foreign elements can be self closed "${t.parts[1]}"`))}else this._peek.type===l.TAG_OPEN_END&&(this._advance(),o=!1);let c=this._peek.sourceSpan.fullStart,u=new h(t.sourceSpan.start,c,t.sourceSpan.fullStart),p=new h(t.sourceSpan.start,c,t.sourceSpan.fullStart),d=new h(t.sourceSpan.start.moveBy(1),t.sourceSpan.end),S=new ie(s,n,i,[],o,u,p,void 0,d,a?.isVoid??!1),m=this._getContainer(),g=m!==null&&!!(!((r=this._getTagDefinition(m))===null||r===void 0)&&r.isClosedByChild(S.name));this._pushContainer(S,g),o?this._popContainer(s,ie,u):t.type===l.INCOMPLETE_TAG_OPEN&&(this._popContainer(s,ie,null),this.errors.push(N.create(s,u,`Opening tag "${s}" not terminated.`)))}_consumeComponentStartTag(t){var r;let n=t.parts[0],i=[],s=[];this._consumeAttributesAndDirectives(i,s);let a=this._getClosestElementLikeParent(),o=this._getComponentTagName(t,a),c=this._getComponentFullName(t,a),u=this._peek.type===l.COMPONENT_OPEN_END_VOID;this._advance();let p=this._peek.sourceSpan.fullStart,d=new h(t.sourceSpan.start,p,t.sourceSpan.fullStart),S=new h(t.sourceSpan.start,p,t.sourceSpan.fullStart),m=new J(n,o,c,i,s,[],u,d,S,void 0),g=this._getContainer(),E=g!==null&&m.tagName!==null&&!!(!((r=this._getTagDefinition(g))===null||r===void 0)&&r.isClosedByChild(m.tagName));this._pushContainer(m,E),u?this._popContainer(c,J,d):t.type===l.INCOMPLETE_COMPONENT_OPEN&&(this._popContainer(c,J,null),this.errors.push(N.create(c,d,`Opening tag "${c}" not terminated.`)))}_consumeAttributesAndDirectives(t,r){for(;this._peek.type===l.ATTR_NAME||this._peek.type===l.DIRECTIVE_NAME;)this._peek.type===l.DIRECTIVE_NAME?r.push(this._consumeDirective(this._peek)):t.push(this._consumeAttr(this._advance()))}_consumeComponentEndTag(t){let r=this._getComponentFullName(t,this._getClosestElementLikeParent());if(!this._popContainer(r,J,t.sourceSpan)){let n=this._containerStack[this._containerStack.length-1],i;n instanceof J&&n.componentName===t.parts[0]?i=`, did you mean "${n.fullName}"?`:i=". It may happen when the tag has already been closed by another tag.";let s=`Unexpected closing tag "${r}"${i}`;this.errors.push(N.create(r,t.sourceSpan,s))}}_getTagDefinition(t){return typeof t=="string"?this.tagDefinitionResolver(t):t instanceof ie?this.tagDefinitionResolver(t.name):t instanceof J&&t.tagName!==null?this.tagDefinitionResolver(t.tagName):null}_pushContainer(t,r){r&&this._containerStack.pop(),this._addToParent(t),this._containerStack.push(t)}_consumeElementEndTag(t){var r;let n=this.allowHtmComponentClosingTags&&t.parts.length===0?null:this._getElementFullName(t,this._getClosestElementLikeParent());if(n&&(!((r=this._getTagDefinition(n))===null||r===void 0)&&r.isVoid))this.errors.push(N.create(n,t.sourceSpan,`Void elements do not have end tags "${t.parts[1]}"`));else if(!this._popContainer(n,ie,t.sourceSpan)){let i=`Unexpected closing tag "${n}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(N.create(n,t.sourceSpan,i))}}_popContainer(t,r,n){let i=!1;for(let a=this._containerStack.length-1;a>=0;a--){var s;let o=this._containerStack[a],c=o instanceof J?o.fullName:o.name;if(Me(c)?c===t:(c===t||t===null)&&o instanceof r)return o.endSourceSpan=n,o.sourceSpan.end=n!==null?n.end:o.sourceSpan.end,this._containerStack.splice(a,this._containerStack.length-a),!i;(o instanceof ve||!(!((s=this._getTagDefinition(o))===null||s===void 0)&&s.closedByParent))&&(i=!0)}return!1}_consumeAttr(t){let r=Ee(t.parts[0],t.parts[1]),n=t.sourceSpan.end,i;this._peek.type===l.ATTR_QUOTE&&(i=this._advance());let s="",a=[],o,c;if(this._peek.type===l.ATTR_VALUE_TEXT)for(o=this._peek.sourceSpan,c=this._peek.sourceSpan.end;this._peek.type===l.ATTR_VALUE_TEXT||this._peek.type===l.ATTR_VALUE_INTERPOLATION||this._peek.type===l.ENCODED_ENTITY;){let p=this._advance();a.push(p),p.type===l.ATTR_VALUE_INTERPOLATION?s+=p.parts.join("").replace(/&([^;]+);/g,os):p.type===l.ENCODED_ENTITY?s+=p.parts[0]:s+=p.parts.join(""),c=n=p.sourceSpan.end}this._peek.type===l.ATTR_QUOTE&&(c=n=this._advance().sourceSpan.end);let u=o&&c&&new h(i?.sourceSpan.start??o.start,c,i?.sourceSpan.fullStart??o.fullStart);return new $i(r,s,new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),t.sourceSpan,u,a.length>0?a:void 0,void 0)}_consumeDirective(t){let r=[],n=t.sourceSpan.end,i=null;if(this._advance(),this._peek.type===l.DIRECTIVE_OPEN){for(n=this._peek.sourceSpan.end,this._advance();this._peek.type===l.ATTR_NAME;)r.push(this._consumeAttr(this._advance()));this._peek.type===l.DIRECTIVE_CLOSE?(i=this._peek.sourceSpan,this._advance()):this.errors.push(N.create(null,t.sourceSpan,"Unterminated directive definition"))}let s=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),a=new h(s.start,i===null?t.sourceSpan.end:i.end,s.fullStart);return new ji(t.parts[0],r,a,s,i)}_consumeBlockOpen(t){let r=[];for(;this._peek.type===l.BLOCK_PARAMETER;){let o=this._advance();r.push(new Pr(o.parts[0],o.sourceSpan))}this._peek.type===l.BLOCK_OPEN_END&&this._advance();let n=this._peek.sourceSpan.fullStart,i=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),s=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),a=new ve(t.parts[0],r,[],i,t.sourceSpan,s);this._pushContainer(a,!1)}_consumeBlockClose(t){this._popContainer(null,ve,t.sourceSpan)||this.errors.push(N.create(null,t.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(t){let r=[];for(;this._peek.type===l.BLOCK_PARAMETER;){let o=this._advance();r.push(new Pr(o.parts[0],o.sourceSpan))}let n=this._peek.sourceSpan.fullStart,i=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),s=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),a=new ve(t.parts[0],r,[],i,t.sourceSpan,s);this._pushContainer(a,!1),this._popContainer(null,ve,null),this.errors.push(N.create(t.parts[0],i,`Incomplete block "${t.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(t){let r=t.parts[0],n,i;if(this._peek.type!==l.LET_VALUE){this.errors.push(N.create(t.parts[0],t.sourceSpan,`Invalid @let declaration "${r}". Declaration must have a value.`));return}else n=this._advance();if(this._peek.type!==l.LET_END){this.errors.push(N.create(t.parts[0],t.sourceSpan,`Unterminated @let declaration "${r}". Declaration must be terminated with a semicolon.`));return}else i=this._advance();let s=i.sourceSpan.fullStart,a=new h(t.sourceSpan.start,s,t.sourceSpan.fullStart),o=t.sourceSpan.toString().lastIndexOf(r),c=new h(t.sourceSpan.start.moveBy(o),t.sourceSpan.end),u=new Or(r,n.parts[0],a,c,n.sourceSpan);this._addToParent(u)}_consumeIncompleteLet(t){let r=t.parts[0]??"",n=r?` "${r}"`:"";if(r.length>0){let i=t.sourceSpan.toString().lastIndexOf(r),s=new h(t.sourceSpan.start.moveBy(i),t.sourceSpan.end),a=new h(t.sourceSpan.start,t.sourceSpan.start.moveBy(0)),o=new Or(r,"",t.sourceSpan,s,a);this._addToParent(o)}this.errors.push(N.create(t.parts[0],t.sourceSpan,`Incomplete @let declaration${n}. @let declarations must be written as \`@let <name> = <value>;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestElementLikeParent(){for(let t=this._containerStack.length-1;t>-1;t--){let r=this._containerStack[t];if(r instanceof ie||r instanceof J)return r}return null}_addToParent(t){let r=this._getContainer();r===null?this.rootNodes.push(t):r.children.push(t)}_getElementFullName(t,r){return Ee(this._getPrefix(t,r),t.parts[1])}_getComponentFullName(t,r){let n=t.parts[0],i=this._getComponentTagName(t,r);return i===null?n:i.startsWith(":")?n+i:`${n}:${i}`}_getComponentTagName(t,r){let n=this._getPrefix(t,r),i=t.parts[2];return!n&&!i?null:!n&&i?i:Ee(n,i||"ng-component")}_getPrefix(t,r){var n;let i,s;if(t.type===l.COMPONENT_OPEN_START||t.type===l.INCOMPLETE_COMPONENT_OPEN||t.type===l.COMPONENT_CLOSE?(i=t.parts[1],s=t.parts[2]):(i=t.parts[0],s=t.parts[1]),i=i||((n=this._getTagDefinition(s))===null||n===void 0?void 0:n.implicitNamespacePrefix)||"",!i&&r){let a=r instanceof ie?r.name:r.tagName;if(a!==null){let o=at(a)[1],c=this._getTagDefinition(o);c!==null&&!c.preventNamespaceInheritance&&(i=Me(a))}}return i}};function as(e,t){return e.length>0&&e[e.length-1]===t}function os(e,t){return Te[t]!==void 0?Te[t]||e:/^#x[a-f0-9]+$/i.test(t)?String.fromCodePoint(parseInt(t.slice(2),16)):/^#\d+$/.test(t)?String.fromCodePoint(parseInt(t.slice(1),10)):e}var ps=class extends cs{constructor(){super(Be)}parse(e,t,r,n=!1,i){return super.parse(e,t,r,n,i)}};var Gr=null,jo=()=>(Gr||(Gr=new ps),Gr);function Zt(e,t={}){let{canSelfClose:r=!1,allowHtmComponentClosingTags:n=!1,isTagNameCaseSensitive:i=!1,getTagContentType:s,tokenizeAngularBlocks:a=!1,tokenizeAngularLetDeclaration:o=!1,enableAngularSelectorlessSyntax:c=!1}=t;return jo().parse(e,"angular-html-parser",{tokenizeExpansionForms:a,canSelfClose:r,allowHtmComponentClosingTags:n,tokenizeBlocks:a,tokenizeLet:o,selectorlessEnabled:c},i,s)}var Xo=[Qo,Jo,el,rl,nl,al,il,sl,ol,tl];function Ko(e,t){for(let r of Xo)r(e,t);return e}function Qo(e){e.walk(t=>{if(t.kind==="element"&&t.tagDefinition.ignoreFirstLf&&t.children.length>0&&t.children[0].kind==="text"&&t.children[0].value[0]===`
|
|
24
|
-
`){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function Jo(e){let t=r=>r.kind==="element"&&r.prev?.kind==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&r.firstChild?.kind==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset;e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.firstChild;r.removeChild(s),n--;let o=new h(s.sourceSpan.start,a.sourceSpan.end),c=new h(o.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=c,i.startSourceSpan=o,i.removeChild(a)}})}function Zo(e,t,r){e.walk(n=>{if(n.children)for(let i=0;i<n.children.length;i++){let s=n.children[i];if(s.kind!=="text"&&!t(s))continue;s.kind!=="text"&&(s.kind="text",s.value=r(s));let a=s.prev;!a||a.kind!=="text"||(a.value+=s.value,a.sourceSpan=new h(a.sourceSpan.start,s.sourceSpan.end),n.removeChild(s),i--)}})}function el(e){return Zo(e,t=>t.kind==="cdata",t=>`<![CDATA[${t.value}]]>`)}function tl(e){let t=r=>r.kind==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.kind==="text"&&!y.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&r.prev?.kind==="text"&&r.next?.kind==="text";e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+a.value,s.sourceSpan=new h(s.sourceSpan.start,a.sourceSpan.end),s.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,s.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(i),n--,r.removeChild(a)}})}function rl(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/s;e.walk(n=>{if(An(n,t))for(let i of n.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,a=null,o=i.value.split(r);for(let c=0;c<o.length;c++,s=a){let u=o[c];if(c%2===0){a=s.moveBy(u.length),u.length>0&&n.insertChildBefore(i,{kind:"text",value:u,sourceSpan:new h(s,a)});continue}a=s.moveBy(u.length+4),n.insertChildBefore(i,{kind:"interpolation",sourceSpan:new h(s,a),children:u.length===0?[]:[{kind:"text",value:u,sourceSpan:new h(s.moveBy(2),a.moveBy(-2))}]})}n.removeChild(i)}})}function nl(e,t){e.walk(r=>{let n=r.$children;if(!n)return;if(n.length===0||n.length===1&&n[0].kind==="text"&&y.trim(n[0].value).length===0){r.hasDanglingSpaces=n.length>0,r.$children=[];return}let i=yn(r,t),s=_r(r);if(!i)for(let a=0;a<n.length;a++){let o=n[a];if(o.kind!=="text")continue;let{leadingWhitespace:c,text:u,trailingWhitespace:p}=xn(o.value),d=o.prev,S=o.next;u?(o.value=u,o.sourceSpan=new h(o.sourceSpan.start.moveBy(c.length),o.sourceSpan.end.moveBy(-p.length)),c&&(d&&(d.hasTrailingSpaces=!0),o.hasLeadingSpaces=!0),p&&(o.hasTrailingSpaces=!0,S&&(S.hasLeadingSpaces=!0))):(r.removeChild(o),a--,(c||p)&&(d&&(d.hasTrailingSpaces=!0),S&&(S.hasLeadingSpaces=!0)))}r.isWhitespaceSensitive=i,r.isIndentationSensitive=s})}function il(e){e.walk(t=>{t.isSelfClosing=!t.children||t.kind==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function sl(e,t){e.walk(r=>{r.kind==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function al(e,t){e.walk(r=>{r.cssDisplay=Fn(r,t)})}function ol(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=Pn(r,t);return}for(let i of n)i.isLeadingSpaceSensitive=Nn(i,t),i.isTrailingSpaceSensitive=Ln(i,t);for(let i=0;i<n.length;i++){let s=n[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===n.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var hs=Ko;function ll(e,t,r){let{node:n}=e;switch(n.kind){case"root":return t.__onHtmlRoot&&t.__onHtmlRoot(n),[C(Re(e,t,r)),v];case"element":case"ieConditionalComment":return Oi(e,t,r);case"angularControlFlowBlock":return Ai(e,t,r);case"angularControlFlowBlockParameters":return Ni(e,t,r);case"angularControlFlowBlockParameter":return y.trim(n.expression);case"angularLetDeclaration":return C(["@let ",C([n.id," =",C(A([_,r("init")]))]),";"]);case"angularLetDeclarationInitializer":return n.value;case"angularIcuExpression":return Li(e,t,r);case"angularIcuCase":return Pi(e,t,r);case"ieConditionalStartComment":case"ieConditionalEndComment":return[Se(n),fe(n)];case"interpolation":return[Se(n,t),...e.map(r,"children"),fe(n,t)];case"text":{if(n.parent.kind==="interpolation"){let o=/\n[^\S\n]*$/,c=o.test(n.value),u=c?n.value.replace(o,""):n.value;return[L(u),c?v:""]}let i=U(n,t),s=Rt(n),a=V(n,t);return s[0]=[i,s[0]],s.push([s.pop(),a]),At(s)}case"docType":return[C([Se(n,t)," ",w(0,n.value.replace(/^html\b/i,"html"),/\s+/g," ")]),fe(n,t)];case"comment":return[U(n,t),L(t.originalText.slice(Q(n),te(n))),V(n,t)];case"attribute":{if(n.value===null)return n.rawName;let i=Cr(n.value),s=Bt(n,t)?"":hn(i,'"');return[n.rawName,"=",s,L(s==='"'?w(0,i,'"',"""):w(0,i,"'","'")),s]}case"frontMatter":case"cdata":default:throw new fn(n,"HTML")}}var cl={features:{experimental_frontMatterSupport:{massageAstNode:!0,embed:!0,print:!0}},preprocess:hs,print:ll,insertPragma:wi,massageAstNode:gn,embed:di,getVisitorKeys:Si},ms=cl;var fs=[{name:"Angular",type:"markup",aceMode:"html",extensions:[".component.html"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["angular"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"HTML",type:"markup",aceMode:"html",extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["html"],vscodeLanguageIds:["html"],linguistLanguageId:146},{name:"Lightning Web Components",type:"markup",aceMode:"html",extensions:[],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"MJML",type:"markup",aceMode:"html",extensions:[".mjml"],tmScope:"text.mjml.basic",aliases:["MJML","mjml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["mjml"],filenames:[],vscodeLanguageIds:["mjml"],linguistLanguageId:146},{name:"Vue",type:"markup",aceMode:"vue",extensions:[".vue"],tmScope:"source.vue",codemirrorMode:"vue",codemirrorMimeType:"text/x-vue",parsers:["vue"],vscodeLanguageIds:["vue"],linguistLanguageId:391}];var $r={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ds="HTML",ul={bracketSameLine:$r.bracketSameLine,htmlWhitespaceSensitivity:{category:ds,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:$r.singleAttributePerLine,vueIndentScriptAndStyle:{category:ds,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},gs=ul;var Zr={};tn(Zr,{angular:()=>Ll,html:()=>Al,lwc:()=>Ol,mjml:()=>Nl,vue:()=>Pl});function pl(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var _s=pl;var hl={canSelfClose:!0,normalizeTagName:!1,normalizeAttributeName:!1,allowHtmComponentClosingTags:!1,isTagNameCaseSensitive:!1,shouldParseFrontMatter:!0};function er(e){return{...hl,...e}}function zr(e){let{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,shouldParseAsRawText:i,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}=e;return{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,getTagContentType:i?(...o)=>i(...o)?R.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}}var tr=new Map([["*",new Set(["accesskey","autocapitalize","autocorrect","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["command","commandfor","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["closedby","open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alpha","alt","autocomplete","checked","colorspace","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]);var Ss=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fencedframe","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","selectedcontent","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);var rr={attrs:!0,children:!0,cases:!0,expression:!0},Es=new Set(["parent"]),oe,Yr,jr,We=class We{constructor(t={}){rn(this,oe);ar(this,"kind");ar(this,"parent");for(let r of new Set([...Es,...Object.keys(t)]))this.setProperty(r,t[r]);if(ce(t))for(let r of Object.getOwnPropertySymbols(t))this.setProperty(r,t[r])}setProperty(t,r){if(this[t]!==r){if(t in rr&&(r=r.map(n=>this.createChild(n))),!Es.has(t)){this[t]=r;return}Object.defineProperty(this,t,{value:r,enumerable:!1,configurable:!0})}}map(t){let r;for(let n in rr){let i=this[n];if(i){let s=ml(i,a=>a.map(t));r!==i&&(r||(r=new We({parent:this.parent})),r.setProperty(n,s))}}if(r)for(let n in this)n in rr||(r[n]=this[n]);return t(r||this)}walk(t){for(let r in rr){let n=this[r];if(n)for(let i=0;i<n.length;i++)n[i].walk(t)}t(this)}createChild(t){let r=t instanceof We?t.clone():new We(t);return r.setProperty("parent",this),r}insertChildBefore(t,r){let n=this.$children;n.splice(n.indexOf(t),0,this.createChild(r))}removeChild(t){let r=this.$children;r.splice(r.indexOf(t),1)}replaceChild(t,r){let n=this.$children;n[n.indexOf(t)]=this.createChild(r)}clone(){return new We(this)}get $children(){return this[$e(this,oe,Yr)]}set $children(t){this[$e(this,oe,Yr)]=t}get firstChild(){return this.$children?.[0]}get lastChild(){return F(1,this.$children,-1)}get prev(){let t=$e(this,oe,jr);return t[t.indexOf(this)-1]}get next(){let t=$e(this,oe,jr);return t[t.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(t=>[t.fullName,t.value]))}};oe=new WeakSet,Yr=function(){return this.kind==="angularIcuCase"?"expression":this.kind==="angularIcuExpression"?"cases":"children"},jr=function(){return this.parent?.$children??[]};var nr=We;function ml(e,t){let r=e.map(t);return r.some((n,i)=>n!==e[i])?r:e}var fl=[{regex:/^(?<openingTagSuffix>\[if(?<condition>[^\]]*)\]>)(?<data>.*?)<!\s*\[endif\]$/s,parse:dl},{regex:/^\[if(?<condition>[^\]]*)\]><!$/,parse:gl},{regex:/^<!\s*\[endif\]$/,parse:_l}];function Cs(e,t){if(e.value)for(let{regex:r,parse:n}of fl){let i=e.value.match(r);if(i)return n(e,i,t)}return null}function dl(e,t,r){let{openingTagSuffix:n,condition:i,data:s}=t.groups,a=4+n.length,o=e.sourceSpan.start.moveBy(a),c=o.moveBy(s.length),[u,p]=(()=>{try{return[!0,r(s,o).children]}catch{return[!1,[{kind:"text",value:s,sourceSpan:new h(o,c)}]]}})();return{kind:"ieConditionalComment",complete:u,children:p,condition:w(0,i.trim(),/\s+/g," "),sourceSpan:e.sourceSpan,startSourceSpan:new h(e.sourceSpan.start,o),endSourceSpan:new h(c,e.sourceSpan.end)}}function gl(e,t){let{condition:r}=t.groups;return{kind:"ieConditionalStartComment",condition:w(0,r.trim(),/\s+/g," "),sourceSpan:e.sourceSpan}}function _l(e){return{kind:"ieConditionalEndComment",sourceSpan:e.sourceSpan}}var Xr=class extends Dr{visitExpansionCase(t,r){r.parseOptions.name==="angular"&&this.visitChildren(r,n=>{n(t.expression)})}visit(t,{parseOptions:r}){vl(t),Tl(t,r),wl(t,r),bl(t)}};function bs(e,t,r,n){$t(new Xr,e.children,{parseOptions:r}),t&&e.children.unshift(t);let i=new nr(e);return i.walk(s=>{if(s.kind==="comment"){let a=Cs(s,n);a&&s.parent.replaceChild(s,a)}Sl(s),El(s),Cl(s)}),i}function Sl(e){if(e.kind==="block"){if(e.name=w(0,e.name.toLowerCase(),/\s+/g," ").trim(),e.kind="angularControlFlowBlock",!Ie(e.parameters)){delete e.parameters;return}for(let t of e.parameters)t.kind="angularControlFlowBlockParameter";e.parameters={kind:"angularControlFlowBlockParameters",children:e.parameters,sourceSpan:new h(e.parameters[0].sourceSpan.start,F(0,e.parameters,-1).sourceSpan.end)}}}function El(e){e.kind==="letDeclaration"&&(e.kind="angularLetDeclaration",e.id=e.name,e.init={kind:"angularLetDeclarationInitializer",sourceSpan:new h(e.valueSpan.start,e.valueSpan.end),value:e.value},delete e.name,delete e.value)}function Cl(e){e.kind==="expansion"&&(e.kind="angularIcuExpression"),e.kind==="expansionCase"&&(e.kind="angularIcuCase")}function vs(e,t){let r=e.toLowerCase();return t(r)?r:e}function Ts(e){let t=e.name.startsWith(":")?e.name.slice(1).split(":")[0]:null,r=e.nameSpan.toString(),n=t!==null&&r.startsWith(`${t}:`),i=n?r.slice(t.length+1):r;e.name=i,e.namespace=t,e.hasExplicitNamespace=n}function vl(e){switch(e.kind){case"element":Ts(e);for(let t of e.attrs)Ts(t),t.valueSpan?(t.value=t.valueSpan.toString(),/["']/.test(t.value[0])&&(t.value=t.value.slice(1,-1))):t.value=null;break;case"comment":e.value=e.sourceSpan.toString().slice(4,-3);break;case"text":e.value=e.sourceSpan.toString();break}}function Tl(e,t){if(e.kind==="element"){let r=Be(t.isTagNameCaseSensitive?e.name:e.name.toLowerCase());!e.namespace||e.namespace===r.implicitNamespacePrefix||ue(e)?e.tagDefinition=r:e.tagDefinition=Be("")}}function bl(e){e.sourceSpan&&e.endSourceSpan&&(e.sourceSpan=new h(e.sourceSpan.start,e.endSourceSpan.end))}function wl(e,t){if(e.kind==="element"&&(t.normalizeTagName&&(!e.namespace||e.namespace===e.tagDefinition.implicitNamespacePrefix||ue(e))&&(e.name=vs(e.name,r=>Ss.has(r))),t.normalizeAttributeName))for(let r of e.attrs)r.namespace||(r.name=vs(r.name,n=>tr.has(e.name)&&(tr.get("*").has(n)||tr.get(e.name).has(n))))}function Qr(e,t){let{rootNodes:r,errors:n}=Zt(e,zr(t));return n.length>0&&Kr(n[0]),{parseOptions:t,rootNodes:r}}function ws(e,t){let r=zr(t),{rootNodes:n,errors:i}=Zt(e,r);if(n.some(u=>u.kind==="docType"&&u.value==="html"||u.kind==="element"&&u.name.toLowerCase()==="html"))return Qr(e,ir);let a,o=()=>a??(a=Zt(e,{...r,getTagContentType:void 0})),c=u=>{let{offset:p}=u.startSourceSpan.start;return o().rootNodes.find(d=>d.kind==="element"&&d.startSourceSpan.start.offset===p)??u};for(let[u,p]of n.entries())if(p.kind==="element"){if(p.isVoid)i=o().errors,n[u]=c(p);else if(kl(p)){let{endSourceSpan:d,startSourceSpan:S}=p,m=o().errors.find(g=>g.span.start.offset>S.start.offset&&g.span.start.offset<d.end.offset);m&&Kr(m),n[u]=c(p)}}return i.length>0&&Kr(i[0]),{parseOptions:t,rootNodes:n}}function kl(e){if(e.kind!=="element"||e.name!=="template")return!1;let t=e.attrs.find(r=>r.name==="lang")?.value;return!t||t==="html"}function Kr(e){let{msg:t,span:{start:r,end:n}}=e;throw _s(t,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:e})}function xl(e,t,r,n,i,s){let{offset:a}=n,o=Lt(t.slice(0,a))+r,c=Jr(o,e,{...i,shouldParseFrontMatter:!1},s);c.sourceSpan=new h(n,F(0,c.children,-1).sourceSpan.end);let u=c.children[0];return u.length===a?c.children.shift():(u.sourceSpan=new h(u.sourceSpan.start.moveBy(a),u.sourceSpan.end),u.value=u.value.slice(a)),c}function Jr(e,t,r,n={}){let{frontMatter:i,content:s}=r.shouldParseFrontMatter?mr(e):{content:e},a=new mt(e,n.filepath),o=new qe(a,0,0,0),c=o.moveBy(e.length),{parseOptions:u,rootNodes:p}=t(s,r),d={kind:"root",sourceSpan:new h(o,c),children:p},S;if(i){let[g,E]=[i.start,i.end].map(P=>new qe(a,P.index,P.line-1,P.column));S={...i,kind:"frontMatter",sourceSpan:new h(g,E)}}return bs(d,S,u,(g,E)=>xl(t,e,g,E,u,n))}var ir=er({name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0});function gt(e){let t=er(e),r=t.name==="vue"?ws:Qr;return{parse:(n,i)=>Jr(n,r,t,i),hasPragma:Ti,hasIgnorePragma:bi,astFormat:"html",locStart:Q,locEnd:te}}var Al=gt(ir),yl=new Set(["mj-style","mj-raw"]),Nl=gt({...ir,name:"mjml",shouldParseAsRawText:e=>yl.has(e)}),Ll=gt({name:"angular",tokenizeAngularBlocks:!0,tokenizeAngularLetDeclaration:!0}),Pl=gt({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(e,t,r,n){return e.toLowerCase()!=="html"&&!r&&(e!=="template"||n.some(({name:i,value:s})=>i==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),Ol=gt({name:"lwc",canSelfClose:!1});var Dl={html:ms};return Ls(Il);});
|
|
24
|
+
`){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function Jo(e){let t=r=>r.kind==="element"&&r.prev?.kind==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&r.firstChild?.kind==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset;e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.firstChild;r.removeChild(s),n--;let o=new h(s.sourceSpan.start,a.sourceSpan.end),c=new h(o.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=c,i.startSourceSpan=o,i.removeChild(a)}})}function Zo(e,t,r){e.walk(n=>{if(n.children)for(let i=0;i<n.children.length;i++){let s=n.children[i];if(s.kind!=="text"&&!t(s))continue;s.kind!=="text"&&(s.kind="text",s.value=r(s));let a=s.prev;!a||a.kind!=="text"||(a.value+=s.value,a.sourceSpan=new h(a.sourceSpan.start,s.sourceSpan.end),n.removeChild(s),i--)}})}function el(e){return Zo(e,t=>t.kind==="cdata",t=>`<![CDATA[${t.value}]]>`)}function tl(e){let t=r=>r.kind==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.kind==="text"&&!y.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&r.prev?.kind==="text"&&r.next?.kind==="text";e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+a.value,s.sourceSpan=new h(s.sourceSpan.start,a.sourceSpan.end),s.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,s.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(i),n--,r.removeChild(a)}})}function rl(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/s;e.walk(n=>{if(An(n,t))for(let i of n.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,a=null,o=i.value.split(r);for(let c=0;c<o.length;c++,s=a){let u=o[c];if(c%2===0){a=s.moveBy(u.length),u.length>0&&n.insertChildBefore(i,{kind:"text",value:u,sourceSpan:new h(s,a)});continue}a=s.moveBy(u.length+4),n.insertChildBefore(i,{kind:"interpolation",sourceSpan:new h(s,a),children:u.length===0?[]:[{kind:"text",value:u,sourceSpan:new h(s.moveBy(2),a.moveBy(-2))}]})}n.removeChild(i)}})}function nl(e,t){e.walk(r=>{let n=r.$children;if(!n)return;if(n.length===0||n.length===1&&n[0].kind==="text"&&y.trim(n[0].value).length===0){r.hasDanglingSpaces=n.length>0,r.$children=[];return}let i=yn(r,t),s=_r(r);if(!i)for(let a=0;a<n.length;a++){let o=n[a];if(o.kind!=="text")continue;let{leadingWhitespace:c,text:u,trailingWhitespace:p}=xn(o.value),d=o.prev,S=o.next;u?(o.value=u,o.sourceSpan=new h(o.sourceSpan.start.moveBy(c.length),o.sourceSpan.end.moveBy(-p.length)),c&&(d&&(d.hasTrailingSpaces=!0),o.hasLeadingSpaces=!0),p&&(o.hasTrailingSpaces=!0,S&&(S.hasLeadingSpaces=!0))):(r.removeChild(o),a--,(c||p)&&(d&&(d.hasTrailingSpaces=!0),S&&(S.hasLeadingSpaces=!0)))}r.isWhitespaceSensitive=i,r.isIndentationSensitive=s})}function il(e){e.walk(t=>{t.isSelfClosing=!t.children||t.kind==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function sl(e,t){e.walk(r=>{r.kind==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function al(e,t){e.walk(r=>{r.cssDisplay=Fn(r,t)})}function ol(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=Pn(r,t);return}for(let i of n)i.isLeadingSpaceSensitive=Nn(i,t),i.isTrailingSpaceSensitive=Ln(i,t);for(let i=0;i<n.length;i++){let s=n[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===n.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var hs=Ko;function ll(e,t,r){let{node:n}=e;switch(n.kind){case"root":return t.__onHtmlRoot&&t.__onHtmlRoot(n),[C(Re(e,t,r)),v];case"element":case"ieConditionalComment":return Oi(e,t,r);case"angularControlFlowBlock":return Ai(e,t,r);case"angularControlFlowBlockParameters":return Ni(e,t,r);case"angularControlFlowBlockParameter":return y.trim(n.expression);case"angularLetDeclaration":return C(["@let ",C([n.id," =",C(A([_,r("init")]))]),";"]);case"angularLetDeclarationInitializer":return n.value;case"angularIcuExpression":return Li(e,t,r);case"angularIcuCase":return Pi(e,t,r);case"ieConditionalStartComment":case"ieConditionalEndComment":return[Se(n),fe(n)];case"interpolation":return[Se(n,t),...e.map(r,"children"),fe(n,t)];case"text":{if(n.parent.kind==="interpolation"){let o=/\n[^\S\n]*$/,c=o.test(n.value),u=c?n.value.replace(o,""):n.value;return[L(u),c?v:""]}let i=U(n,t),s=Rt(n),a=V(n,t);return s[0]=[i,s[0]],s.push([s.pop(),a]),At(s)}case"docType":return[C([Se(n,t)," ",w(0,n.value.replace(/^html\b/i,"html"),/\s+/g," ")]),fe(n,t)];case"comment":return[U(n,t),L(t.originalText.slice(Q(n),te(n))),V(n,t)];case"attribute":{if(n.value===null)return n.rawName;let i=Cr(n.value),s=Bt(n,t)?"":hn(i,'"');return[n.rawName,"=",s,L(s==='"'?w(0,i,'"',"""):w(0,i,"'","'")),s]}default:throw new fn(n,"HTML")}}var cl={features:{experimental_frontMatterSupport:{massageAstNode:!0,embed:!0,print:!0}},preprocess:hs,print:ll,insertPragma:wi,massageAstNode:gn,embed:di,getVisitorKeys:Si},ms=cl;var fs=[{name:"Angular",type:"markup",aceMode:"html",extensions:[".component.html"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["angular"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"HTML",type:"markup",aceMode:"html",extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["html"],vscodeLanguageIds:["html"],linguistLanguageId:146},{name:"Lightning Web Components",type:"markup",aceMode:"html",extensions:[],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"MJML",type:"markup",aceMode:"html",extensions:[".mjml"],tmScope:"text.mjml.basic",aliases:["MJML","mjml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["mjml"],filenames:[],vscodeLanguageIds:["mjml"],linguistLanguageId:146},{name:"Vue",type:"markup",aceMode:"vue",extensions:[".vue"],tmScope:"source.vue",codemirrorMode:"vue",codemirrorMimeType:"text/x-vue",parsers:["vue"],vscodeLanguageIds:["vue"],linguistLanguageId:391}];var $r={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ds="HTML",ul={bracketSameLine:$r.bracketSameLine,htmlWhitespaceSensitivity:{category:ds,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:$r.singleAttributePerLine,vueIndentScriptAndStyle:{category:ds,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},gs=ul;var Zr={};tn(Zr,{angular:()=>Ll,html:()=>Al,lwc:()=>Ol,mjml:()=>Nl,vue:()=>Pl});function pl(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var _s=pl;var hl={canSelfClose:!0,normalizeTagName:!1,normalizeAttributeName:!1,allowHtmComponentClosingTags:!1,isTagNameCaseSensitive:!1,shouldParseFrontMatter:!0};function er(e){return{...hl,...e}}function zr(e){let{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,shouldParseAsRawText:i,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}=e;return{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,getTagContentType:i?(...o)=>i(...o)?R.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}}var tr=new Map([["*",new Set(["accesskey","autocapitalize","autocorrect","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["command","commandfor","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["closedby","open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alpha","alt","autocomplete","checked","colorspace","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]);var Ss=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fencedframe","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","selectedcontent","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);var rr={attrs:!0,children:!0,cases:!0,expression:!0},Es=new Set(["parent"]),oe,Yr,jr,We=class We{constructor(t={}){rn(this,oe);ar(this,"kind");ar(this,"parent");for(let r of new Set([...Es,...Object.keys(t)]))this.setProperty(r,t[r]);if(ce(t))for(let r of Object.getOwnPropertySymbols(t))this.setProperty(r,t[r])}setProperty(t,r){if(this[t]!==r){if(t in rr&&(r=r.map(n=>this.createChild(n))),!Es.has(t)){this[t]=r;return}Object.defineProperty(this,t,{value:r,enumerable:!1,configurable:!0})}}map(t){let r;for(let n in rr){let i=this[n];if(i){let s=ml(i,a=>a.map(t));r!==i&&(r||(r=new We({parent:this.parent})),r.setProperty(n,s))}}if(r)for(let n in this)n in rr||(r[n]=this[n]);return t(r||this)}walk(t){for(let r in rr){let n=this[r];if(n)for(let i=0;i<n.length;i++)n[i].walk(t)}t(this)}createChild(t){let r=t instanceof We?t.clone():new We(t);return r.setProperty("parent",this),r}insertChildBefore(t,r){let n=this.$children;n.splice(n.indexOf(t),0,this.createChild(r))}removeChild(t){let r=this.$children;r.splice(r.indexOf(t),1)}replaceChild(t,r){let n=this.$children;n[n.indexOf(t)]=this.createChild(r)}clone(){return new We(this)}get $children(){return this[$e(this,oe,Yr)]}set $children(t){this[$e(this,oe,Yr)]=t}get firstChild(){return this.$children?.[0]}get lastChild(){return F(1,this.$children,-1)}get prev(){let t=$e(this,oe,jr);return t[t.indexOf(this)-1]}get next(){let t=$e(this,oe,jr);return t[t.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(t=>[t.fullName,t.value]))}};oe=new WeakSet,Yr=function(){return this.kind==="angularIcuCase"?"expression":this.kind==="angularIcuExpression"?"cases":"children"},jr=function(){return this.parent?.$children??[]};var nr=We;function ml(e,t){let r=e.map(t);return r.some((n,i)=>n!==e[i])?r:e}var fl=[{regex:/^(?<openingTagSuffix>\[if(?<condition>[^\]]*)\]>)(?<data>.*?)<!\s*\[endif\]$/s,parse:dl},{regex:/^\[if(?<condition>[^\]]*)\]><!$/,parse:gl},{regex:/^<!\s*\[endif\]$/,parse:_l}];function Cs(e,t){if(e.value)for(let{regex:r,parse:n}of fl){let i=e.value.match(r);if(i)return n(e,i,t)}return null}function dl(e,t,r){let{openingTagSuffix:n,condition:i,data:s}=t.groups,a=4+n.length,o=e.sourceSpan.start.moveBy(a),c=o.moveBy(s.length),[u,p]=(()=>{try{return[!0,r(s,o).children]}catch{return[!1,[{kind:"text",value:s,sourceSpan:new h(o,c)}]]}})();return{kind:"ieConditionalComment",complete:u,children:p,condition:w(0,i.trim(),/\s+/g," "),sourceSpan:e.sourceSpan,startSourceSpan:new h(e.sourceSpan.start,o),endSourceSpan:new h(c,e.sourceSpan.end)}}function gl(e,t){let{condition:r}=t.groups;return{kind:"ieConditionalStartComment",condition:w(0,r.trim(),/\s+/g," "),sourceSpan:e.sourceSpan}}function _l(e){return{kind:"ieConditionalEndComment",sourceSpan:e.sourceSpan}}var Xr=class extends Dr{visitExpansionCase(t,r){r.parseOptions.name==="angular"&&this.visitChildren(r,n=>{n(t.expression)})}visit(t,{parseOptions:r}){vl(t),Tl(t,r),wl(t,r),bl(t)}};function bs(e,t,r,n){$t(new Xr,e.children,{parseOptions:r}),t&&e.children.unshift(t);let i=new nr(e);return i.walk(s=>{if(s.kind==="comment"){let a=Cs(s,n);a&&s.parent.replaceChild(s,a)}Sl(s),El(s),Cl(s)}),i}function Sl(e){if(e.kind==="block"){if(e.name=w(0,e.name.toLowerCase(),/\s+/g," ").trim(),e.kind="angularControlFlowBlock",!Ie(e.parameters)){delete e.parameters;return}for(let t of e.parameters)t.kind="angularControlFlowBlockParameter";e.parameters={kind:"angularControlFlowBlockParameters",children:e.parameters,sourceSpan:new h(e.parameters[0].sourceSpan.start,F(0,e.parameters,-1).sourceSpan.end)}}}function El(e){e.kind==="letDeclaration"&&(e.kind="angularLetDeclaration",e.id=e.name,e.init={kind:"angularLetDeclarationInitializer",sourceSpan:new h(e.valueSpan.start,e.valueSpan.end),value:e.value},delete e.name,delete e.value)}function Cl(e){e.kind==="expansion"&&(e.kind="angularIcuExpression"),e.kind==="expansionCase"&&(e.kind="angularIcuCase")}function vs(e,t){let r=e.toLowerCase();return t(r)?r:e}function Ts(e){let t=e.name.startsWith(":")?e.name.slice(1).split(":")[0]:null,r=e.nameSpan.toString(),n=t!==null&&r.startsWith(`${t}:`),i=n?r.slice(t.length+1):r;e.name=i,e.namespace=t,e.hasExplicitNamespace=n}function vl(e){switch(e.kind){case"element":Ts(e);for(let t of e.attrs)Ts(t),t.valueSpan?(t.value=t.valueSpan.toString(),/["']/.test(t.value[0])&&(t.value=t.value.slice(1,-1))):t.value=null;break;case"comment":e.value=e.sourceSpan.toString().slice(4,-3);break;case"text":e.value=e.sourceSpan.toString();break}}function Tl(e,t){if(e.kind==="element"){let r=Be(t.isTagNameCaseSensitive?e.name:e.name.toLowerCase());!e.namespace||e.namespace===r.implicitNamespacePrefix||ue(e)?e.tagDefinition=r:e.tagDefinition=Be("")}}function bl(e){e.sourceSpan&&e.endSourceSpan&&(e.sourceSpan=new h(e.sourceSpan.start,e.endSourceSpan.end))}function wl(e,t){if(e.kind==="element"&&(t.normalizeTagName&&(!e.namespace||e.namespace===e.tagDefinition.implicitNamespacePrefix||ue(e))&&(e.name=vs(e.name,r=>Ss.has(r))),t.normalizeAttributeName))for(let r of e.attrs)r.namespace||(r.name=vs(r.name,n=>tr.has(e.name)&&(tr.get("*").has(n)||tr.get(e.name).has(n))))}function Qr(e,t){let{rootNodes:r,errors:n}=Zt(e,zr(t));return n.length>0&&Kr(n[0]),{parseOptions:t,rootNodes:r}}function ws(e,t){let r=zr(t),{rootNodes:n,errors:i}=Zt(e,r);if(n.some(u=>u.kind==="docType"&&u.value==="html"||u.kind==="element"&&u.name.toLowerCase()==="html"))return Qr(e,ir);let a,o=()=>a??(a=Zt(e,{...r,getTagContentType:void 0})),c=u=>{let{offset:p}=u.startSourceSpan.start;return o().rootNodes.find(d=>d.kind==="element"&&d.startSourceSpan.start.offset===p)??u};for(let[u,p]of n.entries())if(p.kind==="element"){if(p.isVoid)i=o().errors,n[u]=c(p);else if(kl(p)){let{endSourceSpan:d,startSourceSpan:S}=p,m=o().errors.find(g=>g.span.start.offset>S.start.offset&&g.span.start.offset<d.end.offset);m&&Kr(m),n[u]=c(p)}}return i.length>0&&Kr(i[0]),{parseOptions:t,rootNodes:n}}function kl(e){if(e.kind!=="element"||e.name!=="template")return!1;let t=e.attrs.find(r=>r.name==="lang")?.value;return!t||t==="html"}function Kr(e){let{msg:t,span:{start:r,end:n}}=e;throw _s(t,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:e})}function xl(e,t,r,n,i,s){let{offset:a}=n,o=Lt(t.slice(0,a))+r,c=Jr(o,e,{...i,shouldParseFrontMatter:!1},s);c.sourceSpan=new h(n,F(0,c.children,-1).sourceSpan.end);let u=c.children[0];return u.length===a?c.children.shift():(u.sourceSpan=new h(u.sourceSpan.start.moveBy(a),u.sourceSpan.end),u.value=u.value.slice(a)),c}function Jr(e,t,r,n={}){let{frontMatter:i,content:s}=r.shouldParseFrontMatter?mr(e):{content:e},a=new mt(e,n.filepath),o=new qe(a,0,0,0),c=o.moveBy(e.length),{parseOptions:u,rootNodes:p}=t(s,r),d={kind:"root",sourceSpan:new h(o,c),children:p},S;if(i){let[g,E]=[i.start,i.end].map(P=>new qe(a,P.index,P.line-1,P.column));S={...i,kind:"frontMatter",sourceSpan:new h(g,E)}}return bs(d,S,u,(g,E)=>xl(t,e,g,E,u,n))}var ir=er({name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0});function gt(e){let t=er(e),r=t.name==="vue"?ws:Qr;return{parse:(n,i)=>Jr(n,r,t,i),hasPragma:Ti,hasIgnorePragma:bi,astFormat:"html",locStart:Q,locEnd:te}}var Al=gt(ir),yl=new Set(["mj-style","mj-raw"]),Nl=gt({...ir,name:"mjml",shouldParseAsRawText:e=>yl.has(e)}),Ll=gt({name:"angular",tokenizeAngularBlocks:!0,tokenizeAngularLetDeclaration:!0}),Pl=gt({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(e,t,r,n){return e.toLowerCase()!=="html"&&!r&&(e!=="template"||n.some(({name:i,value:s})=>i==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),Ol=gt({name:"lwc",canSelfClose:!1});var Dl={html:ms};return Ls(Il);});
|
package/plugins/html.mjs
CHANGED
|
@@ -21,4 +21,4 @@ If '${e}' is a directive input, make sure the directive is imported by the curre
|
|
|
21
21
|
`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let t=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=t,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(l.TEXT,l.INTERPOLATION,()=>this._isTextEnd(),()=>this._isTagStart())}catch(t){this.handleError(t)}}this._beginToken(l.EOF),this._endToken([])}_getBlockName(){let e=!1,t=this._cursor.clone();return this._attemptCharCodeUntilFn(r=>ct(r)?!e:qo(r)?(e=!0,!1):!0),this._cursor.getChars(t).trim()}_consumeBlockStart(e){this._requireCharCode(64),this._beginToken(l.BLOCK_OPEN_START,e);let t=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(T),this._attemptCharCode(41))this._attemptCharCodeUntilFn(T);else{t.type=l.INCOMPLETE_BLOCK_OPEN;return}this._attemptCharCode(123)?(this._beginToken(l.BLOCK_OPEN_END),this._endToken([])):t.type=l.INCOMPLETE_BLOCK_OPEN}_consumeBlockEnd(e){this._beginToken(l.BLOCK_CLOSE,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(es);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(l.BLOCK_PARAMETER);let e=this._cursor.clone(),t=null,r=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||t!==null;){let n=this._cursor.peek();if(n===92)this._cursor.advance();else if(n===t)t=null;else if(t===null&&Wt(n))t=n;else if(n===40&&t===null)r++;else if(n===41&&t===null){if(r===0)break;r>0&&r--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(es)}}_consumeLetDeclaration(e){if(this._requireStr("@let"),this._beginToken(l.LET_START,e),ct(this._cursor.peek()))this._attemptCharCodeUntilFn(T);else{let r=this._endToken([this._cursor.getChars(e)]);r.type=l.INCOMPLETE_LET;return}let t=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(T),!this._attemptCharCode(61)){t.type=l.INCOMPLETE_LET;return}this._attemptCharCodeUntilFn(r=>T(r)&&!pt(r)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(l.LET_END),this._endToken([]),this._cursor.advance()):(t.type=l.INCOMPLETE_LET,t.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),t=!1;return this._attemptCharCodeUntilFn(r=>Fe(r)||r===36||r===95||t&&ut(r)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();for(this._beginToken(l.LET_VALUE,e);this._cursor.peek()!==0;){let t=this._cursor.peek();if(t===59)break;Wt(t)&&(this._cursor.advance(),this._attemptCharCodeUntilFn(r=>r===92?(this._cursor.advance(),!1):r===t)),this._cursor.advance()}this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(Bo(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,t=this._cursor.clone()){this._currentTokenStart=t,this._currentTokenType=e}_endToken(e,t){if(this._currentTokenStart===null)throw new ne(this._cursor.getSpan(t),"Programming error - attempted to end a token when there was no start to the token");if(this._currentTokenType===null)throw new ne(this._cursor.getSpan(this._currentTokenStart),"Programming error - attempted to end a token which has no token type");let r={type:this._currentTokenType,parts:e,sourceSpan:(t??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(r),this._currentTokenStart=null,this._currentTokenType=null,r}_createError(e,t){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let r=new ne(t,e);return this._currentTokenStart=null,this._currentTokenType=null,r}handleError(e){if(e instanceof Ur&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof ne)this.errors.push(e);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return Fo(this._cursor.peek(),e)?(this._cursor.advance(),!0):!1}_requireCharCode(e){let t=this._cursor.clone();if(!this._attemptCharCode(e))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(t))}_attemptStr(e){let t=e.length;if(this._cursor.charsLeft()<t)return!1;let r=this._cursor.clone();for(let n=0;n<t;n++)if(!this._attemptCharCode(e.charCodeAt(n)))return this._cursor=r,!1;return!0}_attemptStrCaseInsensitive(e){for(let t=0;t<e.length;t++)if(!this._attemptCharCodeCaseInsensitive(e.charCodeAt(t)))return!1;return!0}_requireStr(e){let t=this._cursor.clone();if(!this._attemptStr(e))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(t))}_requireStrCaseInsensitive(e){let t=this._cursor.clone();if(!this._attemptStrCaseInsensitive(e))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(t))}_attemptCharCodeUntilFn(e){for(;!e(this._cursor.peek());)this._cursor.advance()}_requireCharCodeUntilFn(e,t){let r=this._cursor.clone();if(this._attemptCharCodeUntilFn(e),this._cursor.diff(r)<t)throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(r))}_attemptUntilChar(e){for(;this._cursor.peek()!==e;)this._cursor.advance()}_readChar(){let e=String.fromCodePoint(this._cursor.peek());return this._cursor.advance(),e}_peekStr(e){let t=e.length;if(this._cursor.charsLeft()<t)return!1;let r=this._cursor.clone();for(let n=0;n<t;n++){if(r.peek()!==e.charCodeAt(n))return!1;r.advance()}return!0}_isBlockStart(){return this._cursor.peek()===64&&Oo.some(e=>this._peekStr(e))}_isLetStart(){return this._cursor.peek()===64&&this._peekStr("@let")}_consumeEntity(e){this._beginToken(l.ENCODED_ENTITY);let t=this._cursor.clone();if(this._cursor.advance(),this._attemptCharCode(35)){let r=this._attemptCharCode(120)||this._attemptCharCode(88),n=this._cursor.clone();if(this._attemptCharCodeUntilFn(Ro),this._cursor.peek()!=59){this._cursor.advance();let s=r?Br.HEX:Br.DEC;throw this._createError(Po(s,this._cursor.getChars(t)),this._cursor.getSpan())}let i=this._cursor.getChars(n);this._cursor.advance();try{let s=parseInt(i,r?16:10);this._endToken([String.fromCodePoint(s),this._cursor.getChars(t)])}catch{throw this._createError(Ji(this._cursor.getChars(t)),this._cursor.getSpan())}}else{let r=this._cursor.clone();if(this._attemptCharCodeUntilFn(Mo),this._cursor.peek()!=59)this._beginToken(e,t),this._cursor=r,this._endToken(["&"]);else{let n=this._cursor.getChars(r);this._cursor.advance();let i=Te.hasOwnProperty(n)&&Te[n];if(!i)throw this._createError(Ji(n),this._cursor.getSpan(t));this._endToken([i,`&${n};`])}}}_consumeRawText(e,t){this._beginToken(e?l.ESCAPABLE_RAW_TEXT:l.RAW_TEXT);let r=[];for(;;){let n=this._cursor.clone(),i=t();if(this._cursor=n,i)break;e&&this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(r.join(""))]),r.length=0,this._consumeEntity(l.ESCAPABLE_RAW_TEXT),this._beginToken(l.ESCAPABLE_RAW_TEXT)):r.push(this._readChar())}this._endToken([this._processCarriageReturns(r.join(""))])}_consumeComment(e){this._beginToken(l.COMMENT_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("-->")),this._beginToken(l.COMMENT_END),this._requireStr("-->"),this._endToken([])}_consumeBogusComment(e){this._beginToken(l.COMMENT_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(l.COMMENT_END),this._cursor.advance(),this._endToken([])}_consumeCdata(e){this._beginToken(l.CDATA_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._attemptStr("]]>")),this._beginToken(l.CDATA_END),this._requireStr("]]>"),this._endToken([])}_consumeDocType(e){this._beginToken(l.DOC_TYPE_START,e),this._endToken([]),this._consumeRawText(!1,()=>this._cursor.peek()===62),this._beginToken(l.DOC_TYPE_END),this._cursor.advance(),this._endToken([])}_consumePrefixAndName(e){let t=this._cursor.clone(),r="";for(;this._cursor.peek()!==58&&!Io(this._cursor.peek());)this._cursor.advance();let n;this._cursor.peek()===58?(r=this._cursor.getChars(t),this._cursor.advance(),n=this._cursor.clone()):n=t,this._requireCharCodeUntilFn(e,r===""?0:1);let i=this._cursor.getChars(n);return[r,i]}_consumeTagOpen(e){let t,r,n,i,s=[];try{if(this._selectorlessEnabled&&Yt(this._cursor.peek()))i=this._consumeComponentOpenStart(e),[n,r,t]=i.parts,r&&(n+=`:${r}`),t&&(n+=`:${t}`),this._attemptCharCodeUntilFn(T);else{if(!Fe(this._cursor.peek()))throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(e));i=this._consumeTagOpenStart(e),r=i.parts[0],t=n=i.parts[1],this._attemptCharCodeUntilFn(T)}for(;!rs(this._cursor.peek());)if(this._selectorlessEnabled&&this._cursor.peek()===64){let o=this._cursor.clone(),c=o.clone();c.advance(),Yt(c.peek())&&this._consumeDirective(o,c)}else{let o=this._consumeAttribute();s.push(o)}i.type===l.COMPONENT_OPEN_START?this._consumeComponentOpenEnd():this._consumeTagOpenEnd()}catch(o){if(o instanceof ne){i?i.type=i.type===l.COMPONENT_OPEN_START?l.INCOMPLETE_COMPONENT_OPEN:l.INCOMPLETE_TAG_OPEN:(this._beginToken(l.TEXT,e),this._endToken(["<"]));return}throw o}if(this._canSelfClose&&this.tokens[this.tokens.length-1].type===l.TAG_OPEN_END_VOID)return;let a=this._getTagContentType(t,r,this._fullNameStack.length>0,s);this._handleFullNameStackForTagOpen(r,t),a===R.RAW_TEXT?this._consumeRawTextWithTagClose(r,i,n,!1):a===R.ESCAPABLE_RAW_TEXT&&this._consumeRawTextWithTagClose(r,i,n,!0)}_consumeRawTextWithTagClose(e,t,r,n){this._consumeRawText(n,()=>!this._attemptCharCode(60)||!this._attemptCharCode(47)||(this._attemptCharCodeUntilFn(T),!this._attemptStrCaseInsensitive(e&&t.type!==l.COMPONENT_OPEN_START?`${e}:${r}`:r))?!1:(this._attemptCharCodeUntilFn(T),this._attemptCharCode(62))),this._beginToken(t.type===l.COMPONENT_OPEN_START?l.COMPONENT_CLOSE:l.TAG_CLOSE),this._requireCharCodeUntilFn(i=>i===62,3),this._cursor.advance(),this._endToken(t.parts),this._handleFullNameStackForTagClose(e,r)}_consumeTagOpenStart(e){this._beginToken(l.TAG_OPEN_START,e);let t=this._consumePrefixAndName(we);return this._endToken(t)}_consumeComponentOpenStart(e){this._beginToken(l.COMPONENT_OPEN_START,e);let t=this._consumeComponentName();return this._endToken(t)}_consumeComponentName(){let e=this._cursor.clone();for(;ts(this._cursor.peek());)this._cursor.advance();let t=this._cursor.getChars(e),r="",n="";return this._cursor.peek()===58&&(this._cursor.advance(),[r,n]=this._consumePrefixAndName(we)),[t,r,n]}_consumeAttribute(){let[e,t]=this._consumeAttributeName(),r;return this._attemptCharCodeUntilFn(T),this._attemptCharCode(61)&&(this._attemptCharCodeUntilFn(T),r=this._consumeAttributeValue()),this._attemptCharCodeUntilFn(T),{prefix:e,name:t,value:r}}_consumeAttributeName(){let e=this._cursor.peek();if(e===39||e===34)throw this._createError(be(e),this._cursor.getSpan());this._beginToken(l.ATTR_NAME);let t;if(this._openDirectiveCount>0){let n=0;t=i=>{if(this._openDirectiveCount>0){if(i===40)n++;else if(i===41){if(n===0)return!0;n--}}return we(i)}}else if(e===91){let n=0;t=i=>(i===91?n++:i===93&&n--,n<=0?we(i):pt(i))}else t=we;let r=this._consumePrefixAndName(t);return this._endToken(r),r}_consumeAttributeValue(){let e;if(this._cursor.peek()===39||this._cursor.peek()===34){let t=this._cursor.peek();this._consumeQuote(t);let r=()=>this._cursor.peek()===t;e=this._consumeWithInterpolation(l.ATTR_VALUE_TEXT,l.ATTR_VALUE_INTERPOLATION,r,r),this._consumeQuote(t)}else{let t=()=>we(this._cursor.peek());e=this._consumeWithInterpolation(l.ATTR_VALUE_TEXT,l.ATTR_VALUE_INTERPOLATION,t,t)}return e}_consumeQuote(e){this._beginToken(l.ATTR_QUOTE),this._requireCharCode(e),this._endToken([String.fromCodePoint(e)])}_consumeTagOpenEnd(){let e=this._attemptCharCode(47)?l.TAG_OPEN_END_VOID:l.TAG_OPEN_END;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeComponentOpenEnd(){let e=this._attemptCharCode(47)?l.COMPONENT_OPEN_END_VOID:l.COMPONENT_OPEN_END;this._beginToken(e),this._requireCharCode(62),this._endToken([])}_consumeTagClose(e){if(this._selectorlessEnabled){let t=e.clone();for(;t.peek()!==62&&!Yt(t.peek());)t.advance();if(Yt(t.peek())){this._beginToken(l.COMPONENT_CLOSE,e);let r=this._consumeComponentName();this._attemptCharCodeUntilFn(T),this._requireCharCode(62),this._endToken(r);return}}if(this._beginToken(l.TAG_CLOSE,e),this._attemptCharCodeUntilFn(T),this._allowHtmComponentClosingTags&&this._attemptCharCode(47))this._attemptCharCodeUntilFn(T),this._requireCharCode(62),this._endToken([]);else{let[t,r]=this._consumePrefixAndName(we);this._attemptCharCodeUntilFn(T),this._requireCharCode(62),this._endToken([t,r]),this._handleFullNameStackForTagClose(t,r)}}_consumeExpansionFormStart(){this._beginToken(l.EXPANSION_FORM_START),this._requireCharCode(123),this._endToken([]),this._expansionCaseStack.push(l.EXPANSION_FORM_START),this._beginToken(l.RAW_TEXT);let e=this._readUntil(44),t=this._processCarriageReturns(e);if(this._i18nNormalizeLineEndingsInICUs)this._endToken([t]);else{let n=this._endToken([e]);t!==e&&this.nonNormalizedIcuExpressions.push(n)}this._requireCharCode(44),this._attemptCharCodeUntilFn(T),this._beginToken(l.RAW_TEXT);let r=this._readUntil(44);this._endToken([r]),this._requireCharCode(44),this._attemptCharCodeUntilFn(T)}_consumeExpansionCaseStart(){this._beginToken(l.EXPANSION_CASE_VALUE);let e=this._readUntil(123).trim();this._endToken([e]),this._attemptCharCodeUntilFn(T),this._beginToken(l.EXPANSION_CASE_EXP_START),this._requireCharCode(123),this._endToken([]),this._attemptCharCodeUntilFn(T),this._expansionCaseStack.push(l.EXPANSION_CASE_EXP_START)}_consumeExpansionCaseEnd(){this._beginToken(l.EXPANSION_CASE_EXP_END),this._requireCharCode(125),this._endToken([]),this._attemptCharCodeUntilFn(T),this._expansionCaseStack.pop()}_consumeExpansionFormEnd(){this._beginToken(l.EXPANSION_FORM_END),this._requireCharCode(125),this._endToken([]),this._expansionCaseStack.pop()}_consumeWithInterpolation(e,t,r,n){this._beginToken(e);let i=[];for(;!r();){let a=this._cursor.clone();this._attemptStr(ft.start)?(this._endToken([this._processCarriageReturns(i.join(""))],a),i.length=0,this._consumeInterpolation(t,a,n),this._beginToken(e)):this._cursor.peek()===38?(this._endToken([this._processCarriageReturns(i.join(""))]),i.length=0,this._consumeEntity(e),this._beginToken(e)):i.push(this._readChar())}this._inInterpolation=!1;let s=this._processCarriageReturns(i.join(""));return this._endToken([s]),s}_consumeInterpolation(e,t,r){let n=[];this._beginToken(e,t),n.push(ft.start);let i=this._cursor.clone(),s=null,a=!1;for(;this._cursor.peek()!==0&&(r===null||!r());){let o=this._cursor.clone();if(this._isTagStart()){this._cursor=o,n.push(this._getProcessedChars(i,o)),this._endToken(n);return}if(s===null)if(this._attemptStr(ft.end)){n.push(this._getProcessedChars(i,o)),n.push(ft.end),this._endToken(n);return}else this._attemptStr("//")&&(a=!0);let c=this._cursor.peek();this._cursor.advance(),c===92?this._cursor.advance():c===s?s=null:!a&&s===null&&Wt(c)&&(s=c)}n.push(this._getProcessedChars(i,this._cursor)),this._endToken(n)}_consumeDirective(e,t){for(this._requireCharCode(64),this._cursor.advance();ts(this._cursor.peek());)this._cursor.advance();this._beginToken(l.DIRECTIVE_NAME,e);let r=this._cursor.getChars(t);if(this._endToken([r]),this._attemptCharCodeUntilFn(T),this._cursor.peek()===40){for(this._openDirectiveCount++,this._beginToken(l.DIRECTIVE_OPEN),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(T);!rs(this._cursor.peek())&&this._cursor.peek()!==41;)this._consumeAttribute();if(this._attemptCharCodeUntilFn(T),this._openDirectiveCount--,this._cursor.peek()!==41){if(this._cursor.peek()===62||this._cursor.peek()===47)return;throw this._createError(be(this._cursor.peek()),this._cursor.getSpan(e))}this._beginToken(l.DIRECTIVE_CLOSE),this._cursor.advance(),this._endToken([]),this._attemptCharCodeUntilFn(T)}}_getProcessedChars(e,t){return this._processCarriageReturns(t.getChars(e))}_isTextEnd(){return!!(this._isTagStart()||this._cursor.peek()===0||this._tokenizeIcu&&!this._inInterpolation&&(this.isExpansionFormStart()||this._cursor.peek()===125&&this._isInExpansionCase())||this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansion()&&(this._isBlockStart()||this._isLetStart()||this._cursor.peek()===125))}_isTagStart(){if(this._cursor.peek()===60){let e=this._cursor.clone();e.advance();let t=e.peek();if(97<=t&&t<=122||65<=t&&t<=90||t===47||t===33)return!0}return!1}_readUntil(e){let t=this._cursor.clone();return this._attemptUntilChar(e),this._cursor.getChars(t)}_isInExpansion(){return this._isInExpansionCase()||this._isInExpansionForm()}_isInExpansionCase(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===l.EXPANSION_CASE_EXP_START}_isInExpansionForm(){return this._expansionCaseStack.length>0&&this._expansionCaseStack[this._expansionCaseStack.length-1]===l.EXPANSION_FORM_START}isExpansionFormStart(){if(this._cursor.peek()!==123)return!1;let e=this._cursor.clone(),t=this._attemptStr(ft.start);return this._cursor=e,!t}_handleFullNameStackForTagOpen(e,t){let r=Ee(e,t);(this._fullNameStack.length===0||this._fullNameStack[this._fullNameStack.length-1]===r)&&this._fullNameStack.push(r)}_handleFullNameStackForTagClose(e,t){let r=Ee(e,t);this._fullNameStack.length!==0&&this._fullNameStack[this._fullNameStack.length-1]===r&&this._fullNameStack.pop()}};function T(e){return!ct(e)||e===0}function we(e){return ct(e)||e===62||e===60||e===47||e===39||e===34||e===61||e===0}function Io(e){return(e<97||122<e)&&(e<65||90<e)&&(e<48||e>57)}function Ro(e){return e===59||e===0||!Fi(e)}function Mo(e){return e===59||e===0||!Fe(e)}function Bo(e){return e!==125}function Fo(e,t){return Zi(e)===Zi(t)}function Zi(e){return e>=97&&e<=122?e-97+65:e}function qo(e){return Fe(e)||ut(e)||e===95}function es(e){return e!==59&&T(e)}function Yt(e){return e===95||e>=65&&e<=90}function ts(e){return Fe(e)||ut(e)||e===95}function rs(e){return e===47||e===62||e===60||e===0}function Ho(e){let t=[],r;for(let n=0;n<e.length;n++){let i=e[n];r&&r.type===l.TEXT&&i.type===l.TEXT||r&&r.type===l.ATTR_VALUE_TEXT&&i.type===l.ATTR_VALUE_TEXT?(r.parts[0]+=i.parts[0],r.sourceSpan.end=i.sourceSpan.end):(r=i,t.push(r))}return t}var ss=class Fr{constructor(t,r){if(t instanceof Fr){this.file=t.file,this.input=t.input,this.end=t.end;let n=t.state;this.state={peek:n.peek,offset:n.offset,line:n.line,column:n.column}}else{if(!r)throw new Error("Programming error: the range argument must be provided with a file argument.");this.file=t,this.input=t.content,this.end=r.endPos,this.state={peek:-1,offset:r.startPos,line:r.startLine,column:r.startCol}}}clone(){return new Fr(this)}peek(){return this.state.peek}charsLeft(){return this.end-this.state.offset}diff(t){return this.state.offset-t.state.offset}advance(){this.advanceState(this.state)}init(){this.updatePeek(this.state)}getSpan(t,r){t=t||this;let n=t;if(r)for(;this.diff(t)>0&&r.indexOf(t.peek())!==-1;)n===t&&(t=t.clone()),t.advance();let i=this.locationFromCursor(t);return new h(i,this.locationFromCursor(this),n!==t?this.locationFromCursor(n):i)}getChars(t){return this.input.substring(t.state.offset,this.state.offset)}charAt(t){return this.input.charCodeAt(t)}advanceState(t){if(t.offset>=this.end)throw this.state=t,new Ur('Unexpected character "EOF"',this);let r=this.charAt(t.offset);r===10?(t.line++,t.column=0):pt(r)||t.column++,t.offset++,this.updatePeek(t)}updatePeek(t){t.peek=t.offset>=this.end?0:this.charAt(t.offset)}locationFromCursor(t){return new qe(t.file,t.state.offset,t.state.line,t.state.column)}},Vo=class qr extends ss{constructor(t,r){t instanceof qr?(super(t),this.internalState={...t.internalState}):(super(t,r),this.internalState=this.state)}advance(){this.state=this.internalState,super.advance(),this.processEscapeSequence()}init(){super.init(),this.processEscapeSequence()}clone(){return new qr(this)}getChars(t){let r=t.clone(),n="";for(;r.internalState.offset<this.internalState.offset;)n+=String.fromCodePoint(r.peek()),r.advance();return n}processEscapeSequence(){let t=()=>this.internalState.peek;if(t()===92)if(this.internalState={...this.state},this.advanceState(this.internalState),t()===110)this.state.peek=10;else if(t()===114)this.state.peek=13;else if(t()===118)this.state.peek=11;else if(t()===116)this.state.peek=9;else if(t()===98)this.state.peek=8;else if(t()===102)this.state.peek=12;else if(t()===117)if(this.advanceState(this.internalState),t()===123){this.advanceState(this.internalState);let r=this.clone(),n=0;for(;t()!==125;)this.advanceState(this.internalState),n++;this.state.peek=this.decodeHexDigits(r,n)}else{let r=this.clone();this.advanceState(this.internalState),this.advanceState(this.internalState),this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,4)}else if(t()===120){this.advanceState(this.internalState);let r=this.clone();this.advanceState(this.internalState),this.state.peek=this.decodeHexDigits(r,2)}else if(Nr(t())){let r="",n=0,i=this.clone();for(;Nr(t())&&n<3;)i=this.clone(),r+=String.fromCodePoint(t()),this.advanceState(this.internalState),n++;this.state.peek=parseInt(r,8),this.internalState=i.internalState}else pt(this.internalState.peek)?(this.advanceState(this.internalState),this.state=this.internalState):this.state.peek=this.internalState.peek}decodeHexDigits(t,r){let n=this.input.slice(t.internalState.offset,t.internalState.offset+r),i=parseInt(n,16);if(isNaN(i))throw t.state=t.internalState,new Ur("Invalid hexadecimal escape sequence",t);return i}},Ur=class extends Error{constructor(e,t){super(e),this.msg=e,this.cursor=t,Object.setPrototypeOf(this,new.target.prototype)}};var N=class ls extends ne{static create(t,r,n){return new ls(t,r,n)}constructor(t,r,n){super(r,n),this.elementName=t}},Uo=class{constructor(e,t){this.rootNodes=e,this.errors=t}},cs=class{constructor(e){this.getTagDefinition=e}parse(e,t,r,n=!1,i){let s=m=>(g,...E)=>m(g.toLowerCase(),...E),a=n?this.getTagDefinition:s(this.getTagDefinition),o=m=>a(m).getContentType(),c=n?i:s(i),u=is(e,t,i?(m,g,E,P)=>{let z=c(m,g,E,P);return z!==void 0?z:o(m)}:o,r),p=r&&r.canSelfClose||!1,d=r&&r.allowHtmComponentClosingTags||!1,S=new Wo(u.tokens,a,p,d,n);return S.build(),new Uo(S.rootNodes,[...u.errors,...S.errors])}},Wo=class us{constructor(t,r,n,i,s){this.tokens=t,this.tagDefinitionResolver=r,this.canSelfClose=n,this.allowHtmComponentClosingTags=i,this.isTagNameCaseSensitive=s,this._index=-1,this._containerStack=[],this.rootNodes=[],this.errors=[],this._advance()}build(){for(;this._peek.type!==l.EOF;)this._peek.type===l.TAG_OPEN_START||this._peek.type===l.INCOMPLETE_TAG_OPEN?this._consumeElementStartTag(this._advance()):this._peek.type===l.TAG_CLOSE?(this._closeVoidElement(),this._consumeElementEndTag(this._advance())):this._peek.type===l.CDATA_START?(this._closeVoidElement(),this._consumeCdata(this._advance())):this._peek.type===l.COMMENT_START?(this._closeVoidElement(),this._consumeComment(this._advance())):this._peek.type===l.TEXT||this._peek.type===l.RAW_TEXT||this._peek.type===l.ESCAPABLE_RAW_TEXT?(this._closeVoidElement(),this._consumeText(this._advance())):this._peek.type===l.EXPANSION_FORM_START?this._consumeExpansion(this._advance()):this._peek.type===l.BLOCK_OPEN_START?(this._closeVoidElement(),this._consumeBlockOpen(this._advance())):this._peek.type===l.BLOCK_CLOSE?(this._closeVoidElement(),this._consumeBlockClose(this._advance())):this._peek.type===l.INCOMPLETE_BLOCK_OPEN?(this._closeVoidElement(),this._consumeIncompleteBlock(this._advance())):this._peek.type===l.LET_START?(this._closeVoidElement(),this._consumeLet(this._advance())):this._peek.type===l.DOC_TYPE_START?this._consumeDocType(this._advance()):this._peek.type===l.INCOMPLETE_LET?(this._closeVoidElement(),this._consumeIncompleteLet(this._advance())):this._peek.type===l.COMPONENT_OPEN_START||this._peek.type===l.INCOMPLETE_COMPONENT_OPEN?this._consumeComponentStartTag(this._advance()):this._peek.type===l.COMPONENT_CLOSE?this._consumeComponentEndTag(this._advance()):this._advance();for(let t of this._containerStack)t instanceof ve&&this.errors.push(N.create(t.name,t.sourceSpan,`Unclosed block "${t.name}"`))}_advance(){let t=this._peek;return this._index<this.tokens.length-1&&this._index++,this._peek=this.tokens[this._index],t}_advanceIf(t){return this._peek.type===t?this._advance():null}_consumeCdata(t){let r=this._advance(),n=this._getText(r),i=this._advanceIf(l.CDATA_END);this._addToParent(new Ui(n,new h(t.sourceSpan.start,(i||r).sourceSpan.end),[r]))}_consumeComment(t){let r=this._advanceIf(l.RAW_TEXT),n=this._advanceIf(l.COMMENT_END),i=r!=null?r.parts[0].trim():null,s=n==null?t.sourceSpan:new h(t.sourceSpan.start,n.sourceSpan.end,t.sourceSpan.fullStart);this._addToParent(new zi(i,s))}_consumeDocType(t){let r=this._advanceIf(l.RAW_TEXT),n=this._advanceIf(l.DOC_TYPE_END),i=r!=null?r.parts[0].trim():null,s=new h(t.sourceSpan.start,(n||r||t).sourceSpan.end);this._addToParent(new Yi(i,s))}_consumeExpansion(t){let r=this._advance(),n=this._advance(),i=[];for(;this._peek.type===l.EXPANSION_CASE_VALUE;){let a=this._parseExpansionCase();if(!a)return;i.push(a)}if(this._peek.type!==l.EXPANSION_FORM_END){this.errors.push(N.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '}'."));return}let s=new h(t.sourceSpan.start,this._peek.sourceSpan.end,t.sourceSpan.fullStart);this._addToParent(new Wi(r.parts[0],n.parts[0],i,s,r.sourceSpan)),this._advance()}_parseExpansionCase(){let t=this._advance();if(this._peek.type!==l.EXPANSION_CASE_EXP_START)return this.errors.push(N.create(null,this._peek.sourceSpan,"Invalid ICU message. Missing '{'.")),null;let r=this._advance(),n=this._collectExpansionExpTokens(r);if(!n)return null;let i=this._advance();n.push({type:l.EOF,parts:[],sourceSpan:i.sourceSpan});let s=new us(n,this.tagDefinitionResolver,this.canSelfClose,this.allowHtmComponentClosingTags,this.isTagNameCaseSensitive);if(s.build(),s.errors.length>0)return this.errors=this.errors.concat(s.errors),null;let a=new h(t.sourceSpan.start,i.sourceSpan.end,t.sourceSpan.fullStart),o=new h(r.sourceSpan.start,i.sourceSpan.end,r.sourceSpan.fullStart);return new Gi(t.parts[0],s.rootNodes,a,t.sourceSpan,o)}_collectExpansionExpTokens(t){let r=[],n=[l.EXPANSION_CASE_EXP_START];for(;;){if((this._peek.type===l.EXPANSION_FORM_START||this._peek.type===l.EXPANSION_CASE_EXP_START)&&n.push(this._peek.type),this._peek.type===l.EXPANSION_CASE_EXP_END)if(as(n,l.EXPANSION_CASE_EXP_START)){if(n.pop(),n.length===0)return r}else return this.errors.push(N.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===l.EXPANSION_FORM_END)if(as(n,l.EXPANSION_FORM_START))n.pop();else return this.errors.push(N.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;if(this._peek.type===l.EOF)return this.errors.push(N.create(null,t.sourceSpan,"Invalid ICU message. Missing '}'.")),null;r.push(this._advance())}}_getText(t){let r=t.parts[0];if(r.length>0&&r[0]==`
|
|
22
22
|
`){var n;let i=this._getClosestElementLikeParent();i!=null&&i.children.length==0&&(!((n=this._getTagDefinition(i))===null||n===void 0)&&n.ignoreFirstLf)&&(r=r.substring(1))}return r}_consumeText(t){let r=[t],n=t.sourceSpan,i=t.parts[0];if(i.length>0&&i[0]===`
|
|
23
23
|
`){var s;let a=this._getContainer();a!=null&&a.children.length===0&&(!((s=this._getTagDefinition(a))===null||s===void 0)&&s.ignoreFirstLf)&&(i=i.substring(1),r[0]={type:t.type,sourceSpan:t.sourceSpan,parts:[i]})}for(;this._peek.type===l.INTERPOLATION||this._peek.type===l.TEXT||this._peek.type===l.ENCODED_ENTITY;)t=this._advance(),r.push(t),t.type===l.INTERPOLATION?i+=t.parts.join("").replace(/&([^;]+);/g,os):t.type===l.ENCODED_ENTITY?i+=t.parts[0]:i+=t.parts.join("");if(i.length>0){let a=t.sourceSpan;this._addToParent(new Vi(i,new h(n.start,a.end,n.fullStart,n.details),r))}}_closeVoidElement(){var t;let r=this._getContainer();r!==null&&(!((t=this._getTagDefinition(r))===null||t===void 0)&&t.isVoid)&&this._containerStack.pop()}_consumeElementStartTag(t){var r;let n=[],i=[];this._consumeAttributesAndDirectives(n,i);let s=this._getElementFullName(t,this._getClosestElementLikeParent()),a=this._getTagDefinition(s),o=!1;if(this._peek.type===l.TAG_OPEN_END_VOID){this._advance(),o=!0;let E=this._getTagDefinition(s);this.canSelfClose||E?.canSelfClose||Me(s)!==null||E?.isVoid||this.errors.push(N.create(s,t.sourceSpan,`Only void, custom and foreign elements can be self closed "${t.parts[1]}"`))}else this._peek.type===l.TAG_OPEN_END&&(this._advance(),o=!1);let c=this._peek.sourceSpan.fullStart,u=new h(t.sourceSpan.start,c,t.sourceSpan.fullStart),p=new h(t.sourceSpan.start,c,t.sourceSpan.fullStart),d=new h(t.sourceSpan.start.moveBy(1),t.sourceSpan.end),S=new ie(s,n,i,[],o,u,p,void 0,d,a?.isVoid??!1),m=this._getContainer(),g=m!==null&&!!(!((r=this._getTagDefinition(m))===null||r===void 0)&&r.isClosedByChild(S.name));this._pushContainer(S,g),o?this._popContainer(s,ie,u):t.type===l.INCOMPLETE_TAG_OPEN&&(this._popContainer(s,ie,null),this.errors.push(N.create(s,u,`Opening tag "${s}" not terminated.`)))}_consumeComponentStartTag(t){var r;let n=t.parts[0],i=[],s=[];this._consumeAttributesAndDirectives(i,s);let a=this._getClosestElementLikeParent(),o=this._getComponentTagName(t,a),c=this._getComponentFullName(t,a),u=this._peek.type===l.COMPONENT_OPEN_END_VOID;this._advance();let p=this._peek.sourceSpan.fullStart,d=new h(t.sourceSpan.start,p,t.sourceSpan.fullStart),S=new h(t.sourceSpan.start,p,t.sourceSpan.fullStart),m=new J(n,o,c,i,s,[],u,d,S,void 0),g=this._getContainer(),E=g!==null&&m.tagName!==null&&!!(!((r=this._getTagDefinition(g))===null||r===void 0)&&r.isClosedByChild(m.tagName));this._pushContainer(m,E),u?this._popContainer(c,J,d):t.type===l.INCOMPLETE_COMPONENT_OPEN&&(this._popContainer(c,J,null),this.errors.push(N.create(c,d,`Opening tag "${c}" not terminated.`)))}_consumeAttributesAndDirectives(t,r){for(;this._peek.type===l.ATTR_NAME||this._peek.type===l.DIRECTIVE_NAME;)this._peek.type===l.DIRECTIVE_NAME?r.push(this._consumeDirective(this._peek)):t.push(this._consumeAttr(this._advance()))}_consumeComponentEndTag(t){let r=this._getComponentFullName(t,this._getClosestElementLikeParent());if(!this._popContainer(r,J,t.sourceSpan)){let n=this._containerStack[this._containerStack.length-1],i;n instanceof J&&n.componentName===t.parts[0]?i=`, did you mean "${n.fullName}"?`:i=". It may happen when the tag has already been closed by another tag.";let s=`Unexpected closing tag "${r}"${i}`;this.errors.push(N.create(r,t.sourceSpan,s))}}_getTagDefinition(t){return typeof t=="string"?this.tagDefinitionResolver(t):t instanceof ie?this.tagDefinitionResolver(t.name):t instanceof J&&t.tagName!==null?this.tagDefinitionResolver(t.tagName):null}_pushContainer(t,r){r&&this._containerStack.pop(),this._addToParent(t),this._containerStack.push(t)}_consumeElementEndTag(t){var r;let n=this.allowHtmComponentClosingTags&&t.parts.length===0?null:this._getElementFullName(t,this._getClosestElementLikeParent());if(n&&(!((r=this._getTagDefinition(n))===null||r===void 0)&&r.isVoid))this.errors.push(N.create(n,t.sourceSpan,`Void elements do not have end tags "${t.parts[1]}"`));else if(!this._popContainer(n,ie,t.sourceSpan)){let i=`Unexpected closing tag "${n}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(N.create(n,t.sourceSpan,i))}}_popContainer(t,r,n){let i=!1;for(let a=this._containerStack.length-1;a>=0;a--){var s;let o=this._containerStack[a],c=o instanceof J?o.fullName:o.name;if(Me(c)?c===t:(c===t||t===null)&&o instanceof r)return o.endSourceSpan=n,o.sourceSpan.end=n!==null?n.end:o.sourceSpan.end,this._containerStack.splice(a,this._containerStack.length-a),!i;(o instanceof ve||!(!((s=this._getTagDefinition(o))===null||s===void 0)&&s.closedByParent))&&(i=!0)}return!1}_consumeAttr(t){let r=Ee(t.parts[0],t.parts[1]),n=t.sourceSpan.end,i;this._peek.type===l.ATTR_QUOTE&&(i=this._advance());let s="",a=[],o,c;if(this._peek.type===l.ATTR_VALUE_TEXT)for(o=this._peek.sourceSpan,c=this._peek.sourceSpan.end;this._peek.type===l.ATTR_VALUE_TEXT||this._peek.type===l.ATTR_VALUE_INTERPOLATION||this._peek.type===l.ENCODED_ENTITY;){let p=this._advance();a.push(p),p.type===l.ATTR_VALUE_INTERPOLATION?s+=p.parts.join("").replace(/&([^;]+);/g,os):p.type===l.ENCODED_ENTITY?s+=p.parts[0]:s+=p.parts.join(""),c=n=p.sourceSpan.end}this._peek.type===l.ATTR_QUOTE&&(c=n=this._advance().sourceSpan.end);let u=o&&c&&new h(i?.sourceSpan.start??o.start,c,i?.sourceSpan.fullStart??o.fullStart);return new $i(r,s,new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),t.sourceSpan,u,a.length>0?a:void 0,void 0)}_consumeDirective(t){let r=[],n=t.sourceSpan.end,i=null;if(this._advance(),this._peek.type===l.DIRECTIVE_OPEN){for(n=this._peek.sourceSpan.end,this._advance();this._peek.type===l.ATTR_NAME;)r.push(this._consumeAttr(this._advance()));this._peek.type===l.DIRECTIVE_CLOSE?(i=this._peek.sourceSpan,this._advance()):this.errors.push(N.create(null,t.sourceSpan,"Unterminated directive definition"))}let s=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),a=new h(s.start,i===null?t.sourceSpan.end:i.end,s.fullStart);return new ji(t.parts[0],r,a,s,i)}_consumeBlockOpen(t){let r=[];for(;this._peek.type===l.BLOCK_PARAMETER;){let o=this._advance();r.push(new Lr(o.parts[0],o.sourceSpan))}this._peek.type===l.BLOCK_OPEN_END&&this._advance();let n=this._peek.sourceSpan.fullStart,i=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),s=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),a=new ve(t.parts[0],r,[],i,t.sourceSpan,s);this._pushContainer(a,!1)}_consumeBlockClose(t){this._popContainer(null,ve,t.sourceSpan)||this.errors.push(N.create(null,t.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(t){let r=[];for(;this._peek.type===l.BLOCK_PARAMETER;){let o=this._advance();r.push(new Lr(o.parts[0],o.sourceSpan))}let n=this._peek.sourceSpan.fullStart,i=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),s=new h(t.sourceSpan.start,n,t.sourceSpan.fullStart),a=new ve(t.parts[0],r,[],i,t.sourceSpan,s);this._pushContainer(a,!1),this._popContainer(null,ve,null),this.errors.push(N.create(t.parts[0],i,`Incomplete block "${t.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(t){let r=t.parts[0],n,i;if(this._peek.type!==l.LET_VALUE){this.errors.push(N.create(t.parts[0],t.sourceSpan,`Invalid @let declaration "${r}". Declaration must have a value.`));return}else n=this._advance();if(this._peek.type!==l.LET_END){this.errors.push(N.create(t.parts[0],t.sourceSpan,`Unterminated @let declaration "${r}". Declaration must be terminated with a semicolon.`));return}else i=this._advance();let s=i.sourceSpan.fullStart,a=new h(t.sourceSpan.start,s,t.sourceSpan.fullStart),o=t.sourceSpan.toString().lastIndexOf(r),c=new h(t.sourceSpan.start.moveBy(o),t.sourceSpan.end),u=new Pr(r,n.parts[0],a,c,n.sourceSpan);this._addToParent(u)}_consumeIncompleteLet(t){let r=t.parts[0]??"",n=r?` "${r}"`:"";if(r.length>0){let i=t.sourceSpan.toString().lastIndexOf(r),s=new h(t.sourceSpan.start.moveBy(i),t.sourceSpan.end),a=new h(t.sourceSpan.start,t.sourceSpan.start.moveBy(0)),o=new Pr(r,"",t.sourceSpan,s,a);this._addToParent(o)}this.errors.push(N.create(t.parts[0],t.sourceSpan,`Incomplete @let declaration${n}. @let declarations must be written as \`@let <name> = <value>;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestElementLikeParent(){for(let t=this._containerStack.length-1;t>-1;t--){let r=this._containerStack[t];if(r instanceof ie||r instanceof J)return r}return null}_addToParent(t){let r=this._getContainer();r===null?this.rootNodes.push(t):r.children.push(t)}_getElementFullName(t,r){return Ee(this._getPrefix(t,r),t.parts[1])}_getComponentFullName(t,r){let n=t.parts[0],i=this._getComponentTagName(t,r);return i===null?n:i.startsWith(":")?n+i:`${n}:${i}`}_getComponentTagName(t,r){let n=this._getPrefix(t,r),i=t.parts[2];return!n&&!i?null:!n&&i?i:Ee(n,i||"ng-component")}_getPrefix(t,r){var n;let i,s;if(t.type===l.COMPONENT_OPEN_START||t.type===l.INCOMPLETE_COMPONENT_OPEN||t.type===l.COMPONENT_CLOSE?(i=t.parts[1],s=t.parts[2]):(i=t.parts[0],s=t.parts[1]),i=i||((n=this._getTagDefinition(s))===null||n===void 0?void 0:n.implicitNamespacePrefix)||"",!i&&r){let a=r instanceof ie?r.name:r.tagName;if(a!==null){let o=at(a)[1],c=this._getTagDefinition(o);c!==null&&!c.preventNamespaceInheritance&&(i=Me(a))}}return i}};function as(e,t){return e.length>0&&e[e.length-1]===t}function os(e,t){return Te[t]!==void 0?Te[t]||e:/^#x[a-f0-9]+$/i.test(t)?String.fromCodePoint(parseInt(t.slice(2),16)):/^#\d+$/.test(t)?String.fromCodePoint(parseInt(t.slice(1),10)):e}var ps=class extends cs{constructor(){super(Be)}parse(e,t,r,n=!1,i){return super.parse(e,t,r,n,i)}};var Wr=null,Go=()=>(Wr||(Wr=new ps),Wr);function Jt(e,t={}){let{canSelfClose:r=!1,allowHtmComponentClosingTags:n=!1,isTagNameCaseSensitive:i=!1,getTagContentType:s,tokenizeAngularBlocks:a=!1,tokenizeAngularLetDeclaration:o=!1,enableAngularSelectorlessSyntax:c=!1}=t;return Go().parse(e,"angular-html-parser",{tokenizeExpansionForms:a,canSelfClose:r,allowHtmComponentClosingTags:n,tokenizeBlocks:a,tokenizeLet:o,selectorlessEnabled:c},i,s)}var $o=[Yo,jo,Ko,Jo,Zo,rl,el,tl,nl,Qo];function zo(e,t){for(let r of $o)r(e,t);return e}function Yo(e){e.walk(t=>{if(t.kind==="element"&&t.tagDefinition.ignoreFirstLf&&t.children.length>0&&t.children[0].kind==="text"&&t.children[0].value[0]===`
|
|
24
|
-
`){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function jo(e){let t=r=>r.kind==="element"&&r.prev?.kind==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&r.firstChild?.kind==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset;e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.firstChild;r.removeChild(s),n--;let o=new h(s.sourceSpan.start,a.sourceSpan.end),c=new h(o.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=c,i.startSourceSpan=o,i.removeChild(a)}})}function Xo(e,t,r){e.walk(n=>{if(n.children)for(let i=0;i<n.children.length;i++){let s=n.children[i];if(s.kind!=="text"&&!t(s))continue;s.kind!=="text"&&(s.kind="text",s.value=r(s));let a=s.prev;!a||a.kind!=="text"||(a.value+=s.value,a.sourceSpan=new h(a.sourceSpan.start,s.sourceSpan.end),n.removeChild(s),i--)}})}function Ko(e){return Xo(e,t=>t.kind==="cdata",t=>`<![CDATA[${t.value}]]>`)}function Qo(e){let t=r=>r.kind==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.kind==="text"&&!y.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&r.prev?.kind==="text"&&r.next?.kind==="text";e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+a.value,s.sourceSpan=new h(s.sourceSpan.start,a.sourceSpan.end),s.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,s.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(i),n--,r.removeChild(a)}})}function Jo(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/s;e.walk(n=>{if(An(n,t))for(let i of n.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,a=null,o=i.value.split(r);for(let c=0;c<o.length;c++,s=a){let u=o[c];if(c%2===0){a=s.moveBy(u.length),u.length>0&&n.insertChildBefore(i,{kind:"text",value:u,sourceSpan:new h(s,a)});continue}a=s.moveBy(u.length+4),n.insertChildBefore(i,{kind:"interpolation",sourceSpan:new h(s,a),children:u.length===0?[]:[{kind:"text",value:u,sourceSpan:new h(s.moveBy(2),a.moveBy(-2))}]})}n.removeChild(i)}})}function Zo(e,t){e.walk(r=>{let n=r.$children;if(!n)return;if(n.length===0||n.length===1&&n[0].kind==="text"&&y.trim(n[0].value).length===0){r.hasDanglingSpaces=n.length>0,r.$children=[];return}let i=yn(r,t),s=gr(r);if(!i)for(let a=0;a<n.length;a++){let o=n[a];if(o.kind!=="text")continue;let{leadingWhitespace:c,text:u,trailingWhitespace:p}=xn(o.value),d=o.prev,S=o.next;u?(o.value=u,o.sourceSpan=new h(o.sourceSpan.start.moveBy(c.length),o.sourceSpan.end.moveBy(-p.length)),c&&(d&&(d.hasTrailingSpaces=!0),o.hasLeadingSpaces=!0),p&&(o.hasTrailingSpaces=!0,S&&(S.hasLeadingSpaces=!0))):(r.removeChild(o),a--,(c||p)&&(d&&(d.hasTrailingSpaces=!0),S&&(S.hasLeadingSpaces=!0)))}r.isWhitespaceSensitive=i,r.isIndentationSensitive=s})}function el(e){e.walk(t=>{t.isSelfClosing=!t.children||t.kind==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function tl(e,t){e.walk(r=>{r.kind==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function rl(e,t){e.walk(r=>{r.cssDisplay=Fn(r,t)})}function nl(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=Pn(r,t);return}for(let i of n)i.isLeadingSpaceSensitive=Nn(i,t),i.isTrailingSpaceSensitive=Ln(i,t);for(let i=0;i<n.length;i++){let s=n[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===n.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var hs=zo;function il(e,t,r){let{node:n}=e;switch(n.kind){case"root":return t.__onHtmlRoot&&t.__onHtmlRoot(n),[C(Re(e,t,r)),v];case"element":case"ieConditionalComment":return Oi(e,t,r);case"angularControlFlowBlock":return Ai(e,t,r);case"angularControlFlowBlockParameters":return Ni(e,t,r);case"angularControlFlowBlockParameter":return y.trim(n.expression);case"angularLetDeclaration":return C(["@let ",C([n.id," =",C(A([_,r("init")]))]),";"]);case"angularLetDeclarationInitializer":return n.value;case"angularIcuExpression":return Li(e,t,r);case"angularIcuCase":return Pi(e,t,r);case"ieConditionalStartComment":case"ieConditionalEndComment":return[Se(n),fe(n)];case"interpolation":return[Se(n,t),...e.map(r,"children"),fe(n,t)];case"text":{if(n.parent.kind==="interpolation"){let o=/\n[^\S\n]*$/,c=o.test(n.value),u=c?n.value.replace(o,""):n.value;return[L(u),c?v:""]}let i=U(n,t),s=It(n),a=V(n,t);return s[0]=[i,s[0]],s.push([s.pop(),a]),xt(s)}case"docType":return[C([Se(n,t)," ",w(0,n.value.replace(/^html\b/i,"html"),/\s+/g," ")]),fe(n,t)];case"comment":return[U(n,t),L(t.originalText.slice(Q(n),te(n))),V(n,t)];case"attribute":{if(n.value===null)return n.rawName;let i=Er(n.value),s=Mt(n,t)?"":hn(i,'"');return[n.rawName,"=",s,L(s==='"'?w(0,i,'"',"""):w(0,i,"'","'")),s]}case"frontMatter":case"cdata":default:throw new fn(n,"HTML")}}var sl={features:{experimental_frontMatterSupport:{massageAstNode:!0,embed:!0,print:!0}},preprocess:hs,print:il,insertPragma:wi,massageAstNode:gn,embed:di,getVisitorKeys:Si},ms=sl;var fs=[{name:"Angular",type:"markup",aceMode:"html",extensions:[".component.html"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["angular"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"HTML",type:"markup",aceMode:"html",extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["html"],vscodeLanguageIds:["html"],linguistLanguageId:146},{name:"Lightning Web Components",type:"markup",aceMode:"html",extensions:[],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"MJML",type:"markup",aceMode:"html",extensions:[".mjml"],tmScope:"text.mjml.basic",aliases:["MJML","mjml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["mjml"],filenames:[],vscodeLanguageIds:["mjml"],linguistLanguageId:146},{name:"Vue",type:"markup",aceMode:"vue",extensions:[".vue"],tmScope:"source.vue",codemirrorMode:"vue",codemirrorMimeType:"text/x-vue",parsers:["vue"],vscodeLanguageIds:["vue"],linguistLanguageId:391}];var Gr={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ds="HTML",al={bracketSameLine:Gr.bracketSameLine,htmlWhitespaceSensitivity:{category:ds,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Gr.singleAttributePerLine,vueIndentScriptAndStyle:{category:ds,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},gs=al;var Jr={};tn(Jr,{angular:()=>xl,html:()=>bl,lwc:()=>yl,mjml:()=>kl,vue:()=>Al});function ol(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var _s=ol;var ll={canSelfClose:!0,normalizeTagName:!1,normalizeAttributeName:!1,allowHtmComponentClosingTags:!1,isTagNameCaseSensitive:!1,shouldParseFrontMatter:!0};function Zt(e){return{...ll,...e}}function $r(e){let{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,shouldParseAsRawText:i,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}=e;return{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,getTagContentType:i?(...o)=>i(...o)?R.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}}var er=new Map([["*",new Set(["accesskey","autocapitalize","autocorrect","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["command","commandfor","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["closedby","open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alpha","alt","autocomplete","checked","colorspace","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]);var Ss=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fencedframe","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","selectedcontent","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);var tr={attrs:!0,children:!0,cases:!0,expression:!0},Es=new Set(["parent"]),oe,zr,Yr,We=class We{constructor(t={}){rn(this,oe);sr(this,"kind");sr(this,"parent");for(let r of new Set([...Es,...Object.keys(t)]))this.setProperty(r,t[r]);if(ce(t))for(let r of Object.getOwnPropertySymbols(t))this.setProperty(r,t[r])}setProperty(t,r){if(this[t]!==r){if(t in tr&&(r=r.map(n=>this.createChild(n))),!Es.has(t)){this[t]=r;return}Object.defineProperty(this,t,{value:r,enumerable:!1,configurable:!0})}}map(t){let r;for(let n in tr){let i=this[n];if(i){let s=cl(i,a=>a.map(t));r!==i&&(r||(r=new We({parent:this.parent})),r.setProperty(n,s))}}if(r)for(let n in this)n in tr||(r[n]=this[n]);return t(r||this)}walk(t){for(let r in tr){let n=this[r];if(n)for(let i=0;i<n.length;i++)n[i].walk(t)}t(this)}createChild(t){let r=t instanceof We?t.clone():new We(t);return r.setProperty("parent",this),r}insertChildBefore(t,r){let n=this.$children;n.splice(n.indexOf(t),0,this.createChild(r))}removeChild(t){let r=this.$children;r.splice(r.indexOf(t),1)}replaceChild(t,r){let n=this.$children;n[n.indexOf(t)]=this.createChild(r)}clone(){return new We(this)}get $children(){return this[$e(this,oe,zr)]}set $children(t){this[$e(this,oe,zr)]=t}get firstChild(){return this.$children?.[0]}get lastChild(){return F(1,this.$children,-1)}get prev(){let t=$e(this,oe,Yr);return t[t.indexOf(this)-1]}get next(){let t=$e(this,oe,Yr);return t[t.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(t=>[t.fullName,t.value]))}};oe=new WeakSet,zr=function(){return this.kind==="angularIcuCase"?"expression":this.kind==="angularIcuExpression"?"cases":"children"},Yr=function(){return this.parent?.$children??[]};var rr=We;function cl(e,t){let r=e.map(t);return r.some((n,i)=>n!==e[i])?r:e}var ul=[{regex:/^(?<openingTagSuffix>\[if(?<condition>[^\]]*)\]>)(?<data>.*?)<!\s*\[endif\]$/s,parse:pl},{regex:/^\[if(?<condition>[^\]]*)\]><!$/,parse:hl},{regex:/^<!\s*\[endif\]$/,parse:ml}];function Cs(e,t){if(e.value)for(let{regex:r,parse:n}of ul){let i=e.value.match(r);if(i)return n(e,i,t)}return null}function pl(e,t,r){let{openingTagSuffix:n,condition:i,data:s}=t.groups,a=4+n.length,o=e.sourceSpan.start.moveBy(a),c=o.moveBy(s.length),[u,p]=(()=>{try{return[!0,r(s,o).children]}catch{return[!1,[{kind:"text",value:s,sourceSpan:new h(o,c)}]]}})();return{kind:"ieConditionalComment",complete:u,children:p,condition:w(0,i.trim(),/\s+/g," "),sourceSpan:e.sourceSpan,startSourceSpan:new h(e.sourceSpan.start,o),endSourceSpan:new h(c,e.sourceSpan.end)}}function hl(e,t){let{condition:r}=t.groups;return{kind:"ieConditionalStartComment",condition:w(0,r.trim(),/\s+/g," "),sourceSpan:e.sourceSpan}}function ml(e){return{kind:"ieConditionalEndComment",sourceSpan:e.sourceSpan}}var jr=class extends Or{visitExpansionCase(t,r){r.parseOptions.name==="angular"&&this.visitChildren(r,n=>{n(t.expression)})}visit(t,{parseOptions:r}){_l(t),Sl(t,r),Cl(t,r),El(t)}};function bs(e,t,r,n){Gt(new jr,e.children,{parseOptions:r}),t&&e.children.unshift(t);let i=new rr(e);return i.walk(s=>{if(s.kind==="comment"){let a=Cs(s,n);a&&s.parent.replaceChild(s,a)}fl(s),dl(s),gl(s)}),i}function fl(e){if(e.kind==="block"){if(e.name=w(0,e.name.toLowerCase(),/\s+/g," ").trim(),e.kind="angularControlFlowBlock",!Ie(e.parameters)){delete e.parameters;return}for(let t of e.parameters)t.kind="angularControlFlowBlockParameter";e.parameters={kind:"angularControlFlowBlockParameters",children:e.parameters,sourceSpan:new h(e.parameters[0].sourceSpan.start,F(0,e.parameters,-1).sourceSpan.end)}}}function dl(e){e.kind==="letDeclaration"&&(e.kind="angularLetDeclaration",e.id=e.name,e.init={kind:"angularLetDeclarationInitializer",sourceSpan:new h(e.valueSpan.start,e.valueSpan.end),value:e.value},delete e.name,delete e.value)}function gl(e){e.kind==="expansion"&&(e.kind="angularIcuExpression"),e.kind==="expansionCase"&&(e.kind="angularIcuCase")}function vs(e,t){let r=e.toLowerCase();return t(r)?r:e}function Ts(e){let t=e.name.startsWith(":")?e.name.slice(1).split(":")[0]:null,r=e.nameSpan.toString(),n=t!==null&&r.startsWith(`${t}:`),i=n?r.slice(t.length+1):r;e.name=i,e.namespace=t,e.hasExplicitNamespace=n}function _l(e){switch(e.kind){case"element":Ts(e);for(let t of e.attrs)Ts(t),t.valueSpan?(t.value=t.valueSpan.toString(),/["']/.test(t.value[0])&&(t.value=t.value.slice(1,-1))):t.value=null;break;case"comment":e.value=e.sourceSpan.toString().slice(4,-3);break;case"text":e.value=e.sourceSpan.toString();break}}function Sl(e,t){if(e.kind==="element"){let r=Be(t.isTagNameCaseSensitive?e.name:e.name.toLowerCase());!e.namespace||e.namespace===r.implicitNamespacePrefix||ue(e)?e.tagDefinition=r:e.tagDefinition=Be("")}}function El(e){e.sourceSpan&&e.endSourceSpan&&(e.sourceSpan=new h(e.sourceSpan.start,e.endSourceSpan.end))}function Cl(e,t){if(e.kind==="element"&&(t.normalizeTagName&&(!e.namespace||e.namespace===e.tagDefinition.implicitNamespacePrefix||ue(e))&&(e.name=vs(e.name,r=>Ss.has(r))),t.normalizeAttributeName))for(let r of e.attrs)r.namespace||(r.name=vs(r.name,n=>er.has(e.name)&&(er.get("*").has(n)||er.get(e.name).has(n))))}function Kr(e,t){let{rootNodes:r,errors:n}=Jt(e,$r(t));return n.length>0&&Xr(n[0]),{parseOptions:t,rootNodes:r}}function ws(e,t){let r=$r(t),{rootNodes:n,errors:i}=Jt(e,r);if(n.some(u=>u.kind==="docType"&&u.value==="html"||u.kind==="element"&&u.name.toLowerCase()==="html"))return Kr(e,nr);let a,o=()=>a??(a=Jt(e,{...r,getTagContentType:void 0})),c=u=>{let{offset:p}=u.startSourceSpan.start;return o().rootNodes.find(d=>d.kind==="element"&&d.startSourceSpan.start.offset===p)??u};for(let[u,p]of n.entries())if(p.kind==="element"){if(p.isVoid)i=o().errors,n[u]=c(p);else if(vl(p)){let{endSourceSpan:d,startSourceSpan:S}=p,m=o().errors.find(g=>g.span.start.offset>S.start.offset&&g.span.start.offset<d.end.offset);m&&Xr(m),n[u]=c(p)}}return i.length>0&&Xr(i[0]),{parseOptions:t,rootNodes:n}}function vl(e){if(e.kind!=="element"||e.name!=="template")return!1;let t=e.attrs.find(r=>r.name==="lang")?.value;return!t||t==="html"}function Xr(e){let{msg:t,span:{start:r,end:n}}=e;throw _s(t,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:e})}function Tl(e,t,r,n,i,s){let{offset:a}=n,o=Nt(t.slice(0,a))+r,c=Qr(o,e,{...i,shouldParseFrontMatter:!1},s);c.sourceSpan=new h(n,F(0,c.children,-1).sourceSpan.end);let u=c.children[0];return u.length===a?c.children.shift():(u.sourceSpan=new h(u.sourceSpan.start.moveBy(a),u.sourceSpan.end),u.value=u.value.slice(a)),c}function Qr(e,t,r,n={}){let{frontMatter:i,content:s}=r.shouldParseFrontMatter?hr(e):{content:e},a=new mt(e,n.filepath),o=new qe(a,0,0,0),c=o.moveBy(e.length),{parseOptions:u,rootNodes:p}=t(s,r),d={kind:"root",sourceSpan:new h(o,c),children:p},S;if(i){let[g,E]=[i.start,i.end].map(P=>new qe(a,P.index,P.line-1,P.column));S={...i,kind:"frontMatter",sourceSpan:new h(g,E)}}return bs(d,S,u,(g,E)=>Tl(t,e,g,E,u,n))}var nr=Zt({name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0});function gt(e){let t=Zt(e),r=t.name==="vue"?ws:Kr;return{parse:(n,i)=>Qr(n,r,t,i),hasPragma:Ti,hasIgnorePragma:bi,astFormat:"html",locStart:Q,locEnd:te}}var bl=gt(nr),wl=new Set(["mj-style","mj-raw"]),kl=gt({...nr,name:"mjml",shouldParseAsRawText:e=>wl.has(e)}),xl=gt({name:"angular",tokenizeAngularBlocks:!0,tokenizeAngularLetDeclaration:!0}),Al=gt({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(e,t,r,n){return e.toLowerCase()!=="html"&&!r&&(e!=="template"||n.some(({name:i,value:s})=>i==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),yl=gt({name:"lwc",canSelfClose:!1});var Nl={html:ms};export{ks as default,fs as languages,gs as options,Jr as parsers,Nl as printers};
|
|
24
|
+
`){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function jo(e){let t=r=>r.kind==="element"&&r.prev?.kind==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&r.firstChild?.kind==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset;e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.firstChild;r.removeChild(s),n--;let o=new h(s.sourceSpan.start,a.sourceSpan.end),c=new h(o.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=c,i.startSourceSpan=o,i.removeChild(a)}})}function Xo(e,t,r){e.walk(n=>{if(n.children)for(let i=0;i<n.children.length;i++){let s=n.children[i];if(s.kind!=="text"&&!t(s))continue;s.kind!=="text"&&(s.kind="text",s.value=r(s));let a=s.prev;!a||a.kind!=="text"||(a.value+=s.value,a.sourceSpan=new h(a.sourceSpan.start,s.sourceSpan.end),n.removeChild(s),i--)}})}function Ko(e){return Xo(e,t=>t.kind==="cdata",t=>`<![CDATA[${t.value}]]>`)}function Qo(e){let t=r=>r.kind==="element"&&r.attrs.length===0&&r.children.length===1&&r.firstChild.kind==="text"&&!y.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&r.prev?.kind==="text"&&r.next?.kind==="text";e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+a.value,s.sourceSpan=new h(s.sourceSpan.start,a.sourceSpan.end),s.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,s.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(i),n--,r.removeChild(a)}})}function Jo(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/s;e.walk(n=>{if(An(n,t))for(let i of n.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,a=null,o=i.value.split(r);for(let c=0;c<o.length;c++,s=a){let u=o[c];if(c%2===0){a=s.moveBy(u.length),u.length>0&&n.insertChildBefore(i,{kind:"text",value:u,sourceSpan:new h(s,a)});continue}a=s.moveBy(u.length+4),n.insertChildBefore(i,{kind:"interpolation",sourceSpan:new h(s,a),children:u.length===0?[]:[{kind:"text",value:u,sourceSpan:new h(s.moveBy(2),a.moveBy(-2))}]})}n.removeChild(i)}})}function Zo(e,t){e.walk(r=>{let n=r.$children;if(!n)return;if(n.length===0||n.length===1&&n[0].kind==="text"&&y.trim(n[0].value).length===0){r.hasDanglingSpaces=n.length>0,r.$children=[];return}let i=yn(r,t),s=gr(r);if(!i)for(let a=0;a<n.length;a++){let o=n[a];if(o.kind!=="text")continue;let{leadingWhitespace:c,text:u,trailingWhitespace:p}=xn(o.value),d=o.prev,S=o.next;u?(o.value=u,o.sourceSpan=new h(o.sourceSpan.start.moveBy(c.length),o.sourceSpan.end.moveBy(-p.length)),c&&(d&&(d.hasTrailingSpaces=!0),o.hasLeadingSpaces=!0),p&&(o.hasTrailingSpaces=!0,S&&(S.hasLeadingSpaces=!0))):(r.removeChild(o),a--,(c||p)&&(d&&(d.hasTrailingSpaces=!0),S&&(S.hasLeadingSpaces=!0)))}r.isWhitespaceSensitive=i,r.isIndentationSensitive=s})}function el(e){e.walk(t=>{t.isSelfClosing=!t.children||t.kind==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function tl(e,t){e.walk(r=>{r.kind==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function rl(e,t){e.walk(r=>{r.cssDisplay=Fn(r,t)})}function nl(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=Pn(r,t);return}for(let i of n)i.isLeadingSpaceSensitive=Nn(i,t),i.isTrailingSpaceSensitive=Ln(i,t);for(let i=0;i<n.length;i++){let s=n[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===n.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var hs=zo;function il(e,t,r){let{node:n}=e;switch(n.kind){case"root":return t.__onHtmlRoot&&t.__onHtmlRoot(n),[C(Re(e,t,r)),v];case"element":case"ieConditionalComment":return Oi(e,t,r);case"angularControlFlowBlock":return Ai(e,t,r);case"angularControlFlowBlockParameters":return Ni(e,t,r);case"angularControlFlowBlockParameter":return y.trim(n.expression);case"angularLetDeclaration":return C(["@let ",C([n.id," =",C(A([_,r("init")]))]),";"]);case"angularLetDeclarationInitializer":return n.value;case"angularIcuExpression":return Li(e,t,r);case"angularIcuCase":return Pi(e,t,r);case"ieConditionalStartComment":case"ieConditionalEndComment":return[Se(n),fe(n)];case"interpolation":return[Se(n,t),...e.map(r,"children"),fe(n,t)];case"text":{if(n.parent.kind==="interpolation"){let o=/\n[^\S\n]*$/,c=o.test(n.value),u=c?n.value.replace(o,""):n.value;return[L(u),c?v:""]}let i=U(n,t),s=It(n),a=V(n,t);return s[0]=[i,s[0]],s.push([s.pop(),a]),xt(s)}case"docType":return[C([Se(n,t)," ",w(0,n.value.replace(/^html\b/i,"html"),/\s+/g," ")]),fe(n,t)];case"comment":return[U(n,t),L(t.originalText.slice(Q(n),te(n))),V(n,t)];case"attribute":{if(n.value===null)return n.rawName;let i=Er(n.value),s=Mt(n,t)?"":hn(i,'"');return[n.rawName,"=",s,L(s==='"'?w(0,i,'"',"""):w(0,i,"'","'")),s]}default:throw new fn(n,"HTML")}}var sl={features:{experimental_frontMatterSupport:{massageAstNode:!0,embed:!0,print:!0}},preprocess:hs,print:il,insertPragma:wi,massageAstNode:gn,embed:di,getVisitorKeys:Si},ms=sl;var fs=[{name:"Angular",type:"markup",aceMode:"html",extensions:[".component.html"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["angular"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"HTML",type:"markup",aceMode:"html",extensions:[".html",".hta",".htm",".html.hl",".inc",".xht",".xhtml"],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["html"],vscodeLanguageIds:["html"],linguistLanguageId:146},{name:"Lightning Web Components",type:"markup",aceMode:"html",extensions:[],tmScope:"text.html.basic",aliases:["xhtml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["lwc"],vscodeLanguageIds:["html"],filenames:[],linguistLanguageId:146},{name:"MJML",type:"markup",aceMode:"html",extensions:[".mjml"],tmScope:"text.mjml.basic",aliases:["MJML","mjml"],codemirrorMode:"htmlmixed",codemirrorMimeType:"text/html",parsers:["mjml"],filenames:[],vscodeLanguageIds:["mjml"],linguistLanguageId:146},{name:"Vue",type:"markup",aceMode:"vue",extensions:[".vue"],tmScope:"source.vue",codemirrorMode:"vue",codemirrorMimeType:"text/x-vue",parsers:["vue"],vscodeLanguageIds:["vue"],linguistLanguageId:391}];var Gr={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},objectWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap object literals.",choices:[{value:"preserve",description:"Keep as multi-line, if there is a newline between the opening brace and first property."},{value:"collapse",description:"Fit to a single line when possible."}]},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var ds="HTML",al={bracketSameLine:Gr.bracketSameLine,htmlWhitespaceSensitivity:{category:ds,type:"choice",default:"css",description:"How to handle whitespaces in HTML.",choices:[{value:"css",description:"Respect the default value of CSS display property."},{value:"strict",description:"Whitespaces are considered sensitive."},{value:"ignore",description:"Whitespaces are considered insensitive."}]},singleAttributePerLine:Gr.singleAttributePerLine,vueIndentScriptAndStyle:{category:ds,type:"boolean",default:!1,description:"Indent script and style tags in Vue files."}},gs=al;var Jr={};tn(Jr,{angular:()=>xl,html:()=>bl,lwc:()=>yl,mjml:()=>kl,vue:()=>Al});function ol(e,t){let r=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(r,t)}var _s=ol;var ll={canSelfClose:!0,normalizeTagName:!1,normalizeAttributeName:!1,allowHtmComponentClosingTags:!1,isTagNameCaseSensitive:!1,shouldParseFrontMatter:!0};function Zt(e){return{...ll,...e}}function $r(e){let{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,shouldParseAsRawText:i,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}=e;return{canSelfClose:t,allowHtmComponentClosingTags:r,isTagNameCaseSensitive:n,getTagContentType:i?(...o)=>i(...o)?R.RAW_TEXT:void 0:void 0,tokenizeAngularBlocks:s,tokenizeAngularLetDeclaration:a}}var er=new Map([["*",new Set(["accesskey","autocapitalize","autocorrect","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","slot","spellcheck","style","tabindex","title","translate","writingsuggestions"])],["a",new Set(["charset","coords","download","href","hreflang","name","ping","referrerpolicy","rel","rev","shape","target","type"])],["applet",new Set(["align","alt","archive","code","codebase","height","hspace","name","object","vspace","width"])],["area",new Set(["alt","coords","download","href","hreflang","nohref","ping","referrerpolicy","rel","shape","target","type"])],["audio",new Set(["autoplay","controls","crossorigin","loop","muted","preload","src"])],["base",new Set(["href","target"])],["basefont",new Set(["color","face","size"])],["blockquote",new Set(["cite"])],["body",new Set(["alink","background","bgcolor","link","text","vlink"])],["br",new Set(["clear"])],["button",new Set(["command","commandfor","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"])],["canvas",new Set(["height","width"])],["caption",new Set(["align"])],["col",new Set(["align","char","charoff","span","valign","width"])],["colgroup",new Set(["align","char","charoff","span","valign","width"])],["data",new Set(["value"])],["del",new Set(["cite","datetime"])],["details",new Set(["name","open"])],["dialog",new Set(["closedby","open"])],["dir",new Set(["compact"])],["div",new Set(["align"])],["dl",new Set(["compact"])],["embed",new Set(["height","src","type","width"])],["fieldset",new Set(["disabled","form","name"])],["font",new Set(["color","face","size"])],["form",new Set(["accept","accept-charset","action","autocomplete","enctype","method","name","novalidate","target"])],["frame",new Set(["frameborder","longdesc","marginheight","marginwidth","name","noresize","scrolling","src"])],["frameset",new Set(["cols","rows"])],["h1",new Set(["align"])],["h2",new Set(["align"])],["h3",new Set(["align"])],["h4",new Set(["align"])],["h5",new Set(["align"])],["h6",new Set(["align"])],["head",new Set(["profile"])],["hr",new Set(["align","noshade","size","width"])],["html",new Set(["manifest","version"])],["iframe",new Set(["align","allow","allowfullscreen","allowpaymentrequest","allowusermedia","frameborder","height","loading","longdesc","marginheight","marginwidth","name","referrerpolicy","sandbox","scrolling","src","srcdoc","width"])],["img",new Set(["align","alt","border","crossorigin","decoding","fetchpriority","height","hspace","ismap","loading","longdesc","name","referrerpolicy","sizes","src","srcset","usemap","vspace","width"])],["input",new Set(["accept","align","alpha","alt","autocomplete","checked","colorspace","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","ismap","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","popovertarget","popovertargetaction","readonly","required","size","src","step","type","usemap","value","width"])],["ins",new Set(["cite","datetime"])],["isindex",new Set(["prompt"])],["label",new Set(["for","form"])],["legend",new Set(["align"])],["li",new Set(["type","value"])],["link",new Set(["as","blocking","charset","color","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","rev","sizes","target","type"])],["map",new Set(["name"])],["menu",new Set(["compact"])],["meta",new Set(["charset","content","http-equiv","media","name","scheme"])],["meter",new Set(["high","low","max","min","optimum","value"])],["object",new Set(["align","archive","border","classid","codebase","codetype","data","declare","form","height","hspace","name","standby","type","typemustmatch","usemap","vspace","width"])],["ol",new Set(["compact","reversed","start","type"])],["optgroup",new Set(["disabled","label"])],["option",new Set(["disabled","label","selected","value"])],["output",new Set(["for","form","name"])],["p",new Set(["align"])],["param",new Set(["name","type","value","valuetype"])],["pre",new Set(["width"])],["progress",new Set(["max","value"])],["q",new Set(["cite"])],["script",new Set(["async","blocking","charset","crossorigin","defer","fetchpriority","integrity","language","nomodule","referrerpolicy","src","type"])],["select",new Set(["autocomplete","disabled","form","multiple","name","required","size"])],["slot",new Set(["name"])],["source",new Set(["height","media","sizes","src","srcset","type","width"])],["style",new Set(["blocking","media","type"])],["table",new Set(["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"])],["tbody",new Set(["align","char","charoff","valign"])],["td",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["template",new Set(["shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable"])],["textarea",new Set(["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"])],["tfoot",new Set(["align","char","charoff","valign"])],["th",new Set(["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"])],["thead",new Set(["align","char","charoff","valign"])],["time",new Set(["datetime"])],["tr",new Set(["align","bgcolor","char","charoff","valign"])],["track",new Set(["default","kind","label","src","srclang"])],["ul",new Set(["compact","type"])],["video",new Set(["autoplay","controls","crossorigin","height","loop","muted","playsinline","poster","preload","src","width"])]]);var Ss=new Set(["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","bgsound","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","dt","em","embed","fencedframe","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","isindex","kbd","keygen","label","legend","li","link","listing","main","map","mark","marquee","math","menu","menuitem","meta","meter","multicol","nav","nextid","nobr","noembed","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","plaintext","pre","progress","q","rb","rbc","rp","rt","rtc","ruby","s","samp","script","search","section","select","selectedcontent","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xmp"]);var tr={attrs:!0,children:!0,cases:!0,expression:!0},Es=new Set(["parent"]),oe,zr,Yr,We=class We{constructor(t={}){rn(this,oe);sr(this,"kind");sr(this,"parent");for(let r of new Set([...Es,...Object.keys(t)]))this.setProperty(r,t[r]);if(ce(t))for(let r of Object.getOwnPropertySymbols(t))this.setProperty(r,t[r])}setProperty(t,r){if(this[t]!==r){if(t in tr&&(r=r.map(n=>this.createChild(n))),!Es.has(t)){this[t]=r;return}Object.defineProperty(this,t,{value:r,enumerable:!1,configurable:!0})}}map(t){let r;for(let n in tr){let i=this[n];if(i){let s=cl(i,a=>a.map(t));r!==i&&(r||(r=new We({parent:this.parent})),r.setProperty(n,s))}}if(r)for(let n in this)n in tr||(r[n]=this[n]);return t(r||this)}walk(t){for(let r in tr){let n=this[r];if(n)for(let i=0;i<n.length;i++)n[i].walk(t)}t(this)}createChild(t){let r=t instanceof We?t.clone():new We(t);return r.setProperty("parent",this),r}insertChildBefore(t,r){let n=this.$children;n.splice(n.indexOf(t),0,this.createChild(r))}removeChild(t){let r=this.$children;r.splice(r.indexOf(t),1)}replaceChild(t,r){let n=this.$children;n[n.indexOf(t)]=this.createChild(r)}clone(){return new We(this)}get $children(){return this[$e(this,oe,zr)]}set $children(t){this[$e(this,oe,zr)]=t}get firstChild(){return this.$children?.[0]}get lastChild(){return F(1,this.$children,-1)}get prev(){let t=$e(this,oe,Yr);return t[t.indexOf(this)-1]}get next(){let t=$e(this,oe,Yr);return t[t.indexOf(this)+1]}get rawName(){return this.hasExplicitNamespace?this.fullName:this.name}get fullName(){return this.namespace?this.namespace+":"+this.name:this.name}get attrMap(){return Object.fromEntries(this.attrs.map(t=>[t.fullName,t.value]))}};oe=new WeakSet,zr=function(){return this.kind==="angularIcuCase"?"expression":this.kind==="angularIcuExpression"?"cases":"children"},Yr=function(){return this.parent?.$children??[]};var rr=We;function cl(e,t){let r=e.map(t);return r.some((n,i)=>n!==e[i])?r:e}var ul=[{regex:/^(?<openingTagSuffix>\[if(?<condition>[^\]]*)\]>)(?<data>.*?)<!\s*\[endif\]$/s,parse:pl},{regex:/^\[if(?<condition>[^\]]*)\]><!$/,parse:hl},{regex:/^<!\s*\[endif\]$/,parse:ml}];function Cs(e,t){if(e.value)for(let{regex:r,parse:n}of ul){let i=e.value.match(r);if(i)return n(e,i,t)}return null}function pl(e,t,r){let{openingTagSuffix:n,condition:i,data:s}=t.groups,a=4+n.length,o=e.sourceSpan.start.moveBy(a),c=o.moveBy(s.length),[u,p]=(()=>{try{return[!0,r(s,o).children]}catch{return[!1,[{kind:"text",value:s,sourceSpan:new h(o,c)}]]}})();return{kind:"ieConditionalComment",complete:u,children:p,condition:w(0,i.trim(),/\s+/g," "),sourceSpan:e.sourceSpan,startSourceSpan:new h(e.sourceSpan.start,o),endSourceSpan:new h(c,e.sourceSpan.end)}}function hl(e,t){let{condition:r}=t.groups;return{kind:"ieConditionalStartComment",condition:w(0,r.trim(),/\s+/g," "),sourceSpan:e.sourceSpan}}function ml(e){return{kind:"ieConditionalEndComment",sourceSpan:e.sourceSpan}}var jr=class extends Or{visitExpansionCase(t,r){r.parseOptions.name==="angular"&&this.visitChildren(r,n=>{n(t.expression)})}visit(t,{parseOptions:r}){_l(t),Sl(t,r),Cl(t,r),El(t)}};function bs(e,t,r,n){Gt(new jr,e.children,{parseOptions:r}),t&&e.children.unshift(t);let i=new rr(e);return i.walk(s=>{if(s.kind==="comment"){let a=Cs(s,n);a&&s.parent.replaceChild(s,a)}fl(s),dl(s),gl(s)}),i}function fl(e){if(e.kind==="block"){if(e.name=w(0,e.name.toLowerCase(),/\s+/g," ").trim(),e.kind="angularControlFlowBlock",!Ie(e.parameters)){delete e.parameters;return}for(let t of e.parameters)t.kind="angularControlFlowBlockParameter";e.parameters={kind:"angularControlFlowBlockParameters",children:e.parameters,sourceSpan:new h(e.parameters[0].sourceSpan.start,F(0,e.parameters,-1).sourceSpan.end)}}}function dl(e){e.kind==="letDeclaration"&&(e.kind="angularLetDeclaration",e.id=e.name,e.init={kind:"angularLetDeclarationInitializer",sourceSpan:new h(e.valueSpan.start,e.valueSpan.end),value:e.value},delete e.name,delete e.value)}function gl(e){e.kind==="expansion"&&(e.kind="angularIcuExpression"),e.kind==="expansionCase"&&(e.kind="angularIcuCase")}function vs(e,t){let r=e.toLowerCase();return t(r)?r:e}function Ts(e){let t=e.name.startsWith(":")?e.name.slice(1).split(":")[0]:null,r=e.nameSpan.toString(),n=t!==null&&r.startsWith(`${t}:`),i=n?r.slice(t.length+1):r;e.name=i,e.namespace=t,e.hasExplicitNamespace=n}function _l(e){switch(e.kind){case"element":Ts(e);for(let t of e.attrs)Ts(t),t.valueSpan?(t.value=t.valueSpan.toString(),/["']/.test(t.value[0])&&(t.value=t.value.slice(1,-1))):t.value=null;break;case"comment":e.value=e.sourceSpan.toString().slice(4,-3);break;case"text":e.value=e.sourceSpan.toString();break}}function Sl(e,t){if(e.kind==="element"){let r=Be(t.isTagNameCaseSensitive?e.name:e.name.toLowerCase());!e.namespace||e.namespace===r.implicitNamespacePrefix||ue(e)?e.tagDefinition=r:e.tagDefinition=Be("")}}function El(e){e.sourceSpan&&e.endSourceSpan&&(e.sourceSpan=new h(e.sourceSpan.start,e.endSourceSpan.end))}function Cl(e,t){if(e.kind==="element"&&(t.normalizeTagName&&(!e.namespace||e.namespace===e.tagDefinition.implicitNamespacePrefix||ue(e))&&(e.name=vs(e.name,r=>Ss.has(r))),t.normalizeAttributeName))for(let r of e.attrs)r.namespace||(r.name=vs(r.name,n=>er.has(e.name)&&(er.get("*").has(n)||er.get(e.name).has(n))))}function Kr(e,t){let{rootNodes:r,errors:n}=Jt(e,$r(t));return n.length>0&&Xr(n[0]),{parseOptions:t,rootNodes:r}}function ws(e,t){let r=$r(t),{rootNodes:n,errors:i}=Jt(e,r);if(n.some(u=>u.kind==="docType"&&u.value==="html"||u.kind==="element"&&u.name.toLowerCase()==="html"))return Kr(e,nr);let a,o=()=>a??(a=Jt(e,{...r,getTagContentType:void 0})),c=u=>{let{offset:p}=u.startSourceSpan.start;return o().rootNodes.find(d=>d.kind==="element"&&d.startSourceSpan.start.offset===p)??u};for(let[u,p]of n.entries())if(p.kind==="element"){if(p.isVoid)i=o().errors,n[u]=c(p);else if(vl(p)){let{endSourceSpan:d,startSourceSpan:S}=p,m=o().errors.find(g=>g.span.start.offset>S.start.offset&&g.span.start.offset<d.end.offset);m&&Xr(m),n[u]=c(p)}}return i.length>0&&Xr(i[0]),{parseOptions:t,rootNodes:n}}function vl(e){if(e.kind!=="element"||e.name!=="template")return!1;let t=e.attrs.find(r=>r.name==="lang")?.value;return!t||t==="html"}function Xr(e){let{msg:t,span:{start:r,end:n}}=e;throw _s(t,{loc:{start:{line:r.line+1,column:r.col+1},end:{line:n.line+1,column:n.col+1}},cause:e})}function Tl(e,t,r,n,i,s){let{offset:a}=n,o=Nt(t.slice(0,a))+r,c=Qr(o,e,{...i,shouldParseFrontMatter:!1},s);c.sourceSpan=new h(n,F(0,c.children,-1).sourceSpan.end);let u=c.children[0];return u.length===a?c.children.shift():(u.sourceSpan=new h(u.sourceSpan.start.moveBy(a),u.sourceSpan.end),u.value=u.value.slice(a)),c}function Qr(e,t,r,n={}){let{frontMatter:i,content:s}=r.shouldParseFrontMatter?hr(e):{content:e},a=new mt(e,n.filepath),o=new qe(a,0,0,0),c=o.moveBy(e.length),{parseOptions:u,rootNodes:p}=t(s,r),d={kind:"root",sourceSpan:new h(o,c),children:p},S;if(i){let[g,E]=[i.start,i.end].map(P=>new qe(a,P.index,P.line-1,P.column));S={...i,kind:"frontMatter",sourceSpan:new h(g,E)}}return bs(d,S,u,(g,E)=>Tl(t,e,g,E,u,n))}var nr=Zt({name:"html",normalizeTagName:!0,normalizeAttributeName:!0,allowHtmComponentClosingTags:!0});function gt(e){let t=Zt(e),r=t.name==="vue"?ws:Kr;return{parse:(n,i)=>Qr(n,r,t,i),hasPragma:Ti,hasIgnorePragma:bi,astFormat:"html",locStart:Q,locEnd:te}}var bl=gt(nr),wl=new Set(["mj-style","mj-raw"]),kl=gt({...nr,name:"mjml",shouldParseAsRawText:e=>wl.has(e)}),xl=gt({name:"angular",tokenizeAngularBlocks:!0,tokenizeAngularLetDeclaration:!0}),Al=gt({name:"vue",isTagNameCaseSensitive:!0,shouldParseAsRawText(e,t,r,n){return e.toLowerCase()!=="html"&&!r&&(e!=="template"||n.some(({name:i,value:s})=>i==="lang"&&s!=="html"&&s!==""&&s!==void 0))}}),yl=gt({name:"lwc",canSelfClose:!1});var Nl={html:ms};export{ks as default,fs as languages,gs as options,Jr as parsers,Nl as printers};
|