Files
client/node_modules/prettier/plugins/angular.js
T

5 lines
130 KiB
JavaScript
Raw Normal View History

2026-10-07 18:56:27 +02:00
(function(n){function e(){var i=n();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.angular=e()}})(function(){"use strict";var vt=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var ur=Object.getPrototypeOf,pr=Object.prototype.hasOwnProperty;var hr=Reflect.get;var _n=t=>{throw TypeError(t)};var In=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},fr=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cr(e))!pr.call(t,i)&&i!==n&&vt(t,i,{get:()=>e[i],enumerable:!(s=lr(e,i))||s.enumerable});return t};var dr=t=>fr(vt({},"__esModule",{value:!0}),t);var wt=(t,e,n)=>e.has(t)||_n("Cannot "+n);var z=(t,e,n)=>(wt(t,e,"read from private field"),n?n.call(t):e.get(t)),De=(t,e,n)=>e.has(t)?_n("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),St=(t,e,n,s)=>(wt(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),w=(t,e,n)=>(wt(t,e,"access private method"),n);var Nn=(t,e,n)=>hr(ur(t),n,e);var oa={};In(oa,{parsers:()=>bn});var bn={};In(bn,{__ng_action:()=>na,__ng_binding:()=>sa,__ng_directive:()=>ra,__ng_interpolation:()=>ia});function mr(t){return typeof t=="string"?e=>e===t:e=>t.test(e)}function Pn(t,e,n){let s=mr(e);for(let i=n;i<t.length;i++){let r=t[i];if(s(r))return i}throw new Error(`Cannot find character ${e} from index ${n} in ${JSON.stringify(t)}`)}function Ln(t){return t.slice(0,1).toLowerCase()+t.slice(1)}function Be(t){let{start:e,end:n}=t;return{start:e,end:n,range:[e,n]}}function An(t){return!!t.extra?.parenthesized}function ye(t){return t.type==="TSNonNullExpression"&&!An(t)?ye(t.expression):(t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression")&&!An(t)}var ua=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var x;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(x||(x={}));var K,$n="svg",gr="math",Fs="",Mn="*",Et=()=>Object.create(null);function vr(){return K||(K=Et(),B(x.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),B(x.STYLE,void 0,[["*",["style"]]]),B(x.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),B(x.URL,gr,[["*",["href","xlink:href"]]]),B(x.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),B(x.URL,$n,[["a",["href","xlink:href"]]]),B(x.ATTRIBUTE_NO_BINDING,$n,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),B(x.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]]]),K)}function B(t,e,n){let s=e??Fs;for(let[i,r]of n){let a=i.toLowerCase();for(let u of r){let h=u.toLowerCase(),d=K[h]??(K[h]=Et()),g=d[s]??(d[s]=Et());g[a]=t}}}function wr(t,e,n){let i=vr()[e.toLowerCase()];if(!i)return x.NONE;let r=t.toLowerCase(),a;if(n){let u=i[n];u&&(a=u[r]??u[Mn])}if(a===void 0){let u=i[Fs];u&&(a=u[r]??u[Mn])}return a??x.NONE}var Rn;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(Rn||(Rn={}));var On;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t[t.Eager=1]="Eager"})(On||(On={}));var Dn;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorI
`&&++u==n)););for(a=0,u=0;a<e&&r<s.length-1&&(r++,a++,!(s[r]==`
`&&++u==n)););return{before:s.substring(i,this.offset),after:s.substring(this.offset,r+1)}}return null}},et=class{content;url;constructor(e,n){this.content=e,this.url=n}},tt=class{start;end;fullStart;details;constructor(e,n,s=e,i=null){this.start=e,this.end=n,this.fullStart=s,this.details=i}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},nt;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(nt||(nt={}));var Re=class extends Error{span;msg;level;relatedError;constructor(e,n,s=nt.ERROR,i){super(n),this.span=e,this.msg=n,this.level=s,this.relatedError=i,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${nt[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var as;(function(t){t[t.Inline=0]="Inline",t[t.SideEffect=1]="SideEffect",t[t.Omit=2]="Omit"})(as||(as={}));var ls;(function(t){t[t.Global=0]="Global",t[t.Local=1]="Local",t[t.Isolated=2]="Isolated"})(ls||(ls={}));var cs;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(cs||(cs={}));var qr="(:(where|is)\\()?";var Qs="-shadowcsshost",jr="-shadowcsscontext",nn="[^)(]*",zr=`(?:\\(${nn}\\)|${nn})+?`,Gr=`(?:\\(${zr}\\)|${nn})+?`,dn=`(?:\\((${Gr})\\))`,da=new RegExp("(:nth-[-\\w]+)"+dn,"g"),ma=new RegExp(Qs+dn+"?([^,{]*)","gim"),Xr=jr+dn+"([^{]*)",ga=new RegExp(`${qr}(${Xr})`,"gim"),Qr=Qs+"-no-combinator",va=new RegExp(`${Qr}(?![^(]*\\))`,"g");var Js="%COMMENT%",wa=new RegExp(Js,"g");var Sa=new RegExp(`(\\s*(?:${Js}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");var Jr="%COMMA_IN_PLACEHOLDER%",Yr="%SEMI_IN_PLACEHOLDER%",Kr="%COLON_IN_PLACEHOLDER%",xa=new RegExp(Jr,"g"),ya=new RegExp(Yr,"g"),Ea=new RegExp(Kr,"g");var l;(function(t){t[t.ListEnd=0]="ListEnd",t[t.Statement=1]="Statement",t[t.Variable=2]="Variable",t[t.ElementStart=3]="ElementStart",t[t.Element=4]="Element",t[t.Template=5]="Template",t[t.ElementEnd=6]="ElementEnd",t[t.ContainerStart=7]="ContainerStart",t[t.Container=8]="Container",t[t.ContainerEnd=9]="ContainerEnd",t[t.DisableBindings=10]="DisableBindings",t[t.ConditionalCreate=11]="ConditionalCreate",t[t.ConditionalBranchCreate=12]="ConditionalBranchCreate",t[t.Conditional=13]="Conditional",t[t.EnableBindings=14]="EnableBindings",t[t.Text=15]="Text",t[t.Listener=16]="Listener",t[t.InterpolateText=17]="InterpolateText",t[t.Binding=18]="Binding",t[t.Property=19]="Property",t[t.StyleProp=20]="StyleProp",t[t.ClassProp=21]="ClassProp",t[t.StyleMap=22]="StyleMap",t[t.ClassMap=23]="ClassMap",t[t.Advance=24]="Advance",t[t.Pipe=25]="Pipe",t[t.Attribute=26]="Attribute",t[t.ExtractedAttribute=27]="ExtractedAttribute",t[t.Defer=28]="Defer",t[t.DeferOn=29]="DeferOn",t[t.DeferWhen=30]="DeferWhen",t[t.I18nMessage=31]="I18nMessage",t[t.DomProperty=32]="DomProperty",t[t.Namespace=33]="Namespace",t[t.ProjectionDef=34]="ProjectionDef",t[t.EnableIncrementalHydrationRuntime=35]="EnableIncrementalHydrationRuntime",t[t.Projection=36]="Projection",t[t.RepeaterCreate=37]="RepeaterCreate",t[t.Repeater=38]="Repeater",t[t.TwoWayProperty=39]="TwoWayProperty",t[t.TwoWayListener=40]="TwoWayListener",t[t.DeclareLet=41]="DeclareLet",t[t.StoreLet=42]="StoreLet",t[t.I18nStart=43]="I18nStart",t[t.I18n=44]="I18n",t[t.I18nEnd=45]="I18nEnd",t[t.I18nExpression=46]="I18nExpression",t[t.I18nApply=47]="I18nApply",t[t.IcuStart=48]="IcuStart",t[t.IcuEnd=49]="IcuEnd",t[t.IcuPlaceholder=50]="IcuPlaceholder",t[t.I18nContext=51]="I18nContext",t[t.I18nAttributes=52]="I18nAttributes",t[t.SourceLocation=53]="SourceLocation",t[t.Animation=54]="Animation",t[t.AnimationString=55]="AnimationString",t[t.AnimationBinding=56]="AnimationBinding",t[t.AnimationListener=57]="AnimationListener",t[t.Control=58]="Control",t[t.ControlCreate=59]="ControlCreate"})(l||(l={}));var te;(function(t){t[t.LexicalRead=0]="LexicalRead",t[t.Context=1]="Context",t[t.TrackContext=2]="TrackContext",t[t.ReadVariable=3]="ReadVariable"
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,Ma=new RegExp(`[^${Ks}]`),Ra=new RegExp(`[${Ks}]{2,}`,"g");var f;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.RegExpBody=7]="RegExpBody",t[t.RegExpFlags=8]="RegExpFlags",t[t.Error=9]="Error"})(f||(f={}));var W;(function(t){t[t.Plain=0]="Plain",t[t.TemplateLiteralPart=1]="TemplateLiteralPart",t[t.TemplateLiteralEnd=2]="TemplateLiteralEnd"})(W||(W={}));var ro=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in","instanceof"],Oe=class{tokenize(e){return new on(e).scan()}},I=class{index;end;type;numValue;strValue;constructor(e,n,s,i,r){this.index=e,this.end=n,this.type=s,this.numValue=i,this.strValue=r}isCharacter(e){return this.type===f.Character&&this.numValue===e}isNumber(){return this.type===f.Number}isString(){return this.type===f.String}isOperator(e){return this.type===f.Operator&&this.strValue===e}isIdentifier(){return this.type===f.Identifier}isPrivateIdentifier(){return this.type===f.PrivateIdentifier}isKeyword(){return this.type===f.Keyword}isKeywordLet(){return this.type===f.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===f.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===f.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===f.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===f.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===f.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===f.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===f.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===f.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===f.Keyword&&this.strValue==="in"}isKeywordInstanceOf(){return this.type===f.Keyword&&this.strValue==="instanceof"}isError(){return this.type===f.Error}isRegExpBody(){return this.type===f.RegExpBody}isRegExpFlags(){return this.type===f.RegExpFlags}toNumber(){return this.type===f.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===W.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===W.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}toString(){switch(this.type){case f.Character:case f.Identifier:case f.Keyword:case f.Operator:case f.PrivateIdentifier:case f.String:case f.Error:case f.RegExpBody:case f.RegExpFlags:return this.strValue;case f.Number:return this.numValue.toString();default:return null}}},Ae=class extends I{kind;constructor(e,n,s,i){super(e,n,f.String,0,s),this.kind=i}};function Ce(t,e,n){return new I(t,e,f.Character,n,String.fromCharCode(n))}function oo(t,e,n){return new I(t,e,f.Identifier,0,n)}function ao(t,e,n){return new I(t,e,f.PrivateIdentifier,0,n)}function lo(t,e,n){return new I(t,e,f.Keyword,0,n)}function F(t,e,n){return new I(t,e,f.Operator,0,n)}function co(t,e,n){return new I(t,e,f.Number,n,"")}function uo(t,e,n){return new I(t,e,f.Error,0,n)}function po(t,e,n){return new I(t,e,f.RegExpBody,0,n)}function ho(t,e,n){return new I(t,e,f.RegExpFlags,0,n)}var be=new I(-1,-1,f.Character,0,""),on=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(e){this.input=e,this.length=e.length,this.advance()}scan(){let e=this.scanToken();for(;e!==null;)this.tokens.push(e),e=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?Ee:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,i=this.index;for(;s<=Hs;)if(++i>=n){s=Ee;break}else s=e.charCodeAt(i);if(this.peek=s,this.index=i,i>=n)return null;if(ks(s))return this.scanIdentifier();if(X(s))return this.scanNumber(i);let r=i;switch(s){case G:return this.advance(),X(this.peek)?this.scanNumber(r):this.peek!==G?Ce(r,this.index,G):(this.advance(),this.peek===G?(this.advance(),F(r,this.index,"...")):this.error(`Unexpected chara
If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let n=Fe(e),s=this._schema.get(n)||this._schema.get("unknown");return Array.from(s.keys()).map(i=>ko.get(i)??i)}allKnownEventsOfElement(e){let n=Fe(e);return Array.from(this._eventSchema.get(n)??[])}normalizeAnimationStyleProperty(e){return Er(e)}normalizeAnimationStyleValue(e,n,s){let i="",r=s.toString().trim(),a=null;if(_o(e)&&s!==0&&s!=="0")if(typeof s=="number")i="px";else{let u=s.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&(a=`Please provide a CSS unit value for ${n}:${s}`)}return{error:a,value:r+i}}};function _o(t){switch(t){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var Oa=new ge(new Oe);function $(t){return e=>e.kind===t}function Pe(t,e){return n=>n.kind===t&&e===n.expression instanceof me}function Io(t){return(t.kind===l.Property||t.kind===l.TwoWayProperty)&&!(t.expression instanceof me)}var Da=[{test:$(l.StyleMap),transform:rt},{test:$(l.ClassMap),transform:rt},{test:$(l.StyleProp)},{test:$(l.ClassProp)},{test:Pe(l.Attribute,!0)},{test:Pe(l.Property,!0)},{test:Io},{test:Pe(l.Attribute,!1)},{test:$(l.Control)}],Ba=[{test:Pe(l.DomProperty,!0)},{test:Pe(l.DomProperty,!1)},{test:$(l.Attribute)},{test:$(l.StyleMap),transform:rt},{test:$(l.ClassMap),transform:rt},{test:$(l.StyleProp)},{test:$(l.ClassProp)}],Fa=new Set([l.Listener,l.TwoWayListener,l.AnimationListener,l.StyleMap,l.ClassMap,l.StyleProp,l.ClassProp,l.Property,l.TwoWayProperty,l.DomProperty,l.Attribute,l.Animation,l.Control]);function rt(t){return t.slice(t.length-1)}var Va=new Map([[O.Idle,{none:c.deferOnIdle,prefetch:c.deferPrefetchOnIdle,hydrate:c.deferHydrateOnIdle}],[O.Immediate,{none:c.deferOnImmediate,prefetch:c.deferPrefetchOnImmediate,hydrate:c.deferHydrateOnImmediate}],[O.Timer,{none:c.deferOnTimer,prefetch:c.deferPrefetchOnTimer,hydrate:c.deferHydrateOnTimer}],[O.Hover,{none:c.deferOnHover,prefetch:c.deferPrefetchOnHover,hydrate:c.deferHydrateOnHover}],[O.Interaction,{none:c.deferOnInteraction,prefetch:c.deferPrefetchOnInteraction,hydrate:c.deferHydrateOnInteraction}],[O.Viewport,{none:c.deferOnViewport,prefetch:c.deferPrefetchOnViewport,hydrate:c.deferHydrateOnViewport}],[O.Never,{none:c.deferHydrateNever,prefetch:c.deferHydrateNever,hydrate:c.deferHydrateNever}]]);var Ha=[c.pipeBind1,c.pipeBind2,c.pipeBind3,c.pipeBind4];var Ua={constant:[c.interpolate,c.interpolate1,c.interpolate2,c.interpolate3,c.interpolate4,c.interpolate5,c.interpolate6,c.interpolate7,c.interpolate8],variable:c.interpolateV,mapping:t=>{if(t%2===0)throw new Error("Expected odd number of arguments");return(t-1)/2}};var Wa=new Map([["window",c.resolveWindow],["document",c.resolveDocument],["body",c.resolveBody]]);var qa=new Map([[x.HTML,c.sanitizeHtml],[x.RESOURCE_URL,c.sanitizeResourceUrl],[x.SCRIPT,c.sanitizeScript],[x.STYLE,c.sanitizeStyle],[x.URL,c.sanitizeUrl],[x.ATTRIBUTE_NO_BINDING,c.validateAttribute]]),ja=new Map([[x.HTML,c.trustConstantHtml],[x.RESOURCE_URL,c.trustConstantResourceUrl]]);var Ns;(function(t){t[t.None=0]="None",t[t.ViewContextRead=1]="ViewContextRead",t[t.ViewContextWrite=2]="ViewContextWrite",t[t.SideEffectful=4]="SideEffectful"})(Ns||(Ns={}));var za=new Map([[M.Property,R.Property],[M.TwoWay,R.TwoWayProperty],[M.Attribute,R.Attribute],[M.Class,R.ClassName],[M.Style,R.StyleProperty],[M.LegacyAnimation,R.LegacyAnim