@slowpoketail/oxc 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,213 @@
1
+ import{builtinModules as e,createRequire as t}from"node:module";import*as n from"node:fs";import*as r from"node:path";var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule||!l.call(e,`default`)?a(n,`default`,{value:e,enumerable:!0}):n,e));let p={description:`Specifies whether to sort items in ascending or descending order.`,enum:[`asc`,`desc`],type:`string`},m={description:"Used only when the `type` option is set to `'custom'`. Specifies the custom alphabet for sorting.",type:`string`},h={oneOf:[{type:`string`},{items:{type:`string`},type:`array`}],description:`Specifies the sorting locales.`},g={description:`Controls whether sorting should be case-sensitive or not.`,type:`boolean`},_={description:`Specifies whether to trim, remove, or keep special characters before sorting.`,enum:[`remove`,`trim`,`keep`],type:`string`},v={description:`Specifies an AST selector to match elements for conditional configuration.`,type:`string`};function y({allowedAdditionalTypeValues:e,additionalSortProperties:t}={}){return{fallbackSort:ee({additionalProperties:t,allowedAdditionalTypeValues:e}),type:te({allowedAdditionalValues:e}),specialCharacters:_,ignoreCase:g,alphabet:m,locales:h,order:p,...t}}function ee({allowedAdditionalTypeValues:e,additionalProperties:t}){return{properties:{type:te({allowedAdditionalValues:e}),order:p,...t},description:`Fallback sort order.`,additionalProperties:!1,required:[`type`],type:`object`}}function b({additionalProperties:e}={}){return{description:`Specifies filters to match a particular options configuration for a given element to sort.`,properties:{allNamesMatchPattern:x(),...e},additionalProperties:!1,type:`object`}}function te({allowedAdditionalValues:e}){return{enum:[`alphabetical`,`natural`,`line-length`,`custom`,`unsorted`,`subgroup-order`,...e??[]],description:`Specifies the sorting method.`,type:`string`}}function x({additionalProperties:e}={}){return{oneOf:[{items:ne({additionalProperties:e}),type:`array`},ne({additionalProperties:e})],description:`Regular expression.`}}function ne({additionalProperties:e}){return{oneOf:[{properties:{...e,pattern:{description:`Regular expression pattern.`,type:`string`},flags:{description:`Regular expression flags.`,type:`string`}},additionalProperties:!1,required:[`pattern`],type:`object`},{type:`string`}],description:`Regular expression.`}}let re={description:`Enables experimental dependency detection for sorting rules that support it.`,type:`boolean`},ie={oneOf:[{description:`Specifies how to handle newlines between groups.`,enum:[`ignore`],type:`string`},{type:`number`,minimum:0}]},ae={oneOf:[{description:`Specifies how to handle newlines between groups elements`,enum:[`ignore`],type:`string`},{type:`number`,minimum:0}]};function oe({allowedAdditionalTypeValues:e,additionalSortProperties:t}){return{items:{oneOf:[{type:`string`},{items:{type:`string`},type:`array`,minItems:1},{properties:{newlinesBetween:ie},required:[`newlinesBetween`],additionalProperties:!1,type:`object`},{properties:{group:{oneOf:[{type:`string`},{items:{type:`string`},type:`array`,minItems:1}]},fallbackSort:ee({additionalProperties:t,allowedAdditionalTypeValues:e}),commentAbove:{description:`Specifies a comment to enforce above the group.`,type:`string`},type:te({allowedAdditionalValues:e}),newlinesInside:ae,order:p,...t},additionalProperties:!1,required:[`group`],minProperties:2,type:`object`}]},description:`Specifies a list of groups for sorting.`,type:`array`}}function se({additionalCustomGroupMatchProperties:e,allowedAdditionalTypeValues:t,additionalSortProperties:n}){let r=ce({allowedAdditionalTypeValues:t,additionalSortProperties:n}),i=le(e);return{items:{oneOf:[{properties:{...r,anyOf:{items:{properties:i,description:`Custom group.`,additionalProperties:!1,type:`object`},type:`array`,minItems:1}},description:`Custom group block.`,required:[`groupName`,`anyOf`],additionalProperties:!1,type:`object`},{properties:{...r,...i},description:`Custom group.`,additionalProperties:!1,required:[`groupName`],minProperties:2,type:`object`}]},description:`Defines custom groups to match specific members.`,type:`array`}}function S({additionalCustomGroupMatchProperties:e,allowedAdditionalTypeValues:t,additionalSortProperties:n}={}){return{customGroups:se({additionalCustomGroupMatchProperties:e,allowedAdditionalTypeValues:t,additionalSortProperties:n}),newlinesInside:{oneOf:[ae,{enum:[`newlinesBetween`],type:`string`}]},groups:oe({allowedAdditionalTypeValues:t,additionalSortProperties:n}),newlinesBetween:ie}}function C(e){return{items:{enum:[...e],type:`string`},description:`Modifier filters.`,type:`array`}}function w(e){return{description:`Selector filter.`,enum:[...e],type:`string`}}function ce({allowedAdditionalTypeValues:e,additionalSortProperties:t}){return{fallbackSort:ee({additionalProperties:t,allowedAdditionalTypeValues:e}),type:te({allowedAdditionalValues:e}),groupName:{description:`Custom group name.`,type:`string`},newlinesInside:ae,order:p,...t}}function le(e){return{elementNamePattern:x(),...e}}const ue=`unexpectedVariableDeclarationsOrder`,de=`unexpectedVariableDeclarationsGroupOrder`,fe=`extraSpacingBetweenVariableDeclarationsMembers`,pe=`missedSpacingBetweenVariableDeclarationsMembers`,me=`unexpectedVariableDeclarationsDependencyOrder`;let he=[`initialized`,`uninitialized`],ge={selector:w(he)};const _e=`nodeDependentOnRight`,T=`right`,ve=`rightGroup`,ye=`left`,be=`leftGroup`,xe=`missedCommentAbove`,E=`Expected "{{${T}}}" to come before "{{${ye}}}".`,Se=`Expected dependency "{{${T}}}" to come before "{{${_e}}}".`,D=`Expected "{{${T}}}" ({{${ve}}}) to come before "{{${ye}}}" ({{${be}}}).`,O=`Extra spacing between "{{${ye}}}" and "{{${T}}}".`,k=`Missed spacing between "{{${ye}}}" and "{{${T}}}".`,Ce=`Missed comment "{{${xe}}}" above "{{${T}}}".`;function we({firstUnorderedNodeDependentOnRight:e,commentAboveMissing:t,messageIds:n,context:r,getFix:i,right:a,left:o}){for(let s of n)r.report({data:{[_e]:e?.name,[xe]:t,[ye]:Te(o?.name??``),[T]:Te(a.name),[ve]:a.group,[be]:o?.group},fix:e=>i({hasCommentAboveMissing:!!t,fixer:e}),node:a.node,messageId:s})}function Te(e){return e.replaceAll(/\s{2,}/gu,` `).trim()}let Ee=[{type:`boolean`},x()],A={oneOf:[...Ee,{properties:{block:{description:`Enables specific block comments to separate the nodes.`,oneOf:Ee},line:{description:`Enables specific line comments to separate the nodes.`,oneOf:Ee}},additionalProperties:!1,minProperties:1,type:`object`}],description:`Enables the use of comments to separate the nodes into logical groups.`},j={description:`Enables the use of newlines to separate the nodes into logical groups.`,type:`boolean`};function De(e,t){return n(t.getScope(e));function n(e){return[...e.references,...e.childScopes.flatMap(n)]}}function Oe(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function ke({additionalIdentifierDependenciesComputer:e,shouldIgnoreSortingNodeComputer:t,shouldIgnoreIdentifierComputer:n,sortingNodes:r,sourceCode:i}){let a=/* @__PURE__ */ new Map,o=r.flatMap(e=>De(e.node,i)),s=new Set(o);for(let i of s){let{identifier:o,resolved:s}=i;if(!s)continue;let c=je(r,o);if(!c||t?.(c))continue;let l=a.get(c)??[];a.set(c,l),l.push(...Ae({shouldIgnoreSortingNodeComputer:t,shouldIgnoreIdentifierComputer:n,referencingSortingNode:c,sortingNodes:r,identifier:o,resolved:s}),...e?.({referencingSortingNode:c,reference:i})??[])}return a}function Ae({shouldIgnoreSortingNodeComputer:e,shouldIgnoreIdentifierComputer:t,referencingSortingNode:n,sortingNodes:r,identifier:i,resolved:a}){if(t?.({referencingSortingNode:n,identifier:i}))return[];let[o]=a.identifiers;if(!o)return[];let s=je(r,o);return!s||e?.(s)||s===n?[]:[s]}function je(e,t){return e.find(e=>Oe(e.node.range,t.range))}function Me({consecutiveOnly:e,allowedTypes:t,maxParent:n,node:r}){let i=new Set(t),a=[],{parent:o}=r;for(;o&&o!==n;){if(i.has(o.type))a.push(o);else if(e)break;({parent:o}=o)}return a}var Ne=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AST_TOKEN_TYPES=e.AST_NODE_TYPES=void 0;var t;(function(e){e.AccessorProperty=`AccessorProperty`,e.ArrayExpression=`ArrayExpression`,e.ArrayPattern=`ArrayPattern`,e.ArrowFunctionExpression=`ArrowFunctionExpression`,e.AssignmentExpression=`AssignmentExpression`,e.AssignmentPattern=`AssignmentPattern`,e.AwaitExpression=`AwaitExpression`,e.BinaryExpression=`BinaryExpression`,e.BlockStatement=`BlockStatement`,e.BreakStatement=`BreakStatement`,e.CallExpression=`CallExpression`,e.CatchClause=`CatchClause`,e.ChainExpression=`ChainExpression`,e.ClassBody=`ClassBody`,e.ClassDeclaration=`ClassDeclaration`,e.ClassExpression=`ClassExpression`,e.ConditionalExpression=`ConditionalExpression`,e.ContinueStatement=`ContinueStatement`,e.DebuggerStatement=`DebuggerStatement`,e.Decorator=`Decorator`,e.DoWhileStatement=`DoWhileStatement`,e.EmptyStatement=`EmptyStatement`,e.ExportAllDeclaration=`ExportAllDeclaration`,e.ExportDefaultDeclaration=`ExportDefaultDeclaration`,e.ExportNamedDeclaration=`ExportNamedDeclaration`,e.ExportSpecifier=`ExportSpecifier`,e.ExpressionStatement=`ExpressionStatement`,e.ForInStatement=`ForInStatement`,e.ForOfStatement=`ForOfStatement`,e.ForStatement=`ForStatement`,e.FunctionDeclaration=`FunctionDeclaration`,e.FunctionExpression=`FunctionExpression`,e.Identifier=`Identifier`,e.IfStatement=`IfStatement`,e.ImportAttribute=`ImportAttribute`,e.ImportDeclaration=`ImportDeclaration`,e.ImportDefaultSpecifier=`ImportDefaultSpecifier`,e.ImportExpression=`ImportExpression`,e.ImportNamespaceSpecifier=`ImportNamespaceSpecifier`,e.ImportSpecifier=`ImportSpecifier`,e.JSXAttribute=`JSXAttribute`,e.JSXClosingElement=`JSXClosingElement`,e.JSXClosingFragment=`JSXClosingFragment`,e.JSXElement=`JSXElement`,e.JSXEmptyExpression=`JSXEmptyExpression`,e.JSXExpressionContainer=`JSXExpressionContainer`,e.JSXFragment=`JSXFragment`,e.JSXIdentifier=`JSXIdentifier`,e.JSXMemberExpression=`JSXMemberExpression`,e.JSXNamespacedName=`JSXNamespacedName`,e.JSXOpeningElement=`JSXOpeningElement`,e.JSXOpeningFragment=`JSXOpeningFragment`,e.JSXSpreadAttribute=`JSXSpreadAttribute`,e.JSXSpreadChild=`JSXSpreadChild`,e.JSXText=`JSXText`,e.LabeledStatement=`LabeledStatement`,e.Literal=`Literal`,e.LogicalExpression=`LogicalExpression`,e.MemberExpression=`MemberExpression`,e.MetaProperty=`MetaProperty`,e.MethodDefinition=`MethodDefinition`,e.NewExpression=`NewExpression`,e.ObjectExpression=`ObjectExpression`,e.ObjectPattern=`ObjectPattern`,e.PrivateIdentifier=`PrivateIdentifier`,e.Program=`Program`,e.Property=`Property`,e.PropertyDefinition=`PropertyDefinition`,e.RestElement=`RestElement`,e.ReturnStatement=`ReturnStatement`,e.SequenceExpression=`SequenceExpression`,e.SpreadElement=`SpreadElement`,e.StaticBlock=`StaticBlock`,e.Super=`Super`,e.SwitchCase=`SwitchCase`,e.SwitchStatement=`SwitchStatement`,e.TaggedTemplateExpression=`TaggedTemplateExpression`,e.TemplateElement=`TemplateElement`,e.TemplateLiteral=`TemplateLiteral`,e.ThisExpression=`ThisExpression`,e.ThrowStatement=`ThrowStatement`,e.TryStatement=`TryStatement`,e.UnaryExpression=`UnaryExpression`,e.UpdateExpression=`UpdateExpression`,e.VariableDeclaration=`VariableDeclaration`,e.VariableDeclarator=`VariableDeclarator`,e.WhileStatement=`WhileStatement`,e.WithStatement=`WithStatement`,e.YieldExpression=`YieldExpression`,e.TSAbstractAccessorProperty=`TSAbstractAccessorProperty`,e.TSAbstractKeyword=`TSAbstractKeyword`,e.TSAbstractMethodDefinition=`TSAbstractMethodDefinition`,e.TSAbstractPropertyDefinition=`TSAbstractPropertyDefinition`,e.TSAnyKeyword=`TSAnyKeyword`,e.TSArrayType=`TSArrayType`,e.TSAsExpression=`TSAsExpression`,e.TSAsyncKeyword=`TSAsyncKeyword`,e.TSBigIntKeyword=`TSBigIntKeyword`,e.TSBooleanKeyword=`TSBooleanKeyword`,e.TSCallSignatureDeclaration=`TSCallSignatureDeclaration`,e.TSClassImplements=`TSClassImplements`,e.TSConditionalType=`TSConditionalType`,e.TSConstructorType=`TSConstructorType`,e.TSConstructSignatureDeclaration=`TSConstructSignatureDeclaration`,e.TSDeclareFunction=`TSDeclareFunction`,e.TSDeclareKeyword=`TSDeclareKeyword`,e.TSEmptyBodyFunctionExpression=`TSEmptyBodyFunctionExpression`,e.TSEnumBody=`TSEnumBody`,e.TSEnumDeclaration=`TSEnumDeclaration`,e.TSEnumMember=`TSEnumMember`,e.TSExportAssignment=`TSExportAssignment`,e.TSExportKeyword=`TSExportKeyword`,e.TSExternalModuleReference=`TSExternalModuleReference`,e.TSFunctionType=`TSFunctionType`,e.TSImportEqualsDeclaration=`TSImportEqualsDeclaration`,e.TSImportType=`TSImportType`,e.TSIndexedAccessType=`TSIndexedAccessType`,e.TSIndexSignature=`TSIndexSignature`,e.TSInferType=`TSInferType`,e.TSInstantiationExpression=`TSInstantiationExpression`,e.TSInterfaceBody=`TSInterfaceBody`,e.TSInterfaceDeclaration=`TSInterfaceDeclaration`,e.TSInterfaceHeritage=`TSInterfaceHeritage`,e.TSIntersectionType=`TSIntersectionType`,e.TSIntrinsicKeyword=`TSIntrinsicKeyword`,e.TSLiteralType=`TSLiteralType`,e.TSMappedType=`TSMappedType`,e.TSMethodSignature=`TSMethodSignature`,e.TSModuleBlock=`TSModuleBlock`,e.TSModuleDeclaration=`TSModuleDeclaration`,e.TSNamedTupleMember=`TSNamedTupleMember`,e.TSNamespaceExportDeclaration=`TSNamespaceExportDeclaration`,e.TSNeverKeyword=`TSNeverKeyword`,e.TSNonNullExpression=`TSNonNullExpression`,e.TSNullKeyword=`TSNullKeyword`,e.TSNumberKeyword=`TSNumberKeyword`,e.TSObjectKeyword=`TSObjectKeyword`,e.TSOptionalType=`TSOptionalType`,e.TSParameterProperty=`TSParameterProperty`,e.TSPrivateKeyword=`TSPrivateKeyword`,e.TSPropertySignature=`TSPropertySignature`,e.TSProtectedKeyword=`TSProtectedKeyword`,e.TSPublicKeyword=`TSPublicKeyword`,e.TSQualifiedName=`TSQualifiedName`,e.TSReadonlyKeyword=`TSReadonlyKeyword`,e.TSRestType=`TSRestType`,e.TSSatisfiesExpression=`TSSatisfiesExpression`,e.TSStaticKeyword=`TSStaticKeyword`,e.TSStringKeyword=`TSStringKeyword`,e.TSSymbolKeyword=`TSSymbolKeyword`,e.TSTemplateLiteralType=`TSTemplateLiteralType`,e.TSThisType=`TSThisType`,e.TSTupleType=`TSTupleType`,e.TSTypeAliasDeclaration=`TSTypeAliasDeclaration`,e.TSTypeAnnotation=`TSTypeAnnotation`,e.TSTypeAssertion=`TSTypeAssertion`,e.TSTypeLiteral=`TSTypeLiteral`,e.TSTypeOperator=`TSTypeOperator`,e.TSTypeParameter=`TSTypeParameter`,e.TSTypeParameterDeclaration=`TSTypeParameterDeclaration`,e.TSTypeParameterInstantiation=`TSTypeParameterInstantiation`,e.TSTypePredicate=`TSTypePredicate`,e.TSTypeQuery=`TSTypeQuery`,e.TSTypeReference=`TSTypeReference`,e.TSUndefinedKeyword=`TSUndefinedKeyword`,e.TSUnionType=`TSUnionType`,e.TSUnknownKeyword=`TSUnknownKeyword`,e.TSVoidKeyword=`TSVoidKeyword`})(t||(e.AST_NODE_TYPES=t={}));var n;(function(e){e.Boolean=`Boolean`,e.Identifier=`Identifier`,e.JSXIdentifier=`JSXIdentifier`,e.PrivateIdentifier=`PrivateIdentifier`,e.JSXText=`JSXText`,e.Keyword=`Keyword`,e.Null=`Null`,e.Numeric=`Numeric`,e.Punctuator=`Punctuator`,e.RegularExpression=`RegularExpression`,e.String=`String`,e.Template=`Template`,e.Block=`Block`,e.Line=`Line`})(n||(e.AST_TOKEN_TYPES=n={}))})),M=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Pe=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Fe=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),a=n&&n.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&r(n,t,a[o]);return i(n,t),n}})();Object.defineProperty(e,"__esModule",{value:!0}),e.TSESTree=void 0,e.TSESTree=a(Ne())})),Ie=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.AST_TOKEN_TYPES=e.AST_NODE_TYPES=void 0;var a=Ne();Object.defineProperty(e,"AST_NODE_TYPES",{enumerable:!0,get:function(){return a.AST_NODE_TYPES}}),Object.defineProperty(e,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return a.AST_TOKEN_TYPES}}),i(M(),e),i(Pe(),e),i(Fe(),e)})),N=Ie();function Le(e){let{parent:t}=e;return(t.type===N.AST_NODE_TYPES.CallExpression||t.type===N.AST_NODE_TYPES.NewExpression)&&t.callee===e}function Re(e,t){if(Array.isArray(t))return t.some(t=>Re(e,t));if(typeof t==`string`)return new RegExp(t).test(e);if(`source`in t)throw Error(`Invalid configuration: please enter your RegExp expressions as strings.
2
+ For example, write ".*foo" instead of /.*foo/`);return new RegExp(t.pattern,t.flags).test(e)}function ze({ignoreCallbackDependenciesPatterns:e,maxParent:t,node:n}){return e&&Be({ignoreCallbackDependenciesPatterns:e,maxParent:t,node:n})?!0:Me({allowedTypes:[N.AST_NODE_TYPES.FunctionExpression,N.AST_NODE_TYPES.ArrowFunctionExpression],consecutiveOnly:!1,maxParent:t,node:n}).some(Ve)}function Be({ignoreCallbackDependenciesPatterns:e,maxParent:t,node:n}){return Me({allowedTypes:[N.AST_NODE_TYPES.CallExpression],consecutiveOnly:!1,maxParent:t,node:n}).some(r);function r(t){return`name`in t.callee&&Re(t.callee.name,e)}}function Ve(e){let{parent:t}=e;return!Le(e)&&t.type!==N.AST_NODE_TYPES.CallExpression}function He({ignoreCallbackDependenciesPatterns:e,sortingNodes:t,sourceCode:n}){return ke({shouldIgnoreIdentifierComputer:r(),sortingNodes:t,sourceCode:n});function r(){return({referencingSortingNode:t,identifier:n})=>ze({maxParent:t.node,ignoreCallbackDependenciesPatterns:e,node:n})}}function Ue({dependenciesBySortingNode:e,sortingNodeGroups:t}){return t.map(t=>We({dependenciesBySortingNode:e,sortingNodes:t}))}function We({dependenciesBySortingNode:e,sortingNodes:t}){return t.map(n);function n(t){return{...t,dependencies:Ge({dependenciesBySortingNode:e,sortingNode:t})}}}function Ge({dependenciesBySortingNode:e,sortingNode:t}){let n=e.get(t);return n?n.flatMap(({dependencyNames:e})=>e):[]}var P=class extends Error{constructor(e,t){super(`Unreachable case: ${e}`,t),this.name=`UnreachableCaseError`}};function Ke(e){return typeof e==`object`&&`group`in e}function qe(e){return typeof e==`object`&&`newlinesBetween`in e}function Je(e,t){switch(t){case`desc`:return-e;case`asc`:return e;
3
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
4
+ default:throw new P(t)}}function Ye({groups:e,order:t}){return(n,r)=>{let i=Xe(n,e),a=Xe(r,e);return!i||!a||i!==a?0:Je(i.indexOf(n.group)-a.indexOf(r.group),t)}}function Xe(e,t){for(let n of t)if(!qe(n)){if(typeof n==`string`||Array.isArray(n)){if(Ze(e,n))return n}else if(Ke(n)){if(Ze(e,n.group))return n.group}else
5
+ /* v8 ignore next -- @preserve Exhaustive guard for unsupported group option. */
6
+ throw new P(n)}return null}function Ze(e,t){return typeof t!=`string`&&t.includes(e.group)}function Qe({order:e}){return(t,n)=>Je(t.size-n.size,e)}function $e({specialCharacters:e,ignoreCase:t}){return n=>{let r=n;switch(t&&(r=r.toLowerCase()),e){case`remove`:r=r.replaceAll(/[^a-z\u{C0}-\u{24F}\u{1E00}-\u{1EFF}]+/giu,``);break;case`trim`:r=r.replaceAll(/^[^a-z\u{C0}-\u{24F}\u{1E00}-\u{1EFF}]+/giu,``);break;case`keep`:break;
7
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
8
+ default:throw new P(e)}return r.replaceAll(/\s/gu,``)}}function et(e,t,{specialCharacters:n,ignoreCase:r,locales:i,order:a}){let o=$e({specialCharacters:n,ignoreCase:r});return Je(o(e).localeCompare(o(t),i),a)}function tt(e){return e?1:-1}let nt=/* @__PURE__ */ new Map;function rt(e,t,{specialCharacters:n,ignoreCase:r,alphabet:i,order:a}){let o=$e({specialCharacters:n,ignoreCase:r}),s=nt.get(i);if(!s){s=/* @__PURE__ */ new Map;for(let[e,t]of[...i].entries())s.set(t,e);nt.set(i,s)}let c=o(e),l=o(t),u=Math.min(c.length,l.length);for(let e=0;e<u;e++){let t=c[e],n=l[e],r=s.get(t),i=s.get(n);if(r??=1/0,i??=1/0,r!==i)return Je(tt(r>i),a)}return c.length===l.length?0:Je(tt(c.length>l.length),a)}let it=()=>0;var at=/* @__PURE__ */ u(((e,t,n)=>{
9
+ /**
10
+ * natural-orderby v5.0.0
11
+ *
12
+ * Copyright (c) Olaf Ennen
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE.md file in the root directory of this source tree.
16
+ *
17
+ * @license MIT
18
+ */
19
+ (function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n=typeof globalThis<`u`?globalThis:n||self).naturalOrderBy={})})(n,(function(e){var t=function(e,t){return e<t?-1:+(e>t)},n=function(e,t,n){var r=e.localeCompare(t,n);return r?r/Math.abs(r):0},r=/(^0x[\da-fA-F]+$|^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?!\.\d+)(?=\D|\s|$))|\d+)/g,i=/^\s+|\s+$/g,a=/\s+/g,o=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[/-]\d{1,4}[/-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0+[1-9]{1}[0-9]*$/,l=/[^\x00-\x80]/,u=function(e,t){return e<t?-1:+(e>t)},d=function(e,r,i){return e.value===r.value?0:e.parsedNumber!==void 0&&r.parsedNumber!==void 0?t(e.parsedNumber,r.parsedNumber):e.chunks&&r.chunks?function(e,r,i){for(var a=e.length,o=r.length,s=Math.min(a,o),c=0;c<s;c++){var d=e[c],f=r[c];if(d.normalizedString!==f.normalizedString){if(d.normalizedString===``!=(f.normalizedString===``))return d.normalizedString===``?-1:1;if(d.parsedNumber!==void 0&&f.parsedNumber!==void 0){var p=t(d.parsedNumber,f.parsedNumber);return p===0?u(d.normalizedString,f.normalizedString):p}return d.parsedNumber!==void 0||f.parsedNumber!==void 0?d.parsedNumber===void 0?1:-1:l.test(d.normalizedString+f.normalizedString)?n(d.normalizedString,f.normalizedString,i):u(d.normalizedString,f.normalizedString)}}return a>s||o>s?a<=s?-1:1:0}(e.chunks,r.chunks,i):function(e,t){return(e.chunks?!t.chunks:t.chunks)?e.chunks?-1:1:(e.isNaN?!t.isNaN:t.isNaN)?e.isNaN?-1:1:(e.isSymbol?!t.isSymbol:t.isSymbol)?e.isSymbol?-1:1:(e.isObject?!t.isObject:t.isObject)?e.isObject?-1:1:(e.isArray?!t.isArray:t.isArray)?e.isArray?-1:1:(e.isFunction?!t.isFunction:t.isFunction)?e.isFunction?-1:1:(e.isNull?!t.isNull:t.isNull)?e.isNull?-1:1:0}(e,r)},f=function(e){return e.replace(a,` `).replace(i,``)},p=function(e){if(e.length!==0){var t=Number(e.replace(/_/g,``));if(!Number.isNaN(t))return t}},m=function(e,t,n){if(o.test(e)&&(!c.test(e)||t===0||n[t-1]!==`.`))return p(e)||0},h=function(e,t,n){return{parsedNumber:m(e,t,n),normalizedString:f(e)}},g=function(e){return function(e){return e.replace(r,`\0$1\0`).replace(/\0$/,``).replace(/^\0/,``).split(`\0`)}(e).map(h)},_=function(e){return typeof e==`function`},v=function(e){return Number.isNaN(e)||e instanceof Number&&Number.isNaN(e.valueOf())},y=function(e){return e===null},ee=function(e){return!(typeof e!=`object`||!e||Array.isArray(e)||e instanceof Number||e instanceof String||e instanceof Boolean||e instanceof Date)},b=function(e){return typeof e==`symbol`},te=function(e){return e===void 0},x=function(e){var t=p(e);return t===void 0?function(e){try{var t=Date.parse(e);return!Number.isNaN(t)&&s.test(e)?t:void 0}catch{return}}(e):t},ne=function(e){if(typeof e==`string`||e instanceof String||(typeof e==`number`||e instanceof Number)&&!v(e)||typeof e==`boolean`||e instanceof Boolean||e instanceof Date){var t=function(e){return typeof e==`boolean`||e instanceof Boolean?Number(e).toString():typeof e==`number`||e instanceof Number?e.toString():e instanceof Date?e.getTime().toString():typeof e==`string`||e instanceof String?e.toLowerCase().replace(i,``):``}(e),n=x(t);return{parsedNumber:n,chunks:g(n?``+n:t),value:e}}return{isArray:Array.isArray(e),isFunction:_(e),isNaN:v(e),isNull:y(e),isObject:ee(e),isSymbol:b(e),isUndefined:te(e),value:e}},re=function(e){return typeof e==`string`&&(e===`asc`||e===`desc`)},ie=function(e){return typeof e==`function`?e:function(t){if(Array.isArray(t)){var n=Number(e);if(Number.isInteger(n))return t[n]}else if(t&&typeof t==`object`)return Object.getOwnPropertyDescriptor(t,e)?.value;return t}},ae=function(e,t,n,r){var i=t.length?t.map(ie):[function(e){return e}],a=e.map((function(e,t){return{index:t,values:i.map((function(t){return t(e)})).map(ne)}}));return a.sort((function(e,t){return function(e,t,n,r){for(var i=e.index,a=e.values,o=t.index,s=t.values,c=a.length,l=n.length,u=0;u<c;u++){var f=u<l?n[u]:null;if(f&&typeof f==`function`){var p=f(a[u].value,s[u].value);if(p)return p}else{var m=d(a[u],s[u],r);if(m)return m*(f===`desc`?-1:1)}}return i-o}(e,t,n,r)})),a.map((function(t){return function(e,t){return e[t]}(e,t.index)}))};e.compare=function(e){var t,n,r;return function(e){return function(t,n){return d(ne(t),ne(n),e.locale)*(e.order===`desc`?-1:1)}}((r=`asc`,typeof(t=e)==`string`&&re(t)?r=t:t&&typeof t==`object`&&(t.order&&re(t.order)&&(r=t.order),t.locale&&t.locale.length>0&&(n=t.locale)),{order:r,locale:n}))},e.orderBy=function(e,t,n,r){return!e||!Array.isArray(e)?[]:ae(e,function(e){if(!e)return[];var t=Array.isArray(e)?[].concat(e):[e];return t.some((function(e){return typeof e!=`string`&&typeof e!=`number`&&typeof e!=`function`}))?[]:t}(t),function(e){if(!e)return[];var t=Array.isArray(e)?[].concat(e):[e];return t.some((function(e){return e!==`asc`&&e!==`desc`&&typeof e!=`function`}))?[]:t}(n),r)}}))})),ot=/* @__PURE__ */ u(((e,t,n)=>{
20
+ /**
21
+ * natural-orderby v5.0.0
22
+ *
23
+ * Copyright (c) Olaf Ennen
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE.md file in the root directory of this source tree.
27
+ *
28
+ * @license MIT
29
+ */
30
+ (function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.naturalOrderBy={}))})(n,(function(e){var t=function(e,t){return e<t?-1:+(e>t)},n=function(e,t,n){var r=e.localeCompare(t,n);return r?r/Math.abs(r):0},r=/(^0x[\da-fA-F]+$|^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?!\.\d+)(?=\D|\s|$))|\d+)/g,i=/^\s+|\s+$/g,a=/\s+/g,o=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[/-]\d{1,4}[/-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0+[1-9]{1}[0-9]*$/,l=/[^\x00-\x80]/,u=function(e,t){return e<t?-1:+(e>t)},d=function(e,r,i){for(var a=e.length,o=r.length,s=Math.min(a,o),c=0;c<s;c++){var d=e[c],f=r[c];if(d.normalizedString!==f.normalizedString){if(d.normalizedString===``!=(f.normalizedString===``))return d.normalizedString===``?-1:1;if(d.parsedNumber!==void 0&&f.parsedNumber!==void 0){var p=t(d.parsedNumber,f.parsedNumber);return p===0?u(d.normalizedString,f.normalizedString):p}return d.parsedNumber!==void 0||f.parsedNumber!==void 0?d.parsedNumber===void 0?1:-1:l.test(d.normalizedString+f.normalizedString)?n(d.normalizedString,f.normalizedString,i):u(d.normalizedString,f.normalizedString)}}return a>s||o>s?a<=s?-1:1:0},f=function(e,t){return(e.chunks?!t.chunks:t.chunks)?e.chunks?-1:1:(e.isNaN?!t.isNaN:t.isNaN)?e.isNaN?-1:1:(e.isSymbol?!t.isSymbol:t.isSymbol)?e.isSymbol?-1:1:(e.isObject?!t.isObject:t.isObject)?e.isObject?-1:1:(e.isArray?!t.isArray:t.isArray)?e.isArray?-1:1:(e.isFunction?!t.isFunction:t.isFunction)?e.isFunction?-1:1:(e.isNull?!t.isNull:t.isNull)?e.isNull?-1:1:0},p=function(e,n,r){return e.value===n.value?0:e.parsedNumber!==void 0&&n.parsedNumber!==void 0?t(e.parsedNumber,n.parsedNumber):e.chunks&&n.chunks?d(e.chunks,n.chunks,r):f(e,n)},m=function(e){return e.replace(a,` `).replace(i,``)},h=function(e){if(e.length!==0){var t=Number(e.replace(/_/g,``));if(!Number.isNaN(t))return t}},g=function(e,t,n){if(o.test(e)&&(!c.test(e)||t===0||n[t-1]!==`.`))return h(e)||0},_=function(e,t,n){return{parsedNumber:g(e,t,n),normalizedString:m(e)}},v=function(e){return e.replace(r,`\0$1\0`).replace(/\0$/,``).replace(/^\0/,``).split(`\0`)},y=function(e){return v(e).map(_)},ee=function(e){return typeof e==`function`},b=function(e){return Number.isNaN(e)||e instanceof Number&&Number.isNaN(e.valueOf())},te=function(e){return e===null},x=function(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Number)&&!(e instanceof String)&&!(e instanceof Boolean)&&!(e instanceof Date)},ne=function(e){return typeof e==`symbol`},re=function(e){return e===void 0},ie=function(e){try{var t=Date.parse(e);return!Number.isNaN(t)&&s.test(e)?t:void 0}catch{return}},ae=function(e){var t=h(e);return t===void 0?ie(e):t},oe=function(e){return typeof e==`boolean`||e instanceof Boolean?Number(e).toString():typeof e==`number`||e instanceof Number?e.toString():e instanceof Date?e.getTime().toString():typeof e==`string`||e instanceof String?e.toLowerCase().replace(i,``):``},se=function(e){if(typeof e==`string`||e instanceof String||(typeof e==`number`||e instanceof Number)&&!b(e)||typeof e==`boolean`||e instanceof Boolean||e instanceof Date){var t=oe(e),n=ae(t);return{parsedNumber:n,chunks:y(n?``+n:t),value:e}}return{isArray:Array.isArray(e),isFunction:ee(e),isNaN:b(e),isNull:te(e),isObject:x(e),isSymbol:ne(e),isUndefined:re(e),value:e}},S=function(e){return function(t,n){return p(se(t),se(n),e.locale)*(e.order===`desc`?-1:1)}},C=function(e){return typeof e==`string`&&(e===`asc`||e===`desc`)},w=function(e){var t=`asc`,n;return typeof e==`string`&&C(e)?t=e:e&&typeof e==`object`&&(e.order&&C(e.order)&&(t=e.order),e.locale&&e.locale.length>0&&(n=e.locale)),{order:t,locale:n}};function ce(e){return S(w(e))}var le=function(e,t,n,r){for(var i=e.index,a=e.values,o=t.index,s=t.values,c=a.length,l=n.length,u=0;u<c;u++){var d=u<l?n[u]:null;if(d&&typeof d==`function`){var f=d(a[u].value,s[u].value);if(f)return f}else{var m=p(a[u],s[u],r);if(m)return m*(d===`desc`?-1:1)}}return i-o},ue=function(e){return typeof e==`function`?e:function(t){if(Array.isArray(t)){var n=Number(e);if(Number.isInteger(n))return t[n]}else if(t&&typeof t==`object`)return Object.getOwnPropertyDescriptor(t,e)?.value;return t}},de=function(e,t){return e[t]},fe=function(e,t){return t(e)},pe=function(e,t,n,r){var i=t.length?t.map(ue):[function(e){return e}],a=e.map(function(e,t){return{index:t,values:i.map(function(t){return fe(e,t)}).map(se)}});return a.sort(function(e,t){return le(e,t,n,r)}),a.map(function(t){return de(e,t.index)})},me=function(e){if(!e)return[];var t=Array.isArray(e)?[].concat(e):[e];return t.some(function(e){return typeof e!=`string`&&typeof e!=`number`&&typeof e!=`function`})?[]:t},he=function(e){if(!e)return[];var t=Array.isArray(e)?[].concat(e):[e];return t.some(function(e){return e!==`asc`&&e!==`desc`&&typeof e!=`function`})?[]:t};function ge(e,t,n,r){return!e||!Array.isArray(e)?[]:pe(e,me(t),he(n),r)}e.compare=ce,e.orderBy=ge}))})),st=(/* @__PURE__ */ u(((e,t)=>{
31
+ /**
32
+ * natural-orderby v5.0.0
33
+ *
34
+ * Copyright (c) Olaf Ennen
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE.md file in the root directory of this source tree.
38
+ *
39
+ * @license MIT
40
+ */
41
+ t.exports=process.env.NODE_ENV===`production`?at():ot()})))();function ct(e,t,{specialCharacters:n,ignoreCase:r,locales:i,order:a}){let o=(0,st.compare)({locale:i.toString()}),s=$e({specialCharacters:n,ignoreCase:r});return Je(o(s(e),s(t)),a)}function lt(e){return t=>{switch(t.type){case`subgroup-order`:return t.groups?Ye({...t,groups:t.groups}):it;case`alphabetical`:return(n,r)=>et(e(n),e(r),t);case`line-length`:return Qe(t);case`unsorted`:return it;case`natural`:return(n,r)=>ct(e(n),e(r),t);case`custom`:return(n,r)=>rt(e(n),e(r),t);
42
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
43
+ default:throw new P(t.type)}}}let F=lt(e=>e.name);const ut=`The 'partitionByNewLine' and 'newlinesInside' options cannot be used together`;function I({partitionByNewLine:e,newlinesBetween:t,newlinesInside:n,customGroups:r,groups:i}){e&&(ft({newlinesBetween:t,groups:i}),dt({newlinesInside:n,customGroups:r,groups:i}))}function dt({newlinesInside:e,customGroups:t,groups:n}){switch(e){case`newlinesBetween`:case`ignore`:break;default:throw Error(ut)}i(),r();function r(){for(let e of t)a(e.newlinesInside)}function i(){for(let e of n)Ke(e)&&a(e.newlinesInside)}function a(e){switch(e){case void 0:case`ignore`:return;default:throw Error(ut)}}}function ft({newlinesBetween:e,groups:t}){if(e!==`ignore`||t.some(e=>qe(e)&&e.newlinesBetween!==`ignore`))throw Error(`The 'partitionByNewLine' and 'newlinesBetween' options cannot be used together`)}function pt(e){if(typeof e==`string`||Array.isArray(e))return mt(e);if(Ke(e))return mt(e.group);
44
+ /* v8 ignore else -- @preserve Exhaustive guard for unsupported group option. */
45
+ if(qe(e))return null;
46
+ /* v8 ignore next -- @preserve Exhaustive guard for unsupported group option. */
47
+ throw new P(e)}function mt(e){return typeof e==`string`?e:null}function ht(e,t){let{customGroups:n,groups:r}=e,i=r[t],a=i?pt(i):null,o=n.find(e=>a===e.groupName),s={...e};if(i&&Ke(i)){let{newlinesInside:e,commentAbove:t,fallbackSort:n,group:r,...a}=i;s={...s,...a,fallbackSort:{...s.fallbackSort,...n}}}if(o){let{elementNamePattern:e,newlinesInside:t,fallbackSort:n,groupName:r,...i}=o;s={...s,...i,fallbackSort:{...s.fallbackSort,...n}}}return s}function L(e){return t=>ht(e,t)}function R(e){if(_t(e)&&e.alphabet.length===0)throw Error("`alphabet` option must not be empty")}function gt(e){return e?e.filter(Ke).some(e=>e.type===`custom`):!1}function _t(e){return e.type===`custom`||gt(e.groups)}function vt(e,t){let n=[];function r(i,a){if(a.length===t)n.push([...a]);else for(let t=i;t<e.length;t++)a.push(e[t]),r(t+1,a),a.pop()}return r(0,[]),n}function yt({selectors:e,modifiers:t,cache:n}){let r=`${t.join(`&`)}/${e.join(`&`)}`,i=n.get(r);if(i)return i;let a=[];for(let e=t.length;e>0;e--)a.push(...vt(t,e));let o=a.flatMap(e=>bt(e)),s=[];for(let t of e)s.push(...o.map(e=>[...e,t].join(`-`)),t);return n.set(r,s),s}function bt(e){let t=[];function n(t,n){let r=e[t];e[t]=e[n],e[n]=r}function r(i){if(i===e.length)t.push([...e]);else for(let t=i;t<e.length;t++)n(i,t),r(i+1),n(i,t)}return r(0),t}function xt({sourceCode:e,node:t}){switch(t.id.type){case N.AST_NODE_TYPES.ObjectPattern:case N.AST_NODE_TYPES.ArrayPattern:return e.text.slice(...t.id.range);case N.AST_NODE_TYPES.Identifier:return t.id.name;
48
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
49
+ default:throw new P(t.id)}}function St({allNamesMatchPattern:e,nodeNames:t}){return!e||t.every(t=>Re(t,e))}function Ct({matchedAstSelectors:e,matchesAstSelector:t}){return!t||e.has(t)}function wt({matchedAstSelectors:e,nodeNames:t,options:n}){return!n.useConfigurationIf||St({allNamesMatchPattern:n.useConfigurationIf.allNamesMatchPattern,nodeNames:t})&&Ct({matchesAstSelector:n.useConfigurationIf.matchesAstSelector,matchedAstSelectors:e})}function Tt({matchedAstSelectors:e,sourceCode:t,context:n,node:r}){let i=r.declarations.map(e=>xt({node:e,sourceCode:t}));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:i,options:t}))}function Et(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set;function i(a,o){if(!r.has(a)){if(n.has(a)){let e=o.indexOf(a);
50
+ /* v8 ignore else -- @preserve Visiting path already contains the element when this branch executes. */
51
+ if(e!==-1)for(let n of o.slice(e))t.add(n)}else{n.add(a),o.push(a);for(let t of a.dependencies){let n=e.filter(e=>e!==a).find(e=>e.dependencyNames.includes(t));
52
+ /* v8 ignore next -- @preserve Dependencies are pre-filtered; missing entries are defensive fallback. */
53
+ n&&i(n,[...o])}n.delete(a),r.add(a)}}}for(let t of e)r.has(t)||i(t,[]);return t}function Dt(e,t){return e!==t&&e.dependencyNames.some(e=>t.dependencies.includes(e))}function Ot(e,t){let n=Et(e),r=[],i=/* @__PURE__ */ new Set;function a(o){if(i.has(o))return;let s=e.filter(e=>!n.has(e)).filter(e=>Dt(e,o));for(let e of s)(!t.ignoreEslintDisabledNodes||!e.isEslintDisabled)&&a(e);i.add(o),r.push(o)}for(let t of e)a(t);return r}let kt=[`eslint-disable`,`eslint-enable`,`eslint-disable-line`,`eslint-disable-next-line`];function At(e){let t=Mt(e);for(let e of kt){let n=jt(t,e);if(n)return{eslintDisableDirective:e,rules:n}}return null}function jt(e,t){if(t===e)return`all`;let n=new RegExp(String.raw`^${t} ((?:.|\s)*)$`),r=e.match(n)?.[1];return r?r.split(`,`).map(e=>e.trim()).filter(e=>!!e):null}function Mt(e){let t=/\s-{2,}\s/u.exec(e);return t?e.slice(0,t.index).trim():e.trim()}function z(e){let{sourceCode:t,ruleName:n}=e,r=[],i=null;for(let e of t.getAllComments()){let t=At(e.value);if(t&&(t.rules===`all`||t.rules.includes(n)))switch(t.eslintDisableDirective){case`eslint-disable-next-line`:r.push(e.loc.end.line+1);continue;case`eslint-disable-line`:r.push(e.loc.start.line);continue;case`eslint-disable`:i??=e.loc.start.line;break;case`eslint-enable`:
54
+ /* v8 ignore next -- @preserve Hard to cover in test without raising another ESLint error. */
55
+ if(!i)continue;r.push(...Nt(i+1,e.loc.start.line)),i=null;break;
56
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
57
+ default:throw new P(t.eslintDisableDirective)}}return r}function Nt(e,t){return Array.from({length:t-e+1},(t,n)=>e+n)}function B(e){return`anyOf`in e.customGroup?e.customGroup.anyOf.some(t=>Pt({...e,customGroup:t})):Pt({...e,customGroup:e.customGroup})}function Pt({decoratorNames:e,elementValue:t,customGroup:n,elementName:r,selectors:i,modifiers:a}){if(n.selector&&!i?.includes(n.selector))return!1;if(n.modifiers){for(let e of n.modifiers)if(!a?.includes(e))return!1}if(`elementNamePattern`in n&&n.elementNamePattern&&!Re(r,n.elementNamePattern)||`elementValuePattern`in n&&n.elementValuePattern&&!Re(t??``,n.elementValuePattern))return!1;if(`decoratorNamePattern`in n&&n.decoratorNamePattern){let t=n.decoratorNamePattern;if(!e?.some(e=>Re(e,t)))return!1}return!0}function V(e,t){return t.includes(e.loc.start.line)}function Ft(e){return e.flatMap(e=>It(e))}function It(e){if(typeof e==`string`||Array.isArray(e))return Lt(e);if(Ke(e))return Lt(e.group);
58
+ /* v8 ignore else -- @preserve Exhaustive guard for unsupported group option. */
59
+ if(qe(e))return[];
60
+ /* v8 ignore next -- @preserve Exhaustive guard for unsupported group option. */
61
+ throw new P(e)}function Lt(e){return typeof e==`string`?[e]:e}function Rt({groups:e}){let t=!1;for(let n of e){let[e]=Ft([n]);if(e)t=!1;else{if(t)throw Error("Consecutive `newlinesBetween` objects are not allowed");t=!0}}}function zt({groups:e}){let t=Ft(e),n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set;for(let e of t)n.has(e)?r.add(e):n.add(e);if(r.size>0)throw Error(`Duplicated group(s): ${[...r].join(`, `)}`)}function H({selectors:e,modifiers:t,options:n}){let r=new Set(n.customGroups.map(e=>e.groupName)),i=Ft(n.groups).filter(n=>!Bt(e,t,n)&&!r.has(n));if(i.length>0)throw Error(`Invalid group(s): ${i.join(`, `)}`);zt(n),Rt(n)}function Bt(e,t,n){if(n===`unknown`)return!0;let r=n.split(`-`),i=Vt({allowedValues:e,elementsSeparatedWithDash:r});if(!i)return!1;let a=r.slice(0,-i.wordCount),o=/* @__PURE__ */ new Set;for(;a.length>0;){let e=Vt({elementsSeparatedWithDash:a,allowedValues:t});if(!e||o.has(e.word))return!1;o.add(e.word),a=a.slice(0,-e.wordCount)}return!0}function Vt({elementsSeparatedWithDash:e,allowedValues:t}){return[{word:e.slice(-3).join(`-`),wordCount:3},{word:e.slice(-2).join(`-`),wordCount:2},{word:e.at(-1),wordCount:1}].filter(({wordCount:t})=>e.length>=t).find(({word:e})=>e&&t.includes(e))||null}function Ht(e,t){for(let n=e.length,r=0;r<n;r++){let n=e[r];if(Ut(n,t.group))return r}return e.length}function Ut(e,t){if(typeof e==`string`||Array.isArray(e))return Wt(e,t);if(Ke(e))return Wt(e.group,t);
62
+ /* v8 ignore else -- @preserve Exhaustive guard: other directives are filtered out earlier. */
63
+ if(qe(e))return!1;
64
+ /* v8 ignore next -- @preserve Exhaustive guard: other directives are filtered out earlier. */
65
+ throw new P(e)}function Wt(e,t){return typeof e==`string`?e===t:e.includes(t)}function Gt(e,t){let n=e(t);return n===it?[]:[n,e({...t,...t.fallbackSort})]}function Kt({comparatorByOptionsComputer:e,ignoreEslintDisabledNodes:t,isNodeIgnored:n,options:r,nodes:i}){let a=[],o=[];for(let[e,r]of i.entries())t&&r.isEslintDisabled||n?.(r)?o.push(e):a.push(r);let s=Gt(e,r),c=[...a].toSorted((e,t)=>{for(let n of s){let r=n(e,t);if(r)return r}return 0});for(let e of o)c.splice(e,0,i[e]);return c}function U({comparatorByOptionsComputer:e,optionsByGroupIndexComputer:t,ignoreEslintDisabledNodes:n,isNodeIgnoredForGroup:r,isNodeIgnored:i,groups:a,nodes:o}){let s={},c=[];for(let[e,t]of o.entries()){if(n&&t.isEslintDisabled||i?.(t)){c.push(e);continue}let r=Ht(a,t);s[r]??=[],s[r].push(t)}let l=[],u=Object.keys(s).toSorted((e,t)=>Number(e)-Number(t));for(let n of u){let i=Number(n),a=t(i),o=s[i],c=new Set(o.filter(e=>r?.({groupOptions:a,groupIndex:i,node:e})));l.push(...Kt({isNodeIgnored:e=>c.has(e),ignoreEslintDisabledNodes:!1,comparatorByOptionsComputer:e,nodes:o,options:a}))}for(let e of c)l.splice(e,0,o[e]);return l}function qt({tokenValueToIgnoreBefore:e,sourceCode:t,node:n}){let r=Jt(t,n),i=t.getTokenBefore(n);return!e||r.length>0||i?.value!==e?r:Jt(t,i)}function Jt(e,t){return e.getCommentsBefore(t).filter(e=>!Yt(e)).filter(t=>e.getTokenBefore(t)?.loc.end.line!==t.loc.start.line)}function Yt(e){return e.type===`Shebang`||e.type===`Hashbang`}function Xt({rightGroupIndex:e,leftGroupIndex:t,sortingNode:n,sourceCode:r,options:i}){if(t!==null&&t>=e)return null;let a=i.groups[e];if(!a||!Ke(a))return null;let o=a.commentAbove;return o?{comment:o,exists:!!qt({node:n.node,sourceCode:r}).find(e=>Zt(e.value,o))}:null}function Zt(e,t){return e.toLowerCase().includes(t.toLowerCase().trim())}function Qt({nextNodeGroupIndex:e,nodeGroupIndex:t,options:n}){return t===e?en({groupIndex:t,options:n}):e>=t+2?$t({nextNodeGroupIndex:e,nodeGroupIndex:t,options:n}):n.newlinesBetween}function $t({nextNodeGroupIndex:e,nodeGroupIndex:t,options:n}){if(e===t+2){let e=n.groups[t+1];return qe(e)?e.newlinesBetween:n.newlinesBetween}let r=tn(n.groups.slice(t,e+1),n.newlinesBetween),i=new Set(r.filter(qe).map(e=>e.newlinesBetween)),a=[...i].filter(e=>typeof e==`number`),o=a.length>0?Math.max(...a):null;return o!==null&&o>=1?o:i.has(`ignore`)?`ignore`:0}function en({groupIndex:e,options:t}){let n=s(),r=t.groups[e];if(!r)return n;let i=pt(r),a=t.customGroups.find(e=>e.groupName===i),o=Ke(r)?r.newlinesInside:null;return a?.newlinesInside??o??n;function s(){switch(t.newlinesInside){case`newlinesBetween`:return t.newlinesBetween===`ignore`?`ignore`:0;case`ignore`:return`ignore`;default:return t.newlinesInside}}}function tn(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(!qe(i)){let i=e[r-1];i&&!qe(i)&&n.push({newlinesBetween:t})}n.push(i)}return n}function nn(e,t,n){return e.lines.slice(t.node.loc.end.line,n.node.loc.start.line-1).filter(e=>e.trim().length===0).length}function rn({newlinesBetweenValueGetter:e,missedSpacingError:t,extraSpacingError:n,rightGroupIndex:r,leftGroupIndex:i,sourceCode:a,options:o,right:s,left:c}){if(i>r||c.partitionId!==s.partitionId)return[];let l=Qt({nextNodeGroupIndex:r,nodeGroupIndex:i,options:o});if(l=e?.({computedNewlinesBetween:l,right:s,left:c})??l,l===`ignore`)return[];let u=nn(a,c,s);return u<l?[t]:u>l?[n]:[]}function an(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of e.entries())t.set(r,n);return t}function on({sourceCode:e,fixes:t}){if(t.length<2)return t;let n=t.toSorted((e,t)=>e.range[0]-t.range[0]||e.range[1]-t.range[1]),[r]=n.at(0).range,[,i]=n.at(-1).range,a=r,o=``;for(let r of n){let[n,i]=r.range;if(n<a)return t;o+=e.text.slice(a,n)+r.text,a=i}return{range:[r,i],text:o}}function sn({partitionByComment:e,comment:t}){if(!e||At(t.value))return!1;let n=t.value.trim();if(typeof e==`boolean`||typeof e==`string`||Array.isArray(e))return cn({partitionByComment:e,trimmedComment:n});let r;return t.type===`Block`&&`block`in e&&(r=e.block),t.type===`Line`&&`line`in e&&(r=e.line),r!==void 0&&cn({partitionByComment:r,trimmedComment:n})}function cn({partitionByComment:e,trimmedComment:t}){return typeof e==`boolean`?e:Re(t,e)}var ln=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t={ArrayExpression:[`elements`],ArrayPattern:[`elements`],ArrowFunctionExpression:[`params`,`body`],AssignmentExpression:[`left`,`right`],AssignmentPattern:[`left`,`right`],AwaitExpression:[`argument`],BinaryExpression:[`left`,`right`],BlockStatement:[`body`],BreakStatement:[`label`],CallExpression:[`callee`,`arguments`],CatchClause:[`param`,`body`],ChainExpression:[`expression`],ClassBody:[`body`],ClassDeclaration:[`id`,`superClass`,`body`],ClassExpression:[`id`,`superClass`,`body`],ConditionalExpression:[`test`,`consequent`,`alternate`],ContinueStatement:[`label`],DebuggerStatement:[],DoWhileStatement:[`body`,`test`],EmptyStatement:[],ExperimentalRestProperty:[`argument`],ExperimentalSpreadProperty:[`argument`],ExportAllDeclaration:[`exported`,`source`],ExportDefaultDeclaration:[`declaration`],ExportNamedDeclaration:[`declaration`,`specifiers`,`source`],ExportSpecifier:[`exported`,`local`],ExpressionStatement:[`expression`],ForInStatement:[`left`,`right`,`body`],ForOfStatement:[`left`,`right`,`body`],ForStatement:[`init`,`test`,`update`,`body`],FunctionDeclaration:[`id`,`params`,`body`],FunctionExpression:[`id`,`params`,`body`],Identifier:[],IfStatement:[`test`,`consequent`,`alternate`],ImportDeclaration:[`specifiers`,`source`],ImportDefaultSpecifier:[`local`],ImportExpression:[`source`],ImportNamespaceSpecifier:[`local`],ImportSpecifier:[`imported`,`local`],JSXAttribute:[`name`,`value`],JSXClosingElement:[`name`],JSXClosingFragment:[],JSXElement:[`openingElement`,`children`,`closingElement`],JSXEmptyExpression:[],JSXExpressionContainer:[`expression`],JSXFragment:[`openingFragment`,`children`,`closingFragment`],JSXIdentifier:[],JSXMemberExpression:[`object`,`property`],JSXNamespacedName:[`namespace`,`name`],JSXOpeningElement:[`name`,`attributes`],JSXOpeningFragment:[],JSXSpreadAttribute:[`argument`],JSXSpreadChild:[`expression`],JSXText:[],LabeledStatement:[`label`,`body`],Literal:[],LogicalExpression:[`left`,`right`],MemberExpression:[`object`,`property`],MetaProperty:[`meta`,`property`],MethodDefinition:[`key`,`value`],NewExpression:[`callee`,`arguments`],ObjectExpression:[`properties`],ObjectPattern:[`properties`],PrivateIdentifier:[],Program:[`body`],Property:[`key`,`value`],PropertyDefinition:[`key`,`value`],RestElement:[`argument`],ReturnStatement:[`argument`],SequenceExpression:[`expressions`],SpreadElement:[`argument`],StaticBlock:[`body`],Super:[],SwitchCase:[`test`,`consequent`],SwitchStatement:[`discriminant`,`cases`],TaggedTemplateExpression:[`tag`,`quasi`],TemplateElement:[],TemplateLiteral:[`quasis`,`expressions`],ThisExpression:[],ThrowStatement:[`argument`],TryStatement:[`block`,`handler`,`finalizer`],UnaryExpression:[`argument`],UpdateExpression:[`argument`],VariableDeclaration:[`declarations`],VariableDeclarator:[`id`,`init`],WhileStatement:[`test`,`body`],WithStatement:[`object`,`body`],YieldExpression:[`argument`]},n=Object.keys(t);for(let e of n)Object.freeze(t[e]);Object.freeze(t);let r=/* @__PURE__ */ new Set([`parent`,`leadingComments`,`trailingComments`]);function i(e){return!r.has(e)&&e[0]!==`_`}function a(e){return Object.keys(e).filter(i)}function o(e){let n=Object.assign({},t);for(let t of Object.keys(e))if(Object.prototype.hasOwnProperty.call(n,t)){let r=new Set(e[t]);for(let e of n[t])r.add(e);n[t]=Object.freeze(Array.from(r))}else n[t]=Object.freeze(Array.from(e[t]));return Object.freeze(n)}e.KEYS=t,e.getKeys=a,e.unionWith=o})),un=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ln();function n(e,t){let n=t.range[0],r=e,i=!1;do{i=!1;for(let e of r.childScopes){let t=e.block.range;if(t[0]<=n&&n<t[1]){r=e,i=!0;break}}}while(i);return r}function r(e,t){let r=``,i=e;for(typeof t==`string`?r=t:(r=t.name,i=n(i,t));i!=null;){let e=i.set.get(r);if(e!=null)return e;i=i.upper}return null}function i(e){return t=>!e(t)}function a(e,t){return e.type===`Punctuator`&&e.value===t}function o(e){return a(e,`=>`)}function s(e){return a(e,`,`)}function c(e){return a(e,`;`)}function l(e){return a(e,`:`)}function u(e){return a(e,`(`)}function d(e){return a(e,`)`)}function f(e){return a(e,`[`)}function p(e){return a(e,`]`)}function m(e){return a(e,`{`)}function h(e){return a(e,`}`)}function g(e){return[`Block`,`Line`,`Shebang`].includes(e.type)}let _=i(o),v=i(s),y=i(c),ee=i(l),b=i(u),te=i(d),x=i(f),ne=i(p),re=i(m),ie=i(h),ae=i(g);function oe(e,t){return e.id?t.getTokenAfter(e.id,u):t.getFirstToken(e,u)}function se(e,t){let n=e.parent,r=null,i=null;if(e.type===`ArrowFunctionExpression`){let n=t.getTokenBefore(e.body,o);r=n.loc.start,i=n.loc.end}else n&&(n.type===`Property`||n.type===`MethodDefinition`||n.type===`PropertyDefinition`)?(r=n.loc.start,i=oe(e,t).loc.start):(r=e.loc.start,i=oe(e,t).loc.start);return{start:{...r},end:{...i}}}let S=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},C=Object.freeze(/* @__PURE__ */ new Set(/* @__PURE__ */ `Array.ArrayBuffer.BigInt.BigInt64Array.BigUint64Array.Boolean.DataView.Date.decodeURI.decodeURIComponent.encodeURI.encodeURIComponent.escape.Float32Array.Float64Array.Function.Infinity.Int16Array.Int32Array.Int8Array.isFinite.isNaN.isPrototypeOf.JSON.Map.Math.NaN.Number.Object.parseFloat.parseInt.Promise.Proxy.Reflect.RegExp.Set.String.Symbol.Uint16Array.Uint32Array.Uint8Array.Uint8ClampedArray.undefined.unescape.WeakMap.WeakSet`.split(`.`))),w=new Set([Array.isArray,Array.of,Array.prototype.at,Array.prototype.concat,Array.prototype.entries,Array.prototype.every,Array.prototype.filter,Array.prototype.find,Array.prototype.findIndex,Array.prototype.flat,Array.prototype.includes,Array.prototype.indexOf,Array.prototype.join,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.slice,Array.prototype.some,Array.prototype.toString,Array.prototype.values,typeof BigInt==`function`?BigInt:void 0,Boolean,Date,Date.parse,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,escape,isFinite,isNaN,isPrototypeOf,Map,Map.prototype.entries,Map.prototype.get,Map.prototype.has,Map.prototype.keys,Map.prototype.values,...Object.getOwnPropertyNames(Math).filter(e=>e!==`random`).map(e=>Math[e]).filter(e=>typeof e==`function`),Number,Number.isFinite,Number.isNaN,Number.parseFloat,Number.parseInt,Number.prototype.toExponential,Number.prototype.toFixed,Number.prototype.toPrecision,Number.prototype.toString,Object,Object.entries,Object.is,Object.isExtensible,Object.isFrozen,Object.isSealed,Object.keys,Object.values,parseFloat,parseInt,RegExp,Set,Set.prototype.entries,Set.prototype.has,Set.prototype.keys,Set.prototype.values,String,String.fromCharCode,String.fromCodePoint,String.raw,String.prototype.at,String.prototype.charAt,String.prototype.charCodeAt,String.prototype.codePointAt,String.prototype.concat,String.prototype.endsWith,String.prototype.includes,String.prototype.indexOf,String.prototype.lastIndexOf,String.prototype.normalize,String.prototype.padEnd,String.prototype.padStart,String.prototype.slice,String.prototype.startsWith,String.prototype.substr,String.prototype.substring,String.prototype.toLowerCase,String.prototype.toString,String.prototype.toUpperCase,String.prototype.trim,String.prototype.trimEnd,String.prototype.trimLeft,String.prototype.trimRight,String.prototype.trimStart,Symbol.for,Symbol.keyFor,unescape].filter(e=>typeof e==`function`)),ce=/* @__PURE__ */ new Set([Object.freeze,Object.preventExtensions,Object.seal]),le=[[Map,/* @__PURE__ */ new Set([`size`])],[RegExp,/* @__PURE__ */ new Set([`dotAll`,`flags`,`global`,`hasIndices`,`ignoreCase`,`multiline`,`source`,`sticky`,`unicode`])],[Set,/* @__PURE__ */ new Set([`size`])]];function ue(e,t){let n=e;for(;(typeof n==`object`||typeof n==`function`)&&n!==null;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Object.getPrototypeOf(n)}return null}function de(e,t){let n=ue(e,t);return n!=null&&n.get!=null}function fe(e,t){let n=[];for(let r=0;r<e.length;++r){let i=e[r];if(i==null)n.length=r+1;else if(i.type===`SpreadElement`){let e=T(i.argument,t);if(e==null)return null;n.push(...e.value)}else{let e=T(i,t);if(e==null)return null;n.push(e.value)}}return n}function pe(e){return e!=null&&e.defs.length===0&&C.has(e.name)&&e.name in S}function me(e){if(e.defs.length!==1)return!1;let t=e.defs[0];return!(!t.parent||t.type!==`Variable`||t.parent.kind!==`const`&&!he(e))}function he(e){let t=e.references,n=t.filter(e=>e.init).length,r=t.filter(e=>e.isReadOnly()).length;return n===1&&r+n===t.length}function ge(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&e.parent.type===`MemberExpression`;)e=e.parent;if(e&&e.parent&&(e.parent.type===`AssignmentExpression`&&e.parent.left===e||e.parent.type===`UpdateExpression`&&e.parent.argument===e||e.parent.type===`CallExpression`&&e.parent.callee===e&&e.type===`MemberExpression`&&n(ve(e,t))))return!0}return!1;function n(e){if(e==null||e.value==null)return!1;let t=e.value;return t===`copyWithin`||t===`fill`||t===`pop`||t===`push`||t===`reverse`||t===`shift`||t===`sort`||t===`splice`||t===`unshift`}}let _e=Object.freeze({ArrayExpression(e,t){let n=fe(e.elements,t);return n==null?null:{value:n}},AssignmentExpression(e,t){return e.operator===`=`?T(e.right,t):null},BinaryExpression(e,t){if(e.operator===`in`||e.operator===`instanceof`)return null;let n=T(e.left,t),r=T(e.right,t);if(n!=null&&r!=null)switch(e.operator){case`==`:return{value:n.value==r.value};case`!=`:return{value:n.value!=r.value};case`===`:return{value:n.value===r.value};case`!==`:return{value:n.value!==r.value};case`<`:return{value:n.value<r.value};case`<=`:return{value:n.value<=r.value};case`>`:return{value:n.value>r.value};case`>=`:return{value:n.value>=r.value};case`<<`:return{value:n.value<<r.value};case`>>`:return{value:n.value>>r.value};case`>>>`:return{value:n.value>>>r.value};case`+`:return{value:n.value+r.value};case`-`:return{value:n.value-r.value};case`*`:return{value:n.value*r.value};case`/`:return{value:n.value/r.value};case`%`:return{value:n.value%r.value};case`**`:return{value:n.value**r.value};case`|`:return{value:n.value|r.value};case`^`:return{value:n.value^r.value};case`&`:return{value:n.value&r.value}}return null},CallExpression(e,t){let n=e.callee,r=fe(e.arguments,t);if(r!=null){if(n.type===`MemberExpression`){if(n.property.type===`PrivateIdentifier`)return null;let i=T(n.object,t);if(i!=null){if(i.value==null&&(i.optional||e.optional))return{value:void 0,optional:!0};let a=ve(n,t);if(a!=null){let e=i.value,t=a.value;if(w.has(e[t]))return{value:e[t](...r)};if(ce.has(e[t]))return{value:r[0]}}}}else{let i=T(n,t);if(i!=null){if(i.value==null&&e.optional)return{value:void 0,optional:!0};let t=i.value;if(w.has(t))return{value:t(...r)};if(ce.has(t))return{value:r[0]}}}}return null},ConditionalExpression(e,t){let n=T(e.test,t);return n==null?null:n.value?T(e.consequent,t):T(e.alternate,t)},ExpressionStatement(e,t){return T(e.expression,t)},Identifier(e,t){if(t!=null){let n=r(t,e);if(n!=null){if(pe(n))return{value:S[n.name]};if(me(n)){let e=n.defs[0];if(e.node.id.type===`Identifier`){let r=T(e.node.init,t);return r&&typeof r.value==`object`&&r.value!==null&&ge(n,t)?null:r}}}}return null},Literal(e){let t=e;return(t.regex!=null||t.bigint!=null)&&t.value==null?null:{value:t.value}},LogicalExpression(e,t){let n=T(e.left,t);if(n!=null){if(e.operator===`||`&&n.value||e.operator===`&&`&&!n.value||e.operator===`??`&&n.value!=null)return n;let r=T(e.right,t);if(r!=null)return r}return null},MemberExpression(e,t){if(e.property.type===`PrivateIdentifier`)return null;let n=T(e.object,t);if(n!=null){if(n.value==null&&(n.optional||e.optional))return{value:void 0,optional:!0};let r=ve(e,t);if(r!=null){if(!de(n.value,r.value))return{value:n.value[r.value]};for(let[e,t]of le)if(n.value instanceof e&&t.has(r.value))return{value:n.value[r.value]}}}return null},ChainExpression(e,t){let n=T(e.expression,t);return n==null?null:{value:n.value}},NewExpression(e,t){let n=T(e.callee,t),r=fe(e.arguments,t);if(n!=null&&r!=null){let e=n.value;if(w.has(e))return{value:new e(...r)}}return null},ObjectExpression(e,t){let n={};for(let r of e.properties)if(r.type===`Property`){if(r.kind!==`init`)return null;let e=ve(r,t),i=T(r.value,t);if(e==null||i==null)return null;n[e.value]=i.value}else if(r.type===`SpreadElement`||r.type===`ExperimentalSpreadProperty`){let e=T(r.argument,t);if(e==null)return null;Object.assign(n,e.value)}else return null;return{value:n}},SequenceExpression(e,t){let n=e.expressions[e.expressions.length-1];return T(n,t)},TaggedTemplateExpression(e,t){let n=T(e.tag,t),r=fe(e.quasi.expressions,t);if(n!=null&&r!=null){let t=n.value,i=e.quasi.quasis.map(e=>e.value.cooked);if(i.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(i,...r)}}return null},TemplateLiteral(e,t){let n=fe(e.expressions,t);if(n!=null){let t=e.quasis[0].value.cooked;for(let r=0;r<n.length;++r)t+=n[r],t+=e.quasis[r+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if(e.operator===`delete`)return null;if(e.operator===`void`)return{value:void 0};let n=T(e.argument,t);if(n!=null)switch(e.operator){case`-`:return{value:-n.value};case`+`:return{value:+n.value};case`!`:return{value:!n.value};case`~`:return{value:~n.value};case`typeof`:return{value:typeof n.value}}return null},TSAsExpression(e,t){return T(e.expression,t)},TSSatisfiesExpression(e,t){return T(e.expression,t)},TSTypeAssertion(e,t){return T(e.expression,t)},TSNonNullExpression(e,t){return T(e.expression,t)},TSInstantiationExpression(e,t){return T(e.expression,t)}});function T(e,t){return e!=null&&Object.hasOwnProperty.call(_e,e.type)?_e[e.type](e,t):null}function ve(e,t){let n=e.type===`Property`?e.key:e.property;return e.computed?T(n,t):n.type===`Identifier`?{value:n.name}:n.type===`Literal`?n.bigint?{value:n.bigint}:{value:String(n.value)}:null}function ye(e,t=null){try{return T(e,t)}catch{return null}}function be(e,t=null){if(e&&e.type===`Literal`&&e.value===null){let t=e;if(t.regex)return`/${t.regex.pattern}/${t.regex.flags}`;if(t.bigint)return t.bigint}let n=ye(e,t);if(n)try{return String(n.value)}catch{}return null}function xe(e,t){switch(e.type){case`MemberExpression`:return e.computed?be(e.property,t):e.property.type===`PrivateIdentifier`?null:e.property.name;case`Property`:case`MethodDefinition`:case`PropertyDefinition`:return e.computed?be(e.key,t):e.key.type===`Literal`?String(e.key.value):e.key.type===`PrivateIdentifier`?null:e.key.name}return null}function E(e,t){let n=e.parent;if(!n)return``;let r=[],i=n.type===`Property`&&n.value===e,a=n.type===`MethodDefinition`&&n.value===e,o=n.type===`PropertyDefinition`&&n.value===e;if((a||o)&&(n.static&&r.push(`static`),n.key.type===`PrivateIdentifier`&&r.push(`private`)),e.async&&r.push(`async`),e.generator&&r.push(`generator`),i||a){if(n.kind===`constructor`)return`constructor`;n.kind===`get`?r.push(`getter`):n.kind===`set`?r.push(`setter`):r.push(`method`)}else o?r.push(`method`):(e.type===`ArrowFunctionExpression`&&r.push(`arrow`),r.push(`function`));if(i||a||o){if(n.key.type===`PrivateIdentifier`)r.push(`#${n.key.name}`);else{let e=xe(n);if(e)r.push(`'${e}'`);else if(t){let e=t.getText(n.key);e.includes(`
66
+ `)||r.push(`[${e}]`)}}}else Se(e)?r.push(`'${e.id.name}'`):n.type===`VariableDeclarator`&&n.id&&n.id.type===`Identifier`?r.push(`'${n.id.name}'`):(n.type===`AssignmentExpression`||n.type===`AssignmentPattern`)&&n.left&&n.left.type===`Identifier`?r.push(`'${n.left.name}'`):n.type===`ExportDefaultDeclaration`&&n.declaration===e&&r.push(`'default'`);return r.join(` `)}function Se(e){return!!e.id}let D=Object.freeze(/* @__PURE__ */ new Set([`==`,`!=`,`<`,`<=`,`>`,`>=`,`<<`,`>>`,`>>>`,`+`,`-`,`*`,`/`,`%`,`|`,`^`,`&`,`in`])),O=Object.freeze(/* @__PURE__ */ new Set([`-`,`+`,`!`,`~`]));function k(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}let Ce=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,n){let{type:r}=e;return typeof this[r]==`function`?this[r](e,t,n):this.$visitChildren(e,t,n)},$visitChildren(e,n,r){let{type:i}=e;for(let a of r[i]||t.getKeys(e)){let t=e[a];if(Array.isArray(t)){for(let e of t)if(k(e)&&this.$visit(e,n,r))return!0}else if(k(t)&&this.$visit(t,n,r))return!0}return!1},ArrowFunctionExpression(){return!1},AssignmentExpression(){return!0},AwaitExpression(){return!0},BinaryExpression(e,t,n){return t.considerImplicitTypeConversion&&D.has(e.operator)&&(e.left.type!==`Literal`||e.right.type!==`Literal`)?!0:this.$visitChildren(e,t,n)},CallExpression(){return!0},FunctionExpression(){return!1},ImportExpression(){return!0},MemberExpression(e,t,n){return t.considerGetters||t.considerImplicitTypeConversion&&e.computed&&e.property.type!==`Literal`?!0:this.$visitChildren(e,t,n)},MethodDefinition(e,t,n){return t.considerImplicitTypeConversion&&e.computed&&e.key.type!==`Literal`?!0:this.$visitChildren(e,t,n)},NewExpression(){return!0},Property(e,t,n){return t.considerImplicitTypeConversion&&e.computed&&e.key.type!==`Literal`?!0:this.$visitChildren(e,t,n)},PropertyDefinition(e,t,n){return t.considerImplicitTypeConversion&&e.computed&&e.key.type!==`Literal`?!0:this.$visitChildren(e,t,n)},UnaryExpression(e,t,n){return e.operator===`delete`||t.considerImplicitTypeConversion&&O.has(e.operator)&&e.argument.type!==`Literal`?!0:this.$visitChildren(e,t,n)},UpdateExpression(){return!0},YieldExpression(){return!0}}));function we(e,n,r={}){let{considerGetters:i=!1,considerImplicitTypeConversion:a=!1}=r;return Ce.$visit(e,{considerGetters:i,considerImplicitTypeConversion:a},n.visitorKeys||t.KEYS)}function Te(e,t){let n=e.parent;if(!n)return null;switch(n.type){case`CallExpression`:case`NewExpression`:return n.arguments.length===1&&n.arguments[0]===e?t.getTokenAfter(n.typeArguments||n.typeParameters||n.callee,u):null;case`DoWhileStatement`:return n.test===e?t.getTokenAfter(n.body,u):null;case`IfStatement`:case`WhileStatement`:return n.test===e?t.getFirstToken(n,1):null;case`ImportExpression`:return n.source===e?t.getFirstToken(n,1):null;case`SwitchStatement`:return n.discriminant===e?t.getFirstToken(n,1):null;case`WithStatement`:return n.object===e?t.getFirstToken(n,1):null;default:return null}}function Ee(e,t,n){let r,i,a,o,s;if(typeof e==`number`){if(r=e|0,i=t,a=n,!(r>=1))throw TypeError(`'times' should be a positive integer.`)}else r=1,i=e,a=t;if(i==null||i.parent==null||i.parent.type===`CatchClause`&&i.parent.param===i)return!1;o=s=i;do o=a.getTokenBefore(o),s=a.getTokenAfter(s);while(o!=null&&s!=null&&u(o)&&d(s)&&o!==Te(i,a)&&--r>0);return r===0}let A=/\$(?:[$&`']|[1-9][0-9]?)/gu,j=/* @__PURE__ */ new WeakMap;function De(e,t){let n=!1;for(let r=t-1;r>=0&&e.charCodeAt(r)===92;--r)n=!n;return n}function Oe(e,t,n){let r=[],i=0;function a(e,n){switch(e){case`$$`:return`$`;case`$&`:return n[0];case"$`":return t.slice(0,n.index);case`$'`:return t.slice(n.index+n[0].length);default:{let t=e.slice(1);return t in n?n[t]:e}}}for(let o of e.execAll(t))r.push(t.slice(i,o.index)),r.push(n.replace(A,e=>a(e,o))),i=o.index+o[0].length;return r.push(t.slice(i)),r.join(``)}function ke(e,t,n){let r=[],i=0;for(let a of e.execAll(t))r.push(t.slice(i,a.index)),r.push(String(n(...a,a.index,a.input))),i=a.index+a[0].length;return r.push(t.slice(i)),r.join(``)}var Ae=class{constructor(e,t={}){let{escaped:n=!1}=t;if(!(e instanceof RegExp))throw TypeError(`'pattern' should be a RegExp instance.`);if(!e.flags.includes(`g`))throw Error(`'pattern' should contains 'g' flag.`);j.set(this,{pattern:new RegExp(e.source,e.flags),escaped:!!n})}*execAll(e){let{pattern:t,escaped:n}=j.get(this),r=null,i=0;for(t.lastIndex=0;(r=t.exec(e))!=null;)(n||!De(e,r.index))&&(i=t.lastIndex,yield r,t.lastIndex=i)}test(e){return!this.execAll(e).next().done}[Symbol.replace](e,t){return typeof t==`function`?ke(this,String(e),t):Oe(this,String(e),String(t))}};let je=/^(?:Import|Export(?:All|Default|Named))Declaration$/u;function Me(e){return je.test(e.type)&&e.source!=null}let Ne=Function.call.bind(Object.hasOwnProperty),M=Symbol(`read`),Pe=Symbol(`call`),Fe=Symbol(`construct`),Ie=Symbol(`esm`),N={require:{[Pe]:!0}};function Le(e){return e==null||e.defs.length!==0||e.references.some(e=>e.isWrite())}function Re(e){let t=e.parent;if(t)switch(t.type){case`ConditionalExpression`:return t.consequent===e||t.alternate===e;case`LogicalExpression`:return!0;case`SequenceExpression`:return t.expressions[t.expressions.length-1]===e;case`ChainExpression`:return!0;case`TSAsExpression`:case`TSSatisfiesExpression`:case`TSTypeAssertion`:case`TSNonNullExpression`:case`TSInstantiationExpression`:return!0;default:return!1}return!1}var ze=class{constructor(e,t={}){let{mode:n=`strict`,globalObjectNames:r=[`global`,`globalThis`,`self`,`window`]}=t;this.variableStack=[],this.globalScope=e,this.mode=n,this.globalObjectNames=r.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let n=e[t],r=[t],i=this.globalScope.set.get(t);Le(i)||(yield*this._iterateVariableReferences(i,r,n,!0))}for(let t of this.globalObjectNames){let n=[],r=this.globalScope.set.get(t);Le(r)||(yield*this._iterateVariableReferences(r,n,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(N)){let n=be(t.arguments[0]);if(n==null||!Ne(e,n))continue;let r=e[n],i=[n];r[M]&&(yield{node:t,path:i,type:M,info:r[M]}),yield*this._iteratePropertyReferences(t,i,r)}}*iterateEsmReferences(e){let t=this.globalScope.block;for(let n of t.body){if(!Me(n))continue;let t=n.source.value;if(!Ne(e,t))continue;let r=e[t],i=[t];if(r[M]&&(yield{node:n,path:i,type:M,info:r[M]}),n.type===`ExportAllDeclaration`)for(let e of Object.keys(r)){let t=r[e];t[M]&&(yield{node:n,path:i.concat(e),type:M,info:t[M]})}else for(let e of n.specifiers){let t=Ne(r,Ie),n=this._iterateImportReferences(e,i,t?r:this.mode===`legacy`?{default:r,...r}:{default:r});if(t)yield*n;else for(let e of n)e.path=e.path.filter(Be),(e.path.length>=2||e.type!==M)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,n,r){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let i of e.references){if(!i.isRead())continue;let e=i.identifier;r&&n[M]&&(yield{node:e,path:t,type:M,info:n[M]}),yield*this._iteratePropertyReferences(e,t,n)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,n){let r=e;for(;Re(r);)r=r.parent;let i=r.parent;if(i){if(i.type===`MemberExpression`){if(i.object===r){let e=xe(i);if(e==null||!Ne(n,e))return;t=t.concat(e);let r=n[e];r[M]&&(yield{node:i,path:t,type:M,info:r[M]}),yield*this._iteratePropertyReferences(i,t,r)}}else i.type===`CallExpression`?i.callee===r&&n[Pe]&&(yield{node:i,path:t,type:Pe,info:n[Pe]}):i.type===`NewExpression`?i.callee===r&&n[Fe]&&(yield{node:i,path:t,type:Fe,info:n[Fe]}):i.type===`AssignmentExpression`?i.right===r&&(yield*this._iterateLhsReferences(i.left,t,n),yield*this._iteratePropertyReferences(i,t,n)):i.type===`AssignmentPattern`?i.right===r&&(yield*this._iterateLhsReferences(i.left,t,n)):i.type===`VariableDeclarator`&&i.init===r&&(yield*this._iterateLhsReferences(i.id,t,n))}}*_iterateLhsReferences(e,t,n){if(e.type===`Identifier`){let i=r(this.globalScope,e);i!=null&&(yield*this._iterateVariableReferences(i,t,n,!1))}else if(e.type===`ObjectPattern`)for(let r of e.properties){let e=xe(r);if(e==null||!Ne(n,e))continue;let i=t.concat(e),a=n[e];a[M]&&(yield{node:r,path:i,type:M,info:a[M]}),yield*this._iterateLhsReferences(r.value,i,a)}else e.type===`AssignmentPattern`&&(yield*this._iterateLhsReferences(e.left,t,n))}*_iterateImportReferences(e,t,n){let i=e.type;if(i===`ImportSpecifier`||i===`ImportDefaultSpecifier`){let a=i===`ImportDefaultSpecifier`?`default`:e.imported.type===`Identifier`?e.imported.name:e.imported.value;if(!Ne(n,a))return;t=t.concat(a);let o=n[a];o[M]&&(yield{node:e,path:t,type:M,info:o[M]}),yield*this._iterateVariableReferences(r(this.globalScope,e.local),t,o,!1)}else if(i===`ImportNamespaceSpecifier`)yield*this._iterateVariableReferences(r(this.globalScope,e.local),t,n,!1);else if(i===`ExportSpecifier`){let r=e.local.type===`Identifier`?e.local.name:e.local.value;if(!Ne(n,r))return;t=t.concat(r);let i=n[r];i[M]&&(yield{node:e,path:t,type:M,info:i[M]})}}};ze.READ=M,ze.CALL=Pe,ze.CONSTRUCT=Fe,ze.ESM=Ie;function Be(e,t){return t!==1||e!=="default"}var Ve={CALL:Pe,CONSTRUCT:Fe,ESM:Ie,findVariable:r,getFunctionHeadLocation:se,getFunctionNameWithKind:E,getInnermostScope:n,getPropertyName:xe,getStaticValue:ye,getStringIfConstant:be,hasSideEffect:we,isArrowToken:o,isClosingBraceToken:h,isClosingBracketToken:p,isClosingParenToken:d,isColonToken:l,isCommaToken:s,isCommentToken:g,isNotArrowToken:_,isNotClosingBraceToken:ie,isNotClosingBracketToken:ne,isNotClosingParenToken:te,isNotColonToken:ee,isNotCommaToken:v,isNotCommentToken:ae,isNotOpeningBraceToken:re,isNotOpeningBracketToken:x,isNotOpeningParenToken:b,isNotSemicolonToken:y,isOpeningBraceToken:m,isOpeningBracketToken:f,isOpeningParenToken:u,isParenthesized:Ee,isSemicolonToken:c,PatternMatcher:Ae,READ:M,ReferenceTracker:ze};e.CALL=Pe,e.CONSTRUCT=Fe,e.ESM=Ie,e.PatternMatcher=Ae,e.READ=M,e.ReferenceTracker=ze,e.default=Ve,e.findVariable=r,e.getFunctionHeadLocation=se,e.getFunctionNameWithKind=E,e.getInnermostScope=n,e.getPropertyName=xe,e.getStaticValue=ye,e.getStringIfConstant=be,e.hasSideEffect=we,e.isArrowToken=o,e.isClosingBraceToken=h,e.isClosingBracketToken=p,e.isClosingParenToken=d,e.isColonToken=l,e.isCommaToken=s,e.isCommentToken=g,e.isNotArrowToken=_,e.isNotClosingBraceToken=ie,e.isNotClosingBracketToken=ne,e.isNotClosingParenToken=te,e.isNotColonToken=ee,e.isNotCommaToken=v,e.isNotCommentToken=ae,e.isNotOpeningBraceToken=re,e.isNotOpeningBracketToken=x,e.isNotOpeningParenToken=b,e.isNotSemicolonToken=y,e.isOpeningBraceToken=m,e.isOpeningBracketToken=f,e.isOpeningParenToken=u,e.isParenthesized=Ee,e.isSemicolonToken=c})),dn=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),a=n&&n.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&r(n,t,a[o]);return i(n,t),n}})();Object.defineProperty(e,"__esModule",{value:!0}),e.isParenthesized=e.hasSideEffect=e.getStringIfConstant=e.getStaticValue=e.getPropertyName=e.getFunctionNameWithKind=e.getFunctionHeadLocation=void 0;let o=a(un());e.getFunctionHeadLocation=o.getFunctionHeadLocation,e.getFunctionNameWithKind=o.getFunctionNameWithKind,e.getPropertyName=o.getPropertyName,e.getStaticValue=o.getStaticValue,e.getStringIfConstant=o.getStringIfConstant,e.hasSideEffect=o.hasSideEffect,e.isParenthesized=o.isParenthesized})),fn=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),a=n&&n.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&r(n,t,a[o]);return i(n,t),n}})();Object.defineProperty(e,"__esModule",{value:!0}),e.PatternMatcher=void 0,e.PatternMatcher=a(un()).PatternMatcher})),pn=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),a=n&&n.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&r(n,t,a[o]);return i(n,t),n}})();Object.defineProperty(e,"__esModule",{value:!0}),e.isNotSemicolonToken=e.isSemicolonToken=e.isNotOpeningParenToken=e.isOpeningParenToken=e.isNotOpeningBracketToken=e.isOpeningBracketToken=e.isNotOpeningBraceToken=e.isOpeningBraceToken=e.isNotCommentToken=e.isCommentToken=e.isNotCommaToken=e.isCommaToken=e.isNotColonToken=e.isColonToken=e.isNotClosingParenToken=e.isClosingParenToken=e.isNotClosingBracketToken=e.isClosingBracketToken=e.isNotClosingBraceToken=e.isClosingBraceToken=e.isNotArrowToken=e.isArrowToken=void 0;let o=a(un());e.isArrowToken=o.isArrowToken,e.isNotArrowToken=o.isNotArrowToken,e.isClosingBraceToken=o.isClosingBraceToken,e.isNotClosingBraceToken=o.isNotClosingBraceToken,e.isClosingBracketToken=o.isClosingBracketToken,e.isNotClosingBracketToken=o.isNotClosingBracketToken,e.isClosingParenToken=o.isClosingParenToken,e.isNotClosingParenToken=o.isNotClosingParenToken,e.isColonToken=o.isColonToken,e.isNotColonToken=o.isNotColonToken,e.isCommaToken=o.isCommaToken,e.isNotCommaToken=o.isNotCommaToken,e.isCommentToken=o.isCommentToken,e.isNotCommentToken=o.isNotCommentToken,e.isOpeningBraceToken=o.isOpeningBraceToken,e.isNotOpeningBraceToken=o.isNotOpeningBraceToken,e.isOpeningBracketToken=o.isOpeningBracketToken,e.isNotOpeningBracketToken=o.isNotOpeningBracketToken,e.isOpeningParenToken=o.isOpeningParenToken,e.isNotOpeningParenToken=o.isNotOpeningParenToken,e.isSemicolonToken=o.isSemicolonToken,e.isNotSemicolonToken=o.isNotSemicolonToken})),mn=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),a=n&&n.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&r(n,t,a[o]);return i(n,t),n}})();Object.defineProperty(e,"__esModule",{value:!0}),e.ReferenceTracker=void 0;let o=a(un());o.ReferenceTracker.READ,o.ReferenceTracker.CALL,o.ReferenceTracker.CONSTRUCT,o.ReferenceTracker.ESM,e.ReferenceTracker=o.ReferenceTracker})),hn=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),a=n&&n.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var a=e(t),o=0;o<a.length;o++)a[o]!=="default"&&r(n,t,a[o]);return i(n,t),n}})();Object.defineProperty(e,"__esModule",{value:!0}),e.getInnermostScope=e.findVariable=void 0;let o=a(un());e.findVariable=o.findVariable,e.getInnermostScope=o.getInnermostScope})),gn=/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(dn(),e),i(fn(),e),i(pn(),e),i(mn(),e),i(hn(),e)})),_n=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isNotTokenOfTypeWithConditions=e.isTokenOfTypeWithConditions=e.isNodeOfTypeWithConditions=e.isNodeOfTypes=e.isNodeOfType=void 0,e.isNodeOfType=e=>t=>t?.type===e,e.isNodeOfTypes=e=>t=>!!t&&e.includes(t.type),e.isNodeOfTypeWithConditions=(e,t)=>{let n=Object.entries(t);return t=>t?.type===e&&n.every(([e,n])=>t[e]===n)},e.isTokenOfTypeWithConditions=(e,t)=>{let n=Object.entries(t);return t=>t?.type===e&&n.every(([e,n])=>t[e]===n)},e.isNotTokenOfTypeWithConditions=(t,n)=>r=>!(0,e.isTokenOfTypeWithConditions)(t,n)(r)})),vn=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LINEBREAK_MATCHER=void 0,e.isTokenOnSameLine=t,e.LINEBREAK_MATCHER=/\r\n|[\r\n\u2028\u2029]/;function t(e,t){return e.loc.end.line===t.loc.start.line}})),yn=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TSESTree=e.AST_TOKEN_TYPES=e.AST_NODE_TYPES=void 0;var t=Ie();Object.defineProperty(e,"AST_NODE_TYPES",{enumerable:!0,get:function(){return t.AST_NODE_TYPES}}),Object.defineProperty(e,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return t.AST_TOKEN_TYPES}}),Object.defineProperty(e,"TSESTree",{enumerable:!0,get:function(){return t.TSESTree}})})),bn=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isLoop=e.isImportKeyword=e.isTypeKeyword=e.isAwaitKeyword=e.isAwaitExpression=e.isIdentifier=e.isConstructor=e.isClassOrTypeElement=e.isTSConstructorType=e.isTSFunctionType=e.isFunctionOrFunctionType=e.isFunctionType=e.isFunction=e.isVariableDeclarator=e.isTypeAssertion=e.isLogicalOrOperator=e.isOptionalCallExpression=e.isNotNonNullAssertionPunctuator=e.isNonNullAssertionPunctuator=e.isNotOptionalChainPunctuator=e.isOptionalChainPunctuator=void 0,e.isSetter=a;let t=yn(),n=_n();e.isOptionalChainPunctuator=(0,n.isTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Punctuator,{value:`?.`}),e.isNotOptionalChainPunctuator=(0,n.isNotTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Punctuator,{value:`?.`}),e.isNonNullAssertionPunctuator=(0,n.isTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Punctuator,{value:`!`}),e.isNotNonNullAssertionPunctuator=(0,n.isNotTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Punctuator,{value:`!`}),e.isOptionalCallExpression=(0,n.isNodeOfTypeWithConditions)(t.AST_NODE_TYPES.CallExpression,{optional:!0}),e.isLogicalOrOperator=(0,n.isNodeOfTypeWithConditions)(t.AST_NODE_TYPES.LogicalExpression,{operator:`||`}),e.isTypeAssertion=(0,n.isNodeOfTypes)([t.AST_NODE_TYPES.TSAsExpression,t.AST_NODE_TYPES.TSTypeAssertion]),e.isVariableDeclarator=(0,n.isNodeOfType)(t.AST_NODE_TYPES.VariableDeclarator);let r=[t.AST_NODE_TYPES.ArrowFunctionExpression,t.AST_NODE_TYPES.FunctionDeclaration,t.AST_NODE_TYPES.FunctionExpression];e.isFunction=(0,n.isNodeOfTypes)(r);let i=[t.AST_NODE_TYPES.TSCallSignatureDeclaration,t.AST_NODE_TYPES.TSConstructorType,t.AST_NODE_TYPES.TSConstructSignatureDeclaration,t.AST_NODE_TYPES.TSDeclareFunction,t.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,t.AST_NODE_TYPES.TSFunctionType,t.AST_NODE_TYPES.TSMethodSignature];e.isFunctionType=(0,n.isNodeOfTypes)(i),e.isFunctionOrFunctionType=(0,n.isNodeOfTypes)([...r,...i]),e.isTSFunctionType=(0,n.isNodeOfType)(t.AST_NODE_TYPES.TSFunctionType),e.isTSConstructorType=(0,n.isNodeOfType)(t.AST_NODE_TYPES.TSConstructorType),e.isClassOrTypeElement=(0,n.isNodeOfTypes)([t.AST_NODE_TYPES.PropertyDefinition,t.AST_NODE_TYPES.FunctionExpression,t.AST_NODE_TYPES.MethodDefinition,t.AST_NODE_TYPES.TSAbstractPropertyDefinition,t.AST_NODE_TYPES.TSAbstractMethodDefinition,t.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,t.AST_NODE_TYPES.TSIndexSignature,t.AST_NODE_TYPES.TSCallSignatureDeclaration,t.AST_NODE_TYPES.TSConstructSignatureDeclaration,t.AST_NODE_TYPES.TSMethodSignature,t.AST_NODE_TYPES.TSPropertySignature]),e.isConstructor=(0,n.isNodeOfTypeWithConditions)(t.AST_NODE_TYPES.MethodDefinition,{kind:`constructor`});function a(e){return!!e&&(e.type===t.AST_NODE_TYPES.MethodDefinition||e.type===t.AST_NODE_TYPES.Property)&&e.kind===`set`}e.isIdentifier=(0,n.isNodeOfType)(t.AST_NODE_TYPES.Identifier),e.isAwaitExpression=(0,n.isNodeOfType)(t.AST_NODE_TYPES.AwaitExpression),e.isAwaitKeyword=(0,n.isTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Identifier,{value:`await`}),e.isTypeKeyword=(0,n.isTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Identifier,{value:`type`}),e.isImportKeyword=(0,n.isTokenOfTypeWithConditions)(t.AST_TOKEN_TYPES.Keyword,{value:`import`}),e.isLoop=(0,n.isNodeOfTypes)([t.AST_NODE_TYPES.DoWhileStatement,t.AST_NODE_TYPES.ForStatement,t.AST_NODE_TYPES.ForInStatement,t.AST_NODE_TYPES.ForOfStatement,t.AST_NODE_TYPES.WhileStatement])})),xn=/* @__PURE__ */ f((/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(gn(),e),i(_n(),e),i(vn(),e),i(bn(),e)})))(),1);function Sn({ignoreHighestBlockComment:e,implicitDecorators:t,sourceCode:n,options:r,node:i}){let a=i.range.at(0),o=i.range.at(1),s=t??(`decorators`in i?i.decorators:[]);if(s[0]){a=Math.min(a,s[0].range[0]);let t=Cn({comments:qt({node:s[0],sourceCode:n}),anchorLine:s[0].loc.start.line,ignoreHighestBlockComment:e,options:r});t!==void 0&&(a=Math.min(a,t))}if(xn.isParenthesized(i,n)){let e=n.getTokenBefore(i,xn.isOpeningParenToken),t=n.getTokenAfter(i,xn.isClosingParenToken);a=Math.min(a,e.range.at(0)),o=t.range.at(1)}let c=Cn({comments:qt({sourceCode:n,node:i}),anchorLine:i.loc.start.line,ignoreHighestBlockComment:e,options:r});return c!==void 0&&(a=Math.min(a,c)),[a,o]}function Cn({ignoreHighestBlockComment:e,anchorLine:t,comments:n,options:r}){let i=n.find(e=>e.type===`Block`),a;for(let o=n.length-1;o>=0;o--){let s=n[o];if(e&&s===i)break;let c=At(s.value);if(sn({partitionByComment:r?.partitionByComment??!1,comment:s})||c?.eslintDisableDirective===`eslint-disable`||c?.eslintDisableDirective===`eslint-enable`)break;let l=o===n.length-1?t:n[o+1].loc.start.line;if(s.loc.end.line!==l-1)break;a=s.range.at(0)}return a}function wn({newlinesBetweenValueGetter:e,sortedNodes:t,sourceCode:n,options:r,fixer:i,nodes:a}){let o=[];for(let s=0;s<t.length-1;s++){let c=a.at(s),l=a.at(s+1),u=t.at(s),d=t.at(s+1);if(u.partitionId!==d.partitionId)continue;let f=Ht(r.groups,u),p=Ht(r.groups,d);if(f>p)continue;let m=Qt({nextNodeGroupIndex:p,nodeGroupIndex:f,options:r});if(m=e?.({computedNewlinesBetween:m,right:d,left:u})??m,m===`ignore`)continue;let h=Sn({node:c.node,sourceCode:n}),g=Sn({node:l.node,sourceCode:n}).at(0);if(nn(n,c,l)===m)continue;let _=[h.at(1),g],v=n.text.slice(h.at(1),g),y=Tn({isOnSameLine:c.node.loc.end.line===l.node.loc.start.line,textBetweenNodes:v,newlinesBetween:m});o.push(i.replaceTextRange(_,y))}return o}function Tn({textBetweenNodes:e,newlinesBetween:t,isOnSameLine:n}){let r=Dn(e);if(t===0)return r;let i=r;for(let e=0;e<t;e++)i=En(i);return n?En(i):i}function En(e){let t=e.indexOf(`
67
+ `);return t===-1?`${e}\n`:`${e.slice(0,t)}\n${e.slice(t)}`}function Dn(e){return e.replaceAll(/\n\s*\n/gu,`
68
+ `).replaceAll(/\n+/gu,`
69
+ `)}function On({sortedNode:e,sourceCode:t,fixer:n,node:r}){let i=jn(e,t),a=r.loc.start.line===e.loc.end.line;if(!i||a)return[];let o=[],s=[t.getTokenBefore(i).range.at(1),i.range.at(1)];o.push(n.replaceTextRange(s,``));let c=kn({sourceCode:t,node:r}),l=An({nodeToInsertAfter:c,commentAfter:i,sourceCode:t,range:s});return o.push(n.insertTextAfter(c,l)),o}function kn({sourceCode:e,node:t}){let n=e.getTokenAfter(t);return n?.type!==`Punctuator`||!r(n)||n.loc.end.line!==t.loc.end.line?t:n;function r(e){switch(e.value){case`,`:case`:`:return!0;default:return!1}}}function An({nodeToInsertAfter:e,commentAfter:t,sourceCode:n,range:r}){let i=n.text.slice(...r);return t.type!==`Line`||n.getTokenAfter(e)?.loc.start.line!==e.loc.end.line||(i+=`
70
+ `),i}function jn(e,t){let n=t.getTokenAfter(e,{filter:({value:e,type:t})=>t!==`Punctuator`||![`,`,`;`,`:`].includes(e),includeComments:!0});return(n?.type===`Block`||n?.type===`Line`)&&e.loc.end.line===n.loc.end.line?n:null}function Mn({sortedNodes:e,sourceCode:t,fixer:n,nodes:r}){let i=[];for(let a=r.length,o=0;o<a;o++){let a=r.at(o),s=e.at(o),{node:c}=a,{node:l}=s;c!==l&&i.push(...On({sortedNode:l,sourceCode:t,fixer:n,node:c}))}return i}function Nn({sortedNodes:e,sourceCode:t,options:n,fixer:r}){let i=new Set(n.groups.filter(e=>Ke(e)).map(({commentAbove:e})=>e).filter(e=>e!==void 0)),a=[],o=Pn({nextSortedSortingNode:e[0],sortedSortingNode:null,allAutoAddedComments:i,sourceCode:t,options:n,fixer:r});a.push(...o);for(let o=0;o<e.length-1;o++){let s=e.at(o),c=Pn({nextSortedSortingNode:e.at(o+1),allAutoAddedComments:i,sortedSortingNode:s,sourceCode:t,options:n,fixer:r});a.push(...c)}return a}function Pn({nextSortedSortingNode:e,allAutoAddedComments:t,sortedSortingNode:n,sourceCode:r,options:i,fixer:a}){let o=n?Ht(i.groups,n):-1,s=Ht(i.groups,e),c=Xt({options:{...i,groups:i.groups},sortingNode:e,rightGroupIndex:s,leftGroupIndex:o,sourceCode:r}),l=qt({node:e.node,sourceCode:r}),u=l.filter(e=>!c?.comment||e.value.slice(1)!==c.comment).filter(e=>e.type===`Line`&&t.has(e.value.slice(1))),d=[];for(let e of u){let t=r.getTokenAfter(e);d.push(a.removeRange([e.range[0],t.range[0]]))}if(c&&!c.exists){let t;!r.getTokenBefore(e.node)||!l[0]?t=e.node:[t]=l,d.push(a.insertTextBeforeRange(t.range,`// ${c.comment}\n`))}return d}const Fn=/* @__PURE__ */ new Set([`[`,`(`,"`",`*`,`+`,`-`,`/`,`<`]);function In(e){return Fn.has(e?.value.charAt(0)??``)}function Ln(e){switch(e.type){case N.AST_NODE_TYPES.VariableDeclaration:return!0;case N.AST_NODE_TYPES.PropertyDefinition:case N.AST_NODE_TYPES.AccessorProperty:return e.value!==null;default:return!1}}function Rn({ignoreFirstNodeHighestBlockComment:e,sortedNodes:t,sourceCode:n,options:r,fixer:i,nodes:a}){let o=[];for(let s=a.length,c=0;c<s;c++){let s=a.at(c),l=t.at(c),{implicitDecorators:u,node:d}=s,{addSafetySemicolonWhenInline:f,node:p}=l,m=d===a.at(0).node,h=p===a.at(0).node;if(d===p)continue;let g=n.text.slice(...Sn({ignoreHighestBlockComment:e&&h,implicitDecorators:l.implicitDecorators,node:p,sourceCode:n,options:r})),_=n.getText(p),v=n.getTokensAfter(d,{includeComments:!1,count:1}).at(0),y=_.endsWith(`;`)||_.endsWith(`,`),ee=v?.loc.start.line===d.loc.end.line,b=v?.value===`;`||v?.value===`,`,te=t.at(c+1),x=te?n.getFirstToken(te.node):v,ne=Ln(p)&&In(x);f&&!y&&!b&&(ee||ne)&&(g+=`;`),o.push(i.replaceTextRange(Sn({ignoreHighestBlockComment:e&&m,implicitDecorators:u,sourceCode:n,options:r,node:d}),g))}return o}function zn({ignoreFirstNodeHighestBlockComment:e,newlinesBetweenValueGetter:t,hasCommentAboveMissing:n,sortedNodes:r,sourceCode:i,options:a,fixer:o,nodes:s}){let c=Rn({ignoreFirstNodeHighestBlockComment:e,sortedNodes:r,sourceCode:i,options:a,nodes:s,fixer:o}),l=Mn({sortedNodes:r,sourceCode:i,nodes:s,fixer:o});if(l.length>0)return[...c,...l];if(a?.groups){let e=wn({options:{...a,newlinesBetween:a.newlinesBetween,groups:a.groups},newlinesBetweenValueGetter:t,sortedNodes:r,sourceCode:i,fixer:o,nodes:s});if(e.length>0)return[...c,...e]}return c.length>0?c:!n||!a?.groups?[]:Nn({options:{...a,groups:a.groups},sortedNodes:r,sourceCode:i,fixer:o})}function Bn(e){let t=/* @__PURE__ */ new Map;return({hasCommentAboveMissing:n,fixer:r})=>{let i=t.get(n);return i===void 0&&(i=on({fixes:zn({...e,hasCommentAboveMissing:n,fixer:r}),sourceCode:e.sourceCode}),t.set(n,i)),i}}function Vn(e,t){if(e.length!==0){t(null,e.at(0));for(let n=1;n<e.length;n++)t(e.at(n-1),e.at(n))}}function W({ignoreFirstNodeHighestBlockComment:e,sortNodesExcludingEslintDisabled:t,newlinesBetweenValueGetter:n,availableMessageIds:r,context:i,options:a,nodes:o}){let{sourceCode:s}=i,c=t(!1),l=t(!0),u=an(c),d=o,f=r.unexpectedDependencyOrder?Et(d):/* @__PURE__ */ new Set,p=Bn({sortedNodes:l,ignoreFirstNodeHighestBlockComment:e,newlinesBetweenValueGetter:n,sourceCode:s,options:a,nodes:o});Vn(o,(e,t)=>{let o=e?{groupIndex:Ht(a.groups,e),index:u.get(e)}:null,c=Ht(a.groups,t),m=u.get(t),h=l.indexOf(t),g=[],_;r.unexpectedDependencyOrder&&(_=Hn({node:t,nodes:d,nodesInCircularDependencies:f})),o&&(_||o.index>m||e?.isEslintDisabled&&o.index>=h)&&(_?g.push(r.unexpectedDependencyOrder):g.push(o.groupIndex===c||!r.unexpectedGroupOrder?r.unexpectedOrder:r.unexpectedGroupOrder)),e&&r.missedSpacingBetweenMembers&&r.extraSpacingBetweenMembers&&g.push(...rn({options:{...a,newlinesBetween:a.newlinesBetween},missedSpacingError:r.missedSpacingBetweenMembers,extraSpacingError:r.extraSpacingBetweenMembers,leftGroupIndex:o.groupIndex,newlinesBetweenValueGetter:n,rightGroupIndex:c,sourceCode:s,right:t,left:e}));let v;if(r.missedCommentAbove){let e=Xt({leftGroupIndex:o?.groupIndex??null,sortingNode:t,rightGroupIndex:c,sourceCode:s,options:a});e&&!e.exists&&(v=e.comment,g.push(r.missedCommentAbove))}we({firstUnorderedNodeDependentOnRight:_,commentAboveMissing:v,messageIds:g,context:i,getFix:p,right:t,left:e})})}function Hn({nodesInCircularDependencies:e,nodes:t,node:n}){return t.filter(t=>!e.has(t)&&Dt(n,t)).find(e=>{let r=t.indexOf(n);return t.indexOf(e)<r})}function G({tokenValueToIgnoreBefore:e,lastSortingNode:t,sortingNode:n,sourceCode:r,options:i}){return i.partitionByComment&&Un({comments:qt({tokenValueToIgnoreBefore:e,node:n.node,sourceCode:r}),partitionByComment:i.partitionByComment})?!0:!!(t&&i.partitionByNewLine&&nn(r,t,n))}function Un({partitionByComment:e,comments:t}){return t.some(t=>sn({partitionByComment:e,comment:t}))}function Wn(e){return[...Gn(e.id),...e.init?Gn(e.init):[]]}function Gn(e){let t=[];return n(e),t;function n(e){switch(e.type){case N.AST_NODE_TYPES.ArrowFunctionExpression:case N.AST_NODE_TYPES.FunctionExpression:if(!Le(e))return;n(e.body);return;case N.AST_NODE_TYPES.ConditionalExpression:n(e.test),n(e.consequent),n(e.alternate);break;case N.AST_NODE_TYPES.BlockStatement:for(let t of e.body)n(t);break;case N.AST_NODE_TYPES.Identifier:t.push(e.name);break;case N.AST_NODE_TYPES.Property:e.computed&&n(e.key),n(e.value)}if(`expression`in e&&typeof e.expression!=`boolean`&&n(e.expression),`object`in e&&n(e.object),`callee`in e&&n(e.callee),`left`in e&&n(e.left),`right`in e&&n(e.right),`elements`in e){let t=e.elements.filter(e=>e!==null);for(let e of t)n(e)}if(`argument`in e&&e.argument&&n(e.argument),`arguments`in e)for(let t of e.arguments)n(t);if(`properties`in e)for(let t of e.properties)n(t);if(`expressions`in e)for(let t of e.expressions)n(t)}}function K({customGroupMatcher:e,predefinedGroups:t,options:n}){let r=new Set(Ft(n.groups));return Kn(r,n.customGroups,e)??t.find(e=>r.has(e))??`unknown`}function Kn(e,t,n){for(let r of t)if(n(r)&&e.has(r.groupName))return r.groupName;return null}function q(e,t){let n=t.getText(e),r=n.endsWith(`;`)||n.endsWith(`,`),[i,a]=e.range;return a-i-+!!r}function J(e){if(!e.perfectionist)return{};function t(e){let t=/* @__PURE__ */ new Set([`partitionByComment`,`partitionByNewLine`,`specialCharacters`,`newlinesBetween`,`newlinesInside`,`fallbackSort`,`ignoreCase`,`tsconfig`,`alphabet`,`locales`,`order`,`type`]);return Object.keys(e).filter(e=>!t.has(e))}let n=e.perfectionist,r=t(n);if(r.length>0)throw Error(`Invalid Perfectionist setting(s): ${r.join(`, `)}`);return e.perfectionist}function Y(e){return Array.isArray(e)&&e.length>1}function X(e={},t={},n={}){return{...n,...t,...e}}let qn=/* @__PURE__ */ new Map,Jn={useExperimentalDependencyDetection:!0,ignoreCallbackDependenciesPatterns:[],fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByNewLine:!1,partitionByComment:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,customGroups:[],ignoreCase:!0,locales:`en-US`,alphabet:``,order:`asc`,groups:[]};function Yn({matchedAstSelectors:e,context:t,node:n}){if(!Y(n.declarations))return;let{sourceCode:r,id:i}=t,a=J(t.settings),o=X(Tt({matchedAstSelectors:e,sourceCode:r,context:t,node:n}),a,Jn);R(o),I(o),H({selectors:he,modifiers:[],options:o});let s=z({ruleName:i,sourceCode:r}),c=L(o),l=n.declarations.reduce((e,t)=>{let n=xt({node:t,sourceCode:r}),i=t.init?`initialized`:`uninitialized`,a=yt({cache:qn,selectors:[i],modifiers:[]}),c=e.at(-1)?.at(-1),l={group:K({customGroupMatcher:e=>B({selectors:[i],elementName:n,modifiers:[],customGroup:e}),predefinedGroups:a,options:o}),dependencies:o.useExperimentalDependencyDetection?[]:Wn(t),isEslintDisabled:V(t,s),size:q(t,r),dependencyNames:[n],node:t,name:n};return G({lastSortingNode:c,sortingNode:l,sourceCode:r,options:o})&&e.push([]),e.at(-1)?.push({...l,partitionId:e.length}),e},[[]]);o.useExperimentalDependencyDetection&&(l=Ue({dependenciesBySortingNode:He({ignoreCallbackDependenciesPatterns:o.ignoreCallbackDependenciesPatterns,sortingNodes:l.flat(),sourceCode:r}),sortingNodeGroups:l}));let u=l.flat();W({availableMessageIds:{missedSpacingBetweenMembers:pe,unexpectedDependencyOrder:me,extraSpacingBetweenMembers:fe,unexpectedGroupOrder:de,unexpectedOrder:ue},sortNodesExcludingEslintDisabled:d,nodes:u,options:o,context:t});function d(e){return Ot(l.flatMap(t=>U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:c,ignoreEslintDisabledNodes:e,nodes:t,groups:o.groups})),{ignoreEslintDisabledNodes:e})}}function Z({nodeTypes:e,context:t,sorter:n}){let r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new WeakMap,a=[...new Set(t.options.map(e=>e.useConfigurationIf?.matchesAstSelector).filter(e=>e!==void 0))].map(t=>[t,Xn({matchedAstSelectorsByNode:i,astSelector:t,nodeTypes:e})]);return{...Object.fromEntries(a),...Object.fromEntries(e.map(o))};function o(e){return[`${e}:exit`,e=>n({matchedAstSelectors:i.get(e)??r,context:t,node:e})]}}function Xn({matchedAstSelectorsByNode:e,astSelector:t,nodeTypes:n}){return r;function r(n){if(!i(n))return;let r=e.get(n);r||(r=/* @__PURE__ */ new Set,e.set(n,r)),r.add(t)}function i(e){return n.includes(e.type)}}var Zn=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isObjectNotArray=t,e.deepMerge=n;function t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function n(e={},r={}){let i=/* @__PURE__ */ new Set([...Object.keys(e),...Object.keys(r)]);return Object.fromEntries([...i].map(i=>{let a=i in e,o=i in r,s=e[i],c=r[i],l;return l=a&&o?t(s)&&t(c)?n(s,c):c:a?s:c,[i,l]}))}})),Qn=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.applyDefault=n;let t=Zn();function n(e,n){let r=structuredClone(e);return n==null||r.forEach((e,i)=>{if(n[i]!==void 0){let a=n[i];(0,t.isObjectNotArray)(a)&&(0,t.isObjectNotArray)(e)?r[i]=(0,t.deepMerge)(e,a):r[i]=a}}),r}})),$n=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parserSeemsToBeTSESLint=t;function t(e){return!!e&&/(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(e)}})),er=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getParserServices=n;let t=$n();function n(e,t=!1){let n=e.parserPath||e.languageOptions.parser?.meta?.name;return(e.sourceCode.parserServices?.esTreeNodeToTSNodeMap==null||e.sourceCode.parserServices.tsNodeToESTreeNodeMap==null)&&r(n),e.sourceCode.parserServices.program==null&&!t&&r(n),e.sourceCode.parserServices}function r(e){let n=[`You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://tseslint.com/typed-linting for enabling linting with type information.`,`Parser: ${e||`(unknown)`}`,!(0,t.parserSeemsToBeTSESLint)(e)&&`Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.`].filter(Boolean);throw Error(n.join(`
71
+ `))}})),tr=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),nr=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullThrowsReasons=void 0,e.nullThrows=t,e.NullThrowsReasons={MissingParent:`Expected node to have a parent.`,MissingToken:(e,t)=>`Expected to find a ${e} for the ${t}.`};function t(e,t){if(e==null)throw Error(`Non-null Assertion Failed: ${t}`);return e}})),rr=/* @__PURE__ */ u((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RuleCreator=n;let t=Qn();function n(e){return function({meta:t,name:n,...i}){return r({meta:{...t,docs:{...t.docs,url:e(n)}},name:n,...i})}}function r({create:e,defaultOptions:n,meta:r,name:i}){let a=r.defaultOptions??n??[];return{create(n){return e(n,(0,t.applyDefault)(a,n.options))},defaultOptions:n,meta:r,name:i}}n.withoutDocs=function(e){return r(e)}}));let Q=(/* @__PURE__ */ f((/* @__PURE__ */ u(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(Qn(),e),i(Zn(),e),i(er(),e),i(tr(),e),i(nr(),e),i(rr(),e)})))(),1)).RuleCreator(e=>`https://perfectionist.dev/rules/${e}`);var ir=Q({meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:ge}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),useExperimentalDependencyDetection:re,ignoreCallbackDependenciesPatterns:x(),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[me]:Se,[pe]:k,[fe]:O,[de]:D,[ue]:E},docs:{url:`https://perfectionist.dev/rules/sort-variable-declarations`,description:`Enforce sorted variable declarations.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.VariableDeclaration],sorter:Yn,context:e}),name:`sort-variable-declarations`,defaultOptions:[Jn]});let ar=[`intersection`,`conditional`,`function`,`operator`,`keyword`,`literal`,`nullish`,`import`,`object`,`named`,`tuple`,`union`],or={selector:w(ar)};function sr({sourceCode:e,type:t}){let n=e.getText(t);return t.type!==N.AST_NODE_TYPES.TSUnionType&&t.type!==N.AST_NODE_TYPES.TSIntersectionType?n:n.replace(/^\s*[&|]\s*/u,``)}function cr({matchedAstSelectors:e,members:t,context:n}){let r=t.map(e=>sr({sourceCode:n.sourceCode,type:e}));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}function lr(e){switch(e.type){case N.AST_NODE_TYPES.TSConstructorType:case N.AST_NODE_TYPES.TSFunctionType:return!0;case N.AST_NODE_TYPES.TSTypeLiteral:return e.members.some(t);default:return!1}function t(e){switch(e.type){case N.AST_NODE_TYPES.TSConstructSignatureDeclaration:case N.AST_NODE_TYPES.TSIndexSignature:return!1;case N.AST_NODE_TYPES.TSCallSignatureDeclaration:case N.AST_NODE_TYPES.TSMethodSignature:return!0;case N.AST_NODE_TYPES.TSPropertySignature:return!!(e.typeAnnotation&&lr(e.typeAnnotation.typeAnnotation));
72
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
73
+ default:throw new P(e)}}}function ur({cachedGroupsByModifiersAndSelectors:e,tokenValueToIgnoreBefore:t,matchedAstSelectors:n,availableMessageIds:r,defaultOptions:i,context:a,node:o}){let s=J(a.settings),c=X(cr({members:o.types,matchedAstSelectors:n,context:a}),s,i);if(R(c),H({selectors:ar,modifiers:[],options:c}),I(c),c.ignoreCallableTypes&&o.types.some(lr))return;let{sourceCode:l,id:u}=a,d=z({ruleName:u,sourceCode:l}),f=L(c),p=o.types.reduce((n,r)=>{let i=[];switch(r.type){case N.AST_NODE_TYPES.TSTemplateLiteralType:case N.AST_NODE_TYPES.TSLiteralType:i.push(`literal`);break;case N.AST_NODE_TYPES.TSIndexedAccessType:case N.AST_NODE_TYPES.TSTypeReference:case N.AST_NODE_TYPES.TSQualifiedName:case N.AST_NODE_TYPES.TSArrayType:case N.AST_NODE_TYPES.TSInferType:i.push(`named`);break;case N.AST_NODE_TYPES.TSIntersectionType:i.push(`intersection`);break;case N.AST_NODE_TYPES.TSUndefinedKeyword:case N.AST_NODE_TYPES.TSNullKeyword:case N.AST_NODE_TYPES.TSVoidKeyword:i.push(`nullish`);break;case N.AST_NODE_TYPES.TSConditionalType:i.push(`conditional`);break;case N.AST_NODE_TYPES.TSConstructorType:case N.AST_NODE_TYPES.TSFunctionType:i.push(`function`);break;case N.AST_NODE_TYPES.TSBooleanKeyword:case N.AST_NODE_TYPES.TSUnknownKeyword:case N.AST_NODE_TYPES.TSBigIntKeyword:case N.AST_NODE_TYPES.TSNumberKeyword:case N.AST_NODE_TYPES.TSObjectKeyword:case N.AST_NODE_TYPES.TSStringKeyword:case N.AST_NODE_TYPES.TSSymbolKeyword:case N.AST_NODE_TYPES.TSNeverKeyword:case N.AST_NODE_TYPES.TSAnyKeyword:case N.AST_NODE_TYPES.TSThisType:i.push(`keyword`);break;case N.AST_NODE_TYPES.TSTypeOperator:case N.AST_NODE_TYPES.TSTypeQuery:i.push(`operator`);break;case N.AST_NODE_TYPES.TSTypeLiteral:case N.AST_NODE_TYPES.TSMappedType:i.push(`object`);break;case N.AST_NODE_TYPES.TSImportType:i.push(`import`);break;case N.AST_NODE_TYPES.TSTupleType:i.push(`tuple`);break;case N.AST_NODE_TYPES.TSUnionType:i.push(`union`)}let a=sr({sourceCode:l,type:r}),o=K({customGroupMatcher:e=>B({elementName:a,modifiers:[],customGroup:e,selectors:i}),predefinedGroups:yt({cache:e,modifiers:[],selectors:i}),options:c}),s=n.at(-1),u=s?.at(-1),f={isEslintDisabled:V(r,d),size:q(r,l),node:r,group:o,name:a};return G({tokenValueToIgnoreBefore:t,lastSortingNode:u,sortingNode:f,sourceCode:l,options:c})&&(s=[],n.push(s)),s?.push({...f,partitionId:n.length}),n},[[]]);for(let e of p)W({sortNodesExcludingEslintDisabled:m(e),availableMessageIds:r,options:c,context:a,nodes:e});function m(e){return function(t){return U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:f,ignoreEslintDisabledNodes:t,groups:c.groups,nodes:e})}}}function dr({ignoreCallableTypes:e}){return{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:or}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),partitionByComment:A,partitionByNewLine:j,...e&&{ignoreCallableTypes:{type:`boolean`}}},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`}}let fr=/* @__PURE__ */ new Map;const pr=`unexpectedIntersectionTypesOrder`,mr=`unexpectedIntersectionTypesGroupOrder`,hr=`extraSpacingBetweenIntersectionTypes`,gr=`missedSpacingBetweenIntersectionTypes`;let _r={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,ignoreCallableTypes:!0,specialCharacters:`keep`,newlinesBetween:`ignore`,partitionByComment:!1,partitionByNewLine:!1,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,locales:`en-US`,customGroups:[],alphabet:``,order:`asc`,groups:[]};var vr=Q({meta:{messages:{[gr]:k,[hr]:O,[mr]:D,[pr]:E},docs:{url:`https://perfectionist.dev/rules/sort-intersection-types`,description:`Enforce sorted intersection types.`,recommended:!0},schema:dr({ignoreCallableTypes:!0}),type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.TSIntersectionType],sorter:yr,context:e}),defaultOptions:[_r],name:`sort-intersection-types`});function yr({matchedAstSelectors:e,context:t,node:n}){ur({availableMessageIds:{missedSpacingBetweenMembers:gr,extraSpacingBetweenMembers:hr,unexpectedGroupOrder:mr,unexpectedOrder:pr},cachedGroupsByModifiersAndSelectors:fr,tokenValueToIgnoreBefore:`&`,matchedAstSelectors:e,defaultOptions:_r,context:t,node:n})}function br(e,t){let{key:n}=e;switch(n.type){case N.AST_NODE_TYPES.Identifier:return n.name;case N.AST_NODE_TYPES.Literal:return n.value?.toString()??t.getText(e);
74
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
75
+ default:throw new P(n)}}function xr({matchedAstSelectors:e,attributes:t,context:n}){let r=t.map(e=>br(e,n.sourceCode));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}function Sr({matchedAstSelectors:e,availableMessageIds:t,defaultOptions:n,context:r,node:i}){let a=i.attributes;if(!Y(a))return;let{sourceCode:o,id:s}=r,c=J(r.settings),l=X(xr({matchedAstSelectors:e,attributes:a,context:r}),c,n);R(l),H({selectors:[],modifiers:[],options:l}),I(l);let u=z({ruleName:s,sourceCode:o}),d=L(l),f=[[]];for(let e of a){let t=br(e,o),n=K({customGroupMatcher:e=>B({elementName:t,selectors:[],modifiers:[],customGroup:e}),predefinedGroups:[],options:l}),r={isEslintDisabled:V(e,u),size:q(e,o),node:e,group:n,name:t},i=f.at(-1)?.at(-1);G({lastSortingNode:i,sortingNode:r,sourceCode:o,options:l})&&f.push([]),f.at(-1).push({...r,partitionId:f.length})}for(let e of f){function n(e){return function(t){return U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:d,ignoreEslintDisabledNodes:t,groups:l.groups,nodes:e})}}W({sortNodesExcludingEslintDisabled:n(e),availableMessageIds:t,options:l,context:r,nodes:e})}}const Cr=`unexpectedImportAttributesOrder`,wr=`unexpectedImportAttributesGroupOrder`,Tr=`extraSpacingBetweenImportAttributes`,Er=`missedSpacingBetweenImportAttributes`;let Dr={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`,groups:[]},Or={items:{properties:{...y(),...S(),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`};var kr=Q({meta:{messages:{[Er]:k,[Tr]:O,[wr]:D,[Cr]:E},docs:{url:`https://perfectionist.dev/rules/sort-import-attributes`,description:`Enforce sorted import attributes.`,recommended:!0},schema:Or,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.ImportDeclaration],sorter:Ar,context:e}),defaultOptions:[Dr],name:`sort-import-attributes`});function Ar({matchedAstSelectors:e,context:t,node:n}){Sr({availableMessageIds:{missedSpacingBetweenMembers:Er,extraSpacingBetweenMembers:Tr,unexpectedGroupOrder:wr,unexpectedOrder:Cr},matchedAstSelectors:e,defaultOptions:Dr,context:t,node:n})}const jr=`unexpectedExportAttributesOrder`,Mr=`unexpectedExportAttributesGroupOrder`,Nr=`extraSpacingBetweenExportAttributes`,Pr=`missedSpacingBetweenExportAttributes`;let Fr={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`,groups:[]};var Ir=Q({meta:{messages:{[Pr]:k,[Nr]:O,[Mr]:D,[jr]:E},docs:{url:`https://perfectionist.dev/rules/sort-export-attributes`,description:`Enforce sorted export attributes.`,recommended:!0},schema:Or,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.ExportNamedDeclaration],sorter:Lr,context:e}),defaultOptions:[Fr],name:`sort-export-attributes`});function Lr({matchedAstSelectors:e,context:t,node:n}){Sr({availableMessageIds:{missedSpacingBetweenMembers:Pr,extraSpacingBetweenMembers:Nr,unexpectedGroupOrder:Mr,unexpectedOrder:jr},matchedAstSelectors:e,defaultOptions:Fr,context:t,node:n})}const Rr=`unexpectedHeritageClausesOrder`,zr=`unexpectedHeritageClausesGroupOrder`,Br=`extraSpacingBetweenHeritageClauses`,Vr=`missedSpacingBetweenHeritageClauses`;function Hr(e){let t=e;for(;`property`in t;)t=t.property;
76
+ /* v8 ignore else -- @preserve Exhaustive guard for unsupported expressions. */
77
+ if(t.type===N.AST_NODE_TYPES.Identifier)return t.name;
78
+ /* v8 ignore next -- @preserve Should never throw. */
79
+ throw Error(`Unexpected heritage clause expression. Please report this issue here: https://github.com/azat-io/eslint-plugin-perfectionist/issues`)}function Ur({matchedAstSelectors:e,heritageClauses:t,context:n}){let r=t.map(e=>Hr(e.expression));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}let Wr={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,newlinesBetween:`ignore`,partitionByNewLine:!1,partitionByComment:!1,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`,groups:[]};function Gr({matchedAstSelectors:e,context:t,node:n}){let r=n.type===N.AST_NODE_TYPES.TSInterfaceDeclaration?n.extends:n.implements;if(!Y(r))return;let i=J(t.settings),a=X(Ur({matchedAstSelectors:e,heritageClauses:r,context:t}),i,Wr);R(a),H({modifiers:[],selectors:[],options:a}),I(a);let{sourceCode:o,id:s}=t,c=z({ruleName:s,sourceCode:o}),l=L(a),u=[[]];for(let e of r){let t=Hr(e.expression),n=K({customGroupMatcher:e=>B({elementName:t,selectors:[],modifiers:[],customGroup:e}),predefinedGroups:[],options:a}),r={isEslintDisabled:V(e,c),size:q(e,o),node:e,partitionId:0,group:n,name:t},i=u.at(-1)?.at(-1);G({lastSortingNode:i,sortingNode:r,sourceCode:o,options:a})&&u.push([]),u.at(-1).push(r)}for(let e of u){function n(e){return function(t){return U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:l,ignoreEslintDisabledNodes:t,groups:a.groups,nodes:e})}}W({availableMessageIds:{missedSpacingBetweenMembers:Vr,extraSpacingBetweenMembers:Br,unexpectedGroupOrder:zr,unexpectedOrder:Rr},sortNodesExcludingEslintDisabled:n(e),options:a,context:t,nodes:e})}}var Kr=Q({meta:{schema:{items:{properties:{...y(),...S(),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),partitionByNewLine:j,partitionByComment:A},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[Vr]:k,[Br]:O,[zr]:D,[Rr]:E},docs:{url:`https://perfectionist.dev/rules/sort-heritage-clauses`,description:`Enforce sorted heritage clauses.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.TSInterfaceDeclaration,N.AST_NODE_TYPES.ClassDeclaration],sorter:Gr,context:e}),defaultOptions:[Wr],name:`sort-heritage-clauses`});let qr=[`literal`],Jr={selector:w(qr)};function Yr({sourceCode:e,node:t}){return t.type===N.AST_NODE_TYPES.Literal?String(t.value):e.getText(t)}function Xr({matchedAstSelectors:e,elements:t,context:n}){let r=t.filter(e=>e!==null).map(e=>Yr({sourceCode:n.sourceCode,node:e}));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}function Zr(e){switch(e.type){case N.AST_NODE_TYPES.ArrayExpression:return e.elements;case N.AST_NODE_TYPES.NewExpression:return e.callee.type!==N.AST_NODE_TYPES.Identifier||e.callee.name!==`Array`?null:e.arguments;
80
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
81
+ default:throw new P(e)}}function Qr({cachedGroupsByModifiersAndSelectors:e,mustHaveMatchedContextOptions:t,availableMessageIds:n,matchedAstSelectors:r,defaultOptions:i,context:a,node:o}){let s=Zr(o);if(!s||!Y(s))return;let{sourceCode:c,id:l}=a,u=J(a.settings),d=Xr({matchedAstSelectors:r,elements:s,context:a});if(t&&!d)return;let f=X(d,u,i);R(f),H({selectors:qr,modifiers:[],options:f}),I(f);let p=z({ruleName:l,sourceCode:c}),m=L(f),h=s.reduce((t,n)=>{if(n===null)return t;if(n.type===N.AST_NODE_TYPES.SpreadElement)return t.push([]),t;let r=Yr({node:n,sourceCode:c}),i=`literal`,a=K({customGroupMatcher:e=>B({selectors:[i],elementName:r,modifiers:[],customGroup:e}),predefinedGroups:yt({cache:e,selectors:[i],modifiers:[]}),options:f}),o={isEslintDisabled:V(n,p),size:q(n,c),node:n,group:a,name:r},s=t.at(-1)?.at(-1);return G({lastSortingNode:s,sortingNode:o,sourceCode:c,options:f})&&t.push([]),t.at(-1).push({...o,partitionId:t.length}),t},[[]]);function g(e){return h.flatMap(t=>U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:m,ignoreEslintDisabledNodes:e,groups:f.groups,nodes:t}))}W({sortNodesExcludingEslintDisabled:g,availableMessageIds:n,options:f,context:a,nodes:h.flat()})}let $r=/* @__PURE__ */ new Map;const ei=`unexpectedArrayIncludesOrder`,ti=`unexpectedArrayIncludesGroupOrder`,ni=`extraSpacingBetweenArrayIncludesMembers`,ri=`missedSpacingBetweenArrayIncludesMembers`;let ii={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,groups:[`literal`],ignoreCase:!0,locales:`en-US`,customGroups:[],alphabet:``,order:`asc`},ai={items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:Jr}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`};var oi=Q({meta:{messages:{[ri]:k,[ni]:O,[ti]:D,[ei]:E},docs:{description:`Enforce sorted arrays before include method.`,url:`https://perfectionist.dev/rules/sort-array-includes`,recommended:!0},schema:ai,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.NewExpression,N.AST_NODE_TYPES.ArrayExpression],sorter:si,context:e}),defaultOptions:[ii],name:`sort-array-includes`});function si({matchedAstSelectors:e,context:t,node:n}){if(!r())return;Qr({availableMessageIds:{missedSpacingBetweenMembers:ri,extraSpacingBetweenMembers:ni,unexpectedGroupOrder:ti,unexpectedOrder:ei},mustHaveMatchedContextOptions:!1,cachedGroupsByModifiersAndSelectors:$r,matchedAstSelectors:e,defaultOptions:ii,context:t,node:n});function r(){return n.parent.type!==N.AST_NODE_TYPES.MemberExpression||n.parent.property.type!==N.AST_NODE_TYPES.Identifier||n.parent.property.name!==`includes`||n.parent.parent.type!==N.AST_NODE_TYPES.CallExpression?!1:n.parent.parent.callee===n.parent}}const ci=`unexpectedNamedImportsOrder`,li=`unexpectedNamedImportsGroupOrder`,ui=`extraSpacingBetweenNamedImports`,di=`missedSpacingBetweenNamedImports`;let fi=[`import`],pi=[`value`,`type`],mi={modifiers:C(pi),selector:w(fi)};function hi(e,t){if(!t)return e.local.name;switch(e.imported.type){case N.AST_NODE_TYPES.Identifier:return e.imported.name;case N.AST_NODE_TYPES.Literal:return e.imported.value;
82
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
83
+ default:throw new P(e.imported)}}function gi({matchedAstSelectors:e,context:t,node:n}){return t.options.find(t=>_i({matchedAstSelectors:e,options:t,node:n}))}function _i({matchedAstSelectors:e,options:t,node:n}){if(!t.useConfigurationIf)return!0;let r=n.specifiers.filter(e=>e.type===N.AST_NODE_TYPES.ImportSpecifier).map(e=>hi(e,!!t.ignoreAlias));return St({allNamesMatchPattern:t.useConfigurationIf.allNamesMatchPattern,nodeNames:r})&&Ct({matchesAstSelector:t.useConfigurationIf.matchesAstSelector,matchedAstSelectors:e})}function vi(e){let t=`importKind`in e?e.importKind:void 0;switch(t){case void 0:case`value`:return`value`;case`type`:return`type`;
84
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
85
+ default:throw new P(t)}}let yi=/* @__PURE__ */ new Map,bi={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByNewLine:!1,partitionByComment:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,ignoreAlias:!1,customGroups:[],ignoreCase:!0,locales:`en-US`,alphabet:``,order:`asc`,groups:[]};function xi({matchedAstSelectors:e,context:t,node:n}){let r=n.specifiers.filter(e=>e.type===N.AST_NODE_TYPES.ImportSpecifier);if(!Y(r))return;let i=J(t.settings),a=X(gi({matchedAstSelectors:e,context:t,node:n}),i,bi);R(a),H({modifiers:pi,selectors:fi,options:a}),I(a);let{sourceCode:o,id:s}=t,c=z({ruleName:s,sourceCode:o}),l=L(a),u=[[]];for(let e of r){let t=hi(e,a.ignoreAlias),n=`import`,r=[vi(e)],i=K({customGroupMatcher:e=>B({selectors:[n],elementName:t,customGroup:e,modifiers:r}),predefinedGroups:yt({cache:yi,selectors:[n],modifiers:r}),options:a}),s={isEslintDisabled:V(e,c),size:q(e,o),node:e,group:i,name:t},l=u.at(-1)?.at(-1);G({lastSortingNode:l,sortingNode:s,sourceCode:o,options:a})&&u.push([]),u.at(-1).push({...s,partitionId:u.length})}function d(e){return u.flatMap(t=>U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:l,ignoreEslintDisabledNodes:e,groups:a.groups,nodes:t}))}let f=u.flat();W({availableMessageIds:{missedSpacingBetweenMembers:di,extraSpacingBetweenMembers:ui,unexpectedGroupOrder:li,unexpectedOrder:ci},sortNodesExcludingEslintDisabled:d,options:a,context:t,nodes:f})}var Si=Q({meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:mi}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),ignoreAlias:{description:`Controls whether to ignore alias names.`,type:`boolean`},partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[di]:k,[ui]:O,[li]:D,[ci]:E},docs:{url:`https://perfectionist.dev/rules/sort-named-imports`,description:`Enforce sorted named imports.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.ImportDeclaration],sorter:xi,context:e}),defaultOptions:[bi],name:`sort-named-imports`});const Ci=`unexpectedNamedExportsOrder`,wi=`unexpectedNamedExportsGroupOrder`,Ti=`extraSpacingBetweenNamedExports`,Ei=`missedSpacingBetweenNamedExports`;let Di=[`export`],Oi=[`value`,`type`],ki={modifiers:C(Oi),selector:w(Di)};function Ai(e,t){let n=t?e.local:e.exported;switch(n.type){case N.AST_NODE_TYPES.Identifier:return n.name;case N.AST_NODE_TYPES.Literal:return n.value;
86
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
87
+ default:throw new P(n)}}function ji({matchedAstSelectors:e,context:t,node:n}){return t.options.find(t=>Mi({matchedAstSelectors:e,options:t,node:n}))}function Mi({matchedAstSelectors:e,options:t,node:n}){if(!t.useConfigurationIf)return!0;let r=n.specifiers.map(e=>Ai(e,!!t.ignoreAlias));return St({allNamesMatchPattern:t.useConfigurationIf.allNamesMatchPattern,nodeNames:r})&&Ct({matchesAstSelector:t.useConfigurationIf.matchesAstSelector,matchedAstSelectors:e})}function Ni(e){let t=`exportKind`in e?e.exportKind:void 0;switch(t){case void 0:case`value`:return`value`;case`type`:return`type`;
88
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
89
+ default:throw new P(t)}}let Pi=/* @__PURE__ */ new Map,Fi={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByNewLine:!1,partitionByComment:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,ignoreAlias:!1,customGroups:[],ignoreCase:!0,locales:`en-US`,alphabet:``,order:`asc`,groups:[]};function Ii({matchedAstSelectors:e,context:t,node:n}){if(!Y(n.specifiers))return;let r=J(t.settings),i=X(ji({matchedAstSelectors:e,context:t,node:n}),r,Fi);R(i),H({modifiers:Oi,selectors:Di,options:i}),I(i);let{sourceCode:a,id:o}=t,s=z({ruleName:o,sourceCode:a}),c=L(i),l=[[]];for(let e of n.specifiers){let t=Ai(e,i.ignoreAlias),n=`export`,r=[Ni(e)],o=K({customGroupMatcher:e=>B({selectors:[n],elementName:t,customGroup:e,modifiers:r}),predefinedGroups:yt({cache:Pi,selectors:[n],modifiers:r}),options:i}),c={isEslintDisabled:V(e,s),size:q(e,a),node:e,group:o,name:t},u=l.at(-1)?.at(-1);G({lastSortingNode:u,sortingNode:c,sourceCode:a,options:i})&&l.push([]),l.at(-1).push({...c,partitionId:l.length})}function u(e){return l.flatMap(t=>U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:c,ignoreEslintDisabledNodes:e,groups:i.groups,nodes:t}))}let d=l.flat();W({availableMessageIds:{missedSpacingBetweenMembers:Ei,extraSpacingBetweenMembers:Ti,unexpectedGroupOrder:wi,unexpectedOrder:Ci},sortNodesExcludingEslintDisabled:u,options:i,context:t,nodes:d})}var Li=Q({meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:ki}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),ignoreAlias:{description:`Controls whether to ignore alias names.`,type:`boolean`},partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[Ei]:k,[Ti]:O,[wi]:D,[Ci]:E},docs:{url:`https://perfectionist.dev/rules/sort-named-exports`,description:`Enforce sorted named exports.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.ExportNamedDeclaration],sorter:Ii,context:e}),defaultOptions:[Fi],name:`sort-named-exports`});let Ri=[N.AST_NODE_TYPES.TSTypeAliasDeclaration,N.AST_NODE_TYPES.TSInterfaceDeclaration,N.AST_NODE_TYPES.TSPropertySignature,N.AST_NODE_TYPES.VariableDeclarator,N.AST_NODE_TYPES.PropertyDefinition],zi=[`index-signature`,`member`,`method`,`property`],Bi=[`optional`,`required`,`multiline`],Vi={sortBy:{enum:[`name`,`value`],type:`string`}},Hi={modifiers:C(Bi),selector:w(zi),elementValuePattern:x()},Ui=x({additionalProperties:{scope:{enum:[`shallow`,`deep`],type:`string`}}}),Wi=lt(e=>e.value),Gi=e=>{switch(e.sortBy){case`value`:return Wi(e);case`name`:return F(e);
90
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
91
+ default:throw new P(e.sortBy)}};function Ki({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.TSConstructSignatureDeclaration:case N.AST_NODE_TYPES.TSCallSignatureDeclaration:return Xi(e.getText(t));case N.AST_NODE_TYPES.TSPropertySignature:return qi(t,e);case N.AST_NODE_TYPES.TSMethodSignature:return Ji(t,e);case N.AST_NODE_TYPES.TSIndexSignature:return Yi(t,e);
92
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
93
+ default:throw new P(t)}}function qi(e,t){switch(e.key.type){case N.AST_NODE_TYPES.Identifier:return e.key.name;case N.AST_NODE_TYPES.Literal:return String(e.key.value);default:{let n=e.typeAnnotation?.range.at(0)??e.range.at(1)-+!!e.optional;return t.text.slice(e.range.at(0),n)}}}function Ji(e,t){
94
+ /* v8 ignore next -- @preserve Unsure if we can reach it. */
95
+ return`name`in e.key?e.key.name:Xi(t.getText(e))}function Yi(e,t){let n=e.typeAnnotation?.range.at(0)??e.range.at(1);return Xi(t.text.slice(e.range.at(0),n))}function Xi(e){return e.replace(/[,;]$/u,``)}function Zi(e){if(!Array.isArray(e)){let t=Qi(e);return{shallowScopePatterns:t?[]:[e],deepScopePatterns:t?[e]:[]}}let t=[],n=[];for(let r of e)Qi(r)?t.push(r):n.push(r);return{shallowScopePatterns:n,deepScopePatterns:t}}function Qi(e){return typeof e!=`object`||!(`scope`in e)?!1:e.scope===`deep`}function $i({nodeValuesComputer:e,scopedRegexOption:t,allowedNodeTypes:n,parentNodes:r}){if(!t)return!0;let{shallowScopePatterns:i,deepScopePatterns:a}=Zi(t);return ea({patterns:i,nodeValuesComputer:e,allowedNodeTypes:n,parentNodes:r})||ta({patterns:a,nodeValuesComputer:e,allowedNodeTypes:n,parentNodes:r})}function ea({nodeValuesComputer:e,allowedNodeTypes:t,parentNodes:n,patterns:r}){let[i]=n;return!i||!ra(i,t)?!1:na({parentNode:i,nodeValuesComputer:e,patterns:r})}function ta({nodeValuesComputer:e,allowedNodeTypes:t,parentNodes:n,patterns:r}){return n.filter(e=>ra(e,t)).some(t=>na({nodeValuesComputer:e,parentNode:t,patterns:r}))}function na({nodeValuesComputer:e,parentNode:t,patterns:n}){let r=e(t);return n.some(i);function i(e){return r.some(t=>Re(t,e))}}function ra(e,t){return t.has(e.type)}function ia(e,t){switch(e.type){case N.AST_NODE_TYPES.TSTypeAliasDeclaration:case N.AST_NODE_TYPES.TSInterfaceDeclaration:return e.id.name;case N.AST_NODE_TYPES.TSPropertySignature:case N.AST_NODE_TYPES.PropertyDefinition:return aa(e,t);case N.AST_NODE_TYPES.VariableDeclarator:return oa(e,t);
96
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
97
+ default:throw new P(e)}}function aa(e,t){switch(e.key.type){case N.AST_NODE_TYPES.Identifier:return e.key.name;case N.AST_NODE_TYPES.Literal:return String(e.key.value);
98
+ /* v8 ignore next 2 -- @preserve Unsure how we can reach that case */
99
+ default:return t.getText(e.key)}}function oa(e,t){return e.id.typeAnnotation?t.text.slice(e.id.range[0],e.id.typeAnnotation.range[0]):t.getText(e.id)}function sa({declarationMatchesPattern:e,parentNodes:t,sourceCode:n}){return $i({nodeValuesComputer:ca(n),allowedNodeTypes:new Set(Ri),scopedRegexOption:e,parentNodes:t})}function ca(e){return t=>[ia(t,e)]}function la({declarationCommentMatchesPattern:e,parentNodes:t,sourceCode:n}){return $i({nodeValuesComputer:da(n),scopedRegexOption:e,allowedNodeTypes:new Set(Ri),parentNodes:t})}function ua(e){let t=e.type;switch(t){case N.AST_NODE_TYPES.TSInterfaceDeclaration:case N.AST_NODE_TYPES.TSTypeAliasDeclaration:case N.AST_NODE_TYPES.TSPropertySignature:case N.AST_NODE_TYPES.PropertyDefinition:return e;case N.AST_NODE_TYPES.VariableDeclarator:return e.parent;
100
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
101
+ default:throw new P(t)}}function da(e){return t=>{let n=ua(t);return e.getCommentsBefore(n).map(e=>e.value.trim())}}function fa({matchedAstSelectors:e,parentNodes:t,sourceCode:n,elements:r,context:i}){return i.options.find(i=>pa({nodeNames:r.map(e=>Ki({sourceCode:n,node:e})),matchedAstSelectors:e,parentNodes:t,sourceCode:n,elements:r,options:i}))}function pa({matchedAstSelectors:e,parentNodes:t,sourceCode:n,nodeNames:r,elements:i,options:a}){return!a.useConfigurationIf||St({allNamesMatchPattern:a.useConfigurationIf.allNamesMatchPattern,nodeNames:r})&&sa({declarationMatchesPattern:a.useConfigurationIf.declarationMatchesPattern,parentNodes:t,sourceCode:n})&&ma({hasNumericKeysOnlyFilter:a.useConfigurationIf.hasNumericKeysOnly,typeElements:i})&&la({declarationCommentMatchesPattern:a.useConfigurationIf.declarationCommentMatchesPattern,parentNodes:t,sourceCode:n})&&Ct({matchesAstSelector:a.useConfigurationIf.matchesAstSelector,matchedAstSelectors:e})}function ma({hasNumericKeysOnlyFilter:e,typeElements:t}){let n=r();switch(e){case void 0:return!0;case!1:return!n;case!0:return n;
102
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
103
+ default:throw new P(e)}function r(){return t.every(e);function e(e){return e.type===N.AST_NODE_TYPES.TSPropertySignature&&e.key.type===N.AST_NODE_TYPES.Literal&&typeof e.key.value==`number`}}}function ha(e){return e.loc.start.line===e.loc.end.line}function ga(e){let t=e;for(;t.type===N.AST_NODE_TYPES.TSPropertySignature&&t.typeAnnotation;)t=t.typeAnnotation.typeAnnotation;return t.type===N.AST_NODE_TYPES.TSMethodSignature||t.type===N.AST_NODE_TYPES.TSFunctionType?!0:t.type===N.AST_NODE_TYPES.TSUnionType||t.type===N.AST_NODE_TYPES.TSIntersectionType?t.types.every(ga):!1}function _a(e){switch(e.type){case N.AST_NODE_TYPES.TSPropertySignature:case N.AST_NODE_TYPES.TSMethodSignature:return e.optional;case N.AST_NODE_TYPES.TSIndexSignature:return!1;
104
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
105
+ default:throw new P(e)}}let va=/* @__PURE__ */ new Map;function ya({availableMessageIds:e,matchedAstSelectors:t,parentNodes:n,elements:r,context:i}){if(!Y(r))return;let a=J(i.settings),{sourceCode:o,id:s}=i,c=X(fa({matchedAstSelectors:t,parentNodes:n,sourceCode:o,elements:r,context:i}),a,wa);R(c),H({selectors:zi,modifiers:Bi,options:c}),I(c);let l=z({ruleName:s,sourceCode:o}),u=L(c),d=[[]];for(let e of r){if(e.type===N.AST_NODE_TYPES.TSCallSignatureDeclaration||e.type===N.AST_NODE_TYPES.TSConstructSignatureDeclaration){d.push([]);continue}let t=d.at(-1),n=t?.at(-1),r=[],i=[];e.type===N.AST_NODE_TYPES.TSIndexSignature&&r.push(`index-signature`),ga(e)&&r.push(`method`),ha(e)||i.push(`multiline`),[`index-signature`,`method`].every(e=>!r.includes(e))&&r.push(`property`),r.push(`member`),_a(e)?i.push(`optional`):i.push(`required`);let a=Ki({node:e,sourceCode:o}),s=null;e.type===N.AST_NODE_TYPES.TSPropertySignature&&e.typeAnnotation&&(s=o.getText(e.typeAnnotation.typeAnnotation));let u=K({customGroupMatcher:e=>B({elementValue:s,elementName:a,customGroup:e,selectors:r,modifiers:i}),predefinedGroups:yt({cache:va,selectors:r,modifiers:i}),options:c}),f={isEslintDisabled:V(e,l),size:q(e,o),addSafetySemicolonWhenInline:!0,value:s??``,node:e,group:u,name:a};G({lastSortingNode:n,sortingNode:f,sourceCode:o,options:c})&&(t=[],d.push(t)),t?.push({...f,partitionId:d.length})}W({sortNodesExcludingEslintDisabled:f,availableMessageIds:e,options:c,context:i,nodes:d.flat()});function f(e){return d.flatMap(t=>U({isNodeIgnoredForGroup:({groupOptions:e,node:t})=>{switch(e.sortBy){case`value`:return!t.value;case`name`:return!1;
106
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
107
+ default:throw new P(e.sortBy)}},comparatorByOptionsComputer:Gi,optionsByGroupIndexComputer:u,ignoreEslintDisabledNodes:e,groups:c.groups,nodes:t}))}}const ba=`unexpectedObjectTypesOrder`,xa=`unexpectedObjectTypesGroupOrder`,Sa=`extraSpacingBetweenObjectTypeMembers`,Ca=`missedSpacingBetweenObjectTypeMembers`;let wa={fallbackSort:{type:`unsorted`,sortBy:`name`},newlinesInside:`newlinesBetween`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,specialCharacters:`keep`,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,sortBy:`name`,alphabet:``,order:`asc`,groups:[]},Ta={items:{properties:{...y({additionalSortProperties:Vi}),...S({additionalCustomGroupMatchProperties:Hi,additionalSortProperties:Vi}),useConfigurationIf:b({additionalProperties:{hasNumericKeysOnly:{description:`Specifies whether to only match types that have exclusively numeric keys.`,type:`boolean`},declarationCommentMatchesPattern:Ui,matchesAstSelector:v,declarationMatchesPattern:Ui}}),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`};var Ea=Q({meta:{messages:{[Ca]:k,[Sa]:O,[xa]:D,[ba]:E},docs:{url:`https://perfectionist.dev/rules/sort-object-types`,description:`Enforce sorted object types.`,recommended:!0},schema:Ta,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.TSTypeLiteral],sorter:Da,context:e}),defaultOptions:[wa],name:`sort-object-types`});function Da({matchedAstSelectors:e,context:t,node:n}){ya({availableMessageIds:{missedSpacingBetweenMembers:Ca,extraSpacingBetweenMembers:Sa,unexpectedGroupOrder:xa,unexpectedOrder:ba},parentNodes:Oa(n),elements:n.members,matchedAstSelectors:e,context:t})}function Oa(e){return Me({allowedTypes:[...Ri],consecutiveOnly:!1,maxParent:null,node:e})}function ka(e){switch(e.type){case N.AST_NODE_TYPES.LogicalExpression:case N.AST_NODE_TYPES.BinaryExpression:return!0;case N.AST_NODE_TYPES.UnaryExpression:return e.operator===`!`;case N.AST_NODE_TYPES.Literal:return typeof e.value==`boolean`;default:return!1}}const Aa=`unexpectedSwitchCaseOrder`;let ja={fallbackSort:{type:`unsorted`},specialCharacters:`keep`,type:`alphabetical`,ignoreCase:!0,locales:`en-US`,alphabet:``,order:`asc`};var Ma=Q({create:e=>({SwitchStatement:t=>{if(!Y(t.cases))return;let n=J(e.settings),r=X(e.options.at(0),n,ja),i=F(r);R(r);let{sourceCode:a}=e;if(ka(t.discriminant)||t.cases.some(e=>e.test!==null&&ka(e.test)))return;let o=t.cases.reduce((e,n,r)=>(n.test&&e.at(-1).push({size:q(n.test,a),name:Pa(a,n),partitionId:e.length,isEslintDisabled:!1,node:n.test,group:`unknown`}),n.consequent.length>0&&r!==t.cases.length-1&&e.push([]),e),[[]]),s=!1;for(let t of o){let n=Kt({comparatorByOptionsComputer:F,nodes:t,ignoreEslintDisabledNodes:!1,options:r});s||=n.some((e,n)=>e!==t[n]);let i=an(n),o=Bn({sortedNodes:n,nodes:t,sourceCode:a});Vn(t,(t,n)=>{t&&(i.get(t)<i.get(n)||we({messageIds:[Aa],getFix:o,context:e,right:n,left:t}))})}let c=t.cases.map(e=>({size:e.test?q(e.test,a):7,name:Pa(a,e),addSafetySemicolonWhenInline:!0,isDefaultClause:!e.test,isEslintDisabled:!1,group:`unknown`,partitionId:0,node:e})),l=Na(c,e=>e.node.consequent.length>0).find(e=>e.some(e=>e.isDefaultClause));if(l&&!l.at(-1).isDefaultClause){let t=l.find(e=>e.isDefaultClause),n=l.at(-1);e.report({fix:e=>{let r=a.getTokenAfter(n.node.test),i=[n.node.range[0],r.range[1]];return[e.replaceText(t.node,a.text.slice(...i)),e.replaceTextRange(i,a.getText(t.node)),...On({sortedNode:r,node:t.node,sourceCode:a,fixer:e}),...On({node:r,sortedNode:t.node,sourceCode:a,fixer:e})]},data:{[ye]:t.name,[T]:n.name},messageId:Aa,node:t.node})}let u=Na(c,e=>Fa(e.node)),d=u.at(-1),f=!Fa(d.at(-1).node),p=[...u].toSorted((e,t)=>{if(f){if(e===d)return 1;
108
+ /* v8 ignore if -- @preserve last element might never be b. */
109
+ if(t===d)return-1}return e.some(e=>e.isDefaultClause)?1:t.some(e=>e.isDefaultClause)?-1:i(e.at(0),t.at(0))}).flat(),m=u.flat(),h=Bn({sortedNodes:p,nodes:m,sourceCode:a});Vn(m,(t,n)=>{t&&(p.indexOf(t)<p.indexOf(n)||e.report({fix:e=>s?[]:h({hasCommentAboveMissing:!1,fixer:e}),data:{[T]:n.name,[ye]:t.name},messageId:Aa,node:n.node}))})}}),meta:{docs:{url:`https://perfectionist.dev/rules/sort-switch-case`,description:`Enforce sorted switch cases.`,recommended:!0},schema:[{properties:y(),additionalProperties:!1,type:`object`}],messages:{[Aa]:E},type:`suggestion`,fixable:`code`},defaultOptions:[ja],name:`sort-switch-case`});function Na(e,t){return e.reduce((n,r,i)=>(n.at(-1).push(r),t(r)&&i!==e.length-1&&n.push([]),n),[[]])}function Pa(e,t){return t.test?.type===N.AST_NODE_TYPES.Literal?String(t.test.value):t.test===null?`default`:e.getText(t.test)}function Fa(e){return(e.consequent[0]?.type===N.AST_NODE_TYPES.BlockStatement?e.consequent[0].body:e.consequent).some(Ia)}function Ia(e){return e.type===N.AST_NODE_TYPES.BreakStatement||e.type===N.AST_NODE_TYPES.ReturnStatement}let La=/* @__PURE__ */ new Map;const Ra=`unexpectedUnionTypesOrder`,za=`unexpectedUnionTypesGroupOrder`,Ba=`extraSpacingBetweenUnionTypes`,Va=`missedSpacingBetweenUnionTypes`;let Ha={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,newlinesBetween:`ignore`,partitionByNewLine:!1,partitionByComment:!1,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,locales:`en-US`,customGroups:[],alphabet:``,order:`asc`,groups:[]};var Ua=Q({meta:{messages:{[Va]:k,[Ba]:O,[za]:D,[Ra]:E},docs:{url:`https://perfectionist.dev/rules/sort-union-types`,description:`Enforce sorted union types.`,recommended:!0},schema:dr({ignoreCallableTypes:!1}),type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.TSUnionType],sorter:Wa,context:e}),defaultOptions:[Ha],name:`sort-union-types`});function Wa({matchedAstSelectors:e,context:t,node:n}){ur({availableMessageIds:{missedSpacingBetweenMembers:Va,extraSpacingBetweenMembers:Ba,unexpectedGroupOrder:za,unexpectedOrder:Ra},defaultOptions:{...Ha,ignoreCallableTypes:!1},cachedGroupsByModifiersAndSelectors:La,tokenValueToIgnoreBefore:`|`,matchedAstSelectors:e,context:t,node:n})}const Ga=`unexpectedInterfacePropertiesOrder`,Ka=`unexpectedInterfacePropertiesGroupOrder`,qa=`extraSpacingBetweenInterfaceMembers`,Ja=`missedSpacingBetweenInterfaceMembers`;var Ya=Q({meta:{messages:{[Ja]:k,[qa]:O,[Ka]:D,[Ga]:E},docs:{url:`https://perfectionist.dev/rules/sort-interfaces`,description:`Enforce sorted interface properties.`,recommended:!0},schema:Ta,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.TSInterfaceDeclaration],sorter:Xa,context:e}),defaultOptions:[wa],name:`sort-interfaces`});function Xa({matchedAstSelectors:e,context:t,node:n}){ya({availableMessageIds:{missedSpacingBetweenMembers:Ja,extraSpacingBetweenMembers:qa,unexpectedGroupOrder:Ka,unexpectedOrder:Ga},elements:n.body.body,matchedAstSelectors:e,parentNodes:[n],context:t})}function $(e){return e.decorators??[]}function Za({sourceCode:e,decorator:t}){let n=e.getText(t);return n.startsWith(`@`)&&(n=n.slice(1)),n.split(`(`,1)[0]}const Qa=`unexpectedDecoratorsOrder`,$a=`unexpectedDecoratorsGroupOrder`,eo=`extraSpacingBetweenDecorators`,to=`missedSpacingBetweenDecorators`;let no={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,sortOnProperties:!0,sortOnParameters:!0,sortOnAccessors:!0,type:`alphabetical`,sortOnClasses:!0,sortOnMethods:!0,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`,groups:[]};var ro=Q({meta:{schema:{items:{properties:{...y(),...S(),sortOnParameters:{description:`Controls whether sorting should be enabled for method parameter decorators.`,type:`boolean`},sortOnProperties:{description:`Controls whether sorting should be enabled for class property decorators.`,type:`boolean`},sortOnAccessors:{description:`Controls whether sorting should be enabled for class accessor decorators.`,type:`boolean`},sortOnMethods:{description:`Controls whether sorting should be enabled for class method decorators.`,type:`boolean`},sortOnClasses:{description:`Controls whether sorting should be enabled for class decorators.`,type:`boolean`},partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[to]:k,[eo]:O,[$a]:D,[Qa]:E},docs:{url:`https://perfectionist.dev/rules/sort-decorators`,description:`Enforce sorted decorators.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>{let t=J(e.settings),n=X(e.options.at(0),t,no);return R(n),H({modifiers:[],selectors:[],options:n}),I(n),{Decorator:t=>{if(n.sortOnParameters&&`decorators`in t.parent&&t.parent.type===N.AST_NODE_TYPES.Identifier&&t.parent.parent.type===N.AST_NODE_TYPES.FunctionExpression){let{decorators:r}=t.parent;if(t!==r[0])return;io(e,n,r)}},PropertyDefinition:t=>{n.sortOnProperties&&io(e,n,$(t))},AccessorProperty:t=>{n.sortOnAccessors&&io(e,n,$(t))},MethodDefinition:t=>{n.sortOnMethods&&io(e,n,$(t))},ClassDeclaration:t=>{n.sortOnClasses&&io(e,n,$(t))}}},defaultOptions:[no],name:`sort-decorators`});function io(e,t,n){if(!Y(n))return;let{sourceCode:r,id:i}=e,a=z({ruleName:i,sourceCode:r}),o=L(t),s=n.reduce((e,n)=>{let i=Za({sourceCode:r,decorator:n}),o=K({customGroupMatcher:e=>B({elementName:i,selectors:[],modifiers:[],customGroup:e}),predefinedGroups:[],options:t}),s={isEslintDisabled:V(n,a),size:q(n,r),node:n,group:o,name:i},c=e.at(-1)?.at(-1);return G({lastSortingNode:c,sortingNode:s,sourceCode:r,options:t})&&e.push([]),e.at(-1).push({...s,partitionId:e.length}),e},[[]]);function c(e){return s.flatMap(n=>U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:o,ignoreEslintDisabledNodes:e,groups:t.groups,nodes:n}))}let l=s.flat();W({availableMessageIds:{missedSpacingBetweenMembers:to,extraSpacingBetweenMembers:eo,unexpectedGroupOrder:$a,unexpectedOrder:Qa},ignoreFirstNodeHighestBlockComment:!0,sortNodesExcludingEslintDisabled:c,options:t,context:e,nodes:l})}const ao=`unexpectedJSXPropsOrder`,oo=`unexpectedJSXPropsGroupOrder`,so=`extraSpacingBetweenJSXPropsMembers`,co=`missedSpacingBetweenJSXPropsMembers`;let lo=[`prop`],uo=[`shorthand`,`multiline`],fo={modifiers:C(uo),selector:w(lo),elementValuePattern:x()};function po(e){switch(e.name.type){case N.AST_NODE_TYPES.JSXNamespacedName:return`${e.name.namespace.name}:${e.name.name.name}`;case N.AST_NODE_TYPES.JSXIdentifier:return e.name.name;
110
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
111
+ default:throw new P(e.name)}}function mo({matchedAstSelectors:e,sourceCode:t,context:n,node:r}){let i=r.openingElement.attributes.filter(e=>e.type!==N.AST_NODE_TYPES.JSXSpreadAttribute).map(e=>po(e));return n.options.find(n=>ho({matchedAstSelectors:e,sourceCode:t,nodeNames:i,options:n,node:r}))}function ho({matchedAstSelectors:e,sourceCode:t,nodeNames:n,options:r,node:i}){return!r.useConfigurationIf||St({allNamesMatchPattern:r.useConfigurationIf.allNamesMatchPattern,nodeNames:n})&&go({tagMatchesPattern:r.useConfigurationIf.tagMatchesPattern,sourceCode:t,node:i})&&Ct({matchesAstSelector:r.useConfigurationIf.matchesAstSelector,matchedAstSelectors:e})}function go({tagMatchesPattern:e,sourceCode:t,node:n}){return!e||Re(t.getText(n.openingElement.name),e)}let _o=/* @__PURE__ */ new Map,vo={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,newlinesBetween:`ignore`,partitionByNewLine:!1,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`,groups:[]};function yo({matchedAstSelectors:e,context:t,node:n}){if(!Y(n.openingElement.attributes))return;let{sourceCode:r,id:i}=t,a=J(t.settings),o=X(mo({matchedAstSelectors:e,sourceCode:r,context:t,node:n}),a,vo);R(o),H({selectors:lo,modifiers:uo,options:o}),I(o);let s=z({ruleName:i,sourceCode:r}),c=L(o),l=n.openingElement.attributes.reduce((e,t)=>{if(t.type===N.AST_NODE_TYPES.JSXSpreadAttribute)return e.push([]),e;let n=po(t),i=[],a=[];t.value===null&&a.push(`shorthand`),ha(t)||a.push(`multiline`),i.push(`prop`);let c=K({customGroupMatcher:e=>B({elementValue:t.value?r.getText(t.value):null,elementName:n,customGroup:e,selectors:i,modifiers:a}),predefinedGroups:yt({cache:_o,selectors:i,modifiers:a}),options:o}),l={isEslintDisabled:V(t,s),size:q(t,r),node:t,group:c,name:n},u=e.at(-1)?.at(-1);return G({options:{partitionByNewLine:o.partitionByNewLine,partitionByComment:!1},lastSortingNode:u,sortingNode:l,sourceCode:r})&&e.push([]),e.at(-1).push({...l,partitionId:e.length}),e},[[]]);for(let e of l){function n(e){return function(t){return U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:c,ignoreEslintDisabledNodes:t,groups:o.groups,nodes:e})}}W({availableMessageIds:{missedSpacingBetweenMembers:co,extraSpacingBetweenMembers:so,unexpectedGroupOrder:oo,unexpectedOrder:ao},sortNodesExcludingEslintDisabled:n(e),options:{...o,partitionByComment:!1},nodes:e,context:t})}}var bo=Q({meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:fo}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v,tagMatchesPattern:x()}}),partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[co]:k,[so]:O,[oo]:D,[ao]:E},docs:{url:`https://perfectionist.dev/rules/sort-jsx-props`,description:`Enforce sorted JSX props.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.JSXElement],sorter:yo,context:e}),defaultOptions:[vo],name:`sort-jsx-props`});const xo=`unexpectedClassesOrder`,So=`unexpectedClassesGroupOrder`,Co=`extraSpacingBetweenClassMembers`,wo=`missedSpacingBetweenClassMembers`,To=`unexpectedClassesDependencyOrder`;let Eo=[`accessor-property`,`index-signature`,`constructor`,`static-block`,`get-method`,`set-method`,`function-property`,`property`,`method`],Do=[`async`,`protected`,`private`,`public`,`static`,`abstract`,`override`,`readonly`,`decorated`,`declare`,`optional`],Oo={modifiers:C(Do),selector:w(Eo),decoratorNamePattern:x(),elementValuePattern:x()};function ko(e){return({computedNewlinesBetween:t,right:n,left:r})=>r.overloadSignatureImplementation&&r.overloadSignatureImplementation===n.overloadSignatureImplementation?e:t}function Ao(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.set(n.node,n);return t}function jo({overloadSignatureGroups:e,sortingNodeGroups:t}){return t.map(t=>No({overloadSignatureGroups:e,sortingNodes:t}))}function Mo({overloadSignatureGroups:e,sortingNodeByNode:t,sortingNode:n}){let r=Po({overloadSignatureGroups:e,node:n.node});if(!r)return{...n,overloadSignatureImplementation:null};let i=t.get(r);
112
+ /* v8 ignore if -- @preserve Unsure how we can reach that case */
113
+ if(!i)return{...n,overloadSignatureImplementation:null};let{addSafetySemicolonWhenInline:a,isEslintDisabled:o,node:s,...c}=i;return{...n,...c,overloadSignatureImplementation:r}}function No({overloadSignatureGroups:e,sortingNodes:t}){let n=Ao(t);return t.map(t=>Mo({overloadSignatureGroups:e,sortingNodeByNode:n,sortingNode:t}))}function Po({overloadSignatureGroups:e,node:t}){let n=e.find(e=>e.doesNodeBelongToGroup(t));return n?n.implementation:null}function Fo({hasPrivateHash:e,node:t}){if(e)return[`private`];switch(t.accessibility){case`protected`:return[`protected`];case`private`:return[`private`];case void 0:case`public`:return[`public`];default:return t.accessibility,n(t.accessibility)}function n(e){
114
+ /* v8 ignore else -- @preserve Unhandled case */
115
+ if(e===null)return[`public`];
116
+ /* v8 ignore next -- @preserve Unhandled case */
117
+ throw Error(`Unhandled accessibility modifier`)}}function Io(e){switch(e.type){case N.AST_NODE_TYPES.TSAbstractPropertyDefinition:case N.AST_NODE_TYPES.TSAbstractMethodDefinition:case N.AST_NODE_TYPES.TSAbstractAccessorProperty:return[`abstract`];case N.AST_NODE_TYPES.PropertyDefinition:case N.AST_NODE_TYPES.MethodDefinition:case N.AST_NODE_TYPES.AccessorProperty:return[];
118
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
119
+ default:throw new P(e)}}function Lo(e){return e.async?[`async`]:[]}function Ro(e){return e.static?[`static`]:[]}function zo(e){return e.readonly?[`readonly`]:[]}function Bo(e){return e.override?[`override`]:[]}function Vo(e){return e.optional?[`optional`]:[]}function Ho(e){return e?[`decorated`]:[]}function Uo({indexSignature:e,sourceCode:t}){return{name:t.text.slice(e.range.at(0),e.typeAnnotation?.range.at(0)??e.range.at(1)),modifiers:Wo(e),selectors:[`index-signature`]}}function Wo(e){return[...Ro(e),...zo(e)]}function Go(e){switch(e.type){case N.AST_NODE_TYPES.PrivateIdentifier:return{nameWithoutStartingHash:e.name,name:`#${e.name}`,hasPrivateHash:!0};case N.AST_NODE_TYPES.Identifier:return Ko(e.name);case N.AST_NODE_TYPES.Literal:return Ko(String(e.value));
120
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
121
+ default:throw new P(e)}}function Ko(e){return{nameWithoutStartingHash:e,hasPrivateHash:!1,name:e}}function qo({ignoreCallbackDependenciesPatterns:e,sortingNodes:t,sourceCode:n,classBody:r}){let i=ke({additionalIdentifierDependenciesComputer:Xo({ignoreCallbackDependenciesPatterns:e,staticSortingNodes:t.filter(e=>e.isStatic),classBody:r}),shouldIgnoreSortingNodeComputer:e=>Qo(e.node),sortingNodes:t,sourceCode:n}),a=Yo({ignoreCallbackDependenciesPatterns:e,sortingNodes:t,sourceCode:n});for(let[e,t]of a){let n=i.get(e)??[];i.set(e,[...n,...t])}return i}function Jo({ignoreCallbackDependenciesPatterns:e,sortingNodes:t,classElement:n,node:r}){if(n.type!==N.AST_NODE_TYPES.StaticBlock&&ze({ignoreCallbackDependenciesPatterns:e,maxParent:n,node:r}))return null;let{parent:i}=r;
122
+ /* v8 ignore if -- @preserve Unsure how we can reach that case */
123
+ if(i.type!==N.AST_NODE_TYPES.MemberExpression)return null;let a=o(i);return a?t.find(e=>e.name===a.name)??null:null;function o(e){switch(e.property.type){case N.AST_NODE_TYPES.PrivateIdentifier:case N.AST_NODE_TYPES.Identifier:case N.AST_NODE_TYPES.Literal:return Go(e.property);
124
+ /* v8 ignore next 2 -- @preserve Unhandled cases */
125
+ default:return null}}}function Yo({ignoreCallbackDependenciesPatterns:e,sortingNodes:t,sourceCode:n}){let r=/* @__PURE__ */ new Map,i=t.filter(e=>e.isStatic),a=t.filter(e=>!e.isStatic),o=t.filter(e=>!Qo(e.node));for(let t of o){let o=Zo({classElement:t.node,sourceCode:n}).map(n=>Jo({sortingNodes:t.isStatic?i:a,ignoreCallbackDependenciesPatterns:e,classElement:t.node,node:n})).filter(e=>e!==null);o.length!==0&&r.set(t,o)}return r}function Xo({ignoreCallbackDependenciesPatterns:e,staticSortingNodes:t,classBody:n}){return({referencingSortingNode:r,reference:i})=>{if(!i.resolved?.identifiers[0])return[];let a=n.parent.id;if(i.resolved?.identifiers[0]!==a)return[];let o=Jo({classElement:r.node,ignoreCallbackDependenciesPatterns:e,sortingNodes:t,node:i.identifier});return o?[o]:[]}}function Zo({classElement:e,sourceCode:t}){return t.getTokens(e).filter(r).map(n).filter(e=>e?.type===N.AST_NODE_TYPES.ThisExpression);function n(e){return t.getNodeByRangeIndex(e.range[0])}function r(e){return e.type===N.AST_TOKEN_TYPES.Keyword&&e.value===`this`}}function Qo(e){switch(e.type){case N.AST_NODE_TYPES.TSAbstractPropertyDefinition:case N.AST_NODE_TYPES.TSAbstractAccessorProperty:case N.AST_NODE_TYPES.TSAbstractMethodDefinition:case N.AST_NODE_TYPES.PropertyDefinition:case N.AST_NODE_TYPES.AccessorProperty:case N.AST_NODE_TYPES.StaticBlock:return!1;case N.AST_NODE_TYPES.MethodDefinition:case N.AST_NODE_TYPES.TSIndexSignature:return!0;
126
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
127
+ default:throw new P(e)}}function $o({nodeNameWithoutStartingHash:e,hasPrivateHash:t,isStatic:n}){return`${n?`static `:``}${t?`#`:``}${e}`}function es({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,isMemberStatic:n,expression:r,className:i}){if(t)return[];let a=[];return s(r),a;function o(t){switch(t.type){case N.AST_NODE_TYPES.ConditionalExpression:s(t.test),s(t.consequent),s(t.alternate);break;case N.AST_NODE_TYPES.MemberExpression:a.push(...ts({memberExpression:t,isMemberStatic:n,className:i}));break;case N.AST_NODE_TYPES.CallExpression:if(!(`name`in t.callee)){s(t.arguments);break}if(Re(t.callee.name,e))break;s(t.arguments);break;case N.AST_NODE_TYPES.NewExpression:s(t.arguments);break;case N.AST_NODE_TYPES.Property:s(t.key),s(t.value)}`argument`in t&&t.argument&&s(t.argument),`body`in t&&t.body&&s(t.body),`callee`in t&&s(t.callee),`declarations`in t&&s(t.declarations),`elements`in t&&s(t.elements.filter(e=>e!==null)),`expression`in t&&typeof t.expression!=`boolean`&&s(t.expression),`expressions`in t&&s(t.expressions),`init`in t&&t.init&&s(t.init),`left`in t&&s(t.left),`object`in t&&s(t.object),`properties`in t&&s(t.properties),`right`in t&&s(t.right)}function s(e){if(Array.isArray(e))for(let t of e)s(t);else o(e)}}function ts({memberExpression:e,isMemberStatic:t,className:n}){switch(e.object.type){case N.AST_NODE_TYPES.ThisExpression:return r();case N.AST_NODE_TYPES.Identifier:return e.object.name===n?r():[];default:return[]}function r(){let e=i();return e?[e]:[]}function i(){switch(e.property.type){case N.AST_NODE_TYPES.PrivateIdentifier:case N.AST_NODE_TYPES.Identifier:case N.AST_NODE_TYPES.Literal:{let{nameWithoutStartingHash:n,hasPrivateHash:r}=Go(e.property);return $o({isStatic:t||e.object.type===N.AST_NODE_TYPES.Identifier,nodeNameWithoutStartingHash:n,hasPrivateHash:r})}
128
+ /* v8 ignore next 2 -- @preserve Unhandled cases */
129
+ default:return null}}}function ns({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,staticBlock:n,className:r}){return{dependencies:es({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,expression:n,isMemberStatic:!0,className:r}),selectors:[`static-block`],modifiers:[]}}var rs=class{implementation;_overloadSignatures;constructor({overloadSignatures:e,implementation:t}){this._overloadSignatures=new Set(e),this.implementation=t}doesNodeBelongToGroup(e){return this._overloadSignatures.has(e)||this.implementation===e}};function is(e){let t=e.filter(e=>e.type===N.AST_NODE_TYPES.MethodDefinition||e.type===N.AST_NODE_TYPES.TSAbstractMethodDefinition).filter(e=>e.kind===`method`),n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let e of t){if(e.key.type!==N.AST_NODE_TYPES.Identifier)continue;let{name:t}=e.key,i=e.static?n:r,a=i.get(t);a||(a=[],i.set(t,a)),a.push(e)}return[...r.values(),...n.values()].filter(Y).map(as)}function as(e){let t=e.find(n)??e.at(-1);return new rs({overloadSignatures:e.filter(e=>!n(e)),implementation:t});function n(e){switch(e.value.type){case N.AST_NODE_TYPES.TSEmptyBodyFunctionExpression:return!1;case N.AST_NODE_TYPES.FunctionExpression:return!0;
130
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
131
+ default:throw new P(e.value)}}}function os(e,t){switch(e.key.type){case N.AST_NODE_TYPES.PrivateIdentifier:case N.AST_NODE_TYPES.Identifier:case N.AST_NODE_TYPES.Literal:return Go(e.key);default:return{nameWithoutStartingHash:t.getText(e.key),name:t.getText(e.key),hasPrivateHash:!1}}}function ss({matchedAstSelectors:e,classElements:t,context:n}){let r=t.filter(e=>e.type!==N.AST_NODE_TYPES.StaticBlock&&e.type!==N.AST_NODE_TYPES.TSIndexSignature).map(e=>os(e,n.sourceCode).name);return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}function cs(e){return e?e.type===N.AST_NODE_TYPES.ArrowFunctionExpression||e.type===N.AST_NODE_TYPES.FunctionExpression:!1}function ls({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,isDecorated:n,sourceCode:r,className:i,property:a}){let o=os(a,r),s=us({hasPrivateHash:o.hasPrivateHash,isDecorated:n,property:a});return{dependencyNames:[$o({nodeNameWithoutStartingHash:o.nameWithoutStartingHash,hasPrivateHash:o.hasPrivateHash,isStatic:s.includes(`static`)})],dependencies:ds({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,className:i,property:a}),memberValue:!cs(a.value)&&a.value?r.getText(a.value):void 0,selectors:fs(a),isStatic:a.static,nameDetails:o,modifiers:s}}function us({hasPrivateHash:e,isDecorated:t,property:n}){return[...Ro(n),...r(),...Io(n),...Ho(t),...Bo(n),...zo(n),...Fo({hasPrivateHash:e,node:n}),...Vo(n),...i()];function r(){return n.declare?[`declare`]:[]}function i(){return cs(n.value)?Lo(n.value):[]}}function ds({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,className:n,property:r}){return cs(r.value)||!r.value?[]:es({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,isMemberStatic:r.static,expression:r.value,className:n})}function fs(e){return[...t(),`property`];function t(){return cs(e.value)?[`function-property`]:[]}}function ps({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,isDecorated:n,sourceCode:r,className:i,accessor:a}){let o=os(a,r),s=hs({hasPrivateHash:o.hasPrivateHash,isDecorated:n,accessor:a});return{dependencyNames:[$o({nodeNameWithoutStartingHash:o.nameWithoutStartingHash,hasPrivateHash:o.hasPrivateHash,isStatic:s.includes(`static`)})],dependencies:ms({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,className:i,accessor:a}),selectors:[`accessor-property`],isStatic:a.static,nameDetails:o,modifiers:s}}function ms({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,className:n,accessor:r}){return cs(r.value)||!r.value?[]:es({ignoreCallbackDependenciesPatterns:e,useExperimentalDependencyDetection:t,isMemberStatic:r.static,expression:r.value,className:n})}function hs({hasPrivateHash:e,isDecorated:t,accessor:n}){return[...Ro(n),...Io(n),...Ho(t),...Bo(n),...Fo({hasPrivateHash:e,node:n})]}function gs({hasParentDeclare:e,isDecorated:t,sourceCode:n,method:r}){let i=os(r,n);return{modifiers:vs({hasPrivateHash:i.hasPrivateHash,isDecorated:t,method:r}),addSafetySemicolonWhenInline:ys({hasParentDeclare:e,method:r}),selectors:_s(r),isStatic:r.static,nameDetails:i}}function _s(e){return[...t(),`method`];function t(){switch(e.kind){case`constructor`:return[`constructor`];case`method`:return[];case`set`:return[`set-method`];case`get`:return[`get-method`];
132
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
133
+ default:throw new P(e.kind)}}}function vs({hasPrivateHash:e,isDecorated:t,method:n}){return[...Ro(n),...Io(n),...Ho(t),...Bo(n),...Fo({hasPrivateHash:e,node:n}),...Vo(n),...Lo(n.value)]}function ys({hasParentDeclare:e,method:t}){switch(t.type){case N.AST_NODE_TYPES.TSAbstractMethodDefinition:return!0;case N.AST_NODE_TYPES.MethodDefinition:return e;
134
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
135
+ default:throw new P(t)}}function bs(e){switch(e.type){case N.AST_NODE_TYPES.TSAbstractPropertyDefinition:case N.AST_NODE_TYPES.TSAbstractMethodDefinition:case N.AST_NODE_TYPES.TSAbstractAccessorProperty:case N.AST_NODE_TYPES.PropertyDefinition:case N.AST_NODE_TYPES.MethodDefinition:case N.AST_NODE_TYPES.AccessorProperty:case N.AST_NODE_TYPES.TSIndexSignature:case N.AST_NODE_TYPES.StaticBlock:return!0;default:return!1}}let xs=/* @__PURE__ */ new Map,Ss={groups:[`index-signature`,[`static-property`,`static-accessor-property`],[`static-get-method`,`static-set-method`],[`protected-static-property`,`protected-static-accessor-property`],[`protected-static-get-method`,`protected-static-set-method`],[`private-static-property`,`private-static-accessor-property`],[`private-static-get-method`,`private-static-set-method`],`static-block`,[`property`,`accessor-property`],[`get-method`,`set-method`],[`protected-property`,`protected-accessor-property`],[`protected-get-method`,`protected-set-method`],[`private-property`,`private-accessor-property`],[`private-get-method`,`private-set-method`],`constructor`,[`static-method`,`static-function-property`],[`protected-static-method`,`protected-static-function-property`],[`private-static-method`,`private-static-function-property`],[`method`,`function-property`],[`protected-method`,`protected-function-property`],[`private-method`,`private-function-property`],`unknown`],useExperimentalDependencyDetection:!0,ignoreCallbackDependenciesPatterns:[],newlinesBetweenOverloadSignatures:0,fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,specialCharacters:`keep`,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`};function Cs({matchedAstSelectors:e,context:t,node:n}){let r=n.body.filter(bs);if(!Y(r))return;let i=J(t.settings),a=X(ss({matchedAstSelectors:e,classElements:r,context:t}),i,Ss);R(a),H({modifiers:Do,selectors:Eo,options:a}),I(a);let{sourceCode:o,id:s}=t,c=z({ruleName:s,sourceCode:o}),l=L(a),u=ko(a.newlinesBetweenOverloadSignatures),d=n.parent.id?.name,f=r.reduce((e,t)=>{let r=[],i=!1,s=[];`decorators`in t&&(s=$(t).map(e=>Za({sourceCode:o,decorator:e})),i=s.length>0);let l,u,f,p,m,h,g,_;switch(t.type){case N.AST_NODE_TYPES.TSAbstractPropertyDefinition:case N.AST_NODE_TYPES.PropertyDefinition:l=!0,{dependencyNames:u,dependencies:r,memberValue:m,nameDetails:p,modifiers:g,selectors:_,isStatic:h}=ls({ignoreCallbackDependenciesPatterns:a.ignoreCallbackDependenciesPatterns,useExperimentalDependencyDetection:a.useExperimentalDependencyDetection,property:t,isDecorated:i,sourceCode:o,className:d}),{name:f}=p;break;case N.AST_NODE_TYPES.TSAbstractMethodDefinition:case N.AST_NODE_TYPES.MethodDefinition:u=[],{addSafetySemicolonWhenInline:l,nameDetails:p,selectors:_,modifiers:g,isStatic:h}=gs({hasParentDeclare:n.parent.declare,method:t,isDecorated:i,sourceCode:o}),{name:f}=p;break;case N.AST_NODE_TYPES.TSAbstractAccessorProperty:case N.AST_NODE_TYPES.AccessorProperty:l=!0,{dependencyNames:u,dependencies:r,nameDetails:p,modifiers:g,selectors:_,isStatic:h}=ps({ignoreCallbackDependenciesPatterns:a.ignoreCallbackDependenciesPatterns,useExperimentalDependencyDetection:a.useExperimentalDependencyDetection,accessor:t,isDecorated:i,sourceCode:o,className:d}),{name:f}=p;break;case N.AST_NODE_TYPES.TSIndexSignature:l=!0,u=[],p=null,h=!1,{modifiers:g,selectors:_,name:f}=Uo({indexSignature:t,sourceCode:o});break;case N.AST_NODE_TYPES.StaticBlock:l=!1,u=[],f=`static`,p=null,h=!0,{dependencies:r,selectors:_,modifiers:g}=ns({useExperimentalDependencyDetection:a.useExperimentalDependencyDetection,ignoreCallbackDependenciesPatterns:a.ignoreCallbackDependenciesPatterns,staticBlock:t,className:d});break;
136
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
137
+ default:throw new P(t)}let v=K({customGroupMatcher:e=>B({elementValue:m,elementName:f,decoratorNames:s,customGroup:e,modifiers:g,selectors:_}),predefinedGroups:yt({cache:xs,selectors:_,modifiers:g}),options:a}),y={isEslintDisabled:V(t,c),size:q(t,o),addSafetySemicolonWhenInline:l,dependencyNames:u,node:t,dependencies:r,nameDetails:p,isStatic:h,group:v,name:f},ee=e.at(-1)?.at(-1);return G({lastSortingNode:ee,sortingNode:y,sourceCode:o,options:a})&&e.push([]),e.at(-1).push({...y,partitionId:e.length}),e},[[]]),p=jo({overloadSignatureGroups:is(r),sortingNodeGroups:f});a.useExperimentalDependencyDetection&&(p=Ue({dependenciesBySortingNode:qo({ignoreCallbackDependenciesPatterns:a.ignoreCallbackDependenciesPatterns,sortingNodes:p.flat(),classBody:n,sourceCode:o}),sortingNodeGroups:p}));let m=p.flat();W({availableMessageIds:{missedSpacingBetweenMembers:wo,unexpectedDependencyOrder:To,extraSpacingBetweenMembers:Co,unexpectedGroupOrder:So,unexpectedOrder:xo},newlinesBetweenValueGetter:u,sortNodesExcludingEslintDisabled:h,nodes:m,options:a,context:t});function h(e){return Ot(p.flatMap(t=>U({isNodeIgnored:e=>Ht(a.groups,e)===a.groups.length,comparatorByOptionsComputer:F,optionsByGroupIndexComputer:l,ignoreEslintDisabledNodes:e,nodes:t,groups:a.groups})),{ignoreEslintDisabledNodes:e})}}var ws=Q({meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:Oo}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),useExperimentalDependencyDetection:re,newlinesBetweenOverloadSignatures:ie,ignoreCallbackDependenciesPatterns:x(),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[To]:Se,[wo]:k,[Co]:O,[So]:D,[xo]:E},docs:{url:`https://perfectionist.dev/rules/sort-classes`,description:`Enforce sorted classes.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.ClassBody],sorter:Cs,context:e}),defaultOptions:[Ss],name:`sort-classes`});let Ts=[`side-effect-style`,`tsconfig-path`,`side-effect`,`external`,`internal`,`builtin`,`sibling`,`subpath`,`import`,`parent`,`index`,`style`,`type`],Es=[`default`,`multiline`,`named`,`require`,`side-effect`,`singleline`,`ts-equals`,`type`,`value`,`wildcard`],Ds={modifiers:C(Es),selector:w(Ts)},Os={sortBy:{enum:[`specifier`,`path`],type:`string`}};const ks=`type-import-first`;function As(e){return e.type===N.AST_NODE_TYPES.TSImportEqualsDeclaration&&e.moduleReference.type!==N.AST_NODE_TYPES.TSExternalModuleReference}let js,Ms=!1,Ns=[`createModuleResolutionCache`,`isExternalModuleNameRelative`,`parseJsonConfigFileContent`,`readConfigFile`,`resolveModuleName`,`sys`];function Ps(){if(js)return js;if(Ms)return null;Ms=!0;try{let e=t(import.meta.url)(`typescript`);return Fs(e)?(js=e,js):null}catch{return null}}function Fs(e){return Ns.every(t=>Object.hasOwn(e,t))}const Is=/* @__PURE__ */ new Set([18002,18003]);let Ls=/* @__PURE__ */ new Map,Rs=/* @__PURE__ */ new Map;function zs({tsconfigFilename:e,tsconfigRootDir:t,contextCwd:i,filePath:a}){let o=Ps();if(!o)return null;let s=r.dirname(a),c=[s];do{let t=r.join(s,e),a=Ls.get(s);if(!a&&n.existsSync(t)&&(a=t),a){for(let e of c)Ls.set(e,a);return Bs(o,i,a)}s=r.dirname(s),c.push(s)}while(s.length>1&&s.length>=t.length);throw Error(`Couldn't find any ${e} relative to '${a}' within '${t}'.`)}function Bs(e,t,n){if(Rs.has(n))return Rs.get(n);let i=e.readConfigFile(n,e.sys.readFile);if(i.error)throw Error(`Error reading tsconfig file: ${JSON.stringify(i.error)}`);let a=e.parseJsonConfigFileContent(i.config,e.sys,r.dirname(n)),o=a.errors.filter(e=>!Is.has(e.code));if(o.length>0)throw Error(`Error getting compiler options: ${JSON.stringify(o)}`);let s=e.createModuleResolutionCache(t,t=>e.sys.resolvePath(t),a.options),c={compilerOptions:a.options,cache:s};return Rs.set(n,c),c}let Vs=e=>{switch(e.type){case`type-import-first`:return(t,n)=>Hs(t,n,e);case`subgroup-order`:case`alphabetical`:case`line-length`:case`unsorted`:case`natural`:case`custom`:switch(e.sortBy){case`specifier`:return Us({...e,type:e.type});case`path`:return F({...e,type:e.type});
138
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
139
+ default:throw new P(e.sortBy)}
140
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
141
+ default:throw new P(e.type)}};function Hs(e,t,n){return e.isTypeImport&&t.isTypeImport||!e.isTypeImport&&!t.isTypeImport?0:Je(e.isTypeImport?-1:1,n.order)}let Us=lt(e=>e.specifierName??``);function Ws(e){return e===`side-effect`||e===`side-effect-style`}function Gs(e){if(!e)return!1;let t=Ft([e]);return t.length!==0&&t.every(Ws)}function Ks({sortSideEffects:e,groups:t}){if(!e&&t.map(e=>Ft([e])).some(e=>qs(e)&&!Gs(e)))throw Error(`Side effect groups cannot be nested with non side effect groups when 'sortSideEffects' is 'false'.`)}function qs(e){return e.some(Ws)}function Js(e){return e.type===N.AST_NODE_TYPES.ImportDeclaration?Ys(e):[]}function Ys(e){let t=e.specifiers;return[...Xs(t,N.AST_NODE_TYPES.ImportDefaultSpecifier)?[`default`]:[],...Xs(t,N.AST_NODE_TYPES.ImportNamespaceSpecifier)?[`wildcard`]:[],...Xs(t,N.AST_NODE_TYPES.ImportSpecifier)?[`named`]:[]]}function Xs(e,t){return e.some(e=>e.type===t)}function Zs(e){return{...e,groups:e.groups.filter(e=>!Array.isArray(e)||e.length>0).map(e=>Array.isArray(e)?Qs(e):e)}}function Qs(e){return e.length===1&&e[0]?e[0]:e}let $s=/* @__PURE__ */ new Map;function ec({tsConfigOutput:e,name:t}){return e.compilerOptions.paths?Object.keys(e.compilerOptions.paths).some(e=>tc(e).test(t)):!1}function tc(e){let t=$s.get(e);if(t)return t;let n=RegExp(`^${nc(e).replaceAll(`*`,`(.+)`)}$`);return $s.set(e,n),n}function nc(e){return e.replaceAll(/[$+.?[\\\]]/gu,String.raw`\$&`)}function rc({tsConfigOutput:e,filename:t,options:n,name:r}){function i(e){return n.internalPattern.some(t=>Re(e,t))}let a=i(r)?`internal`:cc({tsConfigOutput:e,filename:t,name:r}),o=[];return e&&ec({tsConfigOutput:e,name:r})&&o.push(`tsconfig-path`),oc.has(r)&&o.push(`index`),uc(r)&&o.push(`sibling`),dc(r)&&o.push(`parent`),fc(r)&&o.push(`subpath`),a===`internal`&&o.push(`internal`),lc(r,n.environment)&&o.push(`builtin`),a===`external`&&o.push(`external`),o}let ic=/* @__PURE__ */ new Set([`detect-libc`,`bun:sqlite`,`bun:test`,`bun:wrap`,`bun:ffi`,`bun:jsc`,`undici`,`bun`,`ws`]),ac=new Set(e),oc=/* @__PURE__ */ new Set([`./index.d.js`,`./index.d.ts`,`./index.js`,`./index.ts`,`./index`,`./`,`.`]),sc=/* @__PURE__ */ new Set([...e.filter(e=>e.startsWith(`node:`)),`node:sqlite`,`node:test`,`node:sea`]);function cc({tsConfigOutput:e,filename:t,name:n}){let r=Ps();if(!r)return!n.startsWith(`.`)&&!n.startsWith(`/`)?`external`:null;if(r.isExternalModuleNameRelative(n))return null;if(!e)return`external`;let i=r.resolveModuleName(n,t,e.compilerOptions,r.sys,e.cache);return typeof i.resolvedModule?.isExternalLibraryImport==`boolean`?i.resolvedModule.isExternalLibraryImport?`external`:`internal`:`external`}function lc(e,t){function n(e){return e.replace(/^(?:node:){1,2}/u,``)}let[r]=e.split(`/`,1),i=n(e),a=n(r);return ac.has(i)||ac.has(a)||sc.has(e)||sc.has(`node:${i}`)||sc.has(r)||sc.has(`node:${a}`)?!0:t===`bun`&&ic.has(e)}function uc(e){return e.startsWith(`./`)}function dc(e){return e.startsWith(`..`)}function fc(e){return e.startsWith(`#`)}function pc({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.TSImportEqualsDeclaration:return[t.id.name];case N.AST_NODE_TYPES.VariableDeclaration:return[];case N.AST_NODE_TYPES.ImportDeclaration:return t.specifiers.map(n);
142
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
143
+ default:throw new P(t)}function n(t){switch(t.type){case N.AST_NODE_TYPES.ImportNamespaceSpecifier:case N.AST_NODE_TYPES.ImportDefaultSpecifier:return e.getText(t.local);case N.AST_NODE_TYPES.ImportSpecifier:return e.getText(t.imported);
144
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
145
+ default:throw new P(t)}}}let mc={properties:{rootDir:{description:`Specifies the tsConfig root directory.`,type:`string`},filename:{description:`Specifies the tsConfig filename.`,type:`string`}},additionalProperties:!1,required:[`rootDir`],type:`object`};function hc({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.TSImportEqualsDeclaration:return t.id.name;case N.AST_NODE_TYPES.VariableDeclaration:return gc(t,e);case N.AST_NODE_TYPES.ImportDeclaration:return _c(t);
146
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
147
+ default:throw new P(t)}}function gc(e,t){let[n]=e.declarations;switch(n.id.type){case N.AST_NODE_TYPES.ObjectPattern:return r(n.id.properties[0]);case N.AST_NODE_TYPES.ArrayPattern:return n.id.elements[0]?t.getText(n.id.elements[0]):null;case N.AST_NODE_TYPES.Identifier:return n.id.name;
148
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
149
+ default:throw new P(n.id)}function r(e){if(!e)return null;switch(e.type){case N.AST_NODE_TYPES.RestElement:return t.getText(e.argument);case N.AST_NODE_TYPES.Property:return t.getText(e.value);
150
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
151
+ default:throw new P(e)}}}function _c(e){let[t]=e.specifiers;if(!t)return null;switch(t.type){case N.AST_NODE_TYPES.ImportNamespaceSpecifier:return t.local.name;case N.AST_NODE_TYPES.ImportDefaultSpecifier:return t.local.name;case N.AST_NODE_TYPES.ImportSpecifier:return t.local.name;
152
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
153
+ default:throw new P(t)}}function vc(e){switch(e.type){case N.AST_NODE_TYPES.TSImportEqualsDeclaration:return yc(e);case N.AST_NODE_TYPES.VariableDeclaration:case N.AST_NODE_TYPES.ImportDeclaration:return[];
154
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
155
+ default:throw new P(e)}}function yc(e){switch(e.moduleReference.type){case N.AST_NODE_TYPES.TSExternalModuleReference:case N.AST_NODE_TYPES.Identifier:return[];case N.AST_NODE_TYPES.TSQualifiedName:{let t=bc(e.moduleReference);return t?[t]:[]}
156
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
157
+ default:throw new P(e.moduleReference)}}function bc(e){let t=e;for(;t.type===N.AST_NODE_TYPES.TSQualifiedName;)t=t.left;switch(t.type){
158
+ /* v8 ignore next -- @preserve Unsure how we can reach that case */
159
+ case N.AST_NODE_TYPES.ThisExpression:return null;case N.AST_NODE_TYPES.Identifier:return t.name;
160
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
161
+ default:throw new P(t)}}function xc({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.TSImportEqualsDeclaration:case N.AST_NODE_TYPES.VariableDeclaration:return!1;case N.AST_NODE_TYPES.ImportDeclaration:return t.specifiers.length===0&&!/\}\s*from\s+/u.test(e.getText(t));
162
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
163
+ default:throw new P(t)}}function Sc({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.TSImportEqualsDeclaration:return n(t);case N.AST_NODE_TYPES.VariableDeclaration:{let{value:e}=t.declarations[0].init.arguments[0];return e.toString()}case N.AST_NODE_TYPES.ImportDeclaration:return t.source.value;
164
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
165
+ default:throw new P(t)}function n(t){switch(t.moduleReference.type){case N.AST_NODE_TYPES.TSExternalModuleReference:return t.moduleReference.expression.value;case N.AST_NODE_TYPES.TSQualifiedName:case N.AST_NODE_TYPES.Identifier:return e.getText(t.moduleReference);
166
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
167
+ default:throw new P(t.moduleReference)}}}let Cc=/* @__PURE__ */ new Map;const wc=`unexpectedImportsOrder`,Tc=`unexpectedImportsGroupOrder`,Ec=`extraSpacingBetweenImports`,Dc=`missedSpacingBetweenImports`,Oc=`missedCommentAboveImport`,kc=`unexpectedImportsDependencyOrder`;let Ac={groups:[`type-import`,[`value-builtin`,`value-external`],`type-internal`,`value-internal`,[`type-parent`,`type-sibling`,`type-index`],[`value-parent`,`value-sibling`,`value-index`],`ts-equals-import`,`unknown`],internalPattern:[`^~/.+`,`^@/.+`,`^#.+`],useExperimentalDependencyDetection:!0,fallbackSort:{type:`unsorted`},partitionByComment:!1,partitionByNewLine:!1,specialCharacters:`keep`,tsconfig:{rootDir:``},maxLineLength:1/0,sortSideEffects:!1,type:`alphabetical`,environment:`node`,newlinesBetween:1,newlinesInside:0,customGroups:[],ignoreCase:!0,locales:`en-US`,sortBy:`path`,alphabet:``,order:`asc`};var jc=Q({create:e=>{let t=J(e.settings),n=Zs(X(e.options.at(0),t,Ac));H({selectors:Ts,modifiers:Es,options:n}),R(n),I(n),Ks(n);let r=n.tsconfig.rootDir,i=r?zs({tsconfigFilename:n.tsconfig.filename??`tsconfig.json`,tsconfigRootDir:r,filePath:e.physicalFilename,contextCwd:e.cwd}):null,{sourceCode:a,filename:o,id:s}=e,c=z({ruleName:s,sourceCode:a}),l=[],u=new Set(n.groups.flat()),d=u.has(`side-effect`),f=u.has(`side-effect-style`);function p(e){let t=Sc({sourceCode:a,node:e}),r=rc({tsConfigOutput:i,filename:o,options:n,name:t}),s=[],u=[],p=null;e.type!==N.AST_NODE_TYPES.VariableDeclaration&&e.importKind===`type`&&(s.push(`type`),u.push(`type`));let m=xc({sourceCode:a,node:e}),h=Fc(t),g=m&&h;if(!As(e)){g&&s.push(`side-effect-style`),m&&(s.push(`side-effect`),u.push(`side-effect`)),h&&s.push(`style`);for(let e of r)s.push(e)}s.push(`import`),u.includes(`type`)||u.push(`value`),e.type===N.AST_NODE_TYPES.TSImportEqualsDeclaration&&u.push(`ts-equals`),e.type===N.AST_NODE_TYPES.VariableDeclaration&&u.push(`require`),u.push(...Js(e)),ha(e)?u.push(`singleline`):u.push(`multiline`),p??=Nc({selectors:s,modifiers:u,options:n,name:t})??`unknown`;let _=e.type===N.AST_NODE_TYPES.ImportDeclaration&&Y(e.specifiers),v=q(e,a);_&&v>n.maxLineLength&&(v=t.length+10),l.push({isIgnored:!n.sortSideEffects&&m&&!d&&(!g||!f),dependencies:n.useExperimentalDependencyDetection?[]:vc(e),isEslintDisabled:V(e,c),dependencyNames:pc({sourceCode:a,node:e}),specifierName:hc({sourceCode:a,node:e}),isTypeImport:u.includes(`type`),addSafetySemicolonWhenInline:!0,group:p,size:v,name:t,node:e})}return{VariableDeclaration:e=>{e.declarations[0].init?.type===N.AST_NODE_TYPES.CallExpression&&e.declarations[0].init.callee.type===N.AST_NODE_TYPES.Identifier&&e.declarations[0].init.callee.name===`require`&&e.declarations[0].init.arguments[0]?.type===N.AST_NODE_TYPES.Literal&&p(e)},"Program:exit":()=>{Mc({sortingNodesWithoutPartitionId:l,context:e,options:n})},TSImportEqualsDeclaration:p,ImportDeclaration:p}},meta:{schema:{items:{properties:{...y({allowedAdditionalTypeValues:[ks],additionalSortProperties:Os}),...S({additionalCustomGroupMatchProperties:Ds,allowedAdditionalTypeValues:[ks],additionalSortProperties:Os}),maxLineLength:{description:`Specifies the maximum line length.`,exclusiveMinimum:!0,type:`integer`,minimum:0},sortSideEffects:{description:`Controls whether side-effect imports should be sorted.`,type:`boolean`},environment:{description:`Specifies the environment.`,enum:[`node`,`bun`],type:`string`},useExperimentalDependencyDetection:re,partitionByComment:A,partitionByNewLine:j,internalPattern:x(),tsconfig:mc},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[Oc]:Ce,[kc]:Se,[Dc]:k,[Ec]:O,[Tc]:D,[wc]:E},docs:{url:`https://perfectionist.dev/rules/sort-imports`,description:`Enforce sorted imports.`,recommended:!0},type:`suggestion`,fixable:`code`},defaultOptions:[Ac],name:`sort-imports`});function Mc({sortingNodesWithoutPartitionId:e,options:t,context:n}){let{sourceCode:r}=n,i=L(t),a=[[[]]];for(let n of e){let e=a.at(-1),i=e.at(-1),o=i.at(-1);o&&s(o,n)?(i=[],e=[i],a.push(e)):G({sortingNode:n,lastSortingNode:o,sourceCode:r,options:t})&&(i=[],e.push(i)),i.push({...n,partitionId:e.length})}for(let e of a){let i=[...e];t.useExperimentalDependencyDetection&&(i=Ue({dependenciesBySortingNode:ke({sortingNodes:i.flat(),sourceCode:r}),sortingNodeGroups:i}));let a=i.flat();W({availableMessageIds:{unexpectedDependencyOrder:kc,missedSpacingBetweenMembers:Dc,extraSpacingBetweenMembers:Ec,missedCommentAbove:Oc,unexpectedGroupOrder:Tc,unexpectedOrder:wc},sortNodesExcludingEslintDisabled:o(i),nodes:a,options:t,context:n})}function o(e){return function(n){return Ot(e.flatMap(e=>U({isNodeIgnoredForGroup:({groupIndex:e})=>!t.sortSideEffects&&Gs(t.groups[e]),isNodeIgnored:e=>e.isIgnored,optionsByGroupIndexComputer:i,comparatorByOptionsComputer:Vs,ignoreEslintDisabledNodes:n,groups:t.groups,nodes:e})),{ignoreEslintDisabledNodes:n})}}function s(e,t){return r.getTokensBetween(e.node,t.node,{includeComments:!1}).length>0}}function Nc({selectors:e,modifiers:t,options:n,name:r}){let i=K({customGroupMatcher:n=>B({elementName:r,customGroup:n,modifiers:t,selectors:e}),predefinedGroups:yt({cache:Cc,selectors:e,modifiers:t}),options:n});return i===`unknown`?null:i}let Pc=[`.less`,`.scss`,`.sass`,`.styl`,`.pcss`,`.css`,`.sss`];function Fc(e){let[t]=e.split(`?`,1);return Pc.some(e=>t?.endsWith(e))}let Ic=[`export`],Lc=[`value`,`type`,`named`,`wildcard`,`multiline`,`singleline`],Rc={modifiers:C(Lc),selector:w(Ic)},zc=/* @__PURE__ */ new Map;const Bc=`unexpectedExportsOrder`,Vc=`unexpectedExportsGroupOrder`,Hc=`extraSpacingBetweenExports`,Uc=`missedSpacingBetweenExports`,Wc=`missedCommentAboveExport`;let Gc={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,newlinesBetween:`ignore`,partitionByNewLine:!1,type:`alphabetical`,customGroups:[],ignoreCase:!0,locales:`en-US`,alphabet:``,order:`asc`,groups:[]};var Kc=Q({create:e=>{let t=J(e.settings),n=X(e.options.at(0),t,Gc);R(n),H({modifiers:Lc,selectors:Ic,options:n}),I(n);let{sourceCode:r,id:i}=e,a=z({ruleName:i,sourceCode:r}),o=[[]];function s(e){if(!e.source)return;let t=`export`,i=[Jc(e),Yc(e),Xc(e)],s=e.source.value,c=K({customGroupMatcher:e=>B({selectors:[t],elementName:s,customGroup:e,modifiers:i}),predefinedGroups:yt({cache:zc,selectors:[t],modifiers:i}),options:n}),l={isEslintDisabled:V(e,a),size:q(e,r),addSafetySemicolonWhenInline:!0,group:c,name:s,node:e},u=o.at(-1)?.at(-1);G({lastSortingNode:u,sortingNode:l,sourceCode:r,options:n})&&o.push([]),o.at(-1).push({...l,partitionId:o.length})}return{"Program:exit":()=>{qc({formattedMembers:o,context:e,options:n})},ExportNamedDeclaration:s,ExportAllDeclaration:s}},meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:Rc}),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[Wc]:Ce,[Uc]:k,[Hc]:O,[Vc]:D,[Bc]:E},docs:{url:`https://perfectionist.dev/rules/sort-exports`,description:`Enforce sorted exports.`,recommended:!0},type:`suggestion`,fixable:`code`},defaultOptions:[Gc],name:`sort-exports`});function qc({formattedMembers:e,context:t,options:n}){let r=L(n),i=e.flat();W({availableMessageIds:{missedSpacingBetweenMembers:Uc,extraSpacingBetweenMembers:Hc,missedCommentAbove:Wc,unexpectedGroupOrder:Vc,unexpectedOrder:Bc},sortNodesExcludingEslintDisabled:a,options:n,context:t,nodes:i});function a(t){return e.flatMap(e=>U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:r,ignoreEslintDisabledNodes:t,groups:n.groups,nodes:e}))}}function Jc(e){let t=`exportKind`in e?e.exportKind:void 0;switch(t){case void 0:case`value`:return`value`;case`type`:return`type`;
168
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
169
+ default:throw new P(t)}}function Yc(e){switch(e.type){case N.AST_NODE_TYPES.ExportNamedDeclaration:return`named`;case N.AST_NODE_TYPES.ExportAllDeclaration:return`wildcard`;
170
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
171
+ default:throw new P(e)}}function Xc(e){return ha(e)?`singleline`:`multiline`}const Zc=`unexpectedObjectsOrder`,Qc=`unexpectedObjectsGroupOrder`,$c=`extraSpacingBetweenObjectMembers`,el=`missedSpacingBetweenObjectMembers`,tl=`unexpectedObjectsDependencyOrder`;let nl=[N.AST_NODE_TYPES.VariableDeclarator,N.AST_NODE_TYPES.CallExpression,N.AST_NODE_TYPES.Property],rl=[`member`,`method`,`property`],il=[`multiline`],al={sortBy:{enum:[`name`,`value`],type:`string`}},ol={modifiers:C(il),selector:w(rl),elementValuePattern:x()};function sl({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.VariableDeclarator:return cl({node:t.id,sourceCode:e});case N.AST_NODE_TYPES.Property:return cl({node:t.key,sourceCode:e});
172
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
173
+ default:throw new P(t)}}function cl({sourceCode:e,node:t}){switch(t.type){case N.AST_NODE_TYPES.Identifier:return t.name;case N.AST_NODE_TYPES.Literal:return String(t.value);default:return e.getText(t)}}function ll({callingFunctionNamePattern:e,parentNodes:t,sourceCode:n}){return $i({allowedNodeTypes:/* @__PURE__ */ new Set([N.AST_NODE_TYPES.CallExpression]),nodeValuesComputer:ul(n),scopedRegexOption:e,parentNodes:t})}function ul(e){return t=>[e.getText(t.callee)]}let dl=[N.AST_NODE_TYPES.VariableDeclarator,N.AST_NODE_TYPES.Property];function fl({declarationMatchesPattern:e,parentNodes:t,sourceCode:n}){return $i({nodeValuesComputer:pl(n),scopedRegexOption:e,allowedNodeTypes:new Set(dl),parentNodes:t})}function pl(e){return t=>[sl({sourceCode:e,node:t})]}function ml({declarationCommentMatchesPattern:e,parentNodes:t,sourceCode:n}){return $i({nodeValuesComputer:gl(n),scopedRegexOption:e,allowedNodeTypes:new Set(nl),parentNodes:t})}function hl(e){let t=e.type;switch(t){case N.AST_NODE_TYPES.VariableDeclarator:{let t=e.parent;return t.parent?.type===N.AST_NODE_TYPES.ExportNamedDeclaration?t.parent:t}case N.AST_NODE_TYPES.CallExpression:case N.AST_NODE_TYPES.Property:return e;
174
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
175
+ default:throw new P(t)}}function gl(e){return t=>{let n=hl(t);return e.getCommentsBefore(n).map(e=>e.value.trim())}}function _l({isDestructuredObject:e,matchedAstSelectors:t,sourceCode:n,nodeObject:r,context:i}){let a=r.properties.filter(e=>e.type!==N.AST_NODE_TYPES.SpreadElement&&e.type!==N.AST_NODE_TYPES.RestElement).map(e=>sl({node:e,sourceCode:n})),o=Me({allowedTypes:[...nl],consecutiveOnly:!1,node:r,maxParent:null});return i.options.find(i=>vl({isDestructuredObject:e,matchedAstSelectors:t,parentNodes:o,sourceCode:n,nodeObject:r,nodeNames:a,options:i}))}function vl({isDestructuredObject:e,matchedAstSelectors:t,parentNodes:n,sourceCode:r,nodeObject:i,nodeNames:a,options:o}){return!o.useConfigurationIf||St({allNamesMatchPattern:o.useConfigurationIf.allNamesMatchPattern,nodeNames:a})&&bl({objectType:o.useConfigurationIf.objectType,isDestructuredObject:e})&&ll({callingFunctionNamePattern:o.useConfigurationIf.callingFunctionNamePattern,parentNodes:n,sourceCode:r})&&fl({declarationMatchesPattern:o.useConfigurationIf.declarationMatchesPattern,parentNodes:n,sourceCode:r})&&yl({hasNumericKeysOnlyFilter:o.useConfigurationIf.hasNumericKeysOnly,object:i})&&ml({declarationCommentMatchesPattern:o.useConfigurationIf.declarationCommentMatchesPattern,parentNodes:n,sourceCode:r})&&Ct({matchesAstSelector:o.useConfigurationIf.matchesAstSelector,matchedAstSelectors:t})}function yl({hasNumericKeysOnlyFilter:e,object:t}){let n=r();switch(e){case void 0:return!0;case!1:return!n;case!0:return n;
176
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
177
+ default:throw new P(e)}function r(){switch(t.type){case N.AST_NODE_TYPES.ObjectExpression:return t.properties.every(e=>e.type===N.AST_NODE_TYPES.Property&&e.key.type===N.AST_NODE_TYPES.Literal&&typeof e.key.value==`number`);case N.AST_NODE_TYPES.ObjectPattern:return!1;
178
+ /* v8 ignore next 2 */
179
+ default:throw new P(t)}}}function bl({isDestructuredObject:e,objectType:t}){switch(t){case`non-destructured`:return!e;case`destructured`:return e;case void 0:return!0;
180
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
181
+ default:throw new P(t)}}function xl(e){let t=e;for(;t.type===N.AST_NODE_TYPES.AssignmentPattern;)t=t.left;switch(t.type){case N.AST_NODE_TYPES.ObjectPattern:return t.properties.flatMap(r);case N.AST_NODE_TYPES.ArrayPattern:return t.elements.flatMap(n);case N.AST_NODE_TYPES.Identifier:return[t.name];
182
+ /* v8 ignore next 2 */
183
+ default:return[]}function n(e){return e?e.type===N.AST_NODE_TYPES.RestElement?xl(e.argument):xl(e):[]}function r(e){switch(e.type){case N.AST_NODE_TYPES.RestElement:return xl(e.argument);case N.AST_NODE_TYPES.Property:return xl(e.value);
184
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
185
+ default:throw new P(e)}}}function Sl(e){if(e.value.type!==N.AST_NODE_TYPES.AssignmentPattern)return[];let t=[];return r(e.value.right),t;function n(e){e.type!==N.AST_NODE_TYPES.ArrowFunctionExpression&&e.type!==N.AST_NODE_TYPES.FunctionExpression&&(e.type===N.AST_NODE_TYPES.Identifier&&t.push(e.name),e.type===N.AST_NODE_TYPES.Property&&(r(e.key),r(e.value)),e.type===N.AST_NODE_TYPES.ConditionalExpression&&(r(e.test),r(e.consequent),r(e.alternate)),`expression`in e&&typeof e.expression!=`boolean`&&r(e.expression),`object`in e&&r(e.object),`callee`in e&&r(e.callee),`left`in e&&r(e.left),`right`in e&&r(e.right),`elements`in e&&r(e.elements.filter(e=>e!==null)),`argument`in e&&e.argument&&r(e.argument),`arguments`in e&&r(e.arguments),`properties`in e&&r(e.properties),`expressions`in e&&r(e.expressions))}function r(e){if(Array.isArray(e))for(let t of e)r(t);else n(e)}}function Cl(e){if(e.type===N.AST_NODE_TYPES.ObjectPattern)return!1;let t=Tl(e);return wl(t.parent)?!0:t.parent.type===N.AST_NODE_TYPES.ArrowFunctionExpression&&wl(t.parent.parent)}function wl(e){switch(e.type){case N.AST_NODE_TYPES.JSXExpressionContainer:return e.parent.type===N.AST_NODE_TYPES.JSXAttribute&&e.parent.name.name===`style`;case N.AST_NODE_TYPES.CallExpression:return Dl(e.callee)||e.callee.type===N.AST_NODE_TYPES.MemberExpression&&El(e.callee.object)||e.callee.type===N.AST_NODE_TYPES.CallExpression&&El(e.callee.callee);default:return!1}}function Tl(e){let t=e;for(;t.parent.type===N.AST_NODE_TYPES.Property&&t.parent.parent.type===N.AST_NODE_TYPES.ObjectExpression;)t=t.parent.parent;return t}function El(e){return e.type===N.AST_NODE_TYPES.Identifier&&e.name===`styled`}function Dl(e){return e.type===N.AST_NODE_TYPES.Identifier&&e.name===`css`}function Ol({isDestructuredObject:e,sourceCode:t,property:n}){switch(n.value.type){case N.AST_NODE_TYPES.ArrowFunctionExpression:case N.AST_NODE_TYPES.FunctionExpression:return null;case N.AST_NODE_TYPES.AssignmentPattern:switch(n.value.right.type){case N.AST_NODE_TYPES.ArrowFunctionExpression:case N.AST_NODE_TYPES.FunctionExpression:return null;default:return t.getText(n.value.right)}default:return e?null:t.getText(n.value)}}let kl=/* @__PURE__ */ new Map,Al={useExperimentalDependencyDetection:!0,ignoreCallbackDependenciesPatterns:[],fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,partitionByComputedKey:!1,partitionByNewLine:!1,partitionByComment:!1,newlinesBetween:`ignore`,specialCharacters:`keep`,styledComponents:!0,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,sortBy:`name`,alphabet:``,order:`asc`,groups:[]};function jl({matchedAstSelectors:e,context:t,node:n}){if(!Y(n.properties))return;let{sourceCode:r,id:i}=t,a=J(t.settings),o=n.type===N.AST_NODE_TYPES.ObjectPattern,s=X(_l({isDestructuredObject:o,matchedAstSelectors:e,nodeObject:n,sourceCode:r,context:t}),a,Al);if(R(s),H({selectors:rl,modifiers:il,options:s}),I(s),!s.styledComponents&&Cl(n))return;let c=z({ruleName:i,sourceCode:r}),l=L(s),u=[[]];for(let e of n.properties){if(e.type===N.AST_NODE_TYPES.SpreadElement||e.type===N.AST_NODE_TYPES.RestElement||!o&&s.partitionByComputedKey&&e.computed){u.push([]);continue}let t=u.at(-1)?.at(-1),n=[],i=[];e.value.type===N.AST_NODE_TYPES.ArrowFunctionExpression||e.value.type===N.AST_NODE_TYPES.FunctionExpression?n.push(`method`):n.push(`property`),n.push(`member`),ha(e)||i.push(`multiline`);let a=sl({node:e,sourceCode:r}),l=[a];o&&(l=[...new Set(xl(e.value))]);let d=Ol({isDestructuredObject:o,sourceCode:r,property:e}),f=K({customGroupMatcher:e=>B({elementValue:d,elementName:a,customGroup:e,selectors:n,modifiers:i}),predefinedGroups:yt({cache:kl,selectors:n,modifiers:i}),options:s}),p={dependencies:s.useExperimentalDependencyDetection?[]:Sl(e),isEslintDisabled:V(e,c),size:q(e,r),value:d??``,dependencyNames:l,node:e,group:f,name:a};G({lastSortingNode:t,sortingNode:p,sourceCode:r,options:s})&&u.push([]),u.at(-1).push({...p,partitionId:u.length})}s.useExperimentalDependencyDetection&&(u=Ue({dependenciesBySortingNode:He({ignoreCallbackDependenciesPatterns:s.ignoreCallbackDependenciesPatterns,sortingNodes:u.flat(),sourceCode:r}),sortingNodeGroups:u}));let d=u.flat();W({availableMessageIds:{missedSpacingBetweenMembers:el,unexpectedDependencyOrder:tl,extraSpacingBetweenMembers:$c,unexpectedGroupOrder:Qc,unexpectedOrder:Zc},sortNodesExcludingEslintDisabled:f,nodes:d,options:s,context:t});function f(e){return Ot(u.flatMap(t=>U({comparatorByOptionsComputer:Gi,optionsByGroupIndexComputer:l,ignoreEslintDisabledNodes:e,groups:s.groups,nodes:t})),{ignoreEslintDisabledNodes:e})}}var Ml=Q({meta:{schema:{items:{properties:{...y({additionalSortProperties:al}),...S({additionalCustomGroupMatchProperties:ol,additionalSortProperties:al}),useConfigurationIf:b({additionalProperties:{objectType:{description:`Specifies whether to only match destructured objects or regular objects.`,enum:[`destructured`,`non-destructured`],type:`string`},hasNumericKeysOnly:{description:`Specifies whether to only match objects that have exclusively numeric keys.`,type:`boolean`},declarationCommentMatchesPattern:Ui,callingFunctionNamePattern:Ui,matchesAstSelector:v,declarationMatchesPattern:Ui}}),partitionByComputedKey:{description:`Controls whether to partition objects by computed keys.`,type:`boolean`},styledComponents:{description:`Controls whether to sort styled components.`,type:`boolean`},useExperimentalDependencyDetection:re,ignoreCallbackDependenciesPatterns:x(),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[tl]:Se,[el]:k,[$c]:O,[Qc]:D,[Zc]:E},docs:{url:`https://perfectionist.dev/rules/sort-objects`,description:`Enforce sorted objects.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.ObjectPattern,N.AST_NODE_TYPES.ObjectExpression],sorter:jl,context:e}),defaultOptions:[Al],name:`sort-objects`});let Nl=[`enum`,`function`,`interface`,`type`,`class`],Pl=[`async`,`declare`,`decorated`,`default`,`export`],Fl={modifiers:C(Pl),selector:w(Nl),decoratorNamePattern:x()};const Il=`usage`;function Ll({sortingNodes:e,identifier:t}){let{parent:n}=t;if(n.type!==N.AST_NODE_TYPES.TSTypeReference||n.typeName!==t||zl(e,t))return!1;let r=Rl(n);if(!r)return!1;switch(r.type){case N.AST_NODE_TYPES.TSAbstractPropertyDefinition:case N.AST_NODE_TYPES.PropertyDefinition:case N.AST_NODE_TYPES.AccessorProperty:return $(r).length>0;case N.AST_NODE_TYPES.FunctionExpression:{let e=r.parent;if(e.type!==N.AST_NODE_TYPES.MethodDefinition)return!1;if(e.kind===`set`)return $(e).length>0;if(e.value.params.some(e=>$(e).length>0))return!0;switch(e.kind){case`constructor`:return $(e.parent.parent).length>0;case`method`:case`get`:return $(e).length>0;
186
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
187
+ default:throw new P(e.kind)}}default:return!1}}function Rl(e){let t=e.parent;return t.type===N.AST_NODE_TYPES.TSArrayType&&t.parent.type===N.AST_NODE_TYPES.TSTypeAnnotation&&t.parent.parent.type===N.AST_NODE_TYPES.RestElement&&(t=t.parent),t.type===N.AST_NODE_TYPES.TSTypeAnnotation?Me({allowedTypes:[N.AST_NODE_TYPES.Identifier,N.AST_NODE_TYPES.ObjectPattern,N.AST_NODE_TYPES.ArrayPattern,N.AST_NODE_TYPES.RestElement,N.AST_NODE_TYPES.AssignmentPattern,N.AST_NODE_TYPES.TSParameterProperty],consecutiveOnly:!0,node:t,maxParent:null}).at(-1)?.parent??t.parent:null}function zl(e,t){let n=e.find(e=>e.name===t.name);return n?(n.node.type===N.AST_NODE_TYPES.ExportNamedDeclaration?n.node.declaration:n.node)?.type!==N.AST_NODE_TYPES.ClassDeclaration:!1}function Bl(e,t){let n=new Set(e.dependencyNames);return t.some(e=>n.has(e))}function Vl(e){return e.type===N.AST_NODE_TYPES.PropertyDefinition||e.type===N.AST_NODE_TYPES.AccessorProperty}function Hl(e){return Vl(e)&&e.value!==null&&e.value.type===N.AST_NODE_TYPES.ArrowFunctionExpression}function Ul({emitDecoratorMetadata:e,dependencyDetection:t,sortingNodes:n,sourceCode:r}){return ke({shouldIgnoreIdentifierComputer:Wl({emitDecoratorMetadata:e,dependencyDetection:t,sortingNodes:n}),additionalIdentifierDependenciesComputer:Gl({sortingNodes:n}),shouldIgnoreSortingNodeComputer:Kl(t),sortingNodes:n,sourceCode:r})}function Wl({emitDecoratorMetadata:e,dependencyDetection:t,sortingNodes:n}){return({referencingSortingNode:r,identifier:i})=>{switch(t){case`soft`:return!1;case`hard`:return e&&Ll({sortingNodes:n,identifier:i})?!1:i.parent.type===N.AST_NODE_TYPES.TSTypeReference&&i.parent.typeName===i||!a();
188
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
189
+ default:throw new P(t)}function a(){let e=Me({allowedTypes:[N.AST_NODE_TYPES.ClassBody,N.AST_NODE_TYPES.PropertyDefinition,N.AST_NODE_TYPES.AccessorProperty,N.AST_NODE_TYPES.MethodDefinition,N.AST_NODE_TYPES.ArrowFunctionExpression],maxParent:r.node,consecutiveOnly:!1,node:i}),t=e.findIndex(e=>e.type===N.AST_NODE_TYPES.ClassBody);if(t<0)return!0;let n=e[t].body.some(e=>e.type===N.AST_NODE_TYPES.StaticBlock||e.static&&Vl(e)&&!Hl(e));return e.slice(0,t).every(e=>o(e,n))}function o(e,t){return e.type!==N.AST_NODE_TYPES.MethodDefinition&&!Hl(e)||e.static&&t}}}function Gl({sortingNodes:e}){return({referencingSortingNode:t,reference:n})=>{let r=[...i(),...a()];return e.filter(e=>Bl(e,r));function i(){return Me({allowedTypes:[N.AST_NODE_TYPES.MemberExpression],maxParent:t.node,node:n.identifier,consecutiveOnly:!0}).map(e=>e.property).filter(e=>e.type===N.AST_NODE_TYPES.Identifier).map(e=>e.name)}function a(){return Me({allowedTypes:[N.AST_NODE_TYPES.TSQualifiedName],maxParent:t.node,node:n.identifier,consecutiveOnly:!0}).map(e=>e.right.name)}}}function Kl(e){return t=>{switch(e){case`hard`:return t.dependencyDetection!==`hard`;case`soft`:return!1;
190
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
191
+ default:throw new P(e)}}}const ql=[`SvelteScriptElement`];function Jl(e,t){return![...ql,...t].includes(e.type)||!(`body`in e)||!Array.isArray(e.body)?null:e.body}function Yl(e){return e.body?.members??e.members}function Xl(e,t){let n=[];return r(e),n;function r(e,a){switch(t.type){case`hard`:if((e.type===N.AST_NODE_TYPES.MethodDefinition||Hl(e))&&(!e.static||!t.searchStaticMethodsAndFunctionProperties))return;break;case`soft`:s();break;
192
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
193
+ default:throw new P(t)}o();function o(){!a?.ignoreNextIdentifier&&e.type===N.AST_NODE_TYPES.Identifier&&n.push(e.name),`alternate`in e&&e.alternate&&r(e.alternate),`argument`in e&&e.argument&&r(e.argument),`arguments`in e&&i(e.arguments),`body`in e&&e.body&&e.type!==N.AST_NODE_TYPES.TSEnumDeclaration&&i(e.body),`callee`in e&&r(e.callee),`consequent`in e&&i(e.consequent),`declarations`in e&&i(e.declarations),`decorators`in e&&i(e.decorators),`elements`in e&&i(e.elements.filter(e=>e!==null)),`expression`in e&&typeof e.expression!=`boolean`&&r(e.expression),`expressions`in e&&i(e.expressions),`init`in e&&e.init&&r(e.init),`initializer`in e&&e.initializer&&r(e.initializer),`left`in e&&r(e.left),e.type===N.AST_NODE_TYPES.TSEnumDeclaration?i(Yl(e)):`members`in e&&i(e.members),`object`in e&&r(e.object),`properties`in e&&i(e.properties),`property`in e&&r(e.property),`right`in e&&r(e.right),`superClass`in e&&e.superClass&&r(e.superClass),`test`in e&&e.test&&r(e.test),`value`in e&&e.value&&typeof e.value==`object`&&`type`in e.value&&r(e.value)}function s(){`checkType`in e&&r(e.checkType),`constraint`in e&&e.constraint&&r(e.constraint),`declaration`in e&&e.declaration&&r(e.declaration),`elementTypes`in e&&i(e.elementTypes),`elementType`in e&&r(e.elementType),`extends`in e&&i(e.extends),`extendsType`in e&&r(e.extendsType),`exprName`in e&&r(e.exprName),`falseType`in e&&r(e.falseType),`key`in e&&r(e.key,{ignoreNextIdentifier:!0}),`id`in e&&e.id&&r(e.id),`implements`in e&&i(e.implements),`indexType`in e&&r(e.indexType),`name`in e&&typeof e.name!=`string`&&r(e.name),`objectType`in e&&r(e.objectType),`params`in e&&i(e.params,{ignoreNextIdentifier:!0}),`returnType`in e&&e.returnType&&r(e.returnType),`trueType`in e&&r(e.trueType),`typeAnnotation`in e&&e.typeAnnotation&&r(e.typeAnnotation),`typeArguments`in e&&e.typeArguments&&r(e.typeArguments),`typeName`in e&&r(e.typeName),`typeParameters`in e&&e.typeParameters&&i(e.typeParameters),`typeParameter`in e&&r(e.typeParameter),`types`in e&&i(e.types)}}function i(e,t){if(Array.isArray(e))for(let n of e)i(n,t);else r(e,t)}}function Zl({useExperimentalDependencyDetection:e,ignoreEslintDisabledNodes:t,sortingNodes:n,sourceCode:r}){let{updatedSortingNodeByNode:i,orderByUnsortedNode:a,orderBySortedNode:o}=Ql({useExperimentalDependencyDetection:e,ignoreEslintDisabledNodes:t,sortingNodes:n,sourceCode:r});return(e,t)=>{let n=e.node,r=t.node,s=o.get(n),c=a.get(n),l=o.get(r),u=a.get(r),d=s-l,f=c-u;if(Math.sign(d)!==Math.sign(f))return d;let p=i.get(n),m=i.get(r);return Dt(p,m)||Dt(m,p)?d:0}}function Ql({useExperimentalDependencyDetection:e,ignoreEslintDisabledNodes:t,sortingNodes:n,sourceCode:r}){let i;if(e){let e=Ul({dependencyDetection:`soft`,sortingNodes:n,sourceCode:r});i=Ue({sortingNodeGroups:[n],dependenciesBySortingNode:e})[0]}else i=n.map(o);let a=Ot(i,{ignoreEslintDisabledNodes:t});return{updatedSortingNodeByNode:Ao(i),orderBySortedNode:$l(a),orderByUnsortedNode:$l(n)};function o({isEslintDisabled:e,dependencyNames:t,node:n}){let r=Xl(n,{type:`soft`}),i=new Set(t);return{dependencies:r.filter(e=>!i.has(e)),isEslintDisabled:e,dependencyNames:t,node:n}}}function $l(e){let t=/* @__PURE__ */ new Map;for(let[n,{node:r}]of e.entries())t.set(r,n);return t}function eu({useExperimentalDependencyDetection:e,ignoreEslintDisabledNodes:t,sortingNodes:n,sourceCode:r}){return i=>{switch(i.type){case`subgroup-order`:case`alphabetical`:case`line-length`:case`unsorted`:case`natural`:case`custom`:return F({...i,type:i.type});case`usage`:return Zl({useExperimentalDependencyDetection:e,ignoreEslintDisabledNodes:t,sortingNodes:n,sourceCode:r});
194
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
195
+ default:throw new P(i.type)}}}function tu(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=nu(n);if(!e)continue;let r=t.get(e.name);r||(r=[],t.set(e.name,r)),r.push({...e,node:n})}let n=[];for(let e of t.values())Y(e)&&n.push(ru(e));return n}function nu(e){let t=e;for(;t.type===N.AST_NODE_TYPES.ExportDefaultDeclaration||t.type===N.AST_NODE_TYPES.ExportNamedDeclaration;){
196
+ /* v8 ignore start -- @preserve Unsure how we can reach that case */
197
+ if(!t.declaration)return null;
198
+ /* v8 ignore stop -- @preserve Unsure how we can reach that case */
199
+ t=t.declaration}switch(t.type){case N.AST_NODE_TYPES.FunctionDeclaration:case N.AST_NODE_TYPES.TSDeclareFunction:return n(t);default:return null}function n(e){return e.id?{isImplementation:e.type===N.AST_NODE_TYPES.FunctionDeclaration,name:e.id.name}:null}}function ru(e){let t=(e.find(n)??e.at(-1)).node;return new rs({overloadSignatures:e.filter(e=>!n(e)).map(e=>e.node),implementation:t});function n(e){return e.isImplementation}}function iu({useExperimentalDependencyDetection:e,node:t}){let n,r,i=[],a=[],o=[],s=!1,c=null,l=!1,u=`soft`;function d(t){switch(`declare`in t&&t.declare&&i.push(`declare`),t.type){case N.AST_NODE_TYPES.ExportDefaultDeclaration:i.push(`default`,`export`),`decorators`in t.declaration&&(o=$(t.declaration)),d(t.declaration);break;case N.AST_NODE_TYPES.ExportNamedDeclaration:t.declaration&&(`decorators`in t.declaration&&(o=$(t.declaration)),d(t.declaration)),i.push(`export`);break;case N.AST_NODE_TYPES.TSInterfaceDeclaration:n=`interface`,{name:r}=t.id;break;case N.AST_NODE_TYPES.TSTypeAliasDeclaration:n=`type`,{name:r}=t.id,s=!0;break;case N.AST_NODE_TYPES.FunctionDeclaration:case N.AST_NODE_TYPES.TSDeclareFunction:n=`function`,t.async&&i.push(`async`),i.includes(`declare`)&&(s=!0),r=t.id?.name;break;case N.AST_NODE_TYPES.TSModuleDeclaration:l=!0,c=t.body??null;break;case N.AST_NODE_TYPES.VariableDeclaration:l=!0;break;case N.AST_NODE_TYPES.TSEnumDeclaration:n=`enum`,{name:r}=t.id,u=`hard`,a.push(...au(t,e));break;case N.AST_NODE_TYPES.ClassDeclaration:n=`class`,r=t.id?.name;let f=$(t);f[0]&&i.push(`decorated`),o=f,u=`hard`,a.push(...au(t,e))}}return d(t),!n||!r?{shouldPartitionAfterNode:l,moduleBlock:c}:{nodeDetails:{addSafetySemicolonWhenInline:s,dependencyDetection:u,dependencies:a,decorators:o,modifiers:i,selector:n,name:r}}}function au(e,t){return t?[]:Xl(e,{searchStaticMethodsAndFunctionProperties:e.type===N.AST_NODE_TYPES.ClassDeclaration&&e.body.body.some(e=>e.type===N.AST_NODE_TYPES.StaticBlock||e.static&&Vl(e)&&!Hl(e)),type:`hard`})}let ou=/* @__PURE__ */ new Map;const su=`unexpectedModulesOrder`,cu=`unexpectedModulesGroupOrder`,lu=`extraSpacingBetweenModulesMembers`,uu=`missedSpacingBetweenModulesMembers`,du=`unexpectedModulesDependencyOrder`;let fu={groups:[`declare-enum`,`export-enum`,`enum`,[`declare-interface`,`declare-type`],[`export-interface`,`export-type`],[`interface`,`type`],`declare-class`,`class`,`export-class`,`declare-function`,`export-function`,`function`],useExperimentalDependencyDetection:!0,newlinesBetweenOverloadSignatures:0,fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,additionalModuleBlockTypes:[],tsconfig:{rootDir:``},partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,specialCharacters:`keep`,type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`};var pu=Q({meta:{schema:[{properties:{...y({allowedAdditionalTypeValues:[Il]}),...S({additionalCustomGroupMatchProperties:Fl,allowedAdditionalTypeValues:[Il]}),additionalModuleBlockTypes:{description:`Specifies the node types to analyze as module blocks, in addition to the built-in ones.`,items:{type:`string`},type:`array`},useExperimentalDependencyDetection:re,newlinesBetweenOverloadSignatures:ie,partitionByComment:A,partitionByNewLine:j,tsconfig:mc},additionalProperties:!1,type:`object`}],messages:{[du]:Se,[uu]:k,[lu]:O,[cu]:D,[su]:E},docs:{url:`https://perfectionist.dev/rules/sort-modules`,description:`Enforce sorted modules.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>{let t=J(e.settings),n=X(e.options.at(0),t,fu);R(n),H({modifiers:Pl,selectors:Nl,options:n}),I(n);let{sourceCode:r,id:i}=e,a=z({ruleName:i,sourceCode:r});return{Program:t=>mu({eslintDisabledLines:a,module:t,sourceCode:r,options:n,context:e})}},defaultOptions:[fu],name:`sort-modules`});function mu({eslintDisabledLines:e,sourceCode:t,options:n,context:r,module:i}){let a=L(n),o=ko(n.newlinesBetweenOverloadSignatures),s=[[]];for(let a of i.body){let i=Jl(a,n.additionalModuleBlockTypes);if(i){s.push([]),mu({module:{body:i},eslintDisabledLines:e,sourceCode:t,options:n,context:r});continue}switch(a.type){case N.AST_NODE_TYPES.TSNamespaceExportDeclaration:case N.AST_NODE_TYPES.ExportAllDeclaration:case N.AST_NODE_TYPES.ImportDeclaration:case N.AST_NODE_TYPES.DebuggerStatement:case N.AST_NODE_TYPES.ContinueStatement:case N.AST_NODE_TYPES.ReturnStatement:case N.AST_NODE_TYPES.EmptyStatement:case N.AST_NODE_TYPES.BreakStatement:case N.AST_NODE_TYPES.WithStatement:continue;case N.AST_NODE_TYPES.ExportDefaultDeclaration:case N.AST_NODE_TYPES.ExportNamedDeclaration:case N.AST_NODE_TYPES.TSInterfaceDeclaration:case N.AST_NODE_TYPES.TSTypeAliasDeclaration:case N.AST_NODE_TYPES.FunctionDeclaration:case N.AST_NODE_TYPES.TSModuleDeclaration:break;case N.AST_NODE_TYPES.TSImportEqualsDeclaration:case N.AST_NODE_TYPES.VariableDeclaration:case N.AST_NODE_TYPES.ExpressionStatement:case N.AST_NODE_TYPES.TSExportAssignment:case N.AST_NODE_TYPES.DoWhileStatement:case N.AST_NODE_TYPES.LabeledStatement:case N.AST_NODE_TYPES.SwitchStatement:case N.AST_NODE_TYPES.WhileStatement:case N.AST_NODE_TYPES.ForInStatement:case N.AST_NODE_TYPES.ForOfStatement:case N.AST_NODE_TYPES.ThrowStatement:case N.AST_NODE_TYPES.BlockStatement:case N.AST_NODE_TYPES.ForStatement:case N.AST_NODE_TYPES.TryStatement:case N.AST_NODE_TYPES.IfStatement:s.push([]);continue;case N.AST_NODE_TYPES.TSDeclareFunction:case N.AST_NODE_TYPES.TSEnumDeclaration:case N.AST_NODE_TYPES.ClassDeclaration:break;
200
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
201
+ default:continue}let o=iu({useExperimentalDependencyDetection:n.useExperimentalDependencyDetection,node:a});if(!o.nodeDetails){o.shouldPartitionAfterNode&&s.push([]),o.moduleBlock&&mu({module:o.moduleBlock,eslintDisabledLines:e,sourceCode:t,options:n,context:r});continue}let{addSafetySemicolonWhenInline:c,dependencyDetection:l,dependencies:u,decorators:d,modifiers:f,selector:p,name:m}=o.nodeDetails,h=yt({cache:ou,selectors:[p],modifiers:f}),g=d.map(e=>Za({sourceCode:t,decorator:e})),_=K({customGroupMatcher:e=>B({selectors:[p],elementName:m,decoratorNames:g,customGroup:e,modifiers:f}),predefinedGroups:h,options:n}),v={isEslintDisabled:V(a,e),size:q(a,t),implicitDecorators:d,addSafetySemicolonWhenInline:c,dependencyNames:[m],dependencyDetection:l,dependencies:u,group:_,name:m,node:a},y=s.at(-1)?.at(-1);G({lastSortingNode:y,sortingNode:v,sourceCode:t,options:n})&&s.push([]),s.at(-1)?.push({...v,partitionId:s.length})}let c=jo({sortingNodeGroups:s,overloadSignatureGroups:tu(s.flat().map(({node:e})=>e))});if(n.useExperimentalDependencyDetection){let e=n.tsconfig.rootDir?zs({tsconfigFilename:n.tsconfig.filename??`tsconfig.json`,tsconfigRootDir:n.tsconfig.rootDir,filePath:r.physicalFilename,contextCwd:r.cwd}):null;c=Ue({dependenciesBySortingNode:Ul({emitDecoratorMetadata:e?e.compilerOptions.emitDecoratorMetadata??!1:!0,sortingNodes:c.flat(),dependencyDetection:`hard`,sourceCode:t}),sortingNodeGroups:c})}let l=c.flat();W({availableMessageIds:{missedSpacingBetweenMembers:uu,unexpectedDependencyOrder:du,extraSpacingBetweenMembers:lu,unexpectedGroupOrder:cu,unexpectedOrder:su},newlinesBetweenValueGetter:o,sortNodesExcludingEslintDisabled:u,nodes:l,options:n,context:r});function u(e){return Ot(c.flatMap(r=>U({comparatorByOptionsComputer:eu({useExperimentalDependencyDetection:n.useExperimentalDependencyDetection,sortingNodes:r,ignoreEslintDisabledNodes:e,sourceCode:t}),isNodeIgnored:e=>Ht(n.groups,e)===n.groups.length,optionsByGroupIndexComputer:a,ignoreEslintDisabledNodes:e,nodes:r,groups:n.groups})),{ignoreEslintDisabledNodes:e})}}let hu=/* @__PURE__ */ new Map;const gu=`unexpectedArraysOrder`,_u=`unexpectedArraysGroupOrder`,vu=`extraSpacingBetweenArraysMembers`,yu=`missedSpacingBetweenArraysMembers`;let bu={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,groups:[`literal`],ignoreCase:!0,locales:`en-US`,customGroups:[],alphabet:``,order:`asc`},xu={items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:Jr}),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),partitionByComment:A,partitionByNewLine:j},required:[`useConfigurationIf`],additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`,minItems:1};var Su=Q({meta:{messages:{[yu]:k,[vu]:O,[_u]:D,[gu]:E},docs:{url:`https://perfectionist.dev/rules/sort-arrays`,description:`Enforce sorted arrays.`,recommended:!1},schema:xu,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.NewExpression,N.AST_NODE_TYPES.ArrayExpression],context:e,sorter:Cu}),defaultOptions:[bu],name:`sort-arrays`});function Cu({matchedAstSelectors:e,context:t,node:n}){Qr({availableMessageIds:{missedSpacingBetweenMembers:yu,extraSpacingBetweenMembers:vu,unexpectedGroupOrder:_u,unexpectedOrder:gu},cachedGroupsByModifiersAndSelectors:hu,mustHaveMatchedContextOptions:!0,matchedAstSelectors:e,defaultOptions:bu,context:t,node:n})}const wu=`unexpectedEnumsOrder`,Tu=`unexpectedEnumsGroupOrder`,Eu=`extraSpacingBetweenEnumsMembers`,Du=`missedSpacingBetweenEnumsMembers`,Ou=`unexpectedEnumsDependencyOrder`;let ku={elementValuePattern:x()};function Au({sortingNodes:e,sourceCode:t,enumName:n}){return ke({additionalIdentifierDependenciesComputer:ju({sortingNodes:e,enumName:n}),sortingNodes:e,sourceCode:t})}function ju({sortingNodes:e,enumName:t}){return({referencingSortingNode:n,reference:r})=>{if(r.identifier.name!==t)return[];let i=Mu(r.identifier,n);return e.filter(e=>Bl(e,i))}}function Mu(e,t){return Me({allowedTypes:[N.AST_NODE_TYPES.MemberExpression],maxParent:t.node,consecutiveOnly:!0,node:e}).map(e=>Nu(e.property)).filter(e=>e!==null)}function Nu(e){return e.type===N.AST_NODE_TYPES.Identifier?e.name:e.type===N.AST_NODE_TYPES.Literal&&typeof e.value==`string`?e.value:null}function Pu(e){return t=>{switch(t.sortByValue){case`ifNumericEnum`:return e?Iu(t):F(t);case`always`:return e?Iu(t):Fu(t);case`never`:return F(t);
202
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
203
+ default:throw new P(t.sortByValue)}}}let Fu=lt(e=>e.value??``),Iu=e=>{switch(e.type){
204
+ /* v8 ignore next 2 -- @preserve Untested for now as not a relevant sort for this rule. */
205
+ case`subgroup-order`:return F(e);case`alphabetical`:case`line-length`:case`natural`:case`custom`:return(t,n)=>ct(t.numericValue.toString(),n.numericValue.toString(),e);case`unsorted`:return it;
206
+ /* v8 ignore next 2 -- @preserve Exhaustive guard. */
207
+ default:throw new P(e.type)}};function Lu(e){switch(e.type){case N.AST_NODE_TYPES.BinaryExpression:return Ru(e.left,e.right,e.operator);case N.AST_NODE_TYPES.UnaryExpression:return zu(e.argument,e.operator);case N.AST_NODE_TYPES.Literal:return typeof e.value==`number`?e.value:null;default:return null}}function Ru(e,t,n){let r=Lu(e),i=Lu(t);if(r===null||i===null)return null;switch(n){case`**`:return r**i;case`>>`:return r>>i;case`<<`:return r<<i;case`+`:return r+i;case`-`:return r-i;case`*`:return r*i;case`/`:return r/i;case`%`:return r%i;case`|`:return r|i;case`&`:return r&i;case`^`:return r^i;
208
+ /* v8 ignore next 2 -- @preserve Unsure if we can reach it. */
209
+ default:return null}}function zu(e,t){let n=Lu(e);if(n===null)return null;switch(t){case`+`:return n;case`-`:return-n;case`~`:return~n;
210
+ /* v8 ignore next 2 -- @preserve Unsure if we can reach it. */
211
+ default:return null}}function Bu({sourceCode:e,node:t}){return t.id.type===N.AST_NODE_TYPES.Literal?t.id.value:e.getText(t.id)}function Vu({matchedAstSelectors:e,enumMembers:t,context:n}){let r=t.map(e=>Bu({sourceCode:n.sourceCode,node:e}));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}function Hu(e,t){let n=[],r=[e];for(;r.length>0;){let e=r.pop();switch(e.type){case N.AST_NODE_TYPES.MemberExpression:e.object.type===N.AST_NODE_TYPES.Identifier&&e.object.name===t&&(e.property.type===N.AST_NODE_TYPES.Identifier?n.push(e.property.name):e.property.type===N.AST_NODE_TYPES.Literal&&typeof e.property.value==`string`&&n.push(e.property.value));break;case N.AST_NODE_TYPES.Identifier:n.push(e.name)}if(`alternate`in e&&e.alternate&&r.push(e.alternate),`argument`in e&&e.argument&&r.push(e.argument),`arguments`in e&&r.push(...e.arguments),`callee`in e&&r.push(e.callee),`consequent`in e&&
212
+ /* v8 ignore if -- @preserve Unsure if we can reach it. */
213
+ (Array.isArray(e.consequent)?r.push(...e.consequent):r.push(e.consequent)),`elements`in e){let t=e.elements.filter(e=>e!==null);r.push(...t)}`expressions`in e&&r.push(...e.expressions),`key`in e&&r.push(e.key),`left`in e&&r.push(e.left),`object`in e&&r.push(e.object),`properties`in e&&r.push(...e.properties),`right`in e&&r.push(e.right),`test`in e&&e.test&&r.push(e.test),`value`in e&&e.value&&typeof e.value==`object`&&`type`in e.value&&r.push(e.value)}return n}let Uu={useExperimentalDependencyDetection:!0,fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,sortByValue:`ifNumericEnum`,partitionByComment:!1,partitionByNewLine:!1,specialCharacters:`keep`,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,locales:`en-US`,customGroups:[],alphabet:``,order:`asc`,groups:[]};function Wu({matchedAstSelectors:e,context:t,node:n}){let r=Yl(n);if(!Y(r)||r.some(({initializer:e})=>!e))return;let i=J(t.settings),a=X(Vu({enumMembers:r,matchedAstSelectors:e,context:t}),i,Uu);R(a),H({selectors:[],modifiers:[],options:a}),I(a);let{sourceCode:o,id:s}=t,c=z({ruleName:s,sourceCode:o}),l=L(a),u=r.reduce((e,t)=>{let r=Bu({node:t,sourceCode:o}),i=K({customGroupMatcher:e=>B({elementValue:o.getText(t.initializer),elementName:r,selectors:[],modifiers:[],customGroup:e}),predefinedGroups:[],options:a}),s=e.at(-1)?.at(-1),l={dependencies:a.useExperimentalDependencyDetection?[]:Hu(t.initializer,n.id.name),value:t.initializer?.type===N.AST_NODE_TYPES.Literal?t.initializer.value?.toString()??null:null,isEslintDisabled:V(t,c),numericValue:Lu(t.initializer),size:q(t,o),dependencyNames:[r],node:t,group:i,name:r};return G({lastSortingNode:s,sortingNode:l,sourceCode:o,options:a})&&e.push([]),e.at(-1).push({...l,partitionId:e.length}),e},[[]]);a.useExperimentalDependencyDetection&&(u=Ue({dependenciesBySortingNode:Au({sortingNodes:u.flat(),enumName:n.id.name,sourceCode:o}),sortingNodeGroups:u}));let d=u.flat(),f=d.every(e=>e.numericValue!==null);W({availableMessageIds:{missedSpacingBetweenMembers:Du,unexpectedDependencyOrder:Ou,extraSpacingBetweenMembers:Eu,unexpectedGroupOrder:Tu,unexpectedOrder:wu},sortNodesExcludingEslintDisabled:p,nodes:d,options:a,context:t});function p(e){return Ot(u.flatMap(t=>U({comparatorByOptionsComputer:Pu(f),optionsByGroupIndexComputer:l,ignoreEslintDisabledNodes:e,nodes:t,groups:a.groups})),{ignoreEslintDisabledNodes:e})}}var Gu=Q({meta:{schema:{items:{properties:{...y(),...S({additionalCustomGroupMatchProperties:ku}),sortByValue:{description:`Specifies whether to sort enums by value.`,enum:[`always`,`ifNumericEnum`,`never`],type:`string`},useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),useExperimentalDependencyDetection:re,partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[Ou]:Se,[Du]:k,[Eu]:O,[Tu]:D,[wu]:E},docs:{url:`https://perfectionist.dev/rules/sort-enums`,description:`Enforce sorted TypeScript enums.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.TSEnumDeclaration],sorter:Wu,context:e}),defaultOptions:[Uu],name:`sort-enums`});const Ku=`unexpectedMapElementsOrder`,qu=`unexpectedMapElementsGroupOrder`,Ju=`extraSpacingBetweenMapElementsMembers`,Yu=`missedSpacingBetweenMapElementsMembers`;function Xu({sourceCode:e,node:t}){if(t.type!==N.AST_NODE_TYPES.ArrayExpression)return e.getText(t);let[n]=t.elements;return n?n.type===N.AST_NODE_TYPES.Literal?n.raw:e.getText(n):`undefined`}function Zu({matchedAstSelectors:e,elements:t,context:n}){let r=t.filter(e=>e!==null&&e.type!==N.AST_NODE_TYPES.SpreadElement).map(e=>Xu({sourceCode:n.sourceCode,node:e}));return n.options.find(t=>wt({matchedAstSelectors:e,nodeNames:r,options:t}))}let Qu={fallbackSort:{type:`unsorted`},newlinesInside:`newlinesBetween`,specialCharacters:`keep`,partitionByComment:!1,partitionByNewLine:!1,newlinesBetween:`ignore`,useConfigurationIf:{},type:`alphabetical`,ignoreCase:!0,customGroups:[],locales:`en-US`,alphabet:``,order:`asc`,groups:[]};function $u({matchedAstSelectors:e,context:t,node:n}){if(n.callee.type!==N.AST_NODE_TYPES.Identifier||n.callee.name!==`Map`||n.arguments.length===0||n.arguments[0]?.type!==N.AST_NODE_TYPES.ArrayExpression)return;let[{elements:r}]=n.arguments;if(!Y(r))return;let{sourceCode:i,id:a}=t,o=J(t.settings),s=X(Zu({matchedAstSelectors:e,elements:r,context:t}),o,Qu);R(s),H({selectors:[],modifiers:[],options:s});let c=z({ruleName:a,sourceCode:i}),l=L(s),u=r.reduce((e,t)=>(t===null||t.type===N.AST_NODE_TYPES.SpreadElement?e.push([]):e.at(-1).push(t),e),[[]]);for(let e of u){let n=[[]];for(let t of e){let e=Xu({node:t,sourceCode:i}),r=n.at(-1)?.at(-1),a=K({customGroupMatcher:t=>B({elementName:e,selectors:[],modifiers:[],customGroup:t}),predefinedGroups:[],options:s}),o={isEslintDisabled:V(t,c),size:q(t,i),node:t,group:a,name:e};G({lastSortingNode:r,sortingNode:o,sourceCode:i,options:s})&&n.push([]),n.at(-1).push({...o,partitionId:n.length})}for(let e of n){function n(e){return function(t){return U({comparatorByOptionsComputer:F,optionsByGroupIndexComputer:l,ignoreEslintDisabledNodes:t,groups:s.groups,nodes:e})}}W({availableMessageIds:{missedSpacingBetweenMembers:Yu,extraSpacingBetweenMembers:Ju,unexpectedGroupOrder:qu,unexpectedOrder:Ku},sortNodesExcludingEslintDisabled:n(e),options:s,context:t,nodes:e})}}}var ed=Q({meta:{schema:{items:{properties:{...y(),...S(),useConfigurationIf:b({additionalProperties:{matchesAstSelector:v}}),partitionByComment:A,partitionByNewLine:j},additionalProperties:!1,type:`object`},uniqueItems:!0,type:`array`},messages:{[Yu]:k,[Ju]:O,[qu]:D,[Ku]:E},docs:{url:`https://perfectionist.dev/rules/sort-maps`,description:`Enforce sorted Map elements.`,recommended:!0},type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.NewExpression],sorter:$u,context:e}),defaultOptions:[Qu],name:`sort-maps`});let td=/* @__PURE__ */ new Map;const nd=`unexpectedSetsOrder`,rd=`unexpectedSetsGroupOrder`,id=`extraSpacingBetweenSetsMembers`,ad=`missedSpacingBetweenSetsMembers`;var od=Q({meta:{messages:{[ad]:k,[id]:O,[rd]:D,[nd]:E},docs:{url:`https://perfectionist.dev/rules/sort-sets`,description:`Enforce sorted sets.`,recommended:!0},schema:ai,type:`suggestion`,fixable:`code`},create:e=>Z({nodeTypes:[N.AST_NODE_TYPES.NewExpression,N.AST_NODE_TYPES.ArrayExpression],sorter:sd,context:e}),defaultOptions:[ii],name:`sort-sets`});function sd({matchedAstSelectors:e,context:t,node:n}){if(!r())return;Qr({availableMessageIds:{missedSpacingBetweenMembers:ad,extraSpacingBetweenMembers:id,unexpectedGroupOrder:rd,unexpectedOrder:nd},mustHaveMatchedContextOptions:!1,cachedGroupsByModifiersAndSelectors:td,matchedAstSelectors:e,defaultOptions:ii,context:t,node:n});function r(){return n.parent.type!==N.AST_NODE_TYPES.NewExpression||n.parent.callee.type!==N.AST_NODE_TYPES.Identifier||n.parent.callee.name!==`Set`?!1:n.parent.arguments[0]===n}}let cd=`perfectionist`,ld={"sort-variable-declarations":ir,"sort-intersection-types":vr,"sort-import-attributes":kr,"sort-export-attributes":Ir,"sort-heritage-clauses":Kr,"sort-array-includes":oi,"sort-named-imports":Si,"sort-named-exports":Li,"sort-object-types":Ea,"sort-union-types":Ua,"sort-switch-case":Ma,"sort-decorators":ro,"sort-interfaces":Ya,"sort-jsx-props":bo,"sort-modules":pu,"sort-classes":ws,"sort-imports":jc,"sort-exports":Kc,"sort-objects":Ml,"sort-enums":Gu,"sort-sets":od,"sort-maps":ed},ud={meta:{version:`5.12.1`,name:`eslint-plugin-perfectionist`},rules:{...ld,"sort-arrays":Su}};function dd(e){return Object.fromEntries(Object.keys(ld).map(t=>[`${cd}/${t}`,[`error`,e]]))}function fd(e){return{plugins:{[cd]:ud},rules:dd(e)}}function pd(e){return{rules:dd(e),plugins:[cd]}}let md={"recommended-alphabetical-legacy":pd({type:`alphabetical`,order:`asc`}),"recommended-line-length-legacy":pd({type:`line-length`,order:`desc`}),"recommended-natural-legacy":pd({type:`natural`,order:`asc`}),"recommended-custom-legacy":pd({type:`custom`,order:`asc`}),"recommended-alphabetical":fd({type:`alphabetical`,order:`asc`}),"recommended-line-length":fd({type:`line-length`,order:`desc`}),"recommended-natural":fd({type:`natural`,order:`asc`}),"recommended-custom":fd({type:`custom`,order:`asc`})};var hd={...ud,configs:md};export{hd as t};