prettier 3.5.0 → 3.5.2
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/README.md +1 -1
- package/THIRD-PARTY-NOTICES.md +8 -8
- package/index.cjs +1 -1
- package/index.d.ts +7 -2
- package/index.mjs +6 -4
- package/internal/cli.mjs +20 -8
- package/package.json +1 -17
- package/plugins/estree.js +1 -1
- package/plugins/estree.mjs +1 -1
- package/plugins/html.js +1 -1
- package/plugins/html.mjs +1 -1
- package/plugins/postcss.js +6 -6
- package/plugins/postcss.mjs +6 -6
- package/plugins/typescript.js +1 -1
- package/plugins/typescript.mjs +1 -1
- package/plugins/yaml.js +1 -1
- package/plugins/yaml.mjs +1 -1
- package/standalone.d.ts +1 -1
- package/standalone.js +2 -2
- package/standalone.mjs +2 -2
package/plugins/estree.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var Xa=Object.defineProperty;var Ws=e=>{throw TypeError(e)};var Tr=(e,t)=>{for(v
|
|
|
2
2
|
`)return t-2;if(s===`
|
|
3
3
|
`||s==="\r"||s==="\u2028"||s==="\u2029")return t-1}else{if(s==="\r"&&e.charAt(t+1)===`
|
|
4
4
|
`)return t+2;if(s===`
|
|
5
|
-
`||s==="\r"||s==="\u2028"||s==="\u2029")return t+1}return t}var Ne=eo;function to(e,t,r={}){let n=Ye(e,r.backwards?t-1:t,r),s=Ne(e,n,r);return n!==s}var Z=to;function ro(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ot=ro;function no(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Zs(e,t):t}var _t=no;function so(e,t){let r=null,n=t;for(;n!==r;)r=n,n=zs(e,n),n=Ot(e,n),n=Ye(e,n);return n=_t(e,n),n=Ne(e,n),n!==!1&&Z(e,n)}var vt=so;function uo(e){return Array.isArray(e)&&e.length>0}var O=uo;var eu=new Proxy(()=>{},{get:()=>eu}),jt=eu;var xr="'",tu='"';function io(e,t){let r=t===!0||t===xr?xr:tu,n=r===xr?tu:xr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var hr=io;function ao(e,t,r){let n=t==='"'?"'":'"',u=N(!1,e,/\\(.)|(["'])/gsu,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var ru=ao;function oo(e,t){jt(/^(?<quote>["']).*\k<quote>$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":hr(r,t.singleQuote);return e.charAt(0)===n?e:ru(r,n,!1)}var rt=oo;function q(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(q(r),t):t}function k(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function bt(e,t){let r=q(e);return Number.isInteger(r)&&r===q(t)}function po(e,t){let r=k(e);return Number.isInteger(r)&&r===k(t)}function nu(e,t){return bt(e,t)&&po(e,t)}var er=null;function tr(e){if(er!==null&&typeof er.property){let t=er;return er=tr.prototype=null,t}return er=tr.prototype=e??Object.create(null),new tr}var co=10;for(let e=0;e<=co;e++)tr();function Ln(e){return tr(e)}function lo(e,t="type"){Ln(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var gr=lo;var su={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var mo=gr(su),Sr=mo;function yo(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var R=yo;var Do=R(["Block","CommentBlock","MultiLine"]),ee=Do;var fo=R(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),Br=fo;function Eo(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function Fo(e,t){return t.some(r=>Eo(e,r))}var uu=Fo;function Co({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var br=Co;function nr(e,t){return t(e)||Hs(e,{getVisitorKeys:Sr,predicate:t})}function Rt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||L(e)||W(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||Ae(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function ou(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function kr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var Ct=R(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),pu=R(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),Y=R(["ArrayExpression","TupleExpression"]),se=R(["ObjectExpression","RecordExpression"]);function cu(e){return e.type==="LogicalExpression"&&e.operator==="??"}function Fe(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function jn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&Fe(e.argument)}function te(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Mn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var Ir=R(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),Ao=R(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Me=R(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Mt=R(["FunctionExpression","ArrowFunctionExpression"]);function To(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function wn(e){return L(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var X=R(["JSXElement","JSXFragment"]);function Pt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Lr(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function lu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!bt(e,e.typeAnnotation)}var De=R(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function At(e){return W(e)||e.type==="BindExpression"&&!!e.object}var xo=R(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function Jt(e){return br(e)||Br(e)||xo(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function ho(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var go=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function So(e){return uu(e,go)}function kt(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let r=pe(e);if(r.length===1){if(wn(e)&&kt(t))return Mt(r[0]);if(ho(e.callee))return wn(r[0])}else if((r.length===2||r.length===3)&&(r[0].type==="TemplateLiteral"||te(r[0]))&&So(e.callee))return r[2]&&!Fe(r[2])?!1:(r.length===2?Mt(r[1]):To(r[1])&&z(r[1]).length<=1)||wn(r[1]);return!1}var mu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),L=mu(R(["CallExpression","OptionalCallExpression"])),W=mu(R(["MemberExpression","OptionalMemberExpression"]));function Rn(e,t=5){return yu(e,t)<=t}function yu(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=yu(s,t-r)),r>t)return r}return r}var Bo=.25;function sr(e,t){let{printWidth:r}=t;if(T(e))return!1;let n=r*Bo;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||jn(e)&&!T(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:te(e)?rt(fe(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(`
|
|
5
|
+
`||s==="\r"||s==="\u2028"||s==="\u2029")return t+1}return t}var Ne=eo;function to(e,t,r={}){let n=Ye(e,r.backwards?t-1:t,r),s=Ne(e,n,r);return n!==s}var Z=to;function ro(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ot=ro;function no(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Zs(e,t):t}var _t=no;function so(e,t){let r=null,n=t;for(;n!==r;)r=n,n=zs(e,n),n=Ot(e,n),n=Ye(e,n);return n=_t(e,n),n=Ne(e,n),n!==!1&&Z(e,n)}var vt=so;function uo(e){return Array.isArray(e)&&e.length>0}var O=uo;var eu=new Proxy(()=>{},{get:()=>eu}),jt=eu;var xr="'",tu='"';function io(e,t){let r=t===!0||t===xr?xr:tu,n=r===xr?tu:xr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var hr=io;function ao(e,t,r){let n=t==='"'?"'":'"',u=N(!1,e,/\\(.)|(["'])/gsu,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var ru=ao;function oo(e,t){jt.ok(/^(?<quote>["']).*\k<quote>$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":hr(r,t.singleQuote);return e.charAt(0)===n?e:ru(r,n,!1)}var rt=oo;function q(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(q(r),t):t}function k(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function bt(e,t){let r=q(e);return Number.isInteger(r)&&r===q(t)}function po(e,t){let r=k(e);return Number.isInteger(r)&&r===k(t)}function nu(e,t){return bt(e,t)&&po(e,t)}var er=null;function tr(e){if(er!==null&&typeof er.property){let t=er;return er=tr.prototype=null,t}return er=tr.prototype=e??Object.create(null),new tr}var co=10;for(let e=0;e<=co;e++)tr();function Ln(e){return tr(e)}function lo(e,t="type"){Ln(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var gr=lo;var su={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","predicate","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","variance","key","typeAnnotation","value"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","variance","key","typeAnnotation","value"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeParameters","typeArguments","attributes"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumBody:["members"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","options","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]};var mo=gr(su),Sr=mo;function yo(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var R=yo;var Do=R(["Block","CommentBlock","MultiLine"]),ee=Do;var fo=R(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),Br=fo;function Eo(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function Fo(e,t){return t.some(r=>Eo(e,r))}var uu=Fo;function Co({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var br=Co;function nr(e,t){return t(e)||Hs(e,{getVisitorKeys:Sr,predicate:t})}function Rt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||L(e)||W(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||Ae(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function ou(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function kr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var Ct=R(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),pu=R(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),Y=R(["ArrayExpression","TupleExpression"]),se=R(["ObjectExpression","RecordExpression"]);function cu(e){return e.type==="LogicalExpression"&&e.operator==="??"}function Fe(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function jn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&Fe(e.argument)}function te(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Mn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var Ir=R(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),Ao=R(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),Me=R(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Mt=R(["FunctionExpression","ArrowFunctionExpression"]);function To(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function wn(e){return L(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var X=R(["JSXElement","JSXFragment"]);function Pt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Lr(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function lu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!bt(e,e.typeAnnotation)}var De=R(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function At(e){return W(e)||e.type==="BindExpression"&&!!e.object}var xo=R(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function Jt(e){return br(e)||Br(e)||xo(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function ho(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var go=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function So(e){return uu(e,go)}function kt(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let r=pe(e);if(r.length===1){if(wn(e)&&kt(t))return Mt(r[0]);if(ho(e.callee))return wn(r[0])}else if((r.length===2||r.length===3)&&(r[0].type==="TemplateLiteral"||te(r[0]))&&So(e.callee))return r[2]&&!Fe(r[2])?!1:(r.length===2?Mt(r[1]):To(r[1])&&z(r[1]).length<=1)||wn(r[1]);return!1}var mu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),L=mu(R(["CallExpression","OptionalCallExpression"])),W=mu(R(["MemberExpression","OptionalMemberExpression"]));function Rn(e,t=5){return yu(e,t)<=t}function yu(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=yu(s,t-r)),r>t)return r}return r}var Bo=.25;function sr(e,t){let{printWidth:r}=t;if(T(e))return!1;let n=r*Bo;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||jn(e)&&!T(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:te(e)?rt(fe(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(`
|
|
6
6
|
`):e.type==="UnaryExpression"?sr(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:Ir(e)}function Le(e,t){return X(t)?It(t):T(t,h.Leading,r=>Z(e,k(r)))}function iu(e){return e.quasis.some(t=>t.value.raw.includes(`
|
|
7
7
|
`))}function wr(e,t){return(e.type==="TemplateLiteral"&&iu(e)||e.type==="TaggedTemplateExpression"&&iu(e.quasi))&&!Z(t,q(e),{backwards:!0})}function Or(e){if(!T(e))return!1;let t=M(!1,ct(e,h.Dangling),-1);return t&&!ee(t)}function Du(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Mt(r)){if(t+=1,t>1)return!0}else if(L(r)){for(let n of pe(r))if(Mt(n))return!0}return!1}function _r(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&L(t)&&L(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var bo=new Set(["!","-","+","~"]);function Ie(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return Ie(e.expression,t);let r=n=>Ie(n,t-1);if(Mn(e))return tt(e.pattern??e.regex.pattern)<=5;if(Ir(e)||Ao(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(`
|
|
8
8
|
`))&&e.expressions.every(r);if(se(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(Y(e))return e.elements.every(n=>n===null||r(n));if(lt(e)){if(e.type==="ImportExpression"||Ie(e.callee,t)){let n=pe(e);return n.length<=t&&n.every(r)}return!1}return W(e)?Ie(e.object,t)&&Ie(e.property,t):e.type==="UnaryExpression"&&bo.has(e.operator)||e.type==="UpdateExpression"?Ie(e.argument,t):!1}function fe(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}function fu(e){return e}function oe(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ae(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ae(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ae(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ae(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ae(e.callee,t);case"ConditionalExpression":return ae(e.test,t);case"UpdateExpression":return!e.prefix&&ae(e.argument,t);case"BindExpression":return e.object&&ae(e.object,t);case"SequenceExpression":return ae(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ae(e.expression,t);default:return t(e)}}var au={"==":!0,"!=":!0,"===":!0,"!==":!0},Pr={"*":!0,"/":!0,"%":!0},vn={">>":!0,">>>":!0,"<<":!0};function ur(e,t){return!(rr(t)!==rr(e)||e==="**"||au[e]&&au[t]||t==="%"&&Pr[e]||e==="%"&&Pr[t]||t!==e&&Pr[t]&&Pr[e]||vn[e]&&vn[t])}var Po=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function rr(e){return Po.get(e)}function Eu(e){return!!vn[e]||e==="|"||e==="^"||e==="&"}function Fu(e){var r;if(e.rest)return!0;let t=z(e);return((r=M(!1,t,-1))==null?void 0:r.type)==="RestElement"}var On=new WeakMap;function z(e){if(On.has(e))return On.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),On.set(e,t),t}function Cu(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var _n=new WeakMap;function pe(e){if(_n.has(e))return _n.get(e);if(e.type==="ChainExpression")return pe(e.expression);let t=e.arguments;return e.type==="ImportExpression"&&(t=[e.source],e.options&&t.push(e.options)),_n.set(e,t),t}function qt(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>qt(e,t),"expression");r.type==="ImportExpression"?(e.call(n=>t(n,0),"source"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function Jn(e,t){let r=[];if(e.type==="ChainExpression"&&(e=e.expression,r.push("expression")),e.type==="ImportExpression"){if(t===0||t===(e.options?-2:-1))return[...r,"source"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function ir(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function It(e){return(e==null?void 0:e.prettierIgnore)||T(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},Au=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&h.Leading&&!r.leading||e&h.Trailing&&!r.trailing||e&h.Dangling&&(r.leading||r.trailing)||e&h.Block&&!ee(r)||e&h.Line&&!Ct(r)||e&h.First&&n!==0||e&h.Last&&n!==s.length-1||e&h.PrettierIgnore&&!ir(r)||t&&!t(r))};function T(e,t,r){if(!O(e==null?void 0:e.comments))return!1;let n=Au(t,r);return n?e.comments.some(n):!0}function ct(e,t,r){if(!Array.isArray(e==null?void 0:e.comments))return[];let n=Au(t,r);return n?e.comments.filter(n):e.comments}var ce=(e,{originalText:t})=>vt(t,k(e));function lt(e){return L(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function Ce(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!Pt(e))}var Ae=R(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),Xe=R(["UnionTypeAnnotation","TSUnionType"]),vr=R(["IntersectionTypeAnnotation","TSIntersectionType"]);var ko=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),Wt=e=>{for(let t of e.quasis)delete t.value};function Tu(e,t,r){var s,u;if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="BigIntLiteralTypeAnnotation")&&e.value&&(t.value=e.value.toLowerCase()),(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:i}=e;te(i)||Fe(i)?t.key=String(i.value):i.type==="Identifier"&&(t.key=i.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(i=>i.type==="JSXAttribute"&&i.name.name==="jsx"))for(let{type:i,expression:a}of t.children)i==="JSXExpressionContainer"&&a.type==="TemplateLiteral"&&Wt(a);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&Wt(t.value.expression),e.type==="JSXAttribute"&&((s=e.value)==null?void 0:s.type)==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=N(!1,e.value.value,/["']|"|'/gu,'"'));let n=e.expression||e.callee;if(e.type==="Decorator"&&n.type==="CallExpression"&&n.callee.name==="Component"&&n.arguments.length===1){let i=e.expression.arguments[0].properties;for(let[a,o]of t.expression.arguments[0].properties.entries())switch(i[a].key.name){case"styles":Y(o.value)&&Wt(o.value.elements[0]);break;case"template":o.value.type==="TemplateLiteral"&&Wt(o.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&Wt(t.quasi),e.type==="TemplateLiteral"&&((u=e.leadingComments)!=null&&u.some(a=>ee(a)&&["GraphQL","HTML"].some(o=>a.value===` ${o} `))||r.type==="CallExpression"&&r.callee.name==="graphql"||!e.leadingComments)&&Wt(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression"),e.type==="TSMappedType"&&(delete t.key,delete t.constraint),e.type==="TSEnumDeclaration"&&delete t.body}Tu.ignoredProperties=ko;var du=Tu;var Re="string",he="array",nt="cursor",He="indent",Ve="align",$e="trim",me="group",we="fill",Te="if-break",Ke="indent-if-break",Qe="line-suffix",Je="line-suffix-boundary",ie="line",ge="label",Oe="break-parent",jr=new Set([nt,He,Ve,$e,me,we,Te,Ke,Qe,Je,ie,ge,Oe]);function Io(e){if(typeof e=="string")return Re;if(Array.isArray(e))return he;if(!e)return;let{type:t}=e;if(jr.has(t))return t}var Se=Io;var Lo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function wo(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
|
package/plugins/html.js
CHANGED
|
@@ -6,7 +6,7 @@ Expected it to be ${n}.`}var pr=class extends Error{name="InvalidDocError";const
|
|
|
6
6
|
`)){if(r.length===0)continue;let n=O.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&n<e&&(e=n)}return e===Number.POSITIVE_INFINITY?0:e}function vr(t,e=Yi(t)){return e===0?t:t.split(`
|
|
7
7
|
`).map(r=>r.slice(e)).join(`
|
|
8
8
|
`)}function yr(t){return w(!1,w(!1,t,"'","'"),""",'"')}function N(t){return yr(t.value)}var ji=new Set(["template","style","script"]);function et(t,e){return ge(t,e)&&!ji.has(t.fullName)}function ge(t,e){return e.parser==="vue"&&t.type==="element"&&t.parent.type==="root"&&t.fullName.toLowerCase()!=="html"}function xt(t,e){return ge(t,e)&&(et(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function Vn(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function Un(t,e){let r=t.parent;if(!ge(r,e))return!1;let n=r.fullName,s=t.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function kt(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?B(e):B(vr(_r(e)),S):H(_,O.split(e))}function Bt(t,e){return ge(t,e)&&t.name==="script"}var wr=/\{\{(.+?)\}\}/su;async function Wn(t,e){let r=[];for(let[n,s]of t.split(wr).entries())if(n%2===0)r.push(B(s));else try{r.push(E(["{{",k([_,await T(s,e,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_,"}}"]))}catch{r.push("{{",B(s),"}}")}return r}function br({parser:t}){return(e,r,n)=>T(N(n.node),e,{parser:t},Q)}var Ki=br({parser:"__ng_action"}),Qi=br({parser:"__ng_binding"}),Xi=br({parser:"__ng_directive"});function Ji(t,e){if(e.parser!=="angular")return;let{node:r}=t,n=r.fullName;if(n.startsWith("(")&&n.endsWith(")")||n.startsWith("on-"))return Ki;if(n.startsWith("[")&&n.endsWith("]")||/^bind(?:on)?-/u.test(n)||/^ng-(?:if|show|hide|class|style)$/u.test(n))return Qi;if(n.startsWith("*"))return Xi;let s=N(r);if(/^i18n(?:-.+)?$/u.test(n))return()=>he(vt(kt(r,s.trim())),!s.includes("@@"));if(wr.test(s))return i=>Wn(s,i)}var zn=Ji;function Zi(t,e){let{node:r}=t,n=N(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/u).join(" ")}var Gn=Zi;function Yn(t){return t===" "||t===`
|
|
9
|
-
`||t==="\f"||t==="\r"||t===" "}var ea=/^[ \t\n\r\u000c]+/,ta=/^[, \t\n\r\u000c]+/,ra=/^[^ \t\n\r\u000c]+/,na=/[,]+$/,jn=/^\d+$/,sa=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ia(t){let e=t.length,r,n,s,i,a,o=0,u;function p(C){let A,D=C.exec(t.substring(o));if(D)return[A]=D,o+=A.length,A}let l=[];for(;;){if(p(ta),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(ra),n=[],r.slice(-1)===","?(r=r.replace(na,""),d()):f()}function f(){for(p(ea),s="",i="in descriptor";;){if(a=t.charAt(o),i==="in descriptor")if(Yn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!Yn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,A,D,I,F,c={},g,y,q,x,U;for(F=0;F<n.length;F++)g=n[F],y=g[g.length-1],q=g.substring(0,g.length-1),x=parseInt(q,10),U=parseFloat(q),jn.test(q)&&y==="w"?((A||D)&&(C=!0),x===0?C=!0:A=x):sa.test(q)&&y==="x"?((A||D||I)&&(C=!0),U<0?C=!0:D=U):jn.test(q)&&y==="h"?((I||D)&&(C=!0),x===0?C=!0:I=x):C=!0;if(!C)c.source={value:r,startOffset:u},A&&(c.width={value:A}),D&&(c.density={value:D}),I&&(c.height={value:I}),l.push(c);else throw new Error(`Invalid srcset descriptor found in "${t}" at "${g}".`)}}var Kn=ia;function aa(t){if(t.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"))return()=>ua(N(t.node))}var Qn={width:"w",height:"h",density:"x"},oa=Object.keys(Qn);function ua(t){let e=Kn(t),r=oa.filter(l=>e.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Qn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...u);return he(H([",",_],i.map((l,f)=>{let d=[l],C=o[f];if(C){let A=a-l.length+1,D=p-u[f],I=" ".repeat(A+D);d.push(pe(I," "),C+s)}return d})))}var Xn=aa;function Jn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>he(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var Tr=new WeakMap;function la(t,e){let{root:r}=t;return Tr.has(r)||Tr.set(r,r.children.some(n=>Bt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),Tr.get(r)}var Pe=la;function Zn(t,e,r){let{node:n}=r,s=N(n);return T(`type T<${s}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Q)}function es(t,e,{parseWithTs:r}){return T(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function ts(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:o}=ca(s),u=Pe(r,n);return[E(await T(`function _(${i}) {}`,t,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await T(o,t,{parser:u?"__ts_expression":"__js_expression"})]}function ca(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=w(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function pa(t,e){if(e.parser!=="vue")return;let{node:r}=t,n=r.fullName;if(n==="v-for")return ts;if(n==="generic"&&Bt(r.parent,e))return Zn;let s=N(r),i=Pe(t,e);if(Vn(r)||Un(r,e))return a=>es(s,a,{parseWithTs:i});if(n.startsWith("@")||n.startsWith("v-on:"))return a=>ha(s,a,{parseWithTs:i});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return a=>fa(s,a,{parseWithTs:i});if(n.startsWith("v-"))return a=>rs(s,a,{parseWithTs:i})}async function ha(t,e,{parseWithTs:r}){var n;try{return await rs(t,e,{parseWithTs:r})}catch(s){if(((n=s.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw s}return T(t,e,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},Q)}function fa(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__vue_ts_expression":"__vue_expression"},Q)}function rs(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__ts_expression":"__js_expression"},Q)}var ns=pa;function ma(t,e){let{node:r}=t;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||e.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Xn,Jn,Gn,ns,zn]){let s=n(t,e);if(s)return da(s)}}}function da(t){return async(e,r,n,s)=>{let i=await t(e,r,n,s);if(i)return i=fr(i,a=>typeof a=="string"?w(!1,a,'"',"""):a),[n.node.rawName,'="',E(i),'"']}}var ss=ma;var is=new Proxy(()=>{},{get:()=>is}),xr=is;function ga(t){return Array.isArray(t)&&t.length>0}var Ie=ga;function J(t){return t.sourceSpan.start.offset}function Z(t){return t.sourceSpan.end.offset}function tt(t,e){return[t.isSelfClosing?"":Ca(t,e),Ce(t,e)]}function Ca(t,e){return t.lastChild&&Ee(t.lastChild)?"":[Sa(t,e),Lt(t,e)]}function Ce(t,e){return(t.next?X(t.next):_e(t.parent))?"":[Se(t,e),z(t,e)]}function Sa(t,e){return _e(t)?Se(t.lastChild,e):""}function z(t,e){return Ee(t)?Lt(t.parent,e):rt(t)?Ft(t.next,e):""}function Lt(t,e){if(xr(!t.isSelfClosing),os(t,e))return"";switch(t.type){case"ieConditionalComment":return"<!";case"element":if(t.hasHtmComponentClosingTag)return"<//";default:return`</${t.rawName}`}}function Se(t,e){if(os(t,e))return"";switch(t.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function os(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(de(t)||wt(t.parent,e))}function X(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!$(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _e(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!$(Tt(t.lastChild))&&!me(t)}function Ee(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&$(Tt(t))}function rt(t){return t.next&&!$(t.next)&&$(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function _a(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function nt(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function Ea(t,e,r){var f;let{node:n}=t;if(!Ie(n.attrs))return n.isSelfClosing?" ":"";let s=((f=n.prev)==null?void 0:f.type)==="comment"&&_a(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t.map(({node:d})=>i(d)?B(e.originalText.slice(J(d),Z(d))):r(),"attrs"),o=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!ge(n,e)?S:_,l=[k([o?" ":_,H(p,a)])];return n.firstChild&&nt(n.firstChild)||n.isSelfClosing&&_e(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:v),l}function Aa(t){return t.firstChild&&nt(t.firstChild)?"":Nt(t)}function st(t,e,r){let{node:n}=t;return[Ae(n,e),Ea(t,e,r),n.isSelfClosing?"":Aa(n)]}function Ae(t,e){return t.prev&&rt(t.prev)?"":[G(t,e),Ft(t,e)]}function G(t,e){return nt(t)?Nt(t.parent):X(t)?Se(t.prev,e):""}var as="<!doctype";function Ft(t,e){switch(t.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":{if(t.value==="html"){let n=e.filepath??"";if(/\.html?$/u.test(n))return as}return e.originalText.slice(J(t),Z(t)).slice(0,as.length)}case"angularIcuExpression":return"{";case"element":if(t.condition)return`<!--[if ${t.condition}]><!--><${t.rawName}`;default:return`<${t.rawName}`}}function Nt(t){switch(xr(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return"><!--<![endif]-->";default:return">"}}function Da(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&nt(t.firstChild)&&(r-=Nt(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&Ee(t.lastChild)?n+=Lt(t,e).length:_e(t)&&(n-=Se(t.lastChild,e).length),e.originalText.slice(r,n)}var Pt=Da;var va=new Set(["if","else if","for","switch","case"]);function ya(t,e){let{node:r}=t;switch(r.type){case"element":if(W(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&xt(r,e)){let n=Dr(r,e);return n?async(s,i)=>{let a=Pt(r,e),o=/^\s*$/u.test(a),u="";return o||(u=await s(_r(a),{parser:n,__embeddedInHtml:!0}),o=u===""),[G(r,e),E(st(t,e,i)),o?"":S,u,o?"":S,tt(r,e),z(r,e)]}:void 0}break;case"text":if(W(r.parent)){let n=Dr(r.parent,e);if(n)return async s=>{let i=n==="markdown"?vr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,a={parser:n,__embeddedInHtml:!0};if(e.parser==="html"&&n==="babel"){let o="script",{attrMap:u}=r.parent;u&&(u.type==="module"||u.type==="text/babel"&&u["data-type"]==="module")&&(o="module"),a.__babelSourceType=o}return[se,G(r,e),await s(i,a),z(r,e)]}}else if(r.parent.type==="interpolation")return async n=>{let s={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?s.parser="__ng_interpolation":e.parser==="vue"?s.parser=Pe(t,e)?"__vue_ts_expression":"__vue_expression":s.parser="__js_expression",[k([_,await n(r.value,s)]),r.parent.next&&X(r.parent.next)?" ":_]};break;case"attribute":return ss(t,e);case"front-matter":return n=>An(r,n);case"angularControlFlowBlockParameters":return va.has(t.parent.name)?Dn:void 0;case"angularLetDeclarationInitializer":return n=>T(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var us=ya;var it=null;function at(t){if(it!==null&&typeof it.property){let e=it;return it=at.prototype=null,e}return it=at.prototype=t??Object.create(null),new at}var wa=10;for(let t=0;t<=wa;t++)at();function kr(t){return at(t)}function ba(t,e="type"){kr(t);function r(n){let s=n[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var ls=ba;var Ta={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},cs=Ta;var xa=ls(cs),ps=xa;function hs(t){return/^\s*<!--\s*@(?:format|prettier)\s*-->/u.test(t)}function fs(t){return`<!-- @format -->
|
|
9
|
+
`||t==="\f"||t==="\r"||t===" "}var ea=/^[ \t\n\r\u000c]+/,ta=/^[, \t\n\r\u000c]+/,ra=/^[^ \t\n\r\u000c]+/,na=/[,]+$/,jn=/^\d+$/,sa=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ia(t){let e=t.length,r,n,s,i,a,o=0,u;function p(C){let A,D=C.exec(t.substring(o));if(D)return[A]=D,o+=A.length,A}let l=[];for(;;){if(p(ta),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(ra),n=[],r.slice(-1)===","?(r=r.replace(na,""),d()):f()}function f(){for(p(ea),s="",i="in descriptor";;){if(a=t.charAt(o),i==="in descriptor")if(Yn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!Yn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,A,D,I,F,c={},g,y,q,x,U;for(F=0;F<n.length;F++)g=n[F],y=g[g.length-1],q=g.substring(0,g.length-1),x=parseInt(q,10),U=parseFloat(q),jn.test(q)&&y==="w"?((A||D)&&(C=!0),x===0?C=!0:A=x):sa.test(q)&&y==="x"?((A||D||I)&&(C=!0),U<0?C=!0:D=U):jn.test(q)&&y==="h"?((I||D)&&(C=!0),x===0?C=!0:I=x):C=!0;if(!C)c.source={value:r,startOffset:u},A&&(c.width={value:A}),D&&(c.density={value:D}),I&&(c.height={value:I}),l.push(c);else throw new Error(`Invalid srcset descriptor found in "${t}" at "${g}".`)}}var Kn=ia;function aa(t){if(t.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"))return()=>ua(N(t.node))}var Qn={width:"w",height:"h",density:"x"},oa=Object.keys(Qn);function ua(t){let e=Kn(t),r=oa.filter(l=>e.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Qn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...u);return he(H([",",_],i.map((l,f)=>{let d=[l],C=o[f];if(C){let A=a-l.length+1,D=p-u[f],I=" ".repeat(A+D);d.push(pe(I," "),C+s)}return d})))}var Xn=aa;function Jn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>he(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var Tr=new WeakMap;function la(t,e){let{root:r}=t;return Tr.has(r)||Tr.set(r,r.children.some(n=>Bt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),Tr.get(r)}var Pe=la;function Zn(t,e,r){let{node:n}=r,s=N(n);return T(`type T<${s}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Q)}function es(t,e,{parseWithTs:r}){return T(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function ts(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:o}=ca(s),u=Pe(r,n);return[E(await T(`function _(${i}) {}`,t,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await T(o,t,{parser:u?"__ts_expression":"__js_expression"})]}function ca(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=w(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function pa(t,e){if(e.parser!=="vue")return;let{node:r}=t,n=r.fullName;if(n==="v-for")return ts;if(n==="generic"&&Bt(r.parent,e))return Zn;let s=N(r),i=Pe(t,e);if(Vn(r)||Un(r,e))return a=>es(s,a,{parseWithTs:i});if(n.startsWith("@")||n.startsWith("v-on:"))return a=>ha(s,a,{parseWithTs:i});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return a=>fa(s,a,{parseWithTs:i});if(n.startsWith("v-"))return a=>rs(s,a,{parseWithTs:i})}async function ha(t,e,{parseWithTs:r}){var n;try{return await rs(t,e,{parseWithTs:r})}catch(s){if(((n=s.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw s}return T(t,e,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},Q)}function fa(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__vue_ts_expression":"__vue_expression"},Q)}function rs(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__ts_expression":"__js_expression"},Q)}var ns=pa;function ma(t,e){let{node:r}=t;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||e.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Xn,Jn,Gn,ns,zn]){let s=n(t,e);if(s)return da(s)}}}function da(t){return async(e,r,n,s)=>{let i=await t(e,r,n,s);if(i)return i=fr(i,a=>typeof a=="string"?w(!1,a,'"',"""):a),[n.node.rawName,'="',E(i),'"']}}var ss=ma;var is=new Proxy(()=>{},{get:()=>is}),xr=is;function ga(t){return Array.isArray(t)&&t.length>0}var Ie=ga;function J(t){return t.sourceSpan.start.offset}function Z(t){return t.sourceSpan.end.offset}function tt(t,e){return[t.isSelfClosing?"":Ca(t,e),Ce(t,e)]}function Ca(t,e){return t.lastChild&&Ee(t.lastChild)?"":[Sa(t,e),Lt(t,e)]}function Ce(t,e){return(t.next?X(t.next):_e(t.parent))?"":[Se(t,e),z(t,e)]}function Sa(t,e){return _e(t)?Se(t.lastChild,e):""}function z(t,e){return Ee(t)?Lt(t.parent,e):rt(t)?Ft(t.next,e):""}function Lt(t,e){if(xr.ok(!t.isSelfClosing),os(t,e))return"";switch(t.type){case"ieConditionalComment":return"<!";case"element":if(t.hasHtmComponentClosingTag)return"<//";default:return`</${t.rawName}`}}function Se(t,e){if(os(t,e))return"";switch(t.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function os(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(de(t)||wt(t.parent,e))}function X(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!$(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _e(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!$(Tt(t.lastChild))&&!me(t)}function Ee(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&$(Tt(t))}function rt(t){return t.next&&!$(t.next)&&$(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function _a(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function nt(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function Ea(t,e,r){var f;let{node:n}=t;if(!Ie(n.attrs))return n.isSelfClosing?" ":"";let s=((f=n.prev)==null?void 0:f.type)==="comment"&&_a(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t.map(({node:d})=>i(d)?B(e.originalText.slice(J(d),Z(d))):r(),"attrs"),o=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!ge(n,e)?S:_,l=[k([o?" ":_,H(p,a)])];return n.firstChild&&nt(n.firstChild)||n.isSelfClosing&&_e(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:v),l}function Aa(t){return t.firstChild&&nt(t.firstChild)?"":Nt(t)}function st(t,e,r){let{node:n}=t;return[Ae(n,e),Ea(t,e,r),n.isSelfClosing?"":Aa(n)]}function Ae(t,e){return t.prev&&rt(t.prev)?"":[G(t,e),Ft(t,e)]}function G(t,e){return nt(t)?Nt(t.parent):X(t)?Se(t.prev,e):""}var as="<!doctype";function Ft(t,e){switch(t.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":{if(t.value==="html"){let n=e.filepath??"";if(/\.html?$/u.test(n))return as}return e.originalText.slice(J(t),Z(t)).slice(0,as.length)}case"angularIcuExpression":return"{";case"element":if(t.condition)return`<!--[if ${t.condition}]><!--><${t.rawName}`;default:return`<${t.rawName}`}}function Nt(t){switch(xr.ok(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return"><!--<![endif]-->";default:return">"}}function Da(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&nt(t.firstChild)&&(r-=Nt(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&Ee(t.lastChild)?n+=Lt(t,e).length:_e(t)&&(n-=Se(t.lastChild,e).length),e.originalText.slice(r,n)}var Pt=Da;var va=new Set(["if","else if","for","switch","case"]);function ya(t,e){let{node:r}=t;switch(r.type){case"element":if(W(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&xt(r,e)){let n=Dr(r,e);return n?async(s,i)=>{let a=Pt(r,e),o=/^\s*$/u.test(a),u="";return o||(u=await s(_r(a),{parser:n,__embeddedInHtml:!0}),o=u===""),[G(r,e),E(st(t,e,i)),o?"":S,u,o?"":S,tt(r,e),z(r,e)]}:void 0}break;case"text":if(W(r.parent)){let n=Dr(r.parent,e);if(n)return async s=>{let i=n==="markdown"?vr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,a={parser:n,__embeddedInHtml:!0};if(e.parser==="html"&&n==="babel"){let o="script",{attrMap:u}=r.parent;u&&(u.type==="module"||u.type==="text/babel"&&u["data-type"]==="module")&&(o="module"),a.__babelSourceType=o}return[se,G(r,e),await s(i,a),z(r,e)]}}else if(r.parent.type==="interpolation")return async n=>{let s={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?s.parser="__ng_interpolation":e.parser==="vue"?s.parser=Pe(t,e)?"__vue_ts_expression":"__vue_expression":s.parser="__js_expression",[k([_,await n(r.value,s)]),r.parent.next&&X(r.parent.next)?" ":_]};break;case"attribute":return ss(t,e);case"front-matter":return n=>An(r,n);case"angularControlFlowBlockParameters":return va.has(t.parent.name)?Dn:void 0;case"angularLetDeclarationInitializer":return n=>T(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var us=ya;var it=null;function at(t){if(it!==null&&typeof it.property){let e=it;return it=at.prototype=null,e}return it=at.prototype=t??Object.create(null),new at}var wa=10;for(let t=0;t<=wa;t++)at();function kr(t){return at(t)}function ba(t,e="type"){kr(t);function r(n){let s=n[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var ls=ba;var Ta={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},cs=Ta;var xa=ls(cs),ps=xa;function hs(t){return/^\s*<!--\s*@(?:format|prettier)\s*-->/u.test(t)}function fs(t){return`<!-- @format -->
|
|
10
10
|
|
|
11
11
|
`+t}var ms=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function ds(t){let e=Z(t);return t.type==="element"&&!t.endSourceSpan&&Ie(t.children)?Math.max(e,ds(K(!1,t.children,-1))):e}function ot(t,e,r){let n=t.node;if(de(n)){let s=ds(n);return[G(n,e),B(O.trimEnd(e.originalText.slice(J(n)+(n.prev&&rt(n.prev)?Ft(n).length:0),s-(n.next&&X(n.next)?Se(n,e).length:0)))),z(n,e)]}return r()}function It(t,e){return $(t)&&$(e)?t.isTrailingSpaceSensitive?t.hasTrailingSpaces?bt(e)?S:_:"":bt(e)?S:v:rt(t)&&(de(e)||e.firstChild||e.isSelfClosing||e.type==="element"&&e.attrs.length>0)||t.type==="element"&&t.isSelfClosing&&X(e)?"":!e.isLeadingSpaceSensitive||bt(e)||X(e)&&t.lastChild&&Ee(t.lastChild)&&t.lastChild.lastChild&&Ee(t.lastChild.lastChild)?S:e.hasLeadingSpaces?_:v}function Re(t,e,r){let{node:n}=t;if(Ar(n))return[se,...t.map(i=>{let a=i.node,o=a.prev?It(a.prev,a):"";return[o?[o,Je(a.prev)?S:""]:"",ot(i,e,r)]},"children")];let s=n.children.map(()=>Symbol(""));return t.map((i,a)=>{let o=i.node;if($(o)){if(o.prev&&$(o.prev)){let A=It(o.prev,o);if(A)return Je(o.prev)?[S,S,ot(i,e,r)]:[A,ot(i,e,r)]}return ot(i,e,r)}let u=[],p=[],l=[],f=[],d=o.prev?It(o.prev,o):"",C=o.next?It(o,o.next):"";return d&&(Je(o.prev)?u.push(S,S):d===S?u.push(S):$(o.prev)?p.push(d):p.push(pe("",v,{groupId:s[a-1]}))),C&&(Je(o)?$(o.next)&&f.push(S,S):C===S?$(o.next)&&f.push(S):l.push(C)),[...u,E([...p,E([ot(i,e,r),...l],{id:s[a]})]),...f]},"children")}function gs(t,e,r){let{node:n}=t,s=[];ka(t)&&s.push("} "),s.push("@",n.name),n.parameters&&s.push(" (",E(r("parameters")),")"),s.push(" {");let i=Cs(n);return n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,s.push(k([S,Re(t,e,r)])),i&&s.push(S,"}")):i&&s.push("}"),E(s,{shouldBreak:!0})}function Cs(t){var e,r;return!(((e=t.next)==null?void 0:e.type)==="angularControlFlowBlock"&&((r=ms.get(t.name))!=null&&r.has(t.next.name)))}function ka(t){let{previous:e}=t;return(e==null?void 0:e.type)==="angularControlFlowBlock"&&!de(e)&&!Cs(e)}function Ss(t,e,r){return[k([v,H([";",_],t.map(r,"children"))]),v]}function _s(t,e,r){let{node:n}=t;return[Ae(n,e),E([n.switchValue.trim(),", ",n.clause,n.cases.length>0?[",",k([_,H(_,t.map(r,"cases"))])]:"",v]),Ce(n,e)]}function Es(t,e,r){let{node:n}=t;return[n.value," {",E([k([v,t.map(({node:s,isLast:i})=>{let a=[r()];return s.type==="text"&&(s.hasLeadingSpaces&&a.unshift(_),s.hasTrailingSpaces&&!i&&a.push(_)),a},"expression")]),v]),"}"]}function As(t,e,r){let{node:n}=t;if(wt(n,e))return[G(n,e),E(st(t,e,r)),B(Pt(n,e)),...tt(n,e),z(n,e)];let s=n.children.length===1&&(n.firstChild.type==="interpolation"||n.firstChild.type==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,i=Symbol("element-attr-group-id"),a=l=>E([E(st(t,e,r),{id:i}),l,tt(n,e)]),o=l=>s?mn(l,{groupId:i}):(W(n)||et(n,e))&&n.parent.type==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?l:k(l),u=()=>s?pe(v,"",{groupId:i}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?_:n.firstChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?hn(v):v,p=()=>(n.next?X(n.next):_e(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":s?pe(v,"",{groupId:i}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?_:(n.lastChild.type==="comment"||n.lastChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(t.ancestors.length-1)}}$`,"u").test(n.lastChild.value)?"":v;return n.children.length===0?a(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?_:""):a([Pn(n)?se:"",o([u(),Re(t,e,r)]),p()])}function ut(t){return t>=9&&t<=32||t==160}function Rt(t){return 48<=t&&t<=57}function lt(t){return t>=97&&t<=122||t>=65&&t<=90}function Ds(t){return t>=97&&t<=102||t>=65&&t<=70||Rt(t)}function $t(t){return t===10||t===13}function Br(t){return 48<=t&&t<=55}function Ot(t){return t===39||t===34||t===96}var Ba=/-+([a-z0-9])/g;function ys(t){return t.replace(Ba,(...e)=>e[1].toUpperCase())}var ie=class t{constructor(e,r,n,s){this.file=e,this.offset=r,this.line=n,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let r=this.file.content,n=r.length,s=this.offset,i=this.line,a=this.col;for(;s>0&&e<0;)if(s--,e++,r.charCodeAt(s)==10){i--;let u=r.substring(0,s-1).lastIndexOf(String.fromCharCode(10));a=u>0?s-u:s}else a--;for(;s<n&&e>0;){let o=r.charCodeAt(s);s++,e--,o==10?(i++,a=0):a++}return new t(this.file,s,i,a)}getContext(e,r){let n=this.file.content,s=this.offset;if(s!=null){s>n.length-1&&(s=n.length-1);let i=s,a=0,o=0;for(;a<e&&s>0&&(s--,a++,!(n[s]==`
|
|
12
12
|
`&&++o==r)););for(a=0,o=0;a<e&&i<n.length-1&&(i++,a++,!(n[i]==`
|
package/plugins/html.mjs
CHANGED
|
@@ -6,7 +6,7 @@ Expected it to be ${n}.`}var cr=class extends Error{name="InvalidDocError";const
|
|
|
6
6
|
`)){if(r.length===0)continue;let n=O.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&n<e&&(e=n)}return e===Number.POSITIVE_INFINITY?0:e}function Dr(t,e=Ui(t)){return e===0?t:t.split(`
|
|
7
7
|
`).map(r=>r.slice(e)).join(`
|
|
8
8
|
`)}function vr(t){return w(!1,w(!1,t,"'","'"),""",'"')}function N(t){return vr(t.value)}var Wi=new Set(["template","style","script"]);function et(t,e){return ge(t,e)&&!Wi.has(t.fullName)}function ge(t,e){return e.parser==="vue"&&t.type==="element"&&t.parent.type==="root"&&t.fullName.toLowerCase()!=="html"}function Tt(t,e){return ge(t,e)&&(et(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function Un(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function Wn(t,e){let r=t.parent;if(!ge(r,e))return!1;let n=r.fullName,s=t.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function xt(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?B(e):B(Dr(Sr(e)),S):H(_,O.split(e))}function kt(t,e){return ge(t,e)&&t.name==="script"}var yr=/\{\{(.+?)\}\}/su;async function zn(t,e){let r=[];for(let[n,s]of t.split(yr).entries())if(n%2===0)r.push(B(s));else try{r.push(E(["{{",k([_,await T(s,e,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_,"}}"]))}catch{r.push("{{",B(s),"}}")}return r}function wr({parser:t}){return(e,r,n)=>T(N(n.node),e,{parser:t},Q)}var zi=wr({parser:"__ng_action"}),Gi=wr({parser:"__ng_binding"}),Yi=wr({parser:"__ng_directive"});function ji(t,e){if(e.parser!=="angular")return;let{node:r}=t,n=r.fullName;if(n.startsWith("(")&&n.endsWith(")")||n.startsWith("on-"))return zi;if(n.startsWith("[")&&n.endsWith("]")||/^bind(?:on)?-/u.test(n)||/^ng-(?:if|show|hide|class|style)$/u.test(n))return Gi;if(n.startsWith("*"))return Yi;let s=N(r);if(/^i18n(?:-.+)?$/u.test(n))return()=>he(Dt(xt(r,s.trim())),!s.includes("@@"));if(yr.test(s))return i=>zn(s,i)}var Gn=ji;function Ki(t,e){let{node:r}=t,n=N(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/u).join(" ")}var Yn=Ki;function jn(t){return t===" "||t===`
|
|
9
|
-
`||t==="\f"||t==="\r"||t===" "}var Qi=/^[ \t\n\r\u000c]+/,Xi=/^[, \t\n\r\u000c]+/,Ji=/^[^ \t\n\r\u000c]+/,Zi=/[,]+$/,Kn=/^\d+$/,ea=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ta(t){let e=t.length,r,n,s,i,a,o=0,u;function p(C){let A,D=C.exec(t.substring(o));if(D)return[A]=D,o+=A.length,A}let l=[];for(;;){if(p(Xi),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(Ji),n=[],r.slice(-1)===","?(r=r.replace(Zi,""),d()):f()}function f(){for(p(Qi),s="",i="in descriptor";;){if(a=t.charAt(o),i==="in descriptor")if(jn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!jn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,A,D,I,F,c={},g,y,q,x,U;for(F=0;F<n.length;F++)g=n[F],y=g[g.length-1],q=g.substring(0,g.length-1),x=parseInt(q,10),U=parseFloat(q),Kn.test(q)&&y==="w"?((A||D)&&(C=!0),x===0?C=!0:A=x):ea.test(q)&&y==="x"?((A||D||I)&&(C=!0),U<0?C=!0:D=U):Kn.test(q)&&y==="h"?((I||D)&&(C=!0),x===0?C=!0:I=x):C=!0;if(!C)c.source={value:r,startOffset:u},A&&(c.width={value:A}),D&&(c.density={value:D}),I&&(c.height={value:I}),l.push(c);else throw new Error(`Invalid srcset descriptor found in "${t}" at "${g}".`)}}var Qn=ta;function ra(t){if(t.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"))return()=>sa(N(t.node))}var Xn={width:"w",height:"h",density:"x"},na=Object.keys(Xn);function sa(t){let e=Qn(t),r=na.filter(l=>e.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Xn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...u);return he(H([",",_],i.map((l,f)=>{let d=[l],C=o[f];if(C){let A=a-l.length+1,D=p-u[f],I=" ".repeat(A+D);d.push(pe(I," "),C+s)}return d})))}var Jn=ra;function Zn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>he(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var br=new WeakMap;function ia(t,e){let{root:r}=t;return br.has(r)||br.set(r,r.children.some(n=>kt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),br.get(r)}var Pe=ia;function es(t,e,r){let{node:n}=r,s=N(n);return T(`type T<${s}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Q)}function ts(t,e,{parseWithTs:r}){return T(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function rs(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:o}=aa(s),u=Pe(r,n);return[E(await T(`function _(${i}) {}`,t,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await T(o,t,{parser:u?"__ts_expression":"__js_expression"})]}function aa(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=w(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function oa(t,e){if(e.parser!=="vue")return;let{node:r}=t,n=r.fullName;if(n==="v-for")return rs;if(n==="generic"&&kt(r.parent,e))return es;let s=N(r),i=Pe(t,e);if(Un(r)||Wn(r,e))return a=>ts(s,a,{parseWithTs:i});if(n.startsWith("@")||n.startsWith("v-on:"))return a=>ua(s,a,{parseWithTs:i});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return a=>la(s,a,{parseWithTs:i});if(n.startsWith("v-"))return a=>ns(s,a,{parseWithTs:i})}async function ua(t,e,{parseWithTs:r}){var n;try{return await ns(t,e,{parseWithTs:r})}catch(s){if(((n=s.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw s}return T(t,e,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},Q)}function la(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__vue_ts_expression":"__vue_expression"},Q)}function ns(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__ts_expression":"__js_expression"},Q)}var ss=oa;function ca(t,e){let{node:r}=t;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||e.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Jn,Zn,Yn,ss,Gn]){let s=n(t,e);if(s)return pa(s)}}}function pa(t){return async(e,r,n,s)=>{let i=await t(e,r,n,s);if(i)return i=hr(i,a=>typeof a=="string"?w(!1,a,'"',"""):a),[n.node.rawName,'="',E(i),'"']}}var is=ca;var as=new Proxy(()=>{},{get:()=>as}),Tr=as;function ha(t){return Array.isArray(t)&&t.length>0}var Ie=ha;function J(t){return t.sourceSpan.start.offset}function Z(t){return t.sourceSpan.end.offset}function tt(t,e){return[t.isSelfClosing?"":fa(t,e),Ce(t,e)]}function fa(t,e){return t.lastChild&&Ee(t.lastChild)?"":[ma(t,e),Bt(t,e)]}function Ce(t,e){return(t.next?X(t.next):_e(t.parent))?"":[Se(t,e),z(t,e)]}function ma(t,e){return _e(t)?Se(t.lastChild,e):""}function z(t,e){return Ee(t)?Bt(t.parent,e):rt(t)?Lt(t.next,e):""}function Bt(t,e){if(Tr(!t.isSelfClosing),us(t,e))return"";switch(t.type){case"ieConditionalComment":return"<!";case"element":if(t.hasHtmComponentClosingTag)return"<//";default:return`</${t.rawName}`}}function Se(t,e){if(us(t,e))return"";switch(t.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function us(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(de(t)||yt(t.parent,e))}function X(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!$(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _e(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!$(bt(t.lastChild))&&!me(t)}function Ee(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&$(bt(t))}function rt(t){return t.next&&!$(t.next)&&$(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function da(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function nt(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function ga(t,e,r){var f;let{node:n}=t;if(!Ie(n.attrs))return n.isSelfClosing?" ":"";let s=((f=n.prev)==null?void 0:f.type)==="comment"&&da(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t.map(({node:d})=>i(d)?B(e.originalText.slice(J(d),Z(d))):r(),"attrs"),o=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!ge(n,e)?S:_,l=[k([o?" ":_,H(p,a)])];return n.firstChild&&nt(n.firstChild)||n.isSelfClosing&&_e(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:v),l}function Ca(t){return t.firstChild&&nt(t.firstChild)?"":Ft(t)}function st(t,e,r){let{node:n}=t;return[Ae(n,e),ga(t,e,r),n.isSelfClosing?"":Ca(n)]}function Ae(t,e){return t.prev&&rt(t.prev)?"":[G(t,e),Lt(t,e)]}function G(t,e){return nt(t)?Ft(t.parent):X(t)?Se(t.prev,e):""}var os="<!doctype";function Lt(t,e){switch(t.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":{if(t.value==="html"){let n=e.filepath??"";if(/\.html?$/u.test(n))return os}return e.originalText.slice(J(t),Z(t)).slice(0,os.length)}case"angularIcuExpression":return"{";case"element":if(t.condition)return`<!--[if ${t.condition}]><!--><${t.rawName}`;default:return`<${t.rawName}`}}function Ft(t){switch(Tr(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return"><!--<![endif]-->";default:return">"}}function Sa(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&nt(t.firstChild)&&(r-=Ft(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&Ee(t.lastChild)?n+=Bt(t,e).length:_e(t)&&(n-=Se(t.lastChild,e).length),e.originalText.slice(r,n)}var Nt=Sa;var _a=new Set(["if","else if","for","switch","case"]);function Ea(t,e){let{node:r}=t;switch(r.type){case"element":if(W(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&Tt(r,e)){let n=Ar(r,e);return n?async(s,i)=>{let a=Nt(r,e),o=/^\s*$/u.test(a),u="";return o||(u=await s(Sr(a),{parser:n,__embeddedInHtml:!0}),o=u===""),[G(r,e),E(st(t,e,i)),o?"":S,u,o?"":S,tt(r,e),z(r,e)]}:void 0}break;case"text":if(W(r.parent)){let n=Ar(r.parent,e);if(n)return async s=>{let i=n==="markdown"?Dr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,a={parser:n,__embeddedInHtml:!0};if(e.parser==="html"&&n==="babel"){let o="script",{attrMap:u}=r.parent;u&&(u.type==="module"||u.type==="text/babel"&&u["data-type"]==="module")&&(o="module"),a.__babelSourceType=o}return[se,G(r,e),await s(i,a),z(r,e)]}}else if(r.parent.type==="interpolation")return async n=>{let s={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?s.parser="__ng_interpolation":e.parser==="vue"?s.parser=Pe(t,e)?"__vue_ts_expression":"__vue_expression":s.parser="__js_expression",[k([_,await n(r.value,s)]),r.parent.next&&X(r.parent.next)?" ":_]};break;case"attribute":return is(t,e);case"front-matter":return n=>Dn(r,n);case"angularControlFlowBlockParameters":return _a.has(t.parent.name)?vn:void 0;case"angularLetDeclarationInitializer":return n=>T(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var ls=Ea;var it=null;function at(t){if(it!==null&&typeof it.property){let e=it;return it=at.prototype=null,e}return it=at.prototype=t??Object.create(null),new at}var Aa=10;for(let t=0;t<=Aa;t++)at();function xr(t){return at(t)}function Da(t,e="type"){xr(t);function r(n){let s=n[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var cs=Da;var va={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},ps=va;var ya=cs(ps),hs=ya;function fs(t){return/^\s*<!--\s*@(?:format|prettier)\s*-->/u.test(t)}function ms(t){return`<!-- @format -->
|
|
9
|
+
`||t==="\f"||t==="\r"||t===" "}var Qi=/^[ \t\n\r\u000c]+/,Xi=/^[, \t\n\r\u000c]+/,Ji=/^[^ \t\n\r\u000c]+/,Zi=/[,]+$/,Kn=/^\d+$/,ea=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ta(t){let e=t.length,r,n,s,i,a,o=0,u;function p(C){let A,D=C.exec(t.substring(o));if(D)return[A]=D,o+=A.length,A}let l=[];for(;;){if(p(Xi),o>=e){if(l.length===0)throw new Error("Must contain one or more image candidate strings.");return l}u=o,r=p(Ji),n=[],r.slice(-1)===","?(r=r.replace(Zi,""),d()):f()}function f(){for(p(Qi),s="",i="in descriptor";;){if(a=t.charAt(o),i==="in descriptor")if(jn(a))s&&(n.push(s),s="",i="after descriptor");else if(a===","){o+=1,s&&n.push(s),d();return}else if(a==="(")s+=a,i="in parens";else if(a===""){s&&n.push(s),d();return}else s+=a;else if(i==="in parens")if(a===")")s+=a,i="in descriptor";else if(a===""){n.push(s),d();return}else s+=a;else if(i==="after descriptor"&&!jn(a))if(a===""){d();return}else i="in descriptor",o-=1;o+=1}}function d(){let C=!1,A,D,I,F,c={},g,y,q,x,U;for(F=0;F<n.length;F++)g=n[F],y=g[g.length-1],q=g.substring(0,g.length-1),x=parseInt(q,10),U=parseFloat(q),Kn.test(q)&&y==="w"?((A||D)&&(C=!0),x===0?C=!0:A=x):ea.test(q)&&y==="x"?((A||D||I)&&(C=!0),U<0?C=!0:D=U):Kn.test(q)&&y==="h"?((I||D)&&(C=!0),x===0?C=!0:I=x):C=!0;if(!C)c.source={value:r,startOffset:u},A&&(c.width={value:A}),D&&(c.density={value:D}),I&&(c.height={value:I}),l.push(c);else throw new Error(`Invalid srcset descriptor found in "${t}" at "${g}".`)}}var Qn=ta;function ra(t){if(t.node.fullName==="srcset"&&(t.parent.fullName==="img"||t.parent.fullName==="source"))return()=>sa(N(t.node))}var Xn={width:"w",height:"h",density:"x"},na=Object.keys(Xn);function sa(t){let e=Qn(t),r=na.filter(l=>e.some(f=>Object.prototype.hasOwnProperty.call(f,l)));if(r.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[n]=r,s=Xn[n],i=e.map(l=>l.source.value),a=Math.max(...i.map(l=>l.length)),o=e.map(l=>l[n]?String(l[n].value):""),u=o.map(l=>{let f=l.indexOf(".");return f===-1?l.length:f}),p=Math.max(...u);return he(H([",",_],i.map((l,f)=>{let d=[l],C=o[f];if(C){let A=a-l.length+1,D=p-u[f],I=" ".repeat(A+D);d.push(pe(I," "),C+s)}return d})))}var Jn=ra;function Zn(t,e){let{node:r}=t,n=N(t.node).trim();if(r.fullName==="style"&&!e.parentParser&&!n.includes("{{"))return async s=>he(await s(n,{parser:"css",__isHTMLStyleAttribute:!0}))}var br=new WeakMap;function ia(t,e){let{root:r}=t;return br.has(r)||br.set(r,r.children.some(n=>kt(n,e)&&["ts","typescript"].includes(n.attrMap.lang))),br.get(r)}var Pe=ia;function es(t,e,r){let{node:n}=r,s=N(n);return T(`type T<${s}> = any`,t,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},Q)}function ts(t,e,{parseWithTs:r}){return T(`function _(${t}) {}`,e,{parser:r?"babel-ts":"babel",__isVueBindings:!0})}async function rs(t,e,r,n){let s=N(r.node),{left:i,operator:a,right:o}=aa(s),u=Pe(r,n);return[E(await T(`function _(${i}) {}`,t,{parser:u?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await T(o,t,{parser:u?"__ts_expression":"__js_expression"})]}function aa(t){let e=/(.*?)\s+(in|of)\s+(.*)/su,r=/,([^,\]}]*)(?:,([^,\]}]*))?$/u,n=/^\(|\)$/gu,s=t.match(e);if(!s)return;let i={};if(i.for=s[3].trim(),!i.for)return;let a=w(!1,s[1].trim(),n,""),o=a.match(r);o?(i.alias=a.replace(r,""),i.iterator1=o[1].trim(),o[2]&&(i.iterator2=o[2].trim())):i.alias=a;let u=[i.alias,i.iterator1,i.iterator2];if(!u.some((p,l)=>!p&&(l===0||u.slice(l+1).some(Boolean))))return{left:u.filter(Boolean).join(","),operator:s[2],right:i.for}}function oa(t,e){if(e.parser!=="vue")return;let{node:r}=t,n=r.fullName;if(n==="v-for")return rs;if(n==="generic"&&kt(r.parent,e))return es;let s=N(r),i=Pe(t,e);if(Un(r)||Wn(r,e))return a=>ts(s,a,{parseWithTs:i});if(n.startsWith("@")||n.startsWith("v-on:"))return a=>ua(s,a,{parseWithTs:i});if(n.startsWith(":")||n.startsWith(".")||n.startsWith("v-bind:"))return a=>la(s,a,{parseWithTs:i});if(n.startsWith("v-"))return a=>ns(s,a,{parseWithTs:i})}async function ua(t,e,{parseWithTs:r}){var n;try{return await ns(t,e,{parseWithTs:r})}catch(s){if(((n=s.cause)==null?void 0:n.code)!=="BABEL_PARSER_SYNTAX_ERROR")throw s}return T(t,e,{parser:r?"__vue_ts_event_binding":"__vue_event_binding"},Q)}function la(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__vue_ts_expression":"__vue_expression"},Q)}function ns(t,e,{parseWithTs:r}){return T(t,e,{parser:r?"__ts_expression":"__js_expression"},Q)}var ss=oa;function ca(t,e){let{node:r}=t;if(r.value){if(/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(e.originalText.slice(r.valueSpan.start.offset,r.valueSpan.end.offset))||e.parser==="lwc"&&r.value.startsWith("{")&&r.value.endsWith("}"))return[r.rawName,"=",r.value];for(let n of[Jn,Zn,Yn,ss,Gn]){let s=n(t,e);if(s)return pa(s)}}}function pa(t){return async(e,r,n,s)=>{let i=await t(e,r,n,s);if(i)return i=hr(i,a=>typeof a=="string"?w(!1,a,'"',"""):a),[n.node.rawName,'="',E(i),'"']}}var is=ca;var as=new Proxy(()=>{},{get:()=>as}),Tr=as;function ha(t){return Array.isArray(t)&&t.length>0}var Ie=ha;function J(t){return t.sourceSpan.start.offset}function Z(t){return t.sourceSpan.end.offset}function tt(t,e){return[t.isSelfClosing?"":fa(t,e),Ce(t,e)]}function fa(t,e){return t.lastChild&&Ee(t.lastChild)?"":[ma(t,e),Bt(t,e)]}function Ce(t,e){return(t.next?X(t.next):_e(t.parent))?"":[Se(t,e),z(t,e)]}function ma(t,e){return _e(t)?Se(t.lastChild,e):""}function z(t,e){return Ee(t)?Bt(t.parent,e):rt(t)?Lt(t.next,e):""}function Bt(t,e){if(Tr.ok(!t.isSelfClosing),us(t,e))return"";switch(t.type){case"ieConditionalComment":return"<!";case"element":if(t.hasHtmComponentClosingTag)return"<//";default:return`</${t.rawName}`}}function Se(t,e){if(us(t,e))return"";switch(t.type){case"ieConditionalComment":case"ieConditionalEndComment":return"[endif]-->";case"ieConditionalStartComment":return"]><!-->";case"interpolation":return"}}";case"angularIcuExpression":return"}";case"element":if(t.isSelfClosing)return"/>";default:return">"}}function us(t,e){return!t.isSelfClosing&&!t.endSourceSpan&&(de(t)||yt(t.parent,e))}function X(t){return t.prev&&t.prev.type!=="docType"&&t.type!=="angularControlFlowBlock"&&!$(t.prev)&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function _e(t){var e;return((e=t.lastChild)==null?void 0:e.isTrailingSpaceSensitive)&&!t.lastChild.hasTrailingSpaces&&!$(bt(t.lastChild))&&!me(t)}function Ee(t){return!t.next&&!t.hasTrailingSpaces&&t.isTrailingSpaceSensitive&&$(bt(t))}function rt(t){return t.next&&!$(t.next)&&$(t)&&t.isTrailingSpaceSensitive&&!t.hasTrailingSpaces}function da(t){let e=t.trim().match(/^prettier-ignore-attribute(?:\s+(.+))?$/su);return e?e[1]?e[1].split(/\s+/u):!0:!1}function nt(t){return!t.prev&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces}function ga(t,e,r){var f;let{node:n}=t;if(!Ie(n.attrs))return n.isSelfClosing?" ":"";let s=((f=n.prev)==null?void 0:f.type)==="comment"&&da(n.prev.value),i=typeof s=="boolean"?()=>s:Array.isArray(s)?d=>s.includes(d.rawName):()=>!1,a=t.map(({node:d})=>i(d)?B(e.originalText.slice(J(d),Z(d))):r(),"attrs"),o=n.type==="element"&&n.fullName==="script"&&n.attrs.length===1&&n.attrs[0].fullName==="src"&&n.children.length===0,p=e.singleAttributePerLine&&n.attrs.length>1&&!ge(n,e)?S:_,l=[k([o?" ":_,H(p,a)])];return n.firstChild&&nt(n.firstChild)||n.isSelfClosing&&_e(n.parent)||o?l.push(n.isSelfClosing?" ":""):l.push(e.bracketSameLine?n.isSelfClosing?" ":"":n.isSelfClosing?_:v),l}function Ca(t){return t.firstChild&&nt(t.firstChild)?"":Ft(t)}function st(t,e,r){let{node:n}=t;return[Ae(n,e),ga(t,e,r),n.isSelfClosing?"":Ca(n)]}function Ae(t,e){return t.prev&&rt(t.prev)?"":[G(t,e),Lt(t,e)]}function G(t,e){return nt(t)?Ft(t.parent):X(t)?Se(t.prev,e):""}var os="<!doctype";function Lt(t,e){switch(t.type){case"ieConditionalComment":case"ieConditionalStartComment":return`<!--[if ${t.condition}`;case"ieConditionalEndComment":return"<!--<!";case"interpolation":return"{{";case"docType":{if(t.value==="html"){let n=e.filepath??"";if(/\.html?$/u.test(n))return os}return e.originalText.slice(J(t),Z(t)).slice(0,os.length)}case"angularIcuExpression":return"{";case"element":if(t.condition)return`<!--[if ${t.condition}]><!--><${t.rawName}`;default:return`<${t.rawName}`}}function Ft(t){switch(Tr.ok(!t.isSelfClosing),t.type){case"ieConditionalComment":return"]>";case"element":if(t.condition)return"><!--<![endif]-->";default:return">"}}function Sa(t,e){if(!t.endSourceSpan)return"";let r=t.startSourceSpan.end.offset;t.firstChild&&nt(t.firstChild)&&(r-=Ft(t).length);let n=t.endSourceSpan.start.offset;return t.lastChild&&Ee(t.lastChild)?n+=Bt(t,e).length:_e(t)&&(n-=Se(t.lastChild,e).length),e.originalText.slice(r,n)}var Nt=Sa;var _a=new Set(["if","else if","for","switch","case"]);function Ea(t,e){let{node:r}=t;switch(r.type){case"element":if(W(r)||r.type==="interpolation")return;if(!r.isSelfClosing&&Tt(r,e)){let n=Ar(r,e);return n?async(s,i)=>{let a=Nt(r,e),o=/^\s*$/u.test(a),u="";return o||(u=await s(Sr(a),{parser:n,__embeddedInHtml:!0}),o=u===""),[G(r,e),E(st(t,e,i)),o?"":S,u,o?"":S,tt(r,e),z(r,e)]}:void 0}break;case"text":if(W(r.parent)){let n=Ar(r.parent,e);if(n)return async s=>{let i=n==="markdown"?Dr(r.value.replace(/^[^\S\n]*\n/u,"")):r.value,a={parser:n,__embeddedInHtml:!0};if(e.parser==="html"&&n==="babel"){let o="script",{attrMap:u}=r.parent;u&&(u.type==="module"||u.type==="text/babel"&&u["data-type"]==="module")&&(o="module"),a.__babelSourceType=o}return[se,G(r,e),await s(i,a),z(r,e)]}}else if(r.parent.type==="interpolation")return async n=>{let s={__isInHtmlInterpolation:!0,__embeddedInHtml:!0};return e.parser==="angular"?s.parser="__ng_interpolation":e.parser==="vue"?s.parser=Pe(t,e)?"__vue_ts_expression":"__vue_expression":s.parser="__js_expression",[k([_,await n(r.value,s)]),r.parent.next&&X(r.parent.next)?" ":_]};break;case"attribute":return is(t,e);case"front-matter":return n=>Dn(r,n);case"angularControlFlowBlockParameters":return _a.has(t.parent.name)?vn:void 0;case"angularLetDeclarationInitializer":return n=>T(r.value,n,{parser:"__ng_binding",__isInHtmlAttribute:!1})}}var ls=Ea;var it=null;function at(t){if(it!==null&&typeof it.property){let e=it;return it=at.prototype=null,e}return it=at.prototype=t??Object.create(null),new at}var Aa=10;for(let t=0;t<=Aa;t++)at();function xr(t){return at(t)}function Da(t,e="type"){xr(t);function r(n){let s=n[e],i=t[s];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return i}return r}var cs=Da;var va={"front-matter":[],root:["children"],element:["attrs","children"],ieConditionalComment:["children"],ieConditionalStartComment:[],ieConditionalEndComment:[],interpolation:["children"],text:["children"],docType:[],comment:[],attribute:[],cdata:[],angularControlFlowBlock:["children","parameters"],angularControlFlowBlockParameters:["children"],angularControlFlowBlockParameter:[],angularLetDeclaration:["init"],angularLetDeclarationInitializer:[],angularIcuExpression:["cases"],angularIcuCase:["expression"]},ps=va;var ya=cs(ps),hs=ya;function fs(t){return/^\s*<!--\s*@(?:format|prettier)\s*-->/u.test(t)}function ms(t){return`<!-- @format -->
|
|
10
10
|
|
|
11
11
|
`+t}var ds=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function gs(t){let e=Z(t);return t.type==="element"&&!t.endSourceSpan&&Ie(t.children)?Math.max(e,gs(K(!1,t.children,-1))):e}function ot(t,e,r){let n=t.node;if(de(n)){let s=gs(n);return[G(n,e),B(O.trimEnd(e.originalText.slice(J(n)+(n.prev&&rt(n.prev)?Lt(n).length:0),s-(n.next&&X(n.next)?Se(n,e).length:0)))),z(n,e)]}return r()}function Pt(t,e){return $(t)&&$(e)?t.isTrailingSpaceSensitive?t.hasTrailingSpaces?wt(e)?S:_:"":wt(e)?S:v:rt(t)&&(de(e)||e.firstChild||e.isSelfClosing||e.type==="element"&&e.attrs.length>0)||t.type==="element"&&t.isSelfClosing&&X(e)?"":!e.isLeadingSpaceSensitive||wt(e)||X(e)&&t.lastChild&&Ee(t.lastChild)&&t.lastChild.lastChild&&Ee(t.lastChild.lastChild)?S:e.hasLeadingSpaces?_:v}function Re(t,e,r){let{node:n}=t;if(Er(n))return[se,...t.map(i=>{let a=i.node,o=a.prev?Pt(a.prev,a):"";return[o?[o,Je(a.prev)?S:""]:"",ot(i,e,r)]},"children")];let s=n.children.map(()=>Symbol(""));return t.map((i,a)=>{let o=i.node;if($(o)){if(o.prev&&$(o.prev)){let A=Pt(o.prev,o);if(A)return Je(o.prev)?[S,S,ot(i,e,r)]:[A,ot(i,e,r)]}return ot(i,e,r)}let u=[],p=[],l=[],f=[],d=o.prev?Pt(o.prev,o):"",C=o.next?Pt(o,o.next):"";return d&&(Je(o.prev)?u.push(S,S):d===S?u.push(S):$(o.prev)?p.push(d):p.push(pe("",v,{groupId:s[a-1]}))),C&&(Je(o)?$(o.next)&&f.push(S,S):C===S?$(o.next)&&f.push(S):l.push(C)),[...u,E([...p,E([ot(i,e,r),...l],{id:s[a]})]),...f]},"children")}function Cs(t,e,r){let{node:n}=t,s=[];wa(t)&&s.push("} "),s.push("@",n.name),n.parameters&&s.push(" (",E(r("parameters")),")"),s.push(" {");let i=Ss(n);return n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,s.push(k([S,Re(t,e,r)])),i&&s.push(S,"}")):i&&s.push("}"),E(s,{shouldBreak:!0})}function Ss(t){var e,r;return!(((e=t.next)==null?void 0:e.type)==="angularControlFlowBlock"&&((r=ds.get(t.name))!=null&&r.has(t.next.name)))}function wa(t){let{previous:e}=t;return(e==null?void 0:e.type)==="angularControlFlowBlock"&&!de(e)&&!Ss(e)}function _s(t,e,r){return[k([v,H([";",_],t.map(r,"children"))]),v]}function Es(t,e,r){let{node:n}=t;return[Ae(n,e),E([n.switchValue.trim(),", ",n.clause,n.cases.length>0?[",",k([_,H(_,t.map(r,"cases"))])]:"",v]),Ce(n,e)]}function As(t,e,r){let{node:n}=t;return[n.value," {",E([k([v,t.map(({node:s,isLast:i})=>{let a=[r()];return s.type==="text"&&(s.hasLeadingSpaces&&a.unshift(_),s.hasTrailingSpaces&&!i&&a.push(_)),a},"expression")]),v]),"}"]}function Ds(t,e,r){let{node:n}=t;if(yt(n,e))return[G(n,e),E(st(t,e,r)),B(Nt(n,e)),...tt(n,e),z(n,e)];let s=n.children.length===1&&(n.firstChild.type==="interpolation"||n.firstChild.type==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,i=Symbol("element-attr-group-id"),a=l=>E([E(st(t,e,r),{id:i}),l,tt(n,e)]),o=l=>s?dn(l,{groupId:i}):(W(n)||et(n,e))&&n.parent.type==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?l:k(l),u=()=>s?pe(v,"",{groupId:i}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?_:n.firstChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?fn(v):v,p=()=>(n.next?X(n.next):_e(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":s?pe(v,"",{groupId:i}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?_:(n.lastChild.type==="comment"||n.lastChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(t.ancestors.length-1)}}$`,"u").test(n.lastChild.value)?"":v;return n.children.length===0?a(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?_:""):a([In(n)?se:"",o([u(),Re(t,e,r)]),p()])}function ut(t){return t>=9&&t<=32||t==160}function It(t){return 48<=t&&t<=57}function lt(t){return t>=97&&t<=122||t>=65&&t<=90}function vs(t){return t>=97&&t<=102||t>=65&&t<=70||It(t)}function Rt(t){return t===10||t===13}function kr(t){return 48<=t&&t<=55}function $t(t){return t===39||t===34||t===96}var ba=/-+([a-z0-9])/g;function ws(t){return t.replace(ba,(...e)=>e[1].toUpperCase())}var ie=class t{constructor(e,r,n,s){this.file=e,this.offset=r,this.line=n,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let r=this.file.content,n=r.length,s=this.offset,i=this.line,a=this.col;for(;s>0&&e<0;)if(s--,e++,r.charCodeAt(s)==10){i--;let u=r.substring(0,s-1).lastIndexOf(String.fromCharCode(10));a=u>0?s-u:s}else a--;for(;s<n&&e>0;){let o=r.charCodeAt(s);s++,e--,o==10?(i++,a=0):a++}return new t(this.file,s,i,a)}getContext(e,r){let n=this.file.content,s=this.offset;if(s!=null){s>n.length-1&&(s=n.length-1);let i=s,a=0,o=0;for(;a<e&&s>0&&(s--,a++,!(n[s]==`
|
|
12
12
|
`&&++o==r)););for(a=0,o=0;a<e&&i<n.length-1&&(i++,a++,!(n[i]==`
|