@eslint-sukka/eslint-plugin-sukka-full 8.12.2 → 8.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,32 +1,32 @@
1
- "use strict";let e,t;var r,n,o,a,i,s,l,u=require("eslint-plugin-sukka"),p=require("node:assert/strict"),c=require("node:util/types"),d=require("node:path"),m=require("node:util"),f=require("eslint/use-at-your-own-risk");function g(e,t){if("string"==typeof t){let e=t;t=t=>t.type===e}for(;e;){if(t(e))return e;e=e.parent}}function y(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function h(e){return e?.type==="MemberExpression"}function x(e){return e?.type==="AwaitExpression"}function b(e,t){return!!y(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function E(e,t){return e?.type==="Literal"&&(Array.isArray(t)?t.includes(e.value):"string"==typeof e.value&&t instanceof RegExp?t.test(e.value):e.value===t)}function D(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function S(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function v({create:e,defaultOptions:t,meta:r,name:n}){return r.docs&&!r.docs.url&&(r.docs.url=new URL(n,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,o;let a,i=(n=t,o=r.options,a=structuredClone(n),null==o||a.forEach((e,t)=>{if(void 0!==o[t]){let r=o[t];"object"!=typeof r||Array.isArray(r)||"object"!=typeof e||Array.isArray(e)?a[t]=r:a[t]=function e(t={},r={}){return Object.fromEntries([...new Set([...Object.keys(t),...Object.keys(r)])].map(n=>{let o=n in t,a=n in r,i=t[n],s=r[n];return[n,o&&a?"object"!=typeof i||Array.isArray(i)||"object"!=typeof s||Array.isArray(s)?s:e(i,s):o?i:s]}))}(e,r)}}),a);return e(r,i)},defaultOptions:t,meta:r,name:n}}function C(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var A=v({name:"array/no-unneeded-flat-map",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `Array#flatMap((x) => x)` when simpler alternatives exist",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple `Array#flatMap()` in array"}},defaultOptions:[],create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!b(t.callee.property,"flatMap")||!(D(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(S(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&S(r.params[0],r.body.body[0].argument))))return;let{property:n}=t.callee;e.report({node:t,messageId:"invalid",*fix(e){yield e.replaceText(n,"flat"),yield*t.arguments.map(t=>e.remove(t))}})}})});let T=new Set(["href","pathname","search","hash","origin"]);var w=v({name:"browser/prefer-location-assign",meta:{type:"suggestion",fixable:"code",docs:{description:"Prefer `location.assign(...)` over `location.*`",recommended:"stylistic"},schema:[],messages:{instead:"Use `location.assign(...)` instead of `location.{{name}}`"}},defaultOptions:[],create:e=>({AssignmentExpression(t){let r=function(e,t){if(b(e,t))return e;for(;h(e);){if(b(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=k(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=k(t.parent);if(T.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function k(e){if(h(e)&&y(e.property))return e.property.name}var I=v({name:"jsx/no-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow use template-literal in JSX",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow use template-literal in JSX"}},defaultOptions:[],create:e=>({JSXExpressionContainer(t){if("TemplateLiteral"!==t.expression.type||t.parent?.type==="JSXAttribute")return;let{expression:r}=t;e.report({node:t,messageId:"invalid",fix(n){let o=[...r.expressions,...r.quasis];o.sort((e,t)=>e.range[0]-t.range[0]);let a=o.map(t=>"TemplateElement"===t.type?t.value.cooked:"{"+e.sourceCode.getText(t)+"}");return n.replaceText(t,a.join(""))}})}})}),j=v({name:"jsx/no-unneeded-nested",meta:{type:"suggestion",fixable:"code",docs:{description:"Reduce unneeded JSXFragment nested",recommended:"stylistic"},schema:[],messages:{invalid:"Reduce unneeded JSXFragment nested"}},defaultOptions:[],create(e){let t=e.sourceCode;return{JSXFragment(r){if(1!==r.children.length)return;let n=r.children[0];e.report({node:r,messageId:"invalid",*fix(e){"JSXExpressionContainer"===n.type?"JSXEmptyExpression"!==n.expression.type&&(yield e.replaceText(r,t.getText(n.expression))):yield e.replaceText(r,t.getText(n))}})}}}});let F=/^toLocale(?<name>Upper|Lower)Case$/g;var B=v({name:"string/no-locale-case",meta:{type:"problem",fixable:"code",docs:{description:"Disallow use `String#toLocale{Upper,Lower}Case()`",recommended:"recommended"},schema:[],messages:{instead:"Use `.to{{name}}Case(...)` instead of `.toLocale{{name}}Case()`"}},defaultOptions:[],create:e=>({CallExpression(t){if(t.arguments.length>0||!h(t.callee)||!y(t.callee.property))return;let{property:r}=t.callee,n=F.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),$=v({name:"string/no-simple-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow simple template-literal",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple template-literal"}},defaultOptions:[],create:e=>({TemplateLiteral(t){var r,n,o,a;let i=(r=e.sourceCode,(o=n=t,o.parent?.type!=="TaggedTemplateExpression"&&1===o.quasis.length&&!function({loc:e}){return!!e&&e.start.line!==e.end.line}(o.quasis[0])&&0===o.expressions.length)?e=>{let t=JSON.stringify(n.quasis[0].value.cooked),o=g(n,e=>"Property"===e.type&&e.key===n);return o?e.replaceText(o,`${t}: ${r.getText(o.value)}`):e.replaceText(n,t)}:2===(a=n).quasis.length&&a.quasis.every(({value:e})=>""===e.cooked)&&1===a.expressions.length?e=>e.replaceText(n,r.getText(n.expressions[0])):void 0);i&&e.report({node:t,messageId:"invalid",fix:i})}})});let R=/\P{ASCII}/u;function P(e,t){return{Program(r){for(let n of r.tokens??[]){let r=function(e){switch(e.type){case"String":case"Template":return e.value.slice(1,-1);case"Identifier":if(e.value.startsWith("#"))return e.value.slice(1);return e.value;case"PrivateIdentifier":case"JSXText":case"JSXIdentifier":return e.value;case"RegularExpression":return e.regex.pattern}return!1}(n);!1!==r&&e.test(r)&&t(n,"code")}for(let n of r.comments??[])e.test(n.value)&&t(n,"comment")}}}function L(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=N(e.value.slice(1,-1),t);return r.replaceText(e,`${n}${a}${o}`)};case"JSXText":return r=>{let n=e.value.replace(t,e=>`&#x${M(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let n=new Set(e.regex.flags);n.add("u");let o=new RegExp(N(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function N(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${M(t)}}`:`\\u${M(t)}`})}function M(e){return e.toString(16).padStart(4,"0").toUpperCase()}v({name:"unicode/specific-set",meta:{type:"problem",fixable:"code",docs:{description:"Limit the range of literal characters"},schema:[{type:"object",properties:{pattern:{type:"string"},flags:{type:"string"},only:{type:"string",enum:["code","comment"]}},additionalProperties:!1}],messages:{illegal:"Illegal character detected"}},defaultOptions:[{pattern:R.source,flags:"u",only:void 0}],create(e,[{pattern:t,flags:r,only:n}]){let o=t?new RegExp(t,r):R;return P(o,(t,r)=>{if(n&&n!==r)return;let a=L(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let O=/[\u061C\u202A-\u202E\u2066-\u2069]/;var q=v({name:"unicode/no-bidi",meta:{type:"problem",fixable:"code",docs:{description:"Detect and stop Trojan Source attacks",recommended:"recommended"},schema:[],messages:{detected:"Detected potential trojan source attack with unicode bidi introduced in this {{kind}}: {{text}}."}},defaultOptions:[],create:e=>P(O,(t,r)=>{let n=RegExp(O.source,"gu"),o={kind:r,text:N(t.value,n)},a=L(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let U=(t=[/\u00AD\u034F\u061C\u17B4\u17B5\uFEFF\uFFFC/,/\u180B-\u180E/,/\u200B-\u200F/,/\u202A-\u202E/,/\u2060-\u206F/,/\uFE00-\uFE0F/,/\uFFF0-\uFFF8/,/\u{1D173}-\u{1D17A}/u,/\u{E0000}-\u{E007F}/u,/\u{E0100}-\u{E01EF}/u].map(e=>"string"==typeof e?e:e.source).join(""),RegExp(`[${t}]`,"u"));var W=v({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},defaultOptions:[],create:e=>P(U,t=>{let r=L(t,RegExp(U.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),_=v({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},defaultOptions:[],create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(V);if(!s)return;let l=t[t.indexOf(s)-1];r=l,n=s,r&&"VariableDeclaration"===r.type&&1===r.declarations.length&&r.declarations.some(({init:e,id:t})=>null!==e&&S(n.argument,t))&&e.report({node:s,messageId:"invalid",fix:(o=e.sourceCode,a=l,i=s,e=>{var t;let{init:r,id:n}=a.declarations[0];if(!(r&&n&&i.argument))return null;let s=!x(t=r)||g(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${x(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function V(e){return"ReturnStatement"===e.type&&y(e.argument)}var z=v({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},defaultOptions:[],create:e=>({BlockStatement({parent:t,body:r}){if(!D(t))return;let n=function(e,t){let r=t.find(K);if(!r)return;let n=t.find(e=>{var t,n;return t=e,n=r,"VariableDeclaration"===t.type&&"const"!==t.kind&&t.declarations.some(({id:e})=>S(n.argument,e))});if(n)return e.sourceCode.getDeclaredVariables(n).find(({references:e})=>e.every(e=>e.isWriteOnly()||e.identifier.parent===r))}(e,r);for(let{identifier:t}of n?.references??[])t.parent&&e.report({node:t.parent,messageId:"invalid"})}})});function K(e){return"ReturnStatement"===e.type&&y(e.argument)}var G=v({name:"prefer-early-return",meta:{type:"problem",fixable:"code",docs:{description:"Prefer early returns over full-body conditional wrapping in function declarations",recommended:"stylistic"},schema:[{type:"object",properties:{maximumStatements:{type:"integer",minimum:0}},additionalProperties:!1}],messages:{prefer:"Prefer an early return to a conditionally-wrapped function body"}},defaultOptions:[{maximumStatements:0}],create:(e,[{maximumStatements:t}])=>({BlockStatement:function({body:r,parent:n}){var o,a;if(!D(n)||!(1===r.length&&function(e,t){if("IfStatement"!==e.type||null!==e.alternate)return!1;let{consequent:r}=e;return"ExpressionStatement"===r.type&&0===t||"BlockStatement"===r.type&&r.body.length>t}(r[0],t)))return;let i=(o=e,a=r[0],function*(e){var t;let r;if("IfStatement"!==a.type)return;let{test:n,consequent:i}=a;yield e.insertTextBefore(n,"!("),yield e.insertTextAfter(n,")"),yield e.replaceText(i,"return;");let s=(t=o.sourceCode.getText(i),r=t,"BlockStatement"===i.type?r.slice(1,-1):r);yield e.insertTextAfter(a,s)});e.report({node:r[0],messageId:"prefer",fix:i})}})}),J=v({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},defaultOptions:[],create:e=>({ImportDeclaration(t){let r=t.source.value;("axios"===r||"request"===r)&&e.report({node:t,messageId:"callee"})},NewExpression(t){var r;((function({callee:e}){return b(e,"XMLHttpRequest")})(t)||b((r=t).callee,"ActiveXObject")&&E(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return b(e,t)||h(e)&&b(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return b(e,r)&&h(t)&&b(t.property,"load")||h(e)&&b(e.object,r)&&b(e.property,["ajax","get","post","getJSON","getScript"])}(t)||X(t,"axios")||X(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function X(e,t){return b(e.callee,"require")&&E(e.arguments[0],t)}let Y=new Set(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var H=v({name:"prefer-timer-id",meta:{type:"problem",docs:{description:"Enforce best practice with timer function",recommended:"recommended"},schema:[],messages:{assign:"Timer id should assign to an identifier or member for cleaning up, `const timer = {{name}}(...);`",fix:"Assign timer id to a variable"},hasSuggestions:!0},defaultOptions:[],create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!Y.has(t.callee.name)||function(e){if(!b(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||E(t,0)}(t)||t.parent?.type==="AssignmentExpression"&&t.parent.right===t||t.parent?.type==="VariableDeclarator"&&t.parent.init===t||e.report({node:t,messageId:"assign",data:{name:t.callee.name},suggest:[{messageId:"fix",fix:e=>e.insertTextBefore(t,"const timer = ")}]})}})}),Z=v({name:"string/no-unneeded-to-string",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `String#toString()` when simpler alternatives exist",recommended:"stylistic",requiresTypeChecking:!0},schema:[],messages:{invalid:"Disallow use `.toString()` in string"}},defaultOptions:[],create(e){C(e.sourceCode.parserServices);let{program:t,esTreeNodeToTSNodeMap:r}=e.sourceCode.parserServices,n=t.getTypeChecker();return{CallExpression(t){if("MemberExpression"!==t.callee.type)return;let{object:o,property:a}=t.callee;(b(a,"toString")||E(a,"toString"))&&function(e,t){let r=e.getTypeAtLocation(t);if(r.isStringLiteral()||"string"===e.typeToString(r))return!0;let n=r.getSymbol();return n&&"String"===e.symbolToString(n)}(n,r.get(o))&&e.report({node:a,messageId:"invalid",fix:r=>r.replaceText(t,e.sourceCode.getText(o))})}}}}),Q=v({name:"type/no-force-cast-via-top-type",meta:{type:"problem",docs:{description:"Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`",recommended:"recommended"},schema:[],messages:{invalid:"Don't cast this expression to another type by `as {{type}} as T`"}},defaultOptions:[],create:e=>({TSAsExpression(t){var r,n;if("TSAnyKeyword"!==(r=t.typeAnnotation).type&&"TSUnknownKeyword"!==r.type||!((n=t.parent)&&"TSAsExpression"===n.type&&"TSTypeReference"===n.typeAnnotation.type))return;let o="TSAnyKeyword"===t.typeAnnotation.type?"any":"unknown";e.report({node:t,messageId:"invalid",data:{type:o}})}})});let ee=new Set(["BigInt","Boolean","Number","String","Symbol"]);var et=v({name:"type/no-wrapper-type-reference",meta:{type:"problem",fixable:"code",docs:{description:"Disallow wrapper type for type reference",recommended:"recommended"},schema:[],messages:{instead:"Use {{name}} instead"}},defaultOptions:[],create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ee.has(t.typeName.name))return;let r=t.typeName.name.toLowerCase();e.report({node:t,messageId:"instead",data:{name:r},fix:e=>e.replaceText(t.typeName,r)})}})}),er=v({name:"no-default-error",meta:{type:"problem",docs:{description:"Restrict the usage of default (unextended) error",recommended:"strict",requiresTypeChecking:!0},schema:[],messages:{invalid:"Default error object should not be used in this project"}},defaultOptions:[],create(e){C(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:t,program:r}=e.sourceCode.parserServices,n=r.getTypeChecker();function o(r){"ErrorConstructor"===function(e,t){let r=e.getTypeAtLocation(t).getSymbol();if(!r?.valueDeclaration)return;let n=e.getTypeOfSymbolAtLocation(r,r.valueDeclaration);return e.typeToString(n)}(n,t.get(r))&&e.report({node:r,messageId:"invalid"})}return{ThrowStatement(e){e.argument&&o(e.argument)},NewExpression:o,CallExpression:o}}});let en={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"]};for(let e of Object.keys(en))Object.freeze(en[e]);Object.freeze(en);let eo=new Set(["parent","leadingComments","trailingComments"]);function ea(e){return!eo.has(e)&&"_"!==e[0]}function ei(e,t){let r="",n=e;for("string"==typeof t?r=t:(r=t.name,n=function(e,t){let r=t.range[0],n=e,o=!1;do for(let e of(o=!1,n.childScopes)){let t=e.block.range;if(t[0]<=r&&r<t[1]){n=e,o=!0;break}}while(o);return n}(n,t));null!=n;){let e=n.set.get(r);if(null!=e)return e;n=n.upper}return null}function es(e,t){return"Punctuator"===e.type&&e.value===t}function el(e){return es(e,"=>")}function eu(e){return es(e,",")}function ep(e){return es(e,";")}function ec(e){return es(e,":")}function ed(e){return es(e,"(")}function em(e){return es(e,")")}function ef(e){return es(e,"{")}function eg(e){return["Block","Line","Shebang"].includes(e.type)}let ey=e=>!ep(e);function eh(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,el);n=r.loc.start,o=r.loc.end}else{var a,i;n=r&&("Property"===r.type||"MethodDefinition"===r.type||"PropertyDefinition"===r.type)?r.loc.start:e.loc.start,o=(a=e,i=t,a.id?i.getTokenAfter(a.id,ed):i.getFirstToken(a,ed)).loc.start}return{start:{...n},end:{...o}}}let ex="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eb=Object.freeze(new Set(["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"])),eE=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,"function"==typeof BigInt?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=>"random"!==e).map(e=>Math[e]).filter(e=>"function"==typeof e),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=>"function"==typeof e)),eD=new Set([Object.freeze,Object.preventExtensions,Object.seal]),eS=[[Map,new Set(["size"])],[RegExp,new Set(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new Set(["size"])]];function ev(e,t){let r=[];for(let n=0;n<e.length;++n){let o=e[n];if(null==o)r.length=n+1;else if("SpreadElement"===o.type){let e=eA(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eA(o,t);if(null==e)return null;r.push(e.value)}}return r}let eC=Object.freeze({ArrayExpression(e,t){let r=ev(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eA(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eA(e.left,t),n=eA(e.right,t);if(null!=r&&null!=n)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=ev(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eA(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=eT(r,t);if(null!=a){let e=o.value,t=a.value;if(eE.has(e[t]))return{value:e[t](...n)};if(eD.has(e[t]))return{value:n[0]}}}}else{let o=eA(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eE.has(t))return{value:t(...n)};if(eD.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eA(e.test,t);return null!=r?r.value?eA(e.consequent,t):eA(e.alternate,t):null},ExpressionStatement:(e,t)=>eA(e.expression,t),Identifier(e,t){if(null!=t){let r=ei(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eb.has(r.name)&&r.name in ex)return{value:ex[r.name]};if(function(e){let t,r,n;if(1!==e.defs.length)return!1;let o=e.defs[0];return!!(o.parent&&"Variable"===o.type&&("const"===o.parent.kind||(r=(t=e.references).filter(e=>e.init).length,n=t.filter(e=>e.isReadOnly()).length,1===r&&n+r===t.length)))}(r)){let e=r.defs[0];if("Identifier"===e.node.id.type){let n=eA(e.node.init,t);return n&&"object"==typeof n.value&&null!==n.value&&function(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&"MemberExpression"===e.parent.type;)e=e.parent;if(e&&e.parent&&("AssignmentExpression"===e.parent.type&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"CallExpression"===e.parent.type&&e.parent.callee===e&&"MemberExpression"===e.type&&function(e){if(null==e||null==e.value)return!1;let t=e.value;return"copyWithin"===t||"fill"===t||"pop"===t||"push"===t||"reverse"===t||"shift"===t||"sort"===t||"splice"===t||"unshift"===t}(eT(e,t))))return!0}return!1}(r,t)?null:n}}}}return null},Literal:e=>(null!=e.regex||null!=e.bigint)&&null==e.value?null:{value:e.value},LogicalExpression(e,t){let r=eA(e.left,t);if(null!=r){if("||"===e.operator&&!0==!!r.value||"&&"===e.operator&&!1==!!r.value||"??"===e.operator&&null!=r.value)return r;let n=eA(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eA(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=eT(e,t);if(null!=n){let e;if(null==(e=function(e,t){let r=e;for(;("object"==typeof r||"function"==typeof r)&&null!==r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}return null}(r.value,n.value))||null==e.get)return{value:r.value[n.value]};for(let[e,t]of eS)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eA(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eA(e.callee,t),n=ev(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eE.has(e))return{value:new e(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if("Property"===n.type){if("init"!==n.kind)return null;let e=eT(n,t),o=eA(n.value,t);if(null==e||null==o)return null;r[e.value]=o.value}else{if("SpreadElement"!==n.type&&"ExperimentalSpreadProperty"!==n.type)return null;let e=eA(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eA(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eA(e.tag,t),n=ev(e.quasi.expressions,t);if(null!=r&&null!=n){let t=r.value,o=e.quasi.quasis.map(e=>e.value.cooked);if(o.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(o,...n)}}return null},TemplateLiteral(e,t){let r=ev(e.expressions,t);if(null!=r){let t=e.quasis[0].value.cooked;for(let n=0;n<r.length;++n)t+=r[n],t+=e.quasis[n+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if("delete"===e.operator)return null;if("void"===e.operator)return{value:void 0};let r=eA(e.argument,t);if(null!=r)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression:(e,t)=>eA(e.expression,t),TSSatisfiesExpression:(e,t)=>eA(e.expression,t),TSTypeAssertion:(e,t)=>eA(e.expression,t),TSNonNullExpression:(e,t)=>eA(e.expression,t),TSInstantiationExpression:(e,t)=>eA(e.expression,t)});function eA(e,t){return null!=e&&Object.hasOwnProperty.call(eC,e.type)?eC[e.type](e,t):null}function eT(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eA(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function ew(e,t=null){try{return eA(e,t)}catch(e){return null}}function ek(e,t=null){if(e&&"Literal"===e.type&&null===e.value){if(e.regex)return`/${e.regex.pattern}/${e.regex.flags}`;if(e.bigint)return e.bigint}let r=ew(e,t);if(r)try{return String(r.value)}catch{}return null}function eI(e,t){switch(e.type){case"MemberExpression":if(e.computed)return ek(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return ek(e.key,t);if("Literal"===e.key.type)return String(e.key.value);if("PrivateIdentifier"===e.key.type)break;return e.key.name}return null}function ej(e,t){let r=e.parent;if(!r)return"";let n=[],o="Property"===r.type&&r.value===e,a="MethodDefinition"===r.type&&r.value===e,i="PropertyDefinition"===r.type&&r.value===e;if((a||i)&&(r.static&&n.push("static"),"PrivateIdentifier"===r.key.type&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),o||a){if("constructor"===r.kind)return"constructor";"get"===r.kind?n.push("getter"):"set"===r.kind?n.push("setter"):n.push("method")}else i?n.push("method"):("ArrowFunctionExpression"===e.type&&n.push("arrow"),n.push("function"));if(o||a||i)if("PrivateIdentifier"===r.key.type)n.push(`#${r.key.name}`);else{let e=eI(r);if(e)n.push(`'${e}'`);else if(t){let e=t.getText(r.key);e.includes("\n")||n.push(`[${e}]`)}}else e.id?n.push(`'${e.id.name}'`):"VariableDeclarator"===r.type&&r.id&&"Identifier"===r.id.type?n.push(`'${r.id.name}'`):("AssignmentExpression"===r.type||"AssignmentPattern"===r.type)&&r.left&&"Identifier"===r.left.type?n.push(`'${r.left.name}'`):"ExportDefaultDeclaration"===r.type&&r.declaration===e&&n.push("'default'");return n.join(" ")}let eF=Object.freeze(new Set(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eB=Object.freeze(new Set(["-","+","!","~"]));function e$(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eR=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return"function"==typeof this[n]?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let o of r[n]||Object.keys(e).filter(ea)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(e$(e)&&this.$visit(e,t,r))return!0}else if(e$(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eF.has(e.operator))&&("Literal"!==e.left.type||"Literal"!==e.right.type)||this.$visitChildren(e,t,r)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(e,t,r){return!!t.considerGetters||!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.property.type||this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},NewExpression:()=>!0,Property(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return!!("delete"===e.operator||t.considerImplicitTypeConversion&&eB.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function eP(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eR.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||en)}function eL(e,t,r){let n,o,a,i,s;if("number"==typeof e){if(n=0|e,o=t,a=r,!(n>=1))throw TypeError("'times' should be a positive integer.")}else n=1,o=e,a=t;if(null==o||null==o.parent||"CatchClause"===o.parent.type&&o.parent.param===o)return!1;i=s=o;do i=a.getTokenBefore(i),s=a.getTokenAfter(s);while(null!=i&&null!=s&&ed(i)&&em(s)&&i!==function(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,ed);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,ed);return null;case"IfStatement":case"WhileStatement":if(r.test===e)return t.getFirstToken(r,1);return null;case"ImportExpression":if(r.source===e)return t.getFirstToken(r,1);return null;case"SwitchStatement":if(r.discriminant===e)return t.getFirstToken(r,1);return null;case"WithStatement":if(r.object===e)return t.getFirstToken(r,1);return null;default:return null}}(o,a)&&--n>0);return 0===n}let eN=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,eM=Function.call.bind(Object.hasOwnProperty),eO=Symbol("read"),eq=Symbol("call"),eU=Symbol("construct"),eW=Symbol("esm"),e_={require:{[eq]:!0}};function eV(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class ez{constructor(e,t={}){let{mode:r="strict",globalObjectNames:n=["global","globalThis","self","window"]}=t;this.variableStack=[],this.globalScope=e,this.mode=r,this.globalObjectNames=n.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let r=e[t],n=[t],o=this.globalScope.set.get(t);eV(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);eV(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(e_)){let r=ek(t.arguments[0]);if(null==r||!eM(e,r))continue;let n=e[r],o=[r];n[eO]&&(yield{node:t,path:o,type:eO,info:n[eO]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eN.test(t.type)||null==t.source)continue;let r=t.source.value;if(!eM(e,r))continue;let n=e[r],o=[r];if(n[eO]&&(yield{node:t,path:o,type:eO,info:n[eO]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[eO]&&(yield{node:t,path:o.concat(e),type:eO,info:r[eO]})}else for(let e of t.specifiers){let t=eM(n,eW),r=this._iterateImportReferences(e,o,t?n:"legacy"===this.mode?{default:n,...n}:{default:n});if(t)yield*r;else for(let e of r)e.path=e.path.filter(eK),(e.path.length>=2||e.type!==eO)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,r,n){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let o of e.references){if(!o.isRead())continue;let e=o.identifier;n&&r[eO]&&(yield{node:e,path:t,type:eO,info:r[eO]}),yield*this._iteratePropertyReferences(e,t,r)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,r){let n=e;for(;function(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":case"ChainExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e}return!1}(n);)n=n.parent;let o=n.parent;if(o){if("MemberExpression"===o.type){if(o.object===n){let e=eI(o);if(null==e||!eM(r,e))return;t=t.concat(e);let n=r[e];n[eO]&&(yield{node:o,path:t,type:eO,info:n[eO]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[eq]&&(yield{node:o,path:t,type:eq,info:r[eq]});return}if("NewExpression"===o.type){o.callee===n&&r[eU]&&(yield{node:o,path:t,type:eU,info:r[eU]});return}if("AssignmentExpression"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r),yield*this._iteratePropertyReferences(o,t,r));return}if("AssignmentPattern"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r));return}"VariableDeclarator"===o.type&&o.init===n&&(yield*this._iterateLhsReferences(o.id,t,r))}}*_iterateLhsReferences(e,t,r){if("Identifier"===e.type){let n=ei(this.globalScope,e);null!=n&&(yield*this._iterateVariableReferences(n,t,r,!1));return}if("ObjectPattern"===e.type){for(let n of e.properties){let e=eI(n);if(null==e||!eM(r,e))continue;let o=t.concat(e),a=r[e];a[eO]&&(yield{node:n,path:o,type:eO,info:a[eO]}),yield*this._iterateLhsReferences(n.value,o,a)}return}"AssignmentPattern"===e.type&&(yield*this._iterateLhsReferences(e.left,t,r))}*_iterateImportReferences(e,t,r){let n=e.type;if("ImportSpecifier"===n||"ImportDefaultSpecifier"===n){let o="ImportDefaultSpecifier"===n?"default":"Identifier"===e.imported.type?e.imported.name:e.imported.value;if(!eM(r,o))return;t=t.concat(o);let a=r[o];a[eO]&&(yield{node:e,path:t,type:eO,info:a[eO]}),yield*this._iterateVariableReferences(ei(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(ei(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!eM(r,n))return;t=t.concat(n);let o=r[n];o[eO]&&(yield{node:e,path:t,type:eO,info:o[eO]})}}}function eK(e,t){return 1!==t||"default"!==e}ez.READ=eO,ez.CALL=eq,ez.CONSTRUCT=eU,ez.ESM=eW;let eG=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*eJ(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=eG,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!ed(n))return;let o=r.sourceCode.getTokenAfter(t);if(n&&em(o))return[n,o]}(n,t);){let[o]=n;if(r===eG&&(r=function(e,t){let{parent:r}=e;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.sourceCode.getTokenAfter(r.typeArguments??r.callee,ed);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,ed);return;case"IfStatement":case"WhileStatement":if(r.test===e)return t.sourceCode.getFirstToken(r,1);return;case"ImportExpression":if(r.source===e)return t.sourceCode.getFirstToken(r,1);return;case"SwitchStatement":if(r.discriminant===e)return t.sourceCode.getFirstToken(r,1);return;case"WithStatement":if(r.object===e)return t.sourceCode.getFirstToken(r,1)}}(e,t)),o===r)break;yield n}}let eX=new WeakMap;function eY(e,t){if(!e||!eX.has(e)){let r=[];for(let[n,o]of eJ(e,t))r.unshift(n),r.push(o);eX.set(e,r)}return eX.get(e)}function eH(e,t){let r=eY(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function eZ(e,t){let[r,n]=eH(e,t);return t.sourceCode.text.slice(r,n)}function eQ(e,t){if(eX.has(e))return eX.get(e).length>0;let r=eJ(e,t).next().done;return r&&eX.set(e,[]),!r}function e0(e,t){return e?.type==="Literal"&&e.value===t}let e1=e=>e?.type==="Literal"&&"string"==typeof e.value,e2=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),e3=e=>e1(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,e8=e=>"Literal"===e.type&&"number"==typeof e.value,e6=e=>"Literal"===e.type&&!!e.regex,e9=e=>e?.type==="Literal"&&"null"===e.raw,e5=e=>"Literal"===e.type&&!!e.bigint;function e4(e,t,r){if(!r.includes(e?.type))return!1;"string"==typeof t&&(t={names:[t]}),Array.isArray(t)&&(t={names:t});let{name:n,names:o,argumentsLength:a,minimumArguments:i,maximumArguments:s,allowSpreadElement:l,optional:u}={minimumArguments:0,maximumArguments:1/0,allowSpreadElement:!1,...t};if(n&&(o=[n]),!0===u&&e.optional!==u||!1===u&&e.optional||"number"==typeof a&&e.arguments.length!==a||0!==i&&e.arguments.length<i||Number.isFinite(s)&&e.arguments.length>s)return!1;if(!l){let t=Number.isFinite(s)?s:a;if("number"==typeof t&&e.arguments.some((e,r)=>"SpreadElement"===e.type&&r<t))return!1}return!Array.isArray(o)||!(o.length>0)||"Identifier"===e.callee.type&&!!o.includes(e.callee.name)}let e7=(e,t)=>e4(e,t,["CallExpression"]),te=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return e4(e,t,["NewExpression"])},tt=(e,t)=>e4(e,t,["CallExpression","NewExpression"]),tr=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tn(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tn(e,t)):"EmptyStatement"===r||!!t?.(e)}let to=e=>"ArrayExpression"===e.type&&0===e.elements.length,ta=e=>"ObjectExpression"===e.type&&0===e.properties.length;function ti(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let ts=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tl(e){return ts.includes(e.type)}let tu=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tp(e){return tu.includes(e.type)}function tc(e,t){if(e?.type!=="MemberExpression")return!1;"string"==typeof t&&(t={properties:[t]}),Array.isArray(t)&&(t={properties:t});let{property:r,properties:n,object:o,objects:a,optional:i,computed:s}={property:"",properties:[],object:"",...t};if(r&&(n=[r]),o&&(a=[o]),!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(Array.isArray(n)&&n.length>0){if("Identifier"!==e.property.type||!n.includes(e.property.name))return!1;s??=!1}return!(!0===s&&e.computed!==s||!1===s&&e.computed||Array.isArray(a)&&a.length>0&&("Identifier"!==e.object.type||!a.includes(e.object.name)))}function td(e,t){"string"==typeof t&&(t={methods:[t]}),Array.isArray(t)&&(t={methods:t});let{optionalCall:r,optionalMember:n,method:o,methods:a}={method:"",methods:[],...t};return e7(e,{argumentsLength:t.argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:r})&&tc(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:o,properties:a,optional:n})}function tm(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&e8(e.argument)&&1===e.argument.value}let tf=e=>e7(e,{name:"require",argumentsLength:1,optional:!1})&&e1(e.arguments[0]);function tg(e,t){let r=t.trim().split(".");for(let t=r.length-1;t>=0;t--){let n=r[t];if(!n)return!1;if(0===t)return"Identifier"===e.type&&e.name===n||"this"===n&&"ThisExpression"===e.type||"super"===n&&"Super"===e.type;if(1===t&&"MetaProperty"===e.type&&"Identifier"===e.property.type&&e.property.name===n){e=e.meta;continue}if("MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.property.type&&e.property.name===n){e=e.object;continue}return!1}}function ty(e,t){return t.some(t=>tg(e,t))}function th(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||ty(e.parent.tag,t))}function tx(e){return e?.type==="Identifier"&&"undefined"===e.name}let tb=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tc(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tc(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&to(a)||"Object"===r&&ta(a)})(e,{...t,object:"Array"}),tE=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tD=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tS=e=>tD(e.parent)&&e.parent.argument===e,tv=(e,t)=>tC(e.parent,t)&&e.parent.arguments[0]===e,tC=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&"Boolean"===e.callee.name&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&((e,t)=>{let{sourceCode:r}=t;if(r.isGlobalReference(e))return!0;let n=ei(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tA(e,t){return!!(tD(e)||tS(e)||tC(e,t)||tv(e,t))||!!tE(e.parent)&&tA(e.parent,t)}function tT(e){let t;return t=e.parent,!!(t?.type==="VExpressionContainer"&&"VAttribute"===t.parent.type&&t.parent.directive&&t.parent.value===t&&"VDirectiveKey"===t.parent.key.type&&"VIdentifier"===t.parent.key.name.type&&["if","else-if","show"].includes(t.parent.key.name.rawName)||["IfStatement","ConditionalExpression","WhileStatement","DoWhileStatement","ForStatement"].includes(e.parent.type)&&e.parent.test===e)||!!tE(e.parent)&&tT(e.parent)}function tw(e,{test:t,expected:r,ruleId:n}){if(t?.(e)||(r=(r=Array.isArray(r)?r:[r]).map(e=>"string"==typeof e?{value:e}:e),!t&&r.some(t=>Object.entries(t).every(([t,r])=>e[t]===r))))return;let o=`'${JSON.stringify({value:e.value,type:e.type})}'`;r=r.map(e=>`'${JSON.stringify(e)}'`).join(" or ");let a=`\`${n}\`: Unexpected token ${o}`,i=`https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?title=${encodeURIComponent(a)}`;throw Error(`Expected token ${r}, got ${o}.
2
- Please open an issue at ${i}.`)}function tk(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tl(e))return!1;for(let r of t[e.type]??[]){let n=e[r];for(let e of Array.isArray(n)?n:[n])if(e?.type&&tk(e,t))return!0}return!1}function tI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tj=tI(function(){if(n)return r;n=1;let e={},t=e.hasOwnProperty,o=(e,r)=>{for(let n in e)t.call(e,n)&&r(n,e[n])},a=e=>"\\u"+("0000"+e).slice(-4),i=(e,t)=>{let r=e.toString(16);return t?r:r.toUpperCase()},s=e.toString,l=Array.isArray,u={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},p=/[\\\b\f\n\r\t]/,c=/[0-9]/,d=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,m=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,f=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,g=(e,t)=>{let r,n,y=()=>{v=S,++t.indentLevel,S=t.indent.repeat(t.indentLevel)},h={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:" ",indentLevel:0,__inline1__:!1,__inline2__:!1},x=t&&t.json;x&&(h.quotes="double",h.wrap=!0),"single"!=(!($=t)||o($,(e,t)=>{h[e]=t}),t=h).quotes&&"double"!=t.quotes&&"backtick"!=t.quotes&&(t.quotes="single");let b="double"==t.quotes?'"':"backtick"==t.quotes?"`":"'",E=t.compact,D=t.lowercaseHex,S=t.indent.repeat(t.indentLevel),v="",C=t.__inline1__,A=t.__inline2__,T=E?"":"\n",w=!0,k="binary"==t.numbers,I="octal"==t.numbers,j="decimal"==t.numbers,F="hexadecimal"==t.numbers;if(x&&e&&"function"==typeof e.toJSON&&(e=e.toJSON()),"string"!=typeof(n=e)&&"[object String]"!=s.call(n)){let n,a,i,u;if(n=e,"[object Map]"==s.call(n))return 0==e.size?"new Map()":(E||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+g(Array.from(e),t)+")");if(a=e,"[object Set]"==s.call(a))return 0==e.size?"new Set()":"new Set("+g(Array.from(e),t)+")";if(i=e,"function"==typeof Buffer&&Buffer.isBuffer(i))return 0==e.length?"Buffer.from([])":"Buffer.from("+g(Array.from(e),t)+")";if(l(e)){r=[],t.wrap=!0,C&&(t.__inline1__=!1,t.__inline2__=!0),A||y();var B,$,R=e;let n=R.length,o=-1;for(;++o<n;){B=R[o],w=!1,A&&(t.__inline2__=!1),r.push((E||A?"":S)+g(B,t))}return w?"[]":A?"["+r.join(", ")+"]":"["+T+r.join(","+T)+T+(E?"":v)+"]"}if("number"==typeof(u=e)||"[object Number]"==s.call(u)||"bigint"==typeof e){let t;if(x)return JSON.stringify(Number(e));if(j)t=String(e);else if(F){let r=e.toString(16);D||(r=r.toUpperCase()),t="0x"+r}else k?t="0b"+e.toString(2):I&&(t="0o"+e.toString(8));return"bigint"==typeof e?t+"n":t}{let n;if("bigint"==typeof e)return x?JSON.stringify(Number(e)):e+"n";return(n=e,"[object Object]"==s.call(n))?(r=[],t.wrap=!0,y(),o(e,(e,n)=>{w=!1,r.push((E?"":S)+g(e,t)+":"+(E?"":" ")+g(n,t))}),w)?"{}":"{"+T+r.join(","+T)+T+(E?"":v)+"}":x?JSON.stringify(e)||"null":String(e)}}let P=t.escapeEverything?m:f;return r=e.replace(P,(e,r,n,o,s,l)=>{if(r){if(t.minimal)return r;let e=r.charCodeAt(0),n=r.charCodeAt(1);return t.es6?"\\u{"+i((e-55296)*1024+n-56320+65536,D)+"}":a(i(e,D))+a(i(n,D))}if(n)return a(i(n.charCodeAt(0),D));if("\0"==e&&!x&&!c.test(l.charAt(s+1)))return"\\0";if(o)return o==b||t.escapeEverything?"\\"+o:o;if(p.test(e))return u[e];if(t.minimal&&!d.test(e))return e;let m=i(e.charCodeAt(0),D);return x||m.length>2?a(m):"\\x"+("00"+m).slice(-2)}),"`"==b&&(r=r.replace(/\$\{/g,"\\${")),t.isScriptContext&&(r=r.replace(/<\/(script|style)/gi,"<\\/$1").replace(/<!--/g,x?"\\u003C!--":"\\x3C!--")),t.wrap&&(r=b+r+b),r};return g.version="3.0.2",r=g}());function tF(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return tj(e,{quotes:'"'===t?"double":"single",wrap:!0,es6:!0,minimal:!0,lowercaseHex:!1})}var tB={},t$={},tR={},tP=function(){var e,t;return i?tB:(i=1,Object.defineProperty(tB,"__esModule",{value:!0}),Object.defineProperty(tB,"isIdentifierChar",{enumerable:!0,get:function(){return e.isIdentifierChar}}),Object.defineProperty(tB,"isIdentifierName",{enumerable:!0,get:function(){return e.isIdentifierName}}),Object.defineProperty(tB,"isIdentifierStart",{enumerable:!0,get:function(){return e.isIdentifierStart}}),Object.defineProperty(tB,"isKeyword",{enumerable:!0,get:function(){return t.isKeyword}}),Object.defineProperty(tB,"isReservedWord",{enumerable:!0,get:function(){return t.isReservedWord}}),Object.defineProperty(tB,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return t.isStrictBindOnlyReservedWord}}),Object.defineProperty(tB,"isStrictBindReservedWord",{enumerable:!0,get:function(){return t.isStrictBindReservedWord}}),Object.defineProperty(tB,"isStrictReservedWord",{enumerable:!0,get:function(){return t.isStrictReservedWord}}),e=function(){if(o)return t$;o=1,Object.defineProperty(t$,"__esModule",{value:!0}),t$.isIdentifierChar=u,t$.isIdentifierName=function(e){let t=!0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if((64512&n)==55296&&r+1<e.length){let t=e.charCodeAt(++r);(64512&t)==56320&&(n=65536+((1023&n)<<10)+(1023&t))}if(t){if(t=!1,!l(n))return!1}else if(!u(n))return!1}return!t},t$.isIdentifierStart=l;let e="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",t="\xb7̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",r=RegExp("["+e+"]"),n=RegExp("["+e+t+"]");e=t=null;let a=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],i=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function s(e,t){let r=65536;for(let n=0,o=t.length;n<o&&!((r+=t[n])>e);n+=2)if((r+=t[n+1])>=e)return!0;return!1}function l(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&r.test(String.fromCharCode(e)):s(e,a)))}function u(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&n.test(String.fromCharCode(e)):s(e,a)||s(e,i))))}return t$}(),t=function(){if(a)return tR;a=1,Object.defineProperty(tR,"__esModule",{value:!0}),tR.isKeyword=function(t){return e.has(t)},tR.isReservedWord=n,tR.isStrictBindOnlyReservedWord=i,tR.isStrictBindReservedWord=function(e,t){return o(e,t)||i(e)},tR.isStrictReservedWord=o;let e=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"]),t=new Set(["implements","interface","let","package","private","protected","public","static","yield"]),r=new Set(["eval","arguments"]);function n(e,t){return t&&"await"===e||"enum"===e}function o(e,r){return n(e,r)||t.has(e)}function i(e){return r.has(e)}return tR}(),tB)}(),tL=tI(tP);function tN(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}let tM=e=>[e,...e.childScopes.flatMap(e=>tM(e))],tO=e=>[...new Set(tM(e).flatMap(({references:e})=>e))],{isIdentifierName:tq,isStrictReservedWord:tU,isKeyword:tW}=tL,t_=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","as","implements","interface","let","package","private","protected","public","static","yield","any","boolean","constructor","declare","get","module","require","number","set","string","symbol","type","from","of"]),tV=e=>"string"==typeof e&&!tW(e)&&!tU(e,!0)&&tq(e)&&"arguments"!==e&&!t_.has(e),tz=(e,t)=>t.every(t=>!(tN(e,t)||tO(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),tK=()=>!0;function tG(e,t,r=tK){if(tV(e)||tV(e+="_")){for(;!tz(e,t)||!r(e,t);)e+="_";return e}}function tJ(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return ed(n)&&em(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function tX(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,ed),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:eu(a)?a:void 0}}function tY(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=tX(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function tH(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return tH(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=ew(t);if(!r)return;return String(r.value)}}function tZ(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?tZ(e.expression):e}function tQ(e,t){if(e=tZ(e),t=tZ(t),e.type!==t.type)return!1;switch(e.type){case"Super":case"ThisExpression":return!0;case"Identifier":case"PrivateIdentifier":return e.name===t.name;case"Literal":var r,n;return r=e,n=t,r.regex||n.regex?!!(r.regex&&n.regex&&r.regex.pattern===n.regex.pattern&&r.regex.flags===n.regex.flags):r.bigint||n.bigint?r.bigint===n.bigint:r.value===n.value;case"MemberExpression":{let r=tH(e);if(void 0!==r)return tQ(e.object,t.object)&&r===tH(t);return e.computed===t.computed&&tQ(e.object,t.object)&&tQ(e.property,t.property)}default:return!1}}let t0=e=>null===e||"object"!=typeof e&&"function"!=typeof e,t1=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=ew(e,r.getScope(e));if(n&&t0(n.value))return{value:n.value}},t2=(e,t,r)=>{let n=t1(e,r),o=t1(t,r);if(n&&o){let e,t;return(e=n.value)===(t=o.value)||"number"==typeof e&&"number"==typeof t&&Number.isNaN(e)&&Number.isNaN(t)}return!!e&&!!t&&"Literal"!==e.type&&"Literal"!==t.type&&tQ(e,t)},t3=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>t2(e,o,t))&&n.push(o),r.push(o));return n};function t8(e,t){let{sourceCode:r}=t,{start:{line:n,column:o}}=r.getLoc(e);return r.getLines()[n-1].slice(0,o).match(/\s*$/)[0]}function t6(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let t9=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),t5=([e,t],[r,n])=>e>=r&&t<=n;function t4(e,t,r=[]){let{sourceCode:n}=e,o=t9(e,t),a=r.map(t=>t9(e,t));return t6(e).some(e=>{let t=n.getRange(e);return t5(t,o)&&a.every(e=>!t5(t,e))})}function t7(e,t){let{sourceCode:r}=e,n=r.getLoc(t).end.line;return r.getCommentsAfter(t).findLast(e=>r.getLoc(e).start.line===n)}let re=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},rt=new Set(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rr=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||rt.has(e.type),rn=e=>rr(e)||"BlockStatement"===e.type&&e.body.some(e=>rr(e));function ro(e,t){if("Identifier"!==e.type)return;let r=ei(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)return n.node.init}function ra(e,t){let{sourceCode:r}=t,[,n]=eH(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let ri=new Set(["depth","height","width"]);function rs(e){return tc(e,{properties:["length","size"],optional:!1})}function rl(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let ru=["Program","StyleSheet","Document","root"];function rp(e,t){let{sourceCode:r}=e;return r.parserServices.getTemplateBodyTokenStore&&r.ast.templateBody&&r.getRange(r.ast.templateBody)[0]<=r.getRange(t)[0]&&r.getRange(t)[1]<=r.getRange(r.ast.templateBody)[1]?r.parserServices.getTemplateBodyTokenStore():r}let rc=({identifiers:e,references:t})=>[...new Set([...e,...t.map(({identifier:e})=>e)])];function rd(e,t){if(!e)return!1;if("ThisExpression"===e.type||"Super"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){for(let e of n)if(rd(e,t))return!0}else if(rd(n,t))return!0}return!1}let rm=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rf=e=>rm.has(e?.type);function rg(e){for(;rf(e);)e=e.expression;return e}function ry(e){let t;return(e=rg(e),e?.type==="ChainExpression")?ry(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?ry(e.object):ry(e.callee))))}let rh=(e,t)=>{let{references:r=[]}=ei(e,t)||{};return r};function rx(e,t){if(t.block!==e)throw Error('"functionScope" should be the scope of "functionNode".');let{type:r,id:n}=e;return"ArrowFunctionExpression"!==r&&(!!(t.thisFound||rh(t,"arguments").some(({from:e})=>e===t))||!!(n&&rh(t,n).length>0))}let rb=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],rE=new Set(["any","error","unknown"]),rD=new Set(["null","undefined"]),rS=e=>e.getSymbol()??e.aliasSymbol,rv=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function rC(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let rA="target",rT="non-target",rw="unknown",rk=new Set(["ClassDeclaration","ClassExpression"]),rI=new Set(["FunctionDeclaration","FunctionExpression"]),rj=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),rF=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),rB=(e,t)=>e.every(e=>e===rA)?rA:(t.treatMixedUnionAsNonTarget?e.includes(rT):e.every(e=>e===rT))?rT:rw,r$=e=>e.includes(rA)?rA:e.every(e=>e===rT)?rT:rw,rR=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=rR(e.left);return t?`${t}.${e.right.name}`:void 0}},rP=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?rA:t.nonTargetTypeNames?.has(e)?rT:rw};function rL(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return rL(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?rL(e.typeAnnotation,t,r,n):rw;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=rR(t.typeName);if(!s)return rw;if(!n.preferTypeReferenceDefinitions){let e=rP(s,n);if(e!==rw)return e}if(o.has(s))return rw;o.add(s);let l=((e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>rj.has(e.type));if(r)return r;t=t.upper}})(s,r);if(!l)return o.delete(s),rP(s,n);let u=rw;return"Type"===l.type&&"TSTypeAliasDeclaration"===l.node.type?u=rL(l.node.typeAnnotation,r,n,o):"Type"===l.type&&"TSTypeParameter"===l.node.type?u=rL(l.node.constraint,r,n,o):"Type"===l.type&&"TSInterfaceDeclaration"===l.node.type?(a=l.node,u=0===a.extends.length?rT:r$(a.extends.map(t=>rR(t.expression)?e({typeName:t.expression},r,n,o):rw))):"ClassName"===l.type&&(i=l.node,u=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?rw:rM(i.superClass,r,n,o):rT),o.delete(s),u}(e,t,r,n);case"TSUnionType":return rB(e.types.map(e=>rL(e,t,r,n)),r);case"TSIntersectionType":return r$(e.types.map(e=>rL(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return rA;return rF.has(e?.type)?rT:rw}}let rN=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?rM(e.superClass,t,r,n):rT;function rM(e,t,r,n=new Set){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return rP(o,r);if(n.has(o))return rw;n.add(o);let a=((e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}})(o,t),[i]=a?.defs??[],s=rw;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=rM(i.node.init,t,r,n):i?.type==="ClassName"&&(s=rN(i.node,t,r,n)),n.delete(o),i?s:rP(o,r)}return rk.has(e.type)?rN(e,t,r,n):rw}let rO=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return rL(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function rq(e,t,r,n=new Set){if(!e)return rw;if("TSSatisfiesExpression"===e.type)return rq(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=rL(e.typeAnnotation,o,r);if(a!==rw)return a;let i=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=ei(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return rw;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=rL(a.name?.typeAnnotation,i,r),l=rw;return s!==rw?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=rq(a.node.init,t,r,n)),n.delete(o),l})(e,t,r,n);case"ThisExpression":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if(rk.has(n.type))return rN(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||"PropertyDefinition"===n.type&&n.static)return rT;if(rI.has(n.type)){let e=rO(n,t,r);if(e!==rw)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return rT;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return rT;continue}break}}return rw})(e,t,r):rw;case"NewExpression":let a,i;return r.checkClassSyntax?(a=e.callee,rM(a,t.sourceCode.getScope(a),r,i)):rw;case"TSAsExpression":case"TSTypeAssertion":{let a=rL(e.typeAnnotation,o,r);return a===rw?rq(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return rq(e.expression,t,r,n);case"SequenceExpression":return rq(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return rB([rq(e.consequent,t,r,n),rq(e.alternate,t,r,n)],r);default:return rw}})(e,t,r,n);if(i!==rw)return i;if("Identifier"!==e.type){let t,n=(t=ew(e,o))?r.getStaticType?.(t.value,e)??rw:rw;if(n!==rw)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>te(e,{name:t}))||r.targetCallNames?.some(t=>e7(e,{name:t})))return rA;let s=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return rw;try{let{program:t}=n;return function e(t,r,n,o){if(rE.has(t.intrinsicName))return rw;if(rD.has(t.intrinsicName))return rT;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):rw}if(t.isUnion())return rB(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return r$(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return rA;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&rC(t,r).some(t=>e(t,r,n,o)===rA))return rA;if(t.intrinsicName)return rT;let i=rS(t);if(!i)return rw;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?rA:rT}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return rw}})(e,t,r);return s!==rw?s:r.isNonTargetNode?.(e,t)?rT:rw}let rU=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>rq(t,r,{...e,...n}),isTarget:(t,r,n)=>rq(t,r,{...e,...n})===rA,isKnownNonTarget:(t,r,n)=>rq(t,r,{...e,...n})===rT}),rW=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>rU({...n,targetTypeNames:new Set([e]),typeReferenceAliases:new Map(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),r_=new Set(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),rV=new Set([...rb,"Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),{isTarget:rz,isKnownNonTarget:rK}=rU({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new Set(["Array","ReadonlyArray"]),nonTargetTypeNames:rV,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||td(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||r_.has(e.type),isTargetTypeAnnotation:e=>e?.type==="TSArrayType"||e?.type==="TSTupleType",isTargetType:(e,t)=>t.isArrayType(e)||t.isTupleType(e),getStaticType:(e,t)=>Array.isArray(e)?rA:"Identifier"===t.type||"MemberExpression"===t.type?rw:rT}),rG=new Set(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function rJ(e,t){return!rG.has(e.type)&&rK(e,t)}let{isTarget:rX}=rW({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?rA:rw}),{isTarget:rY}=rW({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?rA:rw}),rH=new Set(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),rZ=new Set(["KeyboardEvent","React.KeyboardEvent"]),rQ=new Set(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:r0}=rU({targetTypeNames:rH,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?rA:rw}}),{isKnownNonTarget:r1}=rU({targetTypeNames:rZ,nonTargetTypeNames:rQ}),r2=e=>("AssignmentExpression"===e.parent.type||"AssignmentPattern"===e.parent.type)&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"ArrayPattern"===e.parent.type&&e.parent.elements.includes(e)||"RestElement"===e.parent.type&&e.parent.argument===e||"Property"===e.parent.type&&e.parent.value===e&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)||"UnaryExpression"===e.parent.type&&"delete"===e.parent.operator&&e.parent.argument===e,r3=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,r8=(e,t,r)=>"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.object.type&&e.object.name===t&&"Identifier"===e.property.type&&r.has(e.property.name),r6=new Set(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),r9=new Set(["abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"]),r5=new Set(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),r4=new Set(["parseFloat","parseInt"]),r7=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&e8(e.literal),ne=new Set(["-","*","/","%","**","<<",">>","|","^","&"]);function nt(e,t){let r;if(e8(e)||r8(e,"Math",r6)||"CallExpression"===e.type&&!e.optional&&r8(e.callee,"Math",r9)||r3(e,"Number")||r8(e,"Number",r5)||"CallExpression"===e.type&&!e.optional&&r8(e.callee,"Number",r4)||r3(e,"parseInt")||r3(e,"parseFloat")||"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.property.type&&"length"===e.property.name)return!0;switch(e.type){case"AssignmentExpression":{let{operator:r}=e;if("="===r&&nt(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&nt(e.left,t)&&nt(e.right,t)||">>>"===r||ne.has(r)&&(nt(e.left,t)||nt(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&nt(e.argument,t))return!0;break}case"UpdateExpression":if(nt(e.argument,t))return!0;break;case"ConditionalExpression":{let r=nt(e.consequent,t),n=nt(e.alternate,t);if(r&&n)return!0;let o=ew(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(nt(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=ei(t,e))&&r.defs.some(e=>r7(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(r7(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(nt(e.expression,t))return!0}return"number"==typeof ew(e,t)?.value}rU({targetTypeNames:new Set,targetCallNames:["Number"],isTargetTypeAnnotation:r7,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?rA:rw});let nr=new Set([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),nn=new Set(["boolean","true","false"]),no=new Set(["isFinite","isNaN"]),na=new Map([["Array",new Set(["isArray"])],["ArrayBuffer",new Set(["isView"])],["Atomics",new Set(["isLockFree"])],["Number",new Set(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new Set(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new Set(["deleteProperty","has"])],["URL",new Set(["canParse"])]]),ni=new Map([["array",new Set(["every","includes","some"])],["map",new Set(["has"])],["regexp",new Set(["test"])],["set",new Set(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new Set(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new Set(["has"])]]),ns=new Map([["regexp",new Set(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function nl(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{return function e(t,r){if(!t)return!1;if(t.isUnion?.())return t.types.every(t=>e(t,r));let n=r.getBaseConstraintOfType(t);return n&&n!==t?e(n,r):nn.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function nu(e){if(e?.type==="Identifier")return e.name}function np(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return np(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return function(e,t,r,n){let o=nu(e.typeName);if(!o||n.has(o))return!1;n.add(o);let a=tN(o,r),[i]=a?.defs??[],s=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&np(i.node.typeAnnotation,t,r,n);return n.delete(o),s}(e,t,r,n);case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>np(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function nc(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nc(e.typeAnnotation,t,r,n);case"TSFunctionType":return np(e.returnType,t,r,n);case"TSTypeReference":return function(e,t,r,n){let o=nu(e.typeName);if(!o||n.has(o))return!1;n.add(o);let a=tN(o,r),[i]=a?.defs??[],s=i?.type==="Type"&&("TSTypeAliasDeclaration"===i.node.type&&nc(i.node.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===i.node.type&&i.node.body.body.filter(e=>"TSCallSignatureDeclaration"===e.type).every(e=>np(e.returnType,t,r,n))&&i.node.body.body.some(e=>"TSCallSignatureDeclaration"===e.type));return n.delete(o),s}(e,t,r,n);case"TSUnionType":return e.types.every(e=>nc(e,t,r,n));default:return!1}}function nd(e,t,r=new Set){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!np(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?ng(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&ng(e.body,t,r))}function nm(e,t,r=new Set){if(e?.type!=="Identifier")return!1;let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n))return!1;r.add(n);let o=!1;if(n.defs.length>1&&n.defs.every(e=>"FunctionName"===e.type)){let e=n.defs.filter(e=>"TSDeclareFunction"===e.node.type),a=e.length>0?e:n.defs;o=n.references.every(e=>!e.writeExpr)&&a.every(e=>nd(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(nc(e.name?.typeAnnotation,t,a))o=!0;else{let a;"FunctionName"===e.type?n.references.every(e=>!e.writeExpr)&&(a=e.node):"Variable"===e.type&&"const"===e.parent.kind&&["ArrowFunctionExpression","FunctionExpression"].includes(e.node.init?.type)&&(a=e.node.init),o=!!a&&nd(a,t,r)}}return r.delete(n),o}function nf(e,t,r=new Set){switch(e?.type){case"ArrayExpression":return"array";case"Literal":return"string"==typeof e.value?"string":e.regex?"regexp":void 0;case"TemplateLiteral":return 0===e.expressions.length?"string":void 0;case"NewExpression":if("Identifier"===e.callee.type&&t.sourceCode.isGlobalReference(e.callee)){if("RegExp"===e.callee.name)return"regexp";if(["Map","WeakMap"].includes(e.callee.name))return"map";if("Set"===e.callee.name)return"set";if("WeakSet"===e.callee.name)return"weakSet"}return;case"Identifier":return function(e,t,r){let n=ei(t.sourceCode.getScope(e),e),[o]=n?.defs??[];if(!n||r.has(n)||1!==n.defs.length||"Variable"!==o.type||"const"!==o.parent.kind)return;r.add(n);let a=nf(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return nf(e.expression,t,r)}}function ng(e,t,r=new Set){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!np(e.typeAnnotation,t,n)||"boolean"==typeof ew(e,t.sourceCode.getScope(e))?.value||(function(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){if(!e||r.has(e)||1!==e.defs.length)return!1;r.add(e);let[n]=e.defs,o=t.sourceCode.getScope(n.name);if(n.name?.typeAnnotation)return r.delete(e),!n.name.optional&&np(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&ng(n.node.init,t,r);if(!a&&"Parameter"===n.type){let e=n.name.parent;a="AssignmentPattern"===e.type&&e.left===n.name&&ng(e.right,t,r)}return r.delete(e),a}(ei(t.sourceCode.getScope(e),e),t,r)||nl(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return ng(e.left,t,r)&&ng(e.right,t,r);case"BinaryExpression":return nr.has(e.operator);case"ConditionalExpression":return ng(e.consequent,t,r)&&ng(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),np(e.typeAnnotation,t,n)||ng(e.expression,t,r);case"CallExpression":return!!(function(e,t){if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.object.type||!t.sourceCode.isGlobalReference(e.callee.object))return!1;let r=na.get(e.callee.object.name),n=eI(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t)||function(e,t){if("MemberExpression"!==e.callee.type)return!1;let r=ni.get(nf(e.callee.object,t)),n=eI(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?nl(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||no.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||nm(e.callee,t,r)||nl(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=ns.get(nf(e.object,t)),n=eI(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"YieldExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return ng(e.argument??e.expression,t,r);case"SequenceExpression":return ng(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&ng(e.right,t,r)}return}}(e,t,r)??nl(e,t))}let ny=new Set(["asIntN","asUintN"]),nh=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nh(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return e5(e.literal);default:return!1}},{isTarget:nx}=rU({targetTypeNames:new Set,targetCallNames:["BigInt"],isTargetNode:e=>e5(e)||r3(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&r8(e.callee,"BigInt",ny),isTargetTypeAnnotation:nh,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?rA:rw}),nb=new Set(["fromCharCode","fromCodePoint"]),nE=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nE(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return e1(e.literal);default:return!1}},{isTarget:nD,isKnownNonTarget:nS}=rU({targetTypeNames:new Set,targetCallNames:["String"],isTargetNode:(e,t)=>{if(e1(e)||r3(e,"String")||"CallExpression"===e.type&&!e.optional&&r8(e.callee,"String",nb))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(nv(e.left,t)||nv(e.right,t));case"AssignmentExpression":if("="===e.operator)return nv(e.right,t);return"+="===e.operator&&(nv(e.left,t)||nv(e.right,t));default:return!1}},isTargetTypeAnnotation:nE,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?rA:rw});function nv(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&nE(e.typeAnnotation)||nD(e,t))||"string"==typeof ew(e,t.sourceCode.getScope(e))?.value)}let nC=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),nA=e=>nC.has(e.type)||tx(e),nT=new Set(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),nw=new Set(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),nk=e=>nT.has(e.type)||nw.has(e.type)||tx(e)||e7(e)&&!td(e,{method:"bind",optionalCall:!1,optionalMember:!1}),nI=(e,t)=>{if("ThisExpression"===e.type)return!0;if("FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return!1;if("ClassDeclaration"===e.type||"ClassExpression"===e.type){if(e.superClass&&nI(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&nI(r.key,t))return!0;return!1}let r=t[e.type];if(!r)return!1;for(let n of r){let r=e[n];if(r){if(Array.isArray(r)){for(let e of r)if(e&&nI(e,t))return!0;continue}if(nI(r,t))return!0}}return!1};function nj(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}let nF=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function nB(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!ei(t.sourceCode.getScope(e),e))}let n$=(e,t,r)=>e&&t&&r.sourceCode.getRange(e)[0]===r.sourceCode.getRange(t)[0]&&r.sourceCode.getRange(e)[1]===r.sourceCode.getRange(t)[1],nR=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&n$(n,o,t)&&n===e},nP=new Set(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function nL(e){return nP.has(e.type)}let nN=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,nM=e=>ti(e.parent),nO=new Set(["String","Null","Boolean","Numeric","RegularExpression"]),nq=new Set(["[","(","/","`","+","-","*",",","."]);function nU(e,t,r){if(""===r||r&&!nq.has(r.charAt(0))||!e)return!1;let{sourceCode:n}=t,{type:o,value:a}=e,i=n.getRange(e),s=n.getNodeByRangeIndex(i[0]);if("Punctuator"===o){if(";"===a)return!1;if("]"===a)return!0;if(")"===a){switch(s.type){case"IfStatement":if(n.getTokenBefore(s.consequent)===e)return!1;break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"WhileStatement":case"DoWhileStatement":case"WithStatement":if(s.body&&n.getTokenBefore(s.body)===e)return!1}return!0}}return!!nO.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let nW=e=>"type"===e.importKind||"type"===e.parent.importKind,n_=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0];function*nV(e){if("function"!=typeof e?.[Symbol.iterator])return void(yield e);for(let t of e)yield*nV(t)}class nz extends Error{name="FixAbortError"}let nK={abort(){throw new nz("Fix aborted.")}};function nG(e){return t=>{let r=nV(e(t,nK));try{return[...r]}catch(e){if(e instanceof nz)return;throw e}}}class nJ{#e;#t=new Map;constructor(e){this.#e=e}#r(e,t){let r=this.#t;for(let n of e)r.has(n)?r.get(n).push(t):r.set(n,[t])}on(e,t){let r=Array.isArray(e)?e:[e];this.#r(r,t)}onExit(e,t){let r=Array.isArray(e)?e:[e];this.#r(r.map(e=>`${e}:exit`),t)}toEslintListeners(){let e={};for(let[t,r]of this.#t)e[t]=function(e,t){return(...r)=>{for(let n of nV(t(...r))){if(!n)continue;let t=function(e){let t={...e};return e.fix&&(t.fix=nG(e.fix)),Array.isArray(e.suggest)&&(t.suggest=e.suggest.map(t=>({...t,fix:nG(t.fix),data:{...e.data,...t.data}}))),t}(n);e.report(t)}}}(this.#e,function*(...e){for(let t of r)yield t(...e)});return e}}let nX=new Set;function nY(e){return nX.has(e)?e:t=>{let r=new nJ(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return p.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function nH(e,t){var r;let{visitScriptBlock:n=!0}={},o=nY(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},nX.add(r),r}function nZ(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let nQ=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function n0(e){if(e8(e=rg(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=n0(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function n1(e,t){switch(e.type){case"Identifier":case"MemberExpression":case"CallExpression":case"ChainExpression":case"TemplateLiteral":case"ThisExpression":case"ArrayExpression":case"FunctionExpression":return!1;case"NewExpression":return!tJ(e,t);case"Literal":let r;return!!(e8(e)&&(r=e.raw,nQ.test(r)));default:return!0}}let n2=new Set(["!","typeof","void","delete","~","+","-"]);function n3(e,t){if(!n2.has(t))throw Error("Unexpected operator");return["UpdateExpression","BinaryExpression","LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"].includes(e.type)}function n8(e,{operator:t,property:r}){if(!r)throw Error("`property` is required.");return("LogicalExpression"!==e.type||e.operator!==t)&&(!!["AwaitExpression","BinaryExpression"].includes(e.type)||["LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression"].includes(e.type))}var n6={exports:{}},n9=n6.exports,n5=tI(function(){return s?n6.exports:(s=1,n6.exports=function(){var e=[],t=[],r={},n={},o={};function a(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var o=n.length;o--;){var a=n[o];if(a[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var o,a,s=(o=t[1],a=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return a[t]||""}));return""===r?i(e[n-1],s):i(r,s)})}(t,a)}return t}function l(e,t,r){return function(n){var o=n.toLowerCase();return t.hasOwnProperty(o)?i(n,o):e.hasOwnProperty(o)?i(n,e[o]):s(o,n,r)}}function u(e,t,r,n){return function(n){var o=n.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&s(o,o,r)===o}}function p(e,t,r){var n=1===t?p.singular(e):p.plural(e);return(r?t+" ":"")+n}return p.plural=l(o,n,e),p.isPlural=u(o,n,e),p.singular=l(n,o,t),p.isSingular=u(n,o,t),p.addPluralRule=function(t,r){e.push([a(t),r])},p.addSingularRule=function(e,r){t.push([a(e),r])},p.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,t){t=t.toLowerCase(),o[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}(),n6.exports)}());function n4(e,t,r=0,n=0){let{sourceCode:o}=t,[a,i]=Array.isArray(e)?e:o.getRange(e);return{start:o.getLocFromIndex(a+r),end:o.getLocFromIndex(i+n)}}function n7(e){let t=[],r=new WeakMap,n=new WeakMap,o=new WeakSet;return e.on("onCodePathStart",()=>{t.push(new Set)}),e.on("onCodePathEnd",()=>{t.pop()}),e.on("onCodePathSegmentStart",e=>{t.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{t.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{t.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{t.at(-1).delete(e)}),e.on("IfStatement",e=>{[...t.at(-1)].some(e=>e.reachable)&&o.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{r.set(e,new Set(t.at(-1)))}),e.onExit("IfStatement",e=>{let a=t.at(-1);for(let t of[e.consequent,e.alternate]){if(!t)continue;let i=r.get(t),s=!o.has(e)||!i||[...a].some(e=>e.prevSegments.some(e=>i.has(e)));n.set(t,!s)}}),e=>!!(e&&n.get(e))}function oe(e,t,r){let{parent:n}=e;for(let o of t.sourceCode.visitorKeys[n.type]||Object.keys(n)){let t=n[o];if(t!==e&&Array.isArray(t)){let n=t.indexOf(e);if(-1!==n)return t[n+r]}}}let ot=(e,t)=>oe(e,t,-1),or=(e,t)=>oe(e,t,1),on=e=>e.charAt(0).toUpperCase()+e.slice(1),oo=e=>e.charAt(0).toLowerCase()+e.slice(1),oa="too-deep",oi="should-parenthesized",os="prefer-event-target",ol=new Set(["@angular/core","eventemitter3"]),ou=e=>"VariableDeclarator"===e.parent.type&&e.parent.id===e&&"VariableDeclaration"===e.parent.parent.type&&"const"===e.parent.parent.kind&&e.parent.parent.declarations.includes(e.parent);function op(e){let t;return!!e&&(tf(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(e1(t)&&ol.has(t.value)))}let oc={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},od="prefer-keyboard-event-key",om="prefer-keyboard-event-key/suggestion",of=new Set(["keyCode","charCode","which"]),og=new Set(["onKeyDown","onKeyPress","onKeyUp"]),oy=e=>{var t;return e?.type==="TSTypeAnnotation"&&"TSTypeReference"===e.typeAnnotation.type&&("Identifier"===(t=e.typeAnnotation.typeName).type?"KeyboardEvent"===t.name:"TSQualifiedName"===t.type&&"Identifier"===t.left.type&&"React"===t.left.name&&"Identifier"===t.right.type&&"KeyboardEvent"===t.right.name)},oh=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&td(t.parent,{method:"addEventListener",minimumArguments:2,optionalCall:!1,optionalMember:!1})&&t.parent.arguments[1]===t&&o.push({parameter:t.params[0],shouldAutofix:!0}),a&&"JSXExpressionContainer"===(r=t).parent.type&&r.parent.expression===r&&"JSXAttribute"===r.parent.parent.type&&r.parent.parent.value===r.parent&&"JSXAttribute"===(n=r.parent.parent).type&&"JSXIdentifier"===n.name.type&&og.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))oy(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!r1(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},ox=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,ob=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tl(n)&&r.push(...oh(e,n));return r},oE=(e,{shouldAutofix:t})=>{let r=(e=>{var t;if(e.parent?.type!=="MemberExpression"||e.parent.property!==e)return;let r=((e,t)=>{let r=e;for(;r&&t;)t--,r=r.parent;if(0===t)return r})(e,3);if(!r||"IfStatement"!==r.type)return;let{type:n,operator:o,right:a}=r.test;if(!("BinaryExpression"===n&&r.test.left===e.parent&&("=="===o||"==="===o)&&e8(a)))return;let i=Object.hasOwn(oc,t=a.value)?oc[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:od,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tF(r.key))];return t?n.fix=o:n.suggest=[{messageId:om,data:{key:r.key},fix:o}],n},oD=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),oS=(e,{references:t})=>{let r=((e,t,r=()=>!0)=>{let n=e;for(;n;){if(n.type===t&&r(n))return n;n=n.parent}})(e,"VariableDeclarator"),n=r?.init;return t&&r?.id===e.parent.parent&&t.some(e=>e.identifier===n)},ov="error",oC="suggestion";function*oA(e,t,r){for(let n of eY(e,r))yield t.remove(n)}function oT(e,t,r,n){if("CallExpression"!==t.type)throw Error(`Unexpected node "${t.type}".`);let{sourceCode:o}=n,[a,i]=o.getLastTokens(t,2);return t.arguments.length>0&&(r=eu(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function ow(e,t,r){return e.removeRange(function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=eY(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(0!==n){let e=s.getTokenBefore(a);[l]=s.getRange(e)}if(1===r.arguments.length){let e=s.getTokenAfter(i);eu(e)&&([,u]=s.getRange(e))}return[l,u]}(t,r))}function ok(e,t,r,n){return e.replaceTextRange(eH(t,n),r)}function oI(e,t,r,n){let o=eZ(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!n1(r,n):nL(r))||eQ(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),nU(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*oj(e,t,r){if("ReturnStatement"!==t.type&&"ThrowStatement"!==t.type)return;let{sourceCode:n}=r,o=n.getFirstToken(t);yield e.insertTextAfter(o," (");let a=n.getLastToken(t);ep(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function oF(e,t,r){let n="object"==typeof e?t.sourceCode.getRange(e)[1]:e,[o]=t.sourceCode.text.slice(n).match(/^\s*/);return r.removeRange([n,n+o.length])}function*oB(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield oF(n,t,r),tJ(e,t)||(yield r.insertTextAfter(e,"()")),nj(n,e.callee,t)||eQ(e,t)||(yield oj(r,e.parent,t))}let o$=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*oR(e,t,r){let{sourceCode:n}=r,o=eH(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&o$(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&o$(i)&&(yield e.insertTextBefore(i," "))}function*oP(e,t,r){var n;yield oR(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!eQ(o,t)&&"MemberExpression"===(n=o).type&&function(e){let t=e.object,r=e.object.type;for(;"MemberExpression"===r;)r=(t=t.object).type;return"CallExpression"===r}(n)&&(yield r.insertTextBefore(o,"("),yield r.insertTextAfter(o,")"))}function oL(e,t,r,n){let[,o]=eH(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let oN=(e,t,r)=>oL(e,t,r,"");function*oM(e,t,r){let n=t.callee;yield oN(e,n,r);let[,o]=eH(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function oO(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);ep(r)&&(i=t)}let s=o.getLoc(e).start,l=o.getLoc(i).end,u=a[s.line-1].slice(0,s.column),p=a[l.line-1].slice(l.column),[c]=o.getRange(e),[,d]=o.getRange(i);if(/^\s*$/.test(u)&&/^\s*$/.test(p))if(d+=p.length,0===c){let{text:e}=o;"\r"===e[d]&&"\n"===e[d+1]?d+=2:("\n"===e[d]||"\r"===e[d])&&d++}else c=Math.max(0,c-u.length-1);return r.removeRange([c,d])}function oq(e,t,r,n){if(nN(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&nN(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(nR(e,r))return n.replaceText(e,`${e.name} as ${t}`);if(((e,t)=>{let{type:r,local:n,exported:o}=e.parent;return"ExportSpecifier"===r&&n$(n,o,t)&&n===e})(e,r))return n.replaceText(e,`${t} as ${e.name}`);if(e.typeAnnotation){let{sourceCode:o}=r;return o.getCommentsInside(e).length>0?n.replaceText(o.getFirstToken(e),t):n.replaceTextRange([o.getRange(e)[0],o.getRange(e.typeAnnotation)[0]],`${t}${e.optional?"?":""}`)}return n.replaceText(e,t)}let oU=(e,t,r,n)=>rc(e).map(e=>oq(e,t,r,n)),oW=(e,t,r,n)=>{let{tail:o}=e,[a,i]=r.sourceCode.getRange(e);return n.replaceTextRange([a+1,i-(o?1:2)],t)};function*o_(e,t,r,n,o){for(let t of eY(e,o?{sourceCode:o}:n))yield o_(t,"",r,n,o);let{sourceCode:a}=n,[i,s]=a.getRange(e),[l]=a.text.slice(0,i).match(/\s*$/),[u]=l.match(/(?:\r?\n|\r)?/);i-=l.length,yield r.replaceTextRange([i,s],`${u}${t}`)}let oV="require-array-join-separator",oz="no-thenable-object",oK="no-thenable-export",oG="no-thenable-class",oJ=(e,t)=>ew(e,t.sourceCode.getScope(e))?.value==="then",oX=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===eI(e,t.sourceCode.getScope(e)):"then"===r.name},oY=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&oX(r,t)&&(yield r.key)},messageId:oz},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){oX(e,t)&&(yield e.key)},messageId:oG},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&oX(e,t)&&(yield e.property)},messageId:oz},{selector:"CallExpression",*getNodes(e,t){if(!(td(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})&&"SpreadElement"!==e.arguments[0].type))return;let[,r]=e.arguments;oJ(r,t)&&(yield r)},messageId:oz},{selector:"CallExpression",*getNodes(e,t){if(td(e,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"ArrayExpression"===e.arguments[0].type)for(let r of e.arguments[0].elements){if(!(r?.type==="ArrayExpression"&&r.elements[0]&&"SpreadElement"!==r.elements[0].type))continue;let[e]=r.elements;oJ(e,t)&&(yield e)}},messageId:oz},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:oK},{selector:"Identifier",*getNodes(e){"then"===e.name&&("FunctionDeclaration"===e.parent.type||"ClassDeclaration"===e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type&&e.parent.parent.declaration===e.parent&&(yield e)},messageId:oK},{selector:"VariableDeclaration",*getNodes(e,t){if("ExportNamedDeclaration"===e.parent.type&&e.parent.declaration===e)for(let r of t.sourceCode.getDeclaredVariables(e))"then"===r.name&&(yield*r.identifiers)},messageId:oK}],oH="no-invalid-remove-event-listener",oZ="consistent-function-scoping",oQ=(e,t)=>e&&t&&(e===t||e.block===t.block),o0=(e,t)=>e.some(e=>oQ(e,t)),o1=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),o2=new Set(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),o3=e=>e?.type==="BlockStatement"&&o2.has(e.parent.type)&&e.parent.body===e,o8=new Set(["FunctionExpression","ArrowFunctionExpression"]),o6={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(ts,e=>{if(("ArrowFunctionExpression"!==e.type||t)&&!function(e,t,r){let n,o,a,i=t.acquire(e);if(!i||(o=r.visitorKeys,"ArrowFunctionExpression"===e.type&&nI(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&ts.includes(t.type)&&ty(e.callee,["jest.mock"]))return!0;t=e}return!1}(e))return!0;let s=e.parent;"VariableDeclarator"===s.type&&(s=s.parent),"VariableDeclaration"===s.type&&(s=s.parent),s?.type==="ReturnStatement"&&"ArrowFunctionExpression"===e.type&&(s=s.parent),s=function(e,t){if("ArrowFunctionExpression"===e.type&&"ArrowFunctionExpression"===t.type){let t=function(e){let t=e;for(;t&&"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e);t&&"ReturnStatement"===t.type&&"ReturnStatement"===(e=function(e){let t=e;for(;"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e)).type&&(e=e.parent)}return e}(s,e),s?.type==="BlockStatement"&&(n=s,s=s.parent);let l=t.acquire(s),u=function(e,t,r){let n=[];e&&n.push(e);let o=function(e){let t=[];for(;e?.type==="BlockStatement";){if(t.push(e),o3(e))return t;e=e.parent}return[]}(t);if(0===o.length)return n;let a=o.at(-1),i=r.acquire(a.parent);for(let e of(i&&n.push(i),o)){let t=r.acquire(e);t&&n.push(t)}return n}(l,n,t);return!!(0===u.length||u.some(e=>"global"===e.type)||l&&l.block?.parent?.callee&&ty(l.block.parent.callee,o1)||l&&(a=s,o8.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||tO(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(o0(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&o0(u,t.scope)})||e.defs.some(e=>o0(u,t.acquire(e.node)))||e.identifiers.some(e=>{if(!e.parent||"FunctionDeclaration"!==e.parent.type||t.acquire(e))return!1;let r=t.acquire(e.parent);return!(!r||oQ(i,r))&&o0(u,r.upper)}))}(e,n,r))return{node:e,loc:eh(e,r),messageId:oZ,data:{functionNameWithKind:ej(e,r)}}})},meta:{type:"suggestion",docs:{description:"Move function definitions to the highest possible scope.",recommended:!0},schema:[{type:"object",additionalProperties:!1,properties:{checkArrowFunctions:{type:"boolean",description:"Whether to check arrow functions."}}}],defaultOptions:[{checkArrowFunctions:!0}],messages:{[oZ]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},o9="error",o5="error-unknown",o4="suggestion";function o7(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield oB(e,t,n)}}let ae="no-console-spaces",at=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),ar=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),an="no-empty-file",ao={create:e=>{let{allowComments:t}=e.options[0];e.filename===e.physicalFilename&&(e.on("Program",r=>{if(r.templateBody)return;if(1===r.body.length&&"Document"===r.body[0].type){let{children:e}=r.body[0];if(e.some(e=>"Comment"!==e.type&&("Text"!==e.type||""!==e.value.trim()))||t&&e.some(e=>"Comment"===e.type))return;return{node:r,messageId:an}}if(r.body.some(e=>!tn(e,tr)))return;let{sourceCode:n}=e,o=t6(e);if(0!==n.ast.tokens.length||0!==o.length||""===n.text.trim()){if(!o.some(e=>"Line"===e.type&&e.value.startsWith("/"))&&(!(t&&o.length>0&&o.every(e=>"Line"===e.type||"Block"===e.type))||0!==n.ast.tokens.length))return{node:r,messageId:an}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=t6(e);if(!t||!(n.length>0))return{node:r,messageId:an}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=t6(e);if(!t||!(n.length>0))return{node:r,messageId:an}}),e.on("root",e=>{if(!e.children.some(e=>!("html"===e.type&&/^<!--(?:(?!-->)[\s\S])*-->$/.test(e.value.trim())))&&(!t||!(e.children.length>0)))return{node:e,messageId:an}}))},meta:{type:"suggestion",docs:{description:"Disallow empty files.",recommended:"unopinionated"},schema:[{type:"object",additionalProperties:!1,properties:{allowComments:{type:"boolean",description:"Whether to allow files that only contain comments."}}}],defaultOptions:[{allowComments:!1}],messages:{[an]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},aa="no-useless-fallback-in-spread",ai="zero-fraction",as="dangling-dot",al="error",au="suggestion",ap=Symbol.for("default"),ac=Symbol("NAMESPACE_SPECIFIER_NAME"),ad=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},am=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*af(e,t,r){switch(e.type){case"ImportSpecifier":case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return void(yield function*(e,t,r,n=!1){let o=e.parent,{specifiers:a}=o;if(1===a.length&&!n)return void(yield t.remove(o));let{sourceCode:i}=r;switch(e.type){case"ImportSpecifier":if(a.every(t=>e===t||e.type!==t.type)){let r=i.getTokenAfter(e,e=>"Identifier"===e.type&&"from"===e.value),n=a.some(e=>"ImportDefaultSpecifier"===e.type),o=i.getTokenBefore(e,n?eu:ef),[s]=i.getRange(o),[l]=i.getRange(r),u=i.getTokenBefore(o),p=i.getRange(u)[1]===s;yield t.replaceTextRange([s,l],p?" ":"");return}case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ImportDefaultSpecifier":{yield t.remove(e);let r=i.getTokenAfter(e);eu(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function ag(e,t){let{sourceCode:r}=t,n=r.getTokenBefore(e.source,e=>"Identifier"===e.type&&"from"===e.value),[o]=r.getRange(n),[,a]=r.getRange(e);return r.text.slice(o,a)}let ay={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new Set,o=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{e1(e.source)&&o.push(e)}),e.on("Program:exit",function*(a){for(let i of n){let n=t.getDeclaredVariables(i);if(n.some(e=>1!==e.defs.length||e.defs[0].parent!==i)||(n=n.map(e=>{let r=function(e,t){let r=e.defs[0].node,n={node:r,declaration:r.parent,variable:e,isTypeImport:nW(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:ap,text:"default",...n};case"ImportSpecifier":return{name:ad(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:ac,text:"*",...n}}}(e,t),n=function(e,t){let r=[];for(let{identifier:n}of e.variable.references){let o=function(e,t){let{parent:r}=e;switch(r.type){case"ExportDefaultDeclaration":return{node:r,name:ap,text:"default",isTypeExport:am(r)};case"ExportSpecifier":return{node:r,name:ad(r.exported),text:t.getText(r.exported),isTypeExport:am(r)};case"VariableDeclarator":if(r.init===e&&"Identifier"===r.id.type&&!r.id.typeAnnotation&&"VariableDeclaration"===r.parent.type&&"const"===r.parent.kind&&1===r.parent.declarations.length&&r.parent.declarations[0]===r&&"ExportNamedDeclaration"===r.parent.parent.type&&function(e,t){let r=t.getDeclaredVariables(e);if(1!==r.length)return!1;let[{identifiers:n,references:o}]=r;return 1===n.length&&n[0]===e.id&&1===o.length&&o[0].identifier===e.id}(r,t))return{node:r.parent.parent,name:Symbol.for(r.id.name),text:t.getText(r.id)}}}(n,t);o&&(e.name!==ac||o.name!==ap)&&r.push(o)}return r}(r,t);return{variable:e,imported:r,exports:n}}),!r&&n.some(({variable:e,exports:t})=>e.references.length!==t.length)))continue;let s=!r&&n.some(({variable:e})=>0===e.references.length);for(let{imported:t,exports:r}of n)for(let n of r){let r={node:n.node,messageId:al,data:{exported:n.text}},i=function({context:e,imported:t,exported:r,exportDeclarations:n,program:o}){let a,i=t.declaration,s=i.source.value,l=t.isTypeImport||r.isTypeExport;return l&&(a=n.find(({source:e,exportKind:t})=>"type"===t&&e.value===s)),a||=n.find(({source:e,exportKind:t})=>"type"!==t&&e.value===s),function*(n){if(t.name===ac)yield n.insertTextAfter(o,`
3
- export ${l?"type ":""}* as ${r.text} ${ag(i,e)}`);else{let s=r.name===t.name?r.text:`${t.text} as ${r.text}`;if(l&&(!a||"type"!==a.exportKind)&&(s=`type ${s}`),a){let t=a.specifiers.at(-1);if(t)yield n.insertTextAfter(t,`, ${s}`);else{let t=e.sourceCode.getFirstToken(a,ef);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
4
- export {${s}} ${ag(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield af(t.node,n,e)),yield af(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:au,fix:i}]:r.fix=i,yield r}}})},meta:{type:"suggestion",docs:{description:"Prefer `export…from` when re-exporting.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkUsedVariables:{type:"boolean",description:"Whether to check variables that are used in the module."}}}],defaultOptions:[{checkUsedVariables:!0}],messages:{[al]:"Use `export…from` to re-export `{{exported}}`.",[au]:"Switch to `export…from`."},languages:["js/js"]}},ah="prefer-native-coercion-functions",ax=new Set(["String","Number","BigInt","Boolean","Symbol"]),ab=new Set(["every","filter","find","findLast","findIndex","findLastIndex","some"]),aE=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&ax.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,aD=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},aS=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},aS(e[r],n)):e[r]=n}};class av{#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=ez.READ,context:n,filter:o,handle:a}){for(let e of t)aS(this.#n,aD(e,r));this.#e=n,this.#o=o,this.#a=a}*#i(e,t){let r=t?.context??this.#e,n=t?.filter??this.#o,o=t?.handle??this.#a;for(let t of new ez(e).iterateGlobalReferences(this.#n)){if(n&&!n(t))continue;let e=o(t,r);yield e}}listen(e){let t=e?.context??this.#e;t.onExit("Program",r=>this.#i(t.sourceCode.getScope(r),e))}}Object.assign(av,{READ:ez.READ,CALL:ez.CALL,CONSTRUCT:ez.CONSTRUCT});let aC="no-document-cookie",aA=new av({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:aC})}),aT=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],aw=new Set(["click","rightclick","dblclick","auxclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","mousecancel","selectionchange","selectstart","wheel","keypress","keydown","keyup","blur","focus","deactivate","focusin","focusout","change","reset","select","submit","input","propertychange","dragstart","drag","dragenter","dragover","dragleave","drop","dragend","touchstart","touchmove","touchend","touchcancel","beforeunload","consolemessage","contextmenu","devicechange","devicemotion","deviceorientation","DOMContentLoaded","error","help","load","losecapture","orientationchange","readystatechange","resize","scroll","unload","canplay","canplaythrough","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","sourceopen","sourceended","sourceclosed","abort","update","updatestart","updateend","hashchange","pagehide","pageshow","popstate","copy","paste","cut","beforecopy","beforecut","beforepaste","online","offline","message","connect","install","activate","fetch","foreignfetch","messageerror","statechange","updatefound","controllerchange",...aT("AnimationStart"),...aT("AnimationEnd"),...aT("AnimationIteration"),...aT("TransitionEnd"),"pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout","pointerenter","pointerleave","gotpointercapture","lostpointercapture","MSGestureChange","MSGestureEnd","MSGestureHold","MSGestureStart","MSGestureTap","MSGotPointerCapture","MSInertiaStart","MSLostPointerCapture","MSPointerCancel","MSPointerDown","MSPointerEnter","MSPointerHover","MSPointerLeave","MSPointerMove","MSPointerOut","MSPointerOver","MSPointerUp","text","textinput","textInput","compositionstart","compositionupdate","compositionend","beforeinput","exit","loadabort","loadcommit","loadredirect","loadstart","loadstop","responsive","sizechanged","unresponsive","visibilitychange","storage","DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","beforeprint","afterprint","beforeinstallprompt","appinstalled","afterblur","beforeblur","cancel","close","dragexit","encrypted","fullscreenchange","invalid","toggle","search","open","show"]),ak="prefer-add-event-listener",aI={create:e=>{let t,r,n=new Set(e.options[0].excludedPackages),o=new WeakMap;e.on("onCodePathStart",(e,t)=>{r={node:t,upper:r,returnsSomething:!1}}),e.on("onCodePathEnd",()=>{o.set(r.node,r.returnsSomething),r=r.upper}),e.on("CallExpression",e=>{tf(e)&&!t&&n.has(e.arguments[0].value)&&(t=!0)}),e.on("Literal",e=>{"ImportDeclaration"===e.parent.type&&!t&&n.has(e.value)&&(t=!0)}),e.on("ReturnStatement",e=>{r.returnsSomething||=!!e.argument}),e.on("AssignmentExpression:exit",r=>{let n;if(t)return;let{left:a,right:i,operator:s}=r;if("MemberExpression"!==a.type||a.computed)return;let l=a.property.name;if(!l||!l.startsWith("on"))return;let u=l.slice(2);if(!aw.has(u))return;let p="addEventListener",c="";if(tx(i)||e9(i))p="removeEventListener";else"beforeunload"===u&&("ArrowFunctionExpression"!==i.type&&"FunctionExpression"!==i.type||"BlockStatement"!==i.body.type||o.get(i))?c="Use `event.preventDefault(); event.returnValue = 'foo'` to trigger the prompt.":"message"===u?c="Note that there is difference between `SharedWorker#onmessage` and `SharedWorker#addEventListener('message')`.":"error"===u?c="Note that there is difference between `{window,element}.onerror` and `{window,element}.addEventListener('error')`.":"="!==s||"ExpressionStatement"!==r.parent.type||r.parent.expression!==r||nk(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);eQ(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);eQ(r.right,t)&&(s=`(${s})`);let l=`${i}.addEventListener('${a}', ${s})`;return e.replaceText(r,l)})(t,e,r,a));return{node:a.property,messageId:ak,data:{replacement:p,method:l,extra:c?` ${c}`:""},fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{excludedPackages:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Packages to exclude from checking."}}}],defaultOptions:[{excludedPackages:["koa","sax"]}],messages:{[ak]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},aj=new Set(["false","true"]),aF=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(nF(e.left,t)||nF(e.right,t)),aB=({type:e,name:t},r)=>"Identifier"===e&&t===r;function a$({method:e,replacement:t,checkBooleanPredicate:r=!1}){let n=`prefer-${t}-over-${e}/`,o=`${n}error`,a=`${n}suggestion`;return{messages:{[o]:({findIndex:"Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.",findLastIndex:"Use `.lastIndexOf()` instead of `.findLastIndex() when looking for the index of an item.`",some:`Use \`.${t}()\` instead of \`.${e}()\` when checking value existence.`})[e],[a]:`Replace \`.${e}()\` with \`.${t}()\`.`},listen:function(n){let{sourceCode:i}=n,{scopeManager:s}=i;n.on("CallExpression",r=>{let l,u,p;if(!td(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&aF(p.body,p.params[0])||("ArrowFunctionExpression"===p.type||"FunctionExpression"===p.type)&&!p.async&&!p.generator&&1===p.params.length&&"BlockStatement"===p.body.type&&1===p.body.body.length&&"ReturnStatement"===p.body.body[0].type&&aF(p.body.body[0].argument,p.params[0]))||rJ(r.callee.object,n))return;let[c]=r.arguments,d="BinaryExpression"===c.body.type?c.body:c.body.body[0].argument,[m]=c.params,{left:f,right:g}=d,{name:y}=m;if(aB(f,y))l=g,u=f;else{if(!aB(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||ei(h,m).references.some(({identifier:e})=>e!==u)||rx(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);eQ(l,n)&&!eQ(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return eP(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!td(r,{method:e,argumentsLength:1,optionalCall:!1}))return;let[n]=r.arguments;if("ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||1!==n.params.length||"Identifier"!==n.params[0].type)return;let[a]=n.params,{parserServices:l}=i,u=function(e,t){let r="ArrowFunctionExpression"!==e.type||e.async||1!==e.params.length||"BlockStatement"===e.body.type?"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||1!==e.params.length||"BlockStatement"!==e.body.type||1!==e.body.body.length||"ReturnStatement"!==e.body.body[0].type?void 0:e.body.body[0].argument:e.body;if(r){if(nF(r,t))return r;if("CallExpression"===r.type&&!r.optional&&aB(r.callee,"Boolean")&&1===r.arguments.length&&nF(r.arguments[0],t))return r.arguments[0]}}(n,a);if(!u||!function(e){if("boolean"===e.intrinsicName||"true"===e.intrinsicName)return!0;if(!e.isUnion())return!1;let t=e.types.map(e=>e.intrinsicName);return t.includes("true")&&t.every(e=>aj.has(e))}(l.getTypeAtLocation(a))||!function(e,t){if(e.isUnion())return!1;let r=t.program.getTypeChecker();return!!e.getProperty("includes")&&(r.isArrayType(e)||r.isTupleType(e))}(l.getTypeAtLocation(r.callee.object),l))return;let p=s.acquire(n);if(!p||ei(p,a).references.some(({identifier:e})=>e!==u)||rx(n,p))return;let c=r.callee.property;return{node:c,messageId:o,*fix(e,{abort:r}){i.getCommentsInside(n).length>0&&r(),yield e.replaceText(c,t),yield e.replaceText(n,"true")}}})}}}let aR=a$({method:"findIndex",replacement:"indexOf"}),aP=a$({method:"findLastIndex",replacement:"lastIndexOf"}),aL={create(e){aR.listen(e),aP.listen(e)},meta:{type:"suggestion",docs:{description:"Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{...aR.messages,...aP.messages},languages:["js/js"]}},aN="error",aM="prefer-date",aO="prefer-date-now-over-methods",aq="prefer-date-now-over-number-data-object",aU=e=>te(e,{name:"Date",argumentsLength:0}),aW=(e,t,r)=>({node:e,messageId:aM,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield oR(t,e,r))},...t}),{isIdentifierName:a_}=tL,aV="prefer-dataset",az="prefer-attributes",aK=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,aG=e=>tc(e,{property:"dataset"}),aJ=e=>e.computed||"Identifier"!==e.property.type?e.computed&&e1(e.property)?e.property.value:void 0:e.property.name,aX=new Set(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),aY=/[\s\u0000-\u001F"'/<=>]/,aH=e=>aX.has(e)||e.includes("-")||aY.test(e);function aZ(e,t){let r=eZ(e,t);return!eQ(e,t.sourceCode)&&n1(e,t)?`(${r})`:r}let aQ={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(aH(n.value)||r0(o.object,e))return;let a=aZ(o.object,e),i=o.optional?"?.":".",s=tF(aK(n.value),n.raw.charAt(0)),l=t4(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return nU(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:az,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&e1(e.left)&&aG(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>td(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&aG(e.arguments[0])&&e1(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):td(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&aG(e.callee.object)&&e1(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&aG(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||r0(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:az,data:{method:"getAttribute"},fix:function(e,t){let{sourceCode:r}=t,n=e.init,o=e.parent,[a]=r.getDeclaredVariables(e);if(!a)return;let i=function(e){let t=[];for(let r of e.references){if(r.init)continue;let{identifier:e}=r,n=e.parent;if(!("MemberExpression"===n.type&&n.object===e&&!n.optional))return;let o=aJ(n);if(void 0===o||aH(o))return;let{parent:a}=n;if(r2(n)||"CallExpression"===a.type&&a.callee===n||"TaggedTemplateExpression"===a.type&&a.tag===n)return;t.push(n)}return t}(a);if(!(i&&i.length>0&&"const"===o.kind&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&"Identifier"===n.object.type&&function(e,t,r){let{sourceCode:n}=r,{name:o}=e.object,a=e=>ei(n.getScope(e),o),i=a(e.object),s=t.some(e=>a(e)!==i),l=!!i?.references.some(e=>e.isWrite()&&!e.init);return!s&&!l}(n,i,t)&&!t4(t,o)&&i.every(e=>!t4(t,e))))return;let s=aZ(n.object,t);return function*(e){for(let r of(yield oO(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tF(aK(aJ(r)),t);yield e.replaceText(r,`${s}.getAttribute(${n})`)}}}(t,e)};let{properties:o}=t.id;if(o.some(e=>"Property"===e.type&&(e.computed||"Identifier"!==e.key.type?!e1(e.key)||aH(e.key.value):aH(e.key.name))))return;let a=t.parent,i=aZ(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!t4(e,a,[n.object])&&o.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"Identifier"===e.value.type)&&(1===o.length||"Identifier"===n.object.type)){let t=t8(a,e),n=o.map(e=>{let t=tF(aK(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
5
- ${t}`)};`)}return{node:n,messageId:az,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!aG(o)||r0(o.object,e))return;let a=aJ(r);if(void 0===a||aH(a)||r.optional)return;let i="ChainExpression"===r.parent.type?r.parent.parent:r.parent;if("CallExpression"===i.type&&i.callee===r||"TaggedTemplateExpression"===i.type&&i.tag===r||"UpdateExpression"===i.type||"AssignmentExpression"===i.type&&i.left===r&&"="!==i.operator)return;let s="AssignmentExpression"===i.type&&i.left===r,l="UnaryExpression"===i.type&&"delete"===i.operator;if(r2(r)&&!s&&!l)return;let u=aZ(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tF(aK(a),c);return s&&nM(i)&&!t4(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${eZ(i.right,e)})`):l&&ti(i.parent)&&!t4(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return nU(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||t4(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:az,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((td(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||td(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&e1(t.arguments[0]))||r0(t.callee.object,e))return;let r=t.callee.property.name,n="ChainExpression"===t.parent.type?t.parent:t;if(("AwaitExpression"!==n.parent.type||n.parent.argument!==n||"getAttribute"!==r)&&t.arguments[0].value.toLowerCase().startsWith("data-"))return{node:t,messageId:aV,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&ry(e.callee)||"setAttribute"===r&&!nM(e)||"removeAttribute"===r&&!ti(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!t4(t,e,n))return n=>{let[o]=e.arguments,a=o.value.toLowerCase().slice(5).replaceAll(/-[a-z]/g,e=>e[1].toUpperCase()),i="",s=`${aZ(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=a_(a)?`.${a}`:`[${tF(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${eZ(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tF(a,o.raw.charAt(0))})`}return n.replaceText(e,i)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for DOM element dataset access.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{preferAttributes:{type:"boolean",description:"Prefer attribute methods over named `.dataset` access."}}}],defaultOptions:[{preferAttributes:!1}],messages:{[aV]:"Prefer `.dataset` over `{{method}}(…)`.",[az]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},a0="prefer-modern-math-apis",a1=(e,t)=>"MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.object.type&&"Math"===e.object.name&&"Identifier"===e.property.type&&e.property.name===t,a2=(e,t)=>"CallExpression"===e.type&&!e.optional&&a1(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function a3({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(a2(n.left,"log")&&a1(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):a2(n.right,"log")&&a1(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:a0,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${eZ(s,o)})`)}}}function a8({constantName:e,replacementMethod:t}){let r={messageId:a0,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&a2(n.left,"log")&&a1(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${eZ(a,o)})`)}}}let a6=[a3({constantName:"LOG10E",replacementMethod:"log10"}),a3({constantName:"LOG2E",replacementMethod:"log2"}),a8({constantName:"LN10",replacementMethod:"log10"}),a8({constantName:"LN2",replacementMethod:"log2"})],a9=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>a9(e)):[e],a5="number-literal-case",a4=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},a7={create:nH(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(e8(t)?o=a4(r,n):e5(t)&&(o=a4(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:a5,fix:e=>e.replaceText(t,o)}})}),meta:{type:"suggestion",docs:{description:"Enforce proper case for numeric literals.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{hexadecimalValue:{enum:["uppercase","lowercase"]}}}],defaultOptions:[{hexadecimalValue:"uppercase"}],messages:{[a5]:"Invalid number literal casing."},languages:["js/js"]}},ie="error",it="suggestion",ir={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},io=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function ia(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=io(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:ie,data:{description:o,property:i}};if("NEGATIVE_INFINITY"===i)return s.node=a,s.data.description="-Infinity",s.fix=function*(e){yield e.replaceText(a,"Number.NEGATIVE_INFINITY"),yield oR(e,a,t)},s;let l=e=>oq(r,`Number.${i}`,t,e);return ir[o]||((e,t)=>{let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e||1!==r.arguments.length)return!1;let[n]=r.arguments;return"SpreadElement"!==n.type&&nt(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:it,fix:l}],s}let ii={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new av({objects:Object.keys(ir).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:ia,filter(t){let{node:r,path:n}=t,[o]=n;return!r2(r)&&!("Infinity"===o&&(e=>{if(!io(e))return!1;let{parent:t}=e,{parent:r}=t;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t})(r))&&!("parseInt"===o&&function(e,t){let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e)return!1;let n=r.arguments[1];return!n||"SpreadElement"!==n.type&&ew(n,t.sourceCode.getScope(n))?.value===10}(r,e))}}).listen()},meta:{type:"suggestion",docs:{description:"Prefer `Number` static methods over global functions and optionally static properties over global constants.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkInfinity:{type:"boolean",description:"Whether to check usage of the global `Infinity`."},checkNaN:{type:"boolean",description:"Whether to check usage of the global `NaN`."}}}],defaultOptions:[{checkInfinity:!1,checkNaN:!1}],messages:{[ie]:"Prefer `Number.{{property}}` over `{{description}}`.",[it]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},is="prefer-reflect-apply",il=(e,t)=>(e9(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),iu=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,ip="prefer-set-size";var ic={exports:{}},id=tI(function(){var e,t,r,n;return l?ic.exports:(l=1,r=String.fromCodePoint||(e=String.fromCharCode,t=Math.floor,function(){var r,n,o=[],a=-1,i=arguments.length;if(!i)return"";for(var s="";++a<i;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,n=l%1024+56320,o.push(r,n)),(a+1==i||o.length>16384)&&(s+=e.apply(null,o),o.length=0)}return s}),n={parse:function(e,t,n){function o(t,r){return t.range[0]=r,t.raw=e.substring(r,t.range[1]),t}function a(t,r){return{type:"anchor",kind:t,range:[H-r,H],raw:e.substring(H-r,H)}}function i(t,r,n,o){return{type:"value",kind:t,codePoint:r,range:[n,o],raw:e.substring(n,o)}}function s(e,t,r,n){return n=n||0,i(e,t,H-(r.length+n),H)}function l(e){var t,r=e[0],n=r.charCodeAt(0);return Y&&1===r.length&&n>=55296&&n<=56319&&(t=h().charCodeAt(0))>=56320&&t<=57343?i("symbol",(n-55296)*1024+t-56320+65536,++H-2,H):i("symbol",n,H-1,H)}function u(t,r,n,o,a){return null==o&&(n=H-1,o=H),{type:"quantifier",min:t,max:r,greedy:!0,body:null,symbol:a,range:[n,o],raw:e.substring(n,o)}}function p(t,r,n,o){return{type:"characterClass",kind:t.kind,body:t.body,negative:r,range:[n,o],raw:e.substring(n,o)}}function c(t,r,n,o){return t.codePoint>r.codePoint&&_("invalid range in character class",t.raw+"-"+r.raw,n,o),{type:"characterClassRange",min:t,max:r,range:[n,o],raw:e.substring(n,o)}}function d(e){return"alternative"===e.type?e.body:[e]}function m(e){H+=e=e||1}function f(e){g(e)||_("character",e)}function g(t){var r=t.length;if(e.substring(H,H+r)===t)return m(r),t}function y(t){if(e[H]===t)return H++,t}function h(){return e[H]}function x(t){return e[H]===t}function b(t){return e[H+1]===t}function E(t){var r=e.substring(H).match(t);return r&&(H+=r[0].length),r}function D(){var t,r=[],n=H;for(r.push(S());y("|");)r.push(S());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function S(){for(var t,r,s=[],u=H;r=function(){if(H>=e.length||x("|")||x(")"))return null;var t,r=function(){switch(h()){case"^":return m(),a("start",1);case"$":return m(),a("end",1);case"\\":if(b("b"))return m(2),a("boundary",2);if(b("B"))return m(2),a("not-boundary",2);break;case"(":return v("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=H;if(t=A()||!1){if(!Y&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;H=s,_("Expected atom")}return r}var u=function(){var t;switch(t=h()){case".":return m(),{type:"dot",range:[H-1,H],raw:"."};case"\\":if(m(),!(t=w())){if(!Y&&"c"==h())return i("symbol",92,H-1,H);_("atomEscape")}return t;case"[":return L();case"(":if(n.lookbehind&&(t=v("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=C("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(H,H+2)||":"==e[H+2])return v("(?:","ignore","(","normal");return o=H,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||_("Invalid flags for modifiers group"):a||_("Invalid flags for modifiers group"),((s=(a=a?a[0]:"")+(r=r?r[0]:"")).length>3||function(e){for(var t=0;t<e.length;){if(-1!=e.indexOf(e[t],t+1))return!0;t++}return!1}(s))&&_("flags cannot be duplicated for modifiers group"),y(":")||_("Invalid flags for modifiers group"),(u=C("ignore",o)).modifierFlags={enabling:a,disabling:r},u;case"]":case"}":if(!Y)return m(),l(t);break;case"^":case"$":case"*":case"+":case"?":case"{":case")":case"|":break;default:return m(),l(t)}}();if(u||(s=H,(t=A()||!1)&&(H=s,_("Expected atom")),!Y&&y("{")?u=l("{"):_("Expected atom")),t=A()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&_("Invalid quantifier","",t.range[0],t.range[1]),t.body=d(u),o(t,u.range[0]),t}return u}();)s.push(r);return 1===s.length?s[0]:{type:"alternative",body:s,range:[u,t=H],raw:e.substring(u,t)}}function v(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return C(o,a)}function C(t,r){var n,o=D();o||_("Expected disjunction"),f(")");var a={type:"group",behavior:t,body:d(o),range:[r,n=H],raw:e.substring(r,n)};return"normal"==t&&K&&z++,a}function A(){var e,t,r,n,o=H;switch(h()){case"*":m(),e=u(0,void 0,void 0,void 0,"*");break;case"+":m(),e=u(1,void 0,void 0,void 0,"+");break;case"?":m(),e=u(0,1,void 0,void 0,"?");break;case"{":(n=E(/^\{(\d+)\}/))?e=u(t=parseInt(n[1],10),t,o,H):(n=E(/^\{(\d+),\}/))?e=u(t=parseInt(n[1],10),void 0,o,H):(n=E(/^\{(\d+),(\d+)\}/))&&((t=parseInt(n[1],10))>(r=parseInt(n[2],10))&&_("numbers out of order in {} quantifier","",o,H),e=u(t,r,o,H)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&_("iterations outside JS safe integer range in quantifier","",o,H)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function T(t,r){if(r){var n,o;if("unicodeEscape"==t.kind&&(n=t.codePoint)>=55296&&n<=56319&&x("\\")&&b("u")){var a=H;H++;var i=w(!0);"unicodeEscape"==i.kind&&(o=i.codePoint)>=56320&&o<=57343?(t.kind="unicodeCodePointEscape",t.codePoint=(n-55296)*1024+o-56320+65536,t.range[1]=H,t.raw=e.substring(t.range[0],H)):H=a}}return t}n||(n={});function w(t){var r,a,i,u,p=H;switch(u=h()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return function(t){var r,n,a=H;if(r=E(/^(?!0)\d+/)){var i,u,p=parseInt(n=r[0],10);if(p<=z&&!t)return u=H-1-(i=n).length,{type:"reference",matchIndex:parseInt(i,10),range:[u,H],raw:e.substring(u,H)};if(V.push(p),K?G=!0:k(a,H),m(-n.length),r=E(/^[0-7]{1,3}/))return s("octal",parseInt(r[0],8),r[0],1);var c=H;return o(r=l(E(/^[89]/)),c-1)}return!!(r=E(/^[0-7]{1,3}/))&&(("0"!==(n=r[0])&&k(a,H),/^0{1,3}$/.test(n))?s("null",0,"0",n.length):s("octal",parseInt(n,8),n,1))}(t);case"B":if(!t)return P();_("\\B not possible inside of CharacterClass","",p);break;case"b":if(t)return m(),s("singleEscape",8,"\\b");return P();case"c":if(t){if(!Y&&(i=E(/^c(\d)/)))return s("controlLetter",i[1]+16,i[1],2);else if(!Y&&g("c_"))return s("controlLetter",31,"_",2)}return j();case"d":case"D":case"w":case"W":case"s":case"S":return m(),{type:"characterClassEscape",value:u,range:[H-2,H],raw:e.substring(H-2,H)};case"k":return function(){if(n.namedGroups&&E(/^k<(?=.*?>)/)){var t,r=B();return f(">"),t=r.range[0]-3,{type:"reference",name:r,range:[t,H],raw:e.substring(t,H)}}}()||P();case"p":case"P":return a=H,!!(n.unicodePropertyEscape&&Y&&(r=E(/^([pP])\{([^}]+)\}/)))&&{type:"unicodePropertyEscape",negative:"P"===r[1],value:r[2],range:[a-1,H],raw:e.substring(a-1,H)}||P();case"-":if(t&&Y)return m(),s("singleEscape",45,"\\-");return P();default:return j()}}function k(e,t){Y&&_("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?T(s("unicodeEscape",parseInt(t[1],16),t[1],2),e):e&&(t=E(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(t[1],16),t[1],4):void 0}function j(){var e,t=H;switch(h()){case"t":return m(),s("singleEscape",9,"\\t");case"n":return m(),s("singleEscape",10,"\\n");case"v":return m(),s("singleEscape",11,"\\v");case"f":return m(),s("singleEscape",12,"\\f");case"r":return m(),s("singleEscape",13,"\\r");case"c":if(e=E(/^c([a-zA-Z])/))return s("controlLetter",e[1].charCodeAt(0)%32,e[1],2);break;case"x":if(e=E(/^x([0-9a-fA-F]{2})/))return s("hexadecimalEscape",parseInt(e[1],16),e[1],2);break;case"u":if(e=I(Y))return(!e||e.codePoint>1114111)&&_("Invalid escape sequence",null,t,H),e}return P()}function F(t){var n=h(),o=H;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||_("Invalid escape sequence",null,o,H),r(a.codePoint)}var i=n.charCodeAt(0);if(i>=55296&&i<=56319){var s=(n+=e[H+1]).charCodeAt(1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536)}if(t(i))return m(),i>65535&&m(),n}function B(){var t,r=H,n=F($);for(n||_("Invalid identifier");t=F(R);)n+=t;return{type:"identifier",value:n,range:[r,H],raw:e.substring(r,H)}}function $(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/.test(r(e))}function R(e){return $(e)||e>=48&&e<=57||e>=128&&/[\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDD40-\uDD49\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE-\uDDD9\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD0\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDED0-\uDEE3\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDD50-\uDD59\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99\uDF60-\uDF67\uDFF0-\uDFF9]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDDE0-\uDDE9\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF50-\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDD70-\uDD79\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDCF0-\uDCF9\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDD40-\uDD49\uDEAE\uDEEC-\uDEF9]|\uD839[\uDCEC-\uDCF9\uDDEE\uDDEF\uDDF1-\uDDFA\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]|\uDB40[\uDD00-\uDDEF]/.test(r(e))}function P(){var t,r=h();return Y&&/[\^$.*+?()\\[\]{}|/]/.test(r)||!Y&&"c"!==r?"k"===r&&n.lookbehind?null:s("identifier",(t=e.substring(H,H+=1)).charCodeAt(0),t,1):null}function L(){var e,t=H;return g("[^")?(e=N(),f("]"),p(e,!0,t,H)):y("[")?(e=N(),f("]"),p(e,!1,t,H)):null}function N(){var e,t;return x("]")?{kind:"union",body:[]}:X?function(){var e,t=[],r=O(!0);for(t.push(r),e="classRange"===r.type?"union":x("&")?"intersection":x("-")?"subtraction":"union";!x("]");)"intersection"===e?(f("&"),f("&"),x("&")&&_("&& cannot be followed by &. Wrap it in brackets: &&[&].")):"subtraction"===e&&(f("-"),f("-")),t.push(r=O("union"===e));return{kind:e,body:t}}():((t=M())||_("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||_("classAtom"),n=H;var r,n,o,a,i,s,u=N();return(u||_("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:Y?_("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||_("classAtom"),(o=x("]")?s:e(s))||_("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||_("nonEmptyClassRanges"),{kind:"union",body:e})}function M(){return y("-")?l("-"):function(){var e;switch(e=h()){case"\\":if(m(),!(e=w(!0))){if(!Y&&"c"==h())return l("\\");_("classEscape")}return T(e,Y);case"]":case"-":break;default:return m(),l(e)}}()}function O(t){var r,n,o=H;if(y("\\"))if(g("q{"))return function(){var t,r=H-3,n=[];do n.push(function(){for(var t,r,n=[],o=H;r=q();)n.push(r);return{type:"classString",characters:n,range:[o,t=H],raw:e.substring(o,t)}}());while(y("|"));return f("}"),{type:"classStrings",strings:n,range:[r,t=H],raw:e.substring(r,t)}}();else if(n=w(!0))r=n;else{if(n=W())return n;_("Invalid escape","\\"+h(),o)}else if(n=U())r=n;else{if(n=L())return n;_("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=q())return c(r,n,o,H);_("Invalid range end",h())}return r}function q(){if(y("\\")){var e,t=H;if(e=W())return e;_("Invalid escape","\\"+h(),t)}return U()}function U(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&_("Invalid set operation in character class"),e=E(/^[^()[\]{}/\-\\|]/))return l(e)}function W(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))_("\\B not possible inside of ClassContents","",H-2);else if(e=E(/^[&\-!#%,:;<=>@`~]/))return s("identifier",e[0].codePointAt(0),e[0]);else if(e=j())return e;else return null}function _(t,r,n,o){n=null==n?H:n,o=null==o?n:o;var a=Math.max(0,n-10),i=Math.min(o+10,e.length),s=" "+e.substring(a,i),l=" "+Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+s+"\n"+l)}var V=[],z=0,K=!0,G=!1,J=-1!==(t||"").indexOf("u"),X=-1!==(t||"").indexOf("v"),Y=J||X,H=0;if(X&&!n.unicodeSet)throw Error('The "v" flag is only supported when the .unicodeSet option is enabled.');if(J&&X)throw Error('The "u" and "v" flags are mutually exclusive.');""===(e=String(e))&&(e="(?:)");var Z=D();return(Z.range[1]!==e.length&&_("Could not parse entire input - got stuck","",Z.range[1]),G=G||V.some(function(e){return e<=z}))?(H=0,K=!1,D()):Z}},ic.exports?ic.exports=n:window.regjsparser=n,ic.exports)}());let im=String.raw`\$&`,ig=new Set(String.raw`\^$.*+?()[]{}|/-`),{parse:iy}=id,ih="method",ix="pattern",ib="split-join",iE=new Set(["i","y"]),iD=new Set(["anchor","reference"]),iS=e=>String.raw`\u{${e.toString(16)}}`;function iv(e){let{kind:t,codePoint:r,raw:n}=e;if("controlLetter"===t)return 13===r?String.raw`\r`:10===r?String.raw`\n`:9===r?String.raw`\t`:iS(r);if("null"===t||"octal"===t)return iS(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function iC(e){return"value"===e.type?iv(e):"characterClass"!==e.type||e.negative||1!==e.body.length||"value"!==e.body[0].type?"quantifier"===e.type&&1===e.min&&1===e.max||"group"===e.type&&"ignore"===e.behavior?iA(e.body):void 0:iv(e.body[0])}function iA(e){let t=[];for(let r of e){let e=iC(r);if(void 0===e)return;t.push(e)}return t.join("")}let iT=e=>{let{pattern:t,flags:r}=e.regex;try{return iy(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},iw=e=>{let t=0;for(let r of e)t+=ik(r);return t};function ik(e){return iD.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?iw(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>ik(e))):"quantifier"===e.type?e.min*iw(e.body):"group"===e.type&&"ignore"===e.behavior?iw(e.body):0}let iI=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>iI(e)),ij=e=>e8(e)&&Number.isSafeInteger(e.value)&&e.value>=0,iF=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(tQ(e.left,t)&&e0(e.right,1)||e0(e.left,1)&&tQ(e.right,t)))return t},iB=e=>e8(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-iB(e.argument):void 0,i$=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,iR="prefer-string-trim-start-end",iP="no-unreadable-iife",iL="suggestion",iN="throw-new-error",iM=/^(?:[A-Z][\da-z]*)*Error$/,iO="escape-uppercase",iq="escape-lowercase",iU=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,iW=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,i_=({node:e,original:t,regex:r=iU,lowercase:n,fix:o})=>{let a=t.replace(r,e=>e[0]+e.slice(1)[n?"toLowerCase":"toUpperCase"]());if(a!==t)return{node:e,messageId:n?iq:iO,fix:t=>o?o(t,a):t.replaceText(e,a)}},iV="prefer-unicode-code-point-escapes",iz="prefer-unicode-code-point-escapes/add-unicode-flag",iK=String.raw`\u{`,iG=/^[\da-f]$/iv,iJ=/^[0-7]$/v,iX=/^[A-Za-z]$/v;function iY(e){return iJ.test(e)}function iH(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function iZ(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function iQ(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!iG.test(e))))return Number.parseInt(n,16)}function i0(e){return e>=55296&&e<=56319}function i1(e){return e>=56320&&e<=57343}function i2(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function i3(e,{isRegex:t=!1,supportsNestedCharacterClasses:r=!1}={}){let n="",o=0,a=!1;for(let i=0;i<e.length;i++){let s=e[i],l=o>0;if(t&&"["===s&&(!l||r)&&!iZ(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!iZ(e,i)){o--,n+=s;continue}if("\\"!==s||!iH(e,i)){n+=s;continue}let u=function(e,t,{isRegex:r,isInCharacterClass:n}){return function(e,t){if("x"!==e[t+1])return;let r=iQ(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:i2(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=iQ(e,t+2,4);if(void 0===o||!n&&(i0(o)||i1(o)))return;let a=t+6;if(r&&i0(o)&&"\\"===e[a]&&iH(e,a)&&"u"===e[a+1]){let t=iQ(e,a+2,4);if(i1(t))return{end:a+6,replacement:i2((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:i2(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&iX.test(r))return{end:t+3,replacement:i2(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!iY(e[t+2])||!iY(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&iY(e[o]);)o++;return{end:o,replacement:i2(Number.parseInt(e.slice(t+1,o),8))}}(e,t))}(e,i,{isRegex:t,isInCharacterClass:l});if(!u){n+=s;continue}n+=u.replacement,i=u.end-1,a=!0}return{fixed:n,hasReplacement:a}}function i8(e,t,r){let{fixed:n,hasReplacement:o}=i3(t);if(o)return{node:e,messageId:iV,fix:t=>r?r(t,n):t.replaceText(e,n)}}function i6(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let i9=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],i5=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],i4="missing-message",i7="message-is-empty-string",se="message-is-not-a-string",st=new Map([["AggregateError",1],["SuppressedError",2]]),sr=e=>"instanceof"===e.value&&"Keyword"===e.type,sn="no-instanceof-builtins",so="switch-to-type-of",sa=new Set(["String","Number","Boolean","BigInt","Symbol"]),si=[...i5,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...rb,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],ss=(e,t)=>function*(r){let{left:n,right:o}=e,a=rp(t,e),i=a.getTokenAfter(n,sr),{sourceCode:s}=t,l=s.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),u=l?'"'===s.getText(l)[0]?"'":'"':"'";yield oR(r,e,t);let p=eH(n,{sourceCode:a});!eQ(n,t)&&n3(n,"typeof")?(yield r.insertTextBeforeRange(p,"typeof ("),yield r.insertTextAfterRange(p,")")):yield r.insertTextBeforeRange(p,"typeof "),yield r.replaceText(i,"===");let c=eH(o,{sourceCode:a});yield r.replaceTextRange(c,u+s.getText(o).toLowerCase()+u)},sl={create:nH(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new Set("strict"===r?[...si,...n]:n);e.on("BinaryExpression",r=>{let{right:n,operator:i}=r;if("instanceof"!==i||"Identifier"!==n.type||o.includes(n.name))return;let s=n.name,l={node:r,messageId:sn};if("Array"===s||"Error"===s&&t){let t="Array"===s?"Array.isArray":"Error.isError";return l.fix=function*(n){let{left:o,right:a}=r,i=rp(e,r),s=i.getTokenAfter(o,sr);yield oR(n,r,e);let l=eH(o,{sourceCode:i});yield n.insertTextBeforeRange(l,t+"("),yield n.insertTextAfterRange(l,")"),yield o_(s,"",n,e,i),yield o_(a,"",n,e,i)},l}return"Function"===s?(l.fix=ss(r,e),l):sa.has(s)?(l.suggest=[{messageId:so,data:{type:s.toLowerCase()},fix:ss(r,e)}],l):a.has(s)?l:void 0})}),meta:{type:"problem",docs:{description:"Disallow `instanceof` with built-in objects",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",properties:{useErrorIsError:{type:"boolean"},strategy:{enum:["loose","strict"]},include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},additionalProperties:!1}],defaultOptions:[{useErrorIsError:!1,strategy:"loose",include:[],exclude:[]}],hasSuggestions:!0,messages:{[sn]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[so]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},su="prefer-type-error",sp=new Set(["isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBigInt","isBoolean","isBuffer","isDate","isElement","isError","isFinite","isFunction","isInteger","isLength","isMap","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isPrototypeOf","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isView","isWeakMap","isWeakSet","isWindow","isXMLDoc"]),sc=new Set(["isNaN","isFinite"]),sd=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&sp.has(e.name)||!1===r&&sc.has(e.name)),sm=(e,t)=>!!sd(e.property,t,!0)||"MemberExpression"===e.object.type&&sm(e.object,t),sf=/^(?:[A-Z][\da-z]*)*Error$/,sg=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,sy=(e,t)=>{switch(e.type){case"Identifier":return sd(e,t,!1);case"MemberExpression":return sm(e,t);case"CallExpression":return sy(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&sy(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?sf.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&sf.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(sg(r)&&e0(n,"undefined")||sg(n)&&e0(r,"undefined"))})(e))return!1;return sy(n,t)||sy(o,t)}case"LogicalExpression":return sy(e.left,t)&&sy(e.right,t);default:return!1}},sh="consistentDestructuring",sx="consistentDestructuringSuggest",sb=new Set(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),sE=e=>{for(;e.parent;)if(e=e.parent,sb.has(e.type))return e},sD=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,sS=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=ei(n.getScope(o.value),o.value);if(e&&ei(r,o.value)===e)return o}},sv=({declaration:e,memberExpressionNode:t,memberScope:r,memberRootIdentifier:n,memberRootVariable:o,memberThisScopeBoundary:a,memberExpressionWrites:i,sourceCode:s})=>{if(!((e,t,r)=>{let[,n]=r.getRange(e.object),[o]=r.getRange(t);return n<o})(e,t,s)||e.rootIdentifierName&&n?.name===e.rootIdentifierName&&o!==e.rootVariable||e.thisScopeBoundary&&a!==e.thisScopeBoundary||((e,t,r,n)=>{if(!e.rootVariable)return!1;let[,o]=n.getRange(e.object),[a]=n.getRange(t);return e.rootVariable.references.some(e=>{if(!e.isWrite())return!1;let[t]=n.getRange(e.identifier);return!(t<o)&&(e.from.variableScope!==r.variableScope||t<=a)})})(e,t,r,s)||(({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:n,sourceCode:o})=>{let[,a]=o.getRange(e.object),[i]=o.getRange(t),s=t.property.name,l=rg(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?ei(r,l):void 0,c="ThisExpression"===l.type?sE(l):void 0;return n.some(e=>e.propertyName===s&&e.rootIdentifierName===u&&e.rootVariable===p&&e.thisScopeBoundary===c&&(e.scope.variableScope!==r.variableScope||e.start>=a&&e.start<=i))})({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:i,sourceCode:s}))return!1;for(var l=r,u=e.scope;l;){if(l===u)return!0;l=l.upper}return!1},sC=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&e1(e.left))&&"Identifier"===t.property.type&&e.left.value===t.property.name&&r.getText(e.right)===r.getText(t.object)||"LogicalExpression"===e.type&&"&&"===e.operator&&(sC(e.left,t,r)||sC(e.right,t,r)),sA=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&sC(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&sC(e.left,r,n);default:return!1}},sT=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),sw=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...i5,...["Collator","DateTimeFormat","DisplayNames","DurationFormat","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"].map(e=>`Intl.${e}`),...["Duration","Instant","PlainDate","PlainDateTime","PlainMonthDay","PlainTime","PlainYearMonth","ZonedDateTime"].map(e=>`Temporal.${e}`),...["Module","Instance","Memory","Table","Global","Tag","Exception","CompileError","LinkError","RuntimeError"].map(e=>`WebAssembly.${e}`),...rb],sk=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],sI="error-date",sj="suggestion-date";function sF(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let sB=new av({objects:["BigInt","Boolean","Number","String","Symbol"],type:av.CONSTRUCT,handle:function(e,t){let{node:r}=e,n=e.path.join("."),o={node:r,messageId:"disallow",data:{name:n}};return"String"!==n&&"Boolean"!==n&&"Number"!==n&&(o.fix=e=>oB(r,t,e)),o}}),s$=new av({objects:sw,type:av.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||ry(r.callee))return;let n=e.path.join(".");if("Object"===n){let{parent:e}=r;if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)&&(e.left===r||e.right===r))return}else if("Date"===n){function*o(e){yield e.replaceText(r,"String(new Date())"),yield oR(e,r,t)}let e={node:r,messageId:sI};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:sj,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>oP(r,t,e)}}}),sR=new av({objects:sk,type:av.CALL,handle:sF}),sP=new av({objects:sk,type:av.CONSTRUCT,handle:sF}),sL="error/array-push",sN="suggestion",sM=e=>tc(e,{property:"classList",computed:!1}),sO=e=>e.arguments.some(e=>"SpreadElement"===e.type),sq=[{description:"Array#push()",test:e=>td(e,{method:"push",optionalCall:!1}),ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>td(e,{method:"unshift",optionalCall:!1}),keepSecondCall:!0,ignore:["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"]},{description:"Element#classList.add()",test:e=>td(e,{method:"add",optionalCall:!1,optionalMember:!1})&&sM(e.callee.object)},{description:"Element#classList.remove()",test:e=>td(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&sM(e.callee.object)},{description:"importScripts()",test:e=>e7(e,{name:"importScripts"})}],sU={create:function(e){let{ignore:t}=e.options[0],{sourceCode:r}=e;e.on("CallExpression",function*(n){for(let{description:o,test:a,ignore:i=[],keepSecondCall:s=!1}of sq){if(!a(n))continue;let l=[...i,...t];if(ty(n.callee,l))continue;let u=function(e){let t=e.parent;return"ChainExpression"===t.type&&e===t.expression&&(t=t.parent),"ExpressionStatement"===t.type?t:void 0}(n);if(!u)continue;let p=ot(u,e);if(p?.type!=="ExpressionStatement")continue;let c=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(p);if(!a(c)||!tQ(c.callee,n.callee))continue;let{shouldKeepSecondCall:d,shouldPrependSourceArguments:m,targetCall:f,sourceCall:g}=function(e,t,r){let n=r&&(!ry(t.callee)||ry(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(c,n,s),y=g.arguments,h=r.getRange(p),x=r.getRange(u),b=d?[h[0],x[0]]:[h[1],x[1]],E=!d&&!ep(r.getLastToken(p))&&ep(r.getLastToken(u)),D=d&&nU(r.getTokenBefore(p),e,r.text.slice(x[0],x[0]+1)),S={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:sL,data:{description:o}},v=function*(t){if(y.length>0){let r=tY(e,g,!m),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=tX(f,e);m?yield t.insertTextAfter(n,f.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,f.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(b,E||D?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,b)&&(function(e,t,r,n){let o=r?[...e.arguments,...t.arguments]:t.arguments;return r&&(sO(e)||sO(t))||r&&o.some(e=>null===ew(e,n.getScope(e)))||o.some(e=>eP(e,n))}(c,n,s,r)?S.suggest=[{messageId:sN,fix:v}]:S.fix=v),yield S}})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{ignore:{type:"array",uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[sL]:"Do not call `{{description}}` multiple times.",[sN]:"Merge with previous one."},languages:["js/js"]}},sW="no-process-exit",s_=e=>e0(e,"node:worker_threads")||e0(e,"worker_threads"),sV="no-single-promise-in-promise-methods/error",sz="no-single-promise-in-promise-methods/unwrap",sK="no-single-promise-in-promise-methods/use-promise-resolve",sG=["all","any","race"],sJ=(e,t)=>{let[r]=e.arguments[0].elements,n=eZ(r,t);return!eQ(r,t)&&["SequenceExpression","YieldExpression","ArrowFunctionExpression","ConditionalExpression","AssignmentExpression","LogicalExpression","BinaryExpression"].includes(r.type)&&(n=`(${n})`),n},sX=(e,t)=>e.getCommentsInside(t).length>0,sY=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",sH="no-static-only-class",sZ=({type:e,value:t})=>"Punctuator"===e&&"="===t,sQ=e=>"PropertyDefinition"===e.type,s0="ignored-elements",s1="property-assignment",s2={create:e=>{let{sourceCode:t}=e,{maximumIgnoredElements:r}=e.options[0];e.on("ArrayPattern",n=>{let{elements:o,parent:a}=n;if(function(e){let t=0,r=0;for(let n of e)null===n?t=Math.max(t,++r):r=0;return t}(o)<=r)return;let i={node:n,messageId:s0},s=o.filter(e=>null!==e);if("VariableDeclarator"===a.type&&a.id===n&&null!==a.init&&1===s.length){let[r]=s;"AssignmentPattern"!==r.type&&(i.fix=function*(i){let s=o.indexOf(r),l="RestElement"===r.type,u=l?r.argument:r;yield i.replaceText(n,t.getText(u));let p=l?`.slice(${s})`:`[${s}]`,c=a.init;!eQ(c,e)&&n1(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield oR(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rf(r)&&r.expression===t||"AssignmentPattern"===r.type&&r.left===t||"RestElement"===r.type&&r.argument===t)return e(r);if("Property"===r.type&&r.value===t&&"ObjectPattern"===r.parent.type)return r.parent;if("ObjectPattern"===r.type||"ArrayPattern"===r.type)return r}}(e)?.type==="ArrayPattern")return{node:e,messageId:s1}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable array destructuring.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{maximumIgnoredElements:{type:"integer",minimum:0,description:"Maximum number of consecutive ignored elements allowed."}}}],defaultOptions:[{maximumIgnoredElements:1}],messages:{[s0]:"Array destructuring may not contain consecutive ignored values.",[s1]:"Do not assign destructured values to object properties."},languages:["js/js"]}},s3="spread-in-list",s8="iterable-to-array",s6="iterable-to-array-in-for-of",s9="iterable-to-array-in-yield-star",s5="spread-in-collection-constructor",s4="spread-in-object-assign",s7="clone-array",le="suggestion/remove-object-assign-spread",lt=["Map","WeakMap","Set","WeakSet"],lr=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],ln=[...lr,"filter","flatMap","map"],lo=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",la={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*li(e,t,r){let{sourceCode:n}=r,[o,a,i]=n.getFirstTokens(t,3);yield e.remove(o),yield e.remove(a);let[s,l]=n.getLastTokens(t,2);yield e.remove(l),eu(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||nj(o,i,r)||eQ(t,r)?yield oR(e,t,r):yield oj(e,u,r)}let ls=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&rK(e.callee.object,t),ll="no-useless-switch-case/error",lu="no-useless-switch-case/suggestion",lp=e=>e.consequent.every(e=>tn(e)),lc=e=>tx(e.test)||e9(e.test),ld=new Set(["CallExpression","MemberExpression"]),lm=new Set(["Identifier","MemberExpression","Super","ThisExpression"]),lf=e=>"MemberExpression"===(e=rg(e)).type?{...e,object:lf(e.object),property:e.computed?lf(e.property):e.property}:e,lg=(e,t)=>tQ(lf(e),lf(t)),ly=e=>lm.has(rg(e).type),lh=e=>!!("ChainExpression"===e.type||ld.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&lh(e)):t.type&&lh(t))),lx="no-useless-undefined",lb="no-useless-undefined/suggestion",lE=new Set(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),lD=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},lS={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},lv={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},lC={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},lA={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},lT=new Set(["<","<=",">",">="]);function lw(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function lk(e,t){return tc(e=rg(e),{property:"length",optional:!1,computed:!1})&&lg(e.object,t)}function lI(e,t){return lk(e=rg(e),t)?"length":"BinaryExpression"===e.type&&"-"===e.operator&&lk(e.left,t)&&1===n0(e.right)?"lengthMinusOne":void 0}function lj(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let lF={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=lD(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:lx,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tx(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=lD(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>o_(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>o_(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>o_(o," {}",t,e),!0);if("VariableDeclarator"===a.type&&a.init===o&&"VariableDeclaration"===a.parent.type&&"const"!==a.parent.kind&&a.parent.declarations.includes(a)){let[,e]=t.getRange(a.id),[,n]=t.getRange(o);return r(o,t=>t.removeRange([e,n]))}if("AssignmentPattern"===a.type&&a.right===o)return r(o,function*(r){let{left:n}=a,[,i]=t.getRange(n),[,s]=t.getRange(o);yield r.removeRange([i,s]),(n.typeAnnotation||rl(e.physicalFilename))&&!n.optional&&tl(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tx(r.consequent);if(n===tx(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tc(e=rg(e),{computed:!0,optional:!1})||lh(e)||eP(e.object,t,{considerGetters:!0})||eP(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rg(e)).type&&"-"===e.operator){let t=n0(e.right);if(Number.isSafeInteger(t)&&t>0)return{node:e.left,offset:t}}return{node:e,offset:0}}(e.property)}}(o,t);if(!a||function(e,t){if(!("BinaryExpression"!==(e=rg(e)).type||!lT.has(e.operator)||lh(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=n0(n),i=n0(o);return Number.isSafeInteger(i)&&lg(n,t.node)?lw(lS,r,i,t.offset):Number.isSafeInteger(a)&&lg(o,t.node)?lw(lv,r,a,t.offset):void 0}(e,t.index)??function(e,t){if(0!==t.index.offset)return;let{operator:r,left:n,right:o}=e,a=lI(o,t.node.object);if(a&&lg(n,t.index.node))return lj(lC,r,a);let i=lI(n,t.node.object);if(i&&lg(o,t.index.node))return lj(lA,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:lx};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:lb,fix(n){let a=t.getText(o),i=nU(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||rl(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tx(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),lE.has(n)||"push"===n||"unshift"===n||"includes"===n||"add"===n||"has"===n||"delete"===n||"set"===n||"createContext"===n||/^set[A-Z]/v.test(n)||"useRef"===n||"ref"===n))&&(!(!t.optional&&"MemberExpression"===t.callee.type&&!t.callee.computed&&"Identifier"===t.callee.property.type&&"bind"===t.callee.property.name)||1===o.length))return{node:a,messageId:lx,fix:t=>ow(t,a,e)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `undefined`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkArguments:{type:"boolean",description:"Whether to check function arguments."},checkArrowFunctionBody:{type:"boolean",description:"Whether to check arrow function bodies."}}}],defaultOptions:[{checkArguments:!0,checkArrowFunctionBody:!0}],messages:{[lx]:"Do not use useless `undefined`.",[lb]:"Use the indexed access directly."},languages:["js/js"]}},lB="numeric-separators-style";function l$(e,{minimumDigits:t,groupLength:r},n){let{length:o}=e;if(o<t)return e;let a=[];if(n)for(let t=0;t<o;t+=r){let n=Math.min(t+r,o);a.push(e.slice(t,n))}else for(let t=o;t>0;t-=r){let n=Math.max(t-r,0);a.unshift(e.slice(n,t))}return a.join("_")}let lR={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},lP={create:e=>{let{onlyIfContainsSeparator:t,binary:r,octal:n,hexadecimal:o,number:a}=e.options[0],i={"0b":{onlyIfContainsSeparator:t,...r},"0o":{onlyIfContainsSeparator:t,...n},"0x":{onlyIfContainsSeparator:t,...o},"":{onlyIfContainsSeparator:t,...a}};e.on("Literal",e=>{let t,r;if(!(e8(e)||e5(e))||e8(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";e5(e)&&(o=n.slice(0,-1),a="n");let s=o.replaceAll("_",""),{prefix:l,data:u}=(t="",r=s,/^0[box]/i.test(s)&&(t=s.slice(0,2),r=s.slice(2)),{prefix:t,data:r}),{onlyIfContainsSeparator:p}=i[l.toLowerCase()];if(p&&!n.includes("_"))return;let c=function(e,{prefix:t,data:r},n){let o=n[t.toLowerCase()];if(t)return t+l$(r,o);let{number:a,mark:i,sign:s,power:l}=function(e){let{number:t,mark:r="",sign:n="",power:o=""}=e.match(/^(?<number>[\d._]*)(?:(?<mark>e)(?<sign>[+-])?(?<power>[\d_]+))?$/i).groups;return{number:t,mark:r,sign:n,power:o}}(e);return function(e,t){let{integer:r,dot:n,fractional:o}=function(e){let t=e.split("."),[r,n=""]=t;return{integer:r,dot:2===t.length?".":"",fractional:n}}(e);return l$(r,t)+n+l$(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+l$(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:lB,fix:t=>t.replaceText(e,c)}})},meta:{type:"suggestion",docs:{description:"Enforce the style of numeric separators by correctly grouping digits.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(Object.keys(lR).map(e=>[e,(({withFraction:e=!1}={})=>({type:"object",additionalProperties:!1,properties:{onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."},minimumDigits:{type:"integer",minimum:0,description:"The minimum number of digits before separators are enforced."},groupLength:{type:"integer",minimum:1,description:"The number of digits in each group."},...e&&{fractionGroupLength:{type:"integer",minimum:1,description:"The number of digits in each group after the decimal point. Defaults to no grouping."}}}}))({withFraction:"number"===e})])),onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."}}}],defaultOptions:[{onlyIfContainsSeparator:!1,binary:lR.binary,octal:lR.octal,hexadecimal:lR.hexadecimal,number:lR.number}],messages:{[lB]:"Invalid group length in numeric value."},languages:["js/js"]}},lL="error-zero-index",lN="error-shift",lM="error-pop",lO="error-at-zero",lq="error-at-minus-one",lU="error-slice-minus-one",lW="error-destructuring-declaration",l_="error-destructuring-assignment",lV="error-variable",lz="suggest-nullish-coalescing-operator",lK="suggest-logical-or-operator",lG=(e,t,r)=>td(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!rK(e.callee.object,t),lJ=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,lX=(e,t)=>td(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&lJ(e.arguments[0])&&lG(e.callee.object,t),lY=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*lH(e,t,r){let{left:n}=lY(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||eL(e,t))return!1;let{left:r}=lY(e),[n]=r.elements,{type:o}="AssignmentPattern"===n.type?n.left:n;return"ObjectExpression"===o||"ObjectPattern"===o})(e,t)&&(yield r.insertTextBefore(e,"("),yield r.insertTextAfter(e,")"))}let lZ=e=>"AssignmentPattern"===lY(e).left.elements[0].type,lQ=(e,t)=>{let r,n,{property:o}=lY(t).right.callee;return lZ(t)?r=[{operator:"??",messageId:lz},{operator:"||",messageId:lK}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=lY(e),[i]=o.elements,s=i.right,l=t.getText(s);return(eL(s,t)||"LogicalExpression"===s.type&&(s.operator===n||"||"===n&&"??"===s.operator||"??"===n&&("||"===s.operator||"&&"===s.operator))||"ConditionalExpression"===s.type||"AssignmentExpression"===s.type||"YieldExpression"===s.type||"SequenceExpression"===s.type)&&(l=`(${l})`),r.insertTextAfter(a,` ${n} ${l}`)})(t,e,r,n),yield lH(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield lH(t,e,r)},{fix:n,suggest:r}},l0=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,l1=e=>{let{left:t,right:r}=lY(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},l2={create:e=>{let{sourceCode:t}=e,{checkFromLast:r}=e.options[0];e.on("MemberExpression",t=>{if(t.computed&&"Literal"===t.property.type&&"0"===t.property.raw&&lG(t.object,e)&&!r2(t))return{node:t.object.callee.property,messageId:lL,fix:r=>[r.replaceText(t.object.callee.property,"find"),oN(r,t,e)]}}),e.on("CallExpression",t=>{if(td(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&lG(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:lN,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...oM(r,t,e)]}}),e.on("VariableDeclarator",r=>{if("ArrayPattern"===r.id.type&&1===r.id.elements.length&&r.id.elements[0]&&"RestElement"!==r.id.elements[0].type&&lG(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:lW,...lQ(t,r)}}),e.on("AssignmentExpression",r=>{if("ArrayPattern"===r.left.type&&1===r.left.elements.length&&r.left.elements[0]&&"RestElement"!==r.left.elements[0].type&&lG(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:l_,...lQ(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&lG(r.init,e,{optionalMember:!1})&&"VariableDeclaration"===r.parent.type&&r.parent.declarations.includes(r)&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)))return;let n=t.getScope(r),o=ei(n,r.id),a=rc(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(l0(e))i.push(e.parent);else{if(!l1(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:lV};return s.every(e=>!lZ(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=n5.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=tG(l,tM(n));yield oU(o,r,e,a),yield function*(e,t){yield e.insertTextBeforeRange(t,""),yield e.insertTextAfterRange(t,"")}(a,t.getRange(t.ast))}for(let t of i)yield oN(a,t,e);for(let e of s)yield lH(e,t,a)}),l}),e.on("CallExpression",t=>{if(td(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&lG(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:lO,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...oM(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(td(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&lG(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:lM,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...oM(r,t,e)]}}),e.on("CallExpression",t=>{if(td(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&lJ(t.arguments[0])&&lG(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:lq,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...oM(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!r2(r)&&lX(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:lU,*fix(o,{abort:a}){if(re(e,[eH(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield oM(o,r.object,e),yield oN(o,r,e)}}}),e.on("CallExpression",r=>{if(!(td(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&lX(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:lU,*fix(o,{abort:a}){if(re(e,[eH(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield oM(o,r.callee.object,e),yield oM(o,r,e)}}}))},meta:{type:"suggestion",docs:{description:"Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkFromLast:{type:"boolean",description:"Whether to also check for patterns that can be replaced with `findLast()`."}}}],defaultOptions:[{checkFromLast:!0}],messages:{[lV]:"Prefer `.find(…)` over `.filter(…)`.",[lL]:"Prefer `.find(…)` over `.filter(…)[0]`.",[lO]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[lN]:"Prefer `.find(…)` over `.filter(…).shift()`.",[lM]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[lq]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[lU]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[lW]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[l_]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[lz]:"Replace `.filter(…)` with `.find(…) ?? …`.",[lK]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},l3="prefer-array-flat-map",l8="prefer-array-flat-map/filter-flat-map",l6="prefer-array-flat-map/filter-flat-map-suggestion",l9=["React.Children","Children"],l5=new Set(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),l4=e=>"ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&!e.params[0].optional&&!e.params[0].typeAnnotation&&"BlockStatement"!==e.body.type,l7="prefer-array-flat",ue={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!td(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&nF(r.params[0],r.body)&&!ui(e.callee.object,t)}},ut={testFunction(e){if(!td(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[t,r]=e.arguments;if(!("ArrowFunctionExpression"===t.type&&!t.async&&2===t.params.length&&to(r)))return!1;let n=t.body,[o,a]=t.params;return td(n,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&nF(o,n.callee.object)&&nF(a,n.arguments[0])||"ArrayExpression"===n.type&&2===n.elements.length&&n.elements.every((e,r)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&nF(t.params[r],e.argument))},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},ur={testFunction:e=>td(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&to(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},un={testFunction(e){if(!(td(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tb(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return to(t)&&("apply"===e.callee.property.name&&"SpreadElement"!==r.type||"call"===e.callee.property.name&&"SpreadElement"===r.type)},getArrayNode(e){let t=e.arguments[1];return"SpreadElement"===t.type?t.argument:t},description:"Array.prototype.concat()"},uo=["_.flatten","lodash.flatten","underscore.flatten"],ua=/^\p{Uppercase_Letter}/u,ui=(e,t)=>{let r,n;return"Identifier"===e.type&&ua.test(e.name)&&(!(r=ro(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=ro(e,t))&&("ObjectExpression"===n.type||"Literal"===n.type||"TemplateLiteral"===n.type||"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"ClassExpression"===n.type||"NewExpression"===n.type&&"Identifier"===n.callee.type&&"Array"!==n.callee.name))},us={create:function(e){let{functions:t}=e.options[0],r=[...t,...uo],n=[ue,ut,ur,un,{testFunction:e=>e7(e,{argumentsLength:1,optional:!1})&&ty(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>tg(e.callee,t)).trim()}()`}];e.on("CallExpression",function*(t){for(let{testFunction:r,description:o,getArrayNode:a,shouldSwitchToArray:i,isOptionalArray:s}of n){if(!r(t,e))continue;let n=a(t),l=s?.(t),u={description:"string"==typeof o?o:o(t)},p={node:t,messageId:l7,data:u},{sourceCode:c}=e;c.getCommentsInside(t).length===c.getCommentsInside(n).length&&(p.fix=function(e,t,r,n,o){return"function"==typeof n&&(n=n(e)),function*(a){let{sourceCode:i}=r,s=eZ(t,r);n?s=`[${s}]`:!eQ(t,i)&&n1(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,nU(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield oR(a,e,r)}}(t,n,e,i,l)),yield p}})},meta:{type:"suggestion",docs:{description:"Prefer `Array#flat()` over legacy techniques to flatten arrays.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{functions:{type:"array",uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[l7]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},ul="some",uu="some-suggestion",up="filter",uc={create:nH(e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||rK(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tx(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&e9(t.parent.right));if(!r&&!(tA(t,e)||tT(t)||function(e,t){if(!rz(e.callee.object,t))return!1;let r=e.parent;if("VariableDeclarator"!==r.type||r.init!==e||"Identifier"!==r.id.type||r.id.typeAnnotation||"VariableDeclaration"!==r.parent.type||"const"!==r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type&&r.parent.parent.declaration===r.parent)return!1;let[n]=t.sourceCode.getDeclaredVariables(r);if(!n||1!==n.identifiers.length||n.identifiers[0]!==r.id)return!1;let o=n.references.filter(e=>!e.init);return 0!==o.length&&o.every(e=>{let{identifier:r}=e;return e.isRead()&&(tA(r,t)||tT(r))})}(t,e)))return;let n=t.callee.property,o=r&&re(e,[eH(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:ul,data:{method:n.name},suggest:o?void 0:[{messageId:uu,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=eH(t,e);yield o.removeRange([i[1],a.getRange(t.parent)[1]]),"!="!==t.parent.operator&&"!=="!==t.parent.operator&&(yield o.insertTextBeforeRange(i,"!"))}}]}}),e.on("BinaryExpression",t=>{let{left:r,right:n,operator:o}=t;if(!(td(r,{methods:["findIndex","findLastIndex"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&(["!==","!=",">","===","=="].includes(o)&&"UnaryExpression"===n.type&&"-"===n.operator&&n.argument&&"Literal"===n.argument.type&&1===n.argument.value||[">=","<"].includes(o)&&e0(n,0)))||rK(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:ul,data:{method:a.name},*fix(n,{abort:i}){let{sourceCode:s}=e,l=s.getTokenAfter(r,e=>"Punctuator"===e.type&&e.value===o),[u]=s.getRange(l),[,p]=s.getRange(t);if(re(e,[u,p]))return i();["===","==","<"].includes(o)&&(yield n.insertTextBefore(t,"!")),yield n.replaceText(a,"some"),yield n.removeRange([u,p])}}}),e.on("BinaryExpression",t=>{if(!((">"===t.operator||"!=="===t.operator)&&"Literal"===t.right.type&&"0"===t.right.raw&&tc(t.left,{property:"length",optional:!1})&&td(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if(rK(n,e)||"Identifier"===n.type&&n.name.startsWith("$"))return;let[o]=r.arguments;if(!o||nk(o))return;let a=r.callee.property;return{node:a,messageId:up,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(re(e,[eH(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield oN(n,s,e),yield n.removeRange([eH(s,e)[1],i.getRange(t)[1]])}}})}),meta:{type:"suggestion",docs:{description:"Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[ul]:"Prefer `.some(…)` over `.{{method}}(…)`.",[uu]:"Replace `.{{method}}(…)` with `.some(…)`.",[up]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},ud=(e,t)=>({node:e,messageId:`error/${e.name}`,suggest:[{messageId:`suggestion/${t}`,fix:r=>r.replaceText(e,t)}]}),um="preferDefaultParameters",uf="preferDefaultParametersSuggest",ug=new Set(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),uy=(e,t)=>{if(!t)return!1;if(ug.has(t.type))return!0;for(let r of e.visitorKeys[t.type]){let n=t[r];if(Array.isArray(n)){for(let t of n)if(uy(e,t))return!0}else if(uy(e,n))return!0}return!1},uh="prefer-logical-operator-over-ternary/error",ux="prefer-logical-operator-over-ternary/optional-chain-error",ub="prefer-logical-operator-over-ternary/suggestion",uE="prefer-logical-operator-over-ternary/optional-chain-suggestion",uD=new Set(["==","==="]),uS=new Set(["!=","!=="]);function uv(e,t,r){if(tQ(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return uv(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&uv(e.left,t.left,r)&&uv(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&uv(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function uC({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:uh}:{node:t,messageId:uh,suggest:o.map(o=>({messageId:ub,data:{operator:o},fix:a=>(function({fixer:e,context:t,conditionalExpression:r,left:n,right:o,operator:a}){let{sourceCode:i}=t,s=[n,o].map((e,r)=>{let n=eQ(e,t),o=n?eZ(e,t):i.getText(e);return!n&&n8(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return nU(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function uA(e){return e9(e)?"null":tx(e)?"undefined":void 0}function uT(e){if("BinaryExpression"!==e.type||!uD.has(e.operator)&&!uS.has(e.operator))return;let t=uA(e.left),r=uA(e.right);if(!!t==!!r)return;let n=uD.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let uw=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,uk="with-name",uI="without-name",uj="regexp-exec",uF="string-match",uB="string-search",u$="suggestion",uR="string",uP="regexp",uL="other",uN="string-or-other",uM="regexp-or-other",uO="unknown";function*uq(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);eL(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!eL(t,a)&&n1(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let uU=[{type:uj,test:e=>td(e,{method:"exec",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.arguments[0],methodNode:e.callee.property,regexpNode:e.callee.object}),*fix(e,{methodNode:t}){yield e.replaceText(t,"test")}},{type:uF,test:e=>td(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:uq},{type:uB,test:e=>td(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:uq}],uW=e=>e6(e)||te(e,{name:"RegExp"}),u_=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},uV=e=>{if(e.includes(uO))return uO;let t=new Set(e),r=t.has(uR)||t.has(uN),n=t.has(uP)||t.has(uM);if(r&&n)return uN;let o=t.has(uL)||t.has(uN)||t.has(uM);return r?o?uN:uR:n?o?uM:uP:uL},uz=e=>{let t=new Set(e);return t.has(uO)?uO:t.has(uP)?uP:t.has(uR)?uR:uL},uK=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),uG=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return uG(e.typeAnnotation);case"TSStringKeyword":return uR;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?uR:uL;case"TSTypeReference":if("Identifier"!==e.typeName.type)return uO;if("String"===e.typeName.name)return uR;if("RegExp"===e.typeName.name)return uP;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return uL;return uO;case"TSUnionType":return uV(e.types.map(e=>uG(e)));case"TSIntersectionType":return uz(e.types.map(e=>uG(e)));default:return uK.has(e?.type)?uL:uO}},uJ=(e,t)=>{let r,n;if(r=e,rE.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),rE.has(n.intrinsicName)))return uO;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?uJ(r,t):uO}return e.isUnion()?uV(e.types.map(e=>uJ(e,t))):e.isIntersection()?uz(e.types.map(e=>uJ(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?uR:"RegExp"===rS(e)?.getName()||rC(e,t).some(e=>uJ(e,t)===uP)?uP:uL},uX=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function uY(e,t,r=new Set){let n;if(uW(e))return uP;if(nv(e,t))return uR;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=ei(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return uO;r.add(o);let[a]=o.defs,i=uG(a.name?.typeAnnotation),s=uO;return i!==uO?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=uY(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==uO)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=uG(e.typeAnnotation);return n===uO?uY(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return uY(e.expression,t,r);case"SequenceExpression":return uY(e.expressions.at(-1),t,r);case"ConditionalExpression":return uV([uY(e.consequent,t,r),uY(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=ew(e,o))?"string"==typeof n.value?uR:u_(n.value)?uP:void 0===n.value&&("Identifier"===e.type&&"undefined"===e.name||"UnaryExpression"===e.type&&"void"===e.operator)||null===n.value||["bigint","boolean","number","symbol"].includes(typeof n.value)?uL:uO:uO;return a!==uO?a:uX.has(e.type)?uL:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return uO;try{let{program:t}=r;return uJ(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return uO}})(e,t)}let uH=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tE(e.parent)||tC(e.parent,t)&&e.parent.arguments[0]===e){e=e.parent;continue}break}return e})(e,t)).parent.type&&"!"===r.parent.operator&&r.parent.argument===r},uZ=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),uQ=(e,t,r)=>[eH(t,r)[1],r.sourceCode.getRange(e.node)[1]],u0=e=>[{messageId:u$,fix:e}],u1=e=>[uP,uM,uL].includes(e),u2=e=>[uR,uN,uL].includes(e),u3=({type:e,stringType:t,regexpType:r})=>e===uj?u2(r)||u1(t):u1(t)||u2(r),u8=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[eH(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([eH(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!uZ(r.sourceCode,e))&&(e.suggest=u0(t));return}if(!o||!uZ(r.sourceCode,uQ(o,a,r))){if((({searchCheck:e,isRegExp:t,staticRegExp:r})=>t||r?.global===!1&&(!e||!1===r.sticky))({searchCheck:o,isRegExp:i,staticRegExp:s})){e.fix=t;return}e.suggest=u0(t)}},u6={create:nH(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tc(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(uH(o,t))return;if(tA(o,t)||tT(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&e0(a.right,0)&&!uH(a,t)&&(tA(a,t)||tT(a)))return{lengthNode:n,node:a,comparisonLeftNode:o}})(t,e),n=(e=>{let{parent:t}=e;if(t?.type!=="BinaryExpression"||t.left!==e)return;let{operator:r,right:n}=t;return["!==","!=",">"].includes(r)&&tm(n)||">="===r&&e0(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tm(n)||"<"===r&&e0(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tA(t,e)||tT(t))for(let{type:o,test:a,getNodes:i,fix:s}of uU){if(o===uB!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=ew(p,c),m=d?u_(d.value):void 0,f=uW(p);if(u3({type:o,stringType:uY(l.stringNode,e),regexpType:uY(p,e)}))continue;let g={node:o===uj?u:t,messageId:o};u8(g,function*(o){for(let a of(r?(yield oN(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([eH(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(uQ(n,t,e))),s(o,l,e)))yield a},e,{lengthCheck:r,searchCheck:n,callExpression:t,isRegExp:f,staticRegExp:m}),yield g}})}),meta:{type:"suggestion",docs:{description:"Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[uj]:"Prefer `.test(…)` over `.exec(…)`.",[uF]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[uB]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[u$]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},u9="error",u5="suggestion",u4=0x100000000-1,u7=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],pe=["slice","concat"],pt=e=>td(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e,pr=new Set(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),pn=(e,t,r=new Set)=>"ArrayExpression"===e.type||tt(e,{name:"Array",optional:!1})||td(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||td(e,{methods:u7,optionalCall:!1,optionalMember:!1})||td(e,{methods:pe,optionalCall:!1,optionalMember:!1})&&void 0===e3(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new Set)=>{if("Identifier"!==e.type)return!1;let n=ei(t,e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs;return"Variable"===o.type&&"const"===o.kind&&!!o.node.init&&pn(o.node.init,t,r)})(e.callee.object,t,r)),po=e=>Number.isSafeInteger(e)&&e>=0&&e<=u4,pa=e=>e.some(e=>e?.type==="SpreadElement"),pi=(e,t,r)=>e.getCommentsInside(t).some(t=>{let n,o;return n=e.getRange(t),o=e.getRange(r),!(n[0]>=o[0])||!(n[1]<=o[1])}),ps=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,pl=e=>{let{parent:t}=e;if(!("MemberExpression"===t.type&&t.object===e&&!t.computed&&!t.optional&&"Identifier"===t.property.type&&"length"===t.property.name)||(e=>{let t,r=e;for(;ps(r.parent,r);)r=r.parent;return r2(r)||("ForInStatement"===(t=r).parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t})(t))return!1;let r=t.parent;return"CallExpression"!==r.type||r.callee!==t},pu=e=>{let t,r;return"ForOfStatement"===e.parent.type&&e.parent.right===e||(e=>{let{parent:t}=e;return"SpreadElement"===t.type&&t.argument===e&&["ArrayExpression","CallExpression","NewExpression"].includes(t.parent.type)})(e)||td(t=e.parent.parent,{method:"forEach",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e&&"ArrowFunctionExpression"===(r=t.arguments[0]).type&&1===r.params.length&&"RestElement"!==r.params[0].type},pp={create:e=>{let{minimumItems:t}=e.options[0],{sourceCode:r}=e;e.on("Identifier",n=>{let o,{parent:a}=n;if(!((e,t)=>{let{parent:r}=e;return"VariableDeclarator"===r.type&&r.id===e&&!!r.init&&"VariableDeclaration"===r.parent.type&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)&&pn(r.init,t.getScope(r.init))})(n,r))return;if(t>0){var i,s;let e=(i=a.init,s=r.getScope(a.init),"ArrayExpression"===i.type?pa(i.elements)?void 0:i.elements.length:tt(i,{name:"Array",optional:!1})?((e,t)=>{if(pa(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=ew(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:po(n)?n:void 0})(i,s):td(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?pa(i.arguments)?void 0:i.arguments.length:td(i,{object:"Array",method:"from",optionalCall:!1,optionalMember:!1})?((e,t)=>{let[r]=e.arguments;if(r&&"SpreadElement"!==r.type){if("ArrayExpression"===r.type)return pa(r.elements)?void 0:r.elements.length;if(void 0!==e3(r)){let e=ew(r,t);return"string"==typeof e?.value?[...e.value].length:void 0}return((e,t)=>{if("ObjectExpression"!==e.type||1!==e.properties.length)return;let[r]=e.properties;if((e=>{if("Property"!==e.type||e.computed)return!1;let{key:t}=e;return"Identifier"===t.type&&"length"===t.name||"Literal"===t.type&&"length"===t.value})(r)){let e=ew(r.value,t);return po(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=ei(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(pt(o)){t.push(o);continue}if(pl(o)){r.push(o),n.push(o);continue}if(pu(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(rc(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!pa(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=ew(t,e.sourceCode.getScope(t)))&&t0(r.value)&&!Object.is(r.value,-0)}))||0!==t3(o.elements,e).length)||1===u.includes.length&&!((e,t)=>{let r=t.parent.parent.parent,{parent:n}=e.parent;for(;n&&n!==r;){if(pr.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:u9,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(pi(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(pi(t,e,e.typeAnnotation.elementType))return;return`ReadonlySet<${t.getText(e.typeAnnotation.elementType)}>`}if("TSTypeReference"!==e.type||"Identifier"!==e.typeName.type)return;let r=e.typeArguments??e.typeParameters;if(r?.params.length===1&&!pi(t,e,r)){if("Array"===e.typeName.name)return`Set${t.getText(r)}`;if("ReadonlyArray"===e.typeName.name)return`ReadonlySet${t.getText(r)}`}})(n.typeAnnotation.typeAnnotation,r),d=function*(e){for(let t of(c&&(yield e.replaceText(n.typeAnnotation.typeAnnotation,c)),yield e.insertTextBefore(n.parent.init,"new Set("),yield e.insertTextAfter(n.parent.init,")"),u.includes))yield e.replaceText(t.parent.property,"has");for(let t of u.lengths)yield e.replaceText(t.parent.property,"size")};return n.typeAnnotation&&!c?p.suggest=[{messageId:u5,fix:d}]:p.fix=d,p})},meta:{type:"suggestion",docs:{description:"Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumItems:{type:"integer",minimum:0,description:"The minimum known array size before `Set#has()` is enforced."}}}],defaultOptions:[{minimumItems:0}],messages:{[u9]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[u5]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},pc=e=>td(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&e7(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1}),pd="prefer-string-raw",pm="unnecessary-string-raw";function pf(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let pg="prefer-switch",py=(e,t)=>e===t||tQ(e,t),ph=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tx(e))),px=new Set(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),pb=e=>{for(;e.parent;e=e.parent)if(px.has(e.type))return e},pE=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},pD={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new Set,o=[],a=new Set;e.on("IfStatement",e=>{n.add(e)}),e.on("BreakStatement",e=>{e.label||o.push(e)}),e.on("Program:exit",function*(){for(let i of n){if(a.has(i))continue;let{discriminant:n,ifStatements:s}=function(e){let t,r=[];for(;e&&"IfStatement"===e.type;e=e.alternate){let{test:n}=e,o=function(e){let t=[e],r=[];for(;t.length>0;){if("LogicalExpression"===(e=t.pop()).type&&"||"===e.operator){t.push(e.right,e.left);continue}if("BinaryExpression"!==e.type||"==="!==e.operator)return[];r.push(e)}return r}(n);if(0===o.length)break;t||=ph(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>py(e,r)||py(e,n))).length)break;return t}(o,t);if(0===a.length)break;t=a,r.push({statement:e,compareExpressions:o})}return{ifStatements:r,discriminant:t&&t[0]}}(i);if(!n||s.length<t.minimumCases)continue;for(let{statement:e}of s)a.add(e);let l={loc:{start:r.getLoc(i).start,end:r.getLoc(i.consequent).start},messageId:pg};!eP(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!pE(n,t,r))continue;let e=pb(n);if(!e||pE(t,e,r))return!0}return!1}(o,t,e))&&(l.fix=function({discriminant:e,ifStatements:t},r,n){let{sourceCode:o}=r,a=o.getText(e);return function*(i){let s=t[0].statement,l=t8(s,r);yield i.insertTextBefore(s,`switch (${a}) {`);let u=t.at(-1).statement;if(u.alternate){let{alternate:e}=u;yield i.insertTextBefore(e,`
1
+ "use strict";let e,t;var r,n,o,a,i,s,l,u=require("eslint-plugin-sukka"),p=require("node:assert/strict"),c=require("node:util/types"),d=require("node:path"),m=require("node:util"),f=require("eslint/use-at-your-own-risk");function g(e,t){if("string"==typeof t){let e=t;t=t=>t.type===e}for(;e;){if(t(e))return e;e=e.parent}}function y(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function h(e){return e?.type==="MemberExpression"}function x(e){return e?.type==="AwaitExpression"}function b(e,t){return!!y(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function E(e,t){return e?.type==="Literal"&&(Array.isArray(t)?t.includes(e.value):"string"==typeof e.value&&t instanceof RegExp?t.test(e.value):e.value===t)}function S(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function D(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function v({create:e,defaultOptions:t,meta:r,name:n}){return r.docs&&!r.docs.url&&(r.docs.url=new URL(n,"https://dimensiondev.github.io/eslint-plugin/src/rules/").href),{create(r){var n,o;let a,i=(n=t,o=r.options,a=structuredClone(n),null==o||a.forEach((e,t)=>{if(void 0!==o[t]){let r=o[t];"object"!=typeof r||Array.isArray(r)||"object"!=typeof e||Array.isArray(e)?a[t]=r:a[t]=function e(t={},r={}){return Object.fromEntries([...new Set([...Object.keys(t),...Object.keys(r)])].map(n=>{let o=n in t,a=n in r,i=t[n],s=r[n];return[n,o&&a?"object"!=typeof i||Array.isArray(i)||"object"!=typeof s||Array.isArray(s)?s:e(i,s):o?i:s]}))}(e,r)}}),a);return e(r,i)},defaultOptions:t,meta:r,name:n}}function C(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var A=v({name:"array/no-unneeded-flat-map",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `Array#flatMap((x) => x)` when simpler alternatives exist",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple `Array#flatMap()` in array"}},defaultOptions:[],create:e=>({CallExpression(t){var r;if("MemberExpression"!==t.callee.type||!b(t.callee.property,"flatMap")||!(S(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(D(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&D(r.params[0],r.body.body[0].argument))))return;let{property:n}=t.callee;e.report({node:t,messageId:"invalid",*fix(e){yield e.replaceText(n,"flat"),yield*t.arguments.map(t=>e.remove(t))}})}})});let T=new Set(["href","pathname","search","hash","origin"]);var w=v({name:"browser/prefer-location-assign",meta:{type:"suggestion",fixable:"code",docs:{description:"Prefer `location.assign(...)` over `location.*`",recommended:"stylistic"},schema:[],messages:{instead:"Use `location.assign(...)` instead of `location.{{name}}`"}},defaultOptions:[],create:e=>({AssignmentExpression(t){let r=function(e,t){if(b(e,t))return e;for(;h(e);){if(b(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=k(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=k(t.parent);if(T.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function k(e){if(h(e)&&y(e.property))return e.property.name}var I=v({name:"jsx/no-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow use template-literal in JSX",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow use template-literal in JSX"}},defaultOptions:[],create:e=>({JSXExpressionContainer(t){if("TemplateLiteral"!==t.expression.type||t.parent?.type==="JSXAttribute")return;let{expression:r}=t;e.report({node:t,messageId:"invalid",fix(n){let o=[...r.expressions,...r.quasis];o.sort((e,t)=>e.range[0]-t.range[0]);let a=o.map(t=>"TemplateElement"===t.type?t.value.cooked:"{"+e.sourceCode.getText(t)+"}");return n.replaceText(t,a.join(""))}})}})}),j=v({name:"jsx/no-unneeded-nested",meta:{type:"suggestion",fixable:"code",docs:{description:"Reduce unneeded JSXFragment nested",recommended:"stylistic"},schema:[],messages:{invalid:"Reduce unneeded JSXFragment nested"}},defaultOptions:[],create(e){let t=e.sourceCode;return{JSXFragment(r){if(1!==r.children.length)return;let n=r.children[0];e.report({node:r,messageId:"invalid",*fix(e){"JSXExpressionContainer"===n.type?"JSXEmptyExpression"!==n.expression.type&&(yield e.replaceText(r,t.getText(n.expression))):yield e.replaceText(r,t.getText(n))}})}}}});let F=/^toLocale(?<name>Upper|Lower)Case$/g;var B=v({name:"string/no-locale-case",meta:{type:"problem",fixable:"code",docs:{description:"Disallow use `String#toLocale{Upper,Lower}Case()`",recommended:"recommended"},schema:[],messages:{instead:"Use `.to{{name}}Case(...)` instead of `.toLocale{{name}}Case()`"}},defaultOptions:[],create:e=>({CallExpression(t){if(t.arguments.length>0||!h(t.callee)||!y(t.callee.property))return;let{property:r}=t.callee,n=F.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),R=v({name:"string/no-simple-template-literal",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow simple template-literal",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow simple template-literal"}},defaultOptions:[],create:e=>({TemplateLiteral(t){var r,n,o,a;let i=(r=e.sourceCode,(o=n=t,o.parent?.type!=="TaggedTemplateExpression"&&1===o.quasis.length&&!function({loc:e}){return!!e&&e.start.line!==e.end.line}(o.quasis[0])&&0===o.expressions.length)?e=>{let t=JSON.stringify(n.quasis[0].value.cooked),o=g(n,e=>"Property"===e.type&&e.key===n);return o?e.replaceText(o,`${t}: ${r.getText(o.value)}`):e.replaceText(n,t)}:2===(a=n).quasis.length&&a.quasis.every(({value:e})=>""===e.cooked)&&1===a.expressions.length?e=>e.replaceText(n,r.getText(n.expressions[0])):void 0);i&&e.report({node:t,messageId:"invalid",fix:i})}})});let P=/\P{ASCII}/u;function L(e,t){return{Program(r){for(let n of r.tokens??[]){let r=function(e){switch(e.type){case"String":case"Template":return e.value.slice(1,-1);case"Identifier":if(e.value.startsWith("#"))return e.value.slice(1);return e.value;case"PrivateIdentifier":case"JSXText":case"JSXIdentifier":return e.value;case"RegularExpression":return e.regex.pattern}return!1}(n);!1!==r&&e.test(r)&&t(n,"code")}for(let n of r.comments??[])e.test(n.value)&&t(n,"comment")}}}function $(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=N(e.value.slice(1,-1),t);return r.replaceText(e,`${n}${a}${o}`)};case"JSXText":return r=>{let n=e.value.replace(t,e=>`&#x${M(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let n=new Set(e.regex.flags);n.add("u");let o=new RegExp(N(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function N(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${M(t)}}`:`\\u${M(t)}`})}function M(e){return e.toString(16).padStart(4,"0").toUpperCase()}v({name:"unicode/specific-set",meta:{type:"problem",fixable:"code",docs:{description:"Limit the range of literal characters"},schema:[{type:"object",properties:{pattern:{type:"string"},flags:{type:"string"},only:{type:"string",enum:["code","comment"]}},additionalProperties:!1}],messages:{illegal:"Illegal character detected"}},defaultOptions:[{pattern:P.source,flags:"u",only:void 0}],create(e,[{pattern:t,flags:r,only:n}]){let o=t?new RegExp(t,r):P;return L(o,(t,r)=>{if(n&&n!==r)return;let a=$(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let O=/[\u061C\u202A-\u202E\u2066-\u2069]/;var U=v({name:"unicode/no-bidi",meta:{type:"problem",fixable:"code",docs:{description:"Detect and stop Trojan Source attacks",recommended:"recommended"},schema:[],messages:{detected:"Detected potential trojan source attack with unicode bidi introduced in this {{kind}}: {{text}}."}},defaultOptions:[],create:e=>L(O,(t,r)=>{let n=RegExp(O.source,"gu"),o={kind:r,text:N(t.value,n)},a=$(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let q=(t=[/\u00AD\u034F\u061C\u17B4\u17B5\uFEFF\uFFFC/,/\u180B-\u180E/,/\u200B-\u200F/,/\u202A-\u202E/,/\u2060-\u206F/,/\uFE00-\uFE0F/,/\uFFF0-\uFFF8/,/\u{1D173}-\u{1D17A}/u,/\u{E0000}-\u{E007F}/u,/\u{E0100}-\u{E01EF}/u].map(e=>"string"==typeof e?e:e.source).join(""),RegExp(`[${t}]`,"u"));var W=v({name:"unicode/no-invisible",meta:{type:"problem",fixable:"code",docs:{description:"Disallow invisible characters",recommended:"recommended"},schema:[],messages:{illegal:"Illegal character detected"}},defaultOptions:[],create:e=>L(q,t=>{let r=$(t,RegExp(q.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),_=v({name:"no-redundant-variable",meta:{type:"problem",fixable:"code",docs:{description:"Disallow redundant variable",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Redundant Variable"}},defaultOptions:[],create:e=>({BlockStatement({body:t}){var r,n,o,a,i;let s=t.find(V);if(!s)return;let l=t[t.indexOf(s)-1];r=l,n=s,r&&"VariableDeclaration"===r.type&&1===r.declarations.length&&r.declarations.some(({init:e,id:t})=>null!==e&&D(n.argument,t))&&e.report({node:s,messageId:"invalid",fix:(o=e.sourceCode,a=l,i=s,e=>{var t;let{init:r,id:n}=a.declarations[0];if(!(r&&n&&i.argument))return null;let s=!x(t=r)||g(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${x(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function V(e){return"ReturnStatement"===e.type&&y(e.argument)}var z=v({name:"no-single-return",meta:{type:"suggestion",docs:{description:"Disallow single-return",recommended:"stylistic"},schema:[],messages:{invalid:"Disallow Single Return"}},defaultOptions:[],create:e=>({BlockStatement({parent:t,body:r}){if(!S(t))return;let n=function(e,t){let r=t.find(K);if(!r)return;let n=t.find(e=>{var t,n;return t=e,n=r,"VariableDeclaration"===t.type&&"const"!==t.kind&&t.declarations.some(({id:e})=>D(n.argument,e))});if(n)return e.sourceCode.getDeclaredVariables(n).find(({references:e})=>e.every(e=>e.isWriteOnly()||e.identifier.parent===r))}(e,r);for(let{identifier:t}of n?.references??[])t.parent&&e.report({node:t.parent,messageId:"invalid"})}})});function K(e){return"ReturnStatement"===e.type&&y(e.argument)}var G=v({name:"prefer-early-return",meta:{type:"problem",fixable:"code",docs:{description:"Prefer early returns over full-body conditional wrapping in function declarations",recommended:"stylistic"},schema:[{type:"object",properties:{maximumStatements:{type:"integer",minimum:0}},additionalProperties:!1}],messages:{prefer:"Prefer an early return to a conditionally-wrapped function body"}},defaultOptions:[{maximumStatements:0}],create:(e,[{maximumStatements:t}])=>({BlockStatement:function({body:r,parent:n}){var o,a;if(!S(n)||!(1===r.length&&function(e,t){if("IfStatement"!==e.type||null!==e.alternate)return!1;let{consequent:r}=e;return"ExpressionStatement"===r.type&&0===t||"BlockStatement"===r.type&&r.body.length>t}(r[0],t)))return;let i=(o=e,a=r[0],function*(e){var t;let r;if("IfStatement"!==a.type)return;let{test:n,consequent:i}=a;yield e.insertTextBefore(n,"!("),yield e.insertTextAfter(n,")"),yield e.replaceText(i,"return;");let s=(t=o.sourceCode.getText(i),r=t,"BlockStatement"===i.type?r.slice(1,-1):r);yield e.insertTextAfter(a,s)});e.report({node:r[0],messageId:"prefer",fix:i})}})}),J=v({name:"prefer-fetch",meta:{type:"problem",docs:{description:"Enforce fetch",recommended:"stylistic"},schema:[],messages:{callee:"Should use 'fetch' instead"}},defaultOptions:[],create:e=>({ImportDeclaration(t){let r=t.source.value;("axios"===r||"request"===r)&&e.report({node:t,messageId:"callee"})},NewExpression(t){var r;((function({callee:e}){return b(e,"XMLHttpRequest")})(t)||b((r=t).callee,"ActiveXObject")&&E(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return b(e,t)||h(e)&&b(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return b(e,r)&&h(t)&&b(t.property,"load")||h(e)&&b(e.object,r)&&b(e.property,["ajax","get","post","getJSON","getScript"])}(t)||X(t,"axios")||X(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function X(e,t){return b(e.callee,"require")&&E(e.arguments[0],t)}let H=new Set(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var Y=v({name:"prefer-timer-id",meta:{type:"problem",docs:{description:"Enforce best practice with timer function",recommended:"recommended"},schema:[],messages:{assign:"Timer id should assign to an identifier or member for cleaning up, `const timer = {{name}}(...);`",fix:"Assign timer id to a variable"},hasSuggestions:!0},defaultOptions:[],create:e=>({CallExpression(t){"Identifier"!==t.callee.type||!H.has(t.callee.name)||function(e){if(!b(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||E(t,0)}(t)||t.parent?.type==="AssignmentExpression"&&t.parent.right===t||t.parent?.type==="VariableDeclarator"&&t.parent.init===t||e.report({node:t,messageId:"assign",data:{name:t.callee.name},suggest:[{messageId:"fix",fix:e=>e.insertTextBefore(t,"const timer = ")}]})}})}),Q=v({name:"string/no-unneeded-to-string",meta:{type:"suggestion",fixable:"code",docs:{description:"Disallow `String#toString()` when simpler alternatives exist",recommended:"stylistic",requiresTypeChecking:!0},schema:[],messages:{invalid:"Disallow use `.toString()` in string"}},defaultOptions:[],create(e){C(e.sourceCode.parserServices);let{program:t,esTreeNodeToTSNodeMap:r}=e.sourceCode.parserServices,n=t.getTypeChecker();return{CallExpression(t){if("MemberExpression"!==t.callee.type)return;let{object:o,property:a}=t.callee;(b(a,"toString")||E(a,"toString"))&&function(e,t){let r=e.getTypeAtLocation(t);if(r.isStringLiteral()||"string"===e.typeToString(r))return!0;let n=r.getSymbol();return n&&"String"===e.symbolToString(n)}(n,r.get(o))&&e.report({node:a,messageId:"invalid",fix:r=>r.replaceText(t,e.sourceCode.getText(o))})}}}}),Z=v({name:"type/no-force-cast-via-top-type",meta:{type:"problem",docs:{description:"Disallowing cast a type `T` to unrelated or incompatible type `Q` via `T as any as Q`",recommended:"recommended"},schema:[],messages:{invalid:"Don't cast this expression to another type by `as {{type}} as T`"}},defaultOptions:[],create:e=>({TSAsExpression(t){var r,n;if("TSAnyKeyword"!==(r=t.typeAnnotation).type&&"TSUnknownKeyword"!==r.type||!((n=t.parent)&&"TSAsExpression"===n.type&&"TSTypeReference"===n.typeAnnotation.type))return;let o="TSAnyKeyword"===t.typeAnnotation.type?"any":"unknown";e.report({node:t,messageId:"invalid",data:{type:o}})}})});let ee=new Set(["BigInt","Boolean","Number","String","Symbol"]);var et=v({name:"type/no-wrapper-type-reference",meta:{type:"problem",fixable:"code",docs:{description:"Disallow wrapper type for type reference",recommended:"recommended"},schema:[],messages:{instead:"Use {{name}} instead"}},defaultOptions:[],create:e=>({TSTypeReference(t){if("Identifier"!==t.typeName.type||!ee.has(t.typeName.name))return;let r=t.typeName.name.toLowerCase();e.report({node:t,messageId:"instead",data:{name:r},fix:e=>e.replaceText(t.typeName,r)})}})}),er=v({name:"no-default-error",meta:{type:"problem",docs:{description:"Restrict the usage of default (unextended) error",recommended:"strict",requiresTypeChecking:!0},schema:[],messages:{invalid:"Default error object should not be used in this project"}},defaultOptions:[],create(e){C(e.sourceCode.parserServices);let{esTreeNodeToTSNodeMap:t,program:r}=e.sourceCode.parserServices,n=r.getTypeChecker();function o(r){"ErrorConstructor"===function(e,t){let r=e.getTypeAtLocation(t).getSymbol();if(!r?.valueDeclaration)return;let n=e.getTypeOfSymbolAtLocation(r,r.valueDeclaration);return e.typeToString(n)}(n,t.get(r))&&e.report({node:r,messageId:"invalid"})}return{ThrowStatement(e){e.argument&&o(e.argument)},NewExpression:o,CallExpression:o}}});let en={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"]};for(let e of Object.keys(en))Object.freeze(en[e]);Object.freeze(en);let eo=new Set(["parent","leadingComments","trailingComments"]);function ea(e){return!eo.has(e)&&"_"!==e[0]}function ei(e,t){let r="",n=e;for("string"==typeof t?r=t:(r=t.name,n=function(e,t){let r=t.range[0],n=e,o=!1;do for(let e of(o=!1,n.childScopes)){let t=e.block.range;if(t[0]<=r&&r<t[1]){n=e,o=!0;break}}while(o);return n}(n,t));null!=n;){let e=n.set.get(r);if(null!=e)return e;n=n.upper}return null}function es(e,t){return"Punctuator"===e.type&&e.value===t}function el(e){return es(e,"=>")}function eu(e){return es(e,",")}function ep(e){return es(e,";")}function ec(e){return es(e,":")}function ed(e){return es(e,"(")}function em(e){return es(e,")")}function ef(e){return es(e,"{")}function eg(e){return["Block","Line","Shebang"].includes(e.type)}let ey=e=>!ep(e);function eh(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,el);n=r.loc.start,o=r.loc.end}else{var a,i;n=r&&("Property"===r.type||"MethodDefinition"===r.type||"PropertyDefinition"===r.type)?r.loc.start:e.loc.start,o=(a=e,i=t,a.id?i.getTokenAfter(a.id,ed):i.getFirstToken(a,ed)).loc.start}return{start:{...n},end:{...o}}}let ex="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eb=Object.freeze(new Set(["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"])),eE=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,"function"==typeof BigInt?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=>"random"!==e).map(e=>Math[e]).filter(e=>"function"==typeof e),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=>"function"==typeof e)),eS=new Set([Object.freeze,Object.preventExtensions,Object.seal]),eD=[[Map,new Set(["size"])],[RegExp,new Set(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new Set(["size"])]];function ev(e,t){let r=[];for(let n=0;n<e.length;++n){let o=e[n];if(null==o)r.length=n+1;else if("SpreadElement"===o.type){let e=eA(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eA(o,t);if(null==e)return null;r.push(e.value)}}return r}let eC=Object.freeze({ArrayExpression(e,t){let r=ev(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eA(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eA(e.left,t),n=eA(e.right,t);if(null!=r&&null!=n)switch(e.operator){case"==":return{value:r.value==n.value};case"!=":return{value:r.value!=n.value};case"===":return{value:r.value===n.value};case"!==":return{value:r.value!==n.value};case"<":return{value:r.value<n.value};case"<=":return{value:r.value<=n.value};case">":return{value:r.value>n.value};case">=":return{value:r.value>=n.value};case"<<":return{value:r.value<<n.value};case">>":return{value:r.value>>n.value};case">>>":return{value:r.value>>>n.value};case"+":return{value:r.value+n.value};case"-":return{value:r.value-n.value};case"*":return{value:r.value*n.value};case"/":return{value:r.value/n.value};case"%":return{value:r.value%n.value};case"**":return{value:r.value**n.value};case"|":return{value:r.value|n.value};case"^":return{value:r.value^n.value};case"&":return{value:r.value&n.value}}return null},CallExpression(e,t){let r=e.callee,n=ev(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eA(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=eT(r,t);if(null!=a){let e=o.value,t=a.value;if(eE.has(e[t]))return{value:e[t](...n)};if(eS.has(e[t]))return{value:n[0]}}}}else{let o=eA(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eE.has(t))return{value:t(...n)};if(eS.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eA(e.test,t);return null!=r?r.value?eA(e.consequent,t):eA(e.alternate,t):null},ExpressionStatement:(e,t)=>eA(e.expression,t),Identifier(e,t){if(null!=t){let r=ei(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eb.has(r.name)&&r.name in ex)return{value:ex[r.name]};if(function(e){let t,r,n;if(1!==e.defs.length)return!1;let o=e.defs[0];return!!(o.parent&&"Variable"===o.type&&("const"===o.parent.kind||(r=(t=e.references).filter(e=>e.init).length,n=t.filter(e=>e.isReadOnly()).length,1===r&&n+r===t.length)))}(r)){let e=r.defs[0];if("Identifier"===e.node.id.type){let n=eA(e.node.init,t);return n&&"object"==typeof n.value&&null!==n.value&&function(e,t){for(let r of e.references){let e=r.identifier;for(;e&&e.parent&&"MemberExpression"===e.parent.type;)e=e.parent;if(e&&e.parent&&("AssignmentExpression"===e.parent.type&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"CallExpression"===e.parent.type&&e.parent.callee===e&&"MemberExpression"===e.type&&function(e){if(null==e||null==e.value)return!1;let t=e.value;return"copyWithin"===t||"fill"===t||"pop"===t||"push"===t||"reverse"===t||"shift"===t||"sort"===t||"splice"===t||"unshift"===t}(eT(e,t))))return!0}return!1}(r,t)?null:n}}}}return null},Literal:e=>(null!=e.regex||null!=e.bigint)&&null==e.value?null:{value:e.value},LogicalExpression(e,t){let r=eA(e.left,t);if(null!=r){if("||"===e.operator&&!0==!!r.value||"&&"===e.operator&&!1==!!r.value||"??"===e.operator&&null!=r.value)return r;let n=eA(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eA(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=eT(e,t);if(null!=n){let e;if(null==(e=function(e,t){let r=e;for(;("object"==typeof r||"function"==typeof r)&&null!==r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}return null}(r.value,n.value))||null==e.get)return{value:r.value[n.value]};for(let[e,t]of eD)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eA(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eA(e.callee,t),n=ev(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eE.has(e))return{value:new e(...n)}}return null},ObjectExpression(e,t){let r={};for(let n of e.properties)if("Property"===n.type){if("init"!==n.kind)return null;let e=eT(n,t),o=eA(n.value,t);if(null==e||null==o)return null;r[e.value]=o.value}else{if("SpreadElement"!==n.type&&"ExperimentalSpreadProperty"!==n.type)return null;let e=eA(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eA(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eA(e.tag,t),n=ev(e.quasi.expressions,t);if(null!=r&&null!=n){let t=r.value,o=e.quasi.quasis.map(e=>e.value.cooked);if(o.raw=e.quasi.quasis.map(e=>e.value.raw),t===String.raw)return{value:t(o,...n)}}return null},TemplateLiteral(e,t){let r=ev(e.expressions,t);if(null!=r){let t=e.quasis[0].value.cooked;for(let n=0;n<r.length;++n)t+=r[n],t+=e.quasis[n+1].value.cooked;return{value:t}}return null},UnaryExpression(e,t){if("delete"===e.operator)return null;if("void"===e.operator)return{value:void 0};let r=eA(e.argument,t);if(null!=r)switch(e.operator){case"-":return{value:-r.value};case"+":return{value:+r.value};case"!":return{value:!r.value};case"~":return{value:~r.value};case"typeof":return{value:typeof r.value}}return null},TSAsExpression:(e,t)=>eA(e.expression,t),TSSatisfiesExpression:(e,t)=>eA(e.expression,t),TSTypeAssertion:(e,t)=>eA(e.expression,t),TSNonNullExpression:(e,t)=>eA(e.expression,t),TSInstantiationExpression:(e,t)=>eA(e.expression,t)});function eA(e,t){return null!=e&&Object.hasOwnProperty.call(eC,e.type)?eC[e.type](e,t):null}function eT(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eA(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function ew(e,t=null){try{return eA(e,t)}catch(e){return null}}function ek(e,t=null){if(e&&"Literal"===e.type&&null===e.value){if(e.regex)return`/${e.regex.pattern}/${e.regex.flags}`;if(e.bigint)return e.bigint}let r=ew(e,t);if(r)try{return String(r.value)}catch{}return null}function eI(e,t){switch(e.type){case"MemberExpression":if(e.computed)return ek(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return ek(e.key,t);if("Literal"===e.key.type)return String(e.key.value);if("PrivateIdentifier"===e.key.type)break;return e.key.name}return null}function ej(e,t){let r=e.parent;if(!r)return"";let n=[],o="Property"===r.type&&r.value===e,a="MethodDefinition"===r.type&&r.value===e,i="PropertyDefinition"===r.type&&r.value===e;if((a||i)&&(r.static&&n.push("static"),"PrivateIdentifier"===r.key.type&&n.push("private")),e.async&&n.push("async"),e.generator&&n.push("generator"),o||a){if("constructor"===r.kind)return"constructor";"get"===r.kind?n.push("getter"):"set"===r.kind?n.push("setter"):n.push("method")}else i?n.push("method"):("ArrowFunctionExpression"===e.type&&n.push("arrow"),n.push("function"));if(o||a||i)if("PrivateIdentifier"===r.key.type)n.push(`#${r.key.name}`);else{let e=eI(r);if(e)n.push(`'${e}'`);else if(t){let e=t.getText(r.key);e.includes("\n")||n.push(`[${e}]`)}}else e.id?n.push(`'${e.id.name}'`):"VariableDeclarator"===r.type&&r.id&&"Identifier"===r.id.type?n.push(`'${r.id.name}'`):("AssignmentExpression"===r.type||"AssignmentPattern"===r.type)&&r.left&&"Identifier"===r.left.type?n.push(`'${r.left.name}'`):"ExportDefaultDeclaration"===r.type&&r.declaration===e&&n.push("'default'");return n.join(" ")}let eF=Object.freeze(new Set(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eB=Object.freeze(new Set(["-","+","!","~"]));function eR(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eP=Object.freeze(Object.assign(Object.create(null),{$visit(e,t,r){let{type:n}=e;return"function"==typeof this[n]?this[n](e,t,r):this.$visitChildren(e,t,r)},$visitChildren(e,t,r){let{type:n}=e;for(let o of r[n]||Object.keys(e).filter(ea)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eR(e)&&this.$visit(e,t,r))return!0}else if(eR(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eF.has(e.operator))&&("Literal"!==e.left.type||"Literal"!==e.right.type)||this.$visitChildren(e,t,r)},CallExpression:()=>!0,FunctionExpression:()=>!1,ImportExpression:()=>!0,MemberExpression(e,t,r){return!!t.considerGetters||!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.property.type||this.$visitChildren(e,t,r)},MethodDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},NewExpression:()=>!0,Property(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},PropertyDefinition(e,t,r){return!!t.considerImplicitTypeConversion&&!!e.computed&&"Literal"!==e.key.type||this.$visitChildren(e,t,r)},UnaryExpression(e,t,r){return!!("delete"===e.operator||t.considerImplicitTypeConversion&&eB.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function eL(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eP.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||en)}function e$(e,t,r){let n,o,a,i,s;if("number"==typeof e){if(n=0|e,o=t,a=r,!(n>=1))throw TypeError("'times' should be a positive integer.")}else n=1,o=e,a=t;if(null==o||null==o.parent||"CatchClause"===o.parent.type&&o.parent.param===o)return!1;i=s=o;do i=a.getTokenBefore(i),s=a.getTokenAfter(s);while(null!=i&&null!=s&&ed(i)&&em(s)&&i!==function(e,t){let r=e.parent;if(!r)return null;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.getTokenAfter(r.typeArguments||r.typeParameters||r.callee,ed);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,ed);return null;case"IfStatement":case"WhileStatement":if(r.test===e)return t.getFirstToken(r,1);return null;case"ImportExpression":if(r.source===e)return t.getFirstToken(r,1);return null;case"SwitchStatement":if(r.discriminant===e)return t.getFirstToken(r,1);return null;case"WithStatement":if(r.object===e)return t.getFirstToken(r,1);return null;default:return null}}(o,a)&&--n>0);return 0===n}let eN=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,eM=Function.call.bind(Object.hasOwnProperty),eO=Symbol("read"),eU=Symbol("call"),eq=Symbol("construct"),eW=Symbol("esm"),e_={require:{[eU]:!0}};function eV(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class ez{constructor(e,t={}){let{mode:r="strict",globalObjectNames:n=["global","globalThis","self","window"]}=t;this.variableStack=[],this.globalScope=e,this.mode=r,this.globalObjectNames=n.slice(0)}*iterateGlobalReferences(e){for(let t of Object.keys(e)){let r=e[t],n=[t],o=this.globalScope.set.get(t);eV(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);eV(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(e_)){let r=ek(t.arguments[0]);if(null==r||!eM(e,r))continue;let n=e[r],o=[r];n[eO]&&(yield{node:t,path:o,type:eO,info:n[eO]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eN.test(t.type)||null==t.source)continue;let r=t.source.value;if(!eM(e,r))continue;let n=e[r],o=[r];if(n[eO]&&(yield{node:t,path:o,type:eO,info:n[eO]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[eO]&&(yield{node:t,path:o.concat(e),type:eO,info:r[eO]})}else for(let e of t.specifiers){let t=eM(n,eW),r=this._iterateImportReferences(e,o,t?n:"legacy"===this.mode?{default:n,...n}:{default:n});if(t)yield*r;else for(let e of r)e.path=e.path.filter(eK),(e.path.length>=2||e.type!==eO)&&(yield e)}}}*iteratePropertyReferences(e,t){yield*this._iteratePropertyReferences(e,[],t)}*_iterateVariableReferences(e,t,r,n){if(!this.variableStack.includes(e)){this.variableStack.push(e);try{for(let o of e.references){if(!o.isRead())continue;let e=o.identifier;n&&r[eO]&&(yield{node:e,path:t,type:eO,info:r[eO]}),yield*this._iteratePropertyReferences(e,t,r)}}finally{this.variableStack.pop()}}}*_iteratePropertyReferences(e,t,r){let n=e;for(;function(e){let t=e.parent;if(t)switch(t.type){case"ConditionalExpression":return t.consequent===e||t.alternate===e;case"LogicalExpression":case"ChainExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":return!0;case"SequenceExpression":return t.expressions[t.expressions.length-1]===e}return!1}(n);)n=n.parent;let o=n.parent;if(o){if("MemberExpression"===o.type){if(o.object===n){let e=eI(o);if(null==e||!eM(r,e))return;t=t.concat(e);let n=r[e];n[eO]&&(yield{node:o,path:t,type:eO,info:n[eO]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[eU]&&(yield{node:o,path:t,type:eU,info:r[eU]});return}if("NewExpression"===o.type){o.callee===n&&r[eq]&&(yield{node:o,path:t,type:eq,info:r[eq]});return}if("AssignmentExpression"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r),yield*this._iteratePropertyReferences(o,t,r));return}if("AssignmentPattern"===o.type){o.right===n&&(yield*this._iterateLhsReferences(o.left,t,r));return}"VariableDeclarator"===o.type&&o.init===n&&(yield*this._iterateLhsReferences(o.id,t,r))}}*_iterateLhsReferences(e,t,r){if("Identifier"===e.type){let n=ei(this.globalScope,e);null!=n&&(yield*this._iterateVariableReferences(n,t,r,!1));return}if("ObjectPattern"===e.type){for(let n of e.properties){let e=eI(n);if(null==e||!eM(r,e))continue;let o=t.concat(e),a=r[e];a[eO]&&(yield{node:n,path:o,type:eO,info:a[eO]}),yield*this._iterateLhsReferences(n.value,o,a)}return}"AssignmentPattern"===e.type&&(yield*this._iterateLhsReferences(e.left,t,r))}*_iterateImportReferences(e,t,r){let n=e.type;if("ImportSpecifier"===n||"ImportDefaultSpecifier"===n){let o="ImportDefaultSpecifier"===n?"default":"Identifier"===e.imported.type?e.imported.name:e.imported.value;if(!eM(r,o))return;t=t.concat(o);let a=r[o];a[eO]&&(yield{node:e,path:t,type:eO,info:a[eO]}),yield*this._iterateVariableReferences(ei(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(ei(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!eM(r,n))return;t=t.concat(n);let o=r[n];o[eO]&&(yield{node:e,path:t,type:eO,info:o[eO]})}}}function eK(e,t){return 1!==t||"default"!==e}ez.READ=eO,ez.CALL=eU,ez.CONSTRUCT=eq,ez.ESM=eW;let eG=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*eJ(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=eG,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!ed(n))return;let o=r.sourceCode.getTokenAfter(t);if(n&&em(o))return[n,o]}(n,t);){let[o]=n;if(r===eG&&(r=function(e,t){let{parent:r}=e;switch(r.type){case"CallExpression":case"NewExpression":if(1===r.arguments.length&&r.arguments[0]===e)return t.sourceCode.getTokenAfter(r.typeArguments??r.callee,ed);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,ed);return;case"IfStatement":case"WhileStatement":if(r.test===e)return t.sourceCode.getFirstToken(r,1);return;case"ImportExpression":if(r.source===e)return t.sourceCode.getFirstToken(r,1);return;case"SwitchStatement":if(r.discriminant===e)return t.sourceCode.getFirstToken(r,1);return;case"WithStatement":if(r.object===e)return t.sourceCode.getFirstToken(r,1)}}(e,t)),o===r)break;yield n}}let eX=new WeakMap;function eH(e,t){if(!e||!eX.has(e)){let r=[];for(let[n,o]of eJ(e,t))r.unshift(n),r.push(o);eX.set(e,r)}return eX.get(e)}function eY(e,t){let r=eH(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function eQ(e,t){let[r,n]=eY(e,t);return t.sourceCode.text.slice(r,n)}function eZ(e,t){if(eX.has(e))return eX.get(e).length>0;let r=eJ(e,t).next().done;return r&&eX.set(e,[]),!r}function e0(e,t){return e?.type==="Literal"&&e.value===t}let e1=e=>e?.type==="Literal"&&"string"==typeof e.value,e2=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),e3=e=>e1(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,e8=e=>"Literal"===e.type&&"number"==typeof e.value,e6=e=>"Literal"===e.type&&!!e.regex,e9=e=>e?.type==="Literal"&&"null"===e.raw,e5=e=>"Literal"===e.type&&!!e.bigint;function e4(e,t,r){if(!r.includes(e?.type))return!1;"string"==typeof t&&(t={names:[t]}),Array.isArray(t)&&(t={names:t});let{name:n,names:o,argumentsLength:a,minimumArguments:i,maximumArguments:s,allowSpreadElement:l,optional:u}={minimumArguments:0,maximumArguments:1/0,allowSpreadElement:!1,...t};if(n&&(o=[n]),!0===u&&e.optional!==u||!1===u&&e.optional||"number"==typeof a&&e.arguments.length!==a||0!==i&&e.arguments.length<i||Number.isFinite(s)&&e.arguments.length>s)return!1;if(!l){let t=Number.isFinite(s)?s:a;if("number"==typeof t&&e.arguments.some((e,r)=>"SpreadElement"===e.type&&r<t))return!1}return!Array.isArray(o)||!(o.length>0)||"Identifier"===e.callee.type&&!!o.includes(e.callee.name)}let e7=(e,t)=>e4(e,t,["CallExpression"]),te=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return e4(e,t,["NewExpression"])},tt=(e,t)=>e4(e,t,["CallExpression","NewExpression"]),tr=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tn(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tn(e,t)):"EmptyStatement"===r||!!t?.(e)}let to=e=>"ArrayExpression"===e.type&&0===e.elements.length,ta=e=>"ObjectExpression"===e.type&&0===e.properties.length;function ti(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let ts=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tl(e){return ts.includes(e.type)}let tu=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tp(e){return tu.includes(e.type)}function tc(e,t){if(e?.type!=="MemberExpression")return!1;"string"==typeof t&&(t={properties:[t]}),Array.isArray(t)&&(t={properties:t});let{property:r,properties:n,object:o,objects:a,optional:i,computed:s}={property:"",properties:[],object:"",...t};if(r&&(n=[r]),o&&(a=[o]),!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(Array.isArray(n)&&n.length>0){if("Identifier"!==e.property.type||!n.includes(e.property.name))return!1;s??=!1}return!(!0===s&&e.computed!==s||!1===s&&e.computed||Array.isArray(a)&&a.length>0&&("Identifier"!==e.object.type||!a.includes(e.object.name)))}function td(e,t){"string"==typeof t&&(t={methods:[t]}),Array.isArray(t)&&(t={methods:t});let{optionalCall:r,optionalMember:n,method:o,methods:a}={method:"",methods:[],...t};return e7(e,{argumentsLength:t.argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:r})&&tc(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:o,properties:a,optional:n})}function tm(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&e8(e.argument)&&1===e.argument.value}function tf(e,t=[]){if("Identifier"!==e.type)return!1;let r=Array.isArray(t)?t:[t];return(!(r.length>0)||!!r.includes(e.name))&&!function(e){let{parent:t}=e;switch(t.type){case"MemberExpression":return!t.computed&&t.property===e;case"FunctionDeclaration":case"FunctionExpression":return t.params.includes(e)||t.id===e;case"ArrowFunctionExpression":return t.params.includes(e);case"ClassDeclaration":case"ClassExpression":case"VariableDeclarator":case"TSDeclareFunction":case"TSEnumMember":case"TSTypeAliasDeclaration":return t.id===e;case"PropertyDefinition":case"MethodDefinition":return!t.computed&&t.key===e;case"Property":return!t.computed&&t.key===e&&("ObjectExpression"===t.parent.type||"ObjectPattern"===t.parent.type)&&t.parent.properties.includes(t)||t.value===e&&"ObjectPattern"===t.parent.type&&t.parent.properties.includes(t);case"ArrayPattern":return t.elements.includes(e);case"LabeledStatement":case"ContinueStatement":case"BreakStatement":return t.label===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return t.local===e;case"ExportAllDeclaration":return t.exported===e;case"ImportSpecifier":return t.local===e||t.imported===e;case"ExportSpecifier":return t.local===e||t.exported===e;case"TSIndexSignature":return t.parameters.includes(e);case"TSTypeParameter":return t.name===e;case"TSMappedType":case"TSPropertySignature":return t.key===e}return!1}(e)}let tg=e=>e7(e,{name:"require",argumentsLength:1,optional:!1})&&e1(e.arguments[0]);function ty(e,t){let r=t.trim().split(".");for(let t=r.length-1;t>=0;t--){let n=r[t];if(!n)return!1;if(0===t)return"Identifier"===e.type&&e.name===n||"this"===n&&"ThisExpression"===e.type||"super"===n&&"Super"===e.type;if(1===t&&"MetaProperty"===e.type&&"Identifier"===e.property.type&&e.property.name===n){e=e.meta;continue}if("MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.property.type&&e.property.name===n){e=e.object;continue}return!1}}function th(e,t){return t.some(t=>ty(e,t))}function tx(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||th(e.parent.tag,t))}function tb(e){return e?.type==="Identifier"&&"undefined"===e.name}let tE=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tc(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tc(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&to(a)||"Object"===r&&ta(a)})(e,{...t,object:"Array"}),tS=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tD=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tv=e=>tD(e.parent)&&e.parent.argument===e,tC=(e,t)=>tA(e.parent,t)&&e.parent.arguments[0]===e,tA=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&"Boolean"===e.callee.name&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type&&((e,t)=>{let{sourceCode:r}=t;if(r.isGlobalReference(e))return!0;let n=ei(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tT(e,t){return!!(tD(e)||tv(e)||tA(e,t)||tC(e,t))||!!tS(e.parent)&&tT(e.parent,t)}function tw(e){let t;return t=e.parent,!!(t?.type==="VExpressionContainer"&&"VAttribute"===t.parent.type&&t.parent.directive&&t.parent.value===t&&"VDirectiveKey"===t.parent.key.type&&"VIdentifier"===t.parent.key.name.type&&["if","else-if","show"].includes(t.parent.key.name.rawName)||["IfStatement","ConditionalExpression","WhileStatement","DoWhileStatement","ForStatement"].includes(e.parent.type)&&e.parent.test===e)||!!tS(e.parent)&&tw(e.parent)}function tk(e,{test:t,expected:r,ruleId:n}){if(t?.(e)||(r=(r=Array.isArray(r)?r:[r]).map(e=>"string"==typeof e?{value:e}:e),!t&&r.some(t=>Object.entries(t).every(([t,r])=>e[t]===r))))return;let o=`'${JSON.stringify({value:e.value,type:e.type})}'`;r=r.map(e=>`'${JSON.stringify(e)}'`).join(" or ");let a=`\`${n}\`: Unexpected token ${o}`,i=`https://github.com/sindresorhus/eslint-plugin-unicorn/issues/new?title=${encodeURIComponent(a)}`;throw Error(`Expected token ${r}, got ${o}.
2
+ Please open an issue at ${i}.`)}function tI(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tl(e))return!1;for(let r of t[e.type]??[]){let n=e[r];for(let e of Array.isArray(n)?n:[n])if(e?.type&&tI(e,t))return!0}return!1}function tj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tF=tj(function(){if(n)return r;n=1;let e={},t=e.hasOwnProperty,o=(e,r)=>{for(let n in e)t.call(e,n)&&r(n,e[n])},a=e=>"\\u"+("0000"+e).slice(-4),i=(e,t)=>{let r=e.toString(16);return t?r:r.toUpperCase()},s=e.toString,l=Array.isArray,u={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},p=/[\\\b\f\n\r\t]/,c=/[0-9]/,d=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,m=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,f=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,g=(e,t)=>{let r,n,y=()=>{v=D,++t.indentLevel,D=t.indent.repeat(t.indentLevel)},h={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:" ",indentLevel:0,__inline1__:!1,__inline2__:!1},x=t&&t.json;x&&(h.quotes="double",h.wrap=!0),"single"!=(!(R=t)||o(R,(e,t)=>{h[e]=t}),t=h).quotes&&"double"!=t.quotes&&"backtick"!=t.quotes&&(t.quotes="single");let b="double"==t.quotes?'"':"backtick"==t.quotes?"`":"'",E=t.compact,S=t.lowercaseHex,D=t.indent.repeat(t.indentLevel),v="",C=t.__inline1__,A=t.__inline2__,T=E?"":"\n",w=!0,k="binary"==t.numbers,I="octal"==t.numbers,j="decimal"==t.numbers,F="hexadecimal"==t.numbers;if(x&&e&&"function"==typeof e.toJSON&&(e=e.toJSON()),"string"!=typeof(n=e)&&"[object String]"!=s.call(n)){let n,a,i,u;if(n=e,"[object Map]"==s.call(n))return 0==e.size?"new Map()":(E||(t.__inline1__=!0,t.__inline2__=!1),"new Map("+g(Array.from(e),t)+")");if(a=e,"[object Set]"==s.call(a))return 0==e.size?"new Set()":"new Set("+g(Array.from(e),t)+")";if(i=e,"function"==typeof Buffer&&Buffer.isBuffer(i))return 0==e.length?"Buffer.from([])":"Buffer.from("+g(Array.from(e),t)+")";if(l(e)){r=[],t.wrap=!0,C&&(t.__inline1__=!1,t.__inline2__=!0),A||y();var B,R,P=e;let n=P.length,o=-1;for(;++o<n;){B=P[o],w=!1,A&&(t.__inline2__=!1),r.push((E||A?"":D)+g(B,t))}return w?"[]":A?"["+r.join(", ")+"]":"["+T+r.join(","+T)+T+(E?"":v)+"]"}if("number"==typeof(u=e)||"[object Number]"==s.call(u)||"bigint"==typeof e){let t;if(x)return JSON.stringify(Number(e));if(j)t=String(e);else if(F){let r=e.toString(16);S||(r=r.toUpperCase()),t="0x"+r}else k?t="0b"+e.toString(2):I&&(t="0o"+e.toString(8));return"bigint"==typeof e?t+"n":t}{let n;if("bigint"==typeof e)return x?JSON.stringify(Number(e)):e+"n";return(n=e,"[object Object]"==s.call(n))?(r=[],t.wrap=!0,y(),o(e,(e,n)=>{w=!1,r.push((E?"":D)+g(e,t)+":"+(E?"":" ")+g(n,t))}),w)?"{}":"{"+T+r.join(","+T)+T+(E?"":v)+"}":x?JSON.stringify(e)||"null":String(e)}}let L=t.escapeEverything?m:f;return r=e.replace(L,(e,r,n,o,s,l)=>{if(r){if(t.minimal)return r;let e=r.charCodeAt(0),n=r.charCodeAt(1);return t.es6?"\\u{"+i((e-55296)*1024+n-56320+65536,S)+"}":a(i(e,S))+a(i(n,S))}if(n)return a(i(n.charCodeAt(0),S));if("\0"==e&&!x&&!c.test(l.charAt(s+1)))return"\\0";if(o)return o==b||t.escapeEverything?"\\"+o:o;if(p.test(e))return u[e];if(t.minimal&&!d.test(e))return e;let m=i(e.charCodeAt(0),S);return x||m.length>2?a(m):"\\x"+("00"+m).slice(-2)}),"`"==b&&(r=r.replace(/\$\{/g,"\\${")),t.isScriptContext&&(r=r.replace(/<\/(script|style)/gi,"<\\/$1").replace(/<!--/g,x?"\\u003C!--":"\\x3C!--")),t.wrap&&(r=b+r+b),r};return g.version="3.0.2",r=g}());function tB(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return tF(e,{quotes:'"'===t?"double":"single",wrap:!0,es6:!0,minimal:!0,lowercaseHex:!1})}var tR={},tP={},tL={},t$=function(){var e,t;return i?tR:(i=1,Object.defineProperty(tR,"__esModule",{value:!0}),Object.defineProperty(tR,"isIdentifierChar",{enumerable:!0,get:function(){return e.isIdentifierChar}}),Object.defineProperty(tR,"isIdentifierName",{enumerable:!0,get:function(){return e.isIdentifierName}}),Object.defineProperty(tR,"isIdentifierStart",{enumerable:!0,get:function(){return e.isIdentifierStart}}),Object.defineProperty(tR,"isKeyword",{enumerable:!0,get:function(){return t.isKeyword}}),Object.defineProperty(tR,"isReservedWord",{enumerable:!0,get:function(){return t.isReservedWord}}),Object.defineProperty(tR,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return t.isStrictBindOnlyReservedWord}}),Object.defineProperty(tR,"isStrictBindReservedWord",{enumerable:!0,get:function(){return t.isStrictBindReservedWord}}),Object.defineProperty(tR,"isStrictReservedWord",{enumerable:!0,get:function(){return t.isStrictReservedWord}}),e=function(){if(o)return tP;o=1,Object.defineProperty(tP,"__esModule",{value:!0}),tP.isIdentifierChar=u,tP.isIdentifierName=function(e){let t=!0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if((64512&n)==55296&&r+1<e.length){let t=e.charCodeAt(++r);(64512&t)==56320&&(n=65536+((1023&n)<<10)+(1023&t))}if(t){if(t=!1,!l(n))return!1}else if(!u(n))return!1}return!t},tP.isIdentifierStart=l;let e="\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",t="\xb7̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",r=RegExp("["+e+"]"),n=RegExp("["+e+t+"]");e=t=null;let a=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],i=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function s(e,t){let r=65536;for(let n=0,o=t.length;n<o&&!((r+=t[n])>e);n+=2)if((r+=t[n+1])>=e)return!0;return!1}function l(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&r.test(String.fromCharCode(e)):s(e,a)))}function u(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&n.test(String.fromCharCode(e)):s(e,a)||s(e,i))))}return tP}(),t=function(){if(a)return tL;a=1,Object.defineProperty(tL,"__esModule",{value:!0}),tL.isKeyword=function(t){return e.has(t)},tL.isReservedWord=n,tL.isStrictBindOnlyReservedWord=i,tL.isStrictBindReservedWord=function(e,t){return o(e,t)||i(e)},tL.isStrictReservedWord=o;let e=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"]),t=new Set(["implements","interface","let","package","private","protected","public","static","yield"]),r=new Set(["eval","arguments"]);function n(e,t){return t&&"await"===e||"enum"===e}function o(e,r){return n(e,r)||t.has(e)}function i(e){return r.has(e)}return tL}(),tR)}(),tN=tj(t$);function tM(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}let tO=e=>[e,...e.childScopes.flatMap(e=>tO(e))],tU=e=>[...new Set(tO(e).flatMap(({references:e})=>e))],{isIdentifierName:tq,isStrictReservedWord:tW,isKeyword:t_}=tN,tV=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","as","implements","interface","let","package","private","protected","public","static","yield","any","boolean","constructor","declare","get","module","require","number","set","string","symbol","type","from","of"]),tz=e=>"string"==typeof e&&!t_(e)&&!tW(e,!0)&&tq(e)&&"arguments"!==e&&!tV.has(e),tK=(e,t)=>t.every(t=>!(tM(e,t)||tU(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),tG=()=>!0;function tJ(e,t,r=tG){if(tz(e)||tz(e+="_")){for(;!tK(e,t)||!r(e,t);)e+="_";return e}}function tX(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return ed(n)&&em(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function tH(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,ed),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:eu(a)?a:void 0}}function tY(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=tH(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function tQ(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return tQ(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=ew(t);if(!r)return;return String(r.value)}}function tZ(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?tZ(e.expression):e}function t0(e,t){if(e=tZ(e),t=tZ(t),e.type!==t.type)return!1;switch(e.type){case"Super":case"ThisExpression":return!0;case"Identifier":case"PrivateIdentifier":return e.name===t.name;case"Literal":var r,n;return r=e,n=t,r.regex||n.regex?!!(r.regex&&n.regex&&r.regex.pattern===n.regex.pattern&&r.regex.flags===n.regex.flags):r.bigint||n.bigint?r.bigint===n.bigint:r.value===n.value;case"MemberExpression":{let r=tQ(e);if(void 0!==r)return t0(e.object,t.object)&&r===tQ(t);return e.computed===t.computed&&t0(e.object,t.object)&&t0(e.property,t.property)}default:return!1}}let t1=e=>null===e||"object"!=typeof e&&"function"!=typeof e,t2=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=ew(e,r.getScope(e));if(n&&t1(n.value))return{value:n.value}},t3=(e,t,r)=>{let n=t2(e,r),o=t2(t,r);if(n&&o){let e,t;return(e=n.value)===(t=o.value)||"number"==typeof e&&"number"==typeof t&&Number.isNaN(e)&&Number.isNaN(t)}return!!e&&!!t&&"Literal"!==e.type&&"Literal"!==t.type&&t0(e,t)},t8=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>t3(e,o,t))&&n.push(o),r.push(o));return n};function t6(e,t){let{sourceCode:r}=t,{start:{line:n,column:o}}=r.getLoc(e);return r.getLines()[n-1].slice(0,o).match(/\s*$/)[0]}function t9(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let t5=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),t4=([e,t],[r,n])=>e>=r&&t<=n;function t7(e,t,r=[]){let{sourceCode:n}=e,o=t5(e,t),a=r.map(t=>t5(e,t));return t9(e).some(e=>{let t=n.getRange(e);return t4(t,o)&&a.every(e=>!t4(t,e))})}function re(e,t){let{sourceCode:r}=e,n=r.getLoc(t).end.line;return r.getCommentsAfter(t).findLast(e=>r.getLoc(e).start.line===n)}let rt=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},rr=new Set(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rn=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||rr.has(e.type),ro=e=>rn(e)||"BlockStatement"===e.type&&e.body.some(e=>rn(e));function ra(e,t){if("Identifier"!==e.type)return;let r=ei(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&"const"===n.parent.kind)return n.node.init}function ri(e,t){let{sourceCode:r}=t,[,n]=eY(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let rs=new Set(["depth","height","width"]);function rl(e){return tc(e,{properties:["length","size"],optional:!1})}function ru(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let rp=["Program","StyleSheet","Document","root"];function rc(e,t){let{sourceCode:r}=e;return r.parserServices.getTemplateBodyTokenStore&&r.ast.templateBody&&r.getRange(r.ast.templateBody)[0]<=r.getRange(t)[0]&&r.getRange(t)[1]<=r.getRange(r.ast.templateBody)[1]?r.parserServices.getTemplateBodyTokenStore():r}let rd=({identifiers:e,references:t})=>[...new Set([...e,...t.map(({identifier:e})=>e)])];function rm(e,t){if(!e)return!1;if("ThisExpression"===e.type||"Super"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){for(let e of n)if(rm(e,t))return!0}else if(rm(n,t))return!0}return!1}let rf=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rg=e=>rf.has(e?.type);function ry(e){for(;rg(e);)e=e.expression;return e}function rh(e){let t;return(e=ry(e),e?.type==="ChainExpression")?rh(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?rh(e.object):rh(e.callee))))}let rx=(e,t)=>{let{references:r=[]}=ei(e,t)||{};return r};function rb(e,t){if(t.block!==e)throw Error('"functionScope" should be the scope of "functionNode".');let{type:r,id:n}=e;return"ArrowFunctionExpression"!==r&&(!!(t.thisFound||rx(t,"arguments").some(({from:e})=>e===t))||!!(n&&rx(t,n).length>0))}let rE=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],rS=new Set(["any","error","unknown"]),rD=new Set(["null","undefined"]),rv=e=>e.getSymbol()??e.aliasSymbol,rC=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function rA(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let rT="target",rw="non-target",rk="nullish",rI="unknown",rj=new Set(["ClassDeclaration","ClassExpression"]),rF=new Set(["FunctionDeclaration","FunctionExpression"]),rB=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),rR=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),rP=new Set(["TSNullKeyword","TSUndefinedKeyword"]),rL=e=>e===rk?rw:e,r$=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==rk):e.map(rL)).length?rw:(t.treatMixedUnionAsTarget?e.includes(rT):e.every(e=>e===rT))?rT:(t.treatMixedUnionAsNonTarget?e.includes(rw):e.every(e=>e===rw))?rw:rI,rN=e=>(e=e.map(rL)).includes(rT)?rT:e.every(e=>e===rw)?rw:rI,rM=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>rB.has(e.type));if(r)return r;t=t.upper}},rO=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=rO(e.left);return t?`${t}.${e.right.name}`:void 0}},rU=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?rT:t.nonTargetTypeNames?.has(e)?rw:rI},rq=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?rT:rw:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||rU(o,r)!==rI||rU(a,r)!==rI?rw:rI};function rW(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return rW(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?rW(e.typeAnnotation,t,r,n):rI;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=rO(t.typeName);if(!s)return rI;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return rI;let n=e.typeName.right.name,o=rM(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?rI:rq({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==rI)return l;if(!n.preferTypeReferenceDefinitions){let e=rU(s,n);if(e!==rI)return e}if(o.has(s))return rI;o.add(s);let u=rM(s,r);if(!u)return o.delete(s),rU(s,n);let p=rI,c=((e,t)=>{if("ImportBinding"!==e.type)return rI;if("ImportDefaultSpecifier"===e.node.type)return rU(e.node.local.name,t)===rI?rI:rw;let r=e.node.imported?.name??e.node.imported?.value;return r?rq({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):rI})(u,n);return c!==rI?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=rW(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=rW(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?rw:rN(a.extends.map(t=>rO(t.expression)?e({typeName:t.expression},r,n,o):rI))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?rI:rV(i.superClass,r,n,o):rw),o.delete(s),p}(e,t,r,n);case"TSUnionType":return r$(e.types.map(e=>rW(e,t,r,n)),r);case"TSIntersectionType":return rN(e.types.map(e=>rW(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return rT;if(rP.has(e?.type))return rk;return rR.has(e?.type)?rw:rI}}let r_=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?rV(e.superClass,t,r,n):rw;function rV(e,t,r,n=new Set){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return rU(o,r);if(n.has(o))return rI;n.add(o);let a=((e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}})(o,t),[i]=a?.defs??[],s=rI;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=rV(i.node.init,t,r,n):i?.type==="ClassName"&&(s=r_(i.node,t,r,n)),n.delete(o),i?s:rU(o,r)}return rj.has(e.type)?r_(e,t,r,n):rI}let rz=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return rW(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function rK(e,t,r,n=new Set){if(!e)return rI;if("TSSatisfiesExpression"===e.type)return rK(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=rW(e.typeAnnotation,o,r);if(a!==rI)return a;let i=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=ei(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return rI;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=rW(a.name?.typeAnnotation,i,r),l=rI;return s!==rI?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=rK(a.node.init,t,r,n)),n.delete(o),l})(e,t,r,n);case"ThisExpression":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if(rj.has(n.type))return r_(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return rw;if(rF.has(n.type)){let e=rz(n,t,r);if(e!==rI)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return rw;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return rw;continue}break}}return rI})(e,t,r):rI;case"Super":return r.checkClassSyntax?((e,t,r)=>{for(let{parent:n}=e;n;n=n.parent){if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static||"MethodDefinition"===n.type&&n.static)return rw;if(rj.has(n.type))return n.superClass?rV(n.superClass,t.sourceCode.getScope(n),r):rw}return rI})(e,t,r):rI;case"NewExpression":let a,i;return r.checkClassSyntax?(a=e.callee,rV(a,t.sourceCode.getScope(a),r,i)):rI;case"TSAsExpression":case"TSTypeAssertion":{let a=rW(e.typeAnnotation,o,r);return a===rI?rK(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return rK(e.expression,t,r,n);case"SequenceExpression":return rK(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return r$([rK(e.consequent,t,r,n),rK(e.alternate,t,r,n)],r);default:return rI}})(e,t,r,n);if(i!==rI)return i;if("Identifier"!==e.type){let t,n=(t=ew(e,o))?r.getStaticType?.(t.value,e)??rI:rI;if(n!==rI)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>te(e,{name:t}))||r.targetCallNames?.some(t=>e7(e,{name:t})))return rT;let s=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return rI;try{let{program:t}=n;return function e(t,r,n,o){if(rS.has(t.intrinsicName))return rI;if(rD.has(t.intrinsicName))return rk;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):rI}if(t.isUnion())return r$(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return rN(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return rT;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&rA(t,r).some(t=>e(t,r,n,o)===rT))return rT;if(t.intrinsicName)return rw;let i=rv(t);if(!i)return rI;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?rT:rw}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return rI}})(e,t,r);return s!==rI?s:r.isNonTargetNode?.(e,t)?rw:rI}let rG=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>rL(rK(t,r,{...e,...n})),isTarget:(t,r,n)=>rK(t,r,{...e,...n})===rT,isKnownNonTarget:(t,r,n)=>rL(rK(t,r,{...e,...n}))===rw}),rJ=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>rG({...n,targetTypeNames:new Set([e]),typeReferenceAliases:new Map(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),rX=new Set(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),rH=new Set([...rE,"Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),{isTarget:rY,isKnownNonTarget:rQ}=rG({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new Set(["Array","ReadonlyArray"]),nonTargetTypeNames:rH,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||td(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||rX.has(e.type),isTargetTypeAnnotation:e=>e?.type==="TSArrayType"||e?.type==="TSTupleType",isTargetType:(e,t)=>t.isArrayType(e)||t.isTupleType(e),getStaticType:(e,t)=>Array.isArray(e)?rT:"Identifier"===t.type||"MemberExpression"===t.type?rI:rw}),rZ=new Set(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function r0(e,t){return!rZ.has(e.type)&&rQ(e,t)}let r1=new Set(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),r2=new Set(["AnimationEvent","AnimationPlaybackEvent","AudioProcessingEvent","BeforeUnloadEvent","BlobEvent","ClipboardEvent","CloseEvent","CommandEvent","CompositionEvent","ContentVisibilityAutoStateChangeEvent","CookieChangeEvent","CustomEvent","DeviceMotionEvent","DeviceOrientationEvent","DragEvent","ErrorEvent","Event","ExtendableCookieChangeEvent","ExtendableEvent","ExtendableMessageEvent","FetchEvent","FocusEvent","FontFaceSetLoadEvent","FormDataEvent","GPUUncapturedErrorEvent","GamepadEvent","HashChangeEvent","IDBVersionChangeEvent","InputEvent","KeyboardEvent","MIDIConnectionEvent","MIDIMessageEvent","MediaEncryptedEvent","MediaKeyMessageEvent","MediaQueryListEvent","MediaStreamTrackEvent","MessageEvent","MouseEvent","NavigateEvent","NavigationCurrentEntryChangeEvent","NotificationEvent","OfflineAudioCompletionEvent","PageRevealEvent","PageSwapEvent","PageTransitionEvent","PaymentMethodChangeEvent","PaymentRequestUpdateEvent","PictureInPictureEvent","PointerEvent","PopStateEvent","ProgressEvent","PromiseRejectionEvent","PushEvent","PushSubscriptionChangeEvent","RTCDataChannelEvent","RTCDTMFToneChangeEvent","RTCErrorEvent","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCTrackEvent","RTCTransformEvent","SecurityPolicyViolationEvent","SpeechRecognitionErrorEvent","SpeechRecognitionEvent","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","StorageEvent","SubmitEvent","TaskPriorityChangeEvent","TextEvent","ToggleEvent","TouchEvent","TrackEvent","TransitionEvent","UIEvent","WebGLContextEvent","WheelEvent",...r1]),{isTarget:r3,isKnownNonTarget:r8}=rG({preferTypeReferenceDefinitions:!0,targetTypeImports:new Map([["react",r1]]),targetTypeNamespaceImports:new Map([["react",r1]]),targetTypeNames:r2}),{isTarget:r6}=rJ({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?rT:rI}),{isTarget:r9}=rJ({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?rT:rI}),r5=new Set(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),r4=new Set(["KeyboardEvent","React.KeyboardEvent"]),r7=new Set(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:ne}=rG({targetTypeNames:r5,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?rT:rI}}),{isKnownNonTarget:nt}=rG({targetTypeNames:r4,nonTargetTypeNames:r7}),nr=e=>("AssignmentExpression"===e.parent.type||"AssignmentPattern"===e.parent.type)&&e.parent.left===e||"UpdateExpression"===e.parent.type&&e.parent.argument===e||"ArrayPattern"===e.parent.type&&e.parent.elements.includes(e)||"RestElement"===e.parent.type&&e.parent.argument===e||"Property"===e.parent.type&&e.parent.value===e&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)||"UnaryExpression"===e.parent.type&&"delete"===e.parent.operator&&e.parent.argument===e,nn=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,no=(e,t,r)=>"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.object.type&&e.object.name===t&&"Identifier"===e.property.type&&r.has(e.property.name),na=new Set(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),ni=new Set(["abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"]),ns=new Set(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),nl=new Set(["parseFloat","parseInt"]),nu=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&e8(e.literal),np=new Set(["-","*","/","%","**","<<",">>","|","^","&"]);function nc(e,t){let r;if(e8(e)||no(e,"Math",na)||"CallExpression"===e.type&&!e.optional&&no(e.callee,"Math",ni)||nn(e,"Number")||no(e,"Number",ns)||"CallExpression"===e.type&&!e.optional&&no(e.callee,"Number",nl)||nn(e,"parseInt")||nn(e,"parseFloat")||"MemberExpression"===e.type&&!e.computed&&!e.optional&&"Identifier"===e.property.type&&"length"===e.property.name)return!0;switch(e.type){case"AssignmentExpression":{let{operator:r}=e;if("="===r&&nc(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&nc(e.left,t)&&nc(e.right,t)||">>>"===r||np.has(r)&&(nc(e.left,t)||nc(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&nc(e.argument,t))return!0;break}case"UpdateExpression":if(nc(e.argument,t))return!0;break;case"ConditionalExpression":{let r=nc(e.consequent,t),n=nc(e.alternate,t);if(r&&n)return!0;let o=ew(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(nc(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=ei(t,e))&&r.defs.some(e=>nu(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(nu(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(nc(e.expression,t))return!0}return"number"==typeof ew(e,t)?.value}rG({targetTypeNames:new Set,targetCallNames:["Number"],isTargetTypeAnnotation:nu,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?rT:rI});let nd=new Set([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),nm=new Set(["boolean","true","false"]),nf=new Set(["isFinite","isNaN"]),ng=new Map([["Array",new Set(["isArray"])],["ArrayBuffer",new Set(["isView"])],["Atomics",new Set(["isLockFree"])],["Number",new Set(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new Set(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new Set(["deleteProperty","has"])],["URL",new Set(["canParse"])]]),ny=new Map([["array",new Set(["every","includes","some"])],["map",new Set(["has"])],["regexp",new Set(["test"])],["set",new Set(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new Set(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new Set(["has"])]]),nh=new Map([["regexp",new Set(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function nx(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{return function e(t,r){if(!t)return!1;if(t.isUnion?.())return t.types.every(t=>e(t,r));let n=r.getBaseConstraintOfType(t);return n&&n!==t?e(n,r):nm.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function nb(e){if(e?.type==="Identifier")return e.name}function nE(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nE(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return function(e,t,r,n){let o=nb(e.typeName);if(!o||n.has(o))return!1;n.add(o);let a=tM(o,r),[i]=a?.defs??[],s=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&nE(i.node.typeAnnotation,t,r,n);return n.delete(o),s}(e,t,r,n);case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>nE(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function nS(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nS(e.typeAnnotation,t,r,n);case"TSFunctionType":return nE(e.returnType,t,r,n);case"TSTypeReference":return function(e,t,r,n){let o=nb(e.typeName);if(!o||n.has(o))return!1;n.add(o);let a=tM(o,r),[i]=a?.defs??[],s=i?.type==="Type"&&("TSTypeAliasDeclaration"===i.node.type&&nS(i.node.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===i.node.type&&i.node.body.body.filter(e=>"TSCallSignatureDeclaration"===e.type).every(e=>nE(e.returnType,t,r,n))&&i.node.body.body.some(e=>"TSCallSignatureDeclaration"===e.type));return n.delete(o),s}(e,t,r,n);case"TSUnionType":return e.types.every(e=>nS(e,t,r,n));default:return!1}}function nD(e,t,r=new Set){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!nE(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?nA(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&nA(e.body,t,r))}function nv(e,t,r=new Set){if(e?.type!=="Identifier")return!1;let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n))return!1;r.add(n);let o=!1;if(n.defs.length>1&&n.defs.every(e=>"FunctionName"===e.type)){let e=n.defs.filter(e=>"TSDeclareFunction"===e.node.type),a=e.length>0?e:n.defs;o=n.references.every(e=>!e.writeExpr)&&a.every(e=>nD(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(nS(e.name?.typeAnnotation,t,a))o=!0;else{let a;"FunctionName"===e.type?n.references.every(e=>!e.writeExpr)&&(a=e.node):"Variable"===e.type&&"const"===e.parent.kind&&["ArrowFunctionExpression","FunctionExpression"].includes(e.node.init?.type)&&(a=e.node.init),o=!!a&&nD(a,t,r)}}return r.delete(n),o}function nC(e,t,r=new Set){switch(e?.type){case"ArrayExpression":return"array";case"Literal":return"string"==typeof e.value?"string":e.regex?"regexp":void 0;case"TemplateLiteral":return 0===e.expressions.length?"string":void 0;case"NewExpression":if("Identifier"===e.callee.type&&t.sourceCode.isGlobalReference(e.callee)){if("RegExp"===e.callee.name)return"regexp";if(["Map","WeakMap"].includes(e.callee.name))return"map";if("Set"===e.callee.name)return"set";if("WeakSet"===e.callee.name)return"weakSet"}return;case"Identifier":return function(e,t,r){let n=ei(t.sourceCode.getScope(e),e),[o]=n?.defs??[];if(!n||r.has(n)||1!==n.defs.length||"Variable"!==o.type||"const"!==o.parent.kind)return;r.add(n);let a=nC(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return nC(e.expression,t,r)}}function nA(e,t,r=new Set){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!nE(e.typeAnnotation,t,n)||"boolean"==typeof ew(e,t.sourceCode.getScope(e))?.value||(function(e,t,r){switch(e.type){case"Identifier":return function(e,t,r){if(!e||r.has(e)||1!==e.defs.length)return!1;r.add(e);let[n]=e.defs,o=t.sourceCode.getScope(n.name);if(n.name?.typeAnnotation)return r.delete(e),!n.name.optional&&nE(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&nA(n.node.init,t,r);if(!a&&"Parameter"===n.type){let e=n.name.parent;a="AssignmentPattern"===e.type&&e.left===n.name&&n.node.params.includes(e)&&nA(e.right,t,r)}return r.delete(e),a}(ei(t.sourceCode.getScope(e),e),t,r)||nx(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return nA(e.left,t,r)&&nA(e.right,t,r);case"BinaryExpression":return nd.has(e.operator);case"ConditionalExpression":return nA(e.consequent,t,r)&&nA(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),nE(e.typeAnnotation,t,n)||nA(e.expression,t,r);case"CallExpression":return!!(function(e,t){if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.object.type||!t.sourceCode.isGlobalReference(e.callee.object))return!1;let r=ng.get(e.callee.object.name),n=eI(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t)||function(e,t){if("MemberExpression"!==e.callee.type)return!1;let r=ny.get(nC(e.callee.object,t)),n=eI(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?nx(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||nf.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||nv(e.callee,t,r)||nx(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=nh.get(nC(e.object,t)),n=eI(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return nA(e.argument??e.expression,t,r);case"SequenceExpression":return nA(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&nA(e.right,t,r)}return}}(e,t,r)??nx(e,t))}let nT=new Set(["asIntN","asUintN"]),nw=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nw(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return e5(e.literal);default:return!1}},{isTarget:nk}=rG({targetTypeNames:new Set,targetCallNames:["BigInt"],isTargetNode:e=>e5(e)||nn(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&no(e.callee,"BigInt",nT),isTargetTypeAnnotation:nw,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?rT:rI}),nI=new Set(["fromCharCode","fromCodePoint"]),nj=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nj(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return e1(e.literal);default:return!1}},{isTarget:nF,isKnownNonTarget:nB}=rG({targetTypeNames:new Set,targetCallNames:["String"],isTargetNode:(e,t)=>{if(e1(e)||nn(e,"String")||"CallExpression"===e.type&&!e.optional&&no(e.callee,"String",nI))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(nR(e.left,t)||nR(e.right,t));case"AssignmentExpression":if("="===e.operator)return nR(e.right,t);return"+="===e.operator&&(nR(e.left,t)||nR(e.right,t));default:return!1}},isTargetTypeAnnotation:nj,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?rT:rI});function nR(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&nj(e.typeAnnotation)||nF(e,t))||"string"==typeof ew(e,t.sourceCode.getScope(e))?.value)}let nP=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),nL=e=>nP.has(e.type)||tb(e),n$=new Set(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),nN=new Set(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),nM=e=>n$.has(e.type)||nN.has(e.type)||tb(e)||e7(e)&&!td(e,{method:"bind",optionalCall:!1,optionalMember:!1}),nO=(e,t)=>{if("ThisExpression"===e.type)return!0;if("FunctionDeclaration"===e.type||"FunctionExpression"===e.type)return!1;if("ClassDeclaration"===e.type||"ClassExpression"===e.type){if(e.superClass&&nO(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&nO(r.key,t))return!0;return!1}let r=t[e.type];if(!r)return!1;for(let n of r){let r=e[n];if(r){if(Array.isArray(r)){for(let e of r)if(e&&nO(e,t))return!0;continue}if(nO(r,t))return!0}}return!1};function nU(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function nq(e,t){let r;if(r=e=t.getNonNullableType(e),!rS.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>nq(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let nW=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function n_(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!ei(t.sourceCode.getScope(e),e))}let nV=(e,t,r)=>e&&t&&r.sourceCode.getRange(e)[0]===r.sourceCode.getRange(t)[0]&&r.sourceCode.getRange(e)[1]===r.sourceCode.getRange(t)[1],nz=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&nV(n,o,t)&&n===e},nK=new Set(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function nG(e){return nK.has(e.type)}let nJ=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,nX=e=>ti(e.parent),nH=new Set(["String","Null","Boolean","Numeric","RegularExpression"]),nY=new Set(["[","(","/","`","+","-","*",",","."]);function nQ(e,t,r){if(""===r||r&&!nY.has(r.charAt(0))||!e)return!1;let{sourceCode:n}=t,{type:o,value:a}=e,i=n.getRange(e),s=n.getNodeByRangeIndex(i[0]);if("Punctuator"===o){if(";"===a)return!1;if("]"===a)return!0;if(")"===a){switch(s.type){case"IfStatement":if(n.getTokenBefore(s.consequent)===e)return!1;break;case"ForStatement":case"ForInStatement":case"ForOfStatement":case"WhileStatement":case"DoWhileStatement":case"WithStatement":if(s.body&&n.getTokenBefore(s.body)===e)return!1}return!0}}return!!nH.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let nZ=e=>"type"===e.importKind||"type"===e.parent.importKind,n0=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],n1=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},n2=new Set(["Map","ReadonlyMap"]),n3=new Set(["Set","ReadonlySet"]),n8=n2.union(n3),n6=e=>new Set([e]),n9=e=>n8.has(e)?e:void 0,n5=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),n4=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>n5.has(e.type)))return!0;n=n.upper}return!1},n7=e=>{let t=new Set;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},oe=(e,t)=>{if(rS.has(e.intrinsicName))return;if(e.isUnion())return n7(e.types.map(e=>oe(e,t)));let r=rv(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&n9(n);return o&&n6(o)},ot=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return ot(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?ot(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||n4(e.typeName.name,e,t))return;let r=n9(e.typeName.name);return r&&n6(r)}case"TSUnionType":return n7(e.types.map(e=>ot(e,t)))}},or=(e,t,r=new Set)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=oe(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(n4(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(te(e,{names:["Map","Set"]})&&n_(e.callee,t))return n6(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=ei(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=ot(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=or(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return ot(e.typeAnnotation,t)??or(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return or(e.expression,t,r);case"ConditionalExpression":return n7([or(e.consequent,t,r),or(e.alternate,t,r)])}})(e,t,r),on=(e,t)=>{let r=or(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(n2.has(e)){n=!0;continue}if(n3.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function*oo(e){if("function"!=typeof e?.[Symbol.iterator])return void(yield e);for(let t of e)yield*oo(t)}class oa extends Error{name="FixAbortError"}let oi={abort(){throw new oa("Fix aborted.")}};function os(e){return t=>{let r=oo(e(t,oi));try{return[...r]}catch(e){if(e instanceof oa)return;throw e}}}class ol{#e;#t=new Map;constructor(e){this.#e=e}#r(e,t){let r=this.#t;for(let n of e)r.has(n)?r.get(n).push(t):r.set(n,[t])}on(e,t){let r=Array.isArray(e)?e:[e];this.#r(r,t)}onExit(e,t){let r=Array.isArray(e)?e:[e];this.#r(r.map(e=>`${e}:exit`),t)}toEslintListeners(){let e={};for(let[t,r]of this.#t)e[t]=function(e,t){return(...r)=>{for(let n of oo(t(...r))){if(!n)continue;let t=function(e){let t={...e};return e.fix&&(t.fix=os(e.fix)),Array.isArray(e.suggest)&&(t.suggest=e.suggest.map(t=>({...t,fix:os(t.fix),data:{...e.data,...t.data}}))),t}(n);e.report(t)}}}(this.#e,function*(...e){for(let t of r)yield t(...e)});return e}}let ou=new Set;function op(e){return ou.has(e)?e:t=>{let r=new ol(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return p.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function oc(e,t){var r;let{visitScriptBlock:n=!0}={},o=op(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},ou.add(r),r}function od(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let om=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function of(e){if(e8(e=ry(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=of(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function og(e,t){switch(e.type){case"Identifier":case"MemberExpression":case"CallExpression":case"ChainExpression":case"TemplateLiteral":case"ThisExpression":case"ArrayExpression":case"FunctionExpression":return!1;case"NewExpression":return!tX(e,t);case"Literal":let r;return!!(e8(e)&&(r=e.raw,om.test(r)));default:return!0}}let oy=new Set(["!","typeof","void","delete","~","+","-"]);function oh(e,t){if(!oy.has(t))throw Error("Unexpected operator");return["UpdateExpression","BinaryExpression","LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"].includes(e.type)}function ox(e,{operator:t,property:r}){if(!r)throw Error("`property` is required.");return("LogicalExpression"!==e.type||e.operator!==t)&&(!!["AwaitExpression","BinaryExpression"].includes(e.type)||["LogicalExpression","ConditionalExpression","AssignmentExpression","ArrowFunctionExpression","YieldExpression","SequenceExpression"].includes(e.type))}var ob={exports:{}},oE=ob.exports,oS=tj(function(){return s?ob.exports:(s=1,ob.exports=function(){var e=[],t=[],r={},n={},o={};function a(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var o=n.length;o--;){var a=n[o];if(a[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var o,a,s=(o=t[1],a=arguments,o.replace(/\$(\d{1,2})/g,function(e,t){return a[t]||""}));return""===r?i(e[n-1],s):i(r,s)})}(t,a)}return t}function l(e,t,r){return function(n){var o=n.toLowerCase();return t.hasOwnProperty(o)?i(n,o):e.hasOwnProperty(o)?i(n,e[o]):s(o,n,r)}}function u(e,t,r,n){return function(n){var o=n.toLowerCase();return!!t.hasOwnProperty(o)||!e.hasOwnProperty(o)&&s(o,o,r)===o}}function p(e,t,r){var n=1===t?p.singular(e):p.plural(e);return(r?t+" ":"")+n}return p.plural=l(o,n,e),p.isPlural=u(o,n,e),p.singular=l(n,o,t),p.isSingular=u(n,o,t),p.addPluralRule=function(t,r){e.push([a(t),r])},p.addSingularRule=function(e,r){t.push([a(e),r])},p.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}p.addPluralRule(e,"$0"),p.addSingularRule(e,"$0")},p.addIrregularRule=function(e,t){t=t.toLowerCase(),o[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return p.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return p.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return p.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(p.addUncountableRule),p}(),ob.exports)}());function oD(e,t,r=0,n=0){let{sourceCode:o}=t,[a,i]=Array.isArray(e)?e:o.getRange(e);return{start:o.getLocFromIndex(a+r),end:o.getLocFromIndex(i+n)}}function ov(e){let t=[],r=new WeakMap,n=new WeakMap,o=new WeakSet;return e.on("onCodePathStart",()=>{t.push(new Set)}),e.on("onCodePathEnd",()=>{t.pop()}),e.on("onCodePathSegmentStart",e=>{t.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{t.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{t.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{t.at(-1).delete(e)}),e.on("IfStatement",e=>{[...t.at(-1)].some(e=>e.reachable)&&o.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{r.set(e,new Set(t.at(-1)))}),e.onExit("IfStatement",e=>{let a=t.at(-1);for(let t of[e.consequent,e.alternate]){if(!t)continue;let i=r.get(t),s=!o.has(e)||!i||[...a].some(e=>e.prevSegments.some(e=>i.has(e)));n.set(t,!s)}}),e=>!!(e&&n.get(e))}function oC(e,t,r){let{parent:n}=e;for(let o of t.sourceCode.visitorKeys[n.type]||Object.keys(n)){let t=n[o];if(t!==e&&Array.isArray(t)){let n=t.indexOf(e);if(-1!==n)return t[n+r]}}}let oA=(e,t)=>oC(e,t,-1),oT=(e,t)=>oC(e,t,1),ow=e=>e.charAt(0).toUpperCase()+e.slice(1),ok=e=>e.charAt(0).toLowerCase()+e.slice(1),oI="too-deep",oj="should-parenthesized",oF="prefer-event-target",oB=new Set(["@angular/core","eventemitter3"]),oR=e=>"VariableDeclarator"===e.parent.type&&e.parent.id===e&&"VariableDeclaration"===e.parent.parent.type&&"const"===e.parent.parent.kind&&e.parent.parent.declarations.includes(e.parent);function oP(e){let t;return!!e&&(tg(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(e1(t)&&oB.has(t.value)))}let oL={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},o$="prefer-keyboard-event-key",oN="prefer-keyboard-event-key/suggestion",oM=new Set(["keyCode","charCode","which"]),oO=new Set(["onKeyDown","onKeyPress","onKeyUp"]),oU=e=>{var t;return e?.type==="TSTypeAnnotation"&&"TSTypeReference"===e.typeAnnotation.type&&("Identifier"===(t=e.typeAnnotation.typeName).type?"KeyboardEvent"===t.name:"TSQualifiedName"===t.type&&"Identifier"===t.left.type&&"React"===t.left.name&&"Identifier"===t.right.type&&"KeyboardEvent"===t.right.name)},oq=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&td(t.parent,{method:"addEventListener",minimumArguments:2,optionalCall:!1,optionalMember:!1})&&t.parent.arguments[1]===t&&o.push({parameter:t.params[0],shouldAutofix:!0}),a&&"JSXExpressionContainer"===(r=t).parent.type&&r.parent.expression===r&&"JSXAttribute"===r.parent.parent.type&&r.parent.parent.value===r.parent&&"JSXAttribute"===(n=r.parent.parent).type&&"JSXIdentifier"===n.name.type&&oO.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))oU(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!nt(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},oW=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,o_=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tl(n)&&r.push(...oq(e,n));return r},oV=(e,{shouldAutofix:t})=>{let r=(e=>{var t;if(e.parent?.type!=="MemberExpression"||e.parent.property!==e)return;let r=((e,t)=>{let r=e;for(;r&&t;)t--,r=r.parent;if(0===t)return r})(e,3);if(!r||"IfStatement"!==r.type)return;let{type:n,operator:o,right:a}=r.test;if(!("BinaryExpression"===n&&r.test.left===e.parent&&("=="===o||"==="===o)&&e8(a)))return;let i=Object.hasOwn(oL,t=a.value)?oL[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:o$,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tB(r.key))];return t?n.fix=o:n.suggest=[{messageId:oN,data:{key:r.key},fix:o}],n},oz=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),oK=(e,{references:t})=>{let r=((e,t,r=()=>!0)=>{let n=e;for(;n;){if(n.type===t&&r(n))return n;n=n.parent}})(e,"VariableDeclarator"),n=r?.init;return t&&r?.id===e.parent.parent&&t.some(e=>e.identifier===n)},oG="error",oJ="suggestion";function*oX(e,t,r){for(let n of eH(e,r))yield t.remove(n)}function oH(e,t,r,n){if("CallExpression"!==t.type)throw Error(`Unexpected node "${t.type}".`);let{sourceCode:o}=n,[a,i]=o.getLastTokens(t,2);return t.arguments.length>0&&(r=eu(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function oY(e,t,r){return e.removeRange(function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=eH(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(0!==n){let e=s.getTokenBefore(a);[l]=s.getRange(e)}if(1===r.arguments.length){let e=s.getTokenAfter(i);eu(e)&&([,u]=s.getRange(e))}return[l,u]}(t,r))}function oQ(e,t,r,n){return e.replaceTextRange(eY(t,n),r)}function oZ(e,t,r,n){let o=eQ(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!og(r,n):nG(r))||eZ(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),nQ(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*o0(e,t,r){if("ReturnStatement"!==t.type&&"ThrowStatement"!==t.type)return;let{sourceCode:n}=r,o=n.getFirstToken(t);yield e.insertTextAfter(o," (");let a=n.getLastToken(t);ep(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function o1(e,t,r){let n="object"==typeof e?t.sourceCode.getRange(e)[1]:e,[o]=t.sourceCode.text.slice(n).match(/^\s*/);return r.removeRange([n,n+o.length])}function*o2(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield o1(n,t,r),tX(e,t)||(yield r.insertTextAfter(e,"()")),nU(n,e.callee,t)||eZ(e,t)||(yield o0(r,e.parent,t))}let o3=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*o8(e,t,r){let{sourceCode:n}=r,o=eY(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&o3(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&o3(i)&&(yield e.insertTextBefore(i," "))}function*o6(e,t,r){var n;yield o8(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!eZ(o,t)&&"MemberExpression"===(n=o).type&&function(e){let t=e.object,r=e.object.type;for(;"MemberExpression"===r;)r=(t=t.object).type;return"CallExpression"===r}(n)&&(yield r.insertTextBefore(o,"("),yield r.insertTextAfter(o,")"))}function o9(e,t,r,n){let[,o]=eY(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let o5=(e,t,r)=>o9(e,t,r,"");function*o4(e,t,r){let n=t.callee;yield o5(e,n,r);let[,o]=eY(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function o7(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);ep(r)&&(i=t)}let s=o.getLoc(e).start,l=o.getLoc(i).end,u=a[s.line-1].slice(0,s.column),p=a[l.line-1].slice(l.column),[c]=o.getRange(e),[,d]=o.getRange(i);if(/^\s*$/.test(u)&&/^\s*$/.test(p))if(d+=p.length,0===c){let{text:e}=o;"\r"===e[d]&&"\n"===e[d+1]?d+=2:("\n"===e[d]||"\r"===e[d])&&d++}else c=Math.max(0,c-u.length-1);return r.removeRange([c,d])}function ae(e,t,r,n){if(nJ(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&nJ(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(nz(e,r))return n.replaceText(e,`${e.name} as ${t}`);if(((e,t)=>{let{type:r,local:n,exported:o}=e.parent;return"ExportSpecifier"===r&&nV(n,o,t)&&n===e})(e,r))return n.replaceText(e,`${t} as ${e.name}`);if(e.typeAnnotation){let{sourceCode:o}=r;return o.getCommentsInside(e).length>0?n.replaceText(o.getFirstToken(e),t):n.replaceTextRange([o.getRange(e)[0],o.getRange(e.typeAnnotation)[0]],`${t}${e.optional?"?":""}`)}return n.replaceText(e,t)}let at=(e,t,r,n)=>rd(e).map(e=>ae(e,t,r,n)),ar=(e,t,r,n)=>{let{tail:o}=e,[a,i]=r.sourceCode.getRange(e);return n.replaceTextRange([a+1,i-(o?1:2)],t)};function*an(e,t,r,n,o){for(let t of eH(e,o?{sourceCode:o}:n))yield an(t,"",r,n,o);let{sourceCode:a}=n,[i,s]=a.getRange(e),[l]=a.text.slice(0,i).match(/\s*$/),[u]=l.match(/(?:\r?\n|\r)?/);i-=l.length,yield r.replaceTextRange([i,s],`${u}${t}`)}let ao="require-array-join-separator",aa="no-thenable-object",ai="no-thenable-export",as="no-thenable-class",al=(e,t)=>ew(e,t.sourceCode.getScope(e))?.value==="then",au=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===eI(e,t.sourceCode.getScope(e)):"then"===r.name},ap=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&au(r,t)&&(yield r.key)},messageId:aa},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){au(e,t)&&(yield e.key)},messageId:as},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&au(e,t)&&(yield e.property)},messageId:aa},{selector:"CallExpression",*getNodes(e,t){if(!(td(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})&&"SpreadElement"!==e.arguments[0].type))return;let[,r]=e.arguments;al(r,t)&&(yield r)},messageId:aa},{selector:"CallExpression",*getNodes(e,t){if(td(e,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"ArrayExpression"===e.arguments[0].type)for(let r of e.arguments[0].elements){if(!(r?.type==="ArrayExpression"&&r.elements[0]&&"SpreadElement"!==r.elements[0].type))continue;let[e]=r.elements;al(e,t)&&(yield e)}},messageId:aa},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:ai},{selector:"Identifier",*getNodes(e){"then"===e.name&&("FunctionDeclaration"===e.parent.type||"ClassDeclaration"===e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type&&e.parent.parent.declaration===e.parent&&(yield e)},messageId:ai},{selector:"VariableDeclaration",*getNodes(e,t){if("ExportNamedDeclaration"===e.parent.type&&e.parent.declaration===e)for(let r of t.sourceCode.getDeclaredVariables(e))"then"===r.name&&(yield*r.identifiers)},messageId:ai}],ac="no-invalid-remove-event-listener",ad="consistent-function-scoping",am=(e,t)=>e&&t&&(e===t||e.block===t.block),af=(e,t)=>e.some(e=>am(e,t)),ag=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),ay=new Set(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),ah=e=>e?.type==="BlockStatement"&&ay.has(e.parent.type)&&e.parent.body===e,ax=new Set(["FunctionExpression","ArrowFunctionExpression"]),ab={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(ts,e=>{if(("ArrowFunctionExpression"!==e.type||t)&&!function(e,t,r){let n,o,a,i=t.acquire(e);if(!i||(o=r.visitorKeys,"ArrowFunctionExpression"===e.type&&nO(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&ts.includes(t.type)&&th(e.callee,["jest.mock"]))return!0;t=e}return!1}(e))return!0;let s=e.parent;"VariableDeclarator"===s.type&&(s=s.parent),"VariableDeclaration"===s.type&&(s=s.parent),s?.type==="ReturnStatement"&&"ArrowFunctionExpression"===e.type&&(s=s.parent),s=function(e,t){if("ArrowFunctionExpression"===e.type&&"ArrowFunctionExpression"===t.type){let t=function(e){let t=e;for(;t&&"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e);t&&"ReturnStatement"===t.type&&"ReturnStatement"===(e=function(e){let t=e;for(;"ArrowFunctionExpression"===t.type;)t=t.parent;return t}(e)).type&&(e=e.parent)}return e}(s,e),s?.type==="BlockStatement"&&(n=s,s=s.parent);let l=t.acquire(s),u=function(e,t,r){let n=[];e&&n.push(e);let o=function(e){let t=[];for(;e?.type==="BlockStatement";){if(t.push(e),ah(e))return t;e=e.parent}return[]}(t);if(0===o.length)return n;let a=o.at(-1),i=r.acquire(a.parent);for(let e of(i&&n.push(i),o)){let t=r.acquire(e);t&&n.push(t)}return n}(l,n,t);return!!(0===u.length||u.some(e=>"global"===e.type)||l&&l.block?.parent?.callee&&th(l.block.parent.callee,ag)||l&&(a=s,ax.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||tU(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(af(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&af(u,t.scope)})||e.defs.some(e=>af(u,t.acquire(e.node)))||e.identifiers.some(e=>{if(!e.parent||"FunctionDeclaration"!==e.parent.type||t.acquire(e))return!1;let r=t.acquire(e.parent);return!(!r||am(i,r))&&af(u,r.upper)}))}(e,n,r))return{node:e,loc:eh(e,r),messageId:ad,data:{functionNameWithKind:ej(e,r)}}})},meta:{type:"suggestion",docs:{description:"Move function definitions to the highest possible scope.",recommended:!0},schema:[{type:"object",additionalProperties:!1,properties:{checkArrowFunctions:{type:"boolean",description:"Whether to check arrow functions."}}}],defaultOptions:[{checkArrowFunctions:!0}],messages:{[ad]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},aE="error",aS="error-unknown",aD="suggestion";function av(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield o2(e,t,n)}}let aC="no-console-spaces",aA=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),aT=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),aw="no-empty-file",ak={create:e=>{let{allowComments:t}=e.options[0];e.filename===e.physicalFilename&&(e.on("Program",r=>{if(r.templateBody)return;if(1===r.body.length&&"Document"===r.body[0].type){let{children:e}=r.body[0];if(e.some(e=>"Comment"!==e.type&&("Text"!==e.type||""!==e.value.trim()))||t&&e.some(e=>"Comment"===e.type))return;return{node:r,messageId:aw}}if(r.body.some(e=>!tn(e,tr)))return;let{sourceCode:n}=e,o=t9(e);if(0!==n.ast.tokens.length||0!==o.length||""===n.text.trim()){if(!o.some(e=>"Line"===e.type&&e.value.startsWith("/"))&&(!(t&&o.length>0&&o.every(e=>"Line"===e.type||"Block"===e.type))||0!==n.ast.tokens.length))return{node:r,messageId:aw}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=t9(e);if(!t||!(n.length>0))return{node:r,messageId:aw}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=t9(e);if(!t||!(n.length>0))return{node:r,messageId:aw}}),e.on("root",e=>{if(!e.children.some(e=>!("html"===e.type&&/^<!--(?:(?!-->)[\s\S])*-->$/.test(e.value.trim())))&&(!t||!(e.children.length>0)))return{node:e,messageId:aw}}))},meta:{type:"suggestion",docs:{description:"Disallow empty files.",recommended:"unopinionated"},schema:[{type:"object",additionalProperties:!1,properties:{allowComments:{type:"boolean",description:"Whether to allow files that only contain comments."}}}],defaultOptions:[{allowComments:!1}],messages:{[aw]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},aI="no-useless-fallback-in-spread",aj="zero-fraction",aF="dangling-dot",aB="error",aR="suggestion",aP=Symbol.for("default"),aL=Symbol("NAMESPACE_SPECIFIER_NAME"),a$=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},aN=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*aM(e,t,r){switch(e.type){case"ImportSpecifier":case"ExportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return void(yield function*(e,t,r,n=!1){let o=e.parent,{specifiers:a}=o;if(1===a.length&&!n)return void(yield t.remove(o));let{sourceCode:i}=r;switch(e.type){case"ImportSpecifier":if(a.every(t=>e===t||e.type!==t.type)){let r=i.getTokenAfter(e,e=>"Identifier"===e.type&&"from"===e.value),n=a.some(e=>"ImportDefaultSpecifier"===e.type),o=i.getTokenBefore(e,n?eu:ef),[s]=i.getRange(o),[l]=i.getRange(r),u=i.getTokenBefore(o),p=i.getRange(u)[1]===s;yield t.replaceTextRange([s,l],p?" ":"");return}case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ImportDefaultSpecifier":{yield t.remove(e);let r=i.getTokenAfter(e);eu(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function aO(e,t){let{sourceCode:r}=t,n=r.getTokenBefore(e.source,e=>"Identifier"===e.type&&"from"===e.value),[o]=r.getRange(n),[,a]=r.getRange(e);return r.text.slice(o,a)}let aU={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new Set,o=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{e1(e.source)&&o.push(e)}),e.on("Program:exit",function*(a){for(let i of n){let n=t.getDeclaredVariables(i);if(n.some(e=>1!==e.defs.length||e.defs[0].parent!==i)||(n=n.map(e=>{let r=function(e,t){let r=e.defs[0].node,n={node:r,declaration:r.parent,variable:e,isTypeImport:nZ(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:aP,text:"default",...n};case"ImportSpecifier":return{name:a$(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:aL,text:"*",...n}}}(e,t),n=function(e,t){let r=[];for(let{identifier:n}of e.variable.references){let o=function(e,t){let{parent:r}=e;switch(r.type){case"ExportDefaultDeclaration":return{node:r,name:aP,text:"default",isTypeExport:aN(r)};case"ExportSpecifier":return{node:r,name:a$(r.exported),text:t.getText(r.exported),isTypeExport:aN(r)};case"VariableDeclarator":if(r.init===e&&"Identifier"===r.id.type&&!r.id.typeAnnotation&&"VariableDeclaration"===r.parent.type&&"const"===r.parent.kind&&1===r.parent.declarations.length&&r.parent.declarations[0]===r&&"ExportNamedDeclaration"===r.parent.parent.type&&function(e,t){let r=t.getDeclaredVariables(e);if(1!==r.length)return!1;let[{identifiers:n,references:o}]=r;return 1===n.length&&n[0]===e.id&&1===o.length&&o[0].identifier===e.id}(r,t))return{node:r.parent.parent,name:Symbol.for(r.id.name),text:t.getText(r.id)}}}(n,t);o&&(e.name!==aL||o.name!==aP)&&r.push(o)}return r}(r,t);return{variable:e,imported:r,exports:n}}),!r&&n.some(({variable:e,exports:t})=>e.references.length!==t.length)))continue;let s=!r&&n.some(({variable:e})=>0===e.references.length);for(let{imported:t,exports:r}of n)for(let n of r){let r={node:n.node,messageId:aB,data:{exported:n.text}},i=function({context:e,imported:t,exported:r,exportDeclarations:n,program:o}){let a,i=t.declaration,s=i.source.value,l=t.isTypeImport||r.isTypeExport;return l&&(a=n.find(({source:e,exportKind:t})=>"type"===t&&e.value===s)),a||=n.find(({source:e,exportKind:t})=>"type"!==t&&e.value===s),function*(n){if(t.name===aL)yield n.insertTextAfter(o,`
3
+ export ${l?"type ":""}* as ${r.text} ${aO(i,e)}`);else{let s=r.name===t.name?r.text:`${t.text} as ${r.text}`;if(l&&(!a||"type"!==a.exportKind)&&(s=`type ${s}`),a){let t=a.specifiers.at(-1);if(t)yield n.insertTextAfter(t,`, ${s}`);else{let t=e.sourceCode.getFirstToken(a,ef);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
4
+ export {${s}} ${aO(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield aM(t.node,n,e)),yield aM(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:aR,fix:i}]:r.fix=i,yield r}}})},meta:{type:"suggestion",docs:{description:"Prefer `export…from` when re-exporting.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkUsedVariables:{type:"boolean",description:"Whether to check variables that are used in the module."}}}],defaultOptions:[{checkUsedVariables:!0}],messages:{[aB]:"Use `export…from` to re-export `{{exported}}`.",[aR]:"Switch to `export…from`."},languages:["js/js"]}},aq="prefer-native-coercion-functions",aW=new Set(["String","Number","BigInt","Boolean","Symbol"]),a_=new Set(["every","filter","find","findLast","findIndex","findLastIndex","some"]),aV=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&aW.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,az=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},aK=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},aK(e[r],n)):e[r]=n}};class aG{#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=ez.READ,context:n,filter:o,handle:a}){for(let e of t)aK(this.#n,az(e,r));this.#e=n,this.#o=o,this.#a=a}*#i(e,t){let r=t?.context??this.#e,n=t?.filter??this.#o,o=t?.handle??this.#a;for(let t of new ez(e).iterateGlobalReferences(this.#n)){if(n&&!n(t))continue;let e=o(t,r);yield e}}listen(e){let t=e?.context??this.#e;t.onExit("Program",r=>this.#i(t.sourceCode.getScope(r),e))}}Object.assign(aG,{READ:ez.READ,CALL:ez.CALL,CONSTRUCT:ez.CONSTRUCT});let aJ="no-document-cookie",aX=new aG({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:aJ})}),aH=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],aY=new Set(["click","rightclick","dblclick","auxclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","mousecancel","selectionchange","selectstart","wheel","keypress","keydown","keyup","blur","focus","deactivate","focusin","focusout","change","reset","select","submit","input","propertychange","dragstart","drag","dragenter","dragover","dragleave","drop","dragend","touchstart","touchmove","touchend","touchcancel","beforeunload","consolemessage","contextmenu","devicechange","devicemotion","deviceorientation","DOMContentLoaded","error","help","load","losecapture","orientationchange","readystatechange","resize","scroll","unload","canplay","canplaythrough","durationchange","emptied","ended","loadeddata","loadedmetadata","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","sourceopen","sourceended","sourceclosed","abort","update","updatestart","updateend","hashchange","pagehide","pageshow","popstate","copy","paste","cut","beforecopy","beforecut","beforepaste","online","offline","message","connect","install","activate","fetch","foreignfetch","messageerror","statechange","updatefound","controllerchange",...aH("AnimationStart"),...aH("AnimationEnd"),...aH("AnimationIteration"),...aH("TransitionEnd"),"pointerdown","pointerup","pointercancel","pointermove","pointerover","pointerout","pointerenter","pointerleave","gotpointercapture","lostpointercapture","MSGestureChange","MSGestureEnd","MSGestureHold","MSGestureStart","MSGestureTap","MSGotPointerCapture","MSInertiaStart","MSLostPointerCapture","MSPointerCancel","MSPointerDown","MSPointerEnter","MSPointerHover","MSPointerLeave","MSPointerMove","MSPointerOut","MSPointerOver","MSPointerUp","text","textinput","textInput","compositionstart","compositionupdate","compositionend","beforeinput","exit","loadabort","loadcommit","loadredirect","loadstart","loadstop","responsive","sizechanged","unresponsive","visibilitychange","storage","DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified","beforeprint","afterprint","beforeinstallprompt","appinstalled","afterblur","beforeblur","cancel","close","dragexit","encrypted","fullscreenchange","invalid","toggle","search","open","show"]),aQ="prefer-add-event-listener",aZ={create:e=>{let t,r,n=new Set(e.options[0].excludedPackages),o=new WeakMap;e.on("onCodePathStart",(e,t)=>{r={node:t,upper:r,returnsSomething:!1}}),e.on("onCodePathEnd",()=>{o.set(r.node,r.returnsSomething),r=r.upper}),e.on("CallExpression",e=>{tg(e)&&!t&&n.has(e.arguments[0].value)&&(t=!0)}),e.on("Literal",e=>{"ImportDeclaration"===e.parent.type&&!t&&n.has(e.value)&&(t=!0)}),e.on("ReturnStatement",e=>{r.returnsSomething||=!!e.argument}),e.on("AssignmentExpression:exit",r=>{let n;if(t)return;let{left:a,right:i,operator:s}=r;if("MemberExpression"!==a.type||a.computed)return;let l=a.property.name;if(!l||!l.startsWith("on"))return;let u=l.slice(2);if(!aY.has(u))return;let p="addEventListener",c="";if(tb(i)||e9(i))p="removeEventListener";else"beforeunload"===u&&("ArrowFunctionExpression"!==i.type&&"FunctionExpression"!==i.type||"BlockStatement"!==i.body.type||o.get(i))?c="Use `event.preventDefault(); event.returnValue = 'foo'` to trigger the prompt.":"message"===u?c="Note that there is difference between `SharedWorker#onmessage` and `SharedWorker#addEventListener('message')`.":"error"===u?c="Note that there is difference between `{window,element}.onerror` and `{window,element}.addEventListener('error')`.":"="!==s||"ExpressionStatement"!==r.parent.type||r.parent.expression!==r||nM(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);eZ(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);eZ(r.right,t)&&(s=`(${s})`);let l=`${i}.addEventListener('${a}', ${s})`;return e.replaceText(r,l)})(t,e,r,a));return{node:a.property,messageId:aQ,data:{replacement:p,method:l,extra:c?` ${c}`:""},fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{excludedPackages:{type:"array",items:{type:"string"},uniqueItems:!0,description:"Packages to exclude from checking."}}}],defaultOptions:[{excludedPackages:["koa","sax"]}],messages:{[aQ]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},a0=new Set(["false","true"]),a1=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(nW(e.left,t)||nW(e.right,t)),a2=({type:e,name:t},r)=>"Identifier"===e&&t===r;function a3({method:e,replacement:t,checkBooleanPredicate:r=!1}){let n=`prefer-${t}-over-${e}/`,o=`${n}error`,a=`${n}suggestion`;return{messages:{[o]:({findIndex:"Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.",findLastIndex:"Use `.lastIndexOf()` instead of `.findLastIndex() when looking for the index of an item.`",some:`Use \`.${t}()\` instead of \`.${e}()\` when checking value existence.`})[e],[a]:`Replace \`.${e}()\` with \`.${t}()\`.`},listen:function(n){let{sourceCode:i}=n,{scopeManager:s}=i;n.on("CallExpression",r=>{let l,u,p;if(!td(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&a1(p.body,p.params[0])||("ArrowFunctionExpression"===p.type||"FunctionExpression"===p.type)&&!p.async&&!p.generator&&1===p.params.length&&"BlockStatement"===p.body.type&&1===p.body.body.length&&"ReturnStatement"===p.body.body[0].type&&a1(p.body.body[0].argument,p.params[0]))||r0(r.callee.object,n))return;let[c]=r.arguments,d="BinaryExpression"===c.body.type?c.body:c.body.body[0].argument,[m]=c.params,{left:f,right:g}=d,{name:y}=m;if(a2(f,y))l=g,u=f;else{if(!a2(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||ei(h,m).references.some(({identifier:e})=>e!==u)||rb(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);eZ(l,n)&&!eZ(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return eL(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!td(r,{method:e,argumentsLength:1,optionalCall:!1}))return;let[n]=r.arguments;if("ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||1!==n.params.length||"Identifier"!==n.params[0].type)return;let[a]=n.params,{parserServices:l}=i,u=function(e,t){let r="ArrowFunctionExpression"!==e.type||e.async||1!==e.params.length||"BlockStatement"===e.body.type?"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||1!==e.params.length||"BlockStatement"!==e.body.type||1!==e.body.body.length||"ReturnStatement"!==e.body.body[0].type?void 0:e.body.body[0].argument:e.body;if(r){if(nW(r,t))return r;if("CallExpression"===r.type&&!r.optional&&a2(r.callee,"Boolean")&&1===r.arguments.length&&nW(r.arguments[0],t))return r.arguments[0]}}(n,a);if(!u||!function(e){if("boolean"===e.intrinsicName||"true"===e.intrinsicName)return!0;if(!e.isUnion())return!1;let t=e.types.map(e=>e.intrinsicName);return t.includes("true")&&t.every(e=>a0.has(e))}(l.getTypeAtLocation(a))||!function(e,t){if(e.isUnion())return!1;let r=t.program.getTypeChecker();return!!e.getProperty("includes")&&(r.isArrayType(e)||r.isTupleType(e))}(l.getTypeAtLocation(r.callee.object),l))return;let p=s.acquire(n);if(!p||ei(p,a).references.some(({identifier:e})=>e!==u)||rb(n,p))return;let c=r.callee.property;return{node:c,messageId:o,*fix(e,{abort:r}){i.getCommentsInside(n).length>0&&r(),yield e.replaceText(c,t),yield e.replaceText(n,"true")}}})}}}let a8=a3({method:"findIndex",replacement:"indexOf"}),a6=a3({method:"findLastIndex",replacement:"lastIndexOf"}),a9={create(e){a8.listen(e),a6.listen(e)},meta:{type:"suggestion",docs:{description:"Prefer `Array#{indexOf,lastIndexOf}()` over `Array#{findIndex,findLastIndex}()` when looking for the index of an item.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{...a8.messages,...a6.messages},languages:["js/js"]}},a5="error",a4="prefer-date",a7="prefer-date-now-over-methods",ie="prefer-date-now-over-number-data-object",it=e=>te(e,{name:"Date",argumentsLength:0}),ir=(e,t,r)=>({node:e,messageId:a4,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield o8(t,e,r))},...t}),{isIdentifierName:io}=tN,ia="prefer-dataset",ii="prefer-attributes",is=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,il=e=>tc(e,{property:"dataset"}),iu=e=>e.computed||"Identifier"!==e.property.type?e.computed&&e1(e.property)?e.property.value:void 0:e.property.name,ip=new Set(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),ic=/[\s\u0000-\u001F"'/<=>]/,id=e=>ip.has(e)||e.includes("-")||ic.test(e);function im(e,t){let r=eQ(e,t);return!eZ(e,t.sourceCode)&&og(e,t)?`(${r})`:r}let ig={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(id(n.value)||ne(o.object,e))return;let a=im(o.object,e),i=o.optional?"?.":".",s=tB(is(n.value),n.raw.charAt(0)),l=t7(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return nQ(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:ii,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&e1(e.left)&&il(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>td(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&il(e.arguments[0])&&e1(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):td(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&il(e.callee.object)&&e1(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&il(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||ne(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:ii,data:{method:"getAttribute"},fix:function(e,t){let{sourceCode:r}=t,n=e.init,o=e.parent,[a]=r.getDeclaredVariables(e);if(!a)return;let i=function(e){let t=[];for(let r of e.references){if(r.init)continue;let{identifier:e}=r,n=e.parent;if(!("MemberExpression"===n.type&&n.object===e&&!n.optional))return;let o=iu(n);if(void 0===o||id(o))return;let{parent:a}=n;if(nr(n)||"CallExpression"===a.type&&a.callee===n||"TaggedTemplateExpression"===a.type&&a.tag===n)return;t.push(n)}return t}(a);if(!(i&&i.length>0&&"const"===o.kind&&1===o.declarations.length&&!o.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==o.parent.type&&"Identifier"===n.object.type&&function(e,t,r){let{sourceCode:n}=r,{name:o}=e.object,a=e=>ei(n.getScope(e),o),i=a(e.object),s=t.some(e=>a(e)!==i),l=!!i?.references.some(e=>e.isWrite()&&!e.init);return!s&&!l}(n,i,t)&&!t7(t,o)&&i.every(e=>!t7(t,e))))return;let s=im(n.object,t);return function*(e){for(let r of(yield o7(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tB(is(iu(r)),t);yield e.replaceText(r,`${s}.getAttribute(${n})`)}}}(t,e)};let{properties:o}=t.id;if(o.some(e=>"Property"===e.type&&(e.computed||"Identifier"!==e.key.type?!e1(e.key)||id(e.key.value):id(e.key.name))))return;let a=t.parent,i=im(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!t7(e,a,[n.object])&&o.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type&&"Identifier"===e.value.type)&&(1===o.length||"Identifier"===n.object.type)){let t=t6(a,e),n=o.map(e=>{let t=tB(is(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
5
+ ${t}`)};`)}return{node:n,messageId:ii,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!il(o)||ne(o.object,e))return;let a=iu(r);if(void 0===a||id(a)||r.optional)return;let i="ChainExpression"===r.parent.type?r.parent.parent:r.parent;if("CallExpression"===i.type&&i.callee===r||"TaggedTemplateExpression"===i.type&&i.tag===r||"UpdateExpression"===i.type||"AssignmentExpression"===i.type&&i.left===r&&"="!==i.operator)return;let s="AssignmentExpression"===i.type&&i.left===r,l="UnaryExpression"===i.type&&"delete"===i.operator;if(nr(r)&&!s&&!l)return;let u=im(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tB(is(a),c);return s&&nX(i)&&!t7(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${eQ(i.right,e)})`):l&&ti(i.parent)&&!t7(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return nQ(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||t7(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:ii,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((td(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||td(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&e1(t.arguments[0]))||ne(t.callee.object,e))return;let r=t.callee.property.name,n="ChainExpression"===t.parent.type?t.parent:t;if(("AwaitExpression"!==n.parent.type||n.parent.argument!==n||"getAttribute"!==r)&&t.arguments[0].value.toLowerCase().startsWith("data-"))return{node:t,messageId:ia,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&rh(e.callee)||"setAttribute"===r&&!nX(e)||"removeAttribute"===r&&!ti(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!t7(t,e,n))return n=>{let[o]=e.arguments,a=o.value.toLowerCase().slice(5).replaceAll(/-[a-z]/g,e=>e[1].toUpperCase()),i="",s=`${im(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=io(a)?`.${a}`:`[${tB(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${eQ(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tB(a,o.raw.charAt(0))})`}return n.replaceText(e,i)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for DOM element dataset access.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{preferAttributes:{type:"boolean",description:"Prefer attribute methods over named `.dataset` access."}}}],defaultOptions:[{preferAttributes:!1}],messages:{[ia]:"Prefer `.dataset` over `{{method}}(…)`.",[ii]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},iy="prefer-modern-math-apis",ih=(e,t)=>"MemberExpression"===e.type&&!e.optional&&!e.computed&&"Identifier"===e.object.type&&"Math"===e.object.name&&"Identifier"===e.property.type&&e.property.name===t,ix=(e,t)=>"CallExpression"===e.type&&!e.optional&&ih(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function ib({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(ix(n.left,"log")&&ih(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):ix(n.right,"log")&&ih(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:iy,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${eQ(s,o)})`)}}}function iE({constantName:e,replacementMethod:t}){let r={messageId:iy,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&ix(n.left,"log")&&ih(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${eQ(a,o)})`)}}}let iS=[ib({constantName:"LOG10E",replacementMethod:"log10"}),ib({constantName:"LOG2E",replacementMethod:"log2"}),iE({constantName:"LN10",replacementMethod:"log10"}),iE({constantName:"LN2",replacementMethod:"log2"})],iD=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>iD(e)):[e],iv="number-literal-case",iC=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},iA={create:oc(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(e8(t)?o=iC(r,n):e5(t)&&(o=iC(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:iv,fix:e=>e.replaceText(t,o)}})}),meta:{type:"suggestion",docs:{description:"Enforce proper case for numeric literals.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{hexadecimalValue:{enum:["uppercase","lowercase"]}}}],defaultOptions:[{hexadecimalValue:"uppercase"}],messages:{[iv]:"Invalid number literal casing."},languages:["js/js"]}},iT="error",iw="suggestion",ik={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},iI=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function ij(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=iI(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:iT,data:{description:o,property:i}};if("NEGATIVE_INFINITY"===i)return s.node=a,s.data.description="-Infinity",s.fix=function*(e){yield e.replaceText(a,"Number.NEGATIVE_INFINITY"),yield o8(e,a,t)},s;let l=e=>ae(r,`Number.${i}`,t,e);return ik[o]||((e,t)=>{let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e||1!==r.arguments.length)return!1;let[n]=r.arguments;return"SpreadElement"!==n.type&&nc(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:iw,fix:l}],s}let iF={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new aG({objects:Object.keys(ik).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:ij,filter(t){let{node:r,path:n}=t,[o]=n;return!nr(r)&&!("Infinity"===o&&(e=>{if(!iI(e))return!1;let{parent:t}=e,{parent:r}=t;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t})(r))&&!("parseInt"===o&&function(e,t){let{parent:r}=e;if("CallExpression"!==r.type||r.callee!==e)return!1;let n=r.arguments[1];return!n||"SpreadElement"!==n.type&&ew(n,t.sourceCode.getScope(n))?.value===10}(r,e))}}).listen()},meta:{type:"suggestion",docs:{description:"Prefer `Number` static methods over global functions and optionally static properties over global constants.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkInfinity:{type:"boolean",description:"Whether to check usage of the global `Infinity`."},checkNaN:{type:"boolean",description:"Whether to check usage of the global `NaN`."}}}],defaultOptions:[{checkInfinity:!1,checkNaN:!1}],messages:{[iT]:"Prefer `Number.{{property}}` over `{{description}}`.",[iw]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},iB="prefer-reflect-apply",iR=(e,t)=>(e9(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),iP=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,iL="prefer-set-size";var i$={exports:{}},iN=tj(function(){var e,t,r,n;return l?i$.exports:(l=1,r=String.fromCodePoint||(e=String.fromCharCode,t=Math.floor,function(){var r,n,o=[],a=-1,i=arguments.length;if(!i)return"";for(var s="";++a<i;){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!=l)throw RangeError("Invalid code point: "+l);l<=65535?o.push(l):(l-=65536,r=(l>>10)+55296,n=l%1024+56320,o.push(r,n)),(a+1==i||o.length>16384)&&(s+=e.apply(null,o),o.length=0)}return s}),n={parse:function(e,t,n){function o(t,r){return t.range[0]=r,t.raw=e.substring(r,t.range[1]),t}function a(t,r){return{type:"anchor",kind:t,range:[Y-r,Y],raw:e.substring(Y-r,Y)}}function i(t,r,n,o){return{type:"value",kind:t,codePoint:r,range:[n,o],raw:e.substring(n,o)}}function s(e,t,r,n){return n=n||0,i(e,t,Y-(r.length+n),Y)}function l(e){var t,r=e[0],n=r.charCodeAt(0);return H&&1===r.length&&n>=55296&&n<=56319&&(t=h().charCodeAt(0))>=56320&&t<=57343?i("symbol",(n-55296)*1024+t-56320+65536,++Y-2,Y):i("symbol",n,Y-1,Y)}function u(t,r,n,o,a){return null==o&&(n=Y-1,o=Y),{type:"quantifier",min:t,max:r,greedy:!0,body:null,symbol:a,range:[n,o],raw:e.substring(n,o)}}function p(t,r,n,o){return{type:"characterClass",kind:t.kind,body:t.body,negative:r,range:[n,o],raw:e.substring(n,o)}}function c(t,r,n,o){return t.codePoint>r.codePoint&&_("invalid range in character class",t.raw+"-"+r.raw,n,o),{type:"characterClassRange",min:t,max:r,range:[n,o],raw:e.substring(n,o)}}function d(e){return"alternative"===e.type?e.body:[e]}function m(e){Y+=e=e||1}function f(e){g(e)||_("character",e)}function g(t){var r=t.length;if(e.substring(Y,Y+r)===t)return m(r),t}function y(t){if(e[Y]===t)return Y++,t}function h(){return e[Y]}function x(t){return e[Y]===t}function b(t){return e[Y+1]===t}function E(t){var r=e.substring(Y).match(t);return r&&(Y+=r[0].length),r}function S(){var t,r=[],n=Y;for(r.push(D());y("|");)r.push(D());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=Y],raw:e.substring(n,t)}}function D(){for(var t,r,s=[],u=Y;r=function(){if(Y>=e.length||x("|")||x(")"))return null;var t,r=function(){switch(h()){case"^":return m(),a("start",1);case"$":return m(),a("end",1);case"\\":if(b("b"))return m(2),a("boundary",2);if(b("B"))return m(2),a("not-boundary",2);break;case"(":return v("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=Y;if(t=A()||!1){if(!H&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;Y=s,_("Expected atom")}return r}var u=function(){var t;switch(t=h()){case".":return m(),{type:"dot",range:[Y-1,Y],raw:"."};case"\\":if(m(),!(t=w())){if(!H&&"c"==h())return i("symbol",92,Y-1,Y);_("atomEscape")}return t;case"[":return $();case"(":if(n.lookbehind&&(t=v("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=C("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(Y,Y+2)||":"==e[Y+2])return v("(?:","ignore","(","normal");return o=Y,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||_("Invalid flags for modifiers group"):a||_("Invalid flags for modifiers group"),((s=(a=a?a[0]:"")+(r=r?r[0]:"")).length>3||function(e){for(var t=0;t<e.length;){if(-1!=e.indexOf(e[t],t+1))return!0;t++}return!1}(s))&&_("flags cannot be duplicated for modifiers group"),y(":")||_("Invalid flags for modifiers group"),(u=C("ignore",o)).modifierFlags={enabling:a,disabling:r},u;case"]":case"}":if(!H)return m(),l(t);break;case"^":case"$":case"*":case"+":case"?":case"{":case")":case"|":break;default:return m(),l(t)}}();if(u||(s=Y,(t=A()||!1)&&(Y=s,_("Expected atom")),!H&&y("{")?u=l("{"):_("Expected atom")),t=A()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&_("Invalid quantifier","",t.range[0],t.range[1]),t.body=d(u),o(t,u.range[0]),t}return u}();)s.push(r);return 1===s.length?s[0]:{type:"alternative",body:s,range:[u,t=Y],raw:e.substring(u,t)}}function v(e,t,r,n){var o,a=Y;if(g(e))o=t;else{if(!g(r))return!1;o=n}return C(o,a)}function C(t,r){var n,o=S();o||_("Expected disjunction"),f(")");var a={type:"group",behavior:t,body:d(o),range:[r,n=Y],raw:e.substring(r,n)};return"normal"==t&&K&&z++,a}function A(){var e,t,r,n,o=Y;switch(h()){case"*":m(),e=u(0,void 0,void 0,void 0,"*");break;case"+":m(),e=u(1,void 0,void 0,void 0,"+");break;case"?":m(),e=u(0,1,void 0,void 0,"?");break;case"{":(n=E(/^\{(\d+)\}/))?e=u(t=parseInt(n[1],10),t,o,Y):(n=E(/^\{(\d+),\}/))?e=u(t=parseInt(n[1],10),void 0,o,Y):(n=E(/^\{(\d+),(\d+)\}/))&&((t=parseInt(n[1],10))>(r=parseInt(n[2],10))&&_("numbers out of order in {} quantifier","",o,Y),e=u(t,r,o,Y)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&_("iterations outside JS safe integer range in quantifier","",o,Y)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function T(t,r){if(r){var n,o;if("unicodeEscape"==t.kind&&(n=t.codePoint)>=55296&&n<=56319&&x("\\")&&b("u")){var a=Y;Y++;var i=w(!0);"unicodeEscape"==i.kind&&(o=i.codePoint)>=56320&&o<=57343?(t.kind="unicodeCodePointEscape",t.codePoint=(n-55296)*1024+o-56320+65536,t.range[1]=Y,t.raw=e.substring(t.range[0],Y)):Y=a}}return t}n||(n={});function w(t){var r,a,i,u,p=Y;switch(u=h()){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return function(t){var r,n,a=Y;if(r=E(/^(?!0)\d+/)){var i,u,p=parseInt(n=r[0],10);if(p<=z&&!t)return u=Y-1-(i=n).length,{type:"reference",matchIndex:parseInt(i,10),range:[u,Y],raw:e.substring(u,Y)};if(V.push(p),K?G=!0:k(a,Y),m(-n.length),r=E(/^[0-7]{1,3}/))return s("octal",parseInt(r[0],8),r[0],1);var c=Y;return o(r=l(E(/^[89]/)),c-1)}return!!(r=E(/^[0-7]{1,3}/))&&(("0"!==(n=r[0])&&k(a,Y),/^0{1,3}$/.test(n))?s("null",0,"0",n.length):s("octal",parseInt(n,8),n,1))}(t);case"B":if(!t)return L();_("\\B not possible inside of CharacterClass","",p);break;case"b":if(t)return m(),s("singleEscape",8,"\\b");return L();case"c":if(t){if(!H&&(i=E(/^c(\d)/)))return s("controlLetter",i[1]+16,i[1],2);else if(!H&&g("c_"))return s("controlLetter",31,"_",2)}return j();case"d":case"D":case"w":case"W":case"s":case"S":return m(),{type:"characterClassEscape",value:u,range:[Y-2,Y],raw:e.substring(Y-2,Y)};case"k":return function(){if(n.namedGroups&&E(/^k<(?=.*?>)/)){var t,r=B();return f(">"),t=r.range[0]-3,{type:"reference",name:r,range:[t,Y],raw:e.substring(t,Y)}}}()||L();case"p":case"P":return a=Y,!!(n.unicodePropertyEscape&&H&&(r=E(/^([pP])\{([^}]+)\}/)))&&{type:"unicodePropertyEscape",negative:"P"===r[1],value:r[2],range:[a-1,Y],raw:e.substring(a-1,Y)}||L();case"-":if(t&&H)return m(),s("singleEscape",45,"\\-");return L();default:return j()}}function k(e,t){H&&_("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?T(s("unicodeEscape",parseInt(t[1],16),t[1],2),e):e&&(t=E(/^u\{([0-9a-fA-F]+)\}/))?s("unicodeCodePointEscape",parseInt(t[1],16),t[1],4):void 0}function j(){var e,t=Y;switch(h()){case"t":return m(),s("singleEscape",9,"\\t");case"n":return m(),s("singleEscape",10,"\\n");case"v":return m(),s("singleEscape",11,"\\v");case"f":return m(),s("singleEscape",12,"\\f");case"r":return m(),s("singleEscape",13,"\\r");case"c":if(e=E(/^c([a-zA-Z])/))return s("controlLetter",e[1].charCodeAt(0)%32,e[1],2);break;case"x":if(e=E(/^x([0-9a-fA-F]{2})/))return s("hexadecimalEscape",parseInt(e[1],16),e[1],2);break;case"u":if(e=I(H))return(!e||e.codePoint>1114111)&&_("Invalid escape sequence",null,t,Y),e}return L()}function F(t){var n=h(),o=Y;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||_("Invalid escape sequence",null,o,Y),r(a.codePoint)}var i=n.charCodeAt(0);if(i>=55296&&i<=56319){var s=(n+=e[Y+1]).charCodeAt(1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536)}if(t(i))return m(),i>65535&&m(),n}function B(){var t,r=Y,n=F(R);for(n||_("Invalid identifier");t=F(P);)n+=t;return{type:"identifier",value:n,range:[r,Y],raw:e.substring(r,Y)}}function R(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/.test(r(e))}function P(e){return R(e)||e>=48&&e<=57||e>=128&&/[\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDD40-\uDD49\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE-\uDDD9\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD0\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDED0-\uDEE3\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDD50-\uDD59\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99\uDF60-\uDF67\uDFF0-\uDFF9]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDDE0-\uDDE9\uDEF3-\uDEF6\uDF00\uDF01\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF50-\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDD70-\uDD79\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDCF0-\uDCF9\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDD40-\uDD49\uDEAE\uDEEC-\uDEF9]|\uD839[\uDCEC-\uDCF9\uDDEE\uDDEF\uDDF1-\uDDFA\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9]|\uDB40[\uDD00-\uDDEF]/.test(r(e))}function L(){var t,r=h();return H&&/[\^$.*+?()\\[\]{}|/]/.test(r)||!H&&"c"!==r?"k"===r&&n.lookbehind?null:s("identifier",(t=e.substring(Y,Y+=1)).charCodeAt(0),t,1):null}function $(){var e,t=Y;return g("[^")?(e=N(),f("]"),p(e,!0,t,Y)):y("[")?(e=N(),f("]"),p(e,!1,t,Y)):null}function N(){var e,t;return x("]")?{kind:"union",body:[]}:X?function(){var e,t=[],r=O(!0);for(t.push(r),e="classRange"===r.type?"union":x("&")?"intersection":x("-")?"subtraction":"union";!x("]");)"intersection"===e?(f("&"),f("&"),x("&")&&_("&& cannot be followed by &. Wrap it in brackets: &&[&].")):"subtraction"===e&&(f("-"),f("-")),t.push(r=O("union"===e));return{kind:e,body:t}}():((t=M())||_("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||_("classAtom"),n=Y;var r,n,o,a,i,s,u=N();return(u||_("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:H?_("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||_("classAtom"),(o=x("]")?s:e(s))||_("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||_("nonEmptyClassRanges"),{kind:"union",body:e})}function M(){return y("-")?l("-"):function(){var e;switch(e=h()){case"\\":if(m(),!(e=w(!0))){if(!H&&"c"==h())return l("\\");_("classEscape")}return T(e,H);case"]":case"-":break;default:return m(),l(e)}}()}function O(t){var r,n,o=Y;if(y("\\"))if(g("q{"))return function(){var t,r=Y-3,n=[];do n.push(function(){for(var t,r,n=[],o=Y;r=U();)n.push(r);return{type:"classString",characters:n,range:[o,t=Y],raw:e.substring(o,t)}}());while(y("|"));return f("}"),{type:"classStrings",strings:n,range:[r,t=Y],raw:e.substring(r,t)}}();else if(n=w(!0))r=n;else{if(n=W())return n;_("Invalid escape","\\"+h(),o)}else if(n=q())r=n;else{if(n=$())return n;_("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=U())return c(r,n,o,Y);_("Invalid range end",h())}return r}function U(){if(y("\\")){var e,t=Y;if(e=W())return e;_("Invalid escape","\\"+h(),t)}return q()}function q(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&_("Invalid set operation in character class"),e=E(/^[^()[\]{}/\-\\|]/))return l(e)}function W(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))_("\\B not possible inside of ClassContents","",Y-2);else if(e=E(/^[&\-!#%,:;<=>@`~]/))return s("identifier",e[0].codePointAt(0),e[0]);else if(e=j())return e;else return null}function _(t,r,n,o){n=null==n?Y:n,o=null==o?n:o;var a=Math.max(0,n-10),i=Math.min(o+10,e.length),s=" "+e.substring(a,i),l=" "+Array(n-a+1).join(" ")+"^";throw SyntaxError(t+" at position "+n+(r?": "+r:"")+"\n"+s+"\n"+l)}var V=[],z=0,K=!0,G=!1,J=-1!==(t||"").indexOf("u"),X=-1!==(t||"").indexOf("v"),H=J||X,Y=0;if(X&&!n.unicodeSet)throw Error('The "v" flag is only supported when the .unicodeSet option is enabled.');if(J&&X)throw Error('The "u" and "v" flags are mutually exclusive.');""===(e=String(e))&&(e="(?:)");var Q=S();return(Q.range[1]!==e.length&&_("Could not parse entire input - got stuck","",Q.range[1]),G=G||V.some(function(e){return e<=z}))?(Y=0,K=!1,S()):Q}},i$.exports?i$.exports=n:window.regjsparser=n,i$.exports)}());let iM=String.raw`\$&`,iO=new Set(String.raw`\^$.*+?()[]{}|/-`),{parse:iU}=iN,iq="method",iW="pattern",i_="split-join",iV=new Set(["i","y"]),iz=new Set(["anchor","reference"]),iK=e=>String.raw`\u{${e.toString(16)}}`;function iG(e){let{kind:t,codePoint:r,raw:n}=e;if("controlLetter"===t)return 13===r?String.raw`\r`:10===r?String.raw`\n`:9===r?String.raw`\t`:iK(r);if("null"===t||"octal"===t)return iK(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function iJ(e){return"value"===e.type?iG(e):"characterClass"!==e.type||e.negative||1!==e.body.length||"value"!==e.body[0].type?"quantifier"===e.type&&1===e.min&&1===e.max||"group"===e.type&&"ignore"===e.behavior?iX(e.body):void 0:iG(e.body[0])}function iX(e){let t=[];for(let r of e){let e=iJ(r);if(void 0===e)return;t.push(e)}return t.join("")}let iH=e=>{let{pattern:t,flags:r}=e.regex;try{return iU(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},iY=e=>{let t=0;for(let r of e)t+=iQ(r);return t};function iQ(e){return iz.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?iY(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>iQ(e))):"quantifier"===e.type?e.min*iY(e.body):"group"===e.type&&"ignore"===e.behavior?iY(e.body):0}let iZ=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>iZ(e)),i0=e=>e8(e)&&Number.isSafeInteger(e.value)&&e.value>=0,i1=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(t0(e.left,t)&&e0(e.right,1)||e0(e.left,1)&&t0(e.right,t)))return t},i2=e=>e8(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-i2(e.argument):void 0,i3=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,i8="prefer-string-trim-start-end",i6="no-unreadable-iife",i9="suggestion",i5="throw-new-error",i4=/^(?:[A-Z][\da-z]*)*Error$/,i7="escape-uppercase",se="escape-lowercase",st=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,sr=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,sn=({node:e,original:t,regex:r=st,lowercase:n,fix:o})=>{let a=t.replace(r,e=>e[0]+e.slice(1)[n?"toLowerCase":"toUpperCase"]());if(a!==t)return{node:e,messageId:n?se:i7,fix:t=>o?o(t,a):t.replaceText(e,a)}},so="prefer-unicode-code-point-escapes",sa="prefer-unicode-code-point-escapes/add-unicode-flag",si=String.raw`\u{`,ss=/^[\da-f]$/iv,sl=/^[0-7]$/v,su=/^[A-Za-z]$/v;function sp(e){return sl.test(e)}function sc(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function sd(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function sm(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!ss.test(e))))return Number.parseInt(n,16)}function sf(e){return e>=55296&&e<=56319}function sg(e){return e>=56320&&e<=57343}function sy(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function sh(e,{isRegex:t=!1,supportsNestedCharacterClasses:r=!1}={}){let n="",o=0,a=!1;for(let i=0;i<e.length;i++){let s=e[i],l=o>0;if(t&&"["===s&&(!l||r)&&!sd(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!sd(e,i)){o--,n+=s;continue}if("\\"!==s||!sc(e,i)){n+=s;continue}let u=function(e,t,{isRegex:r,isInCharacterClass:n}){return function(e,t){if("x"!==e[t+1])return;let r=sm(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:sy(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=sm(e,t+2,4);if(void 0===o||!n&&(sf(o)||sg(o)))return;let a=t+6;if(r&&sf(o)&&"\\"===e[a]&&sc(e,a)&&"u"===e[a+1]){let t=sm(e,a+2,4);if(sg(t))return{end:a+6,replacement:sy((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:sy(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&su.test(r))return{end:t+3,replacement:sy(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!sp(e[t+2])||!sp(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&sp(e[o]);)o++;return{end:o,replacement:sy(Number.parseInt(e.slice(t+1,o),8))}}(e,t))}(e,i,{isRegex:t,isInCharacterClass:l});if(!u){n+=s;continue}n+=u.replacement,i=u.end-1,a=!0}return{fixed:n,hasReplacement:a}}function sx(e,t,r){let{fixed:n,hasReplacement:o}=sh(t);if(o)return{node:e,messageId:so,fix:t=>r?r(t,n):t.replaceText(e,n)}}function sb(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let sE=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],sS=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],sD="missing-message",sv="message-is-empty-string",sC="message-is-not-a-string",sA=new Map([["AggregateError",1],["SuppressedError",2]]),sT=e=>"instanceof"===e.value&&"Keyword"===e.type,sw="no-instanceof-builtins",sk="switch-to-type-of",sI=new Set(["String","Number","Boolean","BigInt","Symbol"]),sj=new Set(["global","globalThis","self","window"]),sF=[...sS,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...rE,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],sB=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=rc(t,e),s=i.getTokenAfter(o,sT),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield o8(n,e,t);let c=eY(o,{sourceCode:i});!eZ(o,t)&&oh(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=eY(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},sR=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,sP={create:oc(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new Set("strict"===r?[...sF,...n]:n);e.on("BinaryExpression",r=>{let{right:n,operator:i}=r;if("instanceof"!==i)return;let s="Identifier"===n.type?{name:n.name,referenceText:n.name}:"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.property.type&&"Identifier"===n.object.type&&sj.has(n.object.name)&&n_(n.object,e)?{name:n.property.name,referenceText:e.sourceCode.getText(n)}:void 0;if(!s||o.includes(s.name))return;let{name:l,referenceText:u}=s,p={node:r,messageId:sw};if("Array"===l||"Error"===l&&t){let t="Array"===l?"isArray":"isError",n=`${u}.${t}`;return p.fix=function*(t){let{left:o,right:a}=r,i=rc(e,r),s=i.getTokenAfter(o,sT);yield o8(t,r,e);let l=eY(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield an(s,"",t,e,i),yield an(a,"",t,e,i)},p}return"Function"===l?(sR(n,e)||(p.fix=sB(r,e,l)),p):sI.has(l)?(sR(n,e)||(p.suggest=[{messageId:sk,data:{type:l.toLowerCase()},fix:sB(r,e,l)}]),p):a.has(l)?p:void 0})}),meta:{type:"problem",docs:{description:"Disallow `instanceof` with built-in objects",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",properties:{useErrorIsError:{type:"boolean"},strategy:{enum:["loose","strict"]},include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},additionalProperties:!1}],defaultOptions:[{useErrorIsError:!1,strategy:"loose",include:[],exclude:[]}],hasSuggestions:!0,messages:{[sw]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[sk]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},sL="prefer-type-error",s$=new Set(["isArguments","isArray","isArrayBuffer","isArrayLike","isArrayLikeObject","isBigInt","isBoolean","isBuffer","isDate","isElement","isError","isFinite","isFunction","isInteger","isLength","isMap","isNaN","isNative","isNil","isNull","isNumber","isObject","isObjectLike","isPlainObject","isPrototypeOf","isRegExp","isSafeInteger","isSet","isString","isSymbol","isTypedArray","isUndefined","isView","isWeakMap","isWeakSet","isWindow","isXMLDoc"]),sN=new Set(["isNaN","isFinite"]),sM=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&s$.has(e.name)||!1===r&&sN.has(e.name)),sO=(e,t)=>!!sM(e.property,t,!0)||"MemberExpression"===e.object.type&&sO(e.object,t),sU=/^(?:[A-Z][\da-z]*)*Error$/,sq=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,sW=(e,t)=>{switch(e.type){case"Identifier":return sM(e,t,!1);case"MemberExpression":return sO(e,t);case"CallExpression":return sW(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&sW(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?sU.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&sU.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(sq(r)&&e0(n,"undefined")||sq(n)&&e0(r,"undefined"))})(e))return!1;return sW(n,t)||sW(o,t)}case"LogicalExpression":return sW(e.left,t)&&sW(e.right,t);default:return!1}},s_="consistentDestructuring",sV="consistentDestructuringSuggest",sz=new Set(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),sK=e=>{for(;e.parent;)if(e=e.parent,sz.has(e.type))return e},sG=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,sJ=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=ei(n.getScope(o.value),o.value);if(e&&ei(r,o.value)===e)return o}},sX=({declaration:e,memberExpressionNode:t,memberScope:r,memberRootIdentifier:n,memberRootVariable:o,memberThisScopeBoundary:a,memberExpressionWrites:i,sourceCode:s})=>{if(!((e,t,r)=>{let[,n]=r.getRange(e.object),[o]=r.getRange(t);return n<o})(e,t,s)||e.rootIdentifierName&&n?.name===e.rootIdentifierName&&o!==e.rootVariable||e.thisScopeBoundary&&a!==e.thisScopeBoundary||((e,t,r,n)=>{if(!e.rootVariable)return!1;let[,o]=n.getRange(e.object),[a]=n.getRange(t);return e.rootVariable.references.some(e=>{if(!e.isWrite())return!1;let[t]=n.getRange(e.identifier);return!(t<o)&&(e.from.variableScope!==r.variableScope||t<=a)})})(e,t,r,s)||(({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:n,sourceCode:o})=>{let[,a]=o.getRange(e.object),[i]=o.getRange(t),s=t.property.name,l=ry(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?ei(r,l):void 0,c="ThisExpression"===l.type?sK(l):void 0;return n.some(e=>e.propertyName===s&&e.rootIdentifierName===u&&e.rootVariable===p&&e.thisScopeBoundary===c&&(e.scope.variableScope!==r.variableScope||e.start>=a&&e.start<=i))})({declaration:e,memberExpressionNode:t,memberScope:r,memberExpressionWrites:i,sourceCode:s}))return!1;for(var l=r,u=e.scope;l;){if(l===u)return!0;l=l.upper}return!1},sH=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&e1(e.left))&&"Identifier"===t.property.type&&e.left.value===t.property.name&&r.getText(e.right)===r.getText(t.object)||"LogicalExpression"===e.type&&"&&"===e.operator&&(sH(e.left,t,r)||sH(e.right,t,r)),sY=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&sH(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&sH(e.left,r,n);default:return!1}},sQ=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),sZ=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...sS,...["Collator","DateTimeFormat","DisplayNames","DurationFormat","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"].map(e=>`Intl.${e}`),...["Duration","Instant","PlainDate","PlainDateTime","PlainMonthDay","PlainTime","PlainYearMonth","ZonedDateTime"].map(e=>`Temporal.${e}`),...["Module","Instance","Memory","Table","Global","Tag","Exception","CompileError","LinkError","RuntimeError"].map(e=>`WebAssembly.${e}`),...rE],s0=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],s1="error-date",s2="suggestion-date";function s3(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let s8=new aG({objects:["BigInt","Boolean","Number","String","Symbol"],type:aG.CONSTRUCT,handle:function(e,t){let{node:r}=e,n=e.path.join("."),o={node:r,messageId:"disallow",data:{name:n}};return"String"!==n&&"Boolean"!==n&&"Number"!==n&&(o.fix=e=>o2(r,t,e)),o}}),s6=new aG({objects:sZ,type:aG.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||rh(r.callee))return;let n=e.path.join(".");if("Object"===n){let{parent:e}=r;if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)&&(e.left===r||e.right===r))return}else if("Date"===n){function*o(e){yield e.replaceText(r,"String(new Date())"),yield o8(e,r,t)}let e={node:r,messageId:s1};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:s2,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>o6(r,t,e)}}}),s9=new aG({objects:s0,type:aG.CALL,handle:s3}),s5=new aG({objects:s0,type:aG.CONSTRUCT,handle:s3}),s4="error/array-push",s7="suggestion",le=e=>tc(e,{property:"classList",computed:!1}),lt=e=>e.arguments.some(e=>"SpreadElement"===e.type),lr=[{description:"Array#push()",test:e=>td(e,{method:"push",optionalCall:!1}),ignore:["stream.push","this.push","this.stream.push","process.stdin.push","process.stdout.push","process.stderr.push"]},{description:"Array#unshift()",test:e=>td(e,{method:"unshift",optionalCall:!1}),keepSecondCall:!0,ignore:["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"]},{description:"Element#classList.add()",test:e=>td(e,{method:"add",optionalCall:!1,optionalMember:!1})&&le(e.callee.object)},{description:"Element#classList.remove()",test:e=>td(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&le(e.callee.object)},{description:"importScripts()",test:e=>e7(e,{name:"importScripts"})}],ln={create:function(e){let{ignore:t}=e.options[0],{sourceCode:r}=e;e.on("CallExpression",function*(n){for(let{description:o,test:a,ignore:i=[],keepSecondCall:s=!1}of lr){if(!a(n))continue;let l=[...i,...t];if(th(n.callee,l))continue;let u=function(e){let t=e.parent;return"ChainExpression"===t.type&&e===t.expression&&(t=t.parent),"ExpressionStatement"===t.type?t:void 0}(n);if(!u)continue;let p=oA(u,e);if(p?.type!=="ExpressionStatement")continue;let c=function(e){let{expression:t}=e;return"ChainExpression"===t.type?t.expression:t}(p);if(!a(c)||!t0(c.callee,n.callee))continue;let{shouldKeepSecondCall:d,shouldPrependSourceArguments:m,targetCall:f,sourceCall:g}=function(e,t,r){let n=r&&(!rh(t.callee)||rh(e.callee));return{shouldKeepSecondCall:n,shouldPrependSourceArguments:r&&!n,targetCall:n?t:e,sourceCall:n?e:t}}(c,n,s),y=g.arguments,h=r.getRange(p),x=r.getRange(u),b=d?[h[0],x[0]]:[h[1],x[1]],E=!d&&!ep(r.getLastToken(p))&&ep(r.getLastToken(u)),S=d&&nQ(r.getTokenBefore(p),e,r.text.slice(x[0],x[0]+1)),D={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:s4,data:{description:o}},v=function*(t){if(y.length>0){let r=tY(e,g,!m),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=tH(f,e);m?yield t.insertTextAfter(n,f.arguments.length>0?`${r}, `:r):yield o?t.insertTextAfter(o,` ${r}`):t.insertTextBefore(a,f.arguments.length>0?`, ${r}`:r)}yield t.replaceTextRange(b,E||S?";":"")};!function(e,t){return e.getAllComments().some(r=>{let[n,o]=e.getRange(r);return n>=t[0]&&o<=t[1]})}(r,b)&&(function(e,t,r,n){let o=r?[...e.arguments,...t.arguments]:t.arguments;return r&&(lt(e)||lt(t))||r&&o.some(e=>null===ew(e,n.getScope(e)))||o.some(e=>eL(e,n))}(c,n,s,r)?D.suggest=[{messageId:s7,fix:v}]:D.fix=v),yield D}})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple `Array#{push,unshift}()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{ignore:{type:"array",uniqueItems:!0,description:"Methods to ignore."}}}],defaultOptions:[{ignore:[]}],messages:{[s4]:"Do not call `{{description}}` multiple times.",[s7]:"Merge with previous one."},languages:["js/js"]}},lo="no-process-exit",la=e=>e0(e,"node:worker_threads")||e0(e,"worker_threads"),li="no-single-promise-in-promise-methods/error",ls="no-single-promise-in-promise-methods/unwrap",ll="no-single-promise-in-promise-methods/use-promise-resolve",lu=["all","any","race"],lp=(e,t)=>{let[r]=e.arguments[0].elements,n=eQ(r,t);return!eZ(r,t)&&["SequenceExpression","YieldExpression","ArrowFunctionExpression","ConditionalExpression","AssignmentExpression","LogicalExpression","BinaryExpression"].includes(r.type)&&(n=`(${n})`),n},lc=(e,t)=>e.getCommentsInside(t).length>0,ld=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",lm="no-static-only-class",lf=({type:e,value:t})=>"Punctuator"===e&&"="===t,lg=e=>"PropertyDefinition"===e.type,ly="ignored-elements",lh="property-assignment",lx={create:e=>{let{sourceCode:t}=e,{maximumIgnoredElements:r}=e.options[0];e.on("ArrayPattern",n=>{let{elements:o,parent:a}=n;if(function(e){let t=0,r=0;for(let n of e)null===n?t=Math.max(t,++r):r=0;return t}(o)<=r)return;let i={node:n,messageId:ly},s=o.filter(e=>null!==e);if("VariableDeclarator"===a.type&&a.id===n&&null!==a.init&&1===s.length){let[r]=s;"AssignmentPattern"!==r.type&&(i.fix=function*(i){let s=o.indexOf(r),l="RestElement"===r.type,u=l?r.argument:r;yield i.replaceText(n,t.getText(u));let p=l?`.slice(${s})`:`[${s}]`,c=a.init;!eZ(c,e)&&og(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield o8(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rg(r)&&r.expression===t||"AssignmentPattern"===r.type&&r.left===t||"RestElement"===r.type&&r.argument===t)return e(r);if("Property"===r.type&&r.value===t&&"ObjectPattern"===r.parent.type)return r.parent;if("ObjectPattern"===r.type||"ArrayPattern"===r.type)return r}}(e)?.type==="ArrayPattern")return{node:e,messageId:lh}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable array destructuring.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{maximumIgnoredElements:{type:"integer",minimum:0,description:"Maximum number of consecutive ignored elements allowed."}}}],defaultOptions:[{maximumIgnoredElements:1}],messages:{[ly]:"Array destructuring may not contain consecutive ignored values.",[lh]:"Do not assign destructured values to object properties."},languages:["js/js"]}},lb="spread-in-list",lE="iterable-to-array",lS="iterable-to-array-in-for-of",lD="iterable-to-array-in-yield-star",lv="spread-in-collection-constructor",lC="spread-in-object-assign",lA="clone-array",lT="suggestion/remove-object-assign-spread",lw=["Map","WeakMap","Set","WeakSet"],lk=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],lI=[...lk,"filter","flatMap","map"],lj=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",lF={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*lB(e,t,r){let{sourceCode:n}=r,[o,a,i]=n.getFirstTokens(t,3);yield e.remove(o),yield e.remove(a);let[s,l]=n.getLastTokens(t,2);yield e.remove(l),eu(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||nU(o,i,r)||eZ(t,r)?yield o8(e,t,r):yield o0(e,u,r)}let lR=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&rQ(e.callee.object,t),lP="no-useless-switch-case/error",lL="no-useless-switch-case/suggestion",l$=e=>e.consequent.every(e=>tn(e)),lN=e=>tb(e.test)||e9(e.test),lM=new Set(["CallExpression","MemberExpression"]),lO=new Set(["Identifier","MemberExpression","Super","ThisExpression"]),lU=e=>"MemberExpression"===(e=ry(e)).type?{...e,object:lU(e.object),property:e.computed?lU(e.property):e.property}:e,lq=(e,t)=>t0(lU(e),lU(t)),lW=e=>lO.has(ry(e).type),l_=e=>!!("ChainExpression"===e.type||lM.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&l_(e)):t.type&&l_(t))),lV="no-useless-undefined",lz="no-useless-undefined/suggestion",lK=new Set(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),lG=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},lJ={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},lX={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},lH={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},lY={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},lQ=new Set(["<","<=",">",">="]);function lZ(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function l0(e,t){return tc(e=ry(e),{property:"length",optional:!1,computed:!1})&&lq(e.object,t)}function l1(e,t){return l0(e=ry(e),t)?"length":"BinaryExpression"===e.type&&"-"===e.operator&&l0(e.left,t)&&1===of(e.right)?"lengthMinusOne":void 0}function l2(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let l3={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=lG(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:lV,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tb(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=lG(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>an(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>an(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>an(o," {}",t,e),!0);if("VariableDeclarator"===a.type&&a.init===o&&"VariableDeclaration"===a.parent.type&&"const"!==a.parent.kind&&a.parent.declarations.includes(a)){let[,e]=t.getRange(a.id),[,n]=t.getRange(o);return r(o,t=>t.removeRange([e,n]))}if("AssignmentPattern"===a.type&&a.right===o)return r(o,function*(r){let{left:n}=a,[,i]=t.getRange(n),[,s]=t.getRange(o);yield r.removeRange([i,s]),(n.typeAnnotation||ru(e.physicalFilename))&&!n.optional&&tl(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tb(r.consequent);if(n===tb(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tc(e=ry(e),{computed:!0,optional:!1})||l_(e)||eL(e.object,t,{considerGetters:!0})||eL(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=ry(e)).type&&"-"===e.operator){let t=of(e.right);if(Number.isSafeInteger(t)&&t>0)return{node:e.left,offset:t}}return{node:e,offset:0}}(e.property)}}(o,t);if(!a||function(e,t){if(!("BinaryExpression"!==(e=ry(e)).type||!lQ.has(e.operator)||l_(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=of(n),i=of(o);return Number.isSafeInteger(i)&&lq(n,t.node)?lZ(lJ,r,i,t.offset):Number.isSafeInteger(a)&&lq(o,t.node)?lZ(lX,r,a,t.offset):void 0}(e,t.index)??function(e,t){if(0!==t.index.offset)return;let{operator:r,left:n,right:o}=e,a=l1(o,t.node.object);if(a&&lq(n,t.index.node))return l2(lH,r,a);let i=l1(n,t.node.object);if(i&&lq(o,t.index.node))return l2(lY,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:lV};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:lz,fix(n){let a=t.getText(o),i=nQ(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||ru(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tb(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),lK.has(n)||"push"===n||"unshift"===n||"includes"===n||"add"===n||"has"===n||"delete"===n||"set"===n||"createContext"===n||/^set[A-Z]/v.test(n)||"useRef"===n||"ref"===n))&&(!(!t.optional&&"MemberExpression"===t.callee.type&&!t.callee.computed&&"Identifier"===t.callee.property.type&&"bind"===t.callee.property.name)||1===o.length))return{node:a,messageId:lV,fix:t=>oY(t,a,e)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `undefined`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkArguments:{type:"boolean",description:"Whether to check function arguments."},checkArrowFunctionBody:{type:"boolean",description:"Whether to check arrow function bodies."}}}],defaultOptions:[{checkArguments:!0,checkArrowFunctionBody:!0}],messages:{[lV]:"Do not use useless `undefined`.",[lz]:"Use the indexed access directly."},languages:["js/js"]}},l8="numeric-separators-style";function l6(e,{minimumDigits:t,groupLength:r},n){let{length:o}=e;if(o<t)return e;let a=[];if(n)for(let t=0;t<o;t+=r){let n=Math.min(t+r,o);a.push(e.slice(t,n))}else for(let t=o;t>0;t-=r){let n=Math.max(t-r,0);a.unshift(e.slice(n,t))}return a.join("_")}let l9={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},l5={create:e=>{let{onlyIfContainsSeparator:t,binary:r,octal:n,hexadecimal:o,number:a}=e.options[0],i={"0b":{onlyIfContainsSeparator:t,...r},"0o":{onlyIfContainsSeparator:t,...n},"0x":{onlyIfContainsSeparator:t,...o},"":{onlyIfContainsSeparator:t,...a}};e.on("Literal",e=>{let t,r;if(!(e8(e)||e5(e))||e8(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";e5(e)&&(o=n.slice(0,-1),a="n");let s=o.replaceAll("_",""),{prefix:l,data:u}=(t="",r=s,/^0[box]/i.test(s)&&(t=s.slice(0,2),r=s.slice(2)),{prefix:t,data:r}),{onlyIfContainsSeparator:p}=i[l.toLowerCase()];if(p&&!n.includes("_"))return;let c=function(e,{prefix:t,data:r},n){let o=n[t.toLowerCase()];if(t)return t+l6(r,o);let{number:a,mark:i,sign:s,power:l}=function(e){let{number:t,mark:r="",sign:n="",power:o=""}=e.match(/^(?<number>[\d._]*)(?:(?<mark>e)(?<sign>[+-])?(?<power>[\d_]+))?$/i).groups;return{number:t,mark:r,sign:n,power:o}}(e);return function(e,t){let{integer:r,dot:n,fractional:o}=function(e){let t=e.split("."),[r,n=""]=t;return{integer:r,dot:2===t.length?".":"",fractional:n}}(e);return l6(r,t)+n+l6(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+l6(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:l8,fix:t=>t.replaceText(e,c)}})},meta:{type:"suggestion",docs:{description:"Enforce the style of numeric separators by correctly grouping digits.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{...Object.fromEntries(Object.keys(l9).map(e=>[e,(({withFraction:e=!1}={})=>({type:"object",additionalProperties:!1,properties:{onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."},minimumDigits:{type:"integer",minimum:0,description:"The minimum number of digits before separators are enforced."},groupLength:{type:"integer",minimum:1,description:"The number of digits in each group."},...e&&{fractionGroupLength:{type:"integer",minimum:1,description:"The number of digits in each group after the decimal point. Defaults to no grouping."}}}}))({withFraction:"number"===e})])),onlyIfContainsSeparator:{type:"boolean",description:"Whether to only enforce the style if the number already contains a separator."}}}],defaultOptions:[{onlyIfContainsSeparator:!1,binary:l9.binary,octal:l9.octal,hexadecimal:l9.hexadecimal,number:l9.number}],messages:{[l8]:"Invalid group length in numeric value."},languages:["js/js"]}},l4="error-zero-index",l7="error-shift",ue="error-pop",ut="error-at-zero",ur="error-at-minus-one",un="error-slice-minus-one",uo="error-destructuring-declaration",ua="error-destructuring-assignment",ui="error-variable",us="suggest-nullish-coalescing-operator",ul="suggest-logical-or-operator",uu=(e,t,r)=>td(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!rQ(e.callee.object,t),up=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,uc=(e,t)=>td(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&up(e.arguments[0])&&uu(e.callee.object,t),ud=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*um(e,t,r){let{left:n}=ud(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||e$(e,t))return!1;let{left:r}=ud(e),[n]=r.elements,{type:o}="AssignmentPattern"===n.type?n.left:n;return"ObjectExpression"===o||"ObjectPattern"===o})(e,t)&&(yield r.insertTextBefore(e,"("),yield r.insertTextAfter(e,")"))}let uf=e=>"AssignmentPattern"===ud(e).left.elements[0].type,ug=(e,t)=>{let r,n,{property:o}=ud(t).right.callee;return uf(t)?r=[{operator:"??",messageId:us},{operator:"||",messageId:ul}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=ud(e),[i]=o.elements,s=i.right,l=t.getText(s);return(e$(s,t)||"LogicalExpression"===s.type&&(s.operator===n||"||"===n&&"??"===s.operator||"??"===n&&("||"===s.operator||"&&"===s.operator))||"ConditionalExpression"===s.type||"AssignmentExpression"===s.type||"YieldExpression"===s.type||"SequenceExpression"===s.type)&&(l=`(${l})`),r.insertTextAfter(a,` ${n} ${l}`)})(t,e,r,n),yield um(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield um(t,e,r)},{fix:n,suggest:r}},uy=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,uh=e=>{let{left:t,right:r}=ud(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},ux={create:e=>{let{sourceCode:t}=e,{checkFromLast:r}=e.options[0];e.on("MemberExpression",t=>{if(t.computed&&"Literal"===t.property.type&&"0"===t.property.raw&&uu(t.object,e)&&!nr(t))return{node:t.object.callee.property,messageId:l4,fix:r=>[r.replaceText(t.object.callee.property,"find"),o5(r,t,e)]}}),e.on("CallExpression",t=>{if(td(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uu(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:l7,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...o4(r,t,e)]}}),e.on("VariableDeclarator",r=>{if("ArrayPattern"===r.id.type&&1===r.id.elements.length&&r.id.elements[0]&&"RestElement"!==r.id.elements[0].type&&uu(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:uo,...ug(t,r)}}),e.on("AssignmentExpression",r=>{if("ArrayPattern"===r.left.type&&1===r.left.elements.length&&r.left.elements[0]&&"RestElement"!==r.left.elements[0].type&&uu(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:ua,...ug(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&uu(r.init,e,{optionalMember:!1})&&"VariableDeclaration"===r.parent.type&&r.parent.declarations.includes(r)&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)))return;let n=t.getScope(r),o=ei(n,r.id),a=rd(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(uy(e))i.push(e.parent);else{if(!uh(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:ui};return s.every(e=>!uf(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=oS.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=tJ(l,tO(n));yield at(o,r,e,a),yield function*(e,t){yield e.insertTextBeforeRange(t,""),yield e.insertTextAfterRange(t,"")}(a,t.getRange(t.ast))}for(let t of i)yield o5(a,t,e);for(let e of s)yield um(e,t,a)}),l}),e.on("CallExpression",t=>{if(td(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&uu(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:ut,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...o4(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(td(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uu(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:ue,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...o4(r,t,e)]}}),e.on("CallExpression",t=>{if(td(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&up(t.arguments[0])&&uu(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:ur,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...o4(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nr(r)&&uc(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:un,*fix(o,{abort:a}){if(rt(e,[eY(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield o4(o,r.object,e),yield o5(o,r,e)}}}),e.on("CallExpression",r=>{if(!(td(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uc(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:un,*fix(o,{abort:a}){if(rt(e,[eY(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield o4(o,r.callee.object,e),yield o4(o,r,e)}}}))},meta:{type:"suggestion",docs:{description:"Prefer `.find(…)` and `.findLast(…)` over the first or last element from `.filter(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{checkFromLast:{type:"boolean",description:"Whether to also check for patterns that can be replaced with `findLast()`."}}}],defaultOptions:[{checkFromLast:!0}],messages:{[ui]:"Prefer `.find(…)` over `.filter(…)`.",[l4]:"Prefer `.find(…)` over `.filter(…)[0]`.",[ut]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[l7]:"Prefer `.find(…)` over `.filter(…).shift()`.",[ue]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[ur]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[un]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[uo]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[ua]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[us]:"Replace `.filter(…)` with `.find(…) ?? …`.",[ul]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},ub="prefer-array-flat-map",uE="prefer-array-flat-map/filter-flat-map",uS="prefer-array-flat-map/filter-flat-map-suggestion",uD=["React.Children","Children"],uv=new Set(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),uC=e=>"ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&!e.params[0].optional&&!e.params[0].typeAnnotation&&"BlockStatement"!==e.body.type,uA="prefer-array-flat",uT={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!td(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&nW(r.params[0],r.body)&&!uB(e.callee.object,t)}},uw={testFunction(e){if(!td(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[t,r]=e.arguments;if(!("ArrowFunctionExpression"===t.type&&!t.async&&2===t.params.length&&to(r)))return!1;let n=t.body,[o,a]=t.params;return td(n,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&nW(o,n.callee.object)&&nW(a,n.arguments[0])||"ArrayExpression"===n.type&&2===n.elements.length&&n.elements.every((e,r)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&nW(t.params[r],e.argument))},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},uk={testFunction:e=>td(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&to(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},uI={testFunction(e){if(!(td(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tE(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return to(t)&&("apply"===e.callee.property.name&&"SpreadElement"!==r.type||"call"===e.callee.property.name&&"SpreadElement"===r.type)},getArrayNode(e){let t=e.arguments[1];return"SpreadElement"===t.type?t.argument:t},description:"Array.prototype.concat()"},uj=["_.flatten","lodash.flatten","underscore.flatten"],uF=/^\p{Uppercase_Letter}/u,uB=(e,t)=>{let r,n;return"Identifier"===e.type&&uF.test(e.name)&&(!(r=ra(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=ra(e,t))&&("ObjectExpression"===n.type||"Literal"===n.type||"TemplateLiteral"===n.type||"ArrowFunctionExpression"===n.type||"FunctionExpression"===n.type||"ClassExpression"===n.type||"NewExpression"===n.type&&"Identifier"===n.callee.type&&"Array"!==n.callee.name))},uR={create:function(e){let{functions:t}=e.options[0],r=[...t,...uj],n=[uT,uw,uk,uI,{testFunction:e=>e7(e,{argumentsLength:1,optional:!1})&&th(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>ty(e.callee,t)).trim()}()`}];e.on("CallExpression",function*(t){for(let{testFunction:r,description:o,getArrayNode:a,shouldSwitchToArray:i,isOptionalArray:s}of n){if(!r(t,e))continue;let n=a(t),l=s?.(t),u={description:"string"==typeof o?o:o(t)},p={node:t,messageId:uA,data:u},{sourceCode:c}=e;c.getCommentsInside(t).length===c.getCommentsInside(n).length&&(p.fix=function(e,t,r,n,o){return"function"==typeof n&&(n=n(e)),function*(a){let{sourceCode:i}=r,s=eQ(t,r);n?s=`[${s}]`:!eZ(t,i)&&og(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,nQ(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield o8(a,e,r)}}(t,n,e,i,l)),yield p}})},meta:{type:"suggestion",docs:{description:"Prefer `Array#flat()` over legacy techniques to flatten arrays.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{functions:{type:"array",uniqueItems:!0,description:"Additional functions to check."}}}],defaultOptions:[{functions:[]}],messages:{[uA]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},uP="some",uL="some-suggestion",u$="filter",uN={create:oc(e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||rQ(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tb(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&e9(t.parent.right));if(!r&&!(tT(t,e)||tw(t)||function(e,t){if(!rY(e.callee.object,t))return!1;let r=e.parent;if("VariableDeclarator"!==r.type||r.init!==e||"Identifier"!==r.id.type||r.id.typeAnnotation||"VariableDeclaration"!==r.parent.type||"const"!==r.parent.kind||"ExportNamedDeclaration"===r.parent.parent.type&&r.parent.parent.declaration===r.parent)return!1;let[n]=t.sourceCode.getDeclaredVariables(r);if(!n||1!==n.identifiers.length||n.identifiers[0]!==r.id)return!1;let o=n.references.filter(e=>!e.init);return 0!==o.length&&o.every(e=>{let{identifier:r}=e;return e.isRead()&&(tT(r,t)||tw(r))})}(t,e)))return;let n=t.callee.property,o=r&&rt(e,[eY(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:uP,data:{method:n.name},suggest:o?void 0:[{messageId:uL,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=eY(t,e);yield o.removeRange([i[1],a.getRange(t.parent)[1]]),"!="!==t.parent.operator&&"!=="!==t.parent.operator&&(yield o.insertTextBeforeRange(i,"!"))}}]}}),e.on("BinaryExpression",t=>{let{left:r,right:n,operator:o}=t;if(!(td(r,{methods:["findIndex","findLastIndex"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&(["!==","!=",">","===","=="].includes(o)&&"UnaryExpression"===n.type&&"-"===n.operator&&n.argument&&"Literal"===n.argument.type&&1===n.argument.value||[">=","<"].includes(o)&&e0(n,0)))||rQ(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:uP,data:{method:a.name},*fix(n,{abort:i}){let{sourceCode:s}=e,l=s.getTokenAfter(r,e=>"Punctuator"===e.type&&e.value===o),[u]=s.getRange(l),[,p]=s.getRange(t);if(rt(e,[u,p]))return i();["===","==","<"].includes(o)&&(yield n.insertTextBefore(t,"!")),yield n.replaceText(a,"some"),yield n.removeRange([u,p])}}}),e.on("BinaryExpression",t=>{if(!((">"===t.operator||"!=="===t.operator)&&"Literal"===t.right.type&&"0"===t.right.raw&&tc(t.left,{property:"length",optional:!1})&&td(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if(rQ(n,e)||"Identifier"===n.type&&n.name.startsWith("$"))return;let[o]=r.arguments;if(!o||nM(o))return;let a=r.callee.property;return{node:a,messageId:u$,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(rt(e,[eY(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield o5(n,s,e),yield n.removeRange([eY(s,e)[1],i.getRange(t)[1]])}}})}),meta:{type:"suggestion",docs:{description:"Prefer `.some(…)` over `.filter(…).length` check and `.{find,findLast,findIndex,findLastIndex}(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[uP]:"Prefer `.some(…)` over `.{{method}}(…)`.",[uL]:"Replace `.{{method}}(…)` with `.some(…)`.",[u$]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},uM=(e,t,r=!0)=>({node:e,messageId:`error/${e.name}`,...r&&{suggest:[{messageId:`suggestion/${t}`,fix:r=>r.replaceText(e,t)}]}}),uO=new Set(["+","-","*","/","%","**","&","|","^","<<",">>",">>>"]),uU=new Set(["+","-","~"]),uq="preferDefaultParameters",uW="preferDefaultParametersSuggest",u_=new Set(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),uV=(e,t)=>{if(!t)return!1;if(u_.has(t.type))return!0;for(let r of e.visitorKeys[t.type]){let n=t[r];if(Array.isArray(n)){for(let t of n)if(uV(e,t))return!0}else if(uV(e,n))return!0}return!1},uz="prefer-logical-operator-over-ternary/error",uK="prefer-logical-operator-over-ternary/optional-chain-error",uG="prefer-logical-operator-over-ternary/suggestion",uJ="prefer-logical-operator-over-ternary/optional-chain-suggestion",uX=new Set(["==","==="]),uH=new Set(["!=","!=="]);function uY(e,t,r){if(t0(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return uY(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&uY(e.left,t.left,r)&&uY(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&uY(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function uQ({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:uz}:{node:t,messageId:uz,suggest:o.map(o=>({messageId:uG,data:{operator:o},fix:a=>(function({fixer:e,context:t,conditionalExpression:r,left:n,right:o,operator:a}){let{sourceCode:i}=t,s=[n,o].map((e,r)=>{let n=eZ(e,t),o=n?eQ(e,t):i.getText(e);return!n&&ox(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return nQ(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function uZ(e){return e9(e)?"null":tb(e)?"undefined":void 0}function u0(e){if("BinaryExpression"!==e.type||!uX.has(e.operator)&&!uH.has(e.operator))return;let t=uZ(e.left),r=uZ(e.right);if(!!t==!!r)return;let n=uX.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let u1=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,u2="with-name",u3="without-name",u8="regexp-exec",u6="string-match",u9="string-search",u5="suggestion",u4="string",u7="regexp",pe="other",pt="string-or-other",pr="regexp-or-other",pn="unknown";function*po(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);e$(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!e$(t,a)&&og(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let pa=[{type:u8,test:e=>td(e,{method:"exec",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.arguments[0],methodNode:e.callee.property,regexpNode:e.callee.object}),*fix(e,{methodNode:t}){yield e.replaceText(t,"test")}},{type:u6,test:e=>td(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:po},{type:u9,test:e=>td(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:po}],pi=e=>e6(e)||te(e,{name:"RegExp"}),ps=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},pl=e=>{if(e.includes(pn))return pn;let t=new Set(e),r=t.has(u4)||t.has(pt),n=t.has(u7)||t.has(pr);if(r&&n)return pt;let o=t.has(pe)||t.has(pt)||t.has(pr);return r?o?pt:u4:n?o?pr:u7:pe},pu=e=>{let t=new Set(e);return t.has(pn)?pn:t.has(u7)?u7:t.has(u4)?u4:pe},pp=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),pc=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return pc(e.typeAnnotation);case"TSStringKeyword":return u4;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?u4:pe;case"TSTypeReference":if("Identifier"!==e.typeName.type)return pn;if("String"===e.typeName.name)return u4;if("RegExp"===e.typeName.name)return u7;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return pe;return pn;case"TSUnionType":return pl(e.types.map(e=>pc(e)));case"TSIntersectionType":return pu(e.types.map(e=>pc(e)));default:return pp.has(e?.type)?pe:pn}},pd=(e,t)=>{let r,n;if(r=e,rS.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),rS.has(n.intrinsicName)))return pn;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?pd(r,t):pn}return e.isUnion()?pl(e.types.map(e=>pd(e,t))):e.isIntersection()?pu(e.types.map(e=>pd(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?u4:"RegExp"===rv(e)?.getName()||rA(e,t).some(e=>pd(e,t)===u7)?u7:pe},pm=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function pf(e,t,r=new Set){let n;if(pi(e))return u7;if(nR(e,t))return u4;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=ei(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return pn;r.add(o);let[a]=o.defs,i=pc(a.name?.typeAnnotation),s=pn;return i!==pn?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=pf(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==pn)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=pc(e.typeAnnotation);return n===pn?pf(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return pf(e.expression,t,r);case"SequenceExpression":return pf(e.expressions.at(-1),t,r);case"ConditionalExpression":return pl([pf(e.consequent,t,r),pf(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=ew(e,o))?"string"==typeof n.value?u4:ps(n.value)?u7:void 0===n.value&&("Identifier"===e.type&&"undefined"===e.name||"UnaryExpression"===e.type&&"void"===e.operator)||null===n.value||["bigint","boolean","number","symbol"].includes(typeof n.value)?pe:pn:pn;return a!==pn?a:pm.has(e.type)?pe:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return pn;try{let{program:t}=r;return pd(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return pn}})(e,t)}let pg=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tS(e.parent)||tA(e.parent,t)&&e.parent.arguments[0]===e){e=e.parent;continue}break}return e})(e,t)).parent.type&&"!"===r.parent.operator&&r.parent.argument===r},py=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),ph=(e,t,r)=>[eY(t,r)[1],r.sourceCode.getRange(e.node)[1]],px=e=>[{messageId:u5,fix:e}],pb=e=>[u7,pr,pe].includes(e),pE=e=>[u4,pt,pe].includes(e),pS=({type:e,stringType:t,regexpType:r})=>e===u8?pE(r)||pb(t):pb(t)||pE(r),pD=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[eY(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([eY(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!py(r.sourceCode,e))&&(e.suggest=px(t));return}if(!o||!py(r.sourceCode,ph(o,a,r))){if((({searchCheck:e,isRegExp:t,staticRegExp:r})=>t||r?.global===!1&&(!e||!1===r.sticky))({searchCheck:o,isRegExp:i,staticRegExp:s})){e.fix=t;return}e.suggest=px(t)}},pv={create:oc(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tc(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(pg(o,t))return;if(tT(o,t)||tw(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&e0(a.right,0)&&!pg(a,t)&&(tT(a,t)||tw(a)))return{lengthNode:n,node:a,comparisonLeftNode:o}})(t,e),n=(e=>{let{parent:t}=e;if(t?.type!=="BinaryExpression"||t.left!==e)return;let{operator:r,right:n}=t;return["!==","!=",">"].includes(r)&&tm(n)||">="===r&&e0(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tm(n)||"<"===r&&e0(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tT(t,e)||tw(t))for(let{type:o,test:a,getNodes:i,fix:s}of pa){if(o===u9!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=ew(p,c),m=d?ps(d.value):void 0,f=pi(p);if(pS({type:o,stringType:pf(l.stringNode,e),regexpType:pf(p,e)}))continue;let g={node:o===u8?u:t,messageId:o};pD(g,function*(o){for(let a of(r?(yield o5(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([eY(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(ph(n,t,e))),s(o,l,e)))yield a},e,{lengthCheck:r,searchCheck:n,callExpression:t,isRegExp:f,staticRegExp:m}),yield g}})}),meta:{type:"suggestion",docs:{description:"Prefer `RegExp#test()` over `String#match()`, `String#search()`, and `RegExp#exec()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[u8]:"Prefer `.test(…)` over `.exec(…)`.",[u6]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[u9]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[u5]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},pC="error",pA="suggestion",pT=0x100000000-1,pw=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],pk=["slice","concat"],pI=e=>td(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e,pj=new Set(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),pF=(e,t,r=new Set)=>"ArrayExpression"===e.type||tt(e,{name:"Array",optional:!1})||td(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||td(e,{methods:pw,optionalCall:!1,optionalMember:!1})||td(e,{methods:pk,optionalCall:!1,optionalMember:!1})&&void 0===e3(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new Set)=>{if("Identifier"!==e.type)return!1;let n=ei(t,e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs;return"Variable"===o.type&&"const"===o.kind&&!!o.node.init&&pF(o.node.init,t,r)})(e.callee.object,t,r)),pB=e=>Number.isSafeInteger(e)&&e>=0&&e<=pT,pR=e=>e.some(e=>e?.type==="SpreadElement"),pP=(e,t,r)=>e.getCommentsInside(t).some(t=>{let n,o;return n=e.getRange(t),o=e.getRange(r),!(n[0]>=o[0])||!(n[1]<=o[1])}),pL=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,p$=e=>{let{parent:t}=e;if(!("MemberExpression"===t.type&&t.object===e&&!t.computed&&!t.optional&&"Identifier"===t.property.type&&"length"===t.property.name)||(e=>{let t,r=e;for(;pL(r.parent,r);)r=r.parent;return nr(r)||("ForInStatement"===(t=r).parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t})(t))return!1;let r=t.parent;return"CallExpression"!==r.type||r.callee!==t},pN=e=>{let t,r;return"ForOfStatement"===e.parent.type&&e.parent.right===e||(e=>{let{parent:t}=e;return"SpreadElement"===t.type&&t.argument===e&&["ArrayExpression","CallExpression","NewExpression"].includes(t.parent.type)})(e)||td(t=e.parent.parent,{method:"forEach",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e&&"ArrowFunctionExpression"===(r=t.arguments[0]).type&&1===r.params.length&&"RestElement"!==r.params[0].type},pM={create:e=>{let{minimumItems:t}=e.options[0],{sourceCode:r}=e;e.on("Identifier",n=>{let o,{parent:a}=n;if(!((e,t)=>{let{parent:r}=e;return"VariableDeclarator"===r.type&&r.id===e&&!!r.init&&"VariableDeclaration"===r.parent.type&&("ExportNamedDeclaration"!==r.parent.parent.type||r.parent.parent.declaration!==r.parent)&&pF(r.init,t.getScope(r.init))})(n,r))return;if(t>0){var i,s;let e=(i=a.init,s=r.getScope(a.init),"ArrayExpression"===i.type?pR(i.elements)?void 0:i.elements.length:tt(i,{name:"Array",optional:!1})?((e,t)=>{if(pR(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=ew(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:pB(n)?n:void 0})(i,s):td(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?pR(i.arguments)?void 0:i.arguments.length:td(i,{object:"Array",method:"from",optionalCall:!1,optionalMember:!1})?((e,t)=>{let[r]=e.arguments;if(r&&"SpreadElement"!==r.type){if("ArrayExpression"===r.type)return pR(r.elements)?void 0:r.elements.length;if(void 0!==e3(r)){let e=ew(r,t);return"string"==typeof e?.value?[...e.value].length:void 0}return((e,t)=>{if("ObjectExpression"!==e.type||1!==e.properties.length)return;let[r]=e.properties;if((e=>{if("Property"!==e.type||e.computed)return!1;let{key:t}=e;return"Identifier"===t.type&&"length"===t.name||"Literal"===t.type&&"length"===t.value})(r)){let e=ew(r.value,t);return pB(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=ei(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(pI(o)){t.push(o);continue}if(p$(o)){r.push(o),n.push(o);continue}if(pN(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(rd(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!pR(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=ew(t,e.sourceCode.getScope(t)))&&t1(r.value)&&!Object.is(r.value,-0)}))||0!==t8(o.elements,e).length)||1===u.includes.length&&!((e,t)=>{let r=t.parent.parent.parent,{parent:n}=e.parent;for(;n&&n!==r;){if(pj.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:pC,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(pP(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(pP(t,e,e.typeAnnotation.elementType))return;return`ReadonlySet<${t.getText(e.typeAnnotation.elementType)}>`}if("TSTypeReference"!==e.type||"Identifier"!==e.typeName.type)return;let r=e.typeArguments??e.typeParameters;if(r?.params.length===1&&!pP(t,e,r)){if("Array"===e.typeName.name)return`Set${t.getText(r)}`;if("ReadonlyArray"===e.typeName.name)return`ReadonlySet${t.getText(r)}`}})(n.typeAnnotation.typeAnnotation,r),d=function*(e){for(let t of(c&&(yield e.replaceText(n.typeAnnotation.typeAnnotation,c)),yield e.insertTextBefore(n.parent.init,"new Set("),yield e.insertTextAfter(n.parent.init,")"),u.includes))yield e.replaceText(t.parent.property,"has");for(let t of u.lengths)yield e.replaceText(t.parent.property,"size")};return n.typeAnnotation&&!c?p.suggest=[{messageId:pA,fix:d}]:p.fix=d,p})},meta:{type:"suggestion",docs:{description:"Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",additionalProperties:!1,properties:{minimumItems:{type:"integer",minimum:0,description:"The minimum known array size before `Set#has()` is enforced."}}}],defaultOptions:[{minimumItems:0}],messages:{[pC]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[pA]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},pO=e=>td(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&e7(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1}),pU="prefer-string-raw",pq="unnecessary-string-raw";function pW(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let p_="prefer-switch",pV=(e,t)=>e===t||t0(e,t),pz=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tb(e))),pK=new Set(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),pG=e=>{for(;e.parent;e=e.parent)if(pK.has(e.type))return e},pJ=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},pX={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new Set,o=[],a=new Set;e.on("IfStatement",e=>{n.add(e)}),e.on("BreakStatement",e=>{e.label||o.push(e)}),e.on("Program:exit",function*(){for(let i of n){if(a.has(i))continue;let{discriminant:n,ifStatements:s}=function(e){let t,r=[];for(;e&&"IfStatement"===e.type;e=e.alternate){let{test:n}=e,o=function(e){let t=[e],r=[];for(;t.length>0;){if("LogicalExpression"===(e=t.pop()).type&&"||"===e.operator){t.push(e.right,e.left);continue}if("BinaryExpression"!==e.type||"==="!==e.operator)return[];r.push(e)}return r}(n);if(0===o.length)break;t||=pz(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>pV(e,r)||pV(e,n))).length)break;return t}(o,t);if(0===a.length)break;t=a,r.push({statement:e,compareExpressions:o})}return{ifStatements:r,discriminant:t&&t[0]}}(i);if(!n||s.length<t.minimumCases)continue;for(let{statement:e}of s)a.add(e);let l={loc:{start:r.getLoc(i).start,end:r.getLoc(i.consequent).start},messageId:p_};!eL(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!pJ(n,t,r))continue;let e=pG(n);if(!e||pJ(t,e,r))return!0}return!1}(o,t,e))&&(l.fix=function({discriminant:e,ifStatements:t},r,n){let{sourceCode:o}=r,a=o.getText(e);return function*(i){let s=t[0].statement,l=t6(s,r);yield i.insertTextBefore(s,`switch (${a}) {`);let u=t.at(-1).statement;if(u.alternate){let{alternate:e}=u;yield i.insertTextBefore(e,`
6
6
  ${l}default: `)}else switch(n.emptyDefaultCase){case"no-default-comment":yield i.insertTextAfter(s,`
7
7
  ${l}// No default`);break;case"do-nothing-comment":yield i.insertTextAfter(s,`
8
8
  ${l}default:
9
9
  ${l}// Do nothing`)}for(let{statement:r,compareExpressions:n}of(yield i.insertTextAfter(s,`
10
- ${l}}`),t)){let{consequent:t,alternate:a}=r;if(a){let[,e]=o.getRange(t),[r]=o.getRange(a);yield i.removeRange([e,r])}let s=[o.getRange(r)[0],o.getRange(t)[0]];for(let{left:r,right:a}of(yield i.removeRange(s),n)){let n=py(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
10
+ ${l}}`),t)){let{consequent:t,alternate:a}=r;if(a){let[,e]=o.getRange(t),[r]=o.getRange(a);yield i.removeRange([e,r])}let s=[o.getRange(r)[0],o.getRange(t)[0]];for(let{left:r,right:a}of(yield i.removeRange(s),n)){let n=pV(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
11
11
  ${l}case ${s}: `)}(function e(t){switch(t.type){case"ReturnStatement":case"ThrowStatement":return!1;case"IfStatement":return!t.alternate||e(t.consequent)||e(t.alternate);case"BlockStatement":{let r=function e(t){let{body:r}=t;for(let t=r.length-1;t>=0;t--){let n=r[t];if("FunctionDeclaration"!==n.type&&"EmptyStatement"!==n.type){if("BlockStatement"===n.type){let t=e(n);if(t)return t;continue}return n}}}(t);return!r||e(r)}default:return!0}})(t)&&(yield function*(e,t,r,n){if("BlockStatement"===e.type){let o=r.getLastToken(e);yield t.insertTextBefore(o,`
12
12
  ${n}break;
13
13
  ${n}`)}else yield t.insertTextAfter(e,`
14
14
  ${n}break;`)}(t,i,o,l),yield function*(e,t,r){e&&"BlockStatement"!==e.type&&(yield t.insertTextBefore(e,`{
15
15
  ${r}`),yield t.insertTextAfter(e,`
16
- ${r}}`))}(t,i,l))}}}({discriminant:n,ifStatements:s},e,t)),yield l}})},meta:{type:"suggestion",docs:{description:"Prefer `switch` over multiple `else-if`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{minimumCases:{type:"integer",minimum:2,description:"The minimum number of `if`/`else if` cases before suggesting a `switch` statement."},emptyDefaultCase:{enum:["no-default-comment","do-nothing-comment","no-default-case"],description:"How to handle an empty `default` case."}}}],defaultOptions:[{minimumCases:3,emptyDefaultCase:"no-default-comment"}],messages:{[pg]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},pS="require-number-to-fixed-digits-argument";function pv(e){let t=e.match(/^[ \t]*(?=\S)/gm);if(!t)return e;let r=1/0;for(let e of t)r=Math.min(r,e.length);return 0===r||r===1/0?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}let pC=/^(?:( )+|\t+)/,pA="space";function pT(e,t){let r,n,o=new Map,a=0;for(let i of e.split(/\n/g)){if(!i)continue;let e=i.match(pC);if(null===e)a=0,r="";else{let i=e[0].length,s=e[1]?pA:"tab";if(t&&s===pA&&1===i)continue;s!==r&&(a=0),r=s;let l=1,u=0,p=i-a;if(a=i,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===pA&&1===e)continue;n=(s===pA?"s":"t")+String(e)}let c=o.get(n);o.set(n,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return o}function pw(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=pT(e,!0);0===r.size&&(r=pT(e,!1));let n=function(e){let t,r=0,n=0;for(let[o,[a,i]]of e)(a>r||a===r&&i>n)&&(r=a,n=i,t=o);return t}(r),o=0,a="";if(void 0!==n){var i,s;({type:t,amount:o}={type:"s"===n[0]?pA:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===pA?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let pk="template-indent",pI=(e,t=new Set)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),pj=[{type:"object",additionalProperties:!1,properties:{indent:{oneOf:[{type:"string",pattern:/^\s+$/.source,description:"Whitespace string to use as indentation."},{type:"integer",minimum:1,description:"Number of spaces to use as indentation."}],description:"The indentation to use inside the template literal."},tags:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Tagged template names to check."},functions:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Function names whose template literal arguments to check."},selectors:{type:"array",uniqueItems:!0,items:{type:"string"},description:"AST selectors for template literals to check."},comments:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Comment patterns to mark template literals for checking."}}}],pF="no-await-in-promise-methods/error",pB="no-await-in-promise-methods/suggestion",p$=["all","allSettled","any","race"],pR="no-negation-in-equality-check/error",pP="no-negation-in-equality-check/suggestion",pL=new Set(["===","!==","==","!="]),pN=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function pM(e,{methods:t,messageId:r}){e.on("CallExpression",n=>{if(!td(n,{methods:t,argumentsLength:2,optionalCall:!1}))return;let o=n.arguments[1],a=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tc(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tc(e,{property:"length",computed:!1})&&tQ(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(o,n.callee.object);if(!a)return;let i=n.callee.property.name,s={description:a};return"splice"===i?s.argumentName="deleteCount":"toSpliced"===i&&(s.argumentName="skipCount"),{node:o,messageId:r,data:s,fix:t=>ow(t,o,e)}})}let pO="no-unnecessary-slice-end",pq="catch-error-name",pU={create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>c.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(on(r));e.on("Identifier",t=>{if(("CatchClause"!==t.parent.type||t.parent.param!==t)&&!(("FunctionExpression"===t.parent.type||"ArrowFunctionExpression"===t.parent.type)&&t.parent.params[0]===t&&(td(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||td(t.parent.parent,{method:"catch",argumentsLength:1,optionalCall:!1}))&&t.parent.parent.arguments.at(-1)===t.parent))return;let n=t.name;if(o(n)||o(n.replaceAll(/_+$/g,"")))return;let a=ei(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=tG(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:pq,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>oU(a,i,e,t)),s})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",uniqueItems:!0,description:"Patterns to ignore."}}}],defaultOptions:[{name:"error",ignore:[]}],messages:{[pq]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},pW="invalidExport",p_="doNotPassMessageToSuper",pV="doNotAssignMessageWithoutSetter",pz="missingOptionsParameter",pK="invalidOptionsParameter",pG="passMessageToSuper",pJ="passOptionsToSuper",pX=/^(?:[A-Z][\da-z]*)*Error$/,pY=e=>`
16
+ ${r}}`))}(t,i,l))}}}({discriminant:n,ifStatements:s},e,t)),yield l}})},meta:{type:"suggestion",docs:{description:"Prefer `switch` over multiple `else-if`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{minimumCases:{type:"integer",minimum:2,description:"The minimum number of `if`/`else if` cases before suggesting a `switch` statement."},emptyDefaultCase:{enum:["no-default-comment","do-nothing-comment","no-default-case"],description:"How to handle an empty `default` case."}}}],defaultOptions:[{minimumCases:3,emptyDefaultCase:"no-default-comment"}],messages:{[p_]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},pH="require-number-to-fixed-digits-argument";function pY(e){let t=e.match(/^[ \t]*(?=\S)/gm);if(!t)return e;let r=1/0;for(let e of t)r=Math.min(r,e.length);return 0===r||r===1/0?e:e.replace(RegExp(`^[ \\t]{${r}}`,"gm"),"")}let pQ=/^(?:( )+|\t+)/,pZ="space";function p0(e,t){let r,n,o=new Map,a=0;for(let i of e.split(/\n/g)){if(!i)continue;let e=i.match(pQ);if(null===e)a=0,r="";else{let i=e[0].length,s=e[1]?pZ:"tab";if(t&&s===pZ&&1===i)continue;s!==r&&(a=0),r=s;let l=1,u=0,p=i-a;if(a=i,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===pZ&&1===e)continue;n=(s===pZ?"s":"t")+String(e)}let c=o.get(n);o.set(n,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return o}function p1(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=p0(e,!0);0===r.size&&(r=p0(e,!1));let n=function(e){let t,r=0,n=0;for(let[o,[a,i]]of e)(a>r||a===r&&i>n)&&(r=a,n=i,t=o);return t}(r),o=0,a="";if(void 0!==n){var i,s;({type:t,amount:o}={type:"s"===n[0]?pZ:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===pZ?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let p2="template-indent",p3=(e,t=new Set)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),p8=[{type:"object",additionalProperties:!1,properties:{indent:{oneOf:[{type:"string",pattern:/^\s+$/.source,description:"Whitespace string to use as indentation."},{type:"integer",minimum:1,description:"Number of spaces to use as indentation."}],description:"The indentation to use inside the template literal."},tags:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Tagged template names to check."},functions:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Function names whose template literal arguments to check."},selectors:{type:"array",uniqueItems:!0,items:{type:"string"},description:"AST selectors for template literals to check."},comments:{type:"array",uniqueItems:!0,items:{type:"string"},description:"Comment patterns to mark template literals for checking."}}}],p6="no-await-in-promise-methods/error",p9="no-await-in-promise-methods/suggestion",p5=["all","allSettled","any","race"],p4="no-negation-in-equality-check/error",p7="no-negation-in-equality-check/suggestion",ce=new Set(["===","!==","==","!="]),ct=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function cr(e,{methods:t,messageId:r}){e.on("CallExpression",n=>{if(!td(n,{methods:t,argumentsLength:2,optionalCall:!1}))return;let o=n.arguments[1],a=function(e,t){if("Identifier"===e.type&&"Infinity"===e.name)return"Infinity";if(tc(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tc(e,{property:"length",computed:!1})&&t0(t,e.object))return`${"Identifier"===t.type?t.name:"…"}${r?"?.":"."}length`}(o,n.callee.object);if(!a)return;let i=n.callee.property.name,s={description:a};return"splice"===i?s.argumentName="deleteCount":"toSpliced"===i&&(s.argumentName="skipCount"),{node:o,messageId:r,data:s,fix:t=>oY(t,o,e)}})}let cn="no-unnecessary-slice-end",co="catch-error-name",ca={create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>c.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(ow(r));e.on("Identifier",t=>{if(("CatchClause"!==t.parent.type||t.parent.param!==t)&&!(("FunctionExpression"===t.parent.type||"ArrowFunctionExpression"===t.parent.type)&&t.parent.params[0]===t&&(td(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||td(t.parent.parent,{method:"catch",argumentsLength:1,optionalCall:!1}))&&t.parent.parent.arguments.at(-1)===t.parent))return;let n=t.name;if(o(n)||o(n.replaceAll(/_+$/g,"")))return;let a=ei(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=tJ(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:co,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>at(a,i,e,t)),s})},meta:{type:"suggestion",docs:{description:"Enforce a specific parameter name in catch clauses.",recommended:!0},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"The expected name for the error variable."},ignore:{type:"array",uniqueItems:!0,description:"Patterns to ignore."}}}],defaultOptions:[{name:"error",ignore:[]}],messages:{[co]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},ci="invalidExport",cs="doNotPassMessageToSuper",cl="doNotAssignMessageWithoutSetter",cu="missingOptionsParameter",cp="invalidOptionsParameter",cc="passMessageToSuper",cd="passOptionsToSuper",cm=/^(?:[A-Z][\da-z]*)*Error$/,cf=e=>`
17
17
  name = '${e}';
18
- `,pH=e=>{var t;let r=(t=e.superClass,t?.type==="Identifier"?t.name:t?.type!=="MemberExpression"||t.computed||"Identifier"!==t.property.type?void 0:t.property.name);return!!r&&pX.test(r)},pZ=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&tg(e.expression.callee,"super"),pQ=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&tg(e.expression.left,`this.${t}`),p0=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),p1=(e,t)=>e?.value&&e.value.value===t,p2=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,p3=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,p8=e=>p3(e)?.name==="options",p6=(e,t)=>{if("ThisExpression"===e.type||"Super"===e.type)return!0;for(let r of t[e.type]??[]){let n=e[r];if(n){if(Array.isArray(n)){if(n.some(e=>e&&p6(e,t)))return!0;continue}if(p6(n,t))return!0}}return!1},p9=e=>{let t=p3(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},p5=(e,t,r)=>n=>{let o=t.arguments;if(0===o.length){let o=e.getTokenAfter(t.callee,e=>"("===e.value);return n.insertTextAfter(o,`${r}, options`)}if(1===o.length){let e;return"undefined"!==r&&(!(e=o[0])||tx(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},p4=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*p7(e,t){if(!pH(t)||null===t.id)return;let{name:r}=t.id,n=on(r).replace(/(?:error)?$/i,"Error");r!==n&&(yield{node:t.id,message:`Invalid class name, use \`${n}\`.`});let{body:o}=t.body,{sourceCode:a}=e,i=o.find(e=>"constructor"===e.kind),s=o.find(e=>"PropertyDefinition"===e.type&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"name"===e.key.name);if(!i){if(p1(s,r))return;let e=a.getRange(t.body);yield{...p0(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,pY(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],pY(r))};return}let l=o.some(e=>p2(e,"get")),u=o.some(e=>p2(e,"set"));yield*function*(e,t,r){let{sourceCode:n}=e,o=t.value.body;if(!o)return;let a=o.body,{hasMessageGetter:i,hasMessageSetter:s,checkOptions:l}=r,u=a.find(e=>pZ(e)),p=a.findIndex(e=>pZ(e)),c=a.findIndex(e=>pQ(e,"message")),d=i||s,m=!1;if(u){let r;if(d&&!(!(r=u.expression.arguments[0])||tx(r)))m=!0,yield{node:u,messageId:p_};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:pV};else if(!s&&-1!==c){let r=a[c];m=!0,yield{node:u,message:"Pass the error message to `super()` instead of setting `this.message`.",*fix(i){let s=r.expression.right,[l,d]=t.value.params,m=p3(l),f=1===t.value.params.length&&m&&!p8(l),g=f||p8(d);if(0===u.expression.arguments.length){if(c!==p+1||p6(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${eZ(s,e)}, options`:eZ(s,e))}else{let e;if(e=u.expression.arguments[0],n.getText(e)!==n.getText(s))return;g&&1===u.expression.arguments.length&&(yield i.insertTextAfter(u.expression.arguments[0],", options"))}f&&(yield i.insertTextAfter(l,`, ${p9(l)}`));let y=0===c?n.getRange(o)[0]:n.getRange(a[c-1])[1],[,h]=n.getRange(r);yield i.removeRange([y,h])}}}}else m=!0,yield{node:o,message:"Missing call to `super()` in constructor."};let f=function(e,t,r){let{name:n,nameProperty:o}=r,a=t.find(e=>pQ(e,"name"));return a?"Literal"!==a.expression.right.type||a.expression.right.value!==n?p0(a.expression.right??e,n):void 0:p1(o,n)?void 0:p0(o?.value??e,n)}(o,a,r);if(f&&(yield f),!f&&l&&!m){let r=((e,t,r,n)=>{let o=t.value.params,a=o[0],i=p3(a);if(0===o.length||!i)return;let s=r.expression;if(p8(a)){if(!p8(s.arguments[1])){let t={node:s,messageId:pJ};return p4(s.arguments[0],i)||(t.fix=p5(e.sourceCode,s,"undefined")),t}return}let l=o[1],u=!n&&"message"===i.name,p=u?i.name:"undefined";if(!l)return{node:a,messageId:pz,fix:function*(r){let{sourceCode:n}=e,o=p5(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${p9(a)}`),yield o}};if(!p8(l))return{node:l,messageId:pK};if(u&&!p4(s.arguments[0],i)){let t;return{node:s,messageId:pG,fix:(t=e.sourceCode,e=>{let r,n=s.arguments;if(0===n.length){let r=t.getTokenAfter(s.callee,e=>"("===e.value);return e.insertTextAfter(r,`${p}, options`)}if(!(r=n[0])||tx(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!p8(s.arguments[1]))return{node:s,messageId:pJ,fix:p5(e.sourceCode,s,p)}})(e,t,u,d);r&&(yield r)}}(e,i,{name:r,nameProperty:s,hasMessageGetter:l,hasMessageSetter:u,checkOptions:r===n})}let ce="no-lonely-if",ct=e=>"IfStatement"===e.type&&!e.alternate;function cr(e,t){let r={ifToken:t.getFirstToken(e),openingParenthesisToken:t.getFirstToken(e,1)},{consequent:n}=e;return r.closingParenthesisToken=t.getTokenBefore(n),"BlockStatement"===n.type&&(r.openingBraceToken=t.getFirstToken(n),r.closingBraceToken=t.getLastToken(n)),r}let cn=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),co=e=>e.trim()?e:"",ca=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,ci=(e,t)=>cn(e.ifToken,e.openingParenthesisToken,t),cs=(e,t,r)=>{let n,o=cn(e.openingParenthesisToken,e.closingParenthesisToken,r);return eQ(e.test,t)?o:"LogicalExpression"===(n=e.test).type&&("||"===n.operator||"??"===n.operator)||"ConditionalExpression"===n.type||"AssignmentExpression"===n.type||"YieldExpression"===n.type||"SequenceExpression"===n.type?`(${o})`:o},cl="no-magic-array-flat-depth",cu="no-negated-condition",cp="identifier",cc="non-identifier",cd="prefer-negative-index",cm=new Map([["slice",{argumentsIndexes:[0,1],supportObjects:new Set(["Array","String","ArrayBuffer",...rb])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new Set(rb)}],["splice",{argumentsIndexes:[0],supportObjects:new Set(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new Set(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new Set(["Array","String",...rb])}]]),cf=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var cg=["node:assert","assert","node:assert/strict","assert/strict","node:async_hooks","async_hooks","node:buffer","buffer","node:child_process","child_process","node:cluster","cluster","node:console","console","node:constants","constants","node:crypto","crypto","node:dgram","dgram","node:diagnostics_channel","diagnostics_channel","node:dns","dns","node:dns/promises","dns/promises","node:domain","domain","node:events","events","node:ffi","node:fs","fs","node:fs/promises","fs/promises","node:http","http","node:http2","http2","node:https","https","node:inspector","inspector","node:inspector/promises","inspector/promises","node:module","module","node:net","net","node:os","os","node:path","path","node:path/posix","path/posix","node:path/win32","path/win32","node:perf_hooks","perf_hooks","node:process","process","node:querystring","querystring","node:quic","node:readline","readline","node:readline/promises","readline/promises","node:repl","repl","node:sea","node:sqlite","node:stream","stream","node:stream/consumers","stream/consumers","node:stream/iter","stream/iter","node:stream/promises","stream/promises","node:stream/web","stream/web","node:string_decoder","string_decoder","node:test","node:test/reporters","node:timers","timers","node:timers/promises","timers/promises","node:tls","tls","node:trace_events","trace_events","node:tty","tty","node:url","url","node:util","util","node:util/types","util/types","node:v8","v8","node:vm","vm","node:wasi","wasi","node:worker_threads","worker_threads","node:zlib","zlib","node:zlib/iter","zlib/iter"];function cy(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new Set(cg)).has(t)}let ch="prefer-node-protocol",cx="node:",cb="consistent-date-clone/error",cE="no-accessor-recursion/error",cD=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,cS=(e,t)=>["type","name"].every(r=>e[r]===t[r]),cv=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&cD(e.parent.property)&&cS(e.parent.property,t.key),cC="error/calculate-dirname",cA="error/calculate-filename";function cT(e,{modules:t,functionName:r,sourceCode:n}){if(!e7(e,{optional:!1,argumentsLength:1}))return!1;let o=new Set;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tc(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&td(t,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalMember:!1,optionalCall:!1})&&a(t.arguments[0]);if("Identifier"!==t.type||o.has(t))return!1;o.add(t);let s=ei(n.getScope(t),t);return!!s&&1===s.defs.length&&function(t,n){if("ImportBinding"===t.type){if(!a(t.parent.source))return!1;let e=t.node;return"module"===n?e?.type==="ImportDefaultSpecifier"||e?.type==="ImportNamespaceSpecifier":e?.type==="ImportSpecifier"&&e.imported.name===r}return"Variable"===t.type&&function t(n,o){let{parent:a}=n;return"VariableDeclarator"===a.type?!!a.init&&a.id===n&&"VariableDeclaration"===a.parent.type&&"const"===a.parent.kind&&e(a.init,o):"Property"===a.type&&!!("property"===o&&a.value===n&&!a.computed&&"Identifier"===a.key.type&&a.key.name===r)&&t(a.parent,"module")}(t.name,n)}(s.defs[0],i)}(e.callee,"property");function a(e){return e?.type==="Literal"&&t.has(e.value)}}function cw(e,t){return cT(e,{modules:new Set(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function ck(e,t){return cT(e,{modules:new Set(["path","node:path"]),functionName:"dirname",sourceCode:t})}let cI="no-unnecessary-array-flat-depth",cj="no-unnecessary-array-splice-count",cF="no-useless-error-capture-stack-trace/error",cB="prefer-class-fields/error",c$="prefer-class-fields/suggestion",cR="prefer-bigint-literals/error",cP="prefer-bigint-literals/suggestion",cL="prefer-classlist-toggle/error",cN="prefer-classlist-toggle/suggestion",cM=e=>tc(e,{property:"classList",computed:!1}),cO=(e,t,r)=>{let n={node:r??e,messageId:cL};return"IfStatement"===e.type||ti(e)||ti(e.parent)?n.fix=t:n.suggest=[{messageId:cN,fix:t}],n},cq=(e,t,r)=>{let{sourceCode:n}=t,o=eZ(e,t);return r?(!eQ(e,n)&&n3(e,"!")&&(o=`(${o})`),o=`!${o}`):(eQ(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},cU=(e,t)=>td(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&cM(e.callee.object),cW=(e,t)=>tQ(e.callee.object,t.callee.object)&&tQ(e.arguments[0],t.arguments[0]),c_=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),cU(e,["contains"])&&cW(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?c_(e.argument,!t,r):void 0,cV="require-module-attributes",cz="error",cK="suggestion/array",cG="suggestion/object",cJ="suggestion/object-assign",cX="suggestion/set",cY="suggestion/map",cH=(e,t,r)=>{let{sourceCode:n}=r,o=rc(e);return t.some(e=>{let t=n.getRange(e);return o.some(e=>{let[r,o]=n.getRange(e);return r>=t[0]&&o<=t[1]})})};function cZ(e,t){if(!te(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*cQ(e,t,r){let n=!ep(t.sourceCode.getTokenBefore(e));yield oO(e,t,r,n)}function c0(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!eu(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*c1({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(tJ(r,e)){let[o]=r.arguments;if(o)yield c0(e,t,o,n);else{let{openingParenthesisToken:o}=tJ(r,e)?tX(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*cQ(o,e,t)}let c2=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(td(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!cH(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,i=e.callee,s=i.property,l={node:i,messageId:cz,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>eP(e,a))?l.suggest=[{messageId:cK,fix:p,data:{operation:u?"Prepend":"Append",assignType:n}}]:l.fix=p,l},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,isPrepend:o})=>function*(a){let i=tY(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):c0(e,a,t,i),yield cQ(r,e,a)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!("AssignmentExpression"===n.type&&"="===n.operator&&tc(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!cH(t,a.computed?[i,o]:[o],e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,{left:i,right:s}=e,{property:l}=i,u=a.getTokenAfter(i,t=>"Punctuator"===t.type&&t.value===e.operator),p={node:e,loc:{start:a.getLoc(e).start,end:a.getLoc(u).end},messageId:cz,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&eP(l,a)||eP(s,a)?p.suggest=[{messageId:cG,data:{assignType:n},fix:c}]:p.fix=c,p},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{memberExpression:n,property:o,value:a})=>function*(i){let s=eZ(o,e);n.computed&&(s=`[${s}]`);let l=eZ(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!eu(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield cQ(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!td(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let[o,a]=n.arguments;if(!("Identifier"!==o.type||o.name!==t.name||"SpreadElement"===a.type||cH(t,[a],e)))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,[,i]=e.arguments,s={node:e.callee,messageId:cz,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return eP(i,a)?s.suggest=[{messageId:cJ,data:{description:"ObjectExpression"===i.type?"Move properties to":"Spread properties in",assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,firstValue:o})=>function*(a){let i;("ObjectExpression"===o.type?o.properties.length>0&&(i=function(e,t){let{sourceCode:r}=t,n=r.getFirstToken(e),[o,a]=r.getLastTokens(e,2),[,i]=r.getRange(n),[s]=r.getRange(eu(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${eZ(o,e)}`,i&&(yield c0(e,a,t,i)),2!==n.arguments.length)?yield ow(a,o,e):yield cQ(r,e,a)}},{testValue:e=>cZ(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),td(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!cH(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:cz,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eP(e,i))?s.suggest=[{messageId:cX,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=tY(e,r,!1);return c1({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>cZ(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(td(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!cH(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:cz,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eP(e,i))?s.suggest=[{messageId:cY,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=tY(e,r,!1);return c1({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],c3="no-useless-collection-argument/error",c8="no-useless-collection-argument/suggestion",c6="prefer-response-static-json",c9=/([\p{Ll}\d])(\p{Lu})/gu,c5=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,c4=/(\d)\p{Ll}|(\p{L})\d/u,c7=/[^\p{L}\d]+/giu,de="$1\0$2";function dt(e){let t=e.trim();t=(t=t.replace(c9,de).replace(c5,de)).replace(c7,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function dr(e){let t=dt(e);for(let e=0;e<t.length;e++){let r=t[e],n=c4.exec(r);if(n){let o=n.index+(n[1]??n[2]).length;t.splice(e,1,r.slice(0,o),r.slice(o))}}return t}function dn(e,t){let[r,n,o]=dp(e,t);return r+n.map(ds(t?.locale)).join(t?.delimiter??" ")+o}function da(e,t){var r,n;let[o,a,i]=dp(e,t),s=ds(t?.locale),l=dl(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):du(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function di(e,t){let[r,n,o]=dp(e,t),a=du(ds(t?.locale),dl(t?.locale));return r+n.map(a).join("")+o}function ds(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function dl(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function du(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function dp(e,t={}){let r=t.split??(t.separateNumbers?dr:dt),n=t.prefixCharacters??"",o=t.suffixCharacters??"",a=0,i=e.length;for(;a<e.length;){let t=e.charAt(a);if(!n.includes(t))break;a++}for(;i>a;){let t=i-1,r=e.charAt(t);if(!o.includes(r))break;i=t}return[e.slice(0,a),r(e.slice(a,i)),e.slice(i)]}let dc="filename-case",dd="directory-case",dm="filename-extension",df=e=>!/^[\w-]$/.test(e),dg=new Set(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),dy=new Intl.ListFormat("en-US",{type:"disjunction"}),dh=/^[\da-z]+$/i,dx=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,db=e=>e>="0"&&e<="9",dE=e=>e>="a"&&e<="z",dD=e=>e>="A"&&e<="Z",dS={camelCase:{fn:da,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!dE(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(dE(r)||db(r))continue;if(!dD(r))return!1;let n=t;for(;dD(e[t+1]);)t++;if(t!==n){if(dE(e[t+1])){t--;continue}for(;db(e[t+1]);)t++;if(t===e.length-1)return!0;if(!dD(e[t+1]))return!1}}return!0}(e)?da(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return dn(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return dn(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(dh.test(e)){let t=dx.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&di(r)===r)return e}return di(e)},name:"pascal case"}};function dv(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function dC(e,t,{leading:r,trailing:n}){let{samples:o}=function(e,t=1/0){let r=e.reduce((e,{length:t})=>e*t,1),n=Array.from({length:Math.min(r,t)},(t,r)=>{let n=r,o=[];for(let t=e.length-1;t>=0;t--){let r=e[t],{length:a}=r,i=n%a;n=(n-i)/a,o.unshift(r[i])}return o});return{total:r,samples:n}}(e.map(({word:e,ignored:r})=>r?[e]:t.map(t=>t(e))));return[...new Set(o.map(e=>`${r}${e.join("")}${n}`))]}let dA=/^(?<leading>_+)(?<tailing>.*)$/;function dT(e){let t,{leading:r="",tailing:n=e}=(dA.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=df(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function dw(e){let t;return t=e.map(e=>dS[e].name),dy.format(t)}let dk=[{description:"The rule options.",anyOf:[{properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},ignore:{type:"array",uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1},{properties:{cases:{properties:{camelCase:{type:"boolean",description:"Whether to allow camelCase filenames and directory names."},camelCaseWithAcronyms:{type:"boolean",description:"Whether to allow camelCase filenames and directory names with acronym segments."},snakeCase:{type:"boolean",description:"Whether to allow snake_case filenames and directory names."},kebabCase:{type:"boolean",description:"Whether to allow kebab-case filenames and directory names."},pascalCase:{type:"boolean",description:"Whether to allow PascalCase filenames and directory names."}},additionalProperties:!1,description:"The allowed filename and directory name case styles."},ignore:{type:"array",uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1}]}],dI="consistent-template-literal-escape",dj="iterable-accepting",dF="for-of",dB="yield-star",d$="spread",dR="iterator-method",dP="iterable-accepting/suggestion",dL="iterator-method/suggestion",dN=["every","find","forEach","some"],dM="reduce",dO=e=>td(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),dq="prefer-simple-condition-first",dU="prefer-simple-condition-first/suggestion";function dW(e){return"Identifier"===e.type||"Literal"===e.type||"UnaryExpression"===e.type&&("-"===e.operator||"+"===e.operator)&&"Literal"===e.argument.type&&"number"==typeof e.argument.value}function d_(e){return"Identifier"===e.type||("UnaryExpression"===e.type&&"!"===e.operator?d_(e.argument):"BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)?dW(e.left)&&dW(e.right)&&("Identifier"===e.left.type||"Identifier"===e.right.type):"LogicalExpression"===e.type&&d_(e.left)&&d_(e.right))}let dV=new Set(["AssignmentExpression","UpdateExpression","TaggedTemplateExpression","AwaitExpression","YieldExpression","ImportExpression"]);function dz(e,t,{operator:r,property:n}){let o=eQ(e,t),a=o?eZ(e,t):t.sourceCode.getText(e);return!o&&n8(e,{operator:r,property:n})&&(a=`(${a})`),a}let dK="switch-case-break-position",dG=new Set(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),dJ="first-child",dX="first-element-child",dY="query-selector",dH="closest",dZ="merge-query-selector",dQ="suggestion-first-child",d0="suggestion-first-element-child",d1="suggestion-merge-query-selector",d2={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},d3=(e,t)=>tc(e,{property:t,optional:!1,computed:!1}),d8=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&e8(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,d6=(e,t)=>t.getCommentsInside(e).length>0,d9=(e,t,r,n)=>{let{sourceCode:o}=n;if(d6(e,o))return;let[,a]=eH(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},d5=e=>tc(e,{property:"parentElement",optional:!1,computed:!1}),d4=e=>void 0!==e3(e),d7=e=>td(e,d2),me=new Set(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),mt=new Set(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),mr=e=>{let t="";return"Variable"===e.type?t=e.node.init.arguments[0].value:"ImportBinding"===e.type&&(t=e.parent.source.value),!t.includes("node_modules")&&(t.startsWith(".")||t.startsWith("/"))},mn="consistent-compound-words/error",mo="consistent-compound-words/rename",{isIdentifierName:ma}=tL,mi={backGround:"background",callBack:"callback",checkBox:"checkbox",clipBoard:"clipboard",codeBase:"codebase",dataBase:"database",downLoad:"download",feedBack:"feedback",foreGround:"foreground",frameWork:"framework",headLine:"headline",keyBoard:"keyboard",keyFrame:"keyframe",lifeCycle:"lifecycle",metaData:"metadata",midPoint:"midpoint",nameSpace:"namespace",overRide:"override",passWord:"password",payLoad:"payload",placeHolder:"placeholder",preView:"preview",screenShot:"screenshot",sideBar:"sidebar",subClass:"subclass",subDirectory:"subdirectory",subDomain:"subdomain",subMenu:"submenu",subProcess:"subprocess",subString:"substring",subTree:"subtree",subType:"subtype",subTitle:"subtitle",timeOut:"timeout",timeStamp:"timestamp",toolBar:"toolbar",toolKit:"toolkit",toolTip:"tooltip",touchScreen:"touchscreen",unSubscribe:"unsubscribe",underScore:"underscore",upLoad:"upload",userName:"username",viewPort:"viewport",webCam:"webcam",webHook:"webhook",webSite:"website",weekEnd:"weekend",whiteSpace:"whitespace",wildCard:"wildcard",workFlow:"workflow",workSpace:"workspace"},ms=new Set(String.raw`\^$.*+?()[]{}|`),ml=e=>{let t="";for(let r of e)t+=ms.has(r)?`\\${r}`:r;return t},mu=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,mp=(e,{replacementRegExp:t,replacements:r,allowList:n})=>{if(!t||e===e.toUpperCase()||n.has(e))return;let o=e.replaceAll(t,e=>((e,t)=>{let r=t.get(e)??t.get(oo(e));if(r){let t;return(t=e[0])===t.toUpperCase()?on(r):oo(r)}})(e,r));if(o!==e)return o},mc=(e,t)=>({node:e,messageId:mn,data:{name:e.name,replacement:t}}),md={type:"array",additionalItems:!1,items:[{type:"object",additionalProperties:!1,properties:{checkProperties:{type:"boolean",description:"Whether to check property names."},checkVariables:{type:"boolean",description:"Whether to check variable names."},checkDefaultAndNamespaceImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check default and namespace import names."},checkShorthandImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check shorthand import names."},checkShorthandProperties:{type:"boolean",description:"Whether to check shorthand property names."},extendDefaultReplacements:{type:"boolean",description:"Whether to extend the default replacements."},replacements:{$ref:"#/definitions/replacements",description:"Custom compound word replacements."},allowList:{$ref:"#/definitions/trueObject",description:"Custom allow list of names."}}}],definitions:{replacements:{type:"object",propertyNames:{minLength:1},additionalProperties:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]}},trueObject:{type:"object",propertyNames:{minLength:1},additionalProperties:{enum:[!0]}}}},mm="no-blob-to-file",mf="suggestion";function mg(e,t){let r=ei(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function my(e,t){if(e?.type!=="Identifier")return;let r=ei(t.sourceCode.getScope(e),e),n=r?.defs[0],o=n?.node;if(n?.type==="Variable"&&"const"===n.kind&&o?.type==="VariableDeclarator")return o}let mh="no-canvas-to-image",mx=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function mb(e,t){if(e=mx(e),e?.type!=="Identifier")return e;let r=ei(t.getScope(e),e);if(!r||1!==r.identifiers.length||2!==r.references.length)return;let[n]=r.identifiers;if("VariableDeclarator"===n.parent.type&&n.parent.id===n&&"VariableDeclaration"===n.parent.parent.type&&"const"===n.parent.parent.kind&&!(t.getRange(n)[0]>t.getRange(e)[0]))return mx(n.parent.init)}let mE=e=>e.toLowerCase().includes("canvas"),mD="replace-one-element",mS="insert-at-negative-one",mv="suggestion-replace-one-element",mC="suggestion-insert-at-negative-one";function mA(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&mA(e.object)}let mT=(e,t)=>t.getCommentsInside(e).length>0,mw="no-duplicate-set-values",mk="first-match",mI="id-selector",mj="length-check",mF="query-selector-all-nullish",mB="query-selector-undefined",m$=e=>td(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!nA(e.callee.object),mR=e=>td(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!nA(e.callee.object),mP=e=>{let t,r;return t=e,r=mR,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&e0(t.property,0)},mL=e=>{let t,r;return t=e,r=mR,td(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&e0(t.arguments[0],0)},mN=e=>r2(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,mM=(e,t,r,n)=>{let[,o]=eH(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},mO=(e,t,r)=>{if("Identifier"!==e.type)return;let n=ei(t.getScope(e),e);if(!n||1!==n.defs.length)return;let[o]=n.defs;if("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&r(o.node.init))return o.node.init},mq=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tS(e))r=!r,e=e.parent;else if(tv(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tT(n)||(mR(e)?!e:!mO(e,r,mR)))return;let a=r.getText(e);return{node:e,messageId:mj,fix:((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return r.getAllComments().some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(s<=a||t>=i)})})(n,e,r)?void 0:e=>e.replaceText(n,`${a}.length ${o?"=== 0":"> 0"}`)}},mU=(e,t,r)=>({node:e,messageId:mk,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?oN(n,e,r):oM(n,e,r)}}),mW=(e,t)=>e9(e)||tx(e)&&t.isGlobalReference(e),m_=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:mO(n,r,t))&&mW(a,r)?{node:n,value:a}:(t(a)?a:mO(a,r,t))&&mW(n,r)?{node:a,value:n}:void 0:void 0},mV="no-invalid-file-input-accept/invalid",mz="no-invalid-file-input-accept/static",mK="no-invalid-file-input-accept/normalize",mG=new Set(["audio/*","image/*","video/*"]),mJ=new Map([["application/x-rar-compressed","application/vnd.rar"],["application/x-zip-compressed","application/zip"],["image/jpg","image/jpeg"],["image/svg","image/svg+xml"],["image/x-icon","image/vnd.microsoft.icon"]]),mX=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,mY=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},mH=e=>{if(e.startsWith("."))return e.length>1&&!mY(e.slice(1))?{replacement:e.toLowerCase()}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};if(!e.includes("/"))return e.length>0&&"."!==e[0]&&!mY(e)?{replacement:`.${e.toLowerCase()}`}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};let t=e.toLowerCase();if(t.includes("*"))return mG.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new m.MIMEType(e);return{replacement:mJ.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},mZ=e=>{if("JSXIdentifier"===e.type)return e.name},mQ=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&mZ(e.name)===t),m0=(e,t)=>{let r=e.sourceCode.getScope(t),n=ew(t,r)?.value;if("string"==typeof n)return n},m1=e=>">"===e||""===e.trim(),m2=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},m3=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],m8=(e,t,r)=>{let n=t;for(;t<r&&""!==e[t].trim()&&"="!==e[t]&&">"!==e[t]&&("/"!==e[t]||">"!==e[t+1]);)t++;return{name:e.slice(n,t).toLowerCase(),index:t}},m6=(e,t,r)=>{let n='"'===e[t]||"'"===e[t]?e[t]:void 0;if(n){let o=t+1;for(t=o;t<r&&e[t]!==n;)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!0,index:t+1}}let o=t;for(;t<r&&!m1(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},m9=(e,t,r)=>{let n=e.sourceCode.text,o=e.sourceCode.getRange(t.openStart)[1],a=e.sourceCode.getRange(t.openEnd)[1],i=o;for(;i<a&&(i=m2(n,i,a),!m3(n,i,a));){let e=m8(n,i,a);if(i=m2(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=m2(n,++i,a);let t=m6(n,i,a);if(i=t.index,e.name===r)return t}},m5=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:mV,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:mz};let r=(e=>{let t=e.split(","),r=new Set,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=mH(t);if(o.reason)return o;let{replacement:a}=o;r.has(a)||(r.add(a),n.push(a))}let o=n.join(", ");return o===e?{}:{replacement:o}})(e.value),n=r.replacement&&e.fixable&&(!e.isReplacementFixable||e.isReplacementFixable(r.replacement));return(({valueNode:e,checkResult:t,fix:r})=>{if(t.reason)return{node:e,messageId:mV,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:mK,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},m4="after-suspension",m7="in-nested-function",fe=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,ft=e=>{for(let t=e.parent;t;t=t.parent)if(tl(t))return t},fr="no-unnecessary-nested-ternary";function fn(e,t,r){return r.getText(e)===r.getText(t)}function fo(e,t,r,n){let o=eZ(e,t);return!eQ(e,t)&&n8(e,{operator:r,property:n})&&(o=`(${o})`),o}function fa(e,t){let r=eZ(e,t);return!eQ(e,t)&&nZ(e)&&(r=`(${r})`),r}function fi(e,t,r){let n={node:t,messageId:fr};return 0===e.sourceCode.getCommentsInside(t).length&&(n.fix=n=>n.replaceText(t,function({context:e,node:t,left:r,operator:n,right:o,consequent:a,alternate:i}){let{sourceCode:s}=e,l=[fo(r,e,n,"left"),fo(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${fa(a,e)} : ${fa(i,e)}`;return nU(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let fs="no-unused-array-method-return",fl=new Set(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),fu=/^\p{Uppercase_Letter}/v,fp=Symbol("uncertainValue"),fc=new Set(["BigInt","Boolean","Number","RegExp","String"]),fd=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),fm="prefer-array-last-methods",ff="replace",fg=new Map([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),fy=["reverse","toReversed"],fh="prefer-math-abs",fx=new Set([">",">=","<","<="]),fb={">":"<",">=":"<=","<":">","<=":">="},fE={">":"<",">=":"<="};function fD(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&e5(e.literal)||"TSTypeAnnotation"===e.type&&fD(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>fD(e))||"TSIntersectionType"===e.type&&e.types.some(e=>fD(e))}function fS(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?fS(e.expression):e}function fv(e){let t;return e5(e)||e7(e,{name:"BigInt",argumentsLength:1,optional:!1})||"UnaryExpression"===e.type&&"-"===e.operator&&fv(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&fD(t)}function fC(e,t){return fv(e)||function(e,t){let r=fS(e);if("Identifier"!==r.type)return!1;let n=ei(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&fD(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&fv(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&fD(e.node.id.typeAnnotation)||e.node.init&&fv(e.node.init)))??!1}(e,t)}function fA(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?tQ(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&e0(e.left,0)?tQ(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(tQ(e.left,t)&&tm(e.right)||tm(e.left)&&tQ(e.right,t))}function fT(e,t){if(!("BinaryExpression"!==e.type||!fx.has(e.operator)||fC(e.left,t)||fC(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:fb[e.operator]}}function fw(e,t){if(!("BinaryExpression"!==e.type||!fx.has(e.operator)||fC(e.left,t)||fC(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:fb[e.operator]}}function fk(e,t){let r=eZ(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function fI(e,t,r){let n={node:e,messageId:fh};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function fj(e){return["Identifier","Literal","ThisExpression"].includes((e=fS(e)).type)}let fF="prefer-split-limit",fB=(e,t)=>{let r=ew(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0))return r.value},f$=e=>{let t;return td(e,{method:"split",argumentsLength:1})&&(e1(t=e.arguments[0])&&""!==t.value||e6(t))},fR=(e,t,r,n)=>({node:e,messageId:fF,fix:e=>oT(e,t,String(r+1),n)}),fP="prefer-queue-microtask",fL={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tc(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&nB(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:fP,data:{name:"process.nextTick()"},fix:((e,t)=>{let{parent:r}=e;if("CallExpression"===r.type&&r.callee===e&&1===r.arguments.length&&"SpreadElement"!==r.arguments[0].type&&!(t.sourceCode.getCommentsInside(e).length>0))return t=>t.replaceText(e,"queueMicrotask")})(t,e)}}),e.on("CallExpression",n=>{let o;return t&&"Identifier"===n.callee.type&&"setImmediate"===n.callee.name&&!n.optional&&n.arguments.length>0&&"SpreadElement"!==n.arguments[0].type&&!nk(n.arguments[0])&&nM(n)&&nB(n.callee,e)?{node:n.callee,messageId:fP,data:{name:"setImmediate()"},fix:(e=>{if(1===e.arguments.length)return t=>t.replaceText(e.callee,"queueMicrotask")})(n)}:r&&"Identifier"===n.callee.type&&"setTimeout"===n.callee.name&&!n.optional&&n.arguments.length>=2&&"Literal"===(o=n.arguments[1]).type&&0===o.value&&"SpreadElement"!==n.arguments[0].type&&!nk(n.arguments[0])&&nM(n)&&nB(n.callee,e)?{node:n.callee,messageId:fP,data:{name:"setTimeout()"},fix:((e,t)=>{if(2!==e.arguments.length)return;let r=((e,t)=>{let{sourceCode:r}=t,[,n]=e.arguments,o=r.getTokenBefore(n),a=r.getTokenAfter(n),i=a?.value===","?r.getTokenAfter(a):a,s=[r.getRange(o)[0],a?.value===","?r.getRange(a)[1]:r.getRange(n)[1]];if(!re(t,[s[0],r.getRange(i)[0]]))return s})(e,t);if(r)return function*(t){yield t.replaceText(e.callee,"queueMicrotask"),yield t.removeRange(r)}})(n,e)}:void 0})},meta:{type:"suggestion",docs:{description:"Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkSetImmediate:{type:"boolean",description:"Whether to also check `setImmediate()`."},checkSetTimeout:{type:"boolean",description:"Whether to also check `setTimeout(…, 0)`."}}}],defaultOptions:[{checkSetImmediate:!1,checkSetTimeout:!1}],messages:{[fP]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},fN="prefer-string-pad-start-end",fM="suggest-padding-method",fO=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),fq=(e,t)=>{let r,n=((e,t)=>{if("Identifier"!==e.type)return;let r=ei(t.sourceCode.getScope(e),e),n=r?.defs[0]?.node;return n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"?n:n?.type==="VariableDeclarator"?n.init:void 0})(e,t);return(r=ew(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||fO.has(e.type)||fO.has(n?.type)||n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"},fU=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,fW=e=>"Literal"===e.type&&"number"==typeof e.value,f_=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,fV=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&fW(t)&&f_(r),fz=(e,t)=>{if(!td(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=ew(e,t.sourceCode.getScope(e));if("string"==typeof r?.value)return r.value})(r,t);if(n?.length===1)return{paddingNode:r,paddingString:n,widthNode:e.arguments[0]}},fK=(e,t)=>{let r,n=fz(e,t);if(!n)return;let{widthNode:o}=n;if("BinaryExpression"===o.type&&"-"===o.operator&&(r=o.right,r?.type==="MemberExpression"&&!1===r.computed&&"Identifier"===r.property.type&&"length"===r.property.name))return{...n,targetLengthNode:o.left,targetNode:o.right.object}},fG=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=eZ(t,a),s=eZ(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${eZ(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},fJ=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:fN,data:{method:t}};return o&&!fU(e,n)&&(a.fix=function(t){let o=nU(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},fX=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:fN,data:{method:t}};return o&&!fU(e,n)&&(a.suggest=[{messageId:fM,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},fY="require-css-escape",fH=["closest","matches","querySelector","querySelectorAll"],fZ=e=>e.value.cooked,fQ=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=fZ(r);if(void 0===e)return!1;n+=e}if(!((r=n).lastIndexOf("[")>r.lastIndexOf("]")))return!1;for(let r of e.quasis.slice(t+1)){let e=fZ(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},f0=e=>td(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),f1=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],f2={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!td(e,{methods:fH,minimumArguments:1})||nA(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!f0(n)&&(t||fQ(r,e))&&(yield{node:n,messageId:fY,fix:f1(n)})})},meta:{type:"suggestion",docs:{description:"Require `CSS.escape()` for interpolated values in CSS selectors.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkAllSelectors:{type:"boolean",description:"Check all selector interpolations instead of only attribute selector interpolations."}}}],defaultOptions:[{checkAllSelectors:!1}],messages:{[fY]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},f3="require-passive-events",f8=new Set(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),f6=e=>e.computed||"Identifier"!==e.property.type?e1(e.property)?e.property.value:void 0:e.property.name,f9=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===f6(t)&&("CallExpression"===(r=t).parent.type&&r.parent.callee===r?r.parent:"ChainExpression"===r.parent.type&&"CallExpression"===r.parent.parent.type&&r.parent.parent.callee===r.parent?r.parent.parent:void 0)},f5=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=f6(e.parent);return t&&"preventDefault"!==t&&!r2((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},f4="this",f7="class",ge="class-unavailable",gt="super",gr="super-class",gn="super-class-unavailable",go="suggestion",ga=new Set(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),gi=new Set(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),gs=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,gl=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,gu=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(gl(r)&&!gs(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(ga.has(r.type))return}},gp=e=>{if(e.id)return e.id;let{parent:t}=e;if("ClassExpression"===e.type&&"VariableDeclarator"===t.type&&t.init===e&&"Identifier"===t.id.type)return t.id},gc=(e,t,r)=>ei(e.getScope(t),t)===ei(e.getScope(r),r),gd=(e,t,r)=>ei(e.getScope(t),r.name)===ei(e.getScope(r),r),gm=(e,t)=>"AssignmentExpression"===e.type&&e.left===t||"UpdateExpression"===e.type&&e.argument===t||"UnaryExpression"===e.type&&"delete"===e.operator&&e.argument===t||("ForInStatement"===e.type||"ForOfStatement"===e.type)&&e.left===t,gf=e=>{let t;return(t=e.parent,gi.has(t.type)&&t.expression===e)?e.parent:void 0},gg=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=gf(e);return r||("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type&&t.properties.includes(e)||"ArrayPattern"===t.type&&t.elements.includes(e)||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?t:void 0)},gy=e=>{let t=e;for(;t.parent;){if(gm(t.parent,t))return!0;let e=gg(t);if(!e)break;t=e}return!1},gh=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,gx=e=>{let t=e;for(;t.parent;){let e=gf(t);if(!e)break;t=e}return t},gb=e=>{let t=gx(e);return"CallExpression"===t.parent.type&&t.parent.callee===t||"NewExpression"===t.parent.type&&t.parent.callee===t||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t},gE=e=>{let t=gx(e);return gh(t)&&"PrivateIdentifier"===t.parent.property.type},gD=e=>{let t=gx(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},gS=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,gv=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:go,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),gC=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),gA={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||gy(e)||gb(e)||gE(e)||gD(e))return;let n=gu(e);if(!n)return;let o=gp(n.parent.parent);return o&&gd(t,e,o)?gv({node:e,messageId:f7,source:"this",replacement:o.name,name:o.name}):gC(e,ge)}),e.on("Super",e=>{if(n||gy(e))return;let r=gu(e);if(!r)return;let o=gS(r.parent.parent);return o&&gd(t,e,o)?gv({node:e,messageId:gr,source:"super",replacement:o.name,name:o.name}):gC(e,gn)}),e.on("Identifier",o=>{if(!function(e,t=[]){if("Identifier"!==e.type)return!1;let r=Array.isArray(t)?t:[t];return(!(r.length>0)||!!r.includes(e.name))&&!function(e){let{parent:t}=e;switch(t.type){case"MemberExpression":return!t.computed&&t.property===e;case"FunctionDeclaration":case"FunctionExpression":return t.params.includes(e)||t.id===e;case"ArrowFunctionExpression":return t.params.includes(e);case"ClassDeclaration":case"ClassExpression":case"VariableDeclarator":case"TSDeclareFunction":case"TSEnumMember":case"TSTypeAliasDeclaration":return t.id===e;case"PropertyDefinition":case"MethodDefinition":return!t.computed&&t.key===e;case"Property":return!t.computed&&t.key===e&&("ObjectExpression"===t.parent.type||"ObjectPattern"===t.parent.type)&&t.parent.properties.includes(t)||t.value===e&&"ObjectPattern"===t.parent.type&&t.parent.properties.includes(t);case"ArrayPattern":return t.elements.includes(e);case"LabeledStatement":case"ContinueStatement":case"BreakStatement":return t.label===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":return t.local===e;case"ExportAllDeclaration":return t.exported===e;case"ImportSpecifier":return t.local===e||t.imported===e;case"ExportSpecifier":return t.local===e||t.exported===e;case"TSIndexSignature":return t.parameters.includes(e);case"TSTypeParameter":return t.name===e;case"TSMappedType":case"TSPropertySignature":return t.key===e}return!1}(e)}(o)||(e=>{let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeReference"===t.parent.type&&t.parent.typeName===t||"TSTypeQuery"===t.parent.type&&t.parent.exprName===t})(o)||gy(o)||gb(o)||gE(o)||gD(o))return;let a=gu(o);if(!a)return;let i=a.parent.parent;if(r){let e=gp(i);if(e&&o.name===e.name&&gc(t,o,e))return gv({node:o,messageId:f4,source:o.name,replacement:"this",name:o.name})}if(!n||!(gh(o)&&!o.parent.optional&&!gy(o.parent))||eQ(o,e))return;let s=gS(i);if(s&&o.name===s.name&&gc(t,o,s))return gv({node:o,messageId:gt,source:o.name,replacement:"super",name:o.name})})},meta:{type:"suggestion",docs:{description:"Enforce consistent class references in static methods.",recommended:!0},hasSuggestions:!0,schema:[{type:"object",properties:{preferThis:{type:"boolean",description:"Prefer `this` over the current class name in static methods."},preferSuper:{type:"boolean",description:"Prefer `super` over the superclass name in static methods."}},additionalProperties:!1}],defaultOptions:[{preferThis:!0,preferSuper:!0}],messages:{[f4]:"Use `this` instead of `{{name}}` in static methods.",[f7]:"Use `{{name}}` instead of `this` in static methods.",[ge]:"Use the class name instead of `this` in static methods.",[gt]:"Use `super` instead of `{{name}}` in static methods.",[gr]:"Use `{{name}}` instead of `super` in static methods.",[gn]:"Use the superclass name instead of `super` in static methods.",[go]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},gT="consistent-optional-chaining/remove-optional",gw="consistent-optional-chaining/use-optional",gk="consistent-optional-chaining/suggest-remove-optional",gI="consistent-optional-chaining/suggest-use-optional",gj=new Set(["Identifier","ThisExpression","Super"]);function gF(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rg(e)).type&&(e=e.expression);return e}function gB(e){return"MemberExpression"===(e=gF(e)).type?e:void 0}function g$(e){return e=gF(e),!!gj.has(e.type)||"MemberExpression"===e.type&&g$(e.object)}function gR(e,t){let r=ra(e,t);return!re(t,r)}function gP({memberExpression:e,context:t,fixer:r,replacement:n}){let o=ra(e,t);return r.replaceTextRange(o,n)}function gL(e,t,r){return gP({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let gN="always",gM="never",gO="missing-delay",gq="redundant-delay",gU=new Set(["setTimeout","setInterval"]),gW=new Set(["window","globalThis","global","self"]),g_=e=>e0(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&g_(e.argument),gV="negative-index",gz="length-index",gK=["entries","keys","values"],gG=["drop","filter","flatMap","map","take"],gJ=["concat","from","zip","zipKeyed"],gX=e=>{for(;rf(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},gY="no-duplicate-loops",gH=["filter","map"],gZ="no-declarations-before-early-exit",gQ=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),g0=e=>"use"===e||/^use[\dA-Z]/.test(e),g1=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,g2=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eg(n)},g3=(e,t)=>{let[r,n]=e.getRange(t);return new Set(tO(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*g8(e,t,r){let n;for(let[o,a]of t.entries())if(gQ(a)&&!a.declare){n??=t.map(e=>{var t,n;return(t=e,n=r,"IfStatement"!==t.type||n(t.consequent)===(!!t.alternate&&n(t.alternate)))?void 0:e});for(let r=o+1;r<t.length;r++){let t=n[r];if(t){for(let n of a.declarations){let i=function({sourceCode:e,declaration:t,declarator:r,guardStatement:n,declarationIndex:o,guardIndex:a}){var i;let s;if("Identifier"!==r.id.type||(e=>{if(e?.type!=="CallExpression")return!1;let{callee:t}=e;return"Identifier"===t.type?g0(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&g0(t.property.name)})(r.init)||r.init&&tk(r.init,e.visitorKeys)||a>o+1&&!g1(r.init)||r.init&&(i=r.init,s=g3(e,n),[...g3(e,i)].some(e=>s.has(e)))&&(eP(r.init,e)||eP(n.test,e)))return;let[l]=e.getDeclaredVariables(r),u=l.references.filter(e=>!e.init&&!function(e){let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeQuery"===t.parent.type}(e.identifier));if(0===u.length)return;let[,p]=e.getRange(n);if(u.some(t=>e.getRange(t.identifier)[0]<p))return;let c={node:r.id,messageId:gZ};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&g1(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!g2(e,t,"before")&&!g2(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eg(e)))({sourceCode:e,declaration:t,guardStatement:n,declarationIndex:o,guardIndex:a})&&(c.fix=function(e,t,r){let n=e.getText(t),o=e.getText(r),[a,i]=e.getRange(t),[s,l]=e.getRange(r),u=e.text.slice(i,s);return e=>e.replaceTextRange([a,l],`${o}${u}${n}`)}(e,t,n)),c}({sourceCode:e,declaration:a,declarator:n,guardStatement:t,declarationIndex:o,guardIndex:r});i&&(yield i)}break}}}}let g6="no-optional-chaining-on-undeclared-variable",g9=e=>"Type"===e.type||"ImportBinding"===e.type&&nW(e.node);function g5(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rg(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let g4="no-object-methods-with-collections/error",g7="no-object-methods-with-collections/suggestion",ye=new Set(["Map","ReadonlyMap"]),yt=new Set(["Set","ReadonlySet"]),yr=new Set([...ye,...yt]),yn=new Set(["entries","keys","values"]),yo=e=>new Set([e]),ya=e=>yr.has(e)?e:void 0,yi=new Set(["ClassDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSTypeAliasDeclaration"]),ys=e=>{if(e&&yi.has(e.type))return e.id?.name},yl=(e,t)=>{let r=(e=>{for(;e.parent;)e=e.parent;return"Program"===e.type?e:void 0})(t);if(!r)return!1;for(let t of r.body){if("ImportDeclaration"===t.type){if(t.specifiers.some(t=>t.local.name===e))return!0;continue}if("ExportNamedDeclaration"===t.type||"ExportDefaultDeclaration"===t.type){if(ys(t.declaration)===e)return!0;continue}if(ys(t)===e)return!0}return!1},yu=e=>{let t=new Set;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},yp=(e,t)=>{let r=ei(t.sourceCode.getScope(e),e);return!r||"global"===r.scope.type&&0===r.defs.length},yc=(e,t)=>{if(rE.has(e.intrinsicName))return;if(e.isUnion())return yu(e.types.map(e=>yc(e,t)));let r=rS(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&ya(n);return o&&yo(o)},yd=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return yd(e.typeAnnotation);case"TSTypeOperator":return"readonly"===e.operator?yd(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||yl(e.typeName.name,e))return;let t=ya(e.typeName.name);return t&&yo(t)}case"TSUnionType":return yu(e.types.map(e=>yd(e)))}},ym=(e,t,r=new Set)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r,n=yc(r.getTypeAtLocation(e),t);if(n&&!((e,t)=>{for(let r of e)if(yl(r,t))return!0;return!1})(n,e))return n}catch{}})(e,t)??((e,t,r)=>{if(te(e,{names:["Map","Set"]})&&yp(e.callee,t))return yo(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=yd(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?ym(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return yd(e.typeAnnotation)??ym(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return ym(e.expression,t,r)}})(e,t,r),yf="no-subtraction-comparison/error",yg="no-subtraction-comparison/suggestion",yy={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},yh=new Set(Object.keys(yy)),yx=new Set([">","<"]),yb=e=>"BinaryExpression"===e.type&&"-"===e.operator,yE=(e,t)=>{let r=ew(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},yD="no-unnecessary-global-this",yS=new Set(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),yv=e=>{for(;yS.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e};function yC(e){return"CallExpression"===(e=yv(e)).parent.type&&e.parent.callee===e}let yA="computed-key",yT="nested-array",yw="deep-object",yk="property-assignment";function yI(e){let{parent:t}=e;if(t){if(rf(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return yI(t);if("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type)return t.parent;if("ObjectPattern"===t.type||"ArrayPattern"===t.type)return t}}function yj(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=yI(e);return t}let yF="no-useless-else",yB=new Set(["Program","BlockStatement","StaticBlock","SwitchCase"]),y$=new Set(["[","(","/","`","+","-"]),yR=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},yP=e=>y$.has(e.value[0]),yL="no-useless-recursion",yN=new Set(["using","await using"]),yM=e=>e?.type==="VariableDeclaration"&&yN.has(e.kind),yO=e=>"ForStatement"===e.type?yM(e.init):"ForOfStatement"===e.type&&yM(e.left),yq="prefer-add-event-listener-options",yU="prefer-direct-iteration",yW="Array",y_="FormData",yV="URLSearchParams",yz=new Set([yW,"Map","Set",y_,yV,...rb]),yK=new Map([["ReadonlyArray",yW],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),yG=new Map([[yW,["values"]],["Map",["entries"]],["Set",["values","keys"]],[y_,["entries"]],[yV,["entries"]],...rb.map(e=>[e,["values"]])]),yJ=["Map","WeakMap","Set","WeakSet"],yX=["all","allSettled","any","race"],yY=new Set(["ArrayExpression","CallExpression","NewExpression"]),yH=e=>new Set([e]),yZ=(e,t)=>td(e,{objects:rb,methods:t,optionalCall:!1,optionalMember:!1}),yQ=e=>yz.has(e)?e:yK.get(e),y0=e=>{let t=new Set;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},y1=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return y0(e.types.map(e=>y1(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return yH(yW);let n=rS(e);if(!rv(n,r))return;let o=n.getName(),a=o&&yQ(o);return a&&yH(a)},y2=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return y2(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return yH(yW);case"TSTypeOperator":return"readonly"===e.operator?y2(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=yQ(e.typeName.name);return t&&yH(t)}case"TSUnionType":return y0(e.types.map(e=>y2(e)))}},y3=(e,t,r=new Set)=>((e,t,r)=>{if("ArrayExpression"===e.type||te(e,{name:"Array"}))return yH(yW);if(te(e,{names:rb})||te(e,{names:["Map","Set",y_,yV]}))return yH(e.callee.name);if(e7(e,{name:"Array"})||td(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return yH(yW);if(yZ(e,["from","of"]))return yH(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=y2(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?y3(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return y2(e.typeAnnotation)??y3(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return y3(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return y1(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),y8="prefer-number-is-safe-integer/error",y6="prefer-number-is-safe-integer/suggestion",y9="prefer-number-is-safe-integer/integer-check-error",y5="prefer-number-is-safe-integer/integer-check-suggestion",y4=["_","lodash","underscore"],y7=["floor","trunc"],he=(e,t)=>{let r=ei(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},ht=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&e0(e.right,1))return e.left},hr=(e,t)=>{if(td(e,{object:"Math",methods:y7,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},{isIdentifierName:hn}=tL,ho="prefer-object-define-properties";function ha(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(td(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let hi="prefer-object-destructuring-defaults",hs="prefer-object-destructuring-defaults/suggestion",hl=new Set(Object.getOwnPropertyNames(Object.prototype)),hu={considerGetters:!0,considerImplicitTypeConversion:!0},hp=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,hc=(e,t,r)=>tO(r.sourceCode.getScope(e)).some(n=>t.has(n.identifier.name)&&((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i})(n.identifier,e,r.sourceCode)),hd=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=eZ(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},hm="prefer-single-object-destructuring",hf=(e,t)=>{let r,n;if(!("VariableDeclaration"===t.type&&("const"===(r=t.kind)||"let"===r)&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("ObjectPattern"===o.id.type&&!o.id.typeAnnotation&&(n=o.id).properties.length>0&&n.properties.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.value.type)&&o.init?.type==="Identifier"&&((e,t)=>{let r=ei(e.getScope(t),t);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&!n.parent.declare&&"const"===n.parent.kind})(e,o.init))return{node:t,declarator:o,source:o.init.name}},hg=(e,t,r)=>{let n,o,a=hf(e,t),i=hf(e,r);if(!(a&&i&&a.node.kind===i.node.kind&&a.source===i.source&&0===e.getCommentsInside(a.node).length&&0===e.getCommentsInside(i.node).length&&(n=a.node,o=i.node,!e.getTokensBetween(n,o,{includeComments:!0}).some(e=>eg(e)))))return;let s=t=>t.properties.map(t=>e.getText(t)).join(", "),l=`${a.node.kind} {${s(a.declarator.id)}, ${s(i.declarator.id)}} = ${a.source};`;return{node:i.node,messageId:hm,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*hy(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=hg(e,t[r-1],n);o&&(yield o)}}let hh="prefer-smaller-scope",hx=new Set(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function hb(e,t){let r=e.parent;for(;r&&r!==t;){if(hx.has(r.type))return!1;r=r.parent}return r===t}function hE(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eg(n))}function hD(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let hS="prefer-single-array-predicate/error",hv="prefer-single-array-predicate/suggestion",hC=new Map([["||","some"],["&&","every"]]),hA=new Set(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),hT="prefer-url-href",hw="non-url",hk="unknown",hI=new Set(["ClassName","ImportBinding","Type"]),hj=new Set(["any","error","unknown"]),hF=new Set(["node:url","url"]),hB=e=>hI.has(e.type),h$=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>n_(e,r,n)))return o;t=t.upper}},hR=e=>e.every(e=>"url"===e)?"url":!e.includes(hk)&&e.includes(hw)?hw:hk,hP=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,hF.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},hL=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||nW(e.node)),hN=e=>"Type"===e.type||hL(e),hM=e=>hP(e)&&!hL(e),hO=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>!hN(e)&&n_(e,r,n)))return!0;t=t.upper}return!1})("URL",t.sourceCode.getScope(e),e,t))return!1;if(nB(e,t))return!0;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>hN(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.some(e=>hM(e))??!1})(r,t))},hq=(e,t)=>t.sourceCode.getScope(e.name??e.node),hU=(e,t,r,n=new Set)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return hU(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return hk;let o=e.typeName.name,a=h$(o,r,e.typeName,t),[i]=a?.defs??[];if(!i)return"URL"!==o||((e,t)=>{for(;t;){let r=t.set.get(e);if(r?.defs.some(e=>hB(e)))return!0;t=t.upper}return!1})(o,r)?hk:"url";if(n.has(o))return hk;if(hP(i))return"url";n.add(o);let s=hk;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=hU(i.node.typeAnnotation,t,hq(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=hk:"ClassName"===i.type&&(s=hw),n.delete(o),s})(e,t,r,n);case"TSUnionType":return hR(e.types.map(e=>hU(e,t,r,n)));case"TSIntersectionType":return hR(e.types.map(e=>hU(e,t,r,n)));case"TSImportType":let o;return(o=e.source,hF.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":hw;default:return e?hw:hk}},hW=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(hj.has(e.intrinsicName)||e.isTypeParameter?.())return hk;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return hW(i,t);if(e.isUnion()||e.isIntersection())return hR(e.types.map(e=>hW(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return hk;let n=h$(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||hP(e))??[];return 0===o.length?hk:o.every(e=>hP(e))?"url":hw})(r.typeToString(e),o,n);if(s!==hk)return s;let l=rS(e);return rv(l,a)&&"URL"===l.getName()?"url":hw},h_=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return hk;try{let{program:n}=r;return hW(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return hk}};function hV(e,t,r=new Set){if(!e)return hk;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return hk;let[o]=n.defs;if(!n_(o,e,t))return hk;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?hV(o.node.init,t,r):hk,i=hU(o.name?.typeAnnotation,t,hq(o,t)),s=hk;return a!==hk?s=a:i!==hk&&(s=i),r.delete(n),s})(e,t,r);if(n!==hk)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=hU(e.typeAnnotation,t,n);return o===hk?hV(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return hV(e.expression,t,r);case"SequenceExpression":return hV(e.expressions.at(-1),t,r);case"ConditionalExpression":return hR([hV(e.consequent,t,r),hV(e.alternate,t,r)])}if(hO(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!hN(e)&&!hM(e))??!1})(e.callee,t))return hw;let r=h_(e,t);return r===hk?hw:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return hk;let r=ei(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return hk;let[n]=r.defs;return hU(n.node.returnType,t,hq(n,t))})(e,t);return o!==hk?o:h_(e,t)}let hz=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return hz(e.expression,t);case"SequenceExpression":return hz(e.expressions.at(-1),t);case"ConditionalExpression":return hz(e.consequent,t)&&hz(e.alternate,t);case"NewExpression":return hO(e,t);default:return!1}},hK=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,hG="require-proxy-trap-boolean-return",hJ=new Set(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),hX=new Set(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),hY=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),hH=new Set(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),hZ=(e,t)=>({node:e,messageId:hG,data:{name:t}}),hQ=e=>{if(e)return hZ(e.node,e.data.name)},h0=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?hQ(h0(e.right,t,r)):hZ(e,t);if("ConditionalExpression"===e.type)return h0(e.consequent,t,r)??h0(e.alternate,t,r);if("LogicalExpression"===e.type)return hQ(h0(e.left,t,r)??h0(e.right,t,r));if("SequenceExpression"===e.type)return hQ(h0(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=ew(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(hY.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&hH.has(e.operator)))return;let o=((e,t,r)=>{if(!(r.getCommentsInside(e).length>0)&&("Literal"===e.type&&!e.regex||"TemplateLiteral"===e.type&&0===e.expressions.length||"Identifier"===e.type&&"undefined"===e.name))return String(t)})(e,n,r);return{...hZ(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},h1=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eI(e,t.getScope(e));if(hJ.has(r)&&hX.has(e.value.type))return{name:r,functionNode:e.value}},h2=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return hZ(e,t);if("BlockStatement"!==e.body.type)return h0(e.body,t,r);let o=[...function* e(t){if(t&&"string"==typeof t.type){if("ReturnStatement"===t.type)return void(yield t);if(!("BlockStatement"!==t.type&&hX.has(t.type))){for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){for(let t of n)yield*e(t);continue}yield*e(n)}}}}(e.body)],a=n.get(e)??!1;if(0===o.length){if(a)return;return hZ(e,t)}for(let e of o){if(!e.argument)return hZ(e,t);let n=h0(e.argument,t,r);if(n)return n}if(!a)return hZ(e,t)},h3=f.builtinRules.get("logical-assignment-operators"),h8="ifNullish",h6="convertIf",h9={...h3.meta.messages,[h8]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},h5=e=>e.fix??e.suggest?.[0]?.fix,h4={create:e=>{let{sourceCode:t}=e,r=Object.create(e,{report:{value(r){e.report(function(e,t){let r;if("if"!==e.messageId||e.data?.operator!=="||="||"function"!=typeof h5(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:h8};if(t.getCommentsInside(e.node).length>0)return n;let o=h5(e);return{...n,suggest:[{messageId:h6,data:{operator:"||="},fix:o},{messageId:h6,data:{operator:"??="},fix:e=>o(new Proxy(e,{get(e,t){if("insertTextBefore"!==t){let r=Reflect.get(e,t,e);return"function"==typeof r?r.bind(e):r}return(t,r)=>e.insertTextBefore(t,"||"===r?"??":r)}}))}]}}(r,t))}}});for(let[t,n]of Object.entries(h3.create(r)))e.on(t,n)},meta:{type:h3.meta.type,docs:{description:h3.meta.docs.description,recommended:!0},fixable:h3.meta.fixable,hasSuggestions:h3.meta.hasSuggestions,schema:h3.meta.schema,defaultOptions:[h3.meta.defaultOptions?.[0]],messages:h9,languages:["js/js"]}},h7="no-useless-coercion",xe=new Map([["Boolean",{type:"boolean",isType:ng}],["String",{type:"string",isType:nv}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&nh(e.typeAnnotation)||nx(e,t))||"bigint"==typeof ew(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>nt(e,t.sourceCode.getScope(e))}]]),xt=e=>"Literal"===e.type&&""===e.value,xr="no-useless-boolean-cast",xn=["every","filter","find","findIndex","findLast","findLastIndex","some"],xo="no-useless-continue",xa="no-useless-override",xi=e=>e.isUnion()?e.types.every(e=>xi(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,xs=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},xl="prefer-has-check",xu=new Set(["Map","ReadonlyMap","WeakMap"]),xp=new Set(["Map","WeakMap"]),xc=new Set(["FormData","Headers","URLSearchParams"]),xd=new Set(["Array","ReadonlyArray"]),xm=new Set([...xp,...xc]),xf=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),xg=new Set(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),xy=new Set(["TSTypeAnnotation","TSParenthesizedType"]),xh=new Set(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),xx=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),xb=new Set(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),xE=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),xD=new Set(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),xS=e=>{for(;xD.has(e.type);)e=e.expression;return e},xv=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=xv(e.left);return t?`${t}.${e.right.name}`:void 0}},xC=e=>e.typeArguments?.params??e.typeParameters?.params??[],xA=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>xf.has(e.type));if(r)return r;t=t.upper}},xT=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===xC(e.node).length)return e.node.typeAnnotation},xw=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=ei(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},xk=(e,t)=>tx(e)&&xw(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,xI=(e,t)=>xu.has(e)?{kind:"map",typeName:e,valueType:t}:xc.has(e)?{kind:"null-sentinel",typeName:e}:void 0,xj=(e,t,r=new Set)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return xj(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?xj(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=xv(e.typeName);if(!n)return;if((xu.has(n)||xc.has(n))&&!xA(n,t))return xI(n,xC(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),xT(xA(e,t))})(n,t,r);return o?xj(o,t,r):void 0}}},xF=(e,t)=>{let r=t.sourceCode.getScope(e);return xj(e.typeAnnotation,r)},xB=(e,t,r=new Set)=>{let n=xF(e,t);if(n)return n;if(te(e=xS(e))&&"Identifier"===e.callee.type&&xm.has(e.callee.name)&&xw(e.callee,t))return xI(e.callee.name);if("Identifier"!==e.type)return;let o=ei(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=xj(a.name?.typeAnnotation,t.sourceCode.getScope(a.name));return i||("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init?xB(a.node.init,t,r):void 0)},x$=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=rS(r);if(rv(e,t))return e.getName()}},xR=(e,t,r)=>{if(rE.has(e.intrinsicName)||rD.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>xR(e,t,r));if(1===new Set(n.map(e=>e?.typeName)).size){let[e]=n;if(e?.kind!=="map")return e;let r=n.map(e=>e?.valueType);return{...e,valueType:r.every(Boolean)?t.getUnionType(r):void 0}}if(n.every(e=>e?.kind==="map")){let e=n.map(e=>e.valueType);return{kind:"map",typeName:"Map",valueType:e.every(Boolean)?t.getUnionType(e):void 0}}return n.every(e=>e?.kind==="null-sentinel")?{kind:"null-sentinel",typeName:"null-sentinel"}:void 0}if(e.isIntersection())return e.types.map(e=>xR(e,t,r)).find(e=>e?.kind==="map");let n=x$(e,r);return xI(n,xu.has(n)?t.getTypeArguments(e).at(-1):void 0)},xP=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return xR(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},xL=(e,t)=>xP(e,t)??xB(e,t),xN=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,xM=(e,t,r,n=new Set)=>{if(!e||xh.has(e.type))return!1;if(xy.has(e.type))return xM(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&xM(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>xM(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(xx.has(e.type))return"truthy"!==r;if(xb.has(e.type))return!0;if("TSTypeLiteral"===e.type)return"truthy"!==r;if("TSLiteralType"===e.type){var o;let t="Literal"===(o=e.literal).type?o.value:"TemplateLiteral"===o.type&&0===o.expressions.length?o.quasis[0].value.cooked:"UnaryExpression"===o.type&&("-"===o.operator||"+"===o.operator)&&"Literal"===o.argument.type&&("number"==typeof o.argument.value||"bigint"==typeof o.argument.value)?"-"===o.operator?-o.argument.value:o.argument.value:void 0;return void 0!==t&&xN(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=xv(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=xT(o=xA(i,t.sourceCode.getScope(e.typeName))))?{type:"alias",node:a}:o?.type==="ClassName"||o?.type==="Type"&&"TSInterfaceDeclaration"===o.node.type?{type:"object"}:void 0,l=!1;return s?.type==="alias"?l=xM(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},xO=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,xq=(e,t,r)=>{if(rE.has(e.intrinsicName))return!1;let n=xO(e,t);return n&&n!==e?xq(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>xq(e,t,r)):!r.has(e.intrinsicName))},xU=(e,t,r)=>{if(rE.has(e.intrinsicName)||rD.has(e.intrinsicName))return!1;let n=xO(e,t);if(n&&n!==e)return xU(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>xU(e,t,r));if(xg.has(e.intrinsicName))return!1;if("true"===e.intrinsicName||"symbol"===e.intrinsicName)return!0;if(e.isStringLiteral?.())return e.value.length>0;if(e.isNumberLiteral?.())return 0!==e.value;if(e.isBigIntLiteral?.())return e.value.negative||"0"!==e.value.base10Value;let o=t.typeToString(e);return/^-?\d+n$/u.test(o)?!/^-?0n$/u.test(o):"object"===t.typeToString(e)||xd.has(x$(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},xW=(e,t,r)=>{if(!te(e)||"Identifier"!==e.callee.type||!xp.has(e.callee.name)||!xw(e.callee,t))return;if(0===e.arguments.length)return!0;if(1!==e.arguments.length)return;let[n]=e.arguments;if("ArrayExpression"===n.type)return n.elements.every(e=>{var n;let o;return e?.type==="ArrayExpression"&&e.elements.length>=2&&e.elements[1]&&"SpreadElement"!==e.elements[1].type&&(n=e.elements[1],(o=ew(n,t.sourceCode.getScope(n)))?xN(o.value,r):!tx(n)&&xE.has(n.type))})},x_=(e,t,r)=>{let n=xW(xS(e),t,r);if(void 0!==n)return n;let o=xP(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?xU(o,n,e):"not-undefined"===r?xq(o,n,new Set(["undefined","void"])):xq(o,n,new Set(["undefined","void","null"])))return!0}return function e(t,r,n,o={}){let a,i=o.visitedVariables??new Set,s=o.checkConstructorValues??!0,l=xF(t,r);if(l?.kind==="map")return!!l.valueType&&xM(l.valueType,r,n);let u=((e,t,r,n)=>{if(!te(e)||"Identifier"!==e.callee.type||!xp.has(e.callee.name)||!xw(e.callee,t))return;if(n){let n=xW(e,t,r);if(void 0!==n)return n}let o=xC(e).at(-1);return!!o&&xM(o,t,r)})(t=xS(t),r,n,s);if(void 0!==u)return u;let p=((e,t,r)=>{if("Identifier"!==e.type)return;let n=ei(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,i);if(!p)return!1;i.add(p);let[c]=p.defs,d=(a=xj(c.name?.typeAnnotation,r.sourceCode.getScope(c.name)),a?.kind==="map"?!!a.valueType&&xM(a.valueType,r,n):"Variable"===c.type&&"const"===c.parent.kind&&c.node.id===c.name&&!!c.node.init&&e(c.node.init,r,n,{visitedVariables:i,checkConstructorValues:!1}));return i.delete(p),d}(e,t,r)},xV=e=>"Literal"===e.type&&null===e.value,xz="logical",xK="ternary",xG="consistent-conditional-object-spread",xJ=new Set(["==","==="]),xX=new Set(["!=","!=="]),xY=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function xH(e,t,r){if(tQ(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return xH(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&xH(e.left,t.left,r)&&xH(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&xH(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function xZ(e){return e9(e)?"null":tx(e)?"undefined":void 0}function xQ(e){if("BinaryExpression"!==e.type||!xJ.has(e.operator)&&!xX.has(e.operator))return;let t=xZ(e.left),r=xZ(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:xJ.has(e.operator)}}let x0=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function x1(e,t){let r=xQ(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=xQ(e.left),o=xQ(e.right);if(n&&o&&xH(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&x0(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&x0(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function x2(e,t,r){let n=eZ(e,r);return!eQ(e,r)&&n8(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function x3(e,t){let r=eZ(e,t);return!eQ(e,t)&&nZ(e)&&(r=`(${r})`),r}let x8="default-export-style/inline",x6="default-export-style/separate",x9="default-export-style/suggestion-inline",x5="default-export-style/suggestion-separate",x4="inline",x7="separate",be="ignore",bt="class",br="function",bn=()=>({enum:[x4,x7,be]}),bo=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,ba=e=>e.id?.name,bi=e=>{switch(e.type){case"ClassDeclaration":return bt;case"FunctionDeclaration":return br}},bs=e=>e===bt?"classes":"functions",bl=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return t6(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},bu=(e,t)=>ei(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,bp=e=>!!e&&!!(e.type.startsWith("TS")||e.typeAnnotation||e.typeParameters||e.returnType||e.implements?.length>0||e.superTypeArguments||e.accessibility||e.readonly||e.override||e.definite||e.optional&&"MemberExpression"!==e.type&&"CallExpression"!==e.type||e.abstract||e.declare||e.decorators?.length>0),bc=(e,t)=>{if(bp(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&bc(e,t)))return!0;continue}if(n?.type&&bc(n,t))return!0}return!1},bd=(e,t)=>e.params.every(e=>!rd(e,t.sourceCode.visitorKeys)),bm=(e,t,r)=>ei(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,bf=(e,t)=>{let r=ba(e);if(r){let t=bi(e);return t&&{kind:t,name:r,declaration:e}}let n=((e,t)=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[r]=e.declarations;if(!("Identifier"!==r.id.type||bp(r.id)||r.init?.type!=="ArrowFunctionExpression"||bc(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:br,name:n.id.name,declaration:e,functionNode:n.init}},bg=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),by=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||bm(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!bc(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&bd(t,e)&&!rd(t.body,e.sourceCode.visitorKeys))return[{messageId:x5,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${bg(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
19
- export default ${n};`)}]},bh=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===be||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return t6(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||bu(i,r.declaration))&&(o!==br||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===br&&"FunctionDeclaration"===t.type&&bc(t,e.sourceCode.visitorKeys))){if(n===x4)return"VariableDeclaration"===t.type?{node:r,messageId:x8,data:{kind:o},suggest:(({context:e,declaration:t,exportDeclaration:r,name:n,scope:o})=>{let[{id:a,init:i}]=t.declarations;if(!(e.sourceCode.getCommentsInside(r).length>0||bl(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||bm(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!bc(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&bd(i,e)&&!rd(i.body,e.sourceCode.visitorKeys))return[{messageId:x9,data:{kind:br},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${bg(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${eZ(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===bt&&bc(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||bl(e,r)?{node:r,messageId:x8,data:{kind:o}}:{node:r,messageId:x8,data:{kind:o},fix:function*(n){yield n.insertTextBefore(t,"export default "),yield n.removeRange([e.sourceCode.getRange(t)[1],e.sourceCode.getRange(r)[1]])}};if(n===x7&&o===br&&"FunctionDeclaration"===t.type)return{node:r,messageId:x6,data:{kind:o,style:"const arrow function"},suggest:by({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},bx=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=ba(o),i=e.sourceCode.getScope(t);if(!(!a||r===be||r===x4||bu(i,a)||n===br&&(o.generator||bc(o,e.sourceCode.visitorKeys)))){if(n===br)return{node:t,messageId:x6,data:{kind:n,style:"const arrow function"},suggest:by({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===bt&&bc(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:x6,data:{kind:n,style:"class declaration"}}:{node:t,messageId:x6,data:{kind:n,style:"class declaration"},fix:r=>{let{declaration:n}=t;return r.replaceText(t,`${e.sourceCode.getText(n)}
20
- export default ${n.id.name};`)}}}},bb={create:e=>{let t=e.options[0];e.on("Program",r=>{for(let[n,o]of r.body.entries()){if("ExportDefaultDeclaration"===o.type){let{declaration:r}=o,n=bi(r),a=ba(r);if(!n||!a)continue;let i=bx({context:e,exportDeclaration:o,expectedStyle:t[bs(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=bf(o,e);if(!i||!bo(a,i.name))continue;let s=bh({context:e,exportDeclaration:a,expectedStyle:t[bs(i.kind)],scope:e.sourceCode.getScope(a),...i});if(s)return s}})},meta:{type:"suggestion",docs:{description:"Enforce consistent default export declarations.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{functions:bn(),classes:bn()},additionalProperties:!1}],defaultOptions:[{functions:x4,classes:x4}],messages:{[x8]:"Prefer declaring this default-exported {{kind}} inline.",[x6]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[x9]:"Use an inline default {{kind}} declaration.",[x5]:"Use a separate const arrow function default export."},languages:["js/js"]}};function bE(e){for(;;){let t=rg(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function bD(e,t){return ei(t.sourceCode.getScope(e),e)}let bS="no-array-concat-in-loop",bv="no-array-front-mutation",bC=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],bA="no-array-sort-for-min-max/error",bT="no-array-sort-for-min-max/suggestion",bw=e=>e8(e)&&0===e.value,bk=(e,t)=>{if(!td(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||rK(e.callee.object,t)||ry(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tl(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rg((e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(e));if(t?.type!=="BinaryExpression"||"-"!==t.operator)return;let[r,n]=e.params;if(r.name!==n.name){if(tQ(t.left,r)&&tQ(t.right,n))return"ascending";if(tQ(t.left,n)&&tQ(t.right,r))return"descending"}})(r);if(n)return{direction:n,node:e.callee.object}},bI=(e,t,r,n)=>{var o,a,i;let s=(o=t.direction,"first"===r?"ascending"===o?"min":"max":"ascending"===o?"max":"min"),l={node:e,messageId:bA,data:{method:s,extreme:"min"===s?"minimum":"maximum"}};if("Super"!==t.node.type&&0===n.sourceCode.getCommentsInside(e).length){let r,o=(a=t.node,i=n.sourceCode,r=nL(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:bT,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},bj="no-boolean-sort-comparator",bF="no-boolean-sort-comparator/suggestion",bB=new Set(["sort","toSorted"]),b$=new Set([">",">=","<","<="]),bR=(e,t,r,n)=>(e=rg(e),t=rg(t),"Identifier"===e.type&&"Identifier"===t.type)?e.name===r.name&&t.name===n.name||e.name===n.name&&t.name===r.name:"MemberExpression"===e.type&&"MemberExpression"===t.type&&e.computed===t.computed&&(e.computed?!!tQ(e.property,t.property):e.property.name===t.property.name)&&bR(e.object,t.object,r,n),bP=(e,t)=>{for(;rf(e);){if(e.typeAnnotation&&nc(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},bL="no-chained-comparison/error",bN="no-chained-comparison/suggestion",bM=new Set(["<",">","<=",">="]),bO=new Set(["===","!==","==","!="]),bq=new Set([...bM,...bO]),bU=e=>"BinaryExpression"===e.type&&bq.has(e.operator),bW="no-constant-zero-expression/error",b_="no-constant-zero-expression/suggestion",bV="no-duplicate-logical-operands",bz="no-duplicate-logical-operands/suggestion",bK=new Set(["Identifier","ThisExpression","Literal"]),bG=new Set(["Identifier","ThisExpression"]),bJ=e=>{if(lh(e=rg(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return bJ(e.object)&&(!e.computed||(t=rg(t=e.property),bK.has(t.type)));default:return!1}},bX="no-impossible-length-comparison",bY={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},bH="no-invalid-character-comparison",bZ=new Set(["==","===","!=","!=="]),bQ=(e,t)=>!!(td(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&nv(e.callee.object,t)||td(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&nv(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(e8(e))return!0;if(!e1(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&nv(e.object,t),b0="no-loop-iterable-mutation",b1=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],b2=["add","clear","delete"],b3=["clear","delete","set"],b8={array:new Set(b1),set:new Set(b2),map:new Set(b3),unknown:new Set([...b1,...b2,...b3])},b6=new Set(["entries","keys","values"]),b9=new Set(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function b5(e,t){return rz(e,t)?"array":rX(e,t)?"set":rY(e,t)?"map":void 0}function b4(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function b7(e){return"Identifier"===(e=rg(e)).type?e:void 0}function Ee(e){if("ArrayPattern"!==(e=rg(e)).type)return;let[t]=e.elements;return t&&b7(t)}function Et(e,t){if(lh(e=rg(e)))return;if(ly(e))return{collectionKind:b5(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eI(e.callee,t.sourceCode.getScope(e.callee));if(!(!b6.has(r)||lh(e.callee.object))&&ly(e.callee.object))return{collectionKind:b5(e.callee.object,t),reference:e.callee.object,method:r}}function Er(e,t){let r=b4(e);return"keys"===t.method?b7(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?Ee(r):void 0}function En(e,t){let r,n;if("VariableDeclaration"!==e.left.type||"const"!==e.left.kind)return{collectionKind:t.collectionKind,iterable:t.reference,loopBody:e.body};let o=(r=b4(e),"entries"===t.method?Ee(r):"direct"!==t.method||"map"!==t.collectionKind?b7(r):void 0),a=Er(e,t),i=(n=b4(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?b7(n):"direct"===t.method&&"map"!==t.collectionKind?b7(n)??Ee(n):Er(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*Eo(e){"Identifier"===(e=rg(e)).type?yield e:"MemberExpression"===e.type&&(yield*Eo(e.object),e.computed&&(yield*Eo(e.property)))}function Ea(e,t,r){if(!lg(e,t))return!1;let n=[...Eo(e)],o=[...Eo(t)];return n.length!==o.length||0===n.length?n.length===o.length:n.every((e,t)=>{var n;let a,i;return n=o[t],a=ei(r.sourceCode.getScope(e),e),i=ei(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function Ei(e,t,r){let[n]=e.arguments;return!!(t&&n&&Ea(n,t,r))}function Es(e,t,r,n){return"add"===r&&Ei(e,t.addArgumentIdentifier,n)||"set"===r&&Ei(e,t.setKeyIdentifier,n)}let El="no-selector-as-dom-name",Eu=["add","remove","contains","toggle","replace"],Ep=/^[#.]-?[A-Z_a-z][\w-]*$/u,Ec=new Set([".","#"]),Ed=e=>Ec.has(e?.[0]),Em=e=>e3(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),Ef=(e,t,r,n)=>({node:e,messageId:El,fix:((e,t,r,n)=>{let o=((e,t)=>{let[r]=t.getRange(e);return[r+1,r+2]})(e,n);if(t.startsWith(r)&&n.text[o[0]]===r){if("TemplateLiteral"===e.type&&e.expressions.length>0){if(1!==e.expressions.length||e.quasis[0].value.cooked!==r||""!==e.quasis[1].value.cooked)return;return e=>e.removeRange(o)}if(Ep.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),Eg=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),Ey="no-useless-compound-assignment/error",Eh="no-useless-compound-assignment/remove",Ex="no-useless-compound-assignment/replace",Eb=new Map([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),EE="no-useless-delete-check",ED="removeCheck",ES={considerGetters:!0},Ev=new Set(["Map","Set","WeakMap","WeakSet"]),EC=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),EA=new Set(["ClassName","FunctionName"]),ET=new Set(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),Ew=e=>null!==e&&("object"==typeof e||"function"==typeof e),Ek=e=>!!ET.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>Ek(e)),EI=(e,t)=>{if("Identifier"!==e.type)return!1;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.some(e=>EA.has(e.type))??!1},Ej=(e,t)=>{let r=ew(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!Ew(r.value)?String(r.value):void 0},EF=(e,t)=>{let r=ew(e,t.sourceCode.getScope(e));if(r)return Ew(r.value);let n=ro(rg(e),t);if(n){let e=rg(n),r=ew(e,t.sourceCode.getScope(e));if(r)return Ew(r.value);if(EC.has(e.type))return!0}return!EI(rg(e),t)&&Ek(((e,t)=>{if("Identifier"!==(e=rg(e)).type)return;let r=ei(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},EB=(e,t)=>!eP(e,t.sourceCode,ES),E$=(e,t)=>td(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),ER=(e,t,r)=>n=>{if(re(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),nU(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},EP="no-useless-logical-operand",EL=new Map([["&&",!0],["||",!1]]),EN=new Map([["&&",!1],["||",!0]]),EM=new Set(["FunctionExpression","ClassExpression","ObjectExpression"]),EO="prefer-boolean-return",Eq=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function EU(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return EU(t[0])}return e}}let EW=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function E_(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return Eq.has(e.operator);case"LogicalExpression":return E_(e.left,t)&&E_(e.right,t);case"CallExpression":return tC(e,t)||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.optional&&!e.callee.computed&&"Identifier"===e.callee.object.type&&"Array"===e.callee.object.name&&t.sourceCode.isGlobalReference(e.callee.object)&&"Identifier"===e.callee.property.type&&"isArray"===e.callee.property.name;default:return!1}}let EV="prefer-flat-math-min-max",Ez=["min","max"],EK=(e,t)=>td(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),EG=(e,t)=>{let r=[];for(let n of e.arguments){if(EK(n,t)){r.push(...EG(n,t));continue}r.push(n)}return r},EJ="prefer-hoisting-branch-code/start",EX="prefer-hoisting-branch-code/end",EY="prefer-hoisting-branch-code/suggestion",EH=new Set(["await using","using"]);function EZ(e,t){if("TaggedTemplateExpression"===e.type||eP(e,t))return!0;for(let r of t.visitorKeys[e.type]??[]){let n=e[r];if(Array.isArray(n)){for(let e of n)if(e&&EZ(e,t))return!0;continue}if(n&&EZ(n,t))return!0}return!1}let EQ=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},E0=(e,t,r)=>{let n=EQ(e,r),o=EQ(t,r);return 0!==n.length&&n.length===o.length&&n.every((e,t)=>e.type===o[t].type&&e.value===o[t].value)};function E1(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e;if(n){let[e]=a.getRange(i[0]),[r]=a.getRange(i[t]);return[e,r]}let[,s]=a.getRange(i[i.length-r-1]),[,l]=a.getRange(i.at(-1));return[s,l]}function E2({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){var i;let{sourceCode:s}=a,l=t[0].body,u=o?l.slice(0,r):l.slice(l.length-n),p=u.every(e=>!rn(e))&&function(e){let{parent:t}=e;return["Program","BlockStatement","StaticBlock","SwitchCase"].includes(t.type)}(e)&&!((i={leading:r,trailing:n,isStart:o}).isStart&&((e,t)=>{let{sourceCode:r}=t,[n]=r.getRange(e),o=r.getTokenBefore(e);return re(t,[o?r.getRange(o)[1]:0,n])})(e,a)||!i.isStart&&((e,t)=>{let{sourceCode:r}=t,n=r.getCommentsAfter(e)[0];return!!(n&&r.getLoc(n).start.line===r.getLoc(e).end.line)})(e,a)||t.some(e=>{let{sourceCode:t}=a,[r]=t.getRange(e),[n]=t.getRange(e.body[0]);if(i.isStart&&re(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(re(a,[r,n-1]))return!0}return re(a,E1(e,i,a))}))&&(o||t.every(e=>!function(e,t,r){let{sourceCode:n}=r,{body:o}=e,[a]=n.getRange(o[o.length-t]),[i,s]=n.getRange(e);for(let t of n.getScope(e).variables){let[e]=t.defs;if(!e||e.parent?.type==="VariableDeclaration"&&"var"===e.parent.kind)continue;let[r]=n.getRange(e.name);if(!(r<=i)&&!(r>=a)){if(e.parent?.type==="VariableDeclaration"&&EH.has(e.parent.kind))return!0;for(let e of t.references){let[t]=n.getRange(e.identifier);if(t>=a&&t<=s)return!0}}}return!1}(e,n,a))),c={loc:{start:s.getLoc(u[0]).start,end:s.getLoc(u.at(-1)).end},messageId:o?EJ:EX};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=t8(e,a),l=o?r:n,u=t[0].body,p=o?u.slice(0,l):u.slice(u.length-l),c=function(e,t,r){let{sourceCode:n}=r,[o]=n.getRange(e[0]),[,a]=n.getRange(e.at(-1)),i=n.text.slice(o,a),s=t8(e[0],r);return s===t?i:i.split("\n").map((e,r)=>0===r?e:e.startsWith(s)?`${t}${e.slice(s.length)}`:e).join("\n")}(p,s,a);return function*(l){if(o){let t=i.getTokenBefore(e),r=t&&nU(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
21
- ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&nU(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
22
- ${s}${c}${n}`)}for(let e of t)yield l.removeRange(E1(e,{leading:r,trailing:n,isStart:o},a))}}({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a);!o||function(e,t){for(let r=e;r?.type==="IfStatement";r=r.alternate)if(EZ(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!EZ(e,s))?c.fix=i:c.suggest=[{messageId:EY,fix:i}]}return c}let{parse:E3}=id,E8="prefer-single-replace",E6=new Set(["g","m","s"]),E9=new Map([["\\",String.raw`\\`],["]",String.raw`\]`],["\n",String.raw`\n`],["\r",String.raw`\r`],[" ",String.raw`\t`],["\f",String.raw`\f`],["\v",String.raw`\v`],["\u2028",String.raw`\u2028`],["\u2029",String.raw`\u2029`]]);function E5(e){if(!td(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(e1(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(e6(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!E6.has(e))return;try{r=E3(e,t,{namedGroups:!0,lookbehind:!0})}catch{return}return function e(t){return"value"===t.type?String.fromCodePoint(t.codePoint):("alternative"!==t.type||1!==t.body.length)&&("characterClass"!==t.type||t.negative||1!==t.body.length)?void 0:e(t.body[0])}(r)}}(t.regex)}let E4={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return E4}},rules:{"sukka/unicorn/prefer-node-protocol":"error","sukka/unicorn/prefer-import-meta-properties":"error","no-process-exit":"off","sukka/unicorn/no-process-exit":"warn","no-buffer-constructor":"off","sukka/unicorn/no-new-buffer":"error"}},comment:{name:"@eslint-sukka/eslint-plugin-sukka-full comments preset",plugins:{get sukka(){return E4}},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"]}},recommended:{...u.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return E4}},rules:{...u.eslint_plugin_sukka.configs.recommended.rules,"sukka/prefer-single-boolean-return":"off","sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn"}},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return E4}},rules:{"sukka/unicorn/no-lonely-if":"error","sukka/unicorn/no-negated-condition":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{checkUsedVariables:!1}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/prefer-unicode-code-point-escapes":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-code-point":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","sukka/unicorn/consistent-template-literal-escape":"error","sukka/unicorn/no-useless-iterator-to-array":"error","sukka/unicorn/prefer-simple-condition-first":"error","sukka/unicorn/switch-case-break-position":"error","sukka/unicorn/better-dom-traversing":"warn","sukka/unicorn/no-blob-to-file":"error","sukka/unicorn/no-canvas-to-image":"warn","sukka/unicorn/no-confusing-array-splice":"error","sukka/unicorn/no-duplicate-set-values":"error","sukka/unicorn/no-incorrect-query-selector":"error","sukka/unicorn/no-invalid-file-input-accept":"error","sukka/unicorn/no-late-current-target-access":"error","sukka/unicorn/no-unused-array-method-return":"error","sukka/unicorn/prefer-array-last-methods":"warn","sukka/unicorn/prefer-math-abs":"warn","sukka/unicorn/prefer-split-limit":"warn","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"error","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":"warn","sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"warn","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"warn","sukka/unicorn/no-optional-chaining-on-undeclared-variable":"error","sukka/unicorn/no-object-methods-with-collections":"error","sukka/unicorn/no-subtraction-comparison":"warn","sukka/unicorn/no-unnecessary-global-this":"warn","sukka/unicorn/no-useless-else":"error","sukka/unicorn/no-useless-recursion":"error","sukka/unicorn/prefer-add-event-listener-options":"warn","sukka/unicorn/prefer-direct-iteration":"warn","sukka/unicorn/prefer-number-is-safe-integer":"warn","sukka/unicorn/prefer-object-define-properties":"warn","sukka/unicorn/prefer-object-destructuring-defaults":"warn","sukka/unicorn/prefer-single-object-destructuring":"warn","sukka/unicorn/prefer-smaller-scope":"warn","sukka/unicorn/prefer-single-array-predicate":"warn","sukka/unicorn/prefer-url-href":"warn","sukka/unicorn/require-proxy-trap-boolean-return":"error","sukka/unicorn/logical-assignment-operators":"error","sukka/unicorn/no-useless-coercion":"error","sukka/unicorn/no-useless-boolean-cast":"warn","sukka/unicorn/no-useless-continue":"error","sukka/unicorn/no-useless-override":"error","sukka/unicorn/prefer-has-check":"warn","sukka/unicorn/consistent-conditional-object-spread":"error","sukka/unicorn/no-boolean-sort-comparator":"error","sukka/unicorn/no-chained-comparison":"error","sukka/unicorn/no-constant-zero-expression":"error","sukka/unicorn/no-duplicate-logical-operands":"error","sukka/unicorn/no-impossible-length-comparison":"error","sukka/unicorn/no-invalid-character-comparison":"error","sukka/unicorn/no-loop-iterable-mutation":"error","sukka/unicorn/no-selector-as-dom-name":"error","sukka/unicorn/no-array-concat-in-loop":"error","sukka/unicorn/no-array-front-mutation":"warn","sukka/unicorn/no-array-sort-for-min-max":"warn","sukka/unicorn/no-useless-compound-assignment":"warn","sukka/unicorn/no-useless-delete-check":"warn","sukka/unicorn/no-useless-logical-operand":"error","sukka/unicorn/prefer-boolean-return":"warn","sukka/unicorn/prefer-flat-math-min-max":"warn","sukka/unicorn/prefer-hoisting-branch-code":"warn","sukka/unicorn/prefer-single-replace":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return E4}},rules:{"sukka/unicorn/no-nested-ternary":"warn","sukka/unicorn/filename-case":["error",{cases:{kebabCase:!0,snakeCase:!0},ignore:[/fixtures/i,/^_/,/^\./,/rc$/i,/\.(md|json|yaml|toml|yml|ini|conf|jsonc|json5)$/i]}],"sukka/unicorn/no-unnecessary-nested-ternary":"error","sukka/unicorn/no-unreadable-object-destructuring":"error","sukka/unicorn/consistent-compound-words":"warn","sukka/unicorn/default-export-style":"warn"}},recommended_extra_with_typed_lint:{...u.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return E4}},rules:{...u.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint.rules,"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/no-default-error":"off"}},recommended_react:{...u.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return E4}}}},rules:Object.assign(u.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":A,"browser/prefer-location-assign":w,"jsx/no-template-literal":I,"jsx/no-unneeded-nested":j,"string/no-locale-case":B,"string/no-simple-template-literal":$,"unicode/no-bidi":q,"unicode/no-invisible":W,"no-redundant-variable":_,"no-single-return":z,"prefer-early-return":G,"prefer-fetch":J,"prefer-timer-id":H,"string/no-unneeded-to-string":Z,"type/no-force-cast-via-top-type":Q,"type/no-wrapper-type-reference":et,"no-default-error":er},Object.fromEntries(Object.entries({"unicorn/catch-error-name":pU,"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>p7(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return p7(e,t.right)}),e.on("AssignmentExpression",e=>{if("MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"exports"===e.left.object.name){let t=e.right;if("ClassExpression"!==t.type||!pH(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:pW,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[pW]:"Exported error name should match error class",[p_]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[pV]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[pz]:"Error constructors should accept `options` as the second parameter.",[pK]:"Error constructors should use `options` as the second parameter.",[pG]:"Pass the error message to `super()` as the first argument.",[pJ]:"Pass `options` to `super()` as the second argument."},languages:["js/js"]}},"unicorn/no-nested-ternary":{create:e=>{e.on("ConditionalExpression",t=>{if([t.test,t.consequent,t.alternate].some(e=>"ConditionalExpression"===e.type))return;let{sourceCode:r}=e,n=r.getAncestors(t).toReversed(),o=n.findIndex(e=>"ConditionalExpression"!==e.type);return 1!==o||eQ(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:oa}:void 0:{node:t,messageId:oi,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[oa]:"Do not nest ternary expressions.",[oi]:"Nested ternary expression should be parenthesized."},languages:["js/js"]}},"unicorn/prefer-event-target":{create:e=>{e.on("Identifier",t=>{if("EventEmitter"!==t.name||("ClassDeclaration"!==t.parent.type&&"ClassExpression"!==t.parent.type||t.parent.superClass!==t)&&("NewExpression"!==t.parent.type||t.parent.callee!==t))return;let r=e.sourceCode.getScope(t);if(!function(e){if(!e)return!1;let t=function(e,t){let r=e=>e.type===t;for(;e.parent;e=e.parent)if(r(e))return e}(e,"ImportDeclaration");return!!(ol.has(t?.source.value)||"Property"===e.parent.type&&e.parent.value===e&&"Identifier"===e.parent.key.type&&"EventEmitter"===e.parent.key.name&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)&&ou(e.parent.parent)&&op(e.parent.parent.parent.init))||!!(ou(e)&&tc(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&op(e.parent.init.object))}(ei(r,t)?.defs[0]?.name))return{node:t,messageId:os}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[os]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(of.has(t.name)){for(let r of ob(e,t))if(r.references?.some(e=>ox(t,e.identifier)))return oE(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&of.has(t.key.name)&&"Property"===(r=t.key).parent.type&&r.parent.key===r&&"ObjectPattern"===r.parent.parent.type&&!r.parent.computed){for(let r of ob(e,t))if(oS(t.key,r))return oE(t.key,r);for(let r of ob(e,t))if(oD(t.key,r))return oE(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[od]:"Use `.key` instead of `.{{name}}`.",[om]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tc(t,{property:"innerText"})||r0(t.object,e))return;let r=t.property;return{node:r,messageId:ov,suggest:[{messageId:oC,fix:e=>e.replaceText(r,"textContent")}]}}),e.on("Identifier",t=>{if("innerText"===t.name&&"Property"===t.parent.type&&t.parent.key===t&&!t.parent.computed&&"init"===t.parent.kind&&"ObjectPattern"===t.parent.parent.type&&t.parent.parent.properties.includes(t.parent)&&!((e,t)=>{if(r0(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&r0(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&r0(r.right,t)})(t.parent.parent,e))return{node:t,messageId:ov,suggest:[{messageId:oC,fix:e=>e.replaceText(t,t.parent.shorthand?"textContent: innerText":"textContent")}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.textContent` over `.innerText`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[ov]:"Prefer `.textContent` over `.innerText`.",[oC]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"join",argumentsLength:0,optionalCall:!1})||td(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tb(t.callee.object,{property:"join"}))||0===t.arguments.length&&rJ(t.callee.object,e))return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2),a=1===t.arguments.length;return{loc:{start:r.getLoc(n)[a?"end":"start"],end:r.getLoc(o).end},messageId:oV,fix:r=>oT(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[oV]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of oY)e.on(t??r,function*(t){for(let r of o(t,e))yield{node:r,messageId:n}})},meta:{type:"problem",docs:{description:"Disallow `then` property.",recommended:"unopinionated"},messages:{[oz]:"Do not add `then` to an object.",[oK]:"Do not export `then`.",[oG]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||td(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eh(r,e.sourceCode),messageId:oH}:{node:r.callee.property,messageId:oH}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[oH]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":o6,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!te(r,{name:"Buffer"}))return;let n=((e,t)=>{if(1!==e.length)return"from";let[r]=e;if("SpreadElement"===r.type)return;if("ArrayExpression"===r.type||"TemplateLiteral"===r.type)return"from";if(nt(r,t))return"alloc";let n=ew(r,t);if(n){let{value:e}=n;if("string"==typeof e||Array.isArray(e))return"from"}})(r.arguments,t.getScope(r));return n?{node:r,messageId:o9,data:{method:n},fix:o7(r,e,n)}:{node:r,messageId:o5,suggest:["from","alloc"].map(t=>({messageId:o4,data:{replacement:t},fix:o7(r,e,t)}))}})},meta:{type:"problem",docs:{description:"Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[o9]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[o5]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[o4]:"Switch to `Buffer.{{replacement}}()`."},languages:["js/js"]}},"unicorn/no-console-spaces":{create:e=>{let{sourceCode:t}=e,r=(r,n,o)=>{let[a,i]=t.getRange(r),s="leading"===o?a+1:i-2,l=[s,s+1];return{loc:n4(l,e),messageId:ae,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!td(e,{object:"console",methods:["log","debug","info","warn","error"],minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let n=e.callee.property.name,{arguments:o}=e,{length:a}=o;for(let[e,i]of o.entries()){if(!e1(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&at(o)&&(yield r(i,n,"leading")),e!==a-1&&ar(o)&&(yield r(i,n,"trailing"))}})},meta:{type:"suggestion",docs:{description:"Do not use leading/trailing space between `console.log` parameters.",recommended:"unopinionated"},fixable:"code",messages:{[ae]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":ao,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(ta(t)&&"LogicalExpression"===t.parent.type&&t.parent.right===t&&("||"===t.parent.operator||"??"===t.parent.operator)&&"SpreadElement"===t.parent.parent.type&&t.parent.parent.argument===t.parent&&"ObjectExpression"===t.parent.parent.parent.type&&t.parent.parent.parent.properties.includes(t.parent.parent))return{node:t,messageId:aa,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=eQ(i,e),[,l]=s?eH(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield oA(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[aa]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new Set,n=new Set,o=new Set,a=new Set;e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tc(e.left,{property:"length",optional:!1})&&tE(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("CallExpression",t=>{td(t,{optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===t.callee.property.type&&!rK(t.callee.object,e)&&("some"===t.callee.property.name?o.add(t):"every"===t.callee.property.name&&a.add(t))}),e.on("LogicalExpression",e=>{tE(e)&&t.push(e)}),e.on("Program:exit",function*(){let i=new Set(t.flatMap(e=>(function(e){let{operator:t}=e;return(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(e).filter((e,i,s)=>(function({node:e,operator:t,siblings:i}){return"||"===t&&r.has(e)&&i.some(t=>a.has(t)&&tQ(e.left.object,t.callee.object))||"&&"===t&&n.has(e)&&i.some(t=>o.has(t)&&tQ(e.left.object,t.callee.object))})({node:e,operator:t,siblings:[s[i-1],s[i+1]].filter(Boolean)}))})(e))),{sourceCode:s}=e;for(let t of i)yield{loc:{start:s.getLoc(t.left.property).start,end:s.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=eH(n,e),i=eH(o,e),s=[];return n===t?(s[0]=a[0],s[1]=i[0]):(s[0]=a[1],s[1]=i[1]),r.removeRange(s)}}})},meta:{type:"suggestion",docs:{description:"Disallow useless array length check.",recommended:"unopinionated"},fixable:"code",messages:{"non-zero":"The non-empty check is useless as `Array#some()` returns `false` for an empty array.",zero:"The empty check is useless as `Array#every()` returns `true` for an empty array."},languages:["js/js"]}},"unicorn/no-useless-promise-resolve-reject":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===t.parent.type&&t.parent.body===t||"ReturnStatement"===t.parent.type&&t.parent.argument===t||"YieldExpression"===t.parent.type&&!t.parent.delegate&&t.parent.argument===t)))return;let{functionNode:r,isInTryStatement:n}=function(e){let t,r=!1;for(;e;e=e.parent){if(tl(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(r&&(r.async||function(e){if("CallExpression"===e.parent.type&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&"Identifier"===e.parent.callee.property.type){let{callee:{property:t},arguments:r}=e.parent;if(1===r.length&&["then","catch","finally"].includes(t.name)&&r[0]===e||2===r.length&&"then"===t.name&&(r[0]===e||"SpreadElement"!==r[0].type&&r[1]===e))return!0}return!1}(r)))return function(e,t){let{callee:r,parent:n}=e,o=r.property.name;return{node:r,messageId:o,data:{type:"YieldExpression"===n.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,parent:o,arguments:a}=e,[i]=a;if(i?.type==="SpreadElement")return;let s="reject"===n.property.name,l="YieldExpression"===o.type;if(!s||!t&&(!l||"ExpressionStatement"===o.parent.type))return function(t){let n="ArrowFunctionExpression"===o.type,a=i?r.sourceCode.getText(i):"";if(i?.type==="SequenceExpression"&&(a=`(${a})`),s){if(a||="undefined",a=`throw ${a}`,l)return t.replaceTextRange(eH(o,r),a);if(a+=";",n)return a=`{ ${a} }`,t.replaceTextRange(eH(e,r),a)}else l?a=`yield${a?" ":""}${a}`:"ReturnStatement"===o.type?a=`return${a?" ":""}${a};`:(i?.type==="ObjectExpression"&&(a=`(${a})`),a||="{}");return t.replaceText(n?e:o,a)}}(t,n,e))})},meta:{type:"suggestion",docs:{description:"Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks",recommended:"unopinionated"},fixable:"code",messages:{resolve:"Prefer `{{type}} value` over `{{type}} Promise.resolve(value)`.",reject:"Prefer `throw error` over `{{type}} Promise.reject(error)`."},languages:["js/js"]}},"unicorn/no-zero-fractions":{create:e=>{e.on("Literal",t=>{if(!e8(t))return;let{raw:r}=t,n=r.match(/^(?<before>[\d_]*)(?<dotAndFractions>\.[\d_]*)(?<after>.*)$/);if(!n)return;let{before:o,dotAndFractions:a,after:i}=n.groups,s=(o+a.replaceAll(/[.0_]+$/g,"")||"0")+i;if(s===r)return;let l="."===a,{sourceCode:u}=e,p=u.getRange(t)[0]+o.length+a.length;return{loc:n4([p-(r.length-s.length),p],e),messageId:l?as:ai,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&nQ.test(s)&&!eQ(t,e)&&(n=`(${n})`,nU(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield oR(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[ai]:"Don't use a zero fraction in the number.",[as]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":ay,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(ts,t=>{if(t.async||t.generator||t.returnType?.type==="TSTypeAnnotation"&&"TSTypePredicate"===t.returnType.typeAnnotation.type||0===t.params.length||"Identifier"!==t.params[0].type||("MethodDefinition"===t.parent.type&&("constructor"===t.parent.kind||"set"===t.parent.kind)||"Property"===t.parent.type&&"set"===t.parent.kind)&&t.parent.value===t)return;let r=function(e){if(("ArrowFunctionExpression"===e.type&&"Identifier"===e.body.type&&e.body.name===e.params[0].name||"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&e.body.body[0].argument?.type==="Identifier"&&e.body.body[0].argument.name===e.params[0].name)&&"CallExpression"===e.parent.type&&!e.parent.optional&&e.parent.arguments[0]===e&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&!e.parent.callee.optional&&"Identifier"===e.parent.callee.property.type&&ab.has(e.parent.callee.property.name))return{replacementFunction:"Boolean",fix:t=>t.replaceText(e,"Boolean")}}(t)||function(e){let t,r=(t=e.params[0].name,"ArrowFunctionExpression"===e.type&&aE(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&aE(e.body.body[0].argument,t)?e.body.body[0].argument:void 0);if(!r)return;let{name:n}=r.callee,o={replacementFunction:n};return"FunctionDeclaration"===e.type||1!==r.arguments.length||(o.fix=t=>{let r=n;return"Property"===e.parent.type&&e.parent.method&&e.parent.value===e?r=`: ${r}`:"MethodDefinition"===e.parent.type&&(r=` = ${r};`),t.replaceText(e,r)}),o}(t);if(!r)return;let{sourceCode:n}=e,{replacementFunction:o,fix:a}=r;return r={node:t,loc:eh(t,n),messageId:ah,data:{functionNameWithKind:ej(t,n),replacementFunction:o}},!a||1!==t.params.length||n.getCommentsInside(t).length>0||(r.fix=a),r})},meta:{type:"suggestion",docs:{description:"Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.",recommended:"unopinionated"},fixable:"code",messages:{[ah]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){aA.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[aC]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":aI,"unicorn/prefer-array-index-of":aL,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!td(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:aN,data:{method:r,replacement:"readAsArrayBuffer"===r?"arrayBuffer":"text"}}})},meta:{type:"suggestion",docs:{description:"Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.",recommended:"unopinionated"},messages:{[aN]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(td(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&aU(e.callee.object)){let t=e.callee.property;return aW(e,{node:t,messageId:aO,data:{method:t.name}})}if(e7(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1})&&aU(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?aW(e,{messageId:aq}):aW(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&aU(t.argument))return aW("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&aU(e.right))return aW(e.right)}),e.on("BinaryExpression",function*(e){if("-"===e.operator||"*"===e.operator||"/"===e.operator||"%"===e.operator||"**"===e.operator)for(let t of[e.left,e.right])aU(t)&&(yield aW(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[aM]:"Prefer `Date.now()` over `new Date()`.",[aO]:"Prefer `Date.now()` over `Date#{{method}}()`.",[aq]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":aQ,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!td(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=a9(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&tQ(e.left,e.right)||"**"===e.operator&&e0(e.right,2)))))return;let n=1===r.length?"abs":"hypot",o=new Set(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:a0,data:{replacement:`Math.${n}(…)`,description:"Math.sqrt(…)"},*fix(a){let{sourceCode:i}=e;for(let r of(yield a.replaceText(t.callee.property,n),o)){let t=i.getTokenAfter(r.left,e=>"Punctuator"===e.type&&"+"===e.value);yield o_(t,",",a,e),yield oA(r,a,e)}for(let t of r)yield a.removeRange([eH(t.left,e)[1],i.getRange(t)[1]])}}}),e.on("BinaryExpression",e=>{t.push(e)}),e.on("Program:exit",function*(){for(let r of t)for(let t of a6){let n=t(r,e);n&&(yield n)}})},meta:{type:"suggestion",docs:{description:"Prefer modern `Math` APIs over legacy patterns.",recommended:"unopinionated"},fixable:"code",messages:{[a0]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":a7,"unicorn/prefer-number-properties":ii,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{optionalCall:!1,optionalMember:!1})||"Literal"===t.callee.object.type||"ArrayExpression"===t.callee.object.type||"ObjectExpression"===t.callee.object.type)return;let{sourceCode:r}=e,n=((e,t)=>{if("apply"===eI(e.callee)&&2===e.arguments.length&&il(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,iu(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===eI(e.callee)&&"apply"===eI(e.callee.object)&&"prototype"===eI(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&il(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,iu(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:is,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[is]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tc(t,{property:"length",optional:!1}))return;let n="ArrayExpression"===(r=t.object).type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:td(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&rX(n,e))return{node:t.property,messageId:ip,fix:function(e,t,r){let{sourceCode:n}=e,{object:o,property:a}=t;if(!(n.getCommentsInside(o).length>n.getCommentsInside(r).length))return function*(i){yield i.replaceText(a,"size");let s=n.getText(r);n1(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield oR(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[ip]:"Prefer using `Set#size` instead of `Array#length`."},languages:["js/js"]}},"unicorn/prefer-string-replace-all":{create:e=>{e.on("CallExpression",t=>{let r,n,o=((e,t)=>{let r;if(!td(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!td(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(nS(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=e3(o);if("string"==typeof i){if(0===i.length)return;r=tF(i)}else if(!(r=(e=>{if(!e6(e)||e.regex.flags.includes("y"))return;let t=iT(e);if(!t||iI(t)||0===ik(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=e3(a);if("string"==typeof s)return`${eZ(n.callee.object,t)}.replaceAll(${r}, ${tF(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:ib,fix:e=>e.replaceText(t,o)};if(!td(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||td(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&e6(r=t.arguments[0])&&r.regex.flags.includes("g")&&!r.regex.flags.includes("y")&&(e=>{if(!e.startsWith("[")||!e.endsWith("]")||e.startsWith("[^"))return;let t=new Set,r=e.slice(1,-1);for(let e=0;e<r.length;e++){let n=r[e],o=!1;if("\\"===n&&(n=r[++e],o=!0,!n)||"-"===n&&!o&&0!==e&&e!==r.length-1||"]"===n&&!o&&0!==e||!ig.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&e1(n=t.arguments[1])&&n.value===im)return;let{arguments:a,callee:{property:i}}=t;if(nS(t.callee.object,e))return;let[s]=a;if(!((e,t)=>{if(e6(e))return e.regex.flags.includes("g");if(te(e,{name:"RegExp"})&&e.arguments[0]?.type!=="SpreadElement"&&e.arguments[1]?.type==="Literal"&&"string"==typeof e.arguments[1].value)return e.arguments[1].value.includes("g");let r=ew(e,t);if(!r)return!1;let{value:n}=r;return"[object RegExp]"===Object.prototype.toString.call(n)&&n.global})(s,e.sourceCode.getScope(s)))return;let l=i.name,u=function(e){if(!e6(e))return;let t=iT(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(iE.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?iA(t.body):iC(t);if(n)return"'"+n+"'"}(s);if("replaceAll"===l){if(!u)return;return{node:s,messageId:ix,data:{replacement:u.length<20?u:"a string literal"},fix:e=>e.replaceText(s,u)}}return{node:i,messageId:ih,*fix(e){yield e.insertTextAfter(i,"All"),u&&(yield e.replaceText(s,u))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[ih]:"Prefer `String#replaceAll()` over `String#replace()`.",[ix]:"This pattern can be replaced with {{replacement}}.",[ib]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["substr","substring"]})||nS(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!td(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(ij(t)&&ij(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&e0(e.right,1))return e.left})(t);return iF(r,t)??(iF(t,r)?r:void 0)??(n&&tQ(n,r)?t:void 0)})(t)))return{node:t,messageId:r,*fix(n,{abort:o}){if(yield n.replaceText(t.callee.property,"slice"),0!==t.arguments.length){if(t.arguments.length>2||t.arguments.some(e=>"SpreadElement"===e.type))return o();yield("substr"===r?function*({node:e,fixer:t,context:r,abort:n}){let o=e.arguments,[a,i]=o;if(!i)return;let{sourceCode:s}=r,l=ew(a,s.getScope(e)),u=eH(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(e8(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!i$(e.left)||!("Identifier"===t.type||e1(t))||!tQ(e.left.object,t)||(o=((e,t)=>{let[r,n]=eH(e,t),o=t.sourceCode.getTokenByRangeStart(r),a=t.sourceCode.getTokenBefore(o);return[t.sourceCode.getRange(a)[1],n]})(e,r),a.getAllComments().some(e=>{let t=a.getRange(e);return t[0]>=o[0]&&t[1]<=o[1]}))))return`-${e.right.raw}`})(i,e.callee.object,r);if(n)return void(yield ok(t,i,n,r));if(e8(i)||i$(i))return;let o=iB(i);return"number"==typeof o?void(yield ok(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>e8(e))){let e;return void(yield(e=String(a.value+i.value),ok(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?iB(o):void 0;if(!a){if(i$(o))return;if(void 0!==i)return void(yield ok(t,o,String(Math.max(0,i)),r));let e=eH(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=iB(a);if(void 0!==i&&void 0!==s){let e=[Math.max(0,i),Math.max(0,s)];i>s&&e.reverse(),e[0]!==i&&(yield ok(t,o,String(e[0]),r)),e[1]!==s&&(yield ok(t,a,String(e[1]),r));return}if(0===i||0===s){let e=eZ(o,r),n=eZ(a,r);yield ok(t,o,"0",r),yield ok(t,a,`Math.max(0, ${0===i?n:e})`,r);return}return n()})({node:t,fixer:n,context:e,abort:o})}}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#slice()` over `String#substr()` and `String#substring()`.",recommended:"unopinionated"},fixable:"code",messages:{substr:"Prefer `String#slice()` over `String#substr()`.",substring:"Prefer `String#slice()` over `String#substring()`."},languages:["js/js"]}},"unicorn/prefer-string-trim-start-end":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||nS(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:iR,data:{method:n,replacement:o},fix:e=>e.replaceText(r,o)}})},meta:{type:"suggestion",docs:{description:"Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.",recommended:"unopinionated"},fixable:"code",messages:{[iR]:"Prefer `String#{{replacement}}()` over `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-unreadable-iife":{create:e=>{e.on("CallExpression",t=>{if("ArrowFunctionExpression"!==t.callee.type||"BlockStatement"===t.callee.body.type||!eQ(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:n4(eH(r,e),e),messageId:iP};return!function(e,t){let{sourceCode:r}=t,[n,o]=eH(e,t),[a,i]=r.getRange(e);return r.getCommentsInside(e.parent).some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(t<a||s>i)})}(r,e)&&(n.suggest=[{messageId:iL,fix:t=>t.replaceTextRange(eH(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[iP]:"IIFE with parenthesized arrow function body is considered unreadable.",[iL]:"Use a block statement body."},languages:["js/js"]}},"unicorn/throw-new-error":{create:e=>{e.on("CallExpression",t=>{if("Decorator"===t.parent.type)return;let{callee:r}=t;if(!(t.optional||ry(r))&&("Identifier"===r.type&&iM.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&iM.test(r.property.name))&&!tc(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:iN,fix:r=>oP(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[iN]:"Use `new` when creating an error."},languages:["js/js"]}},"unicorn/escape-case":{create:e=>{let t="lowercase"===e.options[0];e.on("Literal",e=>{if(e1(e))return i_({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(e6(e))return i_({node:e,original:e.raw,regex:iW,lowercase:t})}),e.on("TemplateElement",r=>{if(!th(r.parent))return i_({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>oW(r,n,e,t)})})},meta:{type:"suggestion",docs:{description:"Require escape sequences to use uppercase or lowercase values.",recommended:"unopinionated"},fixable:"code",schema:[{enum:["uppercase","lowercase"],description:"The case style for escape sequences."}],defaultOptions:["uppercase"],messages:{[iO]:"Use uppercase characters for the value of the escape sequence.",[iq]:"Use lowercase characters for the value of the escape sequence."},languages:["js/js"]}},"unicorn/prefer-unicode-code-point-escapes":{create:e=>{e.on("Literal",e=>e1(e)?i8(e,e.raw):e6(e)?function(e){let t,{raw:r}=e,{pattern:n,flags:o}=(t=r.lastIndexOf("/"),{pattern:r.slice(1,t),flags:r.slice(t+1)}),{fixed:a,hasReplacement:i}=i3(n,{isRegex:!0,supportsNestedCharacterClasses:o.includes("v")}),s=o.includes("u")||o.includes("v"),l=function(e){for(let t=0;t<e.length;t++)if(void 0!==function(e,t){var r;if(!e.startsWith(iK,t))return;let n=t+iK.length;for(;r=e[n],iG.test(r);)n++;if(n===t+iK.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+iK.length,n),16);if(!(o>1114111))return o}(e,t)&&iH(e,t))return!0;return!1}(n);if(!i&&(s||!l))return;let u=`/${i?a:n}/${i6(o)}`;return s?{node:e,messageId:iV,fix:t=>t.replaceText(e,u)}:!function(e,t){try{return new RegExp(e,t),!0}catch{return!1}}(i?a:n,i6(o))?{node:e,messageId:iV}:{node:e,messageId:iV,suggest:[{messageId:iz,fix:t=>t.replaceText(e,u)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!th(t.parent))return i8(t,t.value.raw,(r,n)=>oW(t,n,e,r))})},meta:{type:"suggestion",docs:{description:"Prefer Unicode code point escapes over legacy escape sequences.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[iV]:"Prefer Unicode code point escapes.",[iz]:"Use Unicode code point escapes and add the `u` flag."},languages:["js/js"]}},"unicorn/prefer-prototype-methods":{create:function(e){let{sourceCode:t}=e,r=[];e.on("CallExpression",e=>{r.push(e)}),e.onExit("Program",function*(n){let o=new WeakMap;for(let{node:e,path:r}of new ez(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(i9.map(e=>[e,{[ez.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;td(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:td(e,{methods:["apply","bind","call"],optionalCall:!1,optionalMember:!1})&&(n=e.callee.object);let{isGlobalReference:o,constructorName:a,methodName:i}=function(e,{context:t,globalReferences:r}){if(!e)return;if(r.has(e))return{isGlobalReference:!0,constructorName:"Object",methodName:r.get(e).at(-1)};if(!tc(e,{optional:!1}))return;let n=e.object;if(to(n)||ta(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eI(e,t.sourceCode.getScope(e))}}(n,{context:t,globalReferences:r})??{};if(a)return{node:n,messageId:i?"known-method":"unknown-method",data:{constructorName:a,methodName:i},*fix(r){if(o)return void(yield r.replaceText(n,`${a}.prototype.${i}`));if(tc(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield oR(r,e,t))}}}}(t,{context:e,globalReferences:o})})},meta:{type:"suggestion",docs:{description:"Prefer borrowing methods from the prototype instead of the instance.",recommended:"unopinionated"},fixable:"code",messages:{"known-method":"Prefer using `{{constructorName}}.prototype.{{methodName}}`.","unknown-method":"Prefer using method from `{{constructorName}}.prototype`."},languages:["js/js"]}},"unicorn/error-message":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{if(!(tt(t,{names:i5,optional:!1})&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=st.has(r)?st.get(r):0,o=t.arguments;if(o.some((e,t)=>t<=n&&"SpreadElement"===e.type))return;let a=o[n];if(!a)return{node:t,messageId:i4,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:se};let i=ew(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:se}:""===s?{node:a,messageId:i7}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[i4]:"Pass a message to the `{{constructorName}}` constructor.",[i7]:"Error message should not be an empty string.",[se]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":sl,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(te(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&sy(t.test)))return;let r=e.argument.callee;return{node:r,messageId:su,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[su]:"`new Error()` is too unspecific for a type check. Use `new TypeError()` instead."},languages:["js/js"]}},"unicorn/consistent-destructuring":{create:e=>{let{sourceCode:t}=e,r=new Map,n=[],o=[],a=e=>{let r=rg(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);o.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?ei(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?sE(r):void 0,start:t.getRange(e)[0],scope:n})},i=e=>{switch(e.type){case"MemberExpression":a(e);break;case"AssignmentPattern":i(e.left);break;case"RestElement":i(e.argument);break;case"ObjectPattern":for(let t of e.properties)i("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&i(t)}};e.on("AssignmentExpression",e=>{i(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&i(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&a(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&a(e.argument)}),e.on("VariableDeclarator",e=>{let n;if(!("ObjectPattern"===e.id.type&&"const"===e.parent.kind&&e.init&&("Identifier"===(n=e.init).type||"ThisExpression"===n.type)))return;let o="Identifier"===e.init.type?e.init:void 0,a={scope:t.getScope(e),object:e.init,rootIdentifierName:o?.name,rootVariable:o&&ei(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?sE(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let s=e=>{let n;if(e.computed||tt(e.parent)&&e.parent.callee===e||"TaggedTemplateExpression"===e.parent.type&&e.parent.tag===e||r2(e))return;let a=rg(e.object),i=r.get(t.getText(a));if(!i)return;let s=t.getScope(e),l="Identifier"===a.type?a:void 0,u=l&&ei(s,l),p="ThisExpression"===a.type?sE(a):void 0,c=t.getText(e.property);for(let r of i.toReversed())if(sv({declaration:r,memberExpressionNode:e,memberScope:s,memberRootIdentifier:l,memberRootVariable:u,memberThisScopeBoundary:p,memberExpressionWrites:o,sourceCode:t})&&(n=sS(r.objectPattern.properties.filter(e=>sD(e)&&"Identifier"===e.value.type),c,s,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!sT(n);){if(sA(n,r,e,t))return!0;r=n,n=n.parent}return!1})(e,t))return;if("MemberExpression"===e.parent.type)return{node:e,messageId:sh};let d=t.getText(e),m=n.value.name;return{node:e,messageId:sh,suggest:[{messageId:sx,data:{expression:d,property:m},fix:t=>t.replaceText(e,m)}]}};e.on("MemberExpression",e=>{n.push(e)}),e.onExit("Program",function*(){for(let e of n){let t=s(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[sh]:"Use destructured variables over properties.",[sx]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{sB.listen({context:e}),s$.listen({context:e}),sR.listen({context:e}),sP.listen({context:e})},meta:{type:"suggestion",docs:{description:"Enforce correct use of `new` for builtin constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{enforce:"Use `new {{name}}()` instead of `{{name}}()`.",disallow:"Use `{{name}}()` instead of `new {{name}}()`.",disallowCallOrNew:"`{{name}}` is not a function or constructor.",[sI]:"Use `String(new Date())` instead of `Date()`.",[sj]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":sU,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>td(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tf(e)&&s_(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&s_(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&td(e,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&n.push(e)}),e.onExit("Program",function*(){if(!r)for(let e of n)yield{node:e,messageId:sW}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[sW]:"Only use `process.exit()` in CLI apps. Throw an error instead."},languages:["js/js"]}},"unicorn/no-static-only-class":{create:function(e){e.on(["ClassDeclaration","ClassExpression"],t=>{if(!(t.superClass||t.decorators&&t.decorators.length>0||"ClassBody"!==t.body.type||0===t.body.body.length||t.body.body.some(e=>!function(e){let{private:t,static:r,declare:n,readonly:o,accessibility:a,decorators:i,key:s}=e;return!(!sQ(e)&&"MethodDefinition"!==e.type||!r||t||"PrivateIdentifier"===s.type||n||o||void 0!==a||Array.isArray(i)&&i.length>0)}(e))))return{node:t,loc:function(e,t){let{sourceCode:r}=t,{body:n}=e,o=r.getTokenBefore(n),{start:a}=r.getLoc(e),{end:i}=r.getLoc(o);return{start:a,end:i}}(t,e),messageId:sH,fix:function(e,t){let{type:r,id:n,body:o,declare:a,abstract:i,implements:s,parent:l}=e;if(a||i||Array.isArray(s)&&s.length>0||"ClassExpression"===r&&n)return;let u="ClassDeclaration"===e.type&&"ExportDefaultDeclaration"===e.parent.type&&e.parent.declaration===e;if(u&&n)return;let{sourceCode:p}=t;for(let e of o.body)if(sQ(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(tw(a,{expected:{type:"Keyword",value:"class"},ruleId:"no-static-only-class"}),u||"ClassExpression"===r)if("ClassExpression"===r&&"ReturnStatement"===l.type&&p.getLoc(o).start.line!==p.getLoc(l).start.line&&p.text.slice(p.getRange(a)[1],p.getRange(o)[0]).trim()){yield n.replaceText(a,"{");let e=p.getFirstToken(o);yield n.remove(e)}else yield n.replaceText(a,""),yield oF(a,t,n);else yield n.replaceText(a,"const"),yield n.insertTextBefore(o,"= "),yield n.insertTextAfter(o,";");for(let e of o.body)yield function*(e,t,r){let{sourceCode:n}=t,o=n.getFirstToken(e);tw(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield oF(o,t,r);let a=sQ(e)?n.getLastToken(e):n.getTokenAfter(e),i=ep(a);if(sQ(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,sZ);yield r.replaceText(e,":")}else i?yield r.insertTextBefore(a,": undefined"):yield r.insertTextAfter(e,": undefined")}yield i?r.replaceText(a,","):r.insertTextAfter(e,",")}(e,t,n)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow classes that only have static members.",recommended:"unopinionated"},fixable:"code",messages:{[sH]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":s2,"unicorn/no-useless-spread":{create:e=>{let{sourceCode:t}=e;e.on(["ArrayExpression","ObjectExpression"],r=>{if(!("SpreadElement"===r.parent.type&&r.parent.argument===r&&("ObjectExpression"===r.type&&"ObjectExpression"===r.parent.parent.type&&r.parent.parent.properties.includes(r.parent)||"ArrayExpression"===r.type&&("ArrayExpression"===r.parent.parent.type&&r.parent.parent.elements.includes(r.parent)||tt(r.parent.parent)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:s3,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:la[a]}};return"NewExpression"===a&&lo(r)&&te(n.parent,{names:lt,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield oA(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),eu(u)&&(yield i.remove(u)),to(r)||ta(r)){let e=t.getTokenAfter(n);eu(e)&&(yield i.remove(e))}if("CallExpression"===a||"NewExpression"===a)for(let[e,n]of(s=t.getFirstToken(r),r.elements.map((e,n,o)=>{if(n===o.length-1){let e=t.getLastToken(r,{skip:1});return eu(e)?e:void 0}let a=t.getTokenAfter(e||s,eu);return s=a,a})).entries())null===r.elements[e]&&(yield i.insertTextBefore(n,"undefined"))}}}),e.on("ObjectExpression",r=>{if(!("ObjectExpression"===r.type&&r.properties.length>0&&r.properties.every(e=>"SpreadElement"===e.type&&"ObjectExpression"!==e.argument.type)))return;let n=r.parent;if(!td(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let o=n.arguments.indexOf(r),a=n.arguments.slice(0,o).some(e=>"SpreadElement"!==e.type);if(o<=0||!a)return;let i={node:t.getFirstToken(r.properties[0]),messageId:s4};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:le,fix:t=>t.replaceText(r,r.properties.map(t=>eZ(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(te(e,{names:lt,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:s5,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!lo(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(te(r,{names:lt,argumentsLength:1})||te(r,{names:rb,minimumArguments:1})||td(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(r,{objects:["Array",...rb],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=s8;switch(r.type){case"ForOfStatement":o=s6;break;case"YieldExpression":o=s9;break;case"NewExpression":n=`new ${r.callee.name}(…)`;break;case"CallExpression":n=`${r.callee.object.name}.${r.callee.property.name}(…)`}return{node:t,messageId:o,data:{parentDescription:n},fix:r=>li(r,t,e)}}),e.on("ArrayExpression",t=>{if(!lo(t))return;let r=t.elements[0].argument,n=!!td(r,{methods:ln,optionalCall:!1,optionalMember:!1})&&rz(r.callee.object,e)&&rz(r,e);if(!n&&!(!rK(r,e)&&(td(r,{methods:lr,optionalCall:!1,optionalMember:!1})?!ls(r,e):td(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||ls(r,e)):td(r,{method:"split",optionalCall:!1,optionalMember:!1})||td(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&td(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||te(r,{name:"Array"}))))return;let o={node:t,messageId:s7};return te(r,{name:"Array"})||td(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>li(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[s3]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[s8]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[s6]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[s9]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[s5]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[s4]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[s7]:"Unnecessarily cloning an array.",[le]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=rl(e.physicalFilename);e.on("SwitchStatement",function*(r){let{cases:n}=r;if(!(n.length<2)&&null===n.at(-1).test)for(let r=n.length-2;r>=0;r--){let o=n[r];if(!lp(o))break;t&&lc(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ec);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:ll,suggest:[{messageId:lu,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[ll]:"Useless case in switch statement.",[lu]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":lF,"unicorn/numeric-separators-style":lP,"unicorn/prefer-array-find":l2,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"flat",optionalCall:!1,optionalMember:!1})&&(0===t.arguments.length||1===t.arguments.length&&"Literal"===t.arguments[0].type&&"1"===t.arguments[0].raw)&&td(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(ty(r.callee.object,l9)||rJ(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=t4(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield oM(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:l3,fix:a}}),e.on("CallExpression",t=>{if(!td(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let r=t.callee.object;if(!td(r,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||r.typeArguments||r.typeParameters||ry(r.callee.object)||rK(r.callee.object,e))return;let{sourceCode:n}=e;if(n.getCommentsInside(t).length>0)return;let[o]=r.arguments,[a]=t.arguments;if(!l4(o)||!l4(a))return;let[i]=o.params,[s]=a.params;if(!nF(i,s))return;let l=function(e,t){if(eQ(e,t))return eZ(e,t);let r=t.sourceCode.getText(e);return n1(e,t)?`(${r})`:r}(r.callee.object,e),u=n.getText(i),p=function(e,t){if(eQ(e,t))return eZ(e,t);let r=t.sourceCode.getText(e);return l5.has(e.type)?`(${r})`:r}(o.body,e),c=function(e,t){if(eQ(e,t))return eZ(e,t);let r=t.sourceCode.getText(e);return nZ(e)?`(${r})`:r}(a.body,e);return{node:t.callee.property,messageId:l8,suggest:[{messageId:l6,fix:e=>e.replaceText(t,`${l}.flatMap(${u} => ${p} ? ${c} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[l3]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[l8]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[l6]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":us,"unicorn/prefer-array-some":uc,"unicorn/prefer-code-point":{create:e=>{e.on("CallExpression",e=>{if(td(e,{method:"charCodeAt",optionalCall:!1}))return ud(e.callee.property,"codePointAt")}),e.on("MemberExpression",e=>{if(tc(e,{object:"String",property:"fromCharCode",optional:!1}))return ud(e.property,"fromCodePoint")})},meta:{type:"suggestion",docs:{description:"Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{"error/charCodeAt":"Prefer `String#codePointAt()` over `String#charCodeAt()`.","error/fromCharCode":"Prefer `String.fromCodePoint()` over `String.fromCharCode()`.","suggestion/codePointAt":"Use `String#codePointAt()`.","suggestion/fromCodePoint":"Use `String.fromCodePoint()`."},languages:["js/js"]}},"unicorn/prefer-default-parameters":{create:e=>{let{sourceCode:t}=e,r=[],n=(e,n,o,a)=>{let i,s=r.at(-1);if(!s||!n||!o||"Identifier"!==n.type||"LogicalExpression"!==o.type||"||"!==o.operator&&"??"!==o.operator||"Identifier"!==o.left.type||"Literal"!==o.right.type)return;let{name:l}=n,{left:{name:u},right:{raw:p}}=o;if(a&&l!==u)return;let c=ei(t.getScope(e),u);if(!c)return;let{references:d}=c,{params:m}=s,f=m.find(e=>"Identifier"===e.type&&e.name===u);if(((e,t,r)=>{for(let n of t.body.body){if(n===r)break;if(uy(e,n))return!0}return!1})(t,s,e)||a&&d[0].identifier!==n||!a&&d.length>1||(i=m.at(-1),!f||f!==i))return;let g=((e,t)=>{if("ArrowFunctionExpression"!==t.type||t.params.length>1)return!1;let[r]=t.params,n=e.getTokenBefore(r),o=e.getTokenAfter(r);return!o||!n||"("!==n.value||")"!==o.value})(t,s)?`(${l} = ${p})`:`${l} = ${p}`;return{node:e,messageId:um,suggest:[{messageId:uf,fix:r=>[r.replaceText(f,g),((e,t,r)=>{let{line:n}=t.getLoc(r).start,{column:o}=t.getLoc(r).end,a=t.getText(r),i=t.lines[n-1];if(i.trim()===a)return e.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]);if(" "===i[o]){let[n,o]=t.getRange(r);return e.removeRange([n,o+1])}return e.remove(r)})(r,t,e)]}]}};e.on(ts,e=>{r.push(e)}),e.onExit(ts,()=>{r.pop()}),e.on("AssignmentExpression",e=>{if("ExpressionStatement"===e.parent.type&&e.parent.expression===e)return n(e.parent,e.left,e.right,!0)}),e.on("VariableDeclarator",e=>{if("VariableDeclaration"===e.parent.type&&e.parent.declarations[0]===e)return n(e.parent,e.id,e.init,!1)})},meta:{type:"suggestion",docs:{description:"Prefer default parameters over reassignment.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[um]:"Prefer default parameters over reassignment.",[uf]:"Replace reassignment with default parameter."},languages:["js/js"]}},"unicorn/prefer-logical-operator-over-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r,i=function(e,t){let{test:r,consequent:n,alternate:o}=e,a=function(e,t){let r=uT(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=uT(e.left),o=uT(e.right);if(n&&o&&uv(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&uw(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&uw(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}(r,t.sourceCode);if(!a||t.sourceCode.getCommentsInside(e).length>0)return;let{reference:i}=a;if(a.isTrueWhenNullish&&uv(i,o,t.sourceCode))return uC({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&uv(i,n,t.sourceCode))return uC({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tx(s)||!tc(l)||l.optional||!tQ(rg(i),rg(l.object))||function(e){let t=e,{parent:r}=t;for(;rf(r)&&r.expression===t;)r=(t=r).parent;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t||"CallExpression"===r.type&&r.callee===t||"TaggedTemplateExpression"===r.type&&r.tag===t}(e))return;let u=function(e,t){let{sourceCode:r}=t,n=ra(e,t);if(re(t,n))return;let[o,a]=r.getRange(e),[i,s]=n;return r.text.slice(o,i)+(e.computed?"?.[":"?.")+r.text.slice(s,a)}(l,t);if(u)return{node:e,messageId:ux,suggest:[{messageId:uE,fix(r){let n=u;return nU(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(uv(n,o,t)?uC({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&uv(n.argument,a,t)?uC({context:e,conditionalExpression:r,left:n.argument,right:o}):void 0)})},meta:{type:"suggestion",docs:{description:"Prefer using a logical operator over a ternary.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[uh]:"Prefer using a logical operator over a ternary.",[ux]:"Prefer using optional chaining over a ternary.",[ub]:"Switch to `{{operator}}` operator.",[uE]:"Switch to optional chaining."},languages:["js/js"]}},"unicorn/prefer-optional-catch-binding":{create:e=>{e.on("CatchClause",t=>{let r=t.param;if(!r)return;let{sourceCode:n}=e;if(n.getDeclaredVariables(r.parent).some(e=>e.references.length>0))return;let{type:o,name:a,parent:i}=r,s=n.getCommentsInside(r).length>0;return{node:r,messageId:"Identifier"===o?uk:uI,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tw(t,{test:ed,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tw(o,{test:em,expected:")",ruleId:"prefer-optional-catch-binding"}),yield e.remove(t),yield e.remove(r),yield e.remove(o);let[,a]=n.getRange(o),[s]=n.getRange(i.body),l=n.text.slice(a,s),u=l.length-l.trimStart().length;0!==u&&(yield e.removeRange([a,a+u]))}}})},meta:{type:"suggestion",docs:{description:"Prefer omitting the `catch` binding parameter.",recommended:"unopinionated"},fixable:"code",messages:{[uk]:"Remove unused catch binding `{{name}}`.",[uI]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":u6,"unicorn/prefer-set-has":pp,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!e1(t)||function(e){let{parent:t}=e,{type:r}=t;return tr(t)||["Property","PropertyDefinition","MethodDefinition","AccessorProperty"].includes(r)&&!t.computed&&t.key===e||["TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSAbstractAccessorProperty","TSPropertySignature"].includes(r)&&t.key===e||["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"].includes(r)&&t.source===e||"ImportAttribute"===r&&(t.key===e||t.value===e)||"ImportSpecifier"===r&&t.imported===e||"ExportSpecifier"===r&&(t.local===e||t.exported===e)||"ExportAllDeclaration"===r&&t.exported===e||"JSXAttribute"===r&&t.value===e||"TSEnumMember"===r&&(t.initializer===e||t.id===e)||"TSModuleDeclaration"===r&&t.id===e||"TSExternalModuleReference"===r&&t.expression===e||"TSLiteralType"===r&&t.literal===e||"TSImportType"===r&&t.source===e}(t)||pc(t))return;let{sourceCode:r}=e,{raw:n}=t;if("\\"===n.at(-2)||!n.includes("\\\\")||n.includes("`")||n.includes("${")||r.getLoc(t).start.line!==r.getLoc(t).end.line)return;let o=pf(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:pd,*fix(r){yield oR(r,t,e),yield r.replaceText(t,`String.raw\`${o}\``)}}}),e.on("TemplateLiteral",t=>{if(!("TaggedTemplateExpression"===t.parent.type&&t.parent.quasi===t||t.quasis.every(({value:{cooked:e,raw:t}})=>e===t)||t.quasis.some(({value:{cooked:e,raw:t}})=>"\\"===e.at(-1)||pf(t)!==e)||pc(t)))return{node:t,messageId:pd,*fix(r){for(let n of(yield oR(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield oW(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tc(n,{object:"String",property:"raw",optional:!1})||!a.isGlobalReference(n.object)||r.quasis.some(e=>e.value.raw.includes("\\")))return;let i=a.getText(r),s=r.expressions.length>0||/\r?\n/.test(i)?i:`'${i.slice(1,-1).replaceAll("'",()=>String.raw`\'`)}'`;return{node:n,messageId:pm,*fix(r){let n=a.getTokenBefore(t);nU(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||nj(n,t.quasi,e)||eQ(t,e)||(yield oj(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||nj(n,t.quasi,e)||eQ(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield oA(t.tag,r,e),yield r.remove(t.tag)}}})},meta:{type:"suggestion",docs:{description:"Prefer using the `String.raw` tag to avoid escaping `\\`.",recommended:"unopinionated"},fixable:"code",messages:{[pd]:"`String.raw` should be used to avoid escaping `\\`.",[pm]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":pD,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{method:"toFixed",argumentsLength:0,optionalCall:!1})||"NewExpression"===t.callee.object.type)return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2);return{loc:{start:r.getLoc(n).start,end:r.getLoc(o).end},messageId:pS,fix:r=>oT(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[pS]:"Missing the digits argument."},languages:["js/js"]}},"unicorn/template-indent":{create:e=>{let{sourceCode:t}=e,r={...e.options[0]},n=(e=>{let t=new Set,r=[e.ast];for(;r.length>0;){let n=r.pop();if(n){if("TemplateLiteral"===n.type){let{start:{line:r},end:{line:o}}=e.getLoc(n);for(let e=r+1;e<=o;e++)t.add(e)}for(let t of e.visitorKeys[n.type]??[]){let e=n[t];Array.isArray(e)?r.push(...e):r.push(e)}}}return t})(t);r.comments=r.comments.map(e=>e.toLowerCase());let o=new WeakSet,a=a=>{let i;if("TemplateLiteral"!==a.type||o.has(a))return;o.add(a);let s="__PLACEHOLDER__"+Math.random(),l=a.quasis.map(e=>t.getText(e).slice(1,e.tail?-1:-2)).join(s),u=l.match(/\r?\n/);if(!u)return;let p=u[0],c=t.getLoc(a),d=t.lines[c.start.line-1].match(/^(\s*)\S/),m=d?d[1]:"";i="string"==typeof r.indent?r.indent:"number"==typeof r.indent?" ".repeat(r.indent):((e,t,r,n)=>{if(""===r){let r;return pw(pI(e.lines,t)).indent||pw(pv(r=pI(n.split(/\r?\n/)))).indent||pw(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=pv(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),g=p+function(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if("string"!=typeof e)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if("string"!=typeof n)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);return 0===t?e:e.replace(o?/^/gm:/^(?!\s*$)/gm,n.repeat(t))}(f,1,{indent:m+i})+p+m;if(g!==l)return{node:a,messageId:pk,fix:t=>g.split(s).map((r,n)=>oW(a.quasis[n],r,e,t))}};e.on("TemplateLiteral",e=>{if((e=>{if(r.comments.length>0){let n=t.getTokenBefore(e,{includeComments:!0});if(n?.type==="Block"&&r.comments.includes(n.value.trim().toLowerCase()))return!0}return!!(pc(e)||r.tags.length>0&&th(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&ty(e.parent.callee,r.functions))})(e))return a(e)}),e.on(r.selectors,e=>a(e))},meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation.",recommended:!0},fixable:"code",schema:pj,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[pk]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{object:"Promise",methods:sG,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type&&1===t.arguments[0].elements.length&&t.arguments[0].elements[0]&&"SpreadElement"!==t.arguments[0].elements[0].type))return;let r=t.callee.property.name,n={node:t.arguments[0],messageId:sV,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||ti(t.parent.parent)))return n.fix=r=>r.replaceText(t,sJ(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(sX(r,e))return;let n=e.parent;if("AwaitExpression"!==n.type||n.argument!==e)return;let o=(e=>{let{parent:t}=e;return"VariableDeclarator"===t.type&&t.init===e&&sY(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&sY(t.left)&&ti(t.parent)?t.left:void 0})(n);if(o){if(sX(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,sJ(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&e0(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!sX(r,a))return r=>r.replaceText(a,`await ${sJ(e,t)}`)})(t,e),n):(n.suggest=[{messageId:sz,fix:r=>{let[n]=t.arguments[0].elements,o=eZ(n,e);return eQ(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),nU(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:sK,fix:function*(e){let r=t.callee.property;yield e.replaceText(r,"resolve");let[n]=t.arguments,a=o.getFirstToken(n),[i,s]=o.getLastTokens(n,2);yield e.remove(a),yield e.remove(s),eu(i)&&(yield e.remove(i))}}],n)})},meta:{type:"suggestion",docs:{description:"Disallow passing single-element arrays to `Promise` methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[sV]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[sz]:"Use the value directly.",[sK]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(td(t,{object:"Promise",methods:p$,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements)r?.type==="AwaitExpression"&&(yield{node:r,messageId:pF,data:{method:t.callee.property.name},suggest:[{messageId:pB,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield oF(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[pF]:"Promise in `Promise.{{method}}()` should not be awaited.",[pB]:"Remove `await`."},languages:["js/js"]}},"unicorn/no-negation-in-equality-check":{create:e=>{e.on("BinaryExpression",t=>{let{operator:r,left:n}=t;if(!("BinaryExpression"===t.type&&pL.has(t.operator)&&pN(n)&&!pN(n.argument)))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:pR,suggest:[{messageId:pP,data:{operator:i},*fix(s){yield oR(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!eQ(t,e)&&(nj(o.getFirstToken(u),l,e)||(yield oj(s,u,e))),yield s.remove(a),nU(o.getTokenBefore(a),e,l.value)&&(yield s.insertTextAfter(a,";"));let p=o.getTokenAfter(n,e=>"Punctuator"===e.type&&e.value===r);yield s.replaceText(p,i)}}]}})},meta:{type:"problem",docs:{description:"Disallow negated expression in equality check.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[pR]:"Negated expression is not allowed in equality check.",[pP]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){pM(e,{methods:["slice"],messageId:pO})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[pO]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(ct(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&ct(t.parent.parent)&&t.parent.parent.consequent===t.parent||ct(t.parent)&&t.parent.consequent===t))return{node:t,messageId:ce,fix:function(e,t){let{sourceCode:r}=t;return n=>{var o,a;let i=("BlockStatement"===e.parent.type?e.parent:e).parent,s={...i,...cr(i,r)},l={...e,...cr(e,r)},u=ci(s,r),p=cs(s,t,r),c=ca(co(ci(l,r)),cs(l,t,r)),d=function(e,t,r,n){let o=[...n.getRange(e)];if("BlockStatement"===t.type)return o;let a=n.getLastToken(t);if(ey(a)){let t=n.getTokenAfter(e);t&&nU(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?co(cn(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?co(cn(s.openingBraceToken,l.ifToken,r)):co(cn(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?co(cn(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:co(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:co(ca(o,a)).trimStart(),conditionSuffixText:""}),{leadingStatementText:g}=f,y=function({outerIfStatement:e,inner:t,replacementRange:r,sourceCode:n,consequentTextPieces:o,outerConditionGapTextPieces:a}){let{outerTrailingContent:i}=o,{conditionSuffixText:s}=a;if("BlockStatement"===t.consequent.type){let e=cn(t.closingParenthesisToken,t.openingBraceToken,n),r=cn(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=cn(t.closingParenthesisToken,t.consequent,n),u=`${s}${l}${((e,t)=>{let[r,n]=t.getRange(e);return t.text.slice(r,n)})(t.consequent,n)}${i}`;return`${u}${((e,t,r)=>{let[,n]=r.getRange(e);if(t[1]===n)return"";let o=r.text.slice(n,t[1]);return""===o.trim()?o.includes("\n")?`;${o}`:";":`;${o}`})(e,r,n)}`}({outerIfStatement:i,inner:l,replacementRange:d,sourceCode:r,consequentTextPieces:m,outerConditionGapTextPieces:f});return n.replaceTextRange(d,`${g}if${u}(${p} && ${c})${y}`)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow `if` statements as the only statement in `if` blocks without `else`.",recommended:"unopinionated"},fixable:"code",messages:{[ce]:"Unexpected `if` as the only statement in a `if` block without `else`."},languages:["js/js"]}},"unicorn/no-magic-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!e8(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=tX(t,e);if(!n.commentsExistBetween(o,a))return{node:r,messageId:cl}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[cl]:"Magic number as depth is not allowed."},languages:["js/js"]}},"unicorn/no-negated-condition":{create:e=>{e.on(["IfStatement","ConditionalExpression"],t=>{if("IfStatement"===t.type&&(!t.alternate||"IfStatement"===t.alternate.type))return;let{test:r}=t;if("UnaryExpression"===r.type&&"!"===r.operator||"BinaryExpression"===r.type&&("!="===r.operator||"!=="===r.operator))return{node:r,messageId:cu,*fix(n){if(yield function*(e,t,r){let{sourceCode:n}=r,{test:o}=t;if("UnaryExpression"===o.type){let a=n.getFirstToken(o);"IfStatement"===t.type&&(yield oA(o.argument,e,r)),yield e.remove(a);return}let a=n.getTokenAfter(o.left,e=>"Punctuator"===e.type&&e.value===o.operator);yield e.replaceText(a,"="+a.value.slice(1))}(n,t,e),yield function*(e,t,r){let n="IfStatement"===t.type,[o,a]=[t.consequent,t.alternate].map(e=>{let t=eH(e,r),o=r.sourceCode.text.slice(...t);return n&&"BlockStatement"!==e.type&&(o=`{${o}}`),{range:t,text:o}});if(o.text===a.text)return;let{sourceCode:i}=r;yield e.replaceTextRange(i.getRange(o),a.text),yield e.replaceTextRange(i.getRange(a),o.text)}(n,t,e),"ConditionalExpression"!==t.type||"UnaryExpression"!==r.type)return;yield oR(n,t,e);let{sourceCode:o}=e,{parent:a}=t,[i,s]=o.getFirstTokens(r,2);"ReturnStatement"!==a.type&&"ThrowStatement"!==a.type||a.argument!==t||nj(i,s,e)||eQ(t,e)||eQ(r,e)?nU(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield oj(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[cu]:"Unexpected negated condition."},languages:["js/js"]}},"unicorn/no-object-as-default-parameter":{create:e=>{e.on("AssignmentPattern",e=>{if(!("ObjectExpression"===e.right.type&&e.right.properties.length>0&&tl(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:cp,data:{parameter:t.name}}:{node:r,messageId:cc}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[cp]:"Do not use an object literal as default for parameter `{{parameter}}`.",[cc]:"Do not use an object literal as default."},languages:["js/js"]}},"unicorn/prefer-negative-index":{create:e=>{e.on("CallExpression",t=>{if("MemberExpression"!==t.callee.type)return;let r=function(e){let{callee:t,arguments:r}=e,n=t.property.name,o=t.object,a=r;if(cm.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=cf(t.object),!cm.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=cm.get(n),l=t.object.object;if(to(l)||"slice"===n&&e0(l,"")||"prototype"===cf(l)&&"Identifier"===l.object.type&&s.has(l.object.name)){if([o]=r,i){let[,e]=r;if(!e||"ArrayExpression"!==e.type)return;a=e.elements}else a=r.slice(1);return{method:n,target:o,argumentsNodes:a}}}(t);if(!r)return;let{method:n,target:o,argumentsNodes:a}=r,{argumentsIndexes:i}=cm.get(n),s=i.map(e=>(function e(t,r){let n;if(!t)return;let{type:o,operator:a,left:i,right:s}=t=rg(t);if("BinaryExpression"!==o||"-"!==a||!(e8(n=rg(s))&&n.value>0))return;let l=rg(i);return"MemberExpression"===l.type&&!l.computed&&!l.optional&&"Identifier"===l.property.type&&"length"===l.property.name&&lg(l.object,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:cd,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=eH(e,r);return t.removeRange([n,o+r.sourceCode.text.slice(o).match(/\S|$/).index])}(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Prefer negative index over `.length - index` when possible.",recommended:"unopinionated"},fixable:"code",messages:{[cd]:"Prefer negative index over length minus index for `{{method}}`."},languages:["js/js"]}},"unicorn/prefer-node-protocol":{create:e=>{e.on("Literal",t=>{if(!(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ImportExpression","TSImportType"].includes(t.parent.type)&&t.parent.source===t||(td(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tf(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(cx)&&cy(r)&&cy(`${cx}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:ch,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],cx)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[ch]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!te(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!td(r,{method:"getTime",argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{sourceCode:n}=e;return{node:r,loc:{start:n.getLoc(r.callee.property).start,end:n.getLoc(r).end},messageId:cb,fix:t=>oM(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[cb]:"Unnecessary `.getTime()` call."},languages:["js/js"]}},"unicorn/no-accessor-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ThisExpression",e=>{let r=((e,t)=>{for(let r=e.getScope(t);r;r=r.upper){if("class"===r.type)return;if("function"===r.type&&"ArrowFunctionExpression"!==r.block.type)return r}})(t,e);if(!r)return;let n=r.block.parent;if(["Property","MethodDefinition"].includes(n?.type)&&!n.computed&&["set","get"].includes(n.kind)&&cD(n.key)&&("get"===n.kind&&(cv(e,n)||"VariableDeclarator"===e.parent.type&&e.parent.init===e&&"ObjectPattern"===e.parent.id.type&&e.parent.id.properties.some(e=>"Property"===e.type&&!e.computed&&cS(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!cv(e,t))return!1;let r=e.parent,{parent:n}=r;return("AssignmentExpression"===n.type||"AssignmentPattern"===n.type)&&n.left===r||"UpdateExpression"===n.type&&n.argument===r||"ArrayPattern"===n.type&&n.elements.includes(r)||"RestElement"===n.type&&n.argument===r||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.left===r||"Property"===n.type&&n.value===r&&"ObjectPattern"===n.parent.type&&n.parent.properties.includes(r.parent)})(e,n)))return{node:e.parent,messageId:cE,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[cE]:"Disallow recursive access to `this` within {{kind}}ters."},languages:["js/js"]}},"unicorn/prefer-import-meta-properties":{create:function(e){let{sourceCode:t}=e;e.on("MetaProperty",function*(e){if("MetaProperty"!==e.type||"import"!==e.meta.name||"meta"!==e.property.name)return;let r=e.parent;if(!tc(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(cw(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(te(r.parent,{name:"URL",minimumArguments:1,maximumArguments:2})){var o;let e=r.parent,n=e.parent;if(1===e.arguments.length&&e.arguments[0]===r&&cw(n,t)&&n.arguments[0]===e)return void(yield a(n,{reportFilenameNode:!0}));2===e.arguments.length&&(o=e.arguments[0],o?.type==="Literal"&&("."===o.value||"./"===o.value))&&e.arguments[1]===r&&cw(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(ck(n,t)&&n.arguments[0]===e)return void(yield i(n,"dirname"));if(r&&(yield i(e,"filename")),"VariableDeclarator"!==n.type||n.init!==e||"Identifier"!==n.id.type||"VariableDeclaration"!==n.parent.type||"const"!==n.parent.kind)return;let o=ei(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;ck(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?cC:cA,fix:r=>r.replaceText(e,`import.meta.${t}`)}}"filename"===n&&(yield a(r))})},meta:{type:"suggestion",docs:{description:"Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.",recommended:!1},fixable:"code",messages:{[cC]:"Do not construct dirname.",[cA]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&e0(t.arguments[0],1)))return;let[r]=t.arguments;return{node:r,messageId:cI,fix:t=>ow(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[cI]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){pM(e,{methods:["splice","toSpliced"],messageId:cj})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.",recommended:"unopinionated"},fixable:"code",messages:{[cj]:"Passing `{{description}}` as the `{{argumentName}}` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-useless-error-capture-stack-trace":{create:e=>{let t=[],r=[];e.on(["ClassDeclaration","ClassExpression"],e=>{t.push(e),r.push(e)}),e.onExit(["ClassDeclaration","ClassExpression"],()=>{t.pop(),r.pop()}),e.on(["FunctionDeclaration","FunctionExpression"],e=>{r.push(e)}),e.onExit(["FunctionDeclaration","FunctionExpression"],()=>{r.pop()}),e.on("CallExpression",n=>{let o,a=t.at(-1);if(!(a?.superClass&&"Identifier"===a.superClass.type&&i5.includes(a.superClass.name)&&e.sourceCode.isGlobalReference(a.superClass)&&(o=r.at(-1),o&&"MethodDefinition"===o.parent.type&&"constructor"===o.parent.kind&&o.parent.value===o&&a.body.body.includes(o.parent))&&td(n,{object:"Error",method:"captureStackTrace",argumentsLength:2,optionalMember:!1})&&e.sourceCode.isGlobalReference(n.callee.object)))return;let[i,s]=n.arguments;if("ThisExpression"!==i.type||!((e,t,r)=>{if("MetaProperty"===e.type&&"Identifier"===e.meta.type&&"new"===e.meta.name&&"Identifier"===e.property.type&&"target"===e.property.name||tc(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=ei(r.sourceCode.getScope(e),e);return n&&1===n.defs.length&&"ClassName"===n.defs[0].type&&n.defs[0].node===t})(s,a,e))return;let l={node:n,messageId:cF},u="ChainExpression"===n.parent.type?n.parent.parent:n.parent;return"ExpressionStatement"===u.type&&"BlockStatement"===u.parent.type&&(l.fix=e=>e.remove(u)),l})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Error.captureStackTrace(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[cF]:"Unnecessary `Error.captureStackTrace(…)` call."},languages:["js/js"]}},"unicorn/prefer-class-fields":{create:e=>{let{sourceCode:t}=e;e.on("ClassBody",r=>{let n=r.body.find(e=>"constructor"===e.kind&&!e.computed&&!e.static&&"MethodDefinition"===e.type&&"FunctionExpression"===e.value.type);if(!n)return;let o=n.value.body.body.find(e=>"EmptyStatement"!==e.type);if(!(o?.type==="ExpressionStatement"&&"AssignmentExpression"===o.expression.type&&"="===o.expression.operator&&"MemberExpression"===o.expression.left.type&&"ThisExpression"===o.expression.left.object.type&&!o.expression.left.computed&&["Identifier","PrivateIdentifier"].includes(o.expression.left.property.type)&&"Literal"===o.expression.right.type))return;let a=o.expression.left.property.name,i=o.expression.right.raw,s=o.expression.left.property.type,l=r.body.find(e=>"PropertyDefinition"===e.type&&!e.computed&&!e.static&&e.key.type===s&&e.key.name===a),u={node:o,messageId:cB};function*p(s){if(yield((e,t,r)=>{let{line:n}=t.getLoc(e).start,o=t.getText(e);return t.lines[n-1].trim()===o?r.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]):r.remove(e)})(o,t,s),l){if(l.value)return void(yield s.replaceText(l.value,i));let e=` = ${i}`,r=t.getLastToken(l);return ep(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=t8(n,e),c=`${p}${a} = ${i};
18
+ `,cg=e=>{var t;let r=(t=e.superClass,t?.type==="Identifier"?t.name:t?.type!=="MemberExpression"||t.computed||"Identifier"!==t.property.type?void 0:t.property.name);return!!r&&cm.test(r)},cy=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&ty(e.expression.callee,"super"),ch=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&ty(e.expression.left,`this.${t}`),cx=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),cb=(e,t)=>e3(e?.value)===t,cE=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,cS=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,cD=e=>cS(e)?.name==="options",cv=(e,t)=>{if("ThisExpression"===e.type||"Super"===e.type)return!0;for(let r of t[e.type]??[]){let n=e[r];if(n){if(Array.isArray(n)){if(n.some(e=>e&&cv(e,t)))return!0;continue}if(cv(n,t))return!0}}return!1},cC=e=>{let t=cS(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},cA=(e,t,r)=>n=>{let o=t.arguments;if(0===o.length){let o=e.getTokenAfter(t.callee,e=>"("===e.value);return n.insertTextAfter(o,`${r}, options`)}if(1===o.length){let e;return"undefined"!==r&&(!(e=o[0])||tb(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},cT=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*cw(e,t){if(!cg(t)||null===t.id)return;let{name:r}=t.id,n=ow(r).replace(/(?:error)?$/i,"Error");r!==n&&(yield{node:t.id,message:`Invalid class name, use \`${n}\`.`});let{body:o}=t.body,{sourceCode:a}=e,i=o.find(e=>"constructor"===e.kind),s=o.find(e=>"PropertyDefinition"===e.type&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"name"===e.key.name);if(!i){if(cb(s,r))return;let e=a.getRange(t.body);yield{...cx(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,cf(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],cf(r))};return}let l=o.some(e=>cE(e,"get")),u=o.some(e=>cE(e,"set"));yield*function*(e,t,r){let{sourceCode:n}=e,o=t.value.body;if(!o)return;let a=o.body,{hasMessageGetter:i,hasMessageSetter:s,checkOptions:l}=r,u=a.find(e=>cy(e)),p=a.findIndex(e=>cy(e)),c=a.findIndex(e=>ch(e,"message")),d=i||s,m=!1;if(u){let r;if(d&&!(!(r=u.expression.arguments[0])||tb(r)))m=!0,yield{node:u,messageId:cs};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:cl};else if(!s&&-1!==c){let r=a[c];m=!0,yield{node:u,message:"Pass the error message to `super()` instead of setting `this.message`.",*fix(i){let s=r.expression.right,[l,d]=t.value.params,m=cS(l),f=1===t.value.params.length&&m&&!cD(l),g=f||cD(d);if(0===u.expression.arguments.length){if(c!==p+1||cv(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${eQ(s,e)}, options`:eQ(s,e))}else{let e;if(e=u.expression.arguments[0],n.getText(e)!==n.getText(s))return;g&&1===u.expression.arguments.length&&(yield i.insertTextAfter(u.expression.arguments[0],", options"))}f&&(yield i.insertTextAfter(l,`, ${cC(l)}`));let y=0===c?n.getRange(o)[0]:n.getRange(a[c-1])[1],[,h]=n.getRange(r);yield i.removeRange([y,h])}}}}else m=!0,yield{node:o,message:"Missing call to `super()` in constructor."};let f=function(e,t,r){let{name:n,nameProperty:o}=r,a=t.find(e=>ch(e,"name"));return a?e3(a.expression.right)!==n?cx(a.expression.right??e,n):void 0:cb(o,n)?void 0:cx(o?.value??e,n)}(o,a,r);if(f&&(yield f),!f&&l&&!m){let r=((e,t,r,n)=>{let o=t.value.params,a=o[0],i=cS(a);if(0===o.length||!i)return;let s=r.expression;if(cD(a)){if(!cD(s.arguments[1])){let t={node:s,messageId:cd};return cT(s.arguments[0],i)||(t.fix=cA(e.sourceCode,s,"undefined")),t}return}let l=o[1],u=!n&&"message"===i.name,p=u?i.name:"undefined";if(!l){if(((e,t)=>{if(t)return!1;let[r,n]=e.arguments;return 2===e.arguments.length&&void 0!==e3(r)&&"ObjectExpression"===n.type&&1===n.properties.length&&"cause"===eI(n.properties[0])})(s,u))return;return{node:a,messageId:cu,fix:function*(r){let{sourceCode:n}=e,o=cA(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${cC(a)}`),yield o}}}if(!cD(l))return{node:l,messageId:cp};if(u&&!cT(s.arguments[0],i)){let t;return{node:s,messageId:cc,fix:(t=e.sourceCode,e=>{let r,n=s.arguments;if(0===n.length){let r=t.getTokenAfter(s.callee,e=>"("===e.value);return e.insertTextAfter(r,`${p}, options`)}if(!(r=n[0])||tb(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!cD(s.arguments[1]))return{node:s,messageId:cd,fix:cA(e.sourceCode,s,p)}})(e,t,u,d);r&&(yield r)}}(e,i,{name:r,nameProperty:s,hasMessageGetter:l,hasMessageSetter:u,checkOptions:r===n})}let ck="no-lonely-if",cI=e=>"IfStatement"===e.type&&!e.alternate;function cj(e,t){let r={ifToken:t.getFirstToken(e),openingParenthesisToken:t.getFirstToken(e,1)},{consequent:n}=e;return r.closingParenthesisToken=t.getTokenBefore(n),"BlockStatement"===n.type&&(r.openingBraceToken=t.getFirstToken(n),r.closingBraceToken=t.getLastToken(n)),r}let cF=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),cB=e=>e.trim()?e:"",cR=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,cP=(e,t)=>cF(e.ifToken,e.openingParenthesisToken,t),cL=(e,t,r)=>{let n,o=cF(e.openingParenthesisToken,e.closingParenthesisToken,r);return eZ(e.test,t)?o:"LogicalExpression"===(n=e.test).type&&("||"===n.operator||"??"===n.operator)||"ConditionalExpression"===n.type||"AssignmentExpression"===n.type||"YieldExpression"===n.type||"SequenceExpression"===n.type?`(${o})`:o},c$="no-magic-array-flat-depth",cN="no-negated-condition",cM="identifier",cO="non-identifier",cU="prefer-negative-index",cq=new Map([["slice",{argumentsIndexes:[0,1],supportObjects:new Set(["Array","String","ArrayBuffer",...rE])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new Set(rE)}],["splice",{argumentsIndexes:[0],supportObjects:new Set(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new Set(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new Set(["Array","String",...rE])}]]),cW=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var c_=["node:assert","assert","node:assert/strict","assert/strict","node:async_hooks","async_hooks","node:buffer","buffer","node:child_process","child_process","node:cluster","cluster","node:console","console","node:constants","constants","node:crypto","crypto","node:dgram","dgram","node:diagnostics_channel","diagnostics_channel","node:dns","dns","node:dns/promises","dns/promises","node:domain","domain","node:events","events","node:ffi","node:fs","fs","node:fs/promises","fs/promises","node:http","http","node:http2","http2","node:https","https","node:inspector","inspector","node:inspector/promises","inspector/promises","node:module","module","node:net","net","node:os","os","node:path","path","node:path/posix","path/posix","node:path/win32","path/win32","node:perf_hooks","perf_hooks","node:process","process","node:querystring","querystring","node:quic","node:readline","readline","node:readline/promises","readline/promises","node:repl","repl","node:sea","node:sqlite","node:stream","stream","node:stream/consumers","stream/consumers","node:stream/iter","stream/iter","node:stream/promises","stream/promises","node:stream/web","stream/web","node:string_decoder","string_decoder","node:test","node:test/reporters","node:timers","timers","node:timers/promises","timers/promises","node:tls","tls","node:trace_events","trace_events","node:tty","tty","node:url","url","node:util","util","node:util/types","util/types","node:v8","v8","node:vm","vm","node:wasi","wasi","node:worker_threads","worker_threads","node:zlib","zlib","node:zlib/iter","zlib/iter"];function cV(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new Set(c_)).has(t)}let cz="prefer-node-protocol",cK="node:",cG="consistent-date-clone/error",cJ="no-accessor-recursion/error",cX=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,cH=(e,t)=>["type","name"].every(r=>e[r]===t[r]),cY=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&cX(e.parent.property)&&cH(e.parent.property,t.key),cQ="error/calculate-dirname",cZ="error/calculate-filename";function c0(e,{modules:t,functionName:r,sourceCode:n}){if(!e7(e,{optional:!1,argumentsLength:1}))return!1;let o=new Set;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tc(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&td(t,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalMember:!1,optionalCall:!1})&&a(t.arguments[0]);if("Identifier"!==t.type||o.has(t))return!1;o.add(t);let s=ei(n.getScope(t),t);return!!s&&1===s.defs.length&&function(t,n){if("ImportBinding"===t.type){if(!a(t.parent.source))return!1;let e=t.node;return"module"===n?e?.type==="ImportDefaultSpecifier"||e?.type==="ImportNamespaceSpecifier":e?.type==="ImportSpecifier"&&e.imported.name===r}return"Variable"===t.type&&function t(n,o){let{parent:a}=n;return"VariableDeclarator"===a.type?!!a.init&&a.id===n&&"VariableDeclaration"===a.parent.type&&"const"===a.parent.kind&&e(a.init,o):"Property"===a.type&&!!("property"===o&&a.value===n&&!a.computed&&"Identifier"===a.key.type&&a.key.name===r)&&t(a.parent,"module")}(t.name,n)}(s.defs[0],i)}(e.callee,"property");function a(e){return e?.type==="Literal"&&t.has(e.value)}}function c1(e,t){return c0(e,{modules:new Set(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function c2(e,t){return c0(e,{modules:new Set(["path","node:path"]),functionName:"dirname",sourceCode:t})}let c3="no-unnecessary-array-flat-depth",c8="no-unnecessary-array-splice-count",c6="no-useless-error-capture-stack-trace/error",c9="prefer-class-fields/error",c5="prefer-class-fields/suggestion",c4="prefer-bigint-literals/error",c7="prefer-bigint-literals/suggestion",de="prefer-classlist-toggle/error",dt="prefer-classlist-toggle/suggestion",dr=e=>tc(e,{property:"classList",computed:!1}),dn=(e,t,r)=>{let n={node:r??e,messageId:de};return"IfStatement"===e.type||ti(e)||ti(e.parent)?n.fix=t:n.suggest=[{messageId:dt,fix:t}],n},da=(e,t,r)=>{let{sourceCode:n}=t,o=eQ(e,t);return r?(!eZ(e,n)&&oh(e,"!")&&(o=`(${o})`),o=`!${o}`):(eZ(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},di=(e,t)=>td(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&dr(e.callee.object),ds=(e,t)=>t0(e.callee.object,t.callee.object)&&t0(e.arguments[0],t.arguments[0]),dl=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),di(e,["contains"])&&ds(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?dl(e.argument,!t,r):void 0,du="require-module-attributes",dp="error",dc="suggestion/array",dd="suggestion/object",dm="suggestion/object-assign",df="suggestion/set",dg="suggestion/map",dy=(e,t,r)=>{let{sourceCode:n}=r,o=rd(e);return t.some(e=>{let t=n.getRange(e);return o.some(e=>{let[r,o]=n.getRange(e);return r>=t[0]&&o<=t[1]})})};function dh(e,t){if(!te(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*dx(e,t,r){let n=!ep(t.sourceCode.getTokenBefore(e));yield o7(e,t,r,n)}function db(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!eu(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*dE({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(tX(r,e)){let[o]=r.arguments;if(o)yield db(e,t,o,n);else{let{openingParenthesisToken:o}=tX(r,e)?tH(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*dx(o,e,t)}let dS=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(td(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!dy(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,i=e.callee,s=i.property,l={node:i,messageId:dp,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>eL(e,a))?l.suggest=[{messageId:dc,fix:p,data:{operation:u?"Prepend":"Append",assignType:n}}]:l.fix=p,l},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,isPrepend:o})=>function*(a){let i=tY(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):db(e,a,t,i),yield dx(r,e,a)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!("AssignmentExpression"===n.type&&"="===n.operator&&tc(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!dy(t,a.computed?[i,o]:[o],e))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,{left:i,right:s}=e,{property:l}=i,u=a.getTokenAfter(i,t=>"Punctuator"===t.type&&t.value===e.operator),p={node:e,loc:{start:a.getLoc(e).start,end:a.getLoc(u).end},messageId:dp,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&eL(l,a)||eL(s,a)?p.suggest=[{messageId:dd,data:{assignType:n},fix:c}]:p.fix=c,p},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{memberExpression:n,property:o,value:a})=>function*(i){let s=eQ(o,e);n.computed&&(s=`[${s}]`);let l=eQ(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!eu(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield dx(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!td(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let[o,a]=n.arguments;if(!("Identifier"!==o.type||o.name!==t.name||"SpreadElement"===a.type||dy(t,[a],e)))return n},getProblem(e,t){let{context:r,assignType:n,getFix:o}=t,{sourceCode:a}=r,[,i]=e.arguments,s={node:e.callee,messageId:dp,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return eL(i,a)?s.suggest=[{messageId:dm,data:{description:"ObjectExpression"===i.type?"Move properties to":"Spread properties in",assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,valueNode:t,nextExpressionStatement:r},{callExpression:n,firstValue:o})=>function*(a){let i;("ObjectExpression"===o.type?o.properties.length>0&&(i=function(e,t){let{sourceCode:r}=t,n=r.getFirstToken(e),[o,a]=r.getLastTokens(e,2),[,i]=r.getRange(n),[s]=r.getRange(eu(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${eQ(o,e)}`,i&&(yield db(e,a,t,i)),2!==n.arguments.length)?yield oY(a,o,e):yield dx(r,e,a)}},{testValue:e=>dh(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),td(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!dy(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:dp,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eL(e,i))?s.suggest=[{messageId:df,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=tY(e,r,!1);return dE({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>dh(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(td(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!dy(t,n.arguments,e))return n},getProblem(e,t){let{context:r,assignType:n,valueNode:o,getFix:a}=t,{sourceCode:i}=r,s={node:e.callee,messageId:dp,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eL(e,i))?s.suggest=[{messageId:dg,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=tY(e,r,!1);return dE({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],dD="no-useless-collection-argument/error",dv="no-useless-collection-argument/suggestion",dC="prefer-response-static-json",dA=/([\p{Ll}\d])(\p{Lu})/gu,dT=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,dw=/(\d)\p{Ll}|(\p{L})\d/u,dk=/[^\p{L}\d]+/giu,dI="$1\0$2";function dj(e){let t=e.trim();t=(t=t.replace(dA,dI).replace(dT,dI)).replace(dk,"\0");let r=0,n=t.length;for(;"\0"===t.charAt(r);)r++;if(r===n)return[];for(;"\0"===t.charAt(n-1);)n--;return t.slice(r,n).split(/\0/g)}function dF(e){let t=dj(e);for(let e=0;e<t.length;e++){let r=t[e],n=dw.exec(r);if(n){let o=n.index+(n[1]??n[2]).length;t.splice(e,1,r.slice(0,o),r.slice(o))}}return t}function dB(e,t){let[r,n,o]=dM(e,t);return r+n.map(dL(t?.locale)).join(t?.delimiter??" ")+o}function dR(e,t){var r,n;let[o,a,i]=dM(e,t),s=dL(t?.locale),l=d$(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):dN(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function dP(e,t){let[r,n,o]=dM(e,t),a=dN(dL(t?.locale),d$(t?.locale));return r+n.map(a).join("")+o}function dL(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function d$(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function dN(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function dM(e,t={}){let r=t.split??(t.separateNumbers?dF:dj),n=t.prefixCharacters??"",o=t.suffixCharacters??"",a=0,i=e.length;for(;a<e.length;){let t=e.charAt(a);if(!n.includes(t))break;a++}for(;i>a;){let t=i-1,r=e.charAt(t);if(!o.includes(r))break;i=t}return[e.slice(0,a),r(e.slice(a,i)),e.slice(i)]}let dO="filename-case",dU="directory-case",dq="filename-extension",dW=e=>!/^[\w-]$/.test(e),d_=new Set(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),dV=new Intl.ListFormat("en-US",{type:"disjunction"}),dz=/^[\da-z]+$/i,dK=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,dG=e=>e>="0"&&e<="9",dJ=e=>e>="a"&&e<="z",dX=e=>e>="A"&&e<="Z",dH={camelCase:{fn:dR,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!dJ(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(dJ(r)||dG(r))continue;if(!dX(r))return!1;let n=t;for(;dX(e[t+1]);)t++;if(t!==n){if(dJ(e[t+1])){t--;continue}for(;dG(e[t+1]);)t++;if(t===e.length-1)return!0;if(!dX(e[t+1]))return!1}}return!0}(e)?dR(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return dB(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return dB(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(dz.test(e)){let t=dK.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&dP(r)===r)return e}return dP(e)},name:"pascal case"}};function dY(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function dQ(e,t,{leading:r,trailing:n}){let{samples:o}=function(e,t=1/0){let r=e.reduce((e,{length:t})=>e*t,1),n=Array.from({length:Math.min(r,t)},(t,r)=>{let n=r,o=[];for(let t=e.length-1;t>=0;t--){let r=e[t],{length:a}=r,i=n%a;n=(n-i)/a,o.unshift(r[i])}return o});return{total:r,samples:n}}(e.map(({word:e,ignored:r})=>r?[e]:t.map(t=>t(e))));return[...new Set(o.map(e=>`${r}${e.join("")}${n}`))]}let dZ=/^(?<leading>_+)(?<tailing>.*)$/;function d0(e){let t,{leading:r="",tailing:n=e}=(dZ.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=dW(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function d1(e){let t;return t=e.map(e=>dH[e].name),dV.format(t)}let d2=[{description:"The rule options.",anyOf:[{properties:{case:{enum:["camelCase","camelCaseWithAcronyms","snakeCase","kebabCase","pascalCase"],description:"The filename and directory name case style."},ignore:{type:"array",uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1},{properties:{cases:{properties:{camelCase:{type:"boolean",description:"Whether to allow camelCase filenames and directory names."},camelCaseWithAcronyms:{type:"boolean",description:"Whether to allow camelCase filenames and directory names with acronym segments."},snakeCase:{type:"boolean",description:"Whether to allow snake_case filenames and directory names."},kebabCase:{type:"boolean",description:"Whether to allow kebab-case filenames and directory names."},pascalCase:{type:"boolean",description:"Whether to allow PascalCase filenames and directory names."}},additionalProperties:!1,description:"The allowed filename and directory name case styles."},ignore:{type:"array",uniqueItems:!0,description:"Path segment patterns to ignore."},multipleFileExtensions:{type:"boolean",description:"Whether to treat additional, dot-separated parts of a filename as file extensions."},checkDirectories:{type:"boolean",description:"Whether to check directory names."}},additionalProperties:!1}]}],d3="consistent-template-literal-escape",d8="iterable-accepting",d6="for-of",d9="yield-star",d5="spread",d4="iterator-method",d7="iterable-accepting/suggestion",me="iterator-method/suggestion",mt=["every","find","forEach","some"],mr="reduce",mn=e=>td(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),mo=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>o4(r,e,t)},ma=(e,t,r,n)=>{let o=mo(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},mi="prefer-simple-condition-first",ms="prefer-simple-condition-first/suggestion";function ml(e){return"Identifier"===e.type||"Literal"===e.type||"UnaryExpression"===e.type&&("-"===e.operator||"+"===e.operator)&&"Literal"===e.argument.type&&"number"==typeof e.argument.value}function mu(e){return"Identifier"===e.type||("UnaryExpression"===e.type&&"!"===e.operator?mu(e.argument):"BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)?ml(e.left)&&ml(e.right)&&("Identifier"===e.left.type||"Identifier"===e.right.type):"LogicalExpression"===e.type&&mu(e.left)&&mu(e.right))}let mp=new Set(["AssignmentExpression","UpdateExpression","TaggedTemplateExpression","AwaitExpression","YieldExpression","ImportExpression"]);function mc(e,t,{operator:r,property:n}){let o=eZ(e,t),a=o?eQ(e,t):t.sourceCode.getText(e);return!o&&ox(e,{operator:r,property:n})&&(a=`(${a})`),a}let md="switch-case-break-position",mm=new Set(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),mf="first-child",mg="first-element-child",my="query-selector",mh="closest",mx="merge-query-selector",mb="suggestion-first-child",mE="suggestion-first-element-child",mS="suggestion-merge-query-selector",mD={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},mv=(e,t)=>tc(e,{property:t,optional:!1,computed:!1}),mC=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&e8(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,mA=(e,t)=>t.getCommentsInside(e).length>0,mT=(e,t,r,n)=>{let{sourceCode:o}=n;if(mA(e,o))return;let[,a]=eY(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},mw=e=>tc(e,{property:"parentElement",optional:!1,computed:!1}),mk=e=>void 0!==e3(e),mI=e=>td(e,mD),mj=new Set(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),mF=new Set(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),mB=e=>{let t="";return"Variable"===e.type?t=e.node.init.arguments[0].value:"ImportBinding"===e.type&&(t=e.parent.source.value),!t.includes("node_modules")&&(t.startsWith(".")||t.startsWith("/"))},mR="consistent-compound-words/error",mP="consistent-compound-words/rename",{isIdentifierName:mL}=tN,m$={backGround:"background",callBack:"callback",checkBox:"checkbox",clipBoard:"clipboard",codeBase:"codebase",dataBase:"database",downLoad:"download",feedBack:"feedback",foreGround:"foreground",frameWork:"framework",headLine:"headline",keyBoard:"keyboard",keyFrame:"keyframe",lifeCycle:"lifecycle",metaData:"metadata",midPoint:"midpoint",nameSpace:"namespace",overRide:"override",passWord:"password",payLoad:"payload",placeHolder:"placeholder",preView:"preview",screenShot:"screenshot",sideBar:"sidebar",subClass:"subclass",subDirectory:"subdirectory",subDomain:"subdomain",subMenu:"submenu",subProcess:"subprocess",subString:"substring",subTree:"subtree",subType:"subtype",subTitle:"subtitle",timeOut:"timeout",timeStamp:"timestamp",toolBar:"toolbar",toolKit:"toolkit",toolTip:"tooltip",touchScreen:"touchscreen",unSubscribe:"unsubscribe",underScore:"underscore",upLoad:"upload",userName:"username",viewPort:"viewport",webCam:"webcam",webHook:"webhook",webSite:"website",weekEnd:"weekend",whiteSpace:"whitespace",wildCard:"wildcard",workFlow:"workflow",workSpace:"workspace"},mN=new Set(String.raw`\^$.*+?()[]{}|`),mM=e=>{let t="";for(let r of e)t+=mN.has(r)?`\\${r}`:r;return t},mO=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,mU=(e,{replacementRegExp:t,replacements:r,allowList:n})=>{if(!t||e===e.toUpperCase()||n.has(e))return;let o=e.replaceAll(t,e=>((e,t)=>{let r=t.get(e)??t.get(ok(e));if(r){let t;return(t=e[0])===t.toUpperCase()?ow(r):ok(r)}})(e,r));if(o!==e)return o},mq=(e,t)=>({node:e,messageId:mR,data:{name:e.name,replacement:t}}),mW={type:"array",additionalItems:!1,items:[{type:"object",additionalProperties:!1,properties:{checkProperties:{type:"boolean",description:"Whether to check property names."},checkVariables:{type:"boolean",description:"Whether to check variable names."},checkDefaultAndNamespaceImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check default and namespace import names."},checkShorthandImports:{anyOf:[{type:"boolean"},{enum:["internal"]}],description:"Whether to check shorthand import names."},checkShorthandProperties:{type:"boolean",description:"Whether to check shorthand property names."},extendDefaultReplacements:{type:"boolean",description:"Whether to extend the default replacements."},replacements:{$ref:"#/definitions/replacements",description:"Custom compound word replacements."},allowList:{$ref:"#/definitions/trueObject",description:"Custom allow list of names."}}}],definitions:{replacements:{type:"object",propertyNames:{minLength:1},additionalProperties:{anyOf:[{enum:[!1]},{type:"string",minLength:1}]}},trueObject:{type:"object",propertyNames:{minLength:1},additionalProperties:{enum:[!0]}}}},m_="no-blob-to-file",mV="suggestion";function mz(e,t){let r=ei(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function mK(e,t){if(e?.type!=="Identifier")return;let r=ei(t.sourceCode.getScope(e),e),n=r?.defs[0],o=n?.node;if(n?.type==="Variable"&&"const"===n.kind&&o?.type==="VariableDeclarator")return o}let mG="no-canvas-to-image",mJ=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function mX(e,t){if(e=mJ(e),e?.type!=="Identifier")return e;let r=ei(t.getScope(e),e);if(!r||1!==r.identifiers.length||2!==r.references.length)return;let[n]=r.identifiers;if("VariableDeclarator"===n.parent.type&&n.parent.id===n&&"VariableDeclaration"===n.parent.parent.type&&"const"===n.parent.parent.kind&&!(t.getRange(n)[0]>t.getRange(e)[0]))return mJ(n.parent.init)}let mH=e=>e.toLowerCase().includes("canvas"),mY="replace-one-element",mQ="insert-at-negative-one",mZ="suggestion-replace-one-element",m0="suggestion-insert-at-negative-one";function m1(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&m1(e.object)}let m2=(e,t)=>t.getCommentsInside(e).length>0,m3="no-duplicate-set-values",m8="first-match",m6="id-selector",m9="length-check",m5="query-selector-all-nullish",m4="query-selector-undefined",m7=e=>td(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!nL(e.callee.object),fe=e=>td(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!nL(e.callee.object),ft=e=>{let t,r;return t=e,r=fe,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&e0(t.property,0)},fr=e=>{let t,r;return t=e,r=fe,td(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&e0(t.arguments[0],0)},fn=e=>nr(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,fo=(e,t,r,n)=>{let[,o]=eY(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},fa=(e,t,r)=>{if("Identifier"!==e.type)return;let n=ei(t.getScope(e),e);if(!n||1!==n.defs.length)return;let[o]=n.defs;if("Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&r(o.node.init))return o.node.init},fi=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tv(e))r=!r,e=e.parent;else if(tC(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tw(n)||(fe(e)?!e:!fa(e,r,fe)))return;let a=r.getText(e);return{node:e,messageId:m9,fix:((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return r.getAllComments().some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(s<=a||t>=i)})})(n,e,r)?void 0:e=>e.replaceText(n,`${a}.length ${o?"=== 0":"> 0"}`)}},fs=(e,t,r)=>({node:e,messageId:m8,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?o5(n,e,r):o4(n,e,r)}}),fl=(e,t)=>e9(e)||tb(e)&&t.isGlobalReference(e),fu=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:fa(n,r,t))&&fl(a,r)?{node:n,value:a}:(t(a)?a:fa(a,r,t))&&fl(n,r)?{node:a,value:n}:void 0:void 0},fp="no-invalid-file-input-accept/invalid",fc="no-invalid-file-input-accept/static",fd="no-invalid-file-input-accept/normalize",fm=new Set(["audio/*","image/*","video/*"]),ff=new Map([["application/x-rar-compressed","application/vnd.rar"],["application/x-zip-compressed","application/zip"],["image/jpg","image/jpeg"],["image/svg","image/svg+xml"],["image/x-icon","image/vnd.microsoft.icon"]]),fg=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,fy=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},fh=e=>{if(e.startsWith("."))return e.length>1&&!fy(e.slice(1))?{replacement:e.toLowerCase()}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};if(!e.includes("/"))return e.length>0&&"."!==e[0]&&!fy(e)?{replacement:`.${e.toLowerCase()}`}:{reason:"File extensions must start with `.` and cannot contain whitespace, commas, slashes, wildcards, or template markers."};let t=e.toLowerCase();if(t.includes("*"))return fm.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new m.MIMEType(e);return{replacement:ff.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},fx=e=>{if("JSXIdentifier"===e.type)return e.name},fb=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&fx(e.name)===t),fE=(e,t)=>{let r=e.sourceCode.getScope(t),n=ew(t,r)?.value;if("string"==typeof n)return n},fS=e=>">"===e||""===e.trim(),fD=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},fv=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],fC=(e,t,r)=>{let n=t;for(;t<r&&""!==e[t].trim()&&"="!==e[t]&&">"!==e[t]&&("/"!==e[t]||">"!==e[t+1]);)t++;return{name:e.slice(n,t).toLowerCase(),index:t}},fA=(e,t,r)=>{let n='"'===e[t]||"'"===e[t]?e[t]:void 0;if(n){let o=t+1;for(t=o;t<r&&e[t]!==n;)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!0,index:t+1}}let o=t;for(;t<r&&!fS(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},fT=(e,t,r)=>{let n=e.sourceCode.text,o=e.sourceCode.getRange(t.openStart)[1],a=e.sourceCode.getRange(t.openEnd)[1],i=o;for(;i<a&&(i=fD(n,i,a),!fv(n,i,a));){let e=fC(n,i,a);if(i=fD(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=fD(n,++i,a);let t=fA(n,i,a);if(i=t.index,e.name===r)return t}},fw=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:fp,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:fc};let r=(e=>{let t=e.split(","),r=new Set,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=fh(t);if(o.reason)return o;let{replacement:a}=o;r.has(a)||(r.add(a),n.push(a))}let o=n.join(", ");return o===e?{}:{replacement:o}})(e.value),n=r.replacement&&e.fixable&&(!e.isReplacementFixable||e.isReplacementFixable(r.replacement));return(({valueNode:e,checkResult:t,fix:r})=>{if(t.reason)return{node:e,messageId:fp,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:fd,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},fk=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,fI=e=>{for(let t=e.parent;t;t=t.parent)if(tl(t))return t},fj=(e,t)=>{switch(e.type){case"ForStatement":return[e.test,e.update,e.body].includes(t);case"ForInStatement":case"ForOfStatement":return t!==e.right;case"DoWhileStatement":case"WhileStatement":return!0;default:return!1}},fF=e=>{let{sourceCode:t}=e,r=new Set,n=e=>{let t=fI(e);t&&r.add(t)};return e.onExit("AwaitExpression",n),e.onExit("YieldExpression",n),e.onExit("ForOfStatement",e=>{e.await&&n(e)}),{isFunctionSuspended:e=>r.has(e),isInsideSuspendingLoop(e,r){for(let n=e,o=e.parent;o&&o!==r;n=o,o=o.parent)if(fj(o,n)&&tI(o,t.visitorKeys))return!0;return!1}}},fB="after-suspension",fR="in-nested-function",fP="no-unnecessary-nested-ternary";function fL(e,t,r){return r.getText(e)===r.getText(t)}function f$(e,t,r,n){let o=eQ(e,t);return!eZ(e,t)&&ox(e,{operator:r,property:n})&&(o=`(${o})`),o}function fN(e,t){let r=eQ(e,t);return!eZ(e,t)&&od(e)&&(r=`(${r})`),r}function fM(e,t,r){let n={node:t,messageId:fP};return 0===e.sourceCode.getCommentsInside(t).length&&(n.fix=n=>n.replaceText(t,function({context:e,node:t,left:r,operator:n,right:o,consequent:a,alternate:i}){let{sourceCode:s}=e,l=[f$(r,e,n,"left"),f$(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${fN(a,e)} : ${fN(i,e)}`;return nQ(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let fO="no-unused-array-method-return",fU=new Set(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),fq=new Set(["values"]),fW=/^\p{Uppercase_Letter}/v,f_=Symbol("uncertainValue"),fV=new Set(["BigInt","Boolean","Number","RegExp","String"]),fz=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),fK="prefer-array-last-methods",fG="replace",fJ=new Map([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),fX=["reverse","toReversed"],fH="prefer-math-abs",fY=new Set([">",">=","<","<="]),fQ={">":"<",">=":"<=","<":">","<=":">="},fZ={">":"<",">=":"<="};function f0(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&e5(e.literal)||"TSTypeAnnotation"===e.type&&f0(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>f0(e))||"TSIntersectionType"===e.type&&e.types.some(e=>f0(e))}function f1(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?f1(e.expression):e}function f2(e){let t;return e5(e)||e7(e,{name:"BigInt",argumentsLength:1,optional:!1})||"UnaryExpression"===e.type&&"-"===e.operator&&f2(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&f0(t)}function f3(e,t){return f2(e)||function(e,t){let r=f1(e);if("Identifier"!==r.type)return!1;let n=ei(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&f0(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&f2(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&f0(e.node.id.typeAnnotation)||e.node.init&&f2(e.node.init)))??!1}(e,t)}function f8(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?t0(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&e0(e.left,0)?t0(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(t0(e.left,t)&&tm(e.right)||tm(e.left)&&t0(e.right,t))}function f6(e,t){if(!("BinaryExpression"!==e.type||!fY.has(e.operator)||f3(e.left,t)||f3(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:fQ[e.operator]}}function f9(e,t){if(!("BinaryExpression"!==e.type||!fY.has(e.operator)||f3(e.left,t)||f3(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:fQ[e.operator]}}function f5(e,t){let r=eQ(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function f4(e,t,r){let n={node:e,messageId:fH};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function f7(e){return["Identifier","Literal","ThisExpression"].includes((e=f1(e)).type)}let ge="prefer-split-limit",gt=(e,t)=>{let r=ew(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0))return r.value},gr=e=>{let t;return td(e,{method:"split",argumentsLength:1})&&(e1(t=e.arguments[0])&&""!==t.value||e6(t))},gn=(e,t,r,n)=>({node:e,messageId:ge,fix:e=>oH(e,t,String(r+1),n)}),go="prefer-queue-microtask",ga={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tc(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&n_(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:go,data:{name:"process.nextTick()"},fix:((e,t)=>{let{parent:r}=e;if("CallExpression"===r.type&&r.callee===e&&1===r.arguments.length&&"SpreadElement"!==r.arguments[0].type&&!(t.sourceCode.getCommentsInside(e).length>0))return t=>t.replaceText(e,"queueMicrotask")})(t,e)}}),e.on("CallExpression",n=>{let o;return t&&"Identifier"===n.callee.type&&"setImmediate"===n.callee.name&&!n.optional&&n.arguments.length>0&&"SpreadElement"!==n.arguments[0].type&&!nM(n.arguments[0])&&nX(n)&&n_(n.callee,e)?{node:n.callee,messageId:go,data:{name:"setImmediate()"},fix:(e=>{if(1===e.arguments.length)return t=>t.replaceText(e.callee,"queueMicrotask")})(n)}:r&&"Identifier"===n.callee.type&&"setTimeout"===n.callee.name&&!n.optional&&n.arguments.length>=2&&"Literal"===(o=n.arguments[1]).type&&0===o.value&&"SpreadElement"!==n.arguments[0].type&&!nM(n.arguments[0])&&nX(n)&&n_(n.callee,e)?{node:n.callee,messageId:go,data:{name:"setTimeout()"},fix:((e,t)=>{if(2!==e.arguments.length)return;let r=((e,t)=>{let{sourceCode:r}=t,[,n]=e.arguments,o=r.getTokenBefore(n),a=r.getTokenAfter(n),i=a?.value===","?r.getTokenAfter(a):a,s=[r.getRange(o)[0],a?.value===","?r.getRange(a)[1]:r.getRange(n)[1]];if(!rt(t,[s[0],r.getRange(i)[0]]))return s})(e,t);if(r)return function*(t){yield t.replaceText(e.callee,"queueMicrotask"),yield t.removeRange(r)}})(n,e)}:void 0})},meta:{type:"suggestion",docs:{description:"Prefer `queueMicrotask()` over `process.nextTick()`, `setImmediate()`, and `setTimeout(…, 0)`.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkSetImmediate:{type:"boolean",description:"Whether to also check `setImmediate()`."},checkSetTimeout:{type:"boolean",description:"Whether to also check `setTimeout(…, 0)`."}}}],defaultOptions:[{checkSetImmediate:!1,checkSetTimeout:!1}],messages:{[go]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},gi="prefer-string-pad-start-end",gs="suggest-padding-method",gl=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),gu=(e,t)=>{let r,n=((e,t)=>{if("Identifier"!==e.type)return;let r=ei(t.sourceCode.getScope(e),e),n=r?.defs[0]?.node;return n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"?n:n?.type==="VariableDeclarator"?n.init:void 0})(e,t);return(r=ew(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||gl.has(e.type)||gl.has(n?.type)||n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"},gp=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,gc=e=>"Literal"===e.type&&"number"==typeof e.value,gd=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,gm=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&gc(t)&&gd(r),gf=(e,t)=>{if(!td(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=ew(e,t.sourceCode.getScope(e));if("string"==typeof r?.value)return r.value})(r,t);if(n?.length===1)return{paddingNode:r,paddingString:n,widthNode:e.arguments[0]}},gg=(e,t)=>{let r,n=gf(e,t);if(!n)return;let{widthNode:o}=n;if("BinaryExpression"===o.type&&"-"===o.operator&&(r=o.right,r?.type==="MemberExpression"&&!1===r.computed&&"Identifier"===r.property.type&&"length"===r.property.name))return{...n,targetLengthNode:o.left,targetNode:o.right.object}},gy=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=eQ(t,a),s=eQ(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${eQ(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},gh=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:gi,data:{method:t}};return o&&!gp(e,n)&&(a.fix=function(t){let o=nQ(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},gx=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:gi,data:{method:t}};return o&&!gp(e,n)&&(a.suggest=[{messageId:gs,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},gb="require-css-escape",gE=["closest","matches","querySelector","querySelectorAll"],gS=e=>e.value.cooked,gD=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=gS(r);if(void 0===e)return!1;n+=e}if(!((r=n).lastIndexOf("[")>r.lastIndexOf("]")))return!1;for(let r of e.quasis.slice(t+1)){let e=gS(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},gv=e=>td(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),gC=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],gA={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!td(e,{methods:gE,minimumArguments:1})||nL(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!gv(n)&&(t||gD(r,e))&&(yield{node:n,messageId:gb,fix:gC(n)})})},meta:{type:"suggestion",docs:{description:"Require `CSS.escape()` for interpolated values in CSS selectors.",recommended:"unopinionated"},fixable:"code",schema:[{type:"object",additionalProperties:!1,properties:{checkAllSelectors:{type:"boolean",description:"Check all selector interpolations instead of only attribute selector interpolations."}}}],defaultOptions:[{checkAllSelectors:!1}],messages:{[gb]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},gT="require-passive-events",gw=new Set(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),gk=e=>e.computed||"Identifier"!==e.property.type?e1(e.property)?e.property.value:void 0:e.property.name,gI=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===gk(t)&&("CallExpression"===(r=t).parent.type&&r.parent.callee===r?r.parent:"ChainExpression"===r.parent.type&&"CallExpression"===r.parent.parent.type&&r.parent.parent.callee===r.parent?r.parent.parent:void 0)},gj=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=gk(e.parent);return t&&"preventDefault"!==t&&!nr((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},gF="this",gB="class",gR="class-unavailable",gP="super",gL="super-class",g$="super-class-unavailable",gN="suggestion",gM=new Set(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),gO=new Set(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),gU=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,gq=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,gW=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(gq(r)&&!gU(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(gM.has(r.type))return}},g_=e=>{if(e.id)return e.id;let{parent:t}=e;if("ClassExpression"===e.type&&"VariableDeclarator"===t.type&&t.init===e&&"Identifier"===t.id.type)return t.id},gV=(e,t,r)=>ei(e.getScope(t),t)===ei(e.getScope(r),r),gz=(e,t,r)=>ei(e.getScope(t),r.name)===ei(e.getScope(r),r),gK=(e,t)=>"AssignmentExpression"===e.type&&e.left===t||"UpdateExpression"===e.type&&e.argument===t||"UnaryExpression"===e.type&&"delete"===e.operator&&e.argument===t||("ForInStatement"===e.type||"ForOfStatement"===e.type)&&e.left===t,gG=e=>{let t;return(t=e.parent,gO.has(t.type)&&t.expression===e)?e.parent:void 0},gJ=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=gG(e);return r||("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type?t.parent:"ObjectPattern"===t.type&&t.properties.includes(e)||"ArrayPattern"===t.type&&t.elements.includes(e)||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e?t:void 0)},gX=e=>{let t=e;for(;t.parent;){if(gK(t.parent,t))return!0;let e=gJ(t);if(!e)break;t=e}return!1},gH=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,gY=e=>{let t=e;for(;t.parent;){let e=gG(t);if(!e)break;t=e}return t},gQ=e=>{let t=gY(e);return"CallExpression"===t.parent.type&&t.parent.callee===t||"NewExpression"===t.parent.type&&t.parent.callee===t||"TaggedTemplateExpression"===t.parent.type&&t.parent.tag===t},gZ=e=>{let t=gY(e);return gH(t)&&"PrivateIdentifier"===t.parent.property.type},g0=e=>{let t=gY(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},g1=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,g2=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:gN,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),g3=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),g8={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||gX(e)||gQ(e)||gZ(e)||g0(e))return;let n=gW(e);if(!n)return;let o=g_(n.parent.parent);return o&&gz(t,e,o)?g2({node:e,messageId:gB,source:"this",replacement:o.name,name:o.name}):g3(e,gR)}),e.on("Super",e=>{if(n||gX(e))return;let r=gW(e);if(!r)return;let o=g1(r.parent.parent);return o&&gz(t,e,o)?g2({node:e,messageId:gL,source:"super",replacement:o.name,name:o.name}):g3(e,g$)}),e.on("Identifier",o=>{if(!tf(o)||(e=>{let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeReference"===t.parent.type&&t.parent.typeName===t||"TSTypeQuery"===t.parent.type&&t.parent.exprName===t})(o)||gX(o)||gQ(o)||gZ(o)||g0(o))return;let a=gW(o);if(!a)return;let i=a.parent.parent;if(r){let e=g_(i);if(e&&o.name===e.name&&gV(t,o,e))return g2({node:o,messageId:gF,source:o.name,replacement:"this",name:o.name})}if(!n||!(gH(o)&&!o.parent.optional&&!gX(o.parent))||eZ(o,e))return;let s=g1(i);if(s&&o.name===s.name&&gV(t,o,s))return g2({node:o,messageId:gP,source:o.name,replacement:"super",name:o.name})})},meta:{type:"suggestion",docs:{description:"Enforce consistent class references in static methods.",recommended:!0},hasSuggestions:!0,schema:[{type:"object",properties:{preferThis:{type:"boolean",description:"Prefer `this` over the current class name in static methods."},preferSuper:{type:"boolean",description:"Prefer `super` over the superclass name in static methods."}},additionalProperties:!1}],defaultOptions:[{preferThis:!0,preferSuper:!0}],messages:{[gF]:"Use `this` instead of `{{name}}` in static methods.",[gB]:"Use `{{name}}` instead of `this` in static methods.",[gR]:"Use the class name instead of `this` in static methods.",[gP]:"Use `super` instead of `{{name}}` in static methods.",[gL]:"Use `{{name}}` instead of `super` in static methods.",[g$]:"Use the superclass name instead of `super` in static methods.",[gN]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},g6="consistent-optional-chaining/remove-optional",g9="consistent-optional-chaining/use-optional",g5="consistent-optional-chaining/suggest-remove-optional",g4="consistent-optional-chaining/suggest-use-optional",g7=new Set(["Identifier","ThisExpression","Super"]);function ye(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=ry(e)).type&&(e=e.expression);return e}function yt(e){return"MemberExpression"===(e=ye(e)).type?e:void 0}function yr(e){return e=ye(e),!!g7.has(e.type)||"MemberExpression"===e.type&&yr(e.object)}function yn(e,t){let r=ri(e,t);return!rt(t,r)}function yo({memberExpression:e,context:t,fixer:r,replacement:n}){let o=ri(e,t);return r.replaceTextRange(o,n)}function ya(e,t,r){return yo({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let yi="always",ys="never",yl="missing-delay",yu="redundant-delay",yp=new Set(["setTimeout","setInterval"]),yc=new Set(["window","globalThis","global","self"]),yd=e=>e0(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&yd(e.argument),ym="negative-index",yf="length-index",yg=["entries","keys","values"],yy=["drop","filter","flatMap","map","take"],yh=["concat","from","zip","zipKeyed"],yx=e=>{for(;rg(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},yb="no-duplicate-loops",yE=["filter","map"],yS="no-declarations-before-early-exit",yD=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),yv=e=>"use"===e||/^use[\dA-Z]/.test(e),yC=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,yA=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eg(n)},yT=(e,t)=>{let[r,n]=e.getRange(t);return new Set(tU(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*yw(e,t,r){let n;for(let[o,a]of t.entries())if(yD(a)&&!a.declare){n??=t.map(e=>{var t,n;return(t=e,n=r,"IfStatement"!==t.type||n(t.consequent)===(!!t.alternate&&n(t.alternate)))?void 0:e});for(let r=o+1;r<t.length;r++){let t=n[r];if(t){for(let n of a.declarations){let i=function({sourceCode:e,declaration:t,declarator:r,guardStatement:n,declarationIndex:o,guardIndex:a}){var i;let s;if("Identifier"!==r.id.type||(e=>{if(e?.type!=="CallExpression")return!1;let{callee:t}=e;return"Identifier"===t.type?yv(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&yv(t.property.name)})(r.init)||r.init&&tI(r.init,e.visitorKeys)||a>o+1&&!yC(r.init)||r.init&&(i=r.init,s=yT(e,n),[...yT(e,i)].some(e=>s.has(e)))&&(eL(r.init,e)||eL(n.test,e)))return;let[l]=e.getDeclaredVariables(r),u=l.references.filter(e=>!e.init&&!function(e){let t=e;for(;"TSQualifiedName"===t.parent.type;)t=t.parent;return"TSTypeQuery"===t.parent.type}(e.identifier));if(0===u.length)return;let[,p]=e.getRange(n);if(u.some(t=>e.getRange(t.identifier)[0]<p))return;let c={node:r.id,messageId:yS};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&yC(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!yA(e,t,"before")&&!yA(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eg(e)))({sourceCode:e,declaration:t,guardStatement:n,declarationIndex:o,guardIndex:a})&&(c.fix=function(e,t,r){let n=e.getText(t),o=e.getText(r),[a,i]=e.getRange(t),[s,l]=e.getRange(r),u=e.text.slice(i,s);return e=>e.replaceTextRange([a,l],`${o}${u}${n}`)}(e,t,n)),c}({sourceCode:e,declaration:a,declarator:n,guardStatement:t,declarationIndex:o,guardIndex:r});i&&(yield i)}break}}}}let yk="no-optional-chaining-on-undeclared-variable",yI=e=>"Type"===e.type||"ImportBinding"===e.type&&nZ(e.node);function yj(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=ry(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let yF="no-object-methods-with-collections/error",yB="no-object-methods-with-collections/suggestion",yR=new Set(["entries","keys","values"]),yP="no-subtraction-comparison/error",yL="no-subtraction-comparison/suggestion",y$={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},yN=new Set(Object.keys(y$)),yM=new Set([">","<"]),yO=e=>"BinaryExpression"===e.type&&"-"===e.operator,yU=(e,t)=>{let r=ew(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},yq="no-unnecessary-global-this",yW=new Set(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function y_(e){for(;yW.has(e.type);)e=e.expression;return e}let yV=e=>{for(;yW.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e};function yz(e){return"CallExpression"===(e=yV(e)).parent.type&&e.parent.callee===e}let yK=new Set(["==","!=","===","!=="]),yG="computed-key",yJ="nested-array",yX="deep-object",yH="property-assignment";function yY(e){let{parent:t}=e;if(t){if(rg(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return yY(t);if("Property"===t.type&&t.value===e&&"ObjectPattern"===t.parent.type)return t.parent;if("ObjectPattern"===t.type||"ArrayPattern"===t.type)return t}}function yQ(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=yY(e);return t}let yZ="no-useless-else",y0=new Set(["Program","BlockStatement","StaticBlock","SwitchCase"]),y1=new Set(["[","(","<","/","`","+","-"]),y2=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},y3=e=>y1.has(e.value[0]),y8="no-useless-recursion",y6=new Set(["using","await using"]),y9=e=>e?.type==="VariableDeclaration"&&y6.has(e.kind),y5=e=>"ForStatement"===e.type?y9(e.init):"ForOfStatement"===e.type&&y9(e.left),y4="prefer-add-event-listener-options",y7="prefer-direct-iteration",he="Array",ht="FormData",hr="URLSearchParams",hn=new Set([he,"Map","Set",ht,hr,...rE]),ho=new Map([["ReadonlyArray",he],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),ha=new Map([[he,["values"]],["Map",["entries"]],["Set",["values","keys"]],[ht,["entries"]],[hr,["entries"]],...rE.map(e=>[e,["values"]])]),hi=["Map","WeakMap","Set","WeakSet"],hs=["all","allSettled","any","race"],hl=new Set(["ArrayExpression","CallExpression","NewExpression"]),hu=e=>new Set([e]),hp=(e,t)=>td(e,{objects:rE,methods:t,optionalCall:!1,optionalMember:!1}),hc=e=>hn.has(e)?e:ho.get(e),hd=e=>{let t=new Set;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},hm=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return hd(e.types.map(e=>hm(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return hu(he);let n=rv(e);if(!rC(n,r))return;let o=n.getName(),a=o&&hc(o);return a&&hu(a)},hf=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return hf(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return hu(he);case"TSTypeOperator":return"readonly"===e.operator?hf(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=hc(e.typeName.name);return t&&hu(t)}case"TSUnionType":return hd(e.types.map(e=>hf(e)))}},hg=(e,t,r=new Set)=>((e,t,r)=>{if("ArrayExpression"===e.type||te(e,{name:"Array"}))return hu(he);if(te(e,{names:rE})||te(e,{names:["Map","Set",ht,hr]}))return hu(e.callee.name);if(e7(e,{name:"Array"})||td(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return hu(he);if(hp(e,["from","of"]))return hu(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=hf(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?hg(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return hf(e.typeAnnotation)??hg(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return hg(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return hm(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),hy="prefer-number-is-safe-integer/error",hh="prefer-number-is-safe-integer/suggestion",hx="prefer-number-is-safe-integer/integer-check-error",hb="prefer-number-is-safe-integer/integer-check-suggestion",hE=["_","lodash","underscore"],hS=["floor","trunc"],hD=(e,t)=>{let r=ei(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},hv=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&e0(e.right,1))return e.left},hC=(e,t)=>{if(td(e,{object:"Math",methods:hS,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},{isIdentifierName:hA}=tN,hT="prefer-object-define-properties";function hw(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(td(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let hk="prefer-object-destructuring-defaults",hI="prefer-object-destructuring-defaults/suggestion",hj=new Set(Object.getOwnPropertyNames(Object.prototype)),hF={considerGetters:!0,considerImplicitTypeConversion:!0},hB=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,hR=(e,t,r)=>tU(r.sourceCode.getScope(e)).some(n=>t.has(n.identifier.name)&&((e,t,r)=>{let[n,o]=r.getRange(e),[a,i]=r.getRange(t);return n>=a&&o<=i})(n.identifier,e,r.sourceCode)),hP=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=eQ(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},hL="prefer-single-object-destructuring",h$=(e,t)=>{let r,n;if(!("VariableDeclaration"===t.type&&("const"===(r=t.kind)||"let"===r)&&!t.declare&&1===t.declarations.length))return;let[o]=t.declarations;if("ObjectPattern"===o.id.type&&!o.id.typeAnnotation&&(n=o.id).properties.length>0&&n.properties.every(e=>"Property"===e.type&&!e.computed&&"Identifier"===e.value.type)&&o.init?.type==="Identifier"&&((e,t)=>{let r=ei(e.getScope(t),t);if(!r||1!==r.defs.length)return!1;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"VariableDeclaration"===n.parent.type&&!n.parent.declare&&"const"===n.parent.kind})(e,o.init))return{node:t,declarator:o,source:o.init.name}},hN=(e,t,r)=>{let n,o,a=h$(e,t),i=h$(e,r);if(!(a&&i&&a.node.kind===i.node.kind&&a.source===i.source&&0===e.getCommentsInside(a.node).length&&0===e.getCommentsInside(i.node).length&&(n=a.node,o=i.node,!e.getTokensBetween(n,o,{includeComments:!0}).some(e=>eg(e)))))return;let s=t=>t.properties.map(t=>e.getText(t)).join(", "),l=`${a.node.kind} {${s(a.declarator.id)}, ${s(i.declarator.id)}} = ${a.source};`;return{node:i.node,messageId:hL,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*hM(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=hN(e,t[r-1],n);o&&(yield o)}}let hO="prefer-smaller-scope",hU=new Set(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function hq(e,t){let r=e.parent;for(;r&&r!==t;){if(hU.has(r.type))return!1;r=r.parent}return r===t}function hW(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eg(n))}function h_(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let hV="prefer-single-array-predicate/error",hz="prefer-single-array-predicate/suggestion",hK=new Map([["||","some"],["&&","every"]]),hG=new Set(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),hJ="prefer-url-href",hX="non-url",hH="unknown",hY=new Set(["ClassName","ImportBinding","Type"]),hQ=new Set(["any","error","unknown"]),hZ=new Set(["node:url","url"]),h0=e=>hY.has(e.type),h1=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>n0(e,r,n)))return o;t=t.upper}},h2=e=>e.every(e=>"url"===e)?"url":!e.includes(hH)&&e.includes(hX)?hX:hH,h3=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,hZ.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},h8=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||nZ(e.node)),h6=e=>"Type"===e.type||h8(e),h9=e=>h3(e)&&!h8(e),h5=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>!h6(e)&&n0(e,r,n)))return!0;t=t.upper}return!1})("URL",t.sourceCode.getScope(e),e,t))return!1;if(n_(e,t))return!0;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>h6(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.some(e=>h9(e))??!1})(r,t))},h4=(e,t)=>t.sourceCode.getScope(e.name??e.node),h7=(e,t,r,n=new Set)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return h7(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return hH;let o=e.typeName.name,a=h1(o,r,e.typeName,t),[i]=a?.defs??[];if(!i)return"URL"!==o||((e,t)=>{for(;t;){let r=t.set.get(e);if(r?.defs.some(e=>h0(e)))return!0;t=t.upper}return!1})(o,r)?hH:"url";if(n.has(o))return hH;if(h3(i))return"url";n.add(o);let s=hH;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=h7(i.node.typeAnnotation,t,h4(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=hH:"ClassName"===i.type&&(s=hX),n.delete(o),s})(e,t,r,n);case"TSUnionType":return h2(e.types.map(e=>h7(e,t,r,n)));case"TSIntersectionType":return h2(e.types.map(e=>h7(e,t,r,n)));case"TSImportType":let o;return(o=e.source,hZ.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":hX;default:return e?hX:hH}},xe=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(hQ.has(e.intrinsicName)||e.isTypeParameter?.())return hH;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return xe(i,t);if(e.isUnion()||e.isIntersection())return h2(e.types.map(e=>xe(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return hH;let n=h1(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||h3(e))??[];return 0===o.length?hH:o.every(e=>h3(e))?"url":hX})(r.typeToString(e),o,n);if(s!==hH)return s;let l=rv(e);return rC(l,a)&&"URL"===l.getName()?"url":hX},xt=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return hH;try{let{program:n}=r;return xe(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return hH}};function xr(e,t,r=new Set){if(!e)return hH;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=ei(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return hH;let[o]=n.defs;if(!n0(o,e,t))return hH;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?xr(o.node.init,t,r):hH,i=h7(o.name?.typeAnnotation,t,h4(o,t)),s=hH;return a!==hH?s=a:i!==hH&&(s=i),r.delete(n),s})(e,t,r);if(n!==hH)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=h7(e.typeAnnotation,t,n);return o===hH?xr(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return xr(e.expression,t,r);case"SequenceExpression":return xr(e.expressions.at(-1),t,r);case"ConditionalExpression":return h2([xr(e.consequent,t,r),xr(e.alternate,t,r)])}if(h5(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!h6(e)&&!h9(e))??!1})(e.callee,t))return hX;let r=xt(e,t);return r===hH?hX:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return hH;let r=ei(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return hH;let[n]=r.defs;return h7(n.node.returnType,t,h4(n,t))})(e,t);return o!==hH?o:xt(e,t)}let xn=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return xn(e.expression,t);case"SequenceExpression":return xn(e.expressions.at(-1),t);case"ConditionalExpression":return xn(e.consequent,t)&&xn(e.alternate,t);case"NewExpression":return h5(e,t);default:return!1}},xo=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,xa="require-proxy-trap-boolean-return",xi=new Set(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),xs=new Set(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),xl=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),xu=new Set(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),xp=(e,t)=>({node:e,messageId:xa,data:{name:t}}),xc=e=>{if(e)return xp(e.node,e.data.name)},xd=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?xc(xd(e.right,t,r)):xp(e,t);if("ConditionalExpression"===e.type)return xd(e.consequent,t,r)??xd(e.alternate,t,r);if("LogicalExpression"===e.type)return xc(xd(e.left,t,r)??xd(e.right,t,r));if("SequenceExpression"===e.type)return xc(xd(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=ew(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(xl.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&xu.has(e.operator)))return;let o=((e,t,r)=>{if(!(r.getCommentsInside(e).length>0)&&("Literal"===e.type&&!e.regex||"TemplateLiteral"===e.type&&0===e.expressions.length||"Identifier"===e.type&&"undefined"===e.name))return String(t)})(e,n,r);return{...xp(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},xm=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eI(e,t.getScope(e));if(xi.has(r)&&xs.has(e.value.type))return{name:r,functionNode:e.value}},xf=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return xp(e,t);if("BlockStatement"!==e.body.type)return xd(e.body,t,r);let o=[...function* e(t){if(t&&"string"==typeof t.type){if("ReturnStatement"===t.type)return void(yield t);if(!("BlockStatement"!==t.type&&xs.has(t.type))){for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){for(let t of n)yield*e(t);continue}yield*e(n)}}}}(e.body)],a=n.get(e)??!1;if(0===o.length){if(a)return;return xp(e,t)}for(let e of o){if(!e.argument)return xp(e,t);let n=xd(e.argument,t,r);if(n)return n}if(!a)return xp(e,t)},xg=f.builtinRules.get("logical-assignment-operators"),xy="ifNullish",xh="convertIf",xx={...xg.meta.messages,[xy]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},xb=e=>e.fix??e.suggest?.[0]?.fix,xE={create:e=>{let{sourceCode:t}=e,r=Object.create(e,{report:{value(r){e.report(function(e,t){let r;if("if"!==e.messageId||e.data?.operator!=="||="||"function"!=typeof xb(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:xy};if(t.getCommentsInside(e.node).length>0)return n;let o=xb(e);return{...n,suggest:[{messageId:xh,data:{operator:"||="},fix:o},{messageId:xh,data:{operator:"??="},fix:e=>o(new Proxy(e,{get(e,t){if("insertTextBefore"!==t){let r=Reflect.get(e,t,e);return"function"==typeof r?r.bind(e):r}return(t,r)=>e.insertTextBefore(t,"||"===r?"??":r)}}))}]}}(r,t))}}});for(let[t,n]of Object.entries(xg.create(r)))e.on(t,n)},meta:{type:xg.meta.type,docs:{description:xg.meta.docs.description,recommended:!0},fixable:xg.meta.fixable,hasSuggestions:xg.meta.hasSuggestions,schema:xg.meta.schema,defaultOptions:[xg.meta.defaultOptions?.[0]],messages:xx,languages:["js/js"]}},xS="no-useless-coercion",xD=new Map([["Boolean",{type:"boolean",isType:nA}],["String",{type:"string",isType:nR}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&nw(e.typeAnnotation)||nk(e,t))||"bigint"==typeof ew(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>nc(e,t.sourceCode.getScope(e))}]]),xv=e=>"Literal"===e.type&&""===e.value,xC="no-useless-boolean-cast",xA=["every","filter","find","findIndex","findLast","findLastIndex","some"],xT="no-useless-continue",xw="no-useless-override",xk=e=>e.isUnion()?e.types.every(e=>xk(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,xI=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},xj="prefer-has-check",xF=new Set(["Map","ReadonlyMap","WeakMap"]),xB=new Set(["Map","WeakMap"]),xR=new Set(["FormData","Headers","URLSearchParams"]),xP=new Set(["Array","ReadonlyArray"]),xL=xB.union(xR),x$=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),xN=new Set(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),xM=new Set(["TSTypeAnnotation","TSParenthesizedType"]),xO=new Set(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),xU=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),xq=new Set(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),xW=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),x_=new Set(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),xV=e=>{for(;x_.has(e.type);)e=e.expression;return e},xz=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=xz(e.left);return t?`${t}.${e.right.name}`:void 0}},xK=e=>e.typeArguments?.params??e.typeParameters?.params??[],xG=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>x$.has(e.type));if(r)return r;t=t.upper}},xJ=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===xK(e.node).length)return e.node.typeAnnotation},xX=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=ei(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},xH=(e,t)=>tb(e)&&xX(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,xY=(e,t)=>xF.has(e)?{kind:"map",typeName:e,valueType:t}:xR.has(e)?{kind:"null-sentinel",typeName:e}:void 0,xQ=(e,t,r=new Set)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return xQ(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?xQ(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=xz(e.typeName);if(!n)return;if((xF.has(n)||xR.has(n))&&!xG(n,t))return xY(n,xK(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),xJ(xG(e,t))})(n,t,r);return o?xQ(o,t,r):void 0}}},xZ=(e,t)=>{let r=t.sourceCode.getScope(e);return xQ(e.typeAnnotation,r)},x0=(e,t,r=new Set)=>{let n=xZ(e,t);if(n)return n;if(te(e=xV(e))&&"Identifier"===e.callee.type&&xL.has(e.callee.name)&&xX(e.callee,t))return xY(e.callee.name);if("Identifier"!==e.type)return;let o=ei(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=xQ(a.name?.typeAnnotation,t.sourceCode.getScope(a.name));return i||("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init?x0(a.node.init,t,r):void 0)},x1=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=rv(r);if(rC(e,t))return e.getName()}},x2=(e,t,r)=>{if(rS.has(e.intrinsicName)||rD.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>x2(e,t,r));if(1===new Set(n.map(e=>e?.typeName)).size){let[e]=n;if(e?.kind!=="map")return e;let r=n.map(e=>e?.valueType);return{...e,valueType:r.every(Boolean)?t.getUnionType(r):void 0}}if(n.every(e=>e?.kind==="map")){let e=n.map(e=>e.valueType);return{kind:"map",typeName:"Map",valueType:e.every(Boolean)?t.getUnionType(e):void 0}}return n.every(e=>e?.kind==="null-sentinel")?{kind:"null-sentinel",typeName:"null-sentinel"}:void 0}if(e.isIntersection())return e.types.map(e=>x2(e,t,r)).find(e=>e?.kind==="map");let n=x1(e,r);return xY(n,xF.has(n)?t.getTypeArguments(e).at(-1):void 0)},x3=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return x2(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},x8=(e,t)=>x3(e,t)??x0(e,t),x6=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,x9=(e,t,r,n=new Set)=>{if(!e||xO.has(e.type))return!1;if(xM.has(e.type))return x9(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&x9(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>x9(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(xU.has(e.type))return"truthy"!==r;if(xq.has(e.type))return!0;if("TSTypeLiteral"===e.type)return"truthy"!==r;if("TSLiteralType"===e.type){var o;let t="Literal"===(o=e.literal).type?o.value:"TemplateLiteral"===o.type&&0===o.expressions.length?o.quasis[0].value.cooked:"UnaryExpression"===o.type&&("-"===o.operator||"+"===o.operator)&&"Literal"===o.argument.type&&("number"==typeof o.argument.value||"bigint"==typeof o.argument.value)?"-"===o.operator?-o.argument.value:o.argument.value:void 0;return void 0!==t&&x6(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=xz(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=xJ(o=xG(i,t.sourceCode.getScope(e.typeName))))?{type:"alias",node:a}:o?.type==="ClassName"||o?.type==="Type"&&"TSInterfaceDeclaration"===o.node.type?{type:"object"}:void 0,l=!1;return s?.type==="alias"?l=x9(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},x5=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,x4=(e,t,r)=>{if(rS.has(e.intrinsicName))return!1;let n=x5(e,t);return n&&n!==e?x4(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>x4(e,t,r)):!r.has(e.intrinsicName))},x7=(e,t,r)=>{if(rS.has(e.intrinsicName)||rD.has(e.intrinsicName))return!1;let n=x5(e,t);if(n&&n!==e)return x7(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>x7(e,t,r));if(xN.has(e.intrinsicName))return!1;if("true"===e.intrinsicName||"symbol"===e.intrinsicName)return!0;if(e.isStringLiteral?.())return e.value.length>0;if(e.isNumberLiteral?.())return 0!==e.value;if(e.isBigIntLiteral?.())return e.value.negative||"0"!==e.value.base10Value;let o=t.typeToString(e);return/^-?\d+n$/u.test(o)?!/^-?0n$/u.test(o):"object"===t.typeToString(e)||xP.has(x1(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},be=(e,t,r)=>{if(!te(e)||"Identifier"!==e.callee.type||!xB.has(e.callee.name)||!xX(e.callee,t))return;if(0===e.arguments.length)return!0;if(1!==e.arguments.length)return;let[n]=e.arguments;if("ArrayExpression"===n.type)return n.elements.every(e=>{var n;let o;return e?.type==="ArrayExpression"&&e.elements.length>=2&&e.elements[1]&&"SpreadElement"!==e.elements[1].type&&(n=e.elements[1],(o=ew(n,t.sourceCode.getScope(n)))?x6(o.value,r):!tb(n)&&xW.has(n.type))})},bt=(e,t,r)=>{let n=be(xV(e),t,r);if(void 0!==n)return n;let o=x3(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?x7(o,n,e):"not-undefined"===r?x4(o,n,new Set(["undefined","void"])):x4(o,n,new Set(["undefined","void","null"])))return!0}return function e(t,r,n,o={}){let a,i=o.visitedVariables??new Set,s=o.checkConstructorValues??!0,l=xZ(t,r);if(l?.kind==="map")return!!l.valueType&&x9(l.valueType,r,n);let u=((e,t,r,n)=>{if(!te(e)||"Identifier"!==e.callee.type||!xB.has(e.callee.name)||!xX(e.callee,t))return;if(n){let n=be(e,t,r);if(void 0!==n)return n}let o=xK(e).at(-1);return!!o&&x9(o,t,r)})(t=xV(t),r,n,s);if(void 0!==u)return u;let p=((e,t,r)=>{if("Identifier"!==e.type)return;let n=ei(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,i);if(!p)return!1;i.add(p);let[c]=p.defs,d=(a=xQ(c.name?.typeAnnotation,r.sourceCode.getScope(c.name)),a?.kind==="map"?!!a.valueType&&x9(a.valueType,r,n):"Variable"===c.type&&"const"===c.parent.kind&&c.node.id===c.name&&!!c.node.init&&e(c.node.init,r,n,{visitedVariables:i,checkConstructorValues:!1}));return i.delete(p),d}(e,t,r)},br=e=>"Literal"===e.type&&null===e.value,bn="logical",bo="ternary",ba="consistent-conditional-object-spread",bi=new Set(["==","==="]),bs=new Set(["!=","!=="]),bl=e=>ta(e)||tb(e)||e9(e),bu=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function bp(e,t,r){if(t0(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return bp(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&bp(e.left,t.left,r)&&bp(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&bp(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function bc(e){return e9(e)?"null":tb(e)?"undefined":void 0}function bd(e){if("BinaryExpression"!==e.type||!bi.has(e.operator)&&!bs.has(e.operator))return;let t=bc(e.left),r=bc(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:bi.has(e.operator)}}let bm=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function bf(e,t){let r=bd(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=bd(e.left),o=bd(e.right);if(n&&o&&bp(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&bm(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&bm(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function bg(e,t,r){let n=eQ(e,r);return!eZ(e,r)&&ox(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function by(e,t){let r=eQ(e,t);return!eZ(e,t)&&od(e)&&(r=`(${r})`),r}let bh="default-export-style/inline",bx="default-export-style/separate",bb="default-export-style/suggestion-inline",bE="default-export-style/suggestion-separate",bS="inline",bD="separate",bv="ignore",bC="class",bA="function",bT=()=>({enum:[bS,bD,bv]}),bw=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,bk=e=>e.id?.name,bI=e=>{switch(e.type){case"ClassDeclaration":return bC;case"FunctionDeclaration":return bA}},bj=e=>e===bC?"classes":"functions",bF=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return t9(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},bB=(e,t)=>ei(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,bR=e=>!!e&&!!(e.type.startsWith("TS")||e.typeAnnotation||e.typeParameters||e.returnType||e.implements?.length>0||e.superTypeArguments||e.accessibility||e.readonly||e.override||e.definite||e.optional&&"MemberExpression"!==e.type&&"CallExpression"!==e.type||e.abstract||e.declare||e.decorators?.length>0),bP=(e,t)=>{if(bR(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&bP(e,t)))return!0;continue}if(n?.type&&bP(n,t))return!0}return!1},bL=(e,t)=>e.params.every(e=>!rm(e,t.sourceCode.visitorKeys)),b$=(e,t,r)=>ei(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,bN=(e,t)=>{let r=bk(e);if(r){let t=bI(e);return t&&{kind:t,name:r,declaration:e}}let n=((e,t)=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[r]=e.declarations;if(!("Identifier"!==r.id.type||bR(r.id)||r.init?.type!=="ArrowFunctionExpression"||bP(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:bA,name:n.id.name,declaration:e,functionNode:n.init}},bM=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),bO=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||b$(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!bP(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&bL(t,e)&&!rm(t.body,e.sourceCode.visitorKeys))return[{messageId:bE,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${bM(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
19
+ export default ${n};`)}]},bU=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===bv||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return t9(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||bB(i,r.declaration))&&(o!==bA||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===bA&&"FunctionDeclaration"===t.type&&bP(t,e.sourceCode.visitorKeys))){if(n===bS)return"VariableDeclaration"===t.type?{node:r,messageId:bh,data:{kind:o},suggest:(({context:e,declaration:t,exportDeclaration:r,name:n,scope:o})=>{let[{id:a,init:i}]=t.declarations;if(!(e.sourceCode.getCommentsInside(r).length>0||bF(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||b$(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!bP(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&bL(i,e)&&!rm(i.body,e.sourceCode.visitorKeys))return[{messageId:bb,data:{kind:bA},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${bM(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${eQ(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===bC&&bP(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||bF(e,r)?{node:r,messageId:bh,data:{kind:o}}:{node:r,messageId:bh,data:{kind:o},fix:function*(n){yield n.insertTextBefore(t,"export default "),yield n.removeRange([e.sourceCode.getRange(t)[1],e.sourceCode.getRange(r)[1]])}};if(n===bD&&o===bA&&"FunctionDeclaration"===t.type)return{node:r,messageId:bx,data:{kind:o,style:"const arrow function"},suggest:bO({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},bq=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=bk(o),i=e.sourceCode.getScope(t);if(!(!a||r===bv||r===bS||bB(i,a)||n===bA&&(o.generator||bP(o,e.sourceCode.visitorKeys)))){if(n===bA)return{node:t,messageId:bx,data:{kind:n,style:"const arrow function"},suggest:bO({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===bC&&bP(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:bx,data:{kind:n,style:"class declaration"}}:{node:t,messageId:bx,data:{kind:n,style:"class declaration"},fix:r=>{let{declaration:n}=t;return r.replaceText(t,`${e.sourceCode.getText(n)}
20
+ export default ${n.id.name};`)}}}},bW={create:e=>{let t=e.options[0];e.on("Program",r=>{for(let[n,o]of r.body.entries()){if("ExportDefaultDeclaration"===o.type){let{declaration:r}=o,n=bI(r),a=bk(r);if(!n||!a)continue;let i=bq({context:e,exportDeclaration:o,expectedStyle:t[bj(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=bN(o,e);if(!i||!bw(a,i.name))continue;let s=bU({context:e,exportDeclaration:a,expectedStyle:t[bj(i.kind)],scope:e.sourceCode.getScope(a),...i});if(s)return s}})},meta:{type:"suggestion",docs:{description:"Enforce consistent default export declarations.",recommended:!0},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{functions:bT(),classes:bT()},additionalProperties:!1}],defaultOptions:[{functions:bS,classes:bS}],messages:{[bh]:"Prefer declaring this default-exported {{kind}} inline.",[bx]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[bb]:"Use an inline default {{kind}} declaration.",[bE]:"Use a separate const arrow function default export."},languages:["js/js"]}};function b_(e){for(;;){let t=ry(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function bV(e,t){return ei(t.sourceCode.getScope(e),e)}let bz="no-array-concat-in-loop",bK="no-array-front-mutation",bG=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],bJ="no-array-sort-for-min-max/error",bX="no-array-sort-for-min-max/suggestion",bH=e=>e8(e)&&0===e.value,bY=(e,t)=>{if(!td(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||rQ(e.callee.object,t)||rh(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tl(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=ry((e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(e));if(t?.type!=="BinaryExpression"||"-"!==t.operator)return;let[r,n]=e.params;if(r.name!==n.name){if(t0(t.left,r)&&t0(t.right,n))return"ascending";if(t0(t.left,n)&&t0(t.right,r))return"descending"}})(r);if(n)return{direction:n,node:e.callee.object}},bQ=(e,t,r,n)=>{var o,a,i;let s=(o=t.direction,"first"===r?"ascending"===o?"min":"max":"ascending"===o?"max":"min"),l={node:e,messageId:bJ,data:{method:s,extreme:"min"===s?"minimum":"maximum"}};if("Super"!==t.node.type&&0===n.sourceCode.getCommentsInside(e).length){let r,o=(a=t.node,i=n.sourceCode,r=nG(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:bX,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},bZ="no-boolean-sort-comparator",b0="no-boolean-sort-comparator/suggestion",b1=new Set(["sort","toSorted"]),b2=new Set([">",">=","<","<="]),b3=(e,t,r,n)=>(e=ry(e),t=ry(t),"Identifier"===e.type&&"Identifier"===t.type)?e.name===r.name&&t.name===n.name||e.name===n.name&&t.name===r.name:"MemberExpression"===e.type&&"MemberExpression"===t.type&&e.computed===t.computed&&(e.computed?!!t0(e.property,t.property):e.property.name===t.property.name)&&b3(e.object,t.object,r,n),b8=(e,t)=>{for(;rg(e);){if(e.typeAnnotation&&nS(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},b6="no-chained-comparison/error",b9="no-chained-comparison/suggestion",b5=new Set(["<",">","<=",">="]),b4=new Set(["===","!==","==","!="]),b7=b5.union(b4),Ee=e=>"BinaryExpression"===e.type&&b7.has(e.operator),Et="no-constant-zero-expression/error",Er="no-constant-zero-expression/suggestion",En="no-duplicate-logical-operands",Eo="no-duplicate-logical-operands/suggestion",Ea=new Set(["Identifier","ThisExpression","Literal"]),Ei=new Set(["Identifier","ThisExpression"]),Es=e=>{if(l_(e=ry(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return Es(e.object)&&(!e.computed||(t=ry(t=e.property),Ea.has(t.type)));default:return!1}},El="no-impossible-length-comparison",Eu={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},Ep="no-invalid-character-comparison",Ec=new Set(["==","===","!=","!=="]),Ed=(e,t)=>!!(td(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&nR(e.callee.object,t)||td(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&nR(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(e8(e))return!0;if(!e1(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&nR(e.object,t),Em="no-loop-iterable-mutation",Ef=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],Eg=["add","clear","delete"],Ey=["clear","delete","set"],Eh={array:new Set(Ef),set:new Set(Eg),map:new Set(Ey),unknown:new Set([...Ef,...Eg,...Ey])},Ex=new Set(["entries","keys","values"]),Eb=new Set(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function EE(e,t){return rY(e,t)?"array":r6(e,t)?"set":r9(e,t)?"map":void 0}function ES(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function ED(e){return"Identifier"===(e=ry(e)).type?e:void 0}function Ev(e){if("ArrayPattern"!==(e=ry(e)).type)return;let[t]=e.elements;return t&&ED(t)}function EC(e,t){if(l_(e=ry(e)))return;if(lW(e))return{collectionKind:EE(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eI(e.callee,t.sourceCode.getScope(e.callee));if(!(!Ex.has(r)||l_(e.callee.object))&&lW(e.callee.object))return{collectionKind:EE(e.callee.object,t),reference:e.callee.object,method:r}}function EA(e,t){let r=ES(e);return"keys"===t.method?ED(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?Ev(r):void 0}function ET(e,t){let r,n;if("VariableDeclaration"!==e.left.type||"const"!==e.left.kind)return{collectionKind:t.collectionKind,iterable:t.reference,loopBody:e.body};let o=(r=ES(e),"entries"===t.method?Ev(r):"direct"!==t.method||"map"!==t.collectionKind?ED(r):void 0),a=EA(e,t),i=(n=ES(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?ED(n):"direct"===t.method&&"map"!==t.collectionKind?ED(n)??Ev(n):EA(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*Ew(e){"Identifier"===(e=ry(e)).type?yield e:"MemberExpression"===e.type&&(yield*Ew(e.object),e.computed&&(yield*Ew(e.property)))}function Ek(e,t,r){if(!lq(e,t))return!1;let n=[...Ew(e)],o=[...Ew(t)];return n.length!==o.length||0===n.length?n.length===o.length:n.every((e,t)=>{var n;let a,i;return n=o[t],a=ei(r.sourceCode.getScope(e),e),i=ei(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function EI(e,t,r){let[n]=e.arguments;return!!(t&&n&&Ek(n,t,r))}function Ej(e,t,r,n){return"add"===r&&EI(e,t.addArgumentIdentifier,n)||"set"===r&&EI(e,t.setKeyIdentifier,n)}let EF="no-selector-as-dom-name",EB=["add","remove","contains","toggle","replace"],ER=/^[#.]-?[A-Z_a-z][\w-]*$/u,EP=new Set([".","#"]),EL=e=>EP.has(e?.[0]),E$=e=>e3(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),EN=(e,t,r,n)=>({node:e,messageId:EF,fix:((e,t,r,n)=>{let o=((e,t)=>{let[r]=t.getRange(e);return[r+1,r+2]})(e,n);if(t.startsWith(r)&&n.text[o[0]]===r){if("TemplateLiteral"===e.type&&e.expressions.length>0){if(1!==e.expressions.length||e.quasis[0].value.cooked!==r||""!==e.quasis[1].value.cooked)return;return e=>e.removeRange(o)}if(ER.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),EM=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),EO="no-useless-compound-assignment/error",EU="no-useless-compound-assignment/remove",Eq="no-useless-compound-assignment/replace",EW=new Map([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),E_="no-useless-delete-check",EV="removeCheck",Ez={considerGetters:!0},EK=new Set(["Map","Set","WeakMap","WeakSet"]),EG=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),EJ=new Set(["ClassName","FunctionName"]),EX=new Set(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),EH=e=>null!==e&&("object"==typeof e||"function"==typeof e),EY=e=>!!EX.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>EY(e)),EQ=(e,t)=>{if("Identifier"!==e.type)return!1;let r=ei(t.sourceCode.getScope(e),e);return r?.defs.some(e=>EJ.has(e.type))??!1},EZ=(e,t)=>{let r=ew(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!EH(r.value)?String(r.value):void 0},E0=(e,t)=>{let r=ew(e,t.sourceCode.getScope(e));if(r)return EH(r.value);let n=ra(ry(e),t);if(n){let e=ry(n),r=ew(e,t.sourceCode.getScope(e));if(r)return EH(r.value);if(EG.has(e.type))return!0}return!EQ(ry(e),t)&&EY(((e,t)=>{if("Identifier"!==(e=ry(e)).type)return;let r=ei(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},E1=(e,t)=>!eL(e,t.sourceCode,Ez),E2=(e,t)=>td(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),E3=(e,t,r)=>n=>{if(rt(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),nQ(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},E8="no-useless-logical-operand",E6=new Map([["&&",!0],["||",!1]]),E9=new Map([["&&",!1],["||",!0]]),E5=new Set(["FunctionExpression","ClassExpression","ObjectExpression"]),E4="prefer-boolean-return",E7=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function Se(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return Se(t[0])}return e}}let St=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function Sr(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return E7.has(e.operator);case"LogicalExpression":return Sr(e.left,t)&&Sr(e.right,t);case"CallExpression":return tA(e,t)||"CallExpression"===e.type&&!e.optional&&"MemberExpression"===e.callee.type&&!e.callee.optional&&!e.callee.computed&&"Identifier"===e.callee.object.type&&"Array"===e.callee.object.name&&t.sourceCode.isGlobalReference(e.callee.object)&&"Identifier"===e.callee.property.type&&"isArray"===e.callee.property.name;default:return!1}}let Sn="prefer-flat-math-min-max",So=["min","max"],Sa=(e,t)=>td(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),Si=(e,t)=>{let r=[];for(let n of e.arguments){if(Sa(n,t)){r.push(...Si(n,t));continue}r.push(n)}return r},Ss="prefer-hoisting-branch-code/start",Sl="prefer-hoisting-branch-code/end",Su="prefer-hoisting-branch-code/suggestion",Sp=new Set(["await using","using"]),Sc=(e,t)=>eL(e,t)||function e(t,r){if("TaggedTemplateExpression"===t.type)return!0;for(let n of r.visitorKeys[t.type]??[]){let o=t[n];if(Array.isArray(o)){for(let t of o)if(t&&e(t,r))return!0;continue}if(o&&e(o,r))return!0}return!1}(e,t),Sd=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},Sm=(e,t,r)=>{let n=Sd(e,r),o=Sd(t,r);return 0!==n.length&&n.length===o.length&&n.every((e,t)=>e.type===o[t].type&&e.value===o[t].value)};function Sf(e,{leading:t,trailing:r,isStart:n},o){let{sourceCode:a}=o,{body:i}=e;if(n){let[e]=a.getRange(i[0]),[r]=a.getRange(i[t]);return[e,r]}let[,s]=a.getRange(i[i.length-r-1]),[,l]=a.getRange(i.at(-1));return[s,l]}function Sg({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){var i;let{sourceCode:s}=a,l=t[0].body,u=o?l.slice(0,r):l.slice(l.length-n),p=u.every(e=>!ro(e))&&function(e){let{parent:t}=e;return["Program","BlockStatement","StaticBlock","SwitchCase"].includes(t.type)}(e)&&!((i={leading:r,trailing:n,isStart:o}).isStart&&((e,t)=>{let{sourceCode:r}=t,[n]=r.getRange(e),o=r.getTokenBefore(e);return rt(t,[o?r.getRange(o)[1]:0,n])})(e,a)||!i.isStart&&((e,t)=>{let{sourceCode:r}=t,n=r.getCommentsAfter(e)[0];return!!(n&&r.getLoc(n).start.line===r.getLoc(e).end.line)})(e,a)||t.some(e=>{let{sourceCode:t}=a,[r]=t.getRange(e),[n]=t.getRange(e.body[0]);if(i.isStart&&rt(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(rt(a,[r,n-1]))return!0}return rt(a,Sf(e,i,a))}))&&(o||t.every(e=>!function(e,t,r){let{sourceCode:n}=r,{body:o}=e,[a]=n.getRange(o[o.length-t]),[i,s]=n.getRange(e);for(let t of n.getScope(e).variables){let[e]=t.defs;if(!e||e.parent?.type==="VariableDeclaration"&&"var"===e.parent.kind)continue;let[r]=n.getRange(e.name);if(!(r<=i)&&!(r>=a)){if(e.parent?.type==="VariableDeclaration"&&Sp.has(e.parent.kind))return!0;for(let e of t.references){let[t]=n.getRange(e.identifier);if(t>=a&&t<=s)return!0}}}return!1}(e,n,a))),c={loc:{start:s.getLoc(u[0]).start,end:s.getLoc(u.at(-1)).end},messageId:o?Ss:Sl};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=t6(e,a),l=o?r:n,u=t[0].body,p=o?u.slice(0,l):u.slice(u.length-l),c=function(e,t,r){let{sourceCode:n}=r,[o]=n.getRange(e[0]),[,a]=n.getRange(e.at(-1)),i=n.text.slice(o,a),s=t6(e[0],r);return s===t?i:i.split("\n").map((e,r)=>0===r?e:e.startsWith(s)?`${t}${e.slice(s.length)}`:e).join("\n")}(p,s,a);return function*(l){if(o){let t=i.getTokenBefore(e),r=t&&nQ(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
21
+ ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&nQ(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
22
+ ${s}${c}${n}`)}for(let e of t)yield l.removeRange(Sf(e,{leading:r,trailing:n,isStart:o},a))}}({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a);!o||function(e,t){for(let r=e;r?.type==="IfStatement";r=r.alternate)if(Sc(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!Sc(e,s))?c.fix=i:c.suggest=[{messageId:Su,fix:i}]}return c}let{parse:Sy}=iN,Sh="prefer-single-replace",Sx=new Set(["g","m","s"]),Sb=new Map([["\\",String.raw`\\`],["]",String.raw`\]`],["\n",String.raw`\n`],["\r",String.raw`\r`],[" ",String.raw`\t`],["\f",String.raw`\f`],["\v",String.raw`\v`],["\u2028",String.raw`\u2028`],["\u2029",String.raw`\u2029`]]);function SE(e){if(!td(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(e1(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(e6(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!Sx.has(e))return;try{r=Sy(e,t,{namedGroups:!0,lookbehind:!0})}catch{return}return function e(t){return"value"===t.type?String.fromCodePoint(t.codePoint):("alternative"!==t.type||1!==t.body.length)&&("characterClass"!==t.type||t.negative||1!==t.body.length)?void 0:e(t.body[0])}(r)}}(t.regex)}let SS="consistent-tuple-labels",SD="no-invalid-well-known-symbol-methods/async-dispose",Sv="no-invalid-well-known-symbol-methods/dispose-generator",SC="no-invalid-well-known-symbol-methods/sync-iterator",SA="no-invalid-well-known-symbol-methods/async-iterator",ST="no-invalid-well-known-symbol-methods/suggestion",Sw=new Set(["Promise","PromiseLike"]),Sk=new Set(["dispose","iterator","asyncIterator"]);function SI(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&Sw.has(e.typeName.name)}function Sj(e,t){let r,n=function(e){if(e.computed&&"MemberExpression"===e.key.type&&!e.key.computed&&"Identifier"===e.key.object.type&&"Symbol"===e.key.object.name&&"Identifier"===e.key.property.type)return e.key.property.name}(e);if(!Sk.has(n))return;let o=function(e){if("get"!==e.kind&&"set"!==e.kind&&("MethodDefinition"===e.type||"PropertyDefinition"===e.type||"Property"===e.type))return e.value}(e);if(o?.type!=="FunctionExpression"&&o?.type!=="ArrowFunctionExpression")return;if("dispose"===n&&o.generator)return{node:e.key,messageId:Sv};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?SI(r):"TSUnionType"===r.type&&r.types.some(e=>SI(e)))||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.program.getTypeChecker(),n=r.esTreeNodeToTSNodeMap.get(e),o=t.getSignatureFromDeclaration(n);if(o)return!0===nq(t.getReturnTypeOfSignature(o),t);return r.getTypeAtLocation(e).getCallSignatures().some(e=>!0===nq(t.getReturnTypeOfSignature(e),t))}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a))return{node:e.key,messageId:SD,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:SC};return o.generator&&(t.suggest=[{messageId:ST,data:{replacement:"asyncIterator"},fix:t=>t.replaceText(e.key.property,"asyncIterator")}]),t}if("asyncIterator"===n&&!o.generator&&(o.async||a))return{node:e.key,messageId:SA}}let SF="after-suspension",SB="in-generator",SR="in-nested-function",SP=["preventDefault","stopImmediatePropagation","stopPropagation"],SL="prefer-abort-signal-timeout",S$="prefer-abort-signal-timeout/suggestion",SN=0x80000000-1,SM=new Set(["reason","throwIfAborted"]),SO=(e,t)=>{let r,{parent:n}=e;if(!(!tc(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nr(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tc(n.parent)&&n.parent.object===n&&(r=n.parent,SM.has(eI(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rg(r);)t=r,r=r.parent;return{expression:t,parent:r}})(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(n)||rt(t,t.sourceCode.getRange(n))))return n},SU=(e,t,r,n)=>{let o=ei(n.sourceCode.getScope(r),e);return o&&o!==t},Sq="prefer-aggregate-error",SW=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,S_=new Set(sS);function SV(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return ry(e)}function Sz(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=Sz(e.left);return t?`${t}.${e.right.name}`:void 0}}function SK(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?SK(e.typeAnnotation):e}function SG(e,t,r,n=new Set){switch(e=SK(e),e?.type){case"TSTypeReference":{let o=Sz(e.typeName);if(!o)return!1;let a=n1(o,t);if(S_.has(o)&&!((a?.defs.length??0)>0))return!0;if(n.has(o))return!1;n.add(o);let[i]=a?.defs??[],s=i?r.sourceCode.getScope(i.name):t,l=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&SG(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>SG(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>SG(e,t,r,n));default:return!1}}function SJ(e,t){let r;if(tc(e=SV(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,SW.test(r))&&rY(e.object,t)&&function(e,t){let r=n1(e.name,t.sourceCode.getScope(e)),[n]=r?.defs??[],o=n?t.sourceCode.getScope(n.name):t.sourceCode.getScope(e);return function e(t,r,n,o=new Set){switch(t=SK(t),t?.type){case"TSArrayType":return SG(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>SG("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=Sz(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return SG(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=n1(a,r),[l]=s?.defs??[],u=l?n.sourceCode.getScope(l.name):r,p=l?.type==="Type"&&"TSTypeAliasDeclaration"===l.node.type&&e(l.node.typeAnnotation,u,n,o);return o.delete(a),p}(t,r,n,o);case"TSUnionType":return t.types.every(t=>e(t,r,n,o));case"TSIntersectionType":return t.types.some(t=>e(t,r,n,o));default:return!1}}(n?.name?.typeAnnotation,o,t)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return function e(t,r,n,o=new Set){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(!(r.isArrayType(t)||r.isTupleType(t)))return!1;let i=r.getTypeArguments(t);return i.length>0&&i.every(e=>(function e(t,r,n,o=new Set){if(!t||o.has(t))return!1;if(o.add(t),t.isUnion())return t.types.every(t=>e(t,r,n,o));if(t.isIntersection())return t.types.some(t=>e(t,r,n,o));let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);let i=rv(t);return!!(S_.has(i?.getName())&&rC(i,n))||rA(t,r).some(t=>e(t,r,n,o))})(e,r,n))}(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}}(e,t)}(e.object,t))return e.object}let SX=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&e0(SV(t),0))return!0;let o=(n=SV(n=t),n?.type==="Literal"&&"number"==typeof n.value?n.value:void 0);return void 0!==o&&(r?">"===e&&o>=0||">="===e&&o>=1:"<"===e&&o>=0||"<="===e&&o>=1)},SH=e=>"LogicalExpression"!==(e=SV(e)).type||"&&"!==e.operator?[e]:[...SH(e.left),...SH(e.right)],SY={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},SQ=new Set(Object.keys(SY)),SZ=new Set(["globalThis","self","window"]),S0=new Set(["getBoundingClientRect","getClientRects"]),S1=new Set(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),S2=new Set(["innerHeight","innerWidth"]),S3=new Set(["height","width"]),S8=new Set(["Window"]),S6=new Set(["VisualViewport"]),S9=new Set(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),S5=(e,t,r)=>{let n;if(rS.has(e.intrinsicName))return!1;if(rD.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>S5(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return S5(o,t,r);let a=rv(e);return!(!a||rA(e,t).some(e=>!S5(e,t,r)))&&(!rC(a,r)||(n=a.getName(),!(S9.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},S4=(e,t,r,n)=>{if(rS.has(e.intrinsicName)||rD.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!rD.has(e.intrinsicName));return o.length>0&&o.every(e=>S4(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>S4(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return S4(o,t,r,n);let a=rv(e);return!!(a&&rC(a,r)&&n.has(a.getName()))||rA(e,t).some(e=>S4(e,t,r,n))},S7=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return S4(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},De=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return S5(r.getTypeAtLocation(e),n,t)}catch{return!1}},Dt=e=>e.computed||"Identifier"!==e.property.type?e3(ry(e.property)):e.property.name,Dr=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?e3(ry(e.key)):e.key.name})(e))),Dn=(e,t)=>"Identifier"===e.type&&SZ.has(e.name)&&n_(e,t),Do=e=>nr(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),Da=(e,t)=>"Identifier"===(e=ry(e)).type?"visualViewport"===e.name&&n_(e,t):"MemberExpression"===e.type&&"visualViewport"===Dt(e)&&Dn(ry(e.object),t),Di=(e,t)=>{var r;return Dn(e=ry(e),t)||("Identifier"===(r=ry(r=e)).type?"document"===r.name&&n_(r,t):"MemberExpression"===r.type&&"document"===Dt(r)&&Dn(ry(r.object),t))||Da(e,t)},Ds=(e,t,r)=>{let n=ry(t);return Dr(e,S2)&&(Dn(n,r)||S7(t,r,S8))||Dr(e,S3)&&(Da(n,r)||S7(t,r,S6))||Dr(e,S1)&&!Di(n,r)&&!De(t,r)},Dl=(e,t,r=e)=>{let n,o;if(!e||e!==r&&tl(e))return!1;if(e7(e)&&"MemberExpression"===e.callee.type&&S0.has(Dt(e.callee))&&!Di(e.callee.object,t)&&!De(e.callee.object,t)||tf(e)&&S2.has(e.name)&&!Do(e)&&n_(e,t)||"MemberExpression"===e.type&&!Do(e)&&(n=Dt(e),o=ry(e.object),S2.has(n)&&(Dn(o,t)||S7(e.object,t,S8))||S3.has(n)&&(Da(o,t)||S7(e.object,t,S6))||S1.has(Dt(e))&&!Di(e.object,t)&&!De(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?Ds(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&Ds(e.left,e.right,t)))return!0;for(let n of t.sourceCode.visitorKeys[e.type]??[]){let o=e[n];if(Array.isArray(o)){if(o.some(e=>Dl(e,t,r)))return!0;continue}if(Dl(o,t,r))return!0}return!1},Du="prefer-set-methods/union",Dp="prefer-set-methods/intersection",Dc="prefer-set-methods/intersection-suggestion",Dd="prefer-set-methods/difference",Dm="prefer-set-methods/difference-suggestion",Df=(e,t)=>te(e,{name:"Set",argumentsLength:1})&&n_(e.callee,t),Dg=(e,t)=>{let r=eQ(e,t);return og(e,t)&&!eZ(e,t)?`(${r})`:r},Dy=(e,t,r)=>((e,t)=>{let r=e;for(;r.parent;){if("ExpressionStatement"===r.parent.type)return t.sourceCode.getRange(t.sourceCode.getFirstToken(r.parent.expression))[0]===t.sourceCode.getRange(t.sourceCode.getFirstToken(e))[0];r=r.parent}return!1})(e,r)&&nQ(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,Dh=(e,t)=>("ParenthesizedExpression"===e.type||rg(e))&&e.expression===t,Dx=e=>{for(;e.parent;){let{parent:t}=e;if(Dh(t,e)){e=t;continue}break}return e},Db=(e,t)=>e?.type==="SpreadElement"&&"Set"===on(e.argument,t),DE=(e,t,r)=>{if(!(!td(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!t0(e.arguments[0],t)||t0(e.callee.object,t))&&"Set"===on(e.callee.object,r))return e.callee.object},DS=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=Dx(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rg(e.parent))return;let o=((e,t)=>{if(!td(e,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let r=((e,t)=>{if("ArrayExpression"===e.type&&1===e.elements.length&&Db(e.elements[0],t))return e.elements[0].argument})(e.callee.object,t);if(!r)return;let[n]=e.arguments;if("ArrowFunctionExpression"!==n.type||n.async||1!==n.params.length||"Identifier"!==n.params[0].type)return;let o=((e,t,r)=>{let n=DE(e,t,r);if(n)return{method:"intersection",messageId:Dp,suggestionMessageId:Dc,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=DE(e.argument,t,r);if(o)return{method:"difference",messageId:Dd,suggestionMessageId:Dm,otherSet:o}})(n.body,n.params[0],t);if(!(!o||eL(o.otherSet,t.sourceCode,{considerGetters:!0})))return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${Dg(r,t)}.${o.method}(${eQ(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,Dy(t,o.replacement,r))}]}},DD="prefer-toggle-attribute/error",Dv="prefer-toggle-attribute/suggestion",DC=(e,t,r)=>{let n=eQ(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?DC(e.argument,t,!1):(!eZ(e,t.sourceCode)&&oh(e,"!")&&(n=`(${n})`),`!${n}`):eZ(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},DA=(e,t,r)=>td(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function DT(e){if(e?.type==="ChainExpression"&&(e=e.expression),DA(e,["removeAttribute","hasAttribute"],1)||DA(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(e3(r)?.toLowerCase().startsWith("data-"))return;let o=t.property.name;return{node:e,method:o,receiver:t.object,attributeName:r,attributeValue:n,isOptional:!!t.optional,hasEmptyAttributeValue:"setAttribute"!==o||e0(n,"")}}}function Dw(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),DT(e)}}let Dk=(e,t)=>e.isOptional===t.isOptional&&t0(e.receiver,t.receiver)&&t0(e.attributeName,t.attributeName),DI=(e,t)=>nL(e.receiver)||ne(e.receiver,t),Dj="prefer-url-search-parameters/error",DF="prefer-url-search-parameters/suggestion",DB=new Set(["node:url","url"]),DR=e=>"Type"===e.type||"ImportBinding"===e.type&&nZ(e.node),DP=(e,t,r)=>{let n=ei(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>DR(e))},DL=(e,t)=>e3(ry(e))===t,D$=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},DN=(e,t)=>{if(!td(e=ry(e),{method:"map",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let r=((e,t)=>{var r;let n;if(td(e=ry(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&!(!DL(e.arguments[0],"&")||nB(e.callee.object,t)||(n=ew(r=e.callee.object,t.sourceCode.getScope(r)))&&"string"!=typeof n.value))return e})(e.callee.object,t);if(!r)return;let[n]=e.arguments,o="ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||n.async||n.generator||1!==n.params.length||"Identifier"!==n.params[0].type?void 0:"BlockStatement"!==n.body.type?{parameter:n.params[0],returnExpression:n.body}:1===n.body.body.length&&"ReturnStatement"===n.body.body[0].type&&n.body.body[0].argument?{parameter:n.params[0],returnExpression:n.body.body[0].argument}:void 0;if(o&&((e,t,r)=>{let n;return!!td(e=ry(e),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&!!nW(ry(e.callee.object),t)&&!!DL(e.arguments[0],"=")&&(1===e.arguments.length||2===(n=e.arguments[1],ew(n,r.sourceCode.getScope(n))?.value))})(o.returnExpression,o.parameter,t))return{node:e,query:r.callee.object}},DM=(e,t)=>`new URLSearchParams(${D$(e,t)})`,DO=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=eY(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},DU=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=eY(t,r);return[[n,a],[i,o]]},Dq=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=ei(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>DR(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return DB.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||t7(n,e,r)))return[{messageId:DF,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:Dj,suggest:a}},DW={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return DW}},rules:{"sukka/unicorn/prefer-node-protocol":"error","sukka/unicorn/prefer-import-meta-properties":"error","no-process-exit":"off","sukka/unicorn/no-process-exit":"warn","no-buffer-constructor":"off","sukka/unicorn/no-new-buffer":"error"}},comment:{name:"@eslint-sukka/eslint-plugin-sukka-full comments preset",plugins:{get sukka(){return DW}},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"]}},recommended:{...u.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return DW}},rules:{...u.eslint_plugin_sukka.configs.recommended.rules,"sukka/prefer-single-boolean-return":"off","sukka/array/no-unneeded-flat-map":"error","sukka/browser/prefer-location-assign":"warn","sukka/jsx/no-template-literal":"error","sukka/jsx/no-unneeded-nested":"error","sukka/string/no-locale-case":"warn","sukka/string/no-simple-template-literal":"error","sukka/unicode/no-bidi":"warn","sukka/unicode/no-invisible":"warn","sukka/no-redundant-variable":"error","sukka/no-single-return":"warn","sukka/prefer-early-return":["error",{maximumStatements:16}],"sukka/prefer-fetch":"error","sukka/prefer-timer-id":"warn"}},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return DW}},rules:{"sukka/unicorn/no-lonely-if":"error","sukka/unicorn/no-negated-condition":"warn","sukka/unicorn/catch-error-name":["error",{ignore:[/^(?:e|err|error|\w+Err|\w+Error)[\d_]?$/]}],"sukka/unicorn/custom-error-definition":"error","sukka/unicorn/require-array-join-separator":"warn","sukka/unicorn/no-thenable":"error","sukka/unicorn/no-invalid-remove-event-listener":"error","sukka/unicorn/consistent-function-scoping":"warn","sukka/unicorn/prefer-event-target":"warn","sukka/unicorn/prefer-keyboard-event-key":"warn","sukka/unicorn/prefer-text-content":"warn","sukka/unicorn/no-console-spaces":"warn","sukka/unicorn/no-empty-file":"warn","sukka/unicorn/no-useless-fallback-in-spread":"warn","sukka/unicorn/no-useless-length-check":"warn","sukka/unicorn/no-useless-promise-resolve-reject":"warn","sukka/unicorn/no-zero-fractions":"warn","sukka/unicorn/prefer-export-from":["warn",{checkUsedVariables:!1}],"sukka/unicorn/prefer-native-coercion-functions":"warn","sukka/unicorn/prefer-negative-index":"warn","sukka/unicorn/no-document-cookie":"error","sukka/unicorn/prefer-add-event-listener":"warn","sukka/unicorn/prefer-array-index-of":"warn","sukka/unicorn/prefer-blob-reading-methods":"warn","sukka/unicorn/prefer-date-now":"warn","sukka/unicorn/dom-node-dataset":"warn","sukka/unicorn/prefer-modern-math-apis":"warn","sukka/unicorn/number-literal-case":"error","sukka/unicorn/prefer-number-properties":["warn",{checkInfinity:!1}],"sukka/unicorn/prefer-reflect-apply":"warn","sukka/unicorn/prefer-set-size":"warn","sukka/unicorn/prefer-string-replace-all":"warn","sukka/unicorn/prefer-string-slice":"warn","sukka/unicorn/prefer-string-trim-start-end":"warn","sukka/unicorn/no-unreadable-iife":"warn","sukka/unicorn/throw-new-error":"warn","sukka/unicorn/escape-case":"warn","sukka/unicorn/prefer-unicode-code-point-escapes":"warn","sukka/unicorn/prefer-prototype-methods":"warn","sukka/unicorn/error-message":"error","sukka/unicorn/no-instanceof-builtins":["error",{strategy:"loose"}],"sukka/unicorn/prefer-type-error":"error","sukka/unicorn/consistent-destructuring":"warn","sukka/unicorn/new-for-builtins":"warn","sukka/unicorn/prefer-single-call":"warn","sukka/unicorn/no-static-only-class":"warn","sukka/unicorn/no-unreadable-array-destructuring":"error","sukka/unicorn/no-useless-spread":"error","sukka/unicorn/no-useless-switch-case":"warn","sukka/unicorn/no-useless-undefined":["error",{checkArguments:!1}],"sukka/unicorn/numeric-separators-style":["warn",{onlyIfContainsSeparator:!1,number:{minimumDigits:7,groupLength:3},binary:{minimumDigits:9,groupLength:4},octal:{minimumDigits:9,groupLength:4},hexadecimal:{minimumDigits:5,groupLength:2}}],"sukka/unicorn/prefer-array-find":"warn","sukka/unicorn/prefer-array-flat-map":"warn","sukka/unicorn/prefer-array-flat":"warn","sukka/unicorn/prefer-array-some":"warn","sukka/unicorn/prefer-code-point":"warn","sukka/unicorn/prefer-default-parameters":"warn","sukka/unicorn/prefer-logical-operator-over-ternary":"warn","sukka/unicorn/prefer-optional-catch-binding":"error","sukka/unicorn/prefer-regexp-test":"warn","sukka/unicorn/prefer-set-has":"error","sukka/unicorn/prefer-switch":"warn","sukka/unicorn/require-number-to-fixed-digits-argument":"warn","sukka/unicorn/prefer-string-raw":"warn","sukka/unicorn/no-single-promise-in-promise-methods":"error","sukka/unicorn/no-await-in-promise-methods":"error","sukka/unicorn/no-magic-array-flat-depth":"error","sukka/unicorn/no-object-as-default-parameter":"error","sukka/unicorn/template-indent":["warn",{tags:["outdent","dedent","gql","sql","html","styled","css"],functions:["dedent","stripIndent","strip_indent","stripTags","striptags","strip_tags","stripHtml","stripHTML","strip_html"],selectors:[],comments:["HTML","html","CSS","css","indent"]}],"sukka/unicorn/no-negation-in-equality-check":"error","sukka/unicorn/no-unnecessary-slice-end":"error","sukka/unicorn/consistent-date-clone":"error","sukka/unicorn/no-accessor-recursion":"error","sukka/unicorn/no-unnecessary-array-flat-depth":"error","sukka/unicorn/no-unnecessary-array-splice-count":"error","sukka/unicorn/no-useless-error-capture-stack-trace":"error","sukka/unicorn/prefer-class-fields":"error","sukka/unicorn/prefer-bigint-literals":"error","sukka/unicorn/prefer-classlist-toggle":"warn","sukka/unicorn/require-module-attributes":"error","sukka/unicorn/no-immediate-mutation":"error","sukka/unicorn/no-useless-collection-argument":"error","sukka/unicorn/prefer-response-static-json":"error","sukka/unicorn/consistent-template-literal-escape":"error","sukka/unicorn/no-useless-iterator-to-array":"error","sukka/unicorn/prefer-simple-condition-first":"error","sukka/unicorn/switch-case-break-position":"error","sukka/unicorn/better-dom-traversing":"warn","sukka/unicorn/no-blob-to-file":"error","sukka/unicorn/no-canvas-to-image":"warn","sukka/unicorn/no-confusing-array-splice":"error","sukka/unicorn/no-duplicate-set-values":"error","sukka/unicorn/no-incorrect-query-selector":"error","sukka/unicorn/no-invalid-file-input-accept":"error","sukka/unicorn/no-late-current-target-access":"error","sukka/unicorn/no-unused-array-method-return":"error","sukka/unicorn/prefer-array-last-methods":"warn","sukka/unicorn/prefer-math-abs":"warn","sukka/unicorn/prefer-split-limit":"warn","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"error","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":"warn","sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"warn","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"warn","sukka/unicorn/no-optional-chaining-on-undeclared-variable":"error","sukka/unicorn/no-object-methods-with-collections":"error","sukka/unicorn/no-subtraction-comparison":"warn","sukka/unicorn/no-unnecessary-global-this":"warn","sukka/unicorn/no-useless-else":"error","sukka/unicorn/no-useless-recursion":"error","sukka/unicorn/prefer-add-event-listener-options":"warn","sukka/unicorn/prefer-direct-iteration":"warn","sukka/unicorn/prefer-number-is-safe-integer":"warn","sukka/unicorn/prefer-object-define-properties":"warn","sukka/unicorn/prefer-object-destructuring-defaults":"warn","sukka/unicorn/prefer-single-object-destructuring":"warn","sukka/unicorn/prefer-smaller-scope":"warn","sukka/unicorn/prefer-single-array-predicate":"warn","sukka/unicorn/prefer-url-href":"warn","sukka/unicorn/require-proxy-trap-boolean-return":"error","sukka/unicorn/logical-assignment-operators":"error","sukka/unicorn/no-useless-coercion":"error","sukka/unicorn/no-useless-boolean-cast":"warn","sukka/unicorn/no-useless-continue":"error","sukka/unicorn/no-useless-override":"error","sukka/unicorn/prefer-has-check":"warn","sukka/unicorn/consistent-conditional-object-spread":"error","sukka/unicorn/no-boolean-sort-comparator":"error","sukka/unicorn/no-chained-comparison":"error","sukka/unicorn/no-constant-zero-expression":"error","sukka/unicorn/no-duplicate-logical-operands":"error","sukka/unicorn/no-impossible-length-comparison":"error","sukka/unicorn/no-invalid-character-comparison":"error","sukka/unicorn/no-loop-iterable-mutation":"error","sukka/unicorn/no-selector-as-dom-name":"error","sukka/unicorn/no-array-concat-in-loop":"error","sukka/unicorn/no-array-front-mutation":"warn","sukka/unicorn/no-array-sort-for-min-max":"warn","sukka/unicorn/no-useless-compound-assignment":"warn","sukka/unicorn/no-useless-delete-check":"warn","sukka/unicorn/no-useless-logical-operand":"error","sukka/unicorn/prefer-boolean-return":"warn","sukka/unicorn/prefer-flat-math-min-max":"warn","sukka/unicorn/prefer-hoisting-branch-code":"warn","sukka/unicorn/prefer-single-replace":"warn","sukka/unicorn/no-invalid-well-known-symbol-methods":"error","sukka/unicorn/no-late-event-control":"error","sukka/unicorn/prefer-abort-signal-timeout":"warn","sukka/unicorn/prefer-aggregate-error":"warn","sukka/unicorn/prefer-observer-apis":"warn","sukka/unicorn/prefer-set-methods":"warn","sukka/unicorn/prefer-toggle-attribute":"warn","sukka/unicorn/prefer-url-search-parameters":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return DW}},rules:{"sukka/unicorn/no-nested-ternary":"warn","sukka/unicorn/filename-case":["error",{cases:{kebabCase:!0,snakeCase:!0},ignore:[/fixtures/i,/^_/,/^\./,/rc$/i,/\.(md|json|yaml|toml|yml|ini|conf|jsonc|json5)$/i]}],"sukka/unicorn/no-unnecessary-nested-ternary":"error","sukka/unicorn/no-unreadable-object-destructuring":"error","sukka/unicorn/consistent-compound-words":"warn","sukka/unicorn/default-export-style":"warn"}},recommended_extra_with_typed_lint:{...u.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return DW}},rules:{...u.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint.rules,"sukka/string/no-unneeded-to-string":"error","sukka/type/no-force-cast-via-top-type":"error","sukka/type/no-wrapper-type-reference":"error","sukka/no-default-error":"off","sukka/unicorn/consistent-tuple-labels":"warn"}},recommended_react:{...u.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return DW}}}},rules:Object.assign(u.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":A,"browser/prefer-location-assign":w,"jsx/no-template-literal":I,"jsx/no-unneeded-nested":j,"string/no-locale-case":B,"string/no-simple-template-literal":R,"unicode/no-bidi":U,"unicode/no-invisible":W,"no-redundant-variable":_,"no-single-return":z,"prefer-early-return":G,"prefer-fetch":J,"prefer-timer-id":Y,"string/no-unneeded-to-string":Q,"type/no-force-cast-via-top-type":Z,"type/no-wrapper-type-reference":et,"no-default-error":er},Object.fromEntries(Object.entries({"unicorn/catch-error-name":ca,"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>cw(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return cw(e,t.right)}),e.on("AssignmentExpression",e=>{if("MemberExpression"===e.left.type&&"Identifier"===e.left.object.type&&"exports"===e.left.object.name){let t=e.right;if("ClassExpression"!==t.type||!cg(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:ci,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[ci]:"Exported error name should match error class",[cs]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[cl]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[cu]:"Error constructors should accept `options` as the second parameter.",[cp]:"Error constructors should use `options` as the second parameter.",[cc]:"Pass the error message to `super()` as the first argument.",[cd]:"Pass `options` to `super()` as the second argument."},languages:["js/js"]}},"unicorn/no-nested-ternary":{create:e=>{e.on("ConditionalExpression",t=>{if([t.test,t.consequent,t.alternate].some(e=>"ConditionalExpression"===e.type))return;let{sourceCode:r}=e,n=r.getAncestors(t).toReversed(),o=n.findIndex(e=>"ConditionalExpression"!==e.type);return 1!==o||eZ(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:oI}:void 0:{node:t,messageId:oj,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[oI]:"Do not nest ternary expressions.",[oj]:"Nested ternary expression should be parenthesized."},languages:["js/js"]}},"unicorn/prefer-event-target":{create:e=>{e.on("Identifier",t=>{if("EventEmitter"!==t.name||("ClassDeclaration"!==t.parent.type&&"ClassExpression"!==t.parent.type||t.parent.superClass!==t)&&("NewExpression"!==t.parent.type||t.parent.callee!==t))return;let r=e.sourceCode.getScope(t);if(!function(e){if(!e)return!1;let t=function(e,t){let r=e=>e.type===t;for(;e.parent;e=e.parent)if(r(e))return e}(e,"ImportDeclaration");return!!(oB.has(t?.source.value)||"Property"===e.parent.type&&e.parent.value===e&&"Identifier"===e.parent.key.type&&"EventEmitter"===e.parent.key.name&&"ObjectPattern"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent)&&oR(e.parent.parent)&&oP(e.parent.parent.parent.init))||!!(oR(e)&&tc(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&oP(e.parent.init.object))}(ei(r,t)?.defs[0]?.name))return{node:t,messageId:oF}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[oF]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(oM.has(t.name)){for(let r of o_(e,t))if(r.references?.some(e=>oW(t,e.identifier)))return oV(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&oM.has(t.key.name)&&"Property"===(r=t.key).parent.type&&r.parent.key===r&&"ObjectPattern"===r.parent.parent.type&&!r.parent.computed){for(let r of o_(e,t))if(oK(t.key,r))return oV(t.key,r);for(let r of o_(e,t))if(oz(t.key,r))return oV(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[o$]:"Use `.key` instead of `.{{name}}`.",[oN]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tc(t,{property:"innerText"})||ne(t.object,e))return;let r=t.property;return{node:r,messageId:oG,suggest:[{messageId:oJ,fix:e=>e.replaceText(r,"textContent")}]}}),e.on("Identifier",t=>{if("innerText"===t.name&&"Property"===t.parent.type&&t.parent.key===t&&!t.parent.computed&&"init"===t.parent.kind&&"ObjectPattern"===t.parent.parent.type&&t.parent.parent.properties.includes(t.parent)&&!((e,t)=>{if(ne(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&ne(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&ne(r.right,t)})(t.parent.parent,e))return{node:t,messageId:oG,suggest:[{messageId:oJ,fix:e=>e.replaceText(t,t.parent.shorthand?"textContent: innerText":"textContent")}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.textContent` over `.innerText`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[oG]:"Prefer `.textContent` over `.innerText`.",[oJ]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"join",argumentsLength:0,optionalCall:!1})||td(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tE(t.callee.object,{property:"join"}))||0===t.arguments.length&&r0(t.callee.object,e))return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2),a=1===t.arguments.length;return{loc:{start:r.getLoc(n)[a?"end":"start"],end:r.getLoc(o).end},messageId:ao,fix:r=>oH(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[ao]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of ap)e.on(t??r,function*(t){for(let r of o(t,e))yield{node:r,messageId:n}})},meta:{type:"problem",docs:{description:"Disallow `then` property.",recommended:"unopinionated"},messages:{[aa]:"Do not add `then` to an object.",[ai]:"Do not export `then`.",[as]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||td(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eh(r,e.sourceCode),messageId:ac}:{node:r.callee.property,messageId:ac}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[ac]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":ab,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!te(r,{name:"Buffer"}))return;let n=((e,t)=>{if(1!==e.length)return"from";let[r]=e;if("SpreadElement"===r.type)return;if("ArrayExpression"===r.type||"TemplateLiteral"===r.type)return"from";if(nc(r,t))return"alloc";let n=ew(r,t);if(n){let{value:e}=n;if("string"==typeof e||Array.isArray(e))return"from"}})(r.arguments,t.getScope(r));return n?{node:r,messageId:aE,data:{method:n},fix:av(r,e,n)}:{node:r,messageId:aS,suggest:["from","alloc"].map(t=>({messageId:aD,data:{replacement:t},fix:av(r,e,t)}))}})},meta:{type:"problem",docs:{description:"Enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[aE]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[aS]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[aD]:"Switch to `Buffer.{{replacement}}()`."},languages:["js/js"]}},"unicorn/no-console-spaces":{create:e=>{let{sourceCode:t}=e,r=(r,n,o)=>{let[a,i]=t.getRange(r),s="leading"===o?a+1:i-2,l=[s,s+1];return{loc:oD(l,e),messageId:aC,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!td(e,{object:"console",methods:["log","debug","info","warn","error"],minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let n=e.callee.property.name,{arguments:o}=e,{length:a}=o;for(let[e,i]of o.entries()){if(!e1(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&aA(o)&&(yield r(i,n,"leading")),e!==a-1&&aT(o)&&(yield r(i,n,"trailing"))}})},meta:{type:"suggestion",docs:{description:"Do not use leading/trailing space between `console.log` parameters.",recommended:"unopinionated"},fixable:"code",messages:{[aC]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":ak,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(ta(t)&&"LogicalExpression"===t.parent.type&&t.parent.right===t&&("||"===t.parent.operator||"??"===t.parent.operator)&&"SpreadElement"===t.parent.parent.type&&t.parent.parent.argument===t.parent&&"ObjectExpression"===t.parent.parent.parent.type&&t.parent.parent.parent.properties.includes(t.parent.parent))return{node:t,messageId:aI,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=eZ(i,e),[,l]=s?eY(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield oX(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[aI]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new Set,n=new Set,o=new Set,a=new Set;e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tc(e.left,{property:"length",optional:!1})&&tS(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("CallExpression",t=>{td(t,{optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===t.callee.property.type&&!rQ(t.callee.object,e)&&("some"===t.callee.property.name?o.add(t):"every"===t.callee.property.name&&a.add(t))}),e.on("LogicalExpression",e=>{tS(e)&&t.push(e)}),e.on("Program:exit",function*(){let i=new Set(t.flatMap(e=>(function(e){let{operator:t}=e;return(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(e).filter((e,i,s)=>(function({node:e,operator:t,siblings:i}){return"||"===t&&r.has(e)&&i.some(t=>a.has(t)&&t0(e.left.object,t.callee.object))||"&&"===t&&n.has(e)&&i.some(t=>o.has(t)&&t0(e.left.object,t.callee.object))})({node:e,operator:t,siblings:[s[i-1],s[i+1]].filter(Boolean)}))})(e))),{sourceCode:s}=e;for(let t of i)yield{loc:{start:s.getLoc(t.left.property).start,end:s.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=eY(n,e),i=eY(o,e),s=[];return n===t?(s[0]=a[0],s[1]=i[0]):(s[0]=a[1],s[1]=i[1]),r.removeRange(s)}}})},meta:{type:"suggestion",docs:{description:"Disallow useless array length check.",recommended:"unopinionated"},fixable:"code",messages:{"non-zero":"The non-empty check is useless as `Array#some()` returns `false` for an empty array.",zero:"The empty check is useless as `Array#every()` returns `true` for an empty array."},languages:["js/js"]}},"unicorn/no-useless-promise-resolve-reject":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===t.parent.type&&t.parent.body===t||"ReturnStatement"===t.parent.type&&t.parent.argument===t||"YieldExpression"===t.parent.type&&!t.parent.delegate&&t.parent.argument===t)))return;let{functionNode:r,isInTryStatement:n}=function(e){let t,r=!1;for(;e;e=e.parent){if(tl(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(r&&(r.async||function(e){if("CallExpression"===e.parent.type&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&"Identifier"===e.parent.callee.property.type){let{callee:{property:t},arguments:r}=e.parent;if(1===r.length&&["then","catch","finally"].includes(t.name)&&r[0]===e||2===r.length&&"then"===t.name&&(r[0]===e||"SpreadElement"!==r[0].type&&r[1]===e))return!0}return!1}(r)))return function(e,t){let{callee:r,parent:n}=e,o=r.property.name;return{node:r,messageId:o,data:{type:"YieldExpression"===n.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,parent:o,arguments:a}=e,[i]=a;if(i?.type==="SpreadElement")return;let s="reject"===n.property.name,l="YieldExpression"===o.type;if(!s||!t&&(!l||"ExpressionStatement"===o.parent.type))return function(t){let n="ArrowFunctionExpression"===o.type,a=i?r.sourceCode.getText(i):"";if(i?.type==="SequenceExpression"&&(a=`(${a})`),s){if(a||="undefined",a=`throw ${a}`,l)return t.replaceTextRange(eY(o,r),a);if(a+=";",n)return a=`{ ${a} }`,t.replaceTextRange(eY(e,r),a)}else l?a=`yield${a?" ":""}${a}`:"ReturnStatement"===o.type?a=`return${a?" ":""}${a};`:(i?.type==="ObjectExpression"&&(a=`(${a})`),a||="{}");return t.replaceText(n?e:o,a)}}(t,n,e))})},meta:{type:"suggestion",docs:{description:"Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks",recommended:"unopinionated"},fixable:"code",messages:{resolve:"Prefer `{{type}} value` over `{{type}} Promise.resolve(value)`.",reject:"Prefer `throw error` over `{{type}} Promise.reject(error)`."},languages:["js/js"]}},"unicorn/no-zero-fractions":{create:e=>{e.on("Literal",t=>{if(!e8(t))return;let{raw:r}=t,n=r.match(/^(?<before>[\d_]*)(?<dotAndFractions>\.[\d_]*)(?<after>.*)$/);if(!n)return;let{before:o,dotAndFractions:a,after:i}=n.groups,s=(o+a.replaceAll(/[.0_]+$/g,"")||"0")+i;if(s===r)return;let l="."===a,{sourceCode:u}=e,p=u.getRange(t)[0]+o.length+a.length;return{loc:oD([p-(r.length-s.length),p],e),messageId:l?aF:aj,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&om.test(s)&&!eZ(t,e)&&(n=`(${n})`,nQ(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield o8(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[aj]:"Don't use a zero fraction in the number.",[aF]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":aU,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(ts,t=>{if(t.async||t.generator||t.returnType?.type==="TSTypeAnnotation"&&"TSTypePredicate"===t.returnType.typeAnnotation.type||0===t.params.length||"Identifier"!==t.params[0].type||("MethodDefinition"===t.parent.type&&("constructor"===t.parent.kind||"set"===t.parent.kind)||"Property"===t.parent.type&&"set"===t.parent.kind)&&t.parent.value===t)return;let r=function(e){if(("ArrowFunctionExpression"===e.type&&"Identifier"===e.body.type&&e.body.name===e.params[0].name||"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&e.body.body[0].argument?.type==="Identifier"&&e.body.body[0].argument.name===e.params[0].name)&&"CallExpression"===e.parent.type&&!e.parent.optional&&e.parent.arguments[0]===e&&"MemberExpression"===e.parent.callee.type&&!e.parent.callee.computed&&!e.parent.callee.optional&&"Identifier"===e.parent.callee.property.type&&a_.has(e.parent.callee.property.name))return{replacementFunction:"Boolean",fix:t=>t.replaceText(e,"Boolean")}}(t)||function(e){let t,r=(t=e.params[0].name,"ArrowFunctionExpression"===e.type&&aV(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&aV(e.body.body[0].argument,t)?e.body.body[0].argument:void 0);if(!r)return;let{name:n}=r.callee,o={replacementFunction:n};return"FunctionDeclaration"===e.type||1!==r.arguments.length||(o.fix=t=>{let r=n;return"Property"===e.parent.type&&e.parent.method&&e.parent.value===e?r=`: ${r}`:"MethodDefinition"===e.parent.type&&(r=` = ${r};`),t.replaceText(e,r)}),o}(t);if(!r)return;let{sourceCode:n}=e,{replacementFunction:o,fix:a}=r;return r={node:t,loc:eh(t,n),messageId:aq,data:{functionNameWithKind:ej(t,n),replacementFunction:o}},!a||1!==t.params.length||n.getCommentsInside(t).length>0||(r.fix=a),r})},meta:{type:"suggestion",docs:{description:"Prefer using `String`, `Number`, `BigInt`, `Boolean`, and `Symbol` directly.",recommended:"unopinionated"},fixable:"code",messages:{[aq]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){aX.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[aJ]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":aZ,"unicorn/prefer-array-index-of":a9,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!td(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:a5,data:{method:r,replacement:"readAsArrayBuffer"===r?"arrayBuffer":"text"}}})},meta:{type:"suggestion",docs:{description:"Prefer `Blob#arrayBuffer()` over `FileReader#readAsArrayBuffer(…)` and `Blob#text()` over `FileReader#readAsText(…)`.",recommended:"unopinionated"},messages:{[a5]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(td(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&it(e.callee.object)){let t=e.callee.property;return ir(e,{node:t,messageId:a7,data:{method:t.name}})}if(e7(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1})&&it(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?ir(e,{messageId:ie}):ir(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&it(t.argument))return ir("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&it(e.right))return ir(e.right)}),e.on("BinaryExpression",function*(e){if("-"===e.operator||"*"===e.operator||"/"===e.operator||"%"===e.operator||"**"===e.operator)for(let t of[e.left,e.right])it(t)&&(yield ir(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[a4]:"Prefer `Date.now()` over `new Date()`.",[a7]:"Prefer `Date.now()` over `Date#{{method}}()`.",[ie]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":ig,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!td(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=iD(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&t0(e.left,e.right)||"**"===e.operator&&e0(e.right,2)))))return;let n=1===r.length?"abs":"hypot",o=new Set(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:iy,data:{replacement:`Math.${n}(…)`,description:"Math.sqrt(…)"},*fix(a){let{sourceCode:i}=e;for(let r of(yield a.replaceText(t.callee.property,n),o)){let t=i.getTokenAfter(r.left,e=>"Punctuator"===e.type&&"+"===e.value);yield an(t,",",a,e),yield oX(r,a,e)}for(let t of r)yield a.removeRange([eY(t.left,e)[1],i.getRange(t)[1]])}}}),e.on("BinaryExpression",e=>{t.push(e)}),e.on("Program:exit",function*(){for(let r of t)for(let t of iS){let n=t(r,e);n&&(yield n)}})},meta:{type:"suggestion",docs:{description:"Prefer modern `Math` APIs over legacy patterns.",recommended:"unopinionated"},fixable:"code",messages:{[iy]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":iA,"unicorn/prefer-number-properties":iF,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{optionalCall:!1,optionalMember:!1})||"Literal"===t.callee.object.type||"ArrayExpression"===t.callee.object.type||"ObjectExpression"===t.callee.object.type)return;let{sourceCode:r}=e,n=((e,t)=>{if("apply"===eI(e.callee)&&2===e.arguments.length&&iR(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,iP(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===eI(e.callee)&&"apply"===eI(e.callee.object)&&"prototype"===eI(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&iR(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,iP(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:iB,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[iB]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tc(t,{property:"length",optional:!1}))return;let n="ArrayExpression"===(r=t.object).type&&1===r.elements.length&&r.elements[0]?.type==="SpreadElement"?r.elements[0].argument:td(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&r6(n,e))return{node:t.property,messageId:iL,fix:function(e,t,r){let{sourceCode:n}=e,{object:o,property:a}=t;if(!(n.getCommentsInside(o).length>n.getCommentsInside(r).length))return function*(i){yield i.replaceText(a,"size");let s=n.getText(r);og(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield o8(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[iL]:"Prefer using `Set#size` instead of `Array#length`."},languages:["js/js"]}},"unicorn/prefer-string-replace-all":{create:e=>{e.on("CallExpression",t=>{let r,n,o=((e,t)=>{let r;if(!td(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!td(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(nB(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=e3(o);if("string"==typeof i){if(0===i.length)return;r=tB(i)}else if(!(r=(e=>{if(!e6(e)||e.regex.flags.includes("y"))return;let t=iH(e);if(!t||iZ(t)||0===iQ(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=e3(a);if("string"==typeof s)return`${eQ(n.callee.object,t)}.replaceAll(${r}, ${tB(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:i_,fix:e=>e.replaceText(t,o)};if(!td(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||td(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&e6(r=t.arguments[0])&&r.regex.flags.includes("g")&&!r.regex.flags.includes("y")&&(e=>{if(!e.startsWith("[")||!e.endsWith("]")||e.startsWith("[^"))return;let t=new Set,r=e.slice(1,-1);for(let e=0;e<r.length;e++){let n=r[e],o=!1;if("\\"===n&&(n=r[++e],o=!0,!n)||"-"===n&&!o&&0!==e&&e!==r.length-1||"]"===n&&!o&&0!==e||!iO.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&e1(n=t.arguments[1])&&n.value===iM)return;let{arguments:a,callee:{property:i}}=t;if(nB(t.callee.object,e))return;let[s]=a;if(!((e,t)=>{if(e6(e))return e.regex.flags.includes("g");if(te(e,{name:"RegExp"})&&e.arguments[0]?.type!=="SpreadElement"&&e.arguments[1]?.type==="Literal"&&"string"==typeof e.arguments[1].value)return e.arguments[1].value.includes("g");let r=ew(e,t);if(!r)return!1;let{value:n}=r;return"[object RegExp]"===Object.prototype.toString.call(n)&&n.global})(s,e.sourceCode.getScope(s)))return;let l=i.name,u=function(e){if(!e6(e))return;let t=iH(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(iV.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?iX(t.body):iJ(t);if(n)return"'"+n+"'"}(s);if("replaceAll"===l){if(!u)return;return{node:s,messageId:iW,data:{replacement:u.length<20?u:"a string literal"},fix:e=>e.replaceText(s,u)}}return{node:i,messageId:iq,*fix(e){yield e.insertTextAfter(i,"All"),u&&(yield e.replaceText(s,u))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[iq]:"Prefer `String#replaceAll()` over `String#replace()`.",[iW]:"This pattern can be replaced with {{replacement}}.",[i_]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["substr","substring"]})||nB(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!td(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(i0(t)&&i0(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&e0(e.right,1))return e.left})(t);return i1(r,t)??(i1(t,r)?r:void 0)??(n&&t0(n,r)?t:void 0)})(t)))return{node:t,messageId:r,*fix(n,{abort:o}){if(yield n.replaceText(t.callee.property,"slice"),0!==t.arguments.length){if(t.arguments.length>2||t.arguments.some(e=>"SpreadElement"===e.type))return o();yield("substr"===r?function*({node:e,fixer:t,context:r,abort:n}){let o=e.arguments,[a,i]=o;if(!i)return;let{sourceCode:s}=r,l=ew(a,s.getScope(e)),u=eY(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(e8(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!i3(e.left)||!("Identifier"===t.type||e1(t))||!t0(e.left.object,t)||(o=((e,t)=>{let[r,n]=eY(e,t),o=t.sourceCode.getTokenByRangeStart(r),a=t.sourceCode.getTokenBefore(o);return[t.sourceCode.getRange(a)[1],n]})(e,r),a.getAllComments().some(e=>{let t=a.getRange(e);return t[0]>=o[0]&&t[1]<=o[1]}))))return`-${e.right.raw}`})(i,e.callee.object,r);if(n)return void(yield oQ(t,i,n,r));if(e8(i)||i3(i))return;let o=i2(i);return"number"==typeof o?void(yield oQ(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>e8(e))){let e;return void(yield(e=String(a.value+i.value),oQ(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?i2(o):void 0;if(!a){if(i3(o))return;if(void 0!==i)return void(yield oQ(t,o,String(Math.max(0,i)),r));let e=eY(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=i2(a);if(void 0!==i&&void 0!==s){let e=[Math.max(0,i),Math.max(0,s)];i>s&&e.reverse(),e[0]!==i&&(yield oQ(t,o,String(e[0]),r)),e[1]!==s&&(yield oQ(t,a,String(e[1]),r));return}if(0===i||0===s){let e=eQ(o,r),n=eQ(a,r);yield oQ(t,o,"0",r),yield oQ(t,a,`Math.max(0, ${0===i?n:e})`,r);return}return n()})({node:t,fixer:n,context:e,abort:o})}}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#slice()` over `String#substr()` and `String#substring()`.",recommended:"unopinionated"},fixable:"code",messages:{substr:"Prefer `String#slice()` over `String#substr()`.",substring:"Prefer `String#slice()` over `String#substring()`."},languages:["js/js"]}},"unicorn/prefer-string-trim-start-end":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||nB(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:i8,data:{method:n,replacement:o},fix:e=>e.replaceText(r,o)}})},meta:{type:"suggestion",docs:{description:"Prefer `String#trimStart()` / `String#trimEnd()` over `String#trimLeft()` / `String#trimRight()`.",recommended:"unopinionated"},fixable:"code",messages:{[i8]:"Prefer `String#{{replacement}}()` over `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-unreadable-iife":{create:e=>{e.on("CallExpression",t=>{if("ArrowFunctionExpression"!==t.callee.type||"BlockStatement"===t.callee.body.type||!eZ(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:oD(eY(r,e),e),messageId:i6};return!function(e,t){let{sourceCode:r}=t,[n,o]=eY(e,t),[a,i]=r.getRange(e);return r.getCommentsInside(e.parent).some(e=>{let[t,s]=r.getRange(e);return t>=n&&s<=o&&(t<a||s>i)})}(r,e)&&(n.suggest=[{messageId:i9,fix:t=>t.replaceTextRange(eY(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[i6]:"IIFE with parenthesized arrow function body is considered unreadable.",[i9]:"Use a block statement body."},languages:["js/js"]}},"unicorn/throw-new-error":{create:e=>{e.on("CallExpression",t=>{if("Decorator"===t.parent.type)return;let{callee:r}=t;if(!(t.optional||rh(r))&&("Identifier"===r.type&&i4.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&i4.test(r.property.name))&&!tc(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:i5,fix:r=>o6(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[i5]:"Use `new` when creating an error."},languages:["js/js"]}},"unicorn/escape-case":{create:e=>{let t="lowercase"===e.options[0];e.on("Literal",e=>{if(e1(e))return sn({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(e6(e))return sn({node:e,original:e.raw,regex:sr,lowercase:t})}),e.on("TemplateElement",r=>{if(!tx(r.parent))return sn({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>ar(r,n,e,t)})})},meta:{type:"suggestion",docs:{description:"Require escape sequences to use uppercase or lowercase values.",recommended:"unopinionated"},fixable:"code",schema:[{enum:["uppercase","lowercase"],description:"The case style for escape sequences."}],defaultOptions:["uppercase"],messages:{[i7]:"Use uppercase characters for the value of the escape sequence.",[se]:"Use lowercase characters for the value of the escape sequence."},languages:["js/js"]}},"unicorn/prefer-unicode-code-point-escapes":{create:e=>{e.on("Literal",e=>e1(e)?sx(e,e.raw):e6(e)?function(e){let t,{raw:r}=e,{pattern:n,flags:o}=(t=r.lastIndexOf("/"),{pattern:r.slice(1,t),flags:r.slice(t+1)}),{fixed:a,hasReplacement:i}=sh(n,{isRegex:!0,supportsNestedCharacterClasses:o.includes("v")}),s=o.includes("u")||o.includes("v"),l=function(e){for(let t=0;t<e.length;t++)if(void 0!==function(e,t){var r;if(!e.startsWith(si,t))return;let n=t+si.length;for(;r=e[n],ss.test(r);)n++;if(n===t+si.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+si.length,n),16);if(!(o>1114111))return o}(e,t)&&sc(e,t))return!0;return!1}(n);if(!i&&(s||!l))return;let u=`/${i?a:n}/${sb(o)}`;return s?{node:e,messageId:so,fix:t=>t.replaceText(e,u)}:!function(e,t){try{return new RegExp(e,t),!0}catch{return!1}}(i?a:n,sb(o))?{node:e,messageId:so}:{node:e,messageId:so,suggest:[{messageId:sa,fix:t=>t.replaceText(e,u)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tx(t.parent))return sx(t,t.value.raw,(r,n)=>ar(t,n,e,r))})},meta:{type:"suggestion",docs:{description:"Prefer Unicode code point escapes over legacy escape sequences.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[so]:"Prefer Unicode code point escapes.",[sa]:"Use Unicode code point escapes and add the `u` flag."},languages:["js/js"]}},"unicorn/prefer-prototype-methods":{create:function(e){let{sourceCode:t}=e,r=[];e.on("CallExpression",e=>{r.push(e)}),e.onExit("Program",function*(n){let o=new WeakMap;for(let{node:e,path:r}of new ez(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(sE.map(e=>[e,{[ez.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;td(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:td(e,{methods:["apply","bind","call"],optionalCall:!1,optionalMember:!1})&&(n=e.callee.object);let{isGlobalReference:o,constructorName:a,methodName:i}=function(e,{context:t,globalReferences:r}){if(!e)return;if(r.has(e))return{isGlobalReference:!0,constructorName:"Object",methodName:r.get(e).at(-1)};if(!tc(e,{optional:!1}))return;let n=e.object;if(to(n)||ta(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eI(e,t.sourceCode.getScope(e))}}(n,{context:t,globalReferences:r})??{};if(a)return{node:n,messageId:i?"known-method":"unknown-method",data:{constructorName:a,methodName:i},*fix(r){if(o)return void(yield r.replaceText(n,`${a}.prototype.${i}`));if(tc(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield o8(r,e,t))}}}}(t,{context:e,globalReferences:o})})},meta:{type:"suggestion",docs:{description:"Prefer borrowing methods from the prototype instead of the instance.",recommended:"unopinionated"},fixable:"code",messages:{"known-method":"Prefer using `{{constructorName}}.prototype.{{methodName}}`.","unknown-method":"Prefer using method from `{{constructorName}}.prototype`."},languages:["js/js"]}},"unicorn/error-message":{create:e=>{e.on(["CallExpression","NewExpression"],t=>{if(!(tt(t,{names:sS,optional:!1})&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=sA.has(r)?sA.get(r):0,o=t.arguments;if(o.some((e,t)=>t<=n&&"SpreadElement"===e.type))return;let a=o[n];if(!a)return{node:t,messageId:sD,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:sC};let i=ew(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:sC}:""===s?{node:a,messageId:sv}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[sD]:"Pass a message to the `{{constructorName}}` constructor.",[sv]:"Error message should not be an empty string.",[sC]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":sP,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(te(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&sW(t.test)))return;let r=e.argument.callee;return{node:r,messageId:sL,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[sL]:"`new Error()` is too unspecific for a type check. Use `new TypeError()` instead."},languages:["js/js"]}},"unicorn/consistent-destructuring":{create:e=>{let{sourceCode:t}=e,r=new Map,n=[],o=[],a=e=>{let r=ry(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);o.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?ei(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?sK(r):void 0,start:t.getRange(e)[0],scope:n})},i=e=>{switch(e.type){case"MemberExpression":a(e);break;case"AssignmentPattern":i(e.left);break;case"RestElement":i(e.argument);break;case"ObjectPattern":for(let t of e.properties)i("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&i(t)}};e.on("AssignmentExpression",e=>{i(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&i(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&a(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&a(e.argument)}),e.on("VariableDeclarator",e=>{let n;if(!("ObjectPattern"===e.id.type&&"const"===e.parent.kind&&e.init&&("Identifier"===(n=e.init).type||"ThisExpression"===n.type)))return;let o="Identifier"===e.init.type?e.init:void 0,a={scope:t.getScope(e),object:e.init,rootIdentifierName:o?.name,rootVariable:o&&ei(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?sK(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let s=e=>{let n;if(e.computed||tt(e.parent)&&e.parent.callee===e||"TaggedTemplateExpression"===e.parent.type&&e.parent.tag===e||nr(e))return;let a=ry(e.object),i=r.get(t.getText(a));if(!i)return;let s=t.getScope(e),l="Identifier"===a.type?a:void 0,u=l&&ei(s,l),p="ThisExpression"===a.type?sK(a):void 0,c=t.getText(e.property);for(let r of i.toReversed())if(sX({declaration:r,memberExpressionNode:e,memberScope:s,memberRootIdentifier:l,memberRootVariable:u,memberThisScopeBoundary:p,memberExpressionWrites:o,sourceCode:t})&&(n=sJ(r.objectPattern.properties.filter(e=>sG(e)&&"Identifier"===e.value.type),c,s,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!sQ(n);){if(sY(n,r,e,t))return!0;r=n,n=n.parent}return!1})(e,t))return;if("MemberExpression"===e.parent.type)return{node:e,messageId:s_};let d=t.getText(e),m=n.value.name;return{node:e,messageId:s_,suggest:[{messageId:sV,data:{expression:d,property:m},fix:t=>t.replaceText(e,m)}]}};e.on("MemberExpression",e=>{n.push(e)}),e.onExit("Program",function*(){for(let e of n){let t=s(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[s_]:"Use destructured variables over properties.",[sV]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{s8.listen({context:e}),s6.listen({context:e}),s9.listen({context:e}),s5.listen({context:e})},meta:{type:"suggestion",docs:{description:"Enforce correct use of `new` for builtin constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{enforce:"Use `new {{name}}()` instead of `{{name}}()`.",disallow:"Use `{{name}}()` instead of `new {{name}}()`.",disallowCallOrNew:"`{{name}}` is not a function or constructor.",[s1]:"Use `String(new Date())` instead of `Date()`.",[s2]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":ln,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>td(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tg(e)&&la(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&la(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&td(e,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&n.push(e)}),e.onExit("Program",function*(){if(!r)for(let e of n)yield{node:e,messageId:lo}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[lo]:"Only use `process.exit()` in CLI apps. Throw an error instead."},languages:["js/js"]}},"unicorn/no-static-only-class":{create:function(e){e.on(["ClassDeclaration","ClassExpression"],t=>{if(!(t.superClass||t.decorators&&t.decorators.length>0||"ClassBody"!==t.body.type||0===t.body.body.length||t.body.body.some(e=>!function(e){let{private:t,static:r,declare:n,readonly:o,accessibility:a,decorators:i,key:s}=e;return!(!lg(e)&&"MethodDefinition"!==e.type||!r||t||"PrivateIdentifier"===s.type||n||o||void 0!==a||Array.isArray(i)&&i.length>0)}(e))))return{node:t,loc:function(e,t){let{sourceCode:r}=t,{body:n}=e,o=r.getTokenBefore(n),{start:a}=r.getLoc(e),{end:i}=r.getLoc(o);return{start:a,end:i}}(t,e),messageId:lm,fix:function(e,t){let{type:r,id:n,body:o,declare:a,abstract:i,implements:s,parent:l}=e;if(a||i||Array.isArray(s)&&s.length>0||"ClassExpression"===r&&n)return;let u="ClassDeclaration"===e.type&&"ExportDefaultDeclaration"===e.parent.type&&e.parent.declaration===e;if(u&&n)return;let{sourceCode:p}=t;for(let e of o.body)if(lg(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(tk(a,{expected:{type:"Keyword",value:"class"},ruleId:"no-static-only-class"}),u||"ClassExpression"===r)if("ClassExpression"===r&&"ReturnStatement"===l.type&&p.getLoc(o).start.line!==p.getLoc(l).start.line&&p.text.slice(p.getRange(a)[1],p.getRange(o)[0]).trim()){yield n.replaceText(a,"{");let e=p.getFirstToken(o);yield n.remove(e)}else yield n.replaceText(a,""),yield o1(a,t,n);else yield n.replaceText(a,"const"),yield n.insertTextBefore(o,"= "),yield n.insertTextAfter(o,";");for(let e of o.body)yield function*(e,t,r){let{sourceCode:n}=t,o=n.getFirstToken(e);tk(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield o1(o,t,r);let a=lg(e)?n.getLastToken(e):n.getTokenAfter(e),i=ep(a);if(lg(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,lf);yield r.replaceText(e,":")}else i?yield r.insertTextBefore(a,": undefined"):yield r.insertTextAfter(e,": undefined")}yield i?r.replaceText(a,","):r.insertTextAfter(e,",")}(e,t,n)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow classes that only have static members.",recommended:"unopinionated"},fixable:"code",messages:{[lm]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":lx,"unicorn/no-useless-spread":{create:e=>{let{sourceCode:t}=e;e.on(["ArrayExpression","ObjectExpression"],r=>{if(!("SpreadElement"===r.parent.type&&r.parent.argument===r&&("ObjectExpression"===r.type&&"ObjectExpression"===r.parent.parent.type&&r.parent.parent.properties.includes(r.parent)||"ArrayExpression"===r.type&&("ArrayExpression"===r.parent.parent.type&&r.parent.parent.elements.includes(r.parent)||tt(r.parent.parent)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:lb,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:lF[a]}};return"NewExpression"===a&&lj(r)&&te(n.parent,{names:lw,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield oX(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),eu(u)&&(yield i.remove(u)),to(r)||ta(r)){let e=t.getTokenAfter(n);eu(e)&&(yield i.remove(e))}if("CallExpression"===a||"NewExpression"===a)for(let[e,n]of(s=t.getFirstToken(r),r.elements.map((e,n,o)=>{if(n===o.length-1){let e=t.getLastToken(r,{skip:1});return eu(e)?e:void 0}let a=t.getTokenAfter(e||s,eu);return s=a,a})).entries())null===r.elements[e]&&(yield i.insertTextBefore(n,"undefined"))}}}),e.on("ObjectExpression",r=>{if(!("ObjectExpression"===r.type&&r.properties.length>0&&r.properties.every(e=>"SpreadElement"===e.type&&"ObjectExpression"!==e.argument.type)))return;let n=r.parent;if(!td(n,{object:"Object",method:"assign",minimumArguments:2,optionalMember:!1,optionalCall:!1}))return;let o=n.arguments.indexOf(r),a=n.arguments.slice(0,o).some(e=>"SpreadElement"!==e.type);if(o<=0||!a)return;let i={node:t.getFirstToken(r.properties[0]),messageId:lC};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:lT,fix:t=>t.replaceText(r,r.properties.map(t=>eQ(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(te(e,{names:lw,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:lv,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!lj(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(te(r,{names:lw,argumentsLength:1})||te(r,{names:rE,minimumArguments:1})||td(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(r,{objects:["Array",...rE],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=lE;switch(r.type){case"ForOfStatement":o=lS;break;case"YieldExpression":o=lD;break;case"NewExpression":n=`new ${r.callee.name}(…)`;break;case"CallExpression":n=`${r.callee.object.name}.${r.callee.property.name}(…)`}return{node:t,messageId:o,data:{parentDescription:n},fix:r=>lB(r,t,e)}}),e.on("ArrayExpression",t=>{if(!lj(t))return;let r=t.elements[0].argument,n=!!td(r,{methods:lI,optionalCall:!1,optionalMember:!1})&&rY(r.callee.object,e)&&rY(r,e);if(!n&&!(!rQ(r,e)&&(td(r,{methods:lk,optionalCall:!1,optionalMember:!1})?!lR(r,e):td(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||lR(r,e)):td(r,{method:"split",optionalCall:!1,optionalMember:!1})||td(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&td(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||td(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||te(r,{name:"Array"}))))return;let o={node:t,messageId:lA};return te(r,{name:"Array"})||td(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>lB(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[lb]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[lE]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[lS]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[lD]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[lv]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[lC]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[lA]:"Unnecessarily cloning an array.",[lT]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=ru(e.physicalFilename);e.on("SwitchStatement",function*(r){let{cases:n}=r;if(!(n.length<2)&&null===n.at(-1).test)for(let r=n.length-2;r>=0;r--){let o=n[r];if(!l$(o))break;t&&lN(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ec);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:lP,suggest:[{messageId:lL,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[lP]:"Useless case in switch statement.",[lL]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":l3,"unicorn/numeric-separators-style":l5,"unicorn/prefer-array-find":ux,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"flat",optionalCall:!1,optionalMember:!1})&&(0===t.arguments.length||1===t.arguments.length&&"Literal"===t.arguments[0].type&&"1"===t.arguments[0].raw)&&td(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(th(r.callee.object,uD)||r0(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=t7(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield o4(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:ub,fix:a}}),e.on("CallExpression",t=>{if(!td(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let r=t.callee.object;if(!td(r,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||r.typeArguments||r.typeParameters||rh(r.callee.object)||rQ(r.callee.object,e))return;let{sourceCode:n}=e;if(n.getCommentsInside(t).length>0)return;let[o]=r.arguments,[a]=t.arguments;if(!uC(o)||!uC(a))return;let[i]=o.params,[s]=a.params;if(!nW(i,s))return;let l=function(e,t){if(eZ(e,t))return eQ(e,t);let r=t.sourceCode.getText(e);return og(e,t)?`(${r})`:r}(r.callee.object,e),u=n.getText(i),p=function(e,t){if(eZ(e,t))return eQ(e,t);let r=t.sourceCode.getText(e);return uv.has(e.type)?`(${r})`:r}(o.body,e),c=function(e,t){if(eZ(e,t))return eQ(e,t);let r=t.sourceCode.getText(e);return od(e)?`(${r})`:r}(a.body,e);return{node:t.callee.property,messageId:uE,suggest:[{messageId:uS,fix:e=>e.replaceText(t,`${l}.flatMap(${u} => ${p} ? ${c} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[ub]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[uE]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[uS]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":uR,"unicorn/prefer-array-some":uN,"unicorn/prefer-code-point":{create:e=>{e.on("CallExpression",e=>{if(td(e,{method:"charCodeAt",optionalCall:!1}))return uM(e.callee.property,"codePointAt",!(e=>{let t=(e=>{let t=e;for(;;){let{parent:e}=t;if("ChainExpression"===e.type||"LogicalExpression"===e.type||"ConditionalExpression"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return t}})(e),{parent:r}=t;switch(r.type){case"BinaryExpression":return uO.has(r.operator);case"UnaryExpression":return uU.has(r.operator);case"AssignmentExpression":return r.right===t&&uO.has(r.operator.slice(0,-1));default:return!1}})(e))}),e.on("MemberExpression",e=>{if(tc(e,{object:"String",property:"fromCharCode",optional:!1}))return uM(e.property,"fromCodePoint")})},meta:{type:"suggestion",docs:{description:"Prefer `String#codePointAt(…)` over `String#charCodeAt(…)` and `String.fromCodePoint(…)` over `String.fromCharCode(…)`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{"error/charCodeAt":"Prefer `String#codePointAt()` over `String#charCodeAt()`.","error/fromCharCode":"Prefer `String.fromCodePoint()` over `String.fromCharCode()`.","suggestion/codePointAt":"Use `String#codePointAt()`.","suggestion/fromCodePoint":"Use `String.fromCodePoint()`."},languages:["js/js"]}},"unicorn/prefer-default-parameters":{create:e=>{let{sourceCode:t}=e,r=[],n=(e,n,o,a)=>{let i,s=r.at(-1);if(!s||!n||!o||"Identifier"!==n.type||"LogicalExpression"!==o.type||"||"!==o.operator&&"??"!==o.operator||"Identifier"!==o.left.type||"Literal"!==o.right.type)return;let{name:l}=n,{left:{name:u},right:{raw:p}}=o;if(a&&l!==u)return;let c=ei(t.getScope(e),u);if(!c)return;let{references:d}=c,{params:m}=s,f=m.find(e=>"Identifier"===e.type&&e.name===u);if(((e,t,r)=>{for(let n of t.body.body){if(n===r)break;if(uV(e,n))return!0}return!1})(t,s,e)||a&&d[0].identifier!==n||!a&&d.length>1||(i=m.at(-1),!f||f!==i))return;let g=((e,t)=>{if("ArrowFunctionExpression"!==t.type||t.params.length>1)return!1;let[r]=t.params,n=e.getTokenBefore(r),o=e.getTokenAfter(r);return!o||!n||"("!==n.value||")"!==o.value})(t,s)?`(${l} = ${p})`:`${l} = ${p}`;return{node:e,messageId:uq,suggest:[{messageId:uW,fix:r=>[r.replaceText(f,g),((e,t,r)=>{let{line:n}=t.getLoc(r).start,{column:o}=t.getLoc(r).end,a=t.getText(r),i=t.lines[n-1];if(i.trim()===a)return e.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]);if(" "===i[o]){let[n,o]=t.getRange(r);return e.removeRange([n,o+1])}return e.remove(r)})(r,t,e)]}]}};e.on(ts,e=>{r.push(e)}),e.onExit(ts,()=>{r.pop()}),e.on("AssignmentExpression",e=>{if("ExpressionStatement"===e.parent.type&&e.parent.expression===e)return n(e.parent,e.left,e.right,!0)}),e.on("VariableDeclarator",e=>{if("VariableDeclaration"===e.parent.type&&e.parent.declarations[0]===e)return n(e.parent,e.id,e.init,!1)})},meta:{type:"suggestion",docs:{description:"Prefer default parameters over reassignment.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[uq]:"Prefer default parameters over reassignment.",[uW]:"Replace reassignment with default parameter."},languages:["js/js"]}},"unicorn/prefer-logical-operator-over-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r,i=function(e,t){let{test:r,consequent:n,alternate:o}=e,a=function(e,t){let r=u0(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=u0(e.left),o=u0(e.right);if(n&&o&&uY(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&u1(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&u1(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}(r,t.sourceCode);if(!a||t.sourceCode.getCommentsInside(e).length>0)return;let{reference:i}=a;if(a.isTrueWhenNullish&&uY(i,o,t.sourceCode))return uQ({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&uY(i,n,t.sourceCode))return uQ({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tb(s)||!tc(l)||l.optional||!t0(ry(i),ry(l.object))||function(e){let t=e,{parent:r}=t;for(;rg(r)&&r.expression===t;)r=(t=r).parent;return"UnaryExpression"===r.type&&"delete"===r.operator&&r.argument===t||"CallExpression"===r.type&&r.callee===t||"TaggedTemplateExpression"===r.type&&r.tag===t}(e))return;let u=function(e,t){let{sourceCode:r}=t,n=ri(e,t);if(rt(t,n))return;let[o,a]=r.getRange(e),[i,s]=n;return r.text.slice(o,i)+(e.computed?"?.[":"?.")+r.text.slice(s,a)}(l,t);if(u)return{node:e,messageId:uK,suggest:[{messageId:uJ,fix(r){let n=u;return nQ(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(uY(n,o,t)?uQ({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&uY(n.argument,a,t)?uQ({context:e,conditionalExpression:r,left:n.argument,right:o}):void 0)})},meta:{type:"suggestion",docs:{description:"Prefer using a logical operator over a ternary.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[uz]:"Prefer using a logical operator over a ternary.",[uK]:"Prefer using optional chaining over a ternary.",[uG]:"Switch to `{{operator}}` operator.",[uJ]:"Switch to optional chaining."},languages:["js/js"]}},"unicorn/prefer-optional-catch-binding":{create:e=>{e.on("CatchClause",t=>{let r=t.param;if(!r)return;let{sourceCode:n}=e;if(n.getDeclaredVariables(r.parent).some(e=>e.references.length>0))return;let{type:o,name:a,parent:i}=r,s=n.getCommentsInside(r).length>0;return{node:r,messageId:"Identifier"===o?u2:u3,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tk(t,{test:ed,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tk(o,{test:em,expected:")",ruleId:"prefer-optional-catch-binding"}),yield e.remove(t),yield e.remove(r),yield e.remove(o);let[,a]=n.getRange(o),[s]=n.getRange(i.body),l=n.text.slice(a,s),u=l.length-l.trimStart().length;0!==u&&(yield e.removeRange([a,a+u]))}}})},meta:{type:"suggestion",docs:{description:"Prefer omitting the `catch` binding parameter.",recommended:"unopinionated"},fixable:"code",messages:{[u2]:"Remove unused catch binding `{{name}}`.",[u3]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":pv,"unicorn/prefer-set-has":pM,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!e1(t)||function(e){let{parent:t}=e,{type:r}=t;return tr(t)||["Property","PropertyDefinition","MethodDefinition","AccessorProperty"].includes(r)&&!t.computed&&t.key===e||["TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSAbstractAccessorProperty","TSPropertySignature"].includes(r)&&t.key===e||["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"].includes(r)&&t.source===e||"ImportAttribute"===r&&(t.key===e||t.value===e)||"ImportSpecifier"===r&&t.imported===e||"ExportSpecifier"===r&&(t.local===e||t.exported===e)||"ExportAllDeclaration"===r&&t.exported===e||"JSXAttribute"===r&&t.value===e||"TSEnumMember"===r&&(t.initializer===e||t.id===e)||"TSModuleDeclaration"===r&&t.id===e||"TSExternalModuleReference"===r&&t.expression===e||"TSLiteralType"===r&&t.literal===e||"TSImportType"===r&&t.source===e}(t)||pO(t))return;let{sourceCode:r}=e,{raw:n}=t;if("\\"===n.at(-2)||!n.includes("\\\\")||n.includes("`")||n.includes("${")||r.getLoc(t).start.line!==r.getLoc(t).end.line)return;let o=pW(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:pU,*fix(r){yield o8(r,t,e),yield r.replaceText(t,`String.raw\`${o}\``)}}}),e.on("TemplateLiteral",t=>{if(!("TaggedTemplateExpression"===t.parent.type&&t.parent.quasi===t||t.quasis.every(({value:{cooked:e,raw:t}})=>e===t)||t.quasis.some(({value:{cooked:e,raw:t}})=>"\\"===e.at(-1)||pW(t)!==e)||pO(t)))return{node:t,messageId:pU,*fix(r){for(let n of(yield o8(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield ar(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tc(n,{object:"String",property:"raw",optional:!1})||!a.isGlobalReference(n.object)||r.quasis.some(e=>e.value.raw.includes("\\")))return;let i=a.getText(r),s=r.expressions.length>0||/\r?\n/.test(i)?i:`'${i.slice(1,-1).replaceAll("'",()=>String.raw`\'`)}'`;return{node:n,messageId:pq,*fix(r){let n=a.getTokenBefore(t);nQ(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||nU(n,t.quasi,e)||eZ(t,e)||(yield o0(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||nU(n,t.quasi,e)||eZ(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield oX(t.tag,r,e),yield r.remove(t.tag)}}})},meta:{type:"suggestion",docs:{description:"Prefer using the `String.raw` tag to avoid escaping `\\`.",recommended:"unopinionated"},fixable:"code",messages:{[pU]:"`String.raw` should be used to avoid escaping `\\`.",[pq]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":pX,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{method:"toFixed",argumentsLength:0,optionalCall:!1})||"NewExpression"===t.callee.object.type)return;let{sourceCode:r}=e,[n,o]=r.getLastTokens(t,2);return{loc:{start:r.getLoc(n).start,end:r.getLoc(o).end},messageId:pH,fix:r=>oH(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[pH]:"Missing the digits argument."},languages:["js/js"]}},"unicorn/template-indent":{create:e=>{let{sourceCode:t}=e,r={...e.options[0]},n=(e=>{let t=new Set,r=[e.ast];for(;r.length>0;){let n=r.pop();if(n){if("TemplateLiteral"===n.type){let{start:{line:r},end:{line:o}}=e.getLoc(n);for(let e=r+1;e<=o;e++)t.add(e)}for(let t of e.visitorKeys[n.type]??[]){let e=n[t];Array.isArray(e)?r.push(...e):r.push(e)}}}return t})(t);r.comments=r.comments.map(e=>e.toLowerCase());let o=new WeakSet,a=a=>{let i;if("TemplateLiteral"!==a.type||o.has(a))return;o.add(a);let s="__PLACEHOLDER__"+Math.random(),l=a.quasis.map(e=>t.getText(e).slice(1,e.tail?-1:-2)).join(s),u=l.match(/\r?\n/);if(!u)return;let p=u[0],c=t.getLoc(a),d=t.lines[c.start.line-1].match(/^(\s*)\S/),m=d?d[1]:"";i="string"==typeof r.indent?r.indent:"number"==typeof r.indent?" ".repeat(r.indent):((e,t,r,n)=>{if(""===r){let r;return p1(p3(e.lines,t)).indent||p1(pY(r=p3(n.split(/\r?\n/)))).indent||p1(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=pY(l).replaceAll(RegExp(`^${p}|${p}[ ]*$`,"g"),""),g=p+function(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if("string"!=typeof e)throw TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if("number"!=typeof t)throw TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if("string"!=typeof n)throw TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);return 0===t?e:e.replace(o?/^/gm:/^(?!\s*$)/gm,n.repeat(t))}(f,1,{indent:m+i})+p+m;if(g!==l)return{node:a,messageId:p2,fix:t=>g.split(s).map((r,n)=>ar(a.quasis[n],r,e,t))}};e.on("TemplateLiteral",e=>{if((e=>{if(r.comments.length>0){let n=t.getTokenBefore(e,{includeComments:!0});if(n?.type==="Block"&&r.comments.includes(n.value.trim().toLowerCase()))return!0}return!!(pO(e)||r.tags.length>0&&tx(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&th(e.parent.callee,r.functions))})(e))return a(e)}),e.on(r.selectors,e=>a(e))},meta:{type:"suggestion",docs:{description:"Fix whitespace-insensitive template indentation.",recommended:!0},fixable:"code",schema:p8,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[p2]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{object:"Promise",methods:lu,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type&&1===t.arguments[0].elements.length&&t.arguments[0].elements[0]&&"SpreadElement"!==t.arguments[0].elements[0].type))return;let r=t.callee.property.name,n={node:t.arguments[0],messageId:li,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||ti(t.parent.parent)))return n.fix=r=>r.replaceText(t,lp(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(lc(r,e))return;let n=e.parent;if("AwaitExpression"!==n.type||n.argument!==e)return;let o=(e=>{let{parent:t}=e;return"VariableDeclarator"===t.type&&t.init===e&&ld(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&ld(t.left)&&ti(t.parent)?t.left:void 0})(n);if(o){if(lc(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,lp(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&e0(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!lc(r,a))return r=>r.replaceText(a,`await ${lp(e,t)}`)})(t,e),n):(n.suggest=[{messageId:ls,fix:r=>{let[n]=t.arguments[0].elements,o=eQ(n,e);return eZ(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),nQ(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:ll,fix:function*(e){let r=t.callee.property;yield e.replaceText(r,"resolve");let[n]=t.arguments,a=o.getFirstToken(n),[i,s]=o.getLastTokens(n,2);yield e.remove(a),yield e.remove(s),eu(i)&&(yield e.remove(i))}}],n)})},meta:{type:"suggestion",docs:{description:"Disallow passing single-element arrays to `Promise` methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[li]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[ls]:"Use the value directly.",[ll]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(td(t,{object:"Promise",methods:p5,optionalMember:!1,optionalCall:!1,argumentsLength:1})&&"ArrayExpression"===t.arguments[0].type)for(let r of t.arguments[0].elements)r?.type==="AwaitExpression"&&(yield{node:r,messageId:p6,data:{method:t.callee.property.name},suggest:[{messageId:p9,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield o1(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[p6]:"Promise in `Promise.{{method}}()` should not be awaited.",[p9]:"Remove `await`."},languages:["js/js"]}},"unicorn/no-negation-in-equality-check":{create:e=>{e.on("BinaryExpression",t=>{let{operator:r,left:n}=t;if(!("BinaryExpression"===t.type&&ce.has(t.operator)&&ct(n)&&!ct(n.argument)))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:p4,suggest:[{messageId:p7,data:{operator:i},*fix(s){yield o8(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!eZ(t,e)&&(nU(o.getFirstToken(u),l,e)||(yield o0(s,u,e))),yield s.remove(a),nQ(o.getTokenBefore(a),e,l.value)&&(yield s.insertTextAfter(a,";"));let p=o.getTokenAfter(n,e=>"Punctuator"===e.type&&e.value===r);yield s.replaceText(p,i)}}]}})},meta:{type:"problem",docs:{description:"Disallow negated expression in equality check.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[p4]:"Negated expression is not allowed in equality check.",[p7]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){cr(e,{methods:["slice"],messageId:cn})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[cn]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(cI(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&cI(t.parent.parent)&&t.parent.parent.consequent===t.parent||cI(t.parent)&&t.parent.consequent===t))return{node:t,messageId:ck,fix:function(e,t){let{sourceCode:r}=t;return n=>{var o,a;let i=("BlockStatement"===e.parent.type?e.parent:e).parent,s={...i,...cj(i,r)},l={...e,...cj(e,r)},u=cP(s,r),p=cL(s,t,r),c=cR(cB(cP(l,r)),cL(l,t,r)),d=function(e,t,r,n){let o=[...n.getRange(e)];if("BlockStatement"===t.type)return o;let a=n.getLastToken(t);if(ey(a)){let t=n.getTokenAfter(e);t&&nQ(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?cB(cF(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?cB(cF(s.openingBraceToken,l.ifToken,r)):cB(cF(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?cB(cF(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:cB(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:cB(cR(o,a)).trimStart(),conditionSuffixText:""}),{leadingStatementText:g}=f,y=function({outerIfStatement:e,inner:t,replacementRange:r,sourceCode:n,consequentTextPieces:o,outerConditionGapTextPieces:a}){let{outerTrailingContent:i}=o,{conditionSuffixText:s}=a;if("BlockStatement"===t.consequent.type){let e=cF(t.closingParenthesisToken,t.openingBraceToken,n),r=cF(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=cF(t.closingParenthesisToken,t.consequent,n),u=`${s}${l}${((e,t)=>{let[r,n]=t.getRange(e);return t.text.slice(r,n)})(t.consequent,n)}${i}`;return`${u}${((e,t,r)=>{let[,n]=r.getRange(e);if(t[1]===n)return"";let o=r.text.slice(n,t[1]);return""===o.trim()?o.includes("\n")?`;${o}`:";":`;${o}`})(e,r,n)}`}({outerIfStatement:i,inner:l,replacementRange:d,sourceCode:r,consequentTextPieces:m,outerConditionGapTextPieces:f});return n.replaceTextRange(d,`${g}if${u}(${p} && ${c})${y}`)}}(t,e)}})},meta:{type:"suggestion",docs:{description:"Disallow `if` statements as the only statement in `if` blocks without `else`.",recommended:"unopinionated"},fixable:"code",messages:{[ck]:"Unexpected `if` as the only statement in a `if` block without `else`."},languages:["js/js"]}},"unicorn/no-magic-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!e8(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=tH(t,e);if(!n.commentsExistBetween(o,a))return{node:r,messageId:c$}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[c$]:"Magic number as depth is not allowed."},languages:["js/js"]}},"unicorn/no-negated-condition":{create:e=>{e.on(["IfStatement","ConditionalExpression"],t=>{if("IfStatement"===t.type&&(!t.alternate||"IfStatement"===t.alternate.type))return;let{test:r}=t;if("UnaryExpression"===r.type&&"!"===r.operator||"BinaryExpression"===r.type&&("!="===r.operator||"!=="===r.operator))return{node:r,messageId:cN,*fix(n){if(yield function*(e,t,r){let{sourceCode:n}=r,{test:o}=t;if("UnaryExpression"===o.type){let a=n.getFirstToken(o);"IfStatement"===t.type&&(yield oX(o.argument,e,r)),yield e.remove(a);return}let a=n.getTokenAfter(o.left,e=>"Punctuator"===e.type&&e.value===o.operator);yield e.replaceText(a,"="+a.value.slice(1))}(n,t,e),yield function*(e,t,r){let n="IfStatement"===t.type,[o,a]=[t.consequent,t.alternate].map(e=>{let t=eY(e,r),o=r.sourceCode.text.slice(...t);return n&&"BlockStatement"!==e.type&&(o=`{${o}}`),{range:t,text:o}});if(o.text===a.text)return;let{sourceCode:i}=r;yield e.replaceTextRange(i.getRange(o),a.text),yield e.replaceTextRange(i.getRange(a),o.text)}(n,t,e),"ConditionalExpression"!==t.type||"UnaryExpression"!==r.type)return;yield o8(n,t,e);let{sourceCode:o}=e,{parent:a}=t,[i,s]=o.getFirstTokens(r,2);"ReturnStatement"!==a.type&&"ThrowStatement"!==a.type||a.argument!==t||nU(i,s,e)||eZ(t,e)||eZ(r,e)?nQ(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield o0(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[cN]:"Unexpected negated condition."},languages:["js/js"]}},"unicorn/no-object-as-default-parameter":{create:e=>{e.on("AssignmentPattern",e=>{if(!("ObjectExpression"===e.right.type&&e.right.properties.length>0&&tl(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:cM,data:{parameter:t.name}}:{node:r,messageId:cO}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[cM]:"Do not use an object literal as default for parameter `{{parameter}}`.",[cO]:"Do not use an object literal as default."},languages:["js/js"]}},"unicorn/prefer-negative-index":{create:e=>{e.on("CallExpression",t=>{if("MemberExpression"!==t.callee.type)return;let r=function(e){let{callee:t,arguments:r}=e,n=t.property.name,o=t.object,a=r;if(cq.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=cW(t.object),!cq.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=cq.get(n),l=t.object.object;if(to(l)||"slice"===n&&e0(l,"")||"prototype"===cW(l)&&"Identifier"===l.object.type&&s.has(l.object.name)){if([o]=r,i){let[,e]=r;if(!e||"ArrayExpression"!==e.type)return;a=e.elements}else a=r.slice(1);return{method:n,target:o,argumentsNodes:a}}}(t);if(!r)return;let{method:n,target:o,argumentsNodes:a}=r,{argumentsIndexes:i}=cq.get(n),s=i.map(e=>(function e(t,r){let n;if(!t)return;let{type:o,operator:a,left:i,right:s}=t=ry(t);if("BinaryExpression"!==o||"-"!==a||!(e8(n=ry(s))&&n.value>0))return;let l=ry(i);return"MemberExpression"===l.type&&!l.computed&&!l.optional&&"Identifier"===l.property.type&&"length"===l.property.name&&lq(l.object,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:cU,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=eY(e,r);return t.removeRange([n,o+r.sourceCode.text.slice(o).match(/\S|$/).index])}(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Prefer negative index over `.length - index` when possible.",recommended:"unopinionated"},fixable:"code",messages:{[cU]:"Prefer negative index over length minus index for `{{method}}`."},languages:["js/js"]}},"unicorn/prefer-node-protocol":{create:e=>{e.on("Literal",t=>{if(!(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ImportExpression","TSImportType"].includes(t.parent.type)&&t.parent.source===t||(td(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tg(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(cK)&&cV(r)&&cV(`${cK}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:cz,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],cK)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[cz]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!te(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!td(r,{method:"getTime",argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let{sourceCode:n}=e;return{node:r,loc:{start:n.getLoc(r.callee.property).start,end:n.getLoc(r).end},messageId:cG,fix:t=>o4(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[cG]:"Unnecessary `.getTime()` call."},languages:["js/js"]}},"unicorn/no-accessor-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ThisExpression",e=>{let r=((e,t)=>{for(let r=e.getScope(t);r;r=r.upper){if("class"===r.type)return;if("function"===r.type&&"ArrowFunctionExpression"!==r.block.type)return r}})(t,e);if(!r)return;let n=r.block.parent;if(["Property","MethodDefinition"].includes(n?.type)&&!n.computed&&["set","get"].includes(n.kind)&&cX(n.key)&&("get"===n.kind&&(cY(e,n)||"VariableDeclarator"===e.parent.type&&e.parent.init===e&&"ObjectPattern"===e.parent.id.type&&e.parent.id.properties.some(e=>"Property"===e.type&&!e.computed&&cH(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!cY(e,t))return!1;let r=e.parent,{parent:n}=r;return("AssignmentExpression"===n.type||"AssignmentPattern"===n.type)&&n.left===r||"UpdateExpression"===n.type&&n.argument===r||"ArrayPattern"===n.type&&n.elements.includes(r)||"RestElement"===n.type&&n.argument===r||("ForOfStatement"===n.type||"ForInStatement"===n.type)&&n.left===r||"Property"===n.type&&n.value===r&&"ObjectPattern"===n.parent.type&&n.parent.properties.includes(r.parent)})(e,n)))return{node:e.parent,messageId:cJ,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[cJ]:"Disallow recursive access to `this` within {{kind}}ters."},languages:["js/js"]}},"unicorn/prefer-import-meta-properties":{create:function(e){let{sourceCode:t}=e;e.on("MetaProperty",function*(e){if("MetaProperty"!==e.type||"import"!==e.meta.name||"meta"!==e.property.name)return;let r=e.parent;if(!tc(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(c1(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(te(r.parent,{name:"URL",minimumArguments:1,maximumArguments:2})){var o;let e=r.parent,n=e.parent;if(1===e.arguments.length&&e.arguments[0]===r&&c1(n,t)&&n.arguments[0]===e)return void(yield a(n,{reportFilenameNode:!0}));2===e.arguments.length&&(o=e.arguments[0],o?.type==="Literal"&&("."===o.value||"./"===o.value))&&e.arguments[1]===r&&c1(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(c2(n,t)&&n.arguments[0]===e)return void(yield i(n,"dirname"));if(r&&(yield i(e,"filename")),"VariableDeclarator"!==n.type||n.init!==e||"Identifier"!==n.id.type||"VariableDeclaration"!==n.parent.type||"const"!==n.parent.kind)return;let o=ei(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;c2(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?cQ:cZ,fix:r=>r.replaceText(e,`import.meta.${t}`)}}"filename"===n&&(yield a(r))})},meta:{type:"suggestion",docs:{description:"Prefer `import.meta.{dirname,filename}` over legacy techniques for getting file paths.",recommended:!1},fixable:"code",messages:{[cQ]:"Do not construct dirname.",[cZ]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(td(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&e0(t.arguments[0],1)))return;let[r]=t.arguments;return{node:r,messageId:c3,fix:t=>oY(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[c3]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){cr(e,{methods:["splice","toSpliced"],messageId:c8})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()`.",recommended:"unopinionated"},fixable:"code",messages:{[c8]:"Passing `{{description}}` as the `{{argumentName}}` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-useless-error-capture-stack-trace":{create:e=>{let t=[],r=[];e.on(["ClassDeclaration","ClassExpression"],e=>{t.push(e),r.push(e)}),e.onExit(["ClassDeclaration","ClassExpression"],()=>{t.pop(),r.pop()}),e.on(["FunctionDeclaration","FunctionExpression"],e=>{r.push(e)}),e.onExit(["FunctionDeclaration","FunctionExpression"],()=>{r.pop()}),e.on("CallExpression",n=>{let o,a=t.at(-1);if(!(a?.superClass&&"Identifier"===a.superClass.type&&sS.includes(a.superClass.name)&&e.sourceCode.isGlobalReference(a.superClass)&&(o=r.at(-1),o&&"MethodDefinition"===o.parent.type&&"constructor"===o.parent.kind&&o.parent.value===o&&a.body.body.includes(o.parent))&&td(n,{object:"Error",method:"captureStackTrace",argumentsLength:2,optionalMember:!1})&&e.sourceCode.isGlobalReference(n.callee.object)))return;let[i,s]=n.arguments;if("ThisExpression"!==i.type||!((e,t,r)=>{if("MetaProperty"===e.type&&"Identifier"===e.meta.type&&"new"===e.meta.name&&"Identifier"===e.property.type&&"target"===e.property.name||tc(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=ei(r.sourceCode.getScope(e),e);return n&&1===n.defs.length&&"ClassName"===n.defs[0].type&&n.defs[0].node===t})(s,a,e))return;let l={node:n,messageId:c6},u="ChainExpression"===n.parent.type?n.parent.parent:n.parent;return"ExpressionStatement"===u.type&&"BlockStatement"===u.parent.type&&(l.fix=e=>e.remove(u)),l})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Error.captureStackTrace(…)`.",recommended:"unopinionated"},fixable:"code",messages:{[c6]:"Unnecessary `Error.captureStackTrace(…)` call."},languages:["js/js"]}},"unicorn/prefer-class-fields":{create:e=>{let{sourceCode:t}=e;e.on("ClassBody",r=>{let n=r.body.find(e=>"constructor"===e.kind&&!e.computed&&!e.static&&"MethodDefinition"===e.type&&"FunctionExpression"===e.value.type);if(!n)return;let o=n.value.body.body.find(e=>"EmptyStatement"!==e.type);if(!(o?.type==="ExpressionStatement"&&"AssignmentExpression"===o.expression.type&&"="===o.expression.operator&&"MemberExpression"===o.expression.left.type&&"ThisExpression"===o.expression.left.object.type&&!o.expression.left.computed&&["Identifier","PrivateIdentifier"].includes(o.expression.left.property.type)&&"Literal"===o.expression.right.type))return;let a=o.expression.left.property.name,i=o.expression.right.raw,s=o.expression.left.property.type,l=r.body.find(e=>"PropertyDefinition"===e.type&&!e.computed&&!e.static&&e.key.type===s&&e.key.name===a),u={node:o,messageId:c9};function*p(s){if(yield((e,t,r)=>{let{line:n}=t.getLoc(e).start,o=t.getText(e);return t.lines[n-1].trim()===o?r.removeRange([t.getIndexFromLoc({line:n,column:0}),t.getIndexFromLoc({line:n+1,column:0})]):r.remove(e)})(o,t,s),l){if(l.value)return void(yield s.replaceText(l.value,i));let e=` = ${i}`,r=t.getLastToken(l);return ep(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=t6(n,e),c=`${p}${a} = ${i};
23
23
  `;"\n"!==t.getText()[t.getRange(u)[0]-1]&&(c=`
24
- ${c}`);let d=r.body.at(-1);"PropertyDefinition"===d.type&&";"!==t.getLastToken(d).value&&(c=`;${c}`),yield s.insertTextBefore(u,c)}return l?.value?u.suggest=[{messageId:c$,fix:p}]:u.fix=p,u})},meta:{type:"suggestion",docs:{description:"Prefer class field declarations over `this` assignments in constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cB]:"Prefer class field declaration over `this` assignment in constructor for static values.",[c$]:"Encountered same-named class field declaration and `this` assignment in constructor. Replace the class field declaration with the value from `this` assignment."},languages:["js/js"]}},"unicorn/prefer-bigint-literals":{create:e=>{e.on("CallExpression",t=>{if(!e7(t,{name:"BigInt",argumentsLength:1,optional:!1}))return;let[r]=t.arguments,n=function(e){let t,r;if(e1(e)){let t,r=e.raw.slice(1,-1);try{t=BigInt(r)}catch{return}let n=0n===t?"0":r.trim();return n.startsWith("+")&&(n=n.slice(1).trim()),{shouldUseSuggestion:r.includes("+"),text:`${n}n`,bigint:t}}let n=!1,o=!1;for(;"UnaryExpression"===e.type&&e.prefix;)if("+"===e.operator)n=!0,e=e.argument;else{if("-"!==e.operator)return;o=!o,e=e.argument}let{value:a,raw:i}=e;if(Number.isInteger(a)){try{t=BigInt(a)}catch{return}return(e=>{let t=e.raw.replaceAll("_","").toLowerCase();if(t.includes("."))return!1;let{value:r}=e;for(let{prefix:e,base:n}of[{prefix:"0b",base:2},{prefix:"0o",base:8},{prefix:"0x",base:16}])if(t.startsWith(e))return t.slice(2)===r.toString(n);return!t.includes("e")&&t===String(r)})(e)?r=`${i}n`:(r=`${t}n`,n=!0),o&&0n!==t&&(r=`-${r}`,t=-t),{shouldUseSuggestion:n,text:r,bigint:t}}}(r);if(!n)return;let o={node:t,messageId:cR},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!eQ(t,e)&&s<0n&&(n=`(${n})`,nU(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:cP,data:{replacement:i.length<20?`\`${i}\``:"a bigint literal"},fix:l}]:o.fix=l,o})},meta:{type:"suggestion",docs:{description:"Prefer `BigInt` literals over the constructor.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cR]:"Prefer using bigint literal over `BigInt(…)`.",[cP]:"Replace with {{replacement}}."},languages:["js/js"]}},"unicorn/prefer-classlist-toggle":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=[r.consequent,r.alternate].map(e=>{if(e)return"BlockStatement"===e.type&&1===e.body.length&&(e=e.body[0]),"ExpressionStatement"===e.type&&(e=e.expression),"ChainExpression"===e.type&&(e=e.expression),e});if(n.some(e=>!cU(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&cW(o,a))return cO(r,function*(n){let i=eZ(o.callee.object.object,e),s=eZ(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=c_(p,u,o),d=c?"":cq(p,e,u),m=o.callee.object.optional||a.callee.object.optional||c?.callee.object.optional,f=`${i}${m?"?":""}.classList.toggle(${s}${d?`, ${d}`:""})`;l||(f+=";"),nU(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield oR(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>e1(e)&&("add"===e.value||"remove"===e.value))&&r[0].value!==r[1].value&&"MemberExpression"===t.parent.type&&t.parent.computed&&!t.parent.optional&&t.parent.property===t&&cM(t.parent.object)&&e7(t.parent.parent,{optional:!1,argumentsLength:1})&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return cO(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=c_(i,a,o)?"":cq(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield oL(r,n,e,".toggle")},t)})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#classList.toggle()` to toggle class names.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[cL]:"Prefer using `Element#classList.toggle()` to toggle class names.",[cN]:"Replace with `Element#classList.toggle()`."},languages:["js/js"]}},"unicorn/require-module-attributes":{create:e=>{let{sourceCode:t}=e;e.on(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"],e=>{let{source:r,attributes:n}=e;if(!r||Array.isArray(n)&&n.length>0)return;let o=t.getTokenAfter(r);if(o?.type!=="Keyword"||"with"!==o.value)return;let a=t.getTokenAfter(o),i=t.getTokenAfter(a);return{node:e,loc:{start:t.getLoc(a).start,end:t.getLoc(i).end},messageId:cV,data:{type:"ImportDeclaration"===e.type?"import statement":"export statement"},fix:e=>[o,i,a].map(t=>e.remove(t))}}),e.on("ImportExpression",r=>{let{options:n}=r;if(n?.type!=="ObjectExpression")return;let o=n.properties.find(e=>"Property"===e.type&&!e.method&&!e.shorthand&&!e.computed&&"init"===e.kind&&("Identifier"===e.key.type&&"with"===e.key.name||"Literal"===e.key.type&&"with"===e.key.value)&&ta(e.value)),a=0===n.properties.length||o&&1===n.properties.length?n:o;if(!a)return;let i="Property"===a.type;return{node:o?.value??a,messageId:cV,data:{type:"import expression"},fix:r=>i?function*(e,t,r){let{sourceCode:n}=r;for(let r of n.getTokens(t))yield e.remove(r);let o=n.getTokenAfter(t);if(eu(o))yield e.remove(o);else{let{properties:r}=t.parent;if(r.length>1&&r.at(-1)===t){let r=n.getTokenBefore(t);yield e.remove(r)}}}(r,a,e):[t.getTokenBefore(a,eu),...t.getTokens(a),...eY(a,e)].map(e=>r.remove(e))}})},meta:{type:"suggestion",docs:{description:"Require non-empty module attributes for imports and exports",recommended:"unopinionated"},fixable:"code",messages:{[cV]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of c2)e.on(["VariableDeclarator","AssignmentExpression"],r=>(function(e,t,{testValue:r,getProblematicNode:n,getProblem:o,getFix:a}){let i,s="AssignmentExpression"===t.type,[l,u]=(s?["left","right"]:["id","init"]).map(e=>t[e]);if(!("Identifier"===l.type&&r(u)))return;let p=t.parent;if(!(s&&"="===t.operator&&"ExpressionStatement"===p.type&&p.expression===t||!s&&"VariableDeclaration"===(i=t.parent).type&&i.declarations.at(-1)===t))return;let c=or(p,e);if(c?.type!=="ExpressionStatement")return;let d="VariableDeclarator"===t.type?e.sourceCode.getDeclaredVariables(t).find(e=>1===e.defs.length&&e.defs[0].name===t.id):ei(e.sourceCode.getScope(t),t.left.name);if(!d)return;let m={context:e,variable:d,variableNode:l,valueNode:u,statement:p,nextExpressionStatement:c,assignType:s?"assignment":"declaration",getFix:a},f=n(m);if(f)return o(f,m)})(e,r,t))},meta:{type:"suggestion",docs:{description:"Disallow immediate mutation after variable assignment.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[cz]:"Immediate mutation on {{objectType}} is not allowed.",[cK]:"{{operation}} the elements to the {{assignType}}.",[cG]:"Move this property to the {{assignType}}.",[cJ]:"{{description}} the {{assignType}}.",[cX]:"Move the element to the {{assignType}}.",[cY]:"Move the entry to the {{assignType}}."},languages:["js/js"]}},"unicorn/no-useless-collection-argument":{create:e=>{e.on("NewExpression",t=>{var r;let n;if(!te(t,{names:["Set","Map","WeakSet","WeakMap"],argumentsLength:1}))return;let[o]=t.arguments,a="LogicalExpression"===o.type&&"??"===o.operator,i=a?o.right:o,s=to(r=i)?"empty array":e0(r,"")?"empty string":e9(r)?"`null`":tx(r)?"`undefined`":void 0;if(!s)return;let l=!1;if(a)n=function*(t){let{sourceCode:r}=e,n=i.parent,{left:o}=n,a=eQ(o,e),[,s]=a?eH(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield oA(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>ow(t,i,e);let u={node:i,messageId:c3,data:{description:s}};return l?u.suggest=[{messageId:c8,fix:n}]:u.fix=n,u})},meta:{type:"suggestion",docs:{description:"Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[c3]:"The {{description}} is useless.",[c8]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!te(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(td(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:c6,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield oB(t,e,n);let[o]=r.arguments,a=eH(r,e),i=eH(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!eQ(t,e)&&eQ(t.callee,e)&&nU(e.sourceCode.getTokenBefore(t),e,"(")&&(yield n.insertTextBefore(t,";"))}}})},meta:{type:"suggestion",docs:{description:"Prefer `Response.json()` over `new Response(JSON.stringify())`.",recommended:"unopinionated"},fixable:"code",messages:{[c6]:"Prefer using `Response.json(…)` over `JSON.stringify()`."},languages:["js/js"]}},"unicorn/filename-case":{create:e=>{let t=e.physicalFilename;if("<input>"===t||"<text>"===t)return;let r=e.options[0]||{},n=function(e){if(e.case)return[e.case];if(e.cases){let t=Object.keys(e.cases).filter(t=>e.cases[t]);return t.length>0?t:["kebabCase"]}return["kebabCase"]}(r),o=(r.ignore||[]).map(e=>c.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>dS[e].fn);e.on(ru,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=d.relative(r,d.resolve(r,t)))||".."===l||l.startsWith(`..${d.sep}`)||d.isAbsolute(l)?[d.basename(t)]:l.split(d.sep).filter(e=>"."!==e)),{basename:c,filename:m,middle:f,extension:g}=function(e,{multipleFileExtensions:t}){let r=d.extname(e),n=d.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".");Object.assign(o,{filename:e,middle:n.slice(e.length)})}return o}(p.at(-1),{multipleFileExtensions:a});if(p.some(e=>o.some(t=>t.test(e))))return;if(i)for(let e of p.slice(0,-1)){let t=function(e,t,r){let n,{leading:o,words:a}=dT(e);if(e.startsWith("$")||dv(a,r))return;let i=dC(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:dd,data:{directory:e,chosenCases:dw(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),dy.format(n))}}}(e,n,s);if(t)return t}if(dg.has(c))return;let{leading:y,words:h}=dT(m);if(m.startsWith("$")||dv(h,s))return g!==g.toLowerCase()?{loc:{column:0,line:1},messageId:dm,data:{filename:m+f+g.toLowerCase(),extension:g}}:void 0;let x=dC(h,s,{leading:y,trailing:f+g.toLowerCase()});return{loc:{column:0,line:1},messageId:dc,data:{chosenCases:dw(n),renamedFilenames:(u=x.map(e=>`\`${e}\``),dy.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:dk,defaultOptions:[],messages:{[dc]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[dd]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[dm]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(th(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:dI,fix:r=>oW(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[dI]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(te(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||te(t,{names:rb,minimumArguments:1}))||!dO(t.arguments[0]))return;let r=t.arguments[0];return{node:r.callee.property,messageId:dj,data:{description:`new ${t.callee.name}(…)`},fix:t=>oM(t,r,e)}}),e.on("CallExpression",t=>{if((td(t,{objects:["Array",...rb],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||td(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1}))&&dO(t.arguments[0])){let r=t.arguments[0];return{node:r.callee.property,messageId:dj,data:{description:`${t.callee.object.name}.${t.callee.property.name}(…)`},fix:t=>oM(t,r,e)}}if(td(t,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&dO(t.arguments[0])){let r=t.arguments[0];return{node:r.callee.property,messageId:dj,data:{description:`${t.callee.object.name}.${t.callee.property.name}(…)`},suggest:[{messageId:dP,fix:t=>oM(t,r,e)}]}}if((td(t,{methods:dN,maximumArguments:1,optionalCall:!1,optionalMember:!1})||td(t,{method:dM,argumentsLength:2,optionalCall:!1,optionalMember:!1}))&&dO(t.callee.object)){let r=t.arguments[0],n=t.callee.property.name===dM;if(r&&("ArrowFunctionExpression"===r.type||"FunctionExpression"===r.type)&&r.params.length>(n?3:2))return;let o=t.callee.object;return{node:o.callee.property,messageId:dR,data:{method:t.callee.property.name},suggest:[{messageId:dL,data:{method:t.callee.property.name},fix:t=>oM(t,o,e)}]}}}),e.on("ForOfStatement",t=>{if(dO(t.right))return{node:t.right.callee.property,messageId:dF,fix:r=>oM(r,t.right,e)}}),e.on("YieldExpression",t=>{if(t.delegate&&dO(t.argument))return{node:t.argument.callee.property,messageId:dB,fix:r=>oM(r,t.argument,e)}}),e.on("SpreadElement",t=>{if(!dO(t.argument))return;let{parent:r}=t;if("ArrayExpression"===r.type||"CallExpression"===r.type||"NewExpression"===r.type)return{node:t.argument.callee.property,messageId:d$,fix:r=>oM(r,t.argument,e)}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[dj]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[dF]:"`for…of` can iterate over an iterable, `.toArray()` is unnecessary.",[dB]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[d$]:"Spread works on iterables, `.toArray()` is unnecessary.",[dR]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[dP]:"Remove `.toArray()`.",[dL]:"Remove `.toArray()` and use `Iterator#{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-simple-condition-first":{create:e=>{let{sourceCode:t}=e;e.on("LogicalExpression",r=>{if("&&"!==r.operator&&"||"!==r.operator||!d_(r.right)||d_(r.left)||"ConditionalExpression"!==r.left.type||!function e(t){let{parent:r}=t;return!!r&&("IfStatement"===r.type&&r.test===t||"WhileStatement"===r.type&&r.test===t||"DoWhileStatement"===r.type&&r.test===t||"ForStatement"===r.type&&r.test===t||"ConditionalExpression"===r.type&&r.test===t||"UnaryExpression"===r.type&&"!"===r.operator||"LogicalExpression"===r.type&&e(r))}(r)||function e(t){if(!t||"object"!=typeof t)return!1;if(dV.has(t.type)||"MemberExpression"===t.type||"BinaryExpression"===t.type&&("in"===t.operator||"instanceof"===t.operator))return!0;for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){if(n.some(t=>e(t)))return!0}else if(n&&"string"==typeof n.type&&e(n))return!0}return!1}(r.left)||function e(t){if(!t||"object"!=typeof t)return!1;if("CallExpression"===t.type||"NewExpression"===t.type)return!0;for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){if(n.some(t=>e(t)))return!0}else if(n&&"string"==typeof n.type&&e(n))return!0}return!1}(r.left))return;let n=dz(r.right,e,{operator:r.operator,property:"left"}),o=dz(r.left,e,{operator:r.operator,property:"right"}),a=t.getTokensBetween(r.left,r.right,{includeComments:!0}).some(e=>eg(e))?void 0:t=>t.replaceTextRange([eH(r.left,e)[0],eH(r.right,e)[1]],`${n} ${r.operator} ${o}`);return"LogicalExpression"===r.left.type&&r.left.operator===r.operator?{node:r,loc:t.getLoc(r.right),messageId:dq,data:{operator:r.operator},...a&&{suggest:[{messageId:dU,fix:a}]}}:{node:r,loc:t.getLoc(r.right),messageId:dq,data:{operator:r.operator},...a&&{fix:a}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[dq]:"Prefer simple condition first in `{{operator}}` expression.",[dU]:"Swap conditions."},languages:["js/js"]}},"unicorn/switch-case-break-position":{create:e=>{let{sourceCode:t}=e;e.on("SwitchCase",r=>{let{consequent:n}=r;if(n.length<2)return;let o=n.at(-1);if(!dG.has(o.type))return;let a=n.slice(0,-1);if(1!==a.length||"BlockStatement"!==a[0].type)return;let i=a[0];if(0===i.body.length)return;let s=function(e){switch(e.type){case"BreakStatement":return"break";case"ReturnStatement":return"return";case"ContinueStatement":return"continue";case"ThrowStatement":return"throw"}}(o);return{node:o,loc:t.getLoc(o),messageId:dK,data:{keyword:s},..."ReturnStatement"!==o.type&&"ThrowStatement"!==o.type&&{*fix(r){let n=t.getLastToken(i);if(t.getTokensBetween(n,o,{includeComments:!0}).some(e=>eg(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||t7(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=t8(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
25
- ${u}${l}`);let c=t.getRange(n)[1],d=t.getRange(o)[1];yield r.removeRange([c,d])}}}})},meta:{type:"layout",docs:{description:"Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.",recommended:!0},fixable:"code",messages:{[dK]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(d8(e)){if(d3(e.object,"childNodes"))return"childNodes";if(d3(e.object,"children"))return"children"}})(t);if(!n||nA(t.object.object)||"children"===n&&d3(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tc(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&d3(t.parent,"children")&&d8(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:dJ,suggest:d9(t,"firstChild",dQ,e)}:"children"===n&&0===o?{node:t,messageId:dX,suggest:d9(t,"firstElementChild",d0,e)}:"children"===n?{node:t,messageId:dY}:void 0}),e.on("MemberExpression",e=>{if(!(!d5(e)||!d5(e.object)||!(!d5(e.parent)||e.parent.object!==e)||nA((e=>{for(;d5(e);)e=e.object;return e})(e))))return{node:e,messageId:dH}}),e.on("CallExpression",t=>{if(!d7(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&d7(t.parent.parent)&&d4(t.parent.parent.arguments[0])||(e=>{for(;e.parent?.type==="MemberExpression"&&e.parent.object===e||e.parent?.type==="CallExpression"&&e.parent.callee===e;)e=e.parent;return e.parent?.type==="ChainExpression"})(t))return;let r=(e=>{let t=[];for(;d7(e);){let[r]=e.arguments;if(!d4(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||nA(e))return;let r=[];for(let e of t)r.unshift(e3(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:dZ,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(d6(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=eZ(t.root,r),s=`${"Identifier"===(n=t.root).type&&"document"===n.name||"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.object.type&&["globalThis","window"].includes(n.object.name)&&"Identifier"===n.property.type&&"document"===n.property.name?"":":scope "}${t.selectors.join(" ")}`,l=`${i}.querySelector(${tF(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:d1,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[dJ]:"Prefer `.firstChild` over `.childNodes[0]`.",[dX]:"Prefer `.firstElementChild` over `.children[0]`.",[dY]:"Consider `.querySelector()` over positional child traversal.",[dH]:"Consider `.closest()` over chaining `.parentElement`.",[dZ]:"Consider merging chained `.querySelector()` calls.",[dQ]:"Switch to `.firstChild`.",[d0]:"Switch to `.firstElementChild`.",[d1]:"Merge the `.querySelector()` calls."},languages:["js/js"]}},"unicorn/consistent-compound-words":{create:e=>{let t=(({checkProperties:e=!1,checkVariables:t=!0,checkDefaultAndNamespaceImports:r="internal",checkShorthandImports:n="internal",checkShorthandProperties:o=!1,extendDefaultReplacements:a=!0,replacements:i={},allowList:s={}}={})=>{let l=new Map(Object.entries(a?{...mi,...i}:i).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:r,checkShorthandImports:n,checkShorthandProperties:o,replacements:l,replacementRegExp:l.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(ml(n)),r.push(ml(on(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${mu}`,"gv")})(l):void 0,allowList:new Set(Object.keys(s))}})(e.options[0]),r=new WeakMap,n=new WeakMap,o=(e,t)=>t.every(t=>{let r=n.get(t);return!r||!r.has(e)}),a=e=>{if((e=>{if(1!==e.defs.length)return!1;let[t]=e.defs;return"ClassName"===t.type})(e)){if("class"===e.scope.type){let[t]=e.defs,n=r.get(t.name);return n?i({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...n.references]}):i(e)}let[t]=e.defs;return void r.set(t.name,e)}return i(e)},i=r=>{var a;if(0===r.defs.length)return;let i=mp(r.name,t);if(!i)return;let[s]=r.defs;if(!(!("ImportDefaultSpecifier"===(a=s.name).parent.type&&a.parent.local===a||"ImportNamespaceSpecifier"===a.parent.type&&a.parent.local===a||"ImportSpecifier"===a.parent.type&&a.parent.local===a&&"Identifier"===a.parent.imported.type&&"default"===a.parent.imported.name||"VariableDeclarator"===a.parent.type&&a.parent.id===a&&tf(a.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||mr(s)))||!(!nR(s.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||mr(s)))||!t.checkShorthandProperties&&nN(s.name))return;let l=[...r.references.map(e=>e.from),r.scope],u=ma(i)?tG(i,l,o):void 0,p=mc(s.name,u??i);if(u&&rc(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!me.has(e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type)&&"JSXIdentifier"!==e.type)&&r.references.every(e=>!e.vueUsedInTemplate)){for(let e of l)n.has(e)||n.set(e,new Set),n.get(e).add(u);p.suggest=[{messageId:mo,data:{replacement:u},fix:t=>oU(r,u,e,t)}]}e.report(p)},s=e=>{for(let t of e.variables)a(t)},l=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=mp(r.name,t);if(!n||"ExportSpecifier"===r.parent.type||(t.checkVariables||("TSParameterProperty"===r.parent.type?r.parent.parameter!==r:"AssignmentPattern"!==r.parent.type||r.parent.left!==r||"TSParameterProperty"!==r.parent.parent.type||r.parent.parent.parameter!==r.parent))&&!("MemberExpression"===r.parent.type&&r.parent.property===r&&!r.parent.computed&&("AssignmentExpression"===r.parent.parent.type&&r.parent.parent.left===r.parent||"UpdateExpression"===r.parent.parent.type&&r.parent.parent.argument===r.parent)||"Property"===r.parent.type&&r.parent.key===r&&!r.parent.computed&&!r.parent.shorthand&&"ObjectExpression"===r.parent.parent.type||"ExportSpecifier"===r.parent.type&&r.parent.exported===r&&r.parent.local!==r||mt.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=mc(r,n);e.report(o)};e.on("Identifier",l),e.on("PrivateIdentifier",l),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of tM(e.sourceCode.getScope(r)))s(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:md,defaultOptions:[{}],messages:{[mn]:"Prefer `{{replacement}}` over `{{name}}`.",[mo]:"Rename to `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-blob-to-file":{create:e=>{e.on("VariableDeclarator",t=>(function(e,t){let{sourceCode:r}=t,{id:n,init:o}=e;if("Identifier"!==n.type||"VariableDeclaration"!==e.parent.type||"const"!==e.parent.kind||1!==e.parent.declarations.length||"Program"!==e.parent.parent.type&&"BlockStatement"!==e.parent.parent.type)return;let a=function(e,t){if(!te(e,{name:"File",minimumArguments:2,maximumArguments:2})||!mg(e.callee,t))return;let[r]=e.arguments,[,n]=e.arguments;if("ArrayExpression"!==r.type||1!==r.elements.length||r.elements[0]?.type==="SpreadElement"||void 0===e3(n))return;let[o]=r.elements;if(function(e,t,r){let n=my(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(te(o,{name:"Blob",maximumArguments:1})||te(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&mg(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=ei(r.getScope(n),n);if(!i)return;let s=rc(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return td(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&mg(n.callee.object,t)?{call:n,kind:"blobArgument"}:td(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=my(n.callee.object,t)?.init,te(r,{name:"FormData",argumentsLength:0})&&mg(r.callee,t))?{call:n,kind:"formData"}:void 0}(l,t);if(!u)return;let p=function(e){let[,t]=e.arguments;return t}(o);if(!(!function(e,t,r){if("Identifier"!==e.type)return!0;let{sourceCode:n}=r;return ei(n.getScope(e),e)===ei(n.getScope(t),e)}(a,l,t)||function(e,t){let{sourceCode:r}=t;return r.getCommentsInside(e).length>0||r.getCommentsBefore(e).some(t=>r.getLoc(t).end.line===r.getLoc(e).start.line||r.getLoc(t).end.line===r.getLoc(e).start.line-1)||t7(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:mm,suggest:[{messageId:mf,*fix(n){yield oO(e.parent,t,n),yield n.replaceText(l,r.getText(a)),"formData"===u.kind&&2===u.call.arguments.length&&(yield n.insertTextAfter(l,`, ${r.getText(p)}`))}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Blob` to `File` conversion.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[mm]:"Use the original `Blob` instead of converting it to a `File`.",[mf]:"Replace the `File` with the original `Blob`."},languages:["js/js"]}},"unicorn/no-canvas-to-image":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{var r,n,o;if(!td(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=mb(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&td(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?mE(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&mE(o.property.name))))return{node:a,messageId:mh}}),e.on("CallExpression",e=>{if(!td(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&td(mb(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:mh}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[mh]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=n0(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?mD:-1===Math.trunc(n0(e))&&0===r?mS:void 0}(t.arguments);if(!r)return;let n={node:t.callee.property,messageId:r,data:{method:t.callee.property.name}},o=function(e,t,r){let{sourceCode:n}=r,{object:o,property:a}=e.callee,[i,,s]=e.arguments,l=a.name,u=eZ(o,r),p=n.getText(i),c=n.getText(s);if(t===mD){if(mT(e,n))return;if("toSpliced"===l){var d,m;if(0>Math.trunc(n0(i))||(d=i,m=o,d=rg(d),m=rg(m),"MemberExpression"===d.type&&!d.optional&&!d.computed&&"Identifier"===d.property.type&&"length"===d.property.name&&lg(d.object,m)))return;return{messageId:mv,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&mA(o)&&(n0(i)??0)>=0?{messageId:mv,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===mS&&mA(o)&&!mT(i,n))return{messageId:mC,fix:e=>e.replaceText(i,`Math.max(${u}.length - 1, 0)`)}}(t,r,e);return o&&(n.suggest=[o]),n})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#{splice,toSpliced}()`.",recommended:!0},hasSuggestions:!0,messages:{[mD]:"Prefer a direct element replacement instead of `{{method}}()`.",[mS]:"Avoid using `{{method}}()` to insert at `-1`.",[mv]:"Use direct element replacement.",[mC]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!te(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return t3(n.elements,e).map(e=>({node:e??n,messageId:mw,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[mw]:"Remove duplicate value `{{value}}` from the Set."},languages:["js/js"]}},"unicorn/no-incorrect-query-selector":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!mP(r)||mN(r))return;let n=r.object;if(!mM(r,n,t,e))return mU(r,n,e)}),e.on("CallExpression",r=>{let n;if(mL(r)){if(mN(r))return;let n=r.callee.object;if(mM(r,n,t,e))return;return mU(r,n,e)}let o=mq(r,e);if(o)return o;if(mR(r)&&!(mP(n=r.parent)||mL(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&mL(r.parent.parent))){let e;if(e=e3(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:mI}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(m_(e,mR,r))return{node:e,messageId:mF}})(r,e)??((e,t)=>{let r=m_(e,m$,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tx(r.value))return{node:e,messageId:mB}})(r,t)),e.on("Identifier",t=>mq(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[mk]:"Prefer `.querySelector()` when only the first match is used.",[mI]:"Prefer `.querySelector()` for a simple ID selector.",[mj]:"Check `.length` instead of the `NodeList` object itself.",[mF]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[mB]:"Compare the result of `.querySelector()` with `null` instead of `undefined`."},languages:["js/js"]}},"unicorn/no-invalid-file-input-accept":{create:e=>{e.on("JSXOpeningElement",t=>{if("input"!==mZ(t.name))return;let r=((e,t)=>{if(t?.value){if(e1(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return m0(e,t.value.expression)}})(e,mQ(t,"type"));if(r?.toLowerCase()!=="file")return;let n=mQ(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(e1(t.value))return{node:t.value,value:t.value.value,fixable:!0};if("JSXExpressionContainer"!==t.value.type)return{node:t.value,dynamic:!0};let r=m0(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return m5({valueInfo:o,fix:t=>r=>{let n;return n=o.node,r.replaceTextRange([e.sourceCode.getRange(n)[0]+1,e.sourceCode.getRange(n)[1]-1],t)}})}),e.on("Tag",t=>{if("input"!==t.name.toLowerCase())return;let r=m9(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=m9(e,t,r);if(!n)return;let o=t.attributes.find(e=>"Attribute"===e.type&&e.key?.value?.toLowerCase()===r);return n.missing?{node:o??t,missing:!0}:o?.value?.parts?.length>0?{node:o.value,dynamic:!0}:mX.test(n.value)?void 0:{node:o?.value??t,value:n.value,fixable:!0,valueRange:n.valueRange,isReplacementFixable:e=>n.isQuoted||!/\s/v.test(e)}})(e,t,"accept");if(n)return m5({valueInfo:n,fix:e=>t=>t.replaceTextRange(n.valueRange,e)})})},meta:{type:"problem",docs:{description:"Disallow invalid `accept` values on file inputs.",recommended:!1},fixable:"code",messages:{[mV]:"Invalid file input `accept` value: {{reason}}",[mz]:"The file input `accept` value must be static.",[mK]:"Prefer `{{replacement}}` as the file input `accept` value."},languages:["js/js","html/html"]}},"unicorn/no-late-current-target-access":{create:e=>{let{sourceCode:t}=e,r=new Set,n=e=>{let t=ft(e);t&&r.add(t)},o=(e,t)=>{switch(e.type){case"ForStatement":return[e.test,e.update,e.body].includes(t);case"ForInStatement":case"ForOfStatement":return t!==e.right;case"DoWhileStatement":case"WhileStatement":return!0;default:return!1}};e.onExit("AwaitExpression",n),e.onExit("YieldExpression",n),e.onExit("ForOfStatement",e=>{e.await&&n(e)}),e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tc(e,{property:"currentTarget"})||!fe.test(e.object.name))return;let n=ei(t.getScope(e.object),e.object),a=n?.defs.find(({type:e})=>"Parameter"===e);if(!a)return;let i=a.node,s=ft(e)!==i;if(s||r.has(i)||((e,r)=>{for(let n=e,a=e.parent;a&&a!==r;n=a,a=a.parent)if(o(a,n)&&tk(a,t.visitorKeys))return!0;return!1})(e,i))return{node:e,messageId:s?m7:m4,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[m4]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[m7]:"`{{name}}.currentTarget` is `null` inside this nested function. It is only set during synchronous event dispatch; save it to a variable in the outer function."},languages:["js/js"]}},"unicorn/no-unnecessary-nested-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;return"ConditionalExpression"===o.type&&fn(o.alternate,a,t)?fi(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&fn(o,a.consequent,t)?fi(e,r,{left:n,operator:"||",right:a.test,consequent:o,alternate:a.alternate}):void 0})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary nested ternary expressions.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[fr]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{var r,n;let o,a,i="MemberExpression"===t.callee.type?eI(r=t.callee,e.sourceCode.getScope(r)):void 0;if(!(!fl.has(i)||!(e=>{for(;;){if(nM(e))return!0;let{parent:t}=e;if("ForStatement"===t.type&&(t.init===e||t.update===e))return!0;if("ChainExpression"!==t.type&&"AwaitExpression"!==t.type&&"TSAsExpression"!==t.type&&"TSTypeAssertion"!==t.type&&"TSNonNullExpression"!==t.type&&"TSSatisfiesExpression"!==t.type)return!1;e=t}})(t)||(n=function e(t,r,n=new Set){if(!t||t===fp||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=function(e,t){if("Identifier"===e.type)return ei(t.sourceCode.getScope(e),e)}(e,t);if(!r)return;if(1!==r.defs.length||function(e,t,r){if(!e)return!1;let[n]=r.sourceCode.getRange(t);return e.references.some(e=>!e.init&&e.isWrite()&&r.sourceCode.getRange(e.identifier)[0]<n)}(r,e,t))return fp;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&n.node.init&&"VariableDeclaration"===n.parent.type?n.node.init:fp}(t,r);return o===fp?o:void 0===o?t:e(o,r,n)}if(["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type))return e(t.expression,r,n);if("MemberExpression"===t.type)return fp;if("TSAsExpression"===t.type||"TSTypeAssertion"===t.type){let{typeAnnotation:e}=t;return"TSTypeOperator"===e.type&&"readonly"===e.operator&&(e=e.typeAnnotation),"TSArrayType"===e.type||"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?t:fp}return t}(n=t.callee.object,e))===fp||((e,t)=>fd(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&"Identifier"===e.callee.type&&!fd(e.callee,"Array",t)||"CallExpression"===e.type&&"Identifier"===e.callee.type&&fc.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))(n,e)||"Identifier"===(o=n).type&&fu.test(o.name)&&!("ArrayExpression"===(a=n).type||("CallExpression"===a.type||"NewExpression"===a.type)&&fd(a.callee,"Array",e))))return{node:t.callee.property,messageId:fs,data:{method:i}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[fs]:"Do not ignore the return value of `.{{method}}(…)`."},languages:["js/js"]}},"unicorn/prefer-array-last-methods":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!td(r,{methods:fg.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!td(n,{methods:fy,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=fg.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:fm,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:ff,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield oM(t,n,e)}}]),s})},meta:{type:"suggestion",docs:{description:"Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[fm]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[ff]:"Replace `.{{reversingMethod}}().{{method}}()` with `.{{replacement}}()`."},languages:["js/js"]}},"unicorn/prefer-math-abs":{create:e=>{e.on("ConditionalExpression",t=>{let r=function(e,t){let r=function(e,t){if(!("BinaryExpression"!==e.type||!fx.has(e.operator)||fC(e.left,t)||fC(e.right,t))){if(e0(e.right,0))return{value:e.left,operator:e.operator};if(e0(e.left,0))return{value:e.right,operator:fb[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&fA(a,n)&&tQ(i,n)||(">"===o||">="===o)&&tQ(a,n)&&fA(i,n))return n}(t,e);if(!r)return;let n=fj(r)?function*(n){yield oR(n,t,e),yield n.replaceText(t,`Math.abs(${fk(r,e)})`)}:void 0;return fI(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=fT(e.left,t),n=fw(e.right,t);if(r&&n&&tQ(r.value,n.value)&&fE[r.operator]===n.operator&&fA(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=fT(e.right,t),a=fw(e.left,t);if(o&&a&&tQ(o.value,a.value)&&fE[o.operator]===a.operator&&fA(a.negativeThreshold,o.threshold))return{value:o.value,threshold:o.threshold,operator:o.operator}}(t,e);if(!r)return;let{value:n,threshold:o,operator:a}=r,i=fj(n)&&fj(o)?function*(r){yield oR(r,t,e),yield r.replaceText(t,`Math.abs(${fk(n,e)}) ${a} ${eZ(o,e)}`)}:void 0;return fI(t,e,i)})},meta:{type:"suggestion",docs:{description:"Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.",recommended:"unopinionated"},fixable:"code",messages:{[fh]:"Prefer `Math.abs()` to simplify this expression."},languages:["js/js"]}},"unicorn/prefer-split-limit":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!r.computed||!f$(r.object)||r2(r))return;let n=fB(r.property,t);if(void 0!==n)return fR(r,r.object,n,e)}),e.on("CallExpression",r=>{if(!td(r,{method:"at",argumentsLength:1}))return;let{object:n}=r.callee;if(!tc(r.callee)||!f$(n))return;let o=fB(r.arguments[0],t);if(void 0!==o)return fR(r,n,o,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[fF]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":fL,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=fK(e.left,t);if(r&&tQ(e.right,r.targetNode)&&!fq(e.right,t)){let n=fV({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return fJ({node:e,method:"padStart",replacement:n&&fG({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=fK(e.right,t);if(n&&tQ(e.left,n.targetNode)&&!fq(e.left,t)){let r=fV({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return fJ({node:e,method:"padEnd",replacement:r&&fG({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!td(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||"BinaryExpression"!==e.callee.object.type||"+"!==e.callee.object.operator)return;let{object:r}=e.callee,[n,o]=e.arguments,a=fz(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&fW(a.widthNode)&&tQ(a.widthNode,i)&&"Identifier"===r.right.type&&!fq(r.right,t)){let n=f_(a.paddingNode);return fX({node:e,method:"padStart",replacement:fG({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=fz(r.right,t);if(2===e.arguments.length&&s&&fW(n)&&0===n.value&&fW(s.widthNode)&&tQ(s.widthNode,o)&&"Identifier"===r.left.type&&!fq(r.left,t)){let n=f_(s.paddingNode);return fX({node:e,method:"padEnd",replacement:fG({method:"padEnd",targetNode:r.left,targetLengthNode:s.widthNode,...s},t),context:t,canSuggest:n})}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `String#padStart()` and `String#padEnd()` over manual string padding.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[fN]:"Prefer `String#{{method}}()` over manual string padding.",[fM]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":f2,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!e1(r)||!f8.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&tM(r.getScope(e)).some(t=>((e,t)=>{let r=e.block;for(;r&&r!==t;){if("FunctionDeclaration"===r.type||"FunctionExpression"===r.type)return!1;r=r.parent}return r===t})(t,e)&&t.references.some(({identifier:e})=>"arguments"===e.name)))return!1;let[n]=e.params;if(!n)return!0;if("Identifier"!==n.type)return!1;let o=t.sourceCode.getDeclaredVariables(e).find(e=>e.defs[0]?.name===n);if(!o)return!1;for(let{identifier:e}of o.references)if(f9(e)||!f5(e))return!1;return!0})(n,e))return;let a=((e,t,r)=>{if(!r){let r;return{fix:(r=t.arguments[1],t=>t.insertTextAfterRange(eH(r,e),", {passive: true}"))}}if(e2(r,!0)||e2(r,!1))return{fix:e=>e.replaceText(r,e2(r,!0)?"{capture: true, passive: true}":"{passive: true}")};if("ObjectExpression"!==r.type||r.properties.some(e=>"SpreadElement"===e.type||e.computed))return;let n=r.properties.findLast(e=>"Property"===e.type&&"passive"===(e=>{if(!e.computed){if("Identifier"===e.key.type)return e.key.name;if(e1(e.key))return e.key.value}})(e));if(!n)return{fix:((e,t)=>{let r=e.properties.at(-1);if(!r)return!1;let n=t.getLastToken(e);return t.getTokensBetween(r,n,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)})(r,e.sourceCode)?void 0:t=>{let{sourceCode:n}=e;if(0===r.properties.length)return t.replaceText(r,"{passive: true}");let o=r.properties.at(-1);if(n.getLoc(r).start.line===n.getLoc(r).end.line)return t.insertTextAfter(o,", passive: true");let a=n.getTokenAfter(o),i=t8(o,e);return","===a.value?t.insertTextAfter(a,`
24
+ ${c}`);let d=r.body.at(-1);"PropertyDefinition"===d.type&&";"!==t.getLastToken(d).value&&(c=`;${c}`),yield s.insertTextBefore(u,c)}return l?.value?u.suggest=[{messageId:c5,fix:p}]:u.fix=p,u})},meta:{type:"suggestion",docs:{description:"Prefer class field declarations over `this` assignments in constructors.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[c9]:"Prefer class field declaration over `this` assignment in constructor for static values.",[c5]:"Encountered same-named class field declaration and `this` assignment in constructor. Replace the class field declaration with the value from `this` assignment."},languages:["js/js"]}},"unicorn/prefer-bigint-literals":{create:e=>{e.on("CallExpression",t=>{if(!e7(t,{name:"BigInt",argumentsLength:1,optional:!1}))return;let[r]=t.arguments,n=function(e){let t,r;if(e1(e)){let t,r=e.raw.slice(1,-1);try{t=BigInt(r)}catch{return}let n=0n===t?"0":r.trim();return n.startsWith("+")&&(n=n.slice(1).trim()),{shouldUseSuggestion:r.includes("+"),text:`${n}n`,bigint:t}}let n=!1,o=!1;for(;"UnaryExpression"===e.type&&e.prefix;)if("+"===e.operator)n=!0,e=e.argument;else{if("-"!==e.operator)return;o=!o,e=e.argument}let{value:a,raw:i}=e;if(Number.isInteger(a)){try{t=BigInt(a)}catch{return}return(e=>{let t=e.raw.replaceAll("_","").toLowerCase();if(t.includes("."))return!1;let{value:r}=e;for(let{prefix:e,base:n}of[{prefix:"0b",base:2},{prefix:"0o",base:8},{prefix:"0x",base:16}])if(t.startsWith(e))return t.slice(2)===r.toString(n);return!t.includes("e")&&t===String(r)})(e)?r=`${i}n`:(r=`${t}n`,n=!0),o&&0n!==t&&(r=`-${r}`,t=-t),{shouldUseSuggestion:n,text:r,bigint:t}}}(r);if(!n)return;let o={node:t,messageId:c4},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!eZ(t,e)&&s<0n&&(n=`(${n})`,nQ(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:c7,data:{replacement:i.length<20?`\`${i}\``:"a bigint literal"},fix:l}]:o.fix=l,o})},meta:{type:"suggestion",docs:{description:"Prefer `BigInt` literals over the constructor.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[c4]:"Prefer using bigint literal over `BigInt(…)`.",[c7]:"Replace with {{replacement}}."},languages:["js/js"]}},"unicorn/prefer-classlist-toggle":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=[r.consequent,r.alternate].map(e=>{if(e)return"BlockStatement"===e.type&&1===e.body.length&&(e=e.body[0]),"ExpressionStatement"===e.type&&(e=e.expression),"ChainExpression"===e.type&&(e=e.expression),e});if(n.some(e=>!di(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&ds(o,a))return dn(r,function*(n){let i=eQ(o.callee.object.object,e),s=eQ(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=dl(p,u,o),d=c?"":da(p,e,u),m=o.callee.object.optional||a.callee.object.optional||c?.callee.object.optional,f=`${i}${m?"?":""}.classList.toggle(${s}${d?`, ${d}`:""})`;l||(f+=";"),nQ(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield o8(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>e1(e)&&("add"===e.value||"remove"===e.value))&&r[0].value!==r[1].value&&"MemberExpression"===t.parent.type&&t.parent.computed&&!t.parent.optional&&t.parent.property===t&&dr(t.parent.object)&&e7(t.parent.parent,{optional:!1,argumentsLength:1})&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return dn(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=dl(i,a,o)?"":da(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield o9(r,n,e,".toggle")},t)})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#classList.toggle()` to toggle class names.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[de]:"Prefer using `Element#classList.toggle()` to toggle class names.",[dt]:"Replace with `Element#classList.toggle()`."},languages:["js/js"]}},"unicorn/require-module-attributes":{create:e=>{let{sourceCode:t}=e;e.on(["ImportDeclaration","ExportNamedDeclaration","ExportAllDeclaration"],e=>{let{source:r,attributes:n}=e;if(!r||Array.isArray(n)&&n.length>0)return;let o=t.getTokenAfter(r);if(o?.type!=="Keyword"||"with"!==o.value)return;let a=t.getTokenAfter(o),i=t.getTokenAfter(a);return{node:e,loc:{start:t.getLoc(a).start,end:t.getLoc(i).end},messageId:du,data:{type:"ImportDeclaration"===e.type?"import statement":"export statement"},fix:e=>[o,i,a].map(t=>e.remove(t))}}),e.on("ImportExpression",r=>{let{options:n}=r;if(n?.type!=="ObjectExpression")return;let o=n.properties.find(e=>"Property"===e.type&&!e.method&&!e.shorthand&&!e.computed&&"init"===e.kind&&("Identifier"===e.key.type&&"with"===e.key.name||"Literal"===e.key.type&&"with"===e.key.value)&&ta(e.value)),a=0===n.properties.length||o&&1===n.properties.length?n:o;if(!a)return;let i="Property"===a.type;return{node:o?.value??a,messageId:du,data:{type:"import expression"},fix:r=>i?function*(e,t,r){let{sourceCode:n}=r;for(let r of n.getTokens(t))yield e.remove(r);let o=n.getTokenAfter(t);if(eu(o))yield e.remove(o);else{let{properties:r}=t.parent;if(r.length>1&&r.at(-1)===t){let r=n.getTokenBefore(t);yield e.remove(r)}}}(r,a,e):[t.getTokenBefore(a,eu),...t.getTokens(a),...eH(a,e)].map(e=>r.remove(e))}})},meta:{type:"suggestion",docs:{description:"Require non-empty module attributes for imports and exports",recommended:"unopinionated"},fixable:"code",messages:{[du]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of dS)e.on(["VariableDeclarator","AssignmentExpression"],r=>(function(e,t,{testValue:r,getProblematicNode:n,getProblem:o,getFix:a}){let i,s="AssignmentExpression"===t.type,[l,u]=(s?["left","right"]:["id","init"]).map(e=>t[e]);if(!("Identifier"===l.type&&r(u)))return;let p=t.parent;if(!(s&&"="===t.operator&&"ExpressionStatement"===p.type&&p.expression===t||!s&&"VariableDeclaration"===(i=t.parent).type&&i.declarations.at(-1)===t))return;let c=oT(p,e);if(c?.type!=="ExpressionStatement")return;let d="VariableDeclarator"===t.type?e.sourceCode.getDeclaredVariables(t).find(e=>1===e.defs.length&&e.defs[0].name===t.id):ei(e.sourceCode.getScope(t),t.left.name);if(!d)return;let m={context:e,variable:d,variableNode:l,valueNode:u,statement:p,nextExpressionStatement:c,assignType:s?"assignment":"declaration",getFix:a},f=n(m);if(f)return o(f,m)})(e,r,t))},meta:{type:"suggestion",docs:{description:"Disallow immediate mutation after variable assignment.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[dp]:"Immediate mutation on {{objectType}} is not allowed.",[dc]:"{{operation}} the elements to the {{assignType}}.",[dd]:"Move this property to the {{assignType}}.",[dm]:"{{description}} the {{assignType}}.",[df]:"Move the element to the {{assignType}}.",[dg]:"Move the entry to the {{assignType}}."},languages:["js/js"]}},"unicorn/no-useless-collection-argument":{create:e=>{e.on("NewExpression",t=>{var r;let n;if(!te(t,{names:["Set","Map","WeakSet","WeakMap"],argumentsLength:1}))return;let[o]=t.arguments,a="LogicalExpression"===o.type&&"??"===o.operator,i=a?o.right:o,s=to(r=i)?"empty array":e0(r,"")?"empty string":e9(r)?"`null`":tb(r)?"`undefined`":void 0;if(!s)return;let l=!1;if(a)n=function*(t){let{sourceCode:r}=e,n=i.parent,{left:o}=n,a=eZ(o,e),[,s]=a?eY(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield oX(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>oY(t,i,e);let u={node:i,messageId:dD,data:{description:s}};return l?u.suggest=[{messageId:dv,fix:n}]:u.fix=n,u})},meta:{type:"suggestion",docs:{description:"Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[dD]:"The {{description}} is useless.",[dv]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!te(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(td(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:dC,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield o2(t,e,n);let[o]=r.arguments,a=eY(r,e),i=eY(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!eZ(t,e)&&eZ(t.callee,e)&&nQ(e.sourceCode.getTokenBefore(t),e,"(")&&(yield n.insertTextBefore(t,";"))}}})},meta:{type:"suggestion",docs:{description:"Prefer `Response.json()` over `new Response(JSON.stringify())`.",recommended:"unopinionated"},fixable:"code",messages:{[dC]:"Prefer using `Response.json(…)` over `JSON.stringify()`."},languages:["js/js"]}},"unicorn/filename-case":{create:e=>{let t=e.physicalFilename;if("<input>"===t||"<text>"===t)return;let r=e.options[0]||{},n=function(e){if(e.case)return[e.case];if(e.cases){let t=Object.keys(e.cases).filter(t=>e.cases[t]);return t.length>0?t:["kebabCase"]}return["kebabCase"]}(r),o=(r.ignore||[]).map(e=>c.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>dH[e].fn);e.on(rp,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=d.relative(r,d.resolve(r,t)))||".."===l||l.startsWith(`..${d.sep}`)||d.isAbsolute(l)?[d.basename(t)]:l.split(d.sep).filter(e=>"."!==e)),{basename:c,filename:m,middle:f,extension:g}=function(e,{multipleFileExtensions:t}){let r=d.extname(e),n=d.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".");Object.assign(o,{filename:e,middle:n.slice(e.length)})}return o}(p.at(-1),{multipleFileExtensions:a});if(p.some(e=>o.some(t=>t.test(e))))return;if(i)for(let e of p.slice(0,-1)){let t=function(e,t,r){let n,{leading:o,words:a}=d0(e);if(e.startsWith("$")||dY(a,r))return;let i=dQ(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:dU,data:{directory:e,chosenCases:d1(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),dV.format(n))}}}(e,n,s);if(t)return t}if(d_.has(c))return;let{leading:y,words:h}=d0(m);if(m.startsWith("$")||dY(h,s))return g!==g.toLowerCase()?{loc:{column:0,line:1},messageId:dq,data:{filename:m+f+g.toLowerCase(),extension:g}}:void 0;let x=dQ(h,s,{leading:y,trailing:f+g.toLowerCase()});return{loc:{column:0,line:1},messageId:dO,data:{chosenCases:d1(n),renamedFilenames:(u=x.map(e=>`\`${e}\``),dV.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:d2,defaultOptions:[],messages:{[dO]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[dU]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[dq]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tx(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:d3,fix:r=>ar(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[d3]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(te(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||te(t,{names:rE,minimumArguments:1}))||!mn(t.arguments[0]))return;let r=t.arguments[0],n=mo(r,e);return{node:r.callee.property,messageId:d8,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n}}}),e.on("CallExpression",t=>((e,t)=>{if(!td(e,{objects:["Array",...rE],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mn(e.arguments[0]))return;let r=e.arguments[0],n=mo(r,t);return{node:r.callee.property,messageId:d8,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n}}})(t,e)??((e,t)=>{if(!td(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mn(e.arguments[0]))return;let r=e.arguments[0],n=mo(r,t);return{node:r.callee.property,messageId:d8,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n}}})(t,e)??((e,t)=>{if(!td(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!mn(e.arguments[0]))return;let r=e.arguments[0],n=ma(r,t,d7);return{node:r.callee.property,messageId:d8,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{if(!(td(e,{methods:mt,maximumArguments:1,optionalCall:!1,optionalMember:!1})||td(e,{method:mr,argumentsLength:2,optionalCall:!1,optionalMember:!1}))||!mn(e.callee.object))return;let r=e.arguments[0],n=e.callee.property.name,o=n===mr;if(r&&("ArrowFunctionExpression"===r.type||"FunctionExpression"===r.type)&&(r.params.length>(o?3:2)||r.params.at(-1)?.type==="RestElement"))return;let a=e.callee.object,i=ma(a,t,me,{method:n});return{node:a.callee.property,messageId:d4,data:{method:n},...i&&{suggest:[i]}}})(t,e)),e.on("ForOfStatement",t=>{if(!mn(t.right))return;let r=mo(t.right,e);return{node:t.right.callee.property,messageId:d6,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!mn(t.argument))return;let r=mo(t.argument,e);return{node:t.argument.callee.property,messageId:d9,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!mn(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=mo(t.argument,e);return{node:t.argument.callee.property,messageId:d5,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[d8]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[d6]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[d9]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[d5]:"Spread works on iterables, `.toArray()` is unnecessary.",[d4]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[d7]:"Remove `.toArray()`.",[me]:"Remove `.toArray()` and use `Iterator#{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-simple-condition-first":{create:e=>{let{sourceCode:t}=e;e.on("LogicalExpression",r=>{if("&&"!==r.operator&&"||"!==r.operator||!mu(r.right)||mu(r.left)||"ConditionalExpression"!==r.left.type||!function e(t){let{parent:r}=t;return!!r&&("IfStatement"===r.type&&r.test===t||"WhileStatement"===r.type&&r.test===t||"DoWhileStatement"===r.type&&r.test===t||"ForStatement"===r.type&&r.test===t||"ConditionalExpression"===r.type&&r.test===t||"UnaryExpression"===r.type&&"!"===r.operator||"LogicalExpression"===r.type&&e(r))}(r)||function e(t){if(!t||"object"!=typeof t)return!1;if(mp.has(t.type)||"MemberExpression"===t.type||"BinaryExpression"===t.type&&("in"===t.operator||"instanceof"===t.operator))return!0;for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){if(n.some(t=>e(t)))return!0}else if(n&&"string"==typeof n.type&&e(n))return!0}return!1}(r.left)||function e(t){if(!t||"object"!=typeof t)return!1;if("CallExpression"===t.type||"NewExpression"===t.type)return!0;for(let[r,n]of Object.entries(t))if("parent"!==r){if(Array.isArray(n)){if(n.some(t=>e(t)))return!0}else if(n&&"string"==typeof n.type&&e(n))return!0}return!1}(r.left))return;let n=mc(r.right,e,{operator:r.operator,property:"left"}),o=mc(r.left,e,{operator:r.operator,property:"right"}),a=t.getTokensBetween(r.left,r.right,{includeComments:!0}).some(e=>eg(e))?void 0:t=>t.replaceTextRange([eY(r.left,e)[0],eY(r.right,e)[1]],`${n} ${r.operator} ${o}`);return"LogicalExpression"===r.left.type&&r.left.operator===r.operator?{node:r,loc:t.getLoc(r.right),messageId:mi,data:{operator:r.operator},...a&&{suggest:[{messageId:ms,fix:a}]}}:{node:r,loc:t.getLoc(r.right),messageId:mi,data:{operator:r.operator},...a&&{fix:a}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mi]:"Prefer simple condition first in `{{operator}}` expression.",[ms]:"Swap conditions."},languages:["js/js"]}},"unicorn/switch-case-break-position":{create:e=>{let{sourceCode:t}=e;e.on("SwitchCase",r=>{let{consequent:n}=r;if(n.length<2)return;let o=n.at(-1);if(!mm.has(o.type))return;let a=n.slice(0,-1);if(1!==a.length||"BlockStatement"!==a[0].type)return;let i=a[0];if(0===i.body.length)return;let s=function(e){switch(e.type){case"BreakStatement":return"break";case"ReturnStatement":return"return";case"ContinueStatement":return"continue";case"ThrowStatement":return"throw"}}(o);return{node:o,loc:t.getLoc(o),messageId:md,data:{keyword:s},..."ReturnStatement"!==o.type&&"ThrowStatement"!==o.type&&{*fix(r){let n=t.getLastToken(i);if(t.getTokensBetween(n,o,{includeComments:!0}).some(e=>eg(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||re(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=t6(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
25
+ ${u}${l}`);let c=t.getRange(n)[1],d=t.getRange(o)[1];yield r.removeRange([c,d])}}}})},meta:{type:"layout",docs:{description:"Enforce consistent `break`/`return`/`continue`/`throw` position in `case` clauses.",recommended:!0},fixable:"code",messages:{[md]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(mC(e)){if(mv(e.object,"childNodes"))return"childNodes";if(mv(e.object,"children"))return"children"}})(t);if(!n||nL(t.object.object)||"children"===n&&mv(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tc(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&mv(t.parent,"children")&&mC(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:mf,suggest:mT(t,"firstChild",mb,e)}:"children"===n&&0===o?{node:t,messageId:mg,suggest:mT(t,"firstElementChild",mE,e)}:"children"===n?{node:t,messageId:my}:void 0}),e.on("MemberExpression",e=>{if(!(!mw(e)||!mw(e.object)||!(!mw(e.parent)||e.parent.object!==e)||nL((e=>{for(;mw(e);)e=e.object;return e})(e))))return{node:e,messageId:mh}}),e.on("CallExpression",t=>{if(!mI(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&mI(t.parent.parent)&&mk(t.parent.parent.arguments[0])||(e=>{for(;e.parent?.type==="MemberExpression"&&e.parent.object===e||e.parent?.type==="CallExpression"&&e.parent.callee===e;)e=e.parent;return e.parent?.type==="ChainExpression"})(t))return;let r=(e=>{let t=[];for(;mI(e);){let[r]=e.arguments;if(!mk(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||nL(e))return;let r=[];for(let e of t)r.unshift(e3(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:mx,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(mA(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=eQ(t.root,r),s=`${"Identifier"===(n=t.root).type&&"document"===n.name||"MemberExpression"===n.type&&!n.computed&&"Identifier"===n.object.type&&["globalThis","window"].includes(n.object.name)&&"Identifier"===n.property.type&&"document"===n.property.name?"":":scope "}${t.selectors.join(" ")}`,l=`${i}.querySelector(${tB(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:mS,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[mf]:"Prefer `.firstChild` over `.childNodes[0]`.",[mg]:"Prefer `.firstElementChild` over `.children[0]`.",[my]:"Consider `.querySelector()` over positional child traversal.",[mh]:"Consider `.closest()` over chaining `.parentElement`.",[mx]:"Consider merging chained `.querySelector()` calls.",[mb]:"Switch to `.firstChild`.",[mE]:"Switch to `.firstElementChild`.",[mS]:"Merge the `.querySelector()` calls."},languages:["js/js"]}},"unicorn/consistent-compound-words":{create:e=>{let t=(({checkProperties:e=!1,checkVariables:t=!0,checkDefaultAndNamespaceImports:r="internal",checkShorthandImports:n="internal",checkShorthandProperties:o=!1,extendDefaultReplacements:a=!0,replacements:i={},allowList:s={}}={})=>{let l=new Map(Object.entries(a?{...m$,...i}:i).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:r,checkShorthandImports:n,checkShorthandProperties:o,replacements:l,replacementRegExp:l.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(mM(n)),r.push(mM(ow(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${mO}`,"gv")})(l):void 0,allowList:new Set(Object.keys(s))}})(e.options[0]),r=new WeakMap,n=new WeakMap,o=(e,t)=>t.every(t=>{let r=n.get(t);return!r||!r.has(e)}),a=e=>{if((e=>{if(1!==e.defs.length)return!1;let[t]=e.defs;return"ClassName"===t.type})(e)){if("class"===e.scope.type){let[t]=e.defs,n=r.get(t.name);return n?i({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...n.references]}):i(e)}let[t]=e.defs;return void r.set(t.name,e)}return i(e)},i=r=>{var a;if(0===r.defs.length)return;let i=mU(r.name,t);if(!i)return;let[s]=r.defs;if(!(!("ImportDefaultSpecifier"===(a=s.name).parent.type&&a.parent.local===a||"ImportNamespaceSpecifier"===a.parent.type&&a.parent.local===a||"ImportSpecifier"===a.parent.type&&a.parent.local===a&&"Identifier"===a.parent.imported.type&&"default"===a.parent.imported.name||"VariableDeclarator"===a.parent.type&&a.parent.id===a&&tg(a.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||mB(s)))||!(!nz(s.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||mB(s)))||!t.checkShorthandProperties&&nJ(s.name))return;let l=[...r.references.map(e=>e.from),r.scope],u=mL(i)?tJ(i,l,o):void 0,p=mq(s.name,u??i);if(u&&rd(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!mj.has(e.parent.type)&&e.parent.id===e&&"ExportNamedDeclaration"===e.parent.parent.type)&&"JSXIdentifier"!==e.type)&&r.references.every(e=>!e.vueUsedInTemplate)){for(let e of l)n.has(e)||n.set(e,new Set),n.get(e).add(u);p.suggest=[{messageId:mP,data:{replacement:u},fix:t=>at(r,u,e,t)}]}e.report(p)},s=e=>{for(let t of e.variables)a(t)},l=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=mU(r.name,t);if(!n||"ExportSpecifier"===r.parent.type||(t.checkVariables||("TSParameterProperty"===r.parent.type?r.parent.parameter!==r:"AssignmentPattern"!==r.parent.type||r.parent.left!==r||"TSParameterProperty"!==r.parent.parent.type||r.parent.parent.parameter!==r.parent))&&!("MemberExpression"===r.parent.type&&r.parent.property===r&&!r.parent.computed&&("AssignmentExpression"===r.parent.parent.type&&r.parent.parent.left===r.parent||"UpdateExpression"===r.parent.parent.type&&r.parent.parent.argument===r.parent)||"Property"===r.parent.type&&r.parent.key===r&&!r.parent.computed&&!r.parent.shorthand&&"ObjectExpression"===r.parent.parent.type||"ExportSpecifier"===r.parent.type&&r.parent.exported===r&&r.parent.local!==r||mF.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=mq(r,n);e.report(o)};e.on("Identifier",l),e.on("PrivateIdentifier",l),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of tO(e.sourceCode.getScope(r)))s(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:mW,defaultOptions:[{}],messages:{[mR]:"Prefer `{{replacement}}` over `{{name}}`.",[mP]:"Rename to `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-blob-to-file":{create:e=>{e.on("VariableDeclarator",t=>(function(e,t){let{sourceCode:r}=t,{id:n,init:o}=e;if("Identifier"!==n.type||"VariableDeclaration"!==e.parent.type||"const"!==e.parent.kind||1!==e.parent.declarations.length||"Program"!==e.parent.parent.type&&"BlockStatement"!==e.parent.parent.type)return;let a=function(e,t){if(!te(e,{name:"File",minimumArguments:2,maximumArguments:2})||!mz(e.callee,t))return;let[r]=e.arguments,[,n]=e.arguments;if("ArrayExpression"!==r.type||1!==r.elements.length||r.elements[0]?.type==="SpreadElement"||void 0===e3(n))return;let[o]=r.elements;if(function(e,t,r){let n=mK(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(te(o,{name:"Blob",maximumArguments:1})||te(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&mz(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=ei(r.getScope(n),n);if(!i)return;let s=rd(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return td(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&mz(n.callee.object,t)?{call:n,kind:"blobArgument"}:td(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=mK(n.callee.object,t)?.init,te(r,{name:"FormData",argumentsLength:0})&&mz(r.callee,t))?{call:n,kind:"formData"}:void 0}(l,t);if(!u)return;let p=function(e){let[,t]=e.arguments;return t}(o);if(!(!function(e,t,r){if("Identifier"!==e.type)return!0;let{sourceCode:n}=r;return ei(n.getScope(e),e)===ei(n.getScope(t),e)}(a,l,t)||function(e,t){let{sourceCode:r}=t;return r.getCommentsInside(e).length>0||r.getCommentsBefore(e).some(t=>r.getLoc(t).end.line===r.getLoc(e).start.line||r.getLoc(t).end.line===r.getLoc(e).start.line-1)||re(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:m_,suggest:[{messageId:mV,*fix(n){yield o7(e.parent,t,n),yield n.replaceText(l,r.getText(a)),"formData"===u.kind&&2===u.call.arguments.length&&(yield n.insertTextAfter(l,`, ${r.getText(p)}`))}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Blob` to `File` conversion.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[m_]:"Use the original `Blob` instead of converting it to a `File`.",[mV]:"Replace the `File` with the original `Blob`."},languages:["js/js"]}},"unicorn/no-canvas-to-image":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{var r,n,o;if(!td(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=mX(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&td(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?mH(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&mH(o.property.name))))return{node:a,messageId:mG}}),e.on("CallExpression",e=>{if(!td(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&td(mX(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:mG}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[mG]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=of(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?mY:-1===Math.trunc(of(e))&&0===r?mQ:void 0}(t.arguments);if(!r)return;let n={node:t.callee.property,messageId:r,data:{method:t.callee.property.name}},o=function(e,t,r){let{sourceCode:n}=r,{object:o,property:a}=e.callee,[i,,s]=e.arguments,l=a.name,u=eQ(o,r),p=n.getText(i),c=n.getText(s);if(t===mY){if(m2(e,n))return;if("toSpliced"===l){var d,m;if(0>Math.trunc(of(i))||(d=i,m=o,d=ry(d),m=ry(m),"MemberExpression"===d.type&&!d.optional&&!d.computed&&"Identifier"===d.property.type&&"length"===d.property.name&&lq(d.object,m)))return;return{messageId:mZ,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&m1(o)&&(of(i)??0)>=0?{messageId:mZ,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===mQ&&m1(o)&&!m2(i,n))return{messageId:m0,fix:e=>e.replaceText(i,`Math.max(${u}.length - 1, 0)`)}}(t,r,e);return o&&(n.suggest=[o]),n})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#{splice,toSpliced}()`.",recommended:!0},hasSuggestions:!0,messages:{[mY]:"Prefer a direct element replacement instead of `{{method}}()`.",[mQ]:"Avoid using `{{method}}()` to insert at `-1`.",[mZ]:"Use direct element replacement.",[m0]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!te(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return t8(n.elements,e).map(e=>({node:e??n,messageId:m3,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[m3]:"Remove duplicate value `{{value}}` from the Set."},languages:["js/js"]}},"unicorn/no-incorrect-query-selector":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!ft(r)||fn(r))return;let n=r.object;if(!fo(r,n,t,e))return fs(r,n,e)}),e.on("CallExpression",r=>{let n;if(fr(r)){if(fn(r))return;let n=r.callee.object;if(fo(r,n,t,e))return;return fs(r,n,e)}let o=fi(r,e);if(o)return o;if(fe(r)&&!(ft(n=r.parent)||fr(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&fr(r.parent.parent))){let e;if(e=e3(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:m6}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(fu(e,fe,r))return{node:e,messageId:m5}})(r,e)??((e,t)=>{let r=fu(e,m7,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tb(r.value))return{node:e,messageId:m4}})(r,t)),e.on("Identifier",t=>fi(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[m8]:"Prefer `.querySelector()` when only the first match is used.",[m6]:"Prefer `.querySelector()` for a simple ID selector.",[m9]:"Check `.length` instead of the `NodeList` object itself.",[m5]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[m4]:"Compare the result of `.querySelector()` with `null` instead of `undefined`."},languages:["js/js"]}},"unicorn/no-invalid-file-input-accept":{create:e=>{e.on("JSXOpeningElement",t=>{if("input"!==fx(t.name))return;let r=((e,t)=>{if(t?.value){if(e1(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return fE(e,t.value.expression)}})(e,fb(t,"type"));if(r?.toLowerCase()!=="file")return;let n=fb(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(e1(t.value))return{node:t.value,value:t.value.value,fixable:!0};if("JSXExpressionContainer"!==t.value.type)return{node:t.value,dynamic:!0};let r=fE(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return fw({valueInfo:o,fix:t=>r=>{let n;return n=o.node,r.replaceTextRange([e.sourceCode.getRange(n)[0]+1,e.sourceCode.getRange(n)[1]-1],t)}})}),e.on("Tag",t=>{if("input"!==t.name.toLowerCase())return;let r=fT(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=fT(e,t,r);if(!n)return;let o=t.attributes.find(e=>"Attribute"===e.type&&e.key?.value?.toLowerCase()===r);return n.missing?{node:o??t,missing:!0}:o?.value?.parts?.length>0?{node:o.value,dynamic:!0}:fg.test(n.value)?void 0:{node:o?.value??t,value:n.value,fixable:!0,valueRange:n.valueRange,isReplacementFixable:e=>n.isQuoted||!/\s/v.test(e)}})(e,t,"accept");if(n)return fw({valueInfo:n,fix:e=>t=>t.replaceTextRange(n.valueRange,e)})})},meta:{type:"problem",docs:{description:"Disallow invalid `accept` values on file inputs.",recommended:!1},fixable:"code",messages:{[fp]:"Invalid file input `accept` value: {{reason}}",[fc]:"The file input `accept` value must be static.",[fd]:"Prefer `{{replacement}}` as the file input `accept` value."},languages:["js/js","html/html"]}},"unicorn/no-late-current-target-access":{create:e=>{let{sourceCode:t}=e,r=fF(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tc(e,{property:"currentTarget"})||!fk.test(e.object.name))return;let n=ei(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=fI(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?fR:fB,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[fB]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[fR]:"`{{name}}.currentTarget` is `null` inside this nested function. It is only set during synchronous event dispatch; save it to a variable in the outer function."},languages:["js/js"]}},"unicorn/no-unnecessary-nested-ternary":{create:e=>{let{sourceCode:t}=e;e.on("ConditionalExpression",r=>{let{test:n,consequent:o,alternate:a}=r;return"ConditionalExpression"===o.type&&fL(o.alternate,a,t)?fM(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&fL(o,a.consequent,t)?fM(e,r,{left:n,operator:"||",right:a.test,consequent:o,alternate:a.alternate}):void 0})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary nested ternary expressions.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[fP]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{var r,n,o;let a,i,s="MemberExpression"===t.callee.type?eI(r=t.callee,e.sourceCode.getScope(r)):void 0;if(!(!fU.has(s)||!(e=>{for(;;){if(nX(e))return!0;let{parent:t}=e;if("ForStatement"===t.type&&(t.init===e||t.update===e))return!0;if("ChainExpression"!==t.type&&"AwaitExpression"!==t.type&&"TSAsExpression"!==t.type&&"TSTypeAssertion"!==t.type&&"TSNonNullExpression"!==t.type&&"TSSatisfiesExpression"!==t.type)return!1;e=t}})(t)||(n=t.callee.object,fq.has(s)?!rY(n,e):(o=function e(t,r,n=new Set){if(!t||t===f_||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=function(e,t){if("Identifier"===e.type)return ei(t.sourceCode.getScope(e),e)}(e,t);if(!r)return;if(1!==r.defs.length||function(e,t,r){if(!e)return!1;let[n]=r.sourceCode.getRange(t);return e.references.some(e=>!e.init&&e.isWrite()&&r.sourceCode.getRange(e.identifier)[0]<n)}(r,e,t))return f_;let[n]=r.defs;return"Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&n.node.init&&"VariableDeclaration"===n.parent.type?n.node.init:f_}(t,r);return o===f_?o:void 0===o?t:e(o,r,n)}if(["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type))return e(t.expression,r,n);if("MemberExpression"===t.type)return f_;if("TSAsExpression"===t.type||"TSTypeAssertion"===t.type){let{typeAnnotation:e}=t;return"TSTypeOperator"===e.type&&"readonly"===e.operator&&(e=e.typeAnnotation),"TSArrayType"===e.type||"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?t:f_}return t}(o=n,e))===f_||((e,t)=>fz(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&"Identifier"===e.callee.type&&!fz(e.callee,"Array",t)||"CallExpression"===e.type&&"Identifier"===e.callee.type&&fV.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))(o,e)||"Identifier"===(a=o).type&&fW.test(a.name)&&!("ArrayExpression"===(i=o).type||("CallExpression"===i.type||"NewExpression"===i.type)&&fz(i.callee,"Array",e)))))return{node:t.callee.property,messageId:fO,data:{method:s}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[fO]:"Do not ignore the return value of `.{{method}}(…)`."},languages:["js/js"]}},"unicorn/prefer-array-last-methods":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!td(r,{methods:fJ.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!td(n,{methods:fX,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=fJ.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:fK,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:fG,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield o4(t,n,e)}}]),s})},meta:{type:"suggestion",docs:{description:"Prefer last-oriented array methods over `Array#reverse()` or `Array#toReversed()` followed by a method.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[fK]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[fG]:"Replace `.{{reversingMethod}}().{{method}}()` with `.{{replacement}}()`."},languages:["js/js"]}},"unicorn/prefer-math-abs":{create:e=>{e.on("ConditionalExpression",t=>{let r=function(e,t){let r=function(e,t){if(!("BinaryExpression"!==e.type||!fY.has(e.operator)||f3(e.left,t)||f3(e.right,t))){if(e0(e.right,0))return{value:e.left,operator:e.operator};if(e0(e.left,0))return{value:e.right,operator:fQ[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&f8(a,n)&&t0(i,n)||(">"===o||">="===o)&&t0(a,n)&&f8(i,n))return n}(t,e);if(!r)return;let n=f7(r)?function*(n){yield o8(n,t,e),yield n.replaceText(t,`Math.abs(${f5(r,e)})`)}:void 0;return f4(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=f6(e.left,t),n=f9(e.right,t);if(r&&n&&t0(r.value,n.value)&&fZ[r.operator]===n.operator&&f8(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=f6(e.right,t),a=f9(e.left,t);if(o&&a&&t0(o.value,a.value)&&fZ[o.operator]===a.operator&&f8(a.negativeThreshold,o.threshold))return{value:o.value,threshold:o.threshold,operator:o.operator}}(t,e);if(!r)return;let{value:n,threshold:o,operator:a}=r,i=f7(n)&&f7(o)?function*(r){yield o8(r,t,e),yield r.replaceText(t,`Math.abs(${f5(n,e)}) ${a} ${eQ(o,e)}`)}:void 0;return f4(t,e,i)})},meta:{type:"suggestion",docs:{description:"Prefer `Math.abs()` over manual absolute value expressions and symmetric range checks.",recommended:"unopinionated"},fixable:"code",messages:{[fH]:"Prefer `Math.abs()` to simplify this expression."},languages:["js/js"]}},"unicorn/prefer-split-limit":{create:e=>{let{sourceCode:t}=e;e.on("MemberExpression",r=>{if(!r.computed||!gr(r.object)||nr(r))return;let n=gt(r.property,t);if(void 0!==n)return gn(r,r.object,n,e)}),e.on("CallExpression",r=>{if(!td(r,{method:"at",argumentsLength:1}))return;let{object:n}=r.callee;if(!tc(r.callee)||!gr(n))return;let o=gt(r.arguments[0],t);if(void 0!==o)return gn(r,n,o,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[ge]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":ga,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=gg(e.left,t);if(r&&t0(e.right,r.targetNode)&&!gu(e.right,t)){let n=gm({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return gh({node:e,method:"padStart",replacement:n&&gy({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=gg(e.right,t);if(n&&t0(e.left,n.targetNode)&&!gu(e.left,t)){let r=gm({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return gh({node:e,method:"padEnd",replacement:r&&gy({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!td(e,{method:"slice",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||"BinaryExpression"!==e.callee.object.type||"+"!==e.callee.object.operator)return;let{object:r}=e.callee,[n,o]=e.arguments,a=gf(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&gc(a.widthNode)&&t0(a.widthNode,i)&&"Identifier"===r.right.type&&!gu(r.right,t)){let n=gd(a.paddingNode);return gx({node:e,method:"padStart",replacement:gy({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=gf(r.right,t);if(2===e.arguments.length&&s&&gc(n)&&0===n.value&&gc(s.widthNode)&&t0(s.widthNode,o)&&"Identifier"===r.left.type&&!gu(r.left,t)){let n=gd(s.paddingNode);return gx({node:e,method:"padEnd",replacement:gy({method:"padEnd",targetNode:r.left,targetLengthNode:s.widthNode,...s},t),context:t,canSuggest:n})}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `String#padStart()` and `String#padEnd()` over manual string padding.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[gi]:"Prefer `String#{{method}}()` over manual string padding.",[gs]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":gA,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!e1(r)||!gw.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&tO(r.getScope(e)).some(t=>((e,t)=>{let r=e.block;for(;r&&r!==t;){if("FunctionDeclaration"===r.type||"FunctionExpression"===r.type)return!1;r=r.parent}return r===t})(t,e)&&t.references.some(({identifier:e})=>"arguments"===e.name)))return!1;let[n]=e.params;if(!n)return!0;if("Identifier"!==n.type)return!1;let o=t.sourceCode.getDeclaredVariables(e).find(e=>e.defs[0]?.name===n);if(!o)return!1;for(let{identifier:e}of o.references)if(gI(e)||!gj(e))return!1;return!0})(n,e))return;let a=((e,t,r)=>{if(!r){let r;return{fix:(r=t.arguments[1],t=>t.insertTextAfterRange(eY(r,e),", {passive: true}"))}}if(e2(r,!0)||e2(r,!1))return{fix:e=>e.replaceText(r,e2(r,!0)?"{capture: true, passive: true}":"{passive: true}")};if("ObjectExpression"!==r.type||r.properties.some(e=>"SpreadElement"===e.type||e.computed))return;let n=r.properties.findLast(e=>"Property"===e.type&&"passive"===(e=>{if(!e.computed){if("Identifier"===e.key.type)return e.key.name;if(e1(e.key))return e.key.value}})(e));if(!n)return{fix:((e,t)=>{let r=e.properties.at(-1);if(!r)return!1;let n=t.getLastToken(e);return t.getTokensBetween(r,n,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)})(r,e.sourceCode)?void 0:t=>{let{sourceCode:n}=e;if(0===r.properties.length)return t.replaceText(r,"{passive: true}");let o=r.properties.at(-1);if(n.getLoc(r).start.line===n.getLoc(r).end.line)return t.insertTextAfter(o,", passive: true");let a=n.getTokenAfter(o),i=t6(o,e);return","===a.value?t.insertTextAfter(a,`
26
26
  ${i}passive: true,`):t.insertTextAfter(o,`,
27
- ${i}passive: true`)}};if(e2(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:f3,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[f3]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":gA,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=gB(r),i=gB(o);if(!a||!i)return;let s=gF(a.object),l=gF(i.object);if(g$(s)&&g$(l)&&tQ(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:gT,...gR(i,t)&&{suggest:[{messageId:gk,fix:e=>gL(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:gT,...gR(i,t)&&{suggest:[{messageId:gk,fix:e=>gL(i,t,e)}]}}:{node:i,messageId:gw,...gR(i,t)&&{suggest:[{messageId:gI,fix:e=>gP({memberExpression:i,context:t,fixer:e,replacement:i.computed?"?.[":"?."})}]}}}})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce consistent optional chaining for same-base member access.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[gT]:"Remove unnecessary optional chaining.",[gw]:"Use optional chaining consistently.",[gk]:"Remove optional chaining.",[gI]:"Use optional chaining."},languages:["js/js"]}},"unicorn/explicit-timer-delay":{create:e=>{let t=e.options[0],{sourceCode:r}=e;e.on("CallExpression",n=>{if(n.optional)return;let{isTimer:o,name:a}=((e,t)=>{let{callee:r}=e;if("Identifier"===r.type&&gU.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&gU.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&gW.has(e.name)&&t.isGlobalReference(e))return{isTimer:!0,name:r.property.name}}return{isTimer:!1}})(n,r);if(!o)return;let{arguments:i}=n,s=i.length>=2;if(t===gN&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:gO,data:{name:a},fix:r=>r.insertTextAfterRange(eH(t,e),", 0")}}if(t===gM&&2===i.length){let t=i[1];if(g_(t))return{node:t,messageId:gq,data:{name:a},fix(r){let[n]=i,[,o]=eH(n,e),[,a]=eH(t,e);return r.removeRange([o,a])}}}})},meta:{type:"suggestion",docs:{description:"Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.",recommended:"unopinionated"},fixable:"code",schema:[{enum:[gN,gM],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[gN],messages:{[gO]:"`{{name}}` should have an explicit delay argument.",[gq]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",e=>{var t,r,n,o;if(!td(e,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:a}=e.callee,[i]=e.arguments,s=(t=i,r=a,0>Math.trunc(n0(t))?gV:(n=t,o=r,n=rg(n),o=rg(o),"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"length"===n.property.name&&lg(n.object,o))?gz:void 0);if(s)return{node:e.callee.property,messageId:s}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[gV]:"Avoid using a negative index with `Array#with()`.",[gz]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=gX(t.right);if(td(r,{methods:gH,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a;return n=t=gX(t),td(n,{methods:gJ,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=gX(e)).type)return"Iterator"===e.name&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||"Iterator"!==e.property.name)return!1;let r=gX(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||td(o=t,{methods:gK,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||td(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||td(a=t,{methods:gG,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)}(r.callee.object,e))return{node:r.callee.property,messageId:gY,data:{loopKind:t.await?"for await…of":"for…of",method:r.callee.property.name}}})},meta:{type:"suggestion",docs:{description:"Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.",recommended:!0},messages:{[gY]:"Do not use `.{{method}}()` directly in a `{{loopKind}}` loop header. It creates an intermediate array before the loop."},languages:["js/js"]}},"unicorn/no-declarations-before-early-exit":{create:e=>{let{sourceCode:t}=e,r=n7(e);e.onExit("Program",e=>g8(t,e.body,r)),e.onExit("BlockStatement",e=>g8(t,e.body,r))},meta:{type:"suggestion",docs:{description:"Disallow declarations before conditional early exits when they are only used after the exit.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[gZ]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new WeakSet;e.on("ChainExpression",r=>{let n=function(e,t){let r=function e(t){return"MemberExpression"===(t=g5(t)).type?e(t.object)??(t.optional?t.object:void 0):"CallExpression"===t.type?e(t.callee)??(t.optional?t.callee:void 0):void 0}(e.expression);if(!r)return;let n=function(e){for(e=g5(e);"MemberExpression"===e.type;)e=g5(e.object);return"Identifier"===e.type?e:void 0}(r);if(n&&function(e,t){let r=t.sourceCode.getScope(e);for(;r;){let t=r.set.get(e.name);if(t&&(0===t.defs.length||t.defs.some(e=>!g9(e))))return!1;r=r.upper}return!0}(n,t))return n}(r,e);if(!(!n||t.has(n)))return t.add(n),{node:n,messageId:g6,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[g6]:"Optional chaining on undeclared variable `{{name}}` throws a ReferenceError."},languages:["js/js"]}},"unicorn/no-object-methods-with-collections":{create:e=>{e.on("CallExpression",t=>((e,t)=>{let r,{callee:n}=e;if(1!==e.arguments.length||e.optional||"MemberExpression"!==n.type||n.optional||n.computed||"Identifier"!==n.object.type||"Object"!==n.object.name||!yp(n.object,t)||"Identifier"!==n.property.type||!yn.has(n.property.name))return;let[o]=e.arguments,a=((e,t)=>{let r=ym(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(ye.has(e)){n=!0;continue}if(yt.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"})(o,t);if(!a)return;let i=n.property.name,s=`${(r=eZ(o,t),n1(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:g4,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:g7,data:{replacement:s},fix:t=>t.replaceText(e,`Array.from(${s})`)}]),l})(t,e))},meta:{type:"problem",docs:{description:"Disallow `Object` methods with `Map` or `Set`.",recommended:!0},hasSuggestions:!0,messages:{[g4]:"`Object.{{method}}()` does not return {{type}} contents.",[g7]:"Use `Array.from({{replacement}})`."},languages:["js/js"]}},"unicorn/no-subtraction-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n,o;if(!yh.has(r.operator))return;if(e0(r.right,0)&&yb(r.left))n=r.left,o=r.operator;else{if(!(e0(r.left,0)&&yb(r.right)))return;n=r.right,o=yy[r.operator]}let a={node:r,messageId:yf};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${eZ(i,e)} ${o} ${eZ(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(yx.has(o)?nt(i,p)&&nt(s,p):yE(i,p)&&yE(s,p))?a.fix=u:a.suggest=[{messageId:yg,data:{replacement:l},fix:u}],a})},meta:{type:"suggestion",docs:{description:"Prefer comparing values directly over subtracting and comparing to `0`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[yf]:"Prefer comparing the values directly over comparing the difference with `0`.",[yg]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unnecessary-global-this":{create:e=>{e.on("MemberExpression",t=>{var r,n,o;let a,i,s=function(e){for(;yS.has(e.type);)e=e.expression;return e}(t.object),l=yv(t);if("Identifier"!==s.type||"globalThis"!==s.name||!nB(s,e)||r2(r=l)||("ForInStatement"===(a=r).parent.type||"ForOfStatement"===a.parent.type)&&a.parent.left===a||ry(n=t)||("MemberExpression"===(n=yv(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n))return;let u=t.computed?e1(t.property)?t.property.value:"TemplateLiteral"===t.property.type&&0===t.property.expressions.length?t.property.quasis[0].value.cooked:void 0:t.property.name;if("string"!=typeof u||!tP.isIdentifierName(u)||tP.isKeyword(u)||tP.isReservedWord(u,!0)||tP.isStrictReservedWord(u,!0)||"eval"===u&&yC(t)||(i=ei(e.sourceCode.getScope(t),u),i?.scope.type!=="global"||0!==i.defs.length))return;let p={node:t,messageId:yD,data:{name:u}};return yC(t)||"TaggedTemplateExpression"===(o=yv(o=t)).parent.type&&o.parent.tag===o||0!==e.sourceCode.getCommentsInside(t).length||(p.fix=e=>e.replaceText(t,u)),p})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `globalThis` references.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[yD]:"Use `{{name}}` directly instead of `globalThis.{{name}}`."},languages:["js/js"]}},"unicorn/no-unreadable-object-destructuring":{create:e=>{e.on("Property",e=>{if("ObjectPattern"===e.parent.type&&e.computed)return{node:e,messageId:yA}}),e.on("ArrayPattern",e=>{if(0!==yj(e))return{node:e,messageId:yT}}),e.on("ObjectPattern",e=>{if(3===yj(e))return{node:e,messageId:yw}}),e.on("MemberExpression",e=>{if(yI(e)?.type==="ObjectPattern")return{node:e,messageId:yk}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[yA]:"Do not use computed keys in object destructuring.",[yT]:"Do not use array destructuring inside object destructuring.",[yw]:"Do not use object destructuring deeper than two levels.",[yk]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=n7(e);e.onExit("IfStatement",n=>{if(!(n.alternate&&yB.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:yF,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(rn(o)||"BlockStatement"===o.type&&((e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>r.getLoc(e).start.line!==r.getLoc(e).end.line)})(o,e)||!((e,t)=>{let{sourceCode:r}=t,{alternate:n,consequent:o}=e,a="BlockStatement"===n.type?r.getTokenAfter(r.getFirstToken(n)):r.getFirstToken(n);if(!a)return!0;let i=r.getLastToken(o);if("BlockStatement"!==o.type&&";"!==i.value&&(nU(i,t,a.value)||yP(a))||((e,t)=>{let r=t.getTokenAfter(e);if(r&&t.getLoc(e).end.line===t.getLoc(r).start.line)return!0;let n=t.getCommentsAfter(e)[0];return!!(n&&t.getLoc(e).end.line===t.getLoc(n).start.line)})(n,r))return!1;let s="BlockStatement"===n.type?r.getTokenBefore(r.getLastToken(n)):r.getLastToken(n),l=r.getTokenAfter(n);return!(s&&";"!==s.value&&l&&(nU(s,t,l.value)||yP(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!re(e,[i[0],r.getRange(o)[0]]))return t.replaceTextRange(i,((e,t)=>{let{alternate:r}=e;if("BlockStatement"===r.type)return((e,t,r)=>{let n=r.getFirstToken(e),o=r.getLastToken(e),a=r.text.slice(r.getRange(n)[1],r.getRange(o)[0]);if(!a.includes("\n")){let e=a.trim();return e?`
28
- ${yR(r,r.getRange(t)[0])}${e}`:""}let i=a.split("\n");if(i[0]?.trim()===""&&i.shift(),i.at(-1)?.trim()===""&&i.pop(),0===i.length)return"";let s=r.getTokenAfter(n,{includeComments:!0}),l=yR(r,r.getRange(t)[0]),u=s&&s!==o?yR(r,r.getRange(s)[0]):l;return`
29
- ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=yR(t,t.getRange(e)[0]);return`
30
- ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[yF]:"Unexpected `else` after a statement that exits."},languages:["js/js"]}},"unicorn/no-useless-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ReturnStatement",e=>{if(((e,t)=>{var r;let n,{argument:o}=e;if(o?.type!=="CallExpression"||o.optional||"Identifier"!==o.callee.type)return!1;let a=(e=>{for(;e;e=e.parent)if(tl(e))return e})(e);return!!(a?.id&&!a.generator&&!((e,t)=>{for(;e&&e!==t;e=e.parent)if("TryStatement"===e.type)return!0;return!1})(e,a)&&!((e,t)=>{for(;e&&e!==t;e=e.parent){if(yO(e))return!0;if(e.parent?.type!=="BlockStatement")continue;let t=e.parent.body.indexOf(e);if(e.parent.body.slice(0,t).some(e=>yM(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=ei(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:yL}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[yL]:"Use a loop instead of this recursive function call."},languages:["js/js"]}},"unicorn/prefer-add-event-listener-options":{create:e=>{e.on("CallExpression",e=>{if(!td(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!e2(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:yq,data:{value:String(t.value),replacement:r},fix:e=>e.replaceText(t,r)}})},meta:{type:"suggestion",docs:{description:"Prefer an options object over a boolean in `.addEventListener()`.",recommended:"unopinionated"},fixable:"code",messages:{[yq]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["entries","keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1})||!(e=>{let{parent:t}=e;if("ForOfStatement"===t.type&&t.right===e||"YieldExpression"===t.type&&t.delegate&&t.argument===e||"SpreadElement"===t.type&&t.argument===e&&(e=>{let{parent:t}=e;return yY.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(te(t,{names:yJ,argumentsLength:1})||te(t,{names:rb,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(td(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||yZ(t,["from"])||td(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||td(t,{object:"Promise",methods:yX,argumentsLength:1,optionalCall:!1,optionalMember:!1}));return!1})(t))return;let r=t.callee.property.name;if(((e,t)=>{if(!t?.size)return!1;for(let r of t){let t=yG.get(r);if(!t?.includes(e))return!1}return!0})(r,y3(t.callee.object,e)))return{node:t.callee.property,messageId:yU,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>oM(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[yU]:"Prefer direct iteration instead of `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-number-is-safe-integer":{create:e=>{let{sourceCode:t}=e,r=(e,r)=>{let n,o={node:e,messageId:y9};return n=t.getRange(r),t.getCommentsInside(e).some(e=>{let r=t.getRange(e);return r[0]<n[0]||r[1]>n[1]})||(o.suggest=[{messageId:y5,fix:n=>{let o;return n.replaceText(e,`Number.isSafeInteger(${(o=t.getText(r),"SequenceExpression"===r.type?`(${o})`:o)})`)}}]),o};e.on("CallExpression",e=>{if(td(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:y8,suggest:[{messageId:y6,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(td(e,{objects:y4,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&he(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(e0(e.right,0))return ht(e.left);if(e0(e.left,0))return ht(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=hr(e.left,t);if(r&&tQ(r,e.right))return r;let n=hr(e.right,t);if(n&&tQ(n,e.left))return n})(e,t);if(n&&he(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[y8]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[y6]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[y9]:"Prefer `Number.isSafeInteger()` over this integer check.",[y5]:"Replace this integer check with `Number.isSafeInteger()`."},languages:["js/js"]}},"unicorn/prefer-object-define-properties":{create:e=>{let{sourceCode:t}=e;e.on("ExpressionStatement",r=>{let n=ha(r);if(!n)return;let o=ha(ot(r,e));if(o&&tQ(o.arguments[0],n.arguments[0]))return;let a=[r],i=[n],s=or(r,e);for(;;){let t=ha(s);if(!t||!tQ(n.arguments[0],t.arguments[0]))break;a.push(s),i.push(t),s=or(s,e)}if(i.length<2)return;let l={node:n.callee.property,messageId:ho},u=[t.getRange(a[0])[0],t.getRange(a.at(-1))[1]];return function(e,t){let r=new Set,n=[];for(let o of e){let e=o.arguments[1],a=function(e,t){let r=ew(e,t.getScope(e));if(r)return"symbol"==typeof r.value?r.value:String(r.value)}(e,t);if(void 0===a){if(n.some(t=>tQ(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(i,t)||t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=u[0]&&n<=u[1]})||(l.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=t8(o,r),s=`${i} `,l=n.getText(t[0].arguments[0]),u=t.map(e=>{let t=function(e,t){let r=t.getText(e);if("Literal"===e.type){if("string"==typeof e.value)return"__proto__"===e.value?`[${r}]`:hn(e.value)?e.value:r;if("number"==typeof e.value)return r}return`[${r}]`}(e.arguments[1],n),r=n.getText(e.arguments[2]).replaceAll("\n","\n ");return`${s}${t}: ${r},`}).join("\n");return e=>e.replaceTextRange([n.getRange(o)[0],n.getRange(a)[1]],`Object.defineProperties(${l}, {
27
+ ${i}passive: true`)}};if(e2(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:gT,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[gT]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":g8,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=yt(r),i=yt(o);if(!a||!i)return;let s=ye(a.object),l=ye(i.object);if(yr(s)&&yr(l)&&t0(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:g6,...yn(i,t)&&{suggest:[{messageId:g5,fix:e=>ya(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:g6,...yn(i,t)&&{suggest:[{messageId:g5,fix:e=>ya(i,t,e)}]}}:{node:i,messageId:g9,...yn(i,t)&&{suggest:[{messageId:g4,fix:e=>yo({memberExpression:i,context:t,fixer:e,replacement:i.computed?"?.[":"?."})}]}}}})(t,e))},meta:{type:"suggestion",docs:{description:"Enforce consistent optional chaining for same-base member access.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[g6]:"Remove unnecessary optional chaining.",[g9]:"Use optional chaining consistently.",[g5]:"Remove optional chaining.",[g4]:"Use optional chaining."},languages:["js/js"]}},"unicorn/explicit-timer-delay":{create:e=>{let t=e.options[0],{sourceCode:r}=e;e.on("CallExpression",n=>{if(n.optional)return;let{isTimer:o,name:a}=((e,t)=>{let{callee:r}=e;if("Identifier"===r.type&&yp.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&yp.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&yc.has(e.name)&&t.isGlobalReference(e))return{isTimer:!0,name:r.property.name}}return{isTimer:!1}})(n,r);if(!o)return;let{arguments:i}=n,s=i.length>=2;if(t===yi&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:yl,data:{name:a},fix:r=>r.insertTextAfterRange(eY(t,e),", 0")}}if(t===ys&&2===i.length){let t=i[1];if(yd(t))return{node:t,messageId:yu,data:{name:a},fix(r){let[n]=i,[,o]=eY(n,e),[,a]=eY(t,e);return r.removeRange([o,a])}}}})},meta:{type:"suggestion",docs:{description:"Enforce or disallow explicit `delay` argument for `setTimeout()` and `setInterval()`.",recommended:"unopinionated"},fixable:"code",schema:[{enum:[yi,ys],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[yi],messages:{[yl]:"`{{name}}` should have an explicit delay argument.",[yu]:"`{{name}}` should not have an explicit delay of `0`."},languages:["js/js"]}},"unicorn/no-confusing-array-with":{create:e=>{e.on("CallExpression",e=>{var t,r,n,o;if(!td(e,{method:"with",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let{object:a}=e.callee,[i]=e.arguments,s=(t=i,r=a,0>Math.trunc(of(t))?ym:(n=t,o=r,n=ry(n),o=ry(o),"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"length"===n.property.name&&lq(n.object,o))?yf:void 0);if(s)return{node:e.callee.property,messageId:s}})},meta:{type:"suggestion",docs:{description:"Disallow confusing uses of `Array#with()`.",recommended:!0},schema:[],messages:{[ym]:"Avoid using a negative index with `Array#with()`.",[yf]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=yx(t.right);if(td(r,{methods:yE,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a;return n=t=yx(t),td(n,{methods:yh,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=yx(e)).type)return"Iterator"===e.name&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||e.computed||"Identifier"!==e.property.type||"Iterator"!==e.property.name)return!1;let r=yx(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||td(o=t,{methods:yg,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||td(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||td(a=t,{methods:yy,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)}(r.callee.object,e))return{node:r.callee.property,messageId:yb,data:{loopKind:t.await?"for await…of":"for…of",method:r.callee.property.name}}})},meta:{type:"suggestion",docs:{description:"Disallow `.map()` and `.filter()` in `for…of` and `for await…of` loop headers.",recommended:!0},messages:{[yb]:"Do not use `.{{method}}()` directly in a `{{loopKind}}` loop header. It creates an intermediate array before the loop."},languages:["js/js"]}},"unicorn/no-declarations-before-early-exit":{create:e=>{let{sourceCode:t}=e,r=ov(e);e.onExit("Program",e=>yw(t,e.body,r)),e.onExit("BlockStatement",e=>yw(t,e.body,r))},meta:{type:"suggestion",docs:{description:"Disallow declarations before conditional early exits when they are only used after the exit.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[yS]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new WeakSet;e.on("ChainExpression",r=>{let n=function(e,t){let r=function e(t){return"MemberExpression"===(t=yj(t)).type?e(t.object)??(t.optional?t.object:void 0):"CallExpression"===t.type?e(t.callee)??(t.optional?t.callee:void 0):void 0}(e.expression);if(!r)return;let n=function(e){for(e=yj(e);"MemberExpression"===e.type;)e=yj(e.object);return"Identifier"===e.type?e:void 0}(r);if(n&&function(e,t){let r=t.sourceCode.getScope(e);for(;r;){let t=r.set.get(e.name);if(t&&(0===t.defs.length||t.defs.some(e=>!yI(e))))return!1;r=r.upper}return!0}(n,t))return n}(r,e);if(!(!n||t.has(n)))return t.add(n),{node:n,messageId:yk,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[yk]:"Optional chaining on undeclared variable `{{name}}` throws a ReferenceError."},languages:["js/js"]}},"unicorn/no-object-methods-with-collections":{create:e=>{e.on("CallExpression",t=>((e,t)=>{let r,{callee:n}=e;if(1!==e.arguments.length||e.optional||"MemberExpression"!==n.type||n.optional||n.computed||"Identifier"!==n.object.type||"Object"!==n.object.name||!n_(n.object,t)||"Identifier"!==n.property.type||!yR.has(n.property.name))return;let[o]=e.arguments,a=on(o,t);if(!a)return;let i=n.property.name,s=`${(r=eQ(o,t),og(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:yF,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:yB,data:{replacement:s},fix:t=>t.replaceText(e,`Array.from(${s})`)}]),l})(t,e))},meta:{type:"problem",docs:{description:"Disallow `Object` methods with `Map` or `Set`.",recommended:!0},hasSuggestions:!0,messages:{[yF]:"`Object.{{method}}()` does not return {{type}} contents.",[yB]:"Use `Array.from({{replacement}})`."},languages:["js/js"]}},"unicorn/no-subtraction-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n,o;if(!yN.has(r.operator))return;if(e0(r.right,0)&&yO(r.left))n=r.left,o=r.operator;else{if(!(e0(r.left,0)&&yO(r.right)))return;n=r.right,o=y$[r.operator]}let a={node:r,messageId:yP};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${eQ(i,e)} ${o} ${eQ(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(yM.has(o)?nc(i,p)&&nc(s,p):yU(i,p)&&yU(s,p))?a.fix=u:a.suggest=[{messageId:yL,data:{replacement:l},fix:u}],a})},meta:{type:"suggestion",docs:{description:"Prefer comparing values directly over subtracting and comparing to `0`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[yP]:"Prefer comparing the values directly over comparing the difference with `0`.",[yL]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unnecessary-global-this":{create:e=>{e.on("MemberExpression",t=>{var r,n,o,a;let i,s,l=y_(t.object),u=yV(t);if("Identifier"!==l.type||"globalThis"!==l.name||!n_(l,e)||nr(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||rh(n=t)||("MemberExpression"===(n=yV(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=yV(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!yK.has(t.operator))return!1;let r=y_(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tw(o)||tT(o,e))return;let p=t.computed?e1(t.property)?t.property.value:"TemplateLiteral"===t.property.type&&0===t.property.expressions.length?t.property.quasis[0].value.cooked:void 0:t.property.name;if("string"!=typeof p||!t$.isIdentifierName(p)||t$.isKeyword(p)||t$.isReservedWord(p,!0)||t$.isStrictReservedWord(p,!0)||"eval"===p&&yz(t)||(s=ei(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:yq,data:{name:p}};return yz(t)||"TaggedTemplateExpression"===(a=yV(a=t)).parent.type&&a.parent.tag===a||0!==e.sourceCode.getCommentsInside(t).length||(c.fix=e=>e.replaceText(t,p)),c})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `globalThis` references.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[yq]:"Use `{{name}}` directly instead of `globalThis.{{name}}`."},languages:["js/js"]}},"unicorn/no-unreadable-object-destructuring":{create:e=>{e.on("Property",t=>{if("ObjectPattern"===t.parent.type&&t.computed&&!(null===ew(t.key,e.sourceCode.getScope(t.key))&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:yG}}),e.on("ArrayPattern",e=>{if(0!==yQ(e))return{node:e,messageId:yJ}}),e.on("ObjectPattern",e=>{if(3===yQ(e))return{node:e,messageId:yX}}),e.on("MemberExpression",e=>{if(yY(e)?.type==="ObjectPattern")return{node:e,messageId:yH}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[yG]:"Do not use computed keys in object destructuring.",[yJ]:"Do not use array destructuring inside object destructuring.",[yX]:"Do not use object destructuring deeper than two levels.",[yH]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=ov(e);e.onExit("IfStatement",n=>{if(!(n.alternate&&y0.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:yZ,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(ro(o)||"BlockStatement"===o.type&&((e,t)=>{let{sourceCode:r}=t;return r.getTokens(e).some(e=>("JSXText"!==e.type||"JSXText"!==r.getNodeByRangeIndex(r.getRange(e)[0]).type)&&r.getLoc(e).start.line!==r.getLoc(e).end.line)})(o,e)||!((e,t)=>{let{sourceCode:r}=t,{alternate:n,consequent:o}=e,a="BlockStatement"===n.type?r.getTokenAfter(r.getFirstToken(n)):r.getFirstToken(n);if(!a)return!0;let i=r.getLastToken(o);if("BlockStatement"!==o.type&&";"!==i.value&&(nQ(i,t,a.value)||y3(a))||((e,t)=>{let r=t.getTokenAfter(e);if(r&&t.getLoc(e).end.line===t.getLoc(r).start.line)return!0;let n=t.getCommentsAfter(e)[0];return!!(n&&t.getLoc(e).end.line===t.getLoc(n).start.line)})(n,r))return!1;let s="BlockStatement"===n.type?r.getTokenBefore(r.getLastToken(n)):r.getLastToken(n),l=r.getTokenAfter(n);return!(s&&";"!==s.value&&l&&(nQ(s,t,l.value)||y3(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!rt(e,[i[0],r.getRange(o)[0]]))return t.replaceTextRange(i,((e,t)=>{let{alternate:r}=e;if("BlockStatement"===r.type)return((e,t,r)=>{let n=r.getFirstToken(e),o=r.getLastToken(e),a=r.text.slice(r.getRange(n)[1],r.getRange(o)[0]);if(!a.includes("\n")){let e=a.trim();return e?`
28
+ ${y2(r,r.getRange(t)[0])}${e}`:""}let i=a.split("\n");if(i[0]?.trim()===""&&i.shift(),i.at(-1)?.trim()===""&&i.pop(),0===i.length)return"";let s=r.getTokenAfter(n,{includeComments:!0}),l=y2(r,r.getRange(t)[0]),u=s&&s!==o?y2(r,r.getRange(s)[0]):l;return`
29
+ ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=y2(t,t.getRange(e)[0]);return`
30
+ ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[yZ]:"Unexpected `else` after a statement that exits."},languages:["js/js"]}},"unicorn/no-useless-recursion":{create:e=>{let{sourceCode:t}=e;e.on("ReturnStatement",e=>{if(((e,t)=>{var r;let n,{argument:o}=e;if(o?.type!=="CallExpression"||o.optional||"Identifier"!==o.callee.type)return!1;let a=(e=>{for(;e;e=e.parent)if(tl(e))return e})(e);return!!(a?.id&&!a.generator&&!((e,t)=>{for(;e&&e!==t;e=e.parent)if("TryStatement"===e.type)return!0;return!1})(e,a)&&!((e,t)=>{for(;e&&e!==t;e=e.parent){if(y5(e))return!0;if(e.parent?.type!=="BlockStatement")continue;let t=e.parent.body.indexOf(e);if(e.parent.body.slice(0,t).some(e=>y9(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=ei(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:y8}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[y8]:"Use a loop instead of this recursive function call."},languages:["js/js"]}},"unicorn/prefer-add-event-listener-options":{create:e=>{e.on("CallExpression",e=>{if(!td(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!e2(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:y4,data:{value:String(t.value),replacement:r},fix:e=>e.replaceText(t,r)}})},meta:{type:"suggestion",docs:{description:"Prefer an options object over a boolean in `.addEventListener()`.",recommended:"unopinionated"},fixable:"code",messages:{[y4]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["entries","keys","values"],argumentsLength:0,optionalCall:!1,optionalMember:!1})||!(e=>{let{parent:t}=e;if("ForOfStatement"===t.type&&t.right===e||"YieldExpression"===t.type&&t.delegate&&t.argument===e||"SpreadElement"===t.type&&t.argument===e&&(e=>{let{parent:t}=e;return hl.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(te(t,{names:hi,argumentsLength:1})||te(t,{names:rE,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(td(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||hp(t,["from"])||td(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||td(t,{object:"Promise",methods:hs,argumentsLength:1,optionalCall:!1,optionalMember:!1}));return!1})(t))return;let r=t.callee.property.name;if(((e,t)=>{if(!t?.size)return!1;for(let r of t){let t=ha.get(r);if(!t?.includes(e))return!1}return!0})(r,hg(t.callee.object,e)))return{node:t.callee.property,messageId:y7,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>o4(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[y7]:"Prefer direct iteration instead of `.{{method}}()`."},languages:["js/js"]}},"unicorn/prefer-number-is-safe-integer":{create:e=>{let{sourceCode:t}=e,r=(e,r)=>{let n,o={node:e,messageId:hx};return n=t.getRange(r),t.getCommentsInside(e).some(e=>{let r=t.getRange(e);return r[0]<n[0]||r[1]>n[1]})||(o.suggest=[{messageId:hb,fix:n=>{let o;return n.replaceText(e,`Number.isSafeInteger(${(o=t.getText(r),"SequenceExpression"===r.type?`(${o})`:o)})`)}}]),o};e.on("CallExpression",e=>{if(td(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:hy,suggest:[{messageId:hh,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(td(e,{objects:hE,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&hD(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(e0(e.right,0))return hv(e.left);if(e0(e.left,0))return hv(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=hC(e.left,t);if(r&&t0(r,e.right))return r;let n=hC(e.right,t);if(n&&t0(n,e.left))return n})(e,t);if(n&&hD(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[hy]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[hh]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[hx]:"Prefer `Number.isSafeInteger()` over this integer check.",[hb]:"Replace this integer check with `Number.isSafeInteger()`."},languages:["js/js"]}},"unicorn/prefer-object-define-properties":{create:e=>{let{sourceCode:t}=e;e.on("ExpressionStatement",r=>{let n=hw(r);if(!n)return;let o=hw(oA(r,e));if(o&&t0(o.arguments[0],n.arguments[0]))return;let a=[r],i=[n],s=oT(r,e);for(;;){let t=hw(s);if(!t||!t0(n.arguments[0],t.arguments[0]))break;a.push(s),i.push(t),s=oT(s,e)}if(i.length<2)return;let l={node:n.callee.property,messageId:hT},u=[t.getRange(a[0])[0],t.getRange(a.at(-1))[1]];return function(e,t){let r=new Set,n=[];for(let o of e){let e=o.arguments[1],a=function(e,t){let r=ew(e,t.getScope(e));if(r)return"symbol"==typeof r.value?r.value:String(r.value)}(e,t);if(void 0===a){if(n.some(t=>t0(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(i,t)||t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=u[0]&&n<=u[1]})||(l.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=t6(o,r),s=`${i} `,l=n.getText(t[0].arguments[0]),u=t.map(e=>{let t=function(e,t){let r=t.getText(e);if("Literal"===e.type){if("string"==typeof e.value)return"__proto__"===e.value?`[${r}]`:hA(e.value)?e.value:r;if("number"==typeof e.value)return r}return`[${r}]`}(e.arguments[1],n),r=n.getText(e.arguments[2]).replaceAll("\n","\n ");return`${s}${t}: ${r},`}).join("\n");return e=>e.replaceTextRange([n.getRange(o)[0],n.getRange(a)[1]],`Object.defineProperties(${l}, {
31
31
  ${u}
32
- ${i}});`)}(a,i,e)),l})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[ho]:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls."},languages:["js/js"]}},"unicorn/prefer-object-destructuring-defaults":{create:e=>{e.on("VariableDeclarator",t=>{let{id:r,init:n}=t;if("ObjectPattern"!==r.type||n?.type!=="ObjectExpression"||0!==e.sourceCode.getCommentsInside(t).length)return;let o=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(hp(n)&&"Identifier"===n.value.type))return;let e=eI(n,t.sourceCode.getScope(n));if(null===e||hl.has(e))return;r.push({node:n,name:e})}return r})(r,e),a=((e,t)=>{let{properties:r}=e,n=r.at(-1);if(n?.type!=="SpreadElement"||eP(n.argument,t.sourceCode,hu))return;let o=new Map;for(let e of r.slice(0,-1)){if(!hp(e)||eP(e.value,t.sourceCode,hu))return;let r=eI(e,t.sourceCode.getScope(e));if(null===r||o.has(r))return;o.set(r,e)}return{defaultProperties:o,spreadElement:n}})(n,e);if(!o||0===o.length||!a)return;let{defaultProperties:i,spreadElement:s}=a;if(o.length!==i.size)return;let l=new Set(o.map(e=>e.node.value.name)),u=[];for(let t of o){let r=i.get(t.name);if(!r||hc(r.value,l,e))return;u.push(hd(t,r,e))}return{node:t,messageId:hi,suggest:[{messageId:hs,fix:r=>r.replaceText(t,`{${u.join(", ")}} = {${e.sourceCode.getText(s)}}`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[hi]:"Prefer object destructuring defaults over default object literals with spread.",[hs]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>hy(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>hy(t,e.body)),e.on("SwitchCase",e=>hy(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[hm]:"Prefer a single object destructuring declaration from `{{source}}`."},languages:["js/js"]}},"unicorn/prefer-smaller-scope":{create:e=>{let{sourceCode:t}=e;e.on("VariableDeclaration",e=>(function(e,t){if(!(e.parent&&("Program"===e.parent.type||"BlockStatement"===e.parent.type)&&"let"===e.kind&&1===e.declarations.length&&"Identifier"===e.declarations[0].id.type&&!e.declarations[0].init))return;let[r]=e.declarations,[n]=t.getDeclaredVariables(r),o=n.references.filter(e=>!e.init),a=o.filter(e=>e.isWrite());if(1!==a.length||o.every(e=>!e.isRead()))return;let i=function(e){let{identifier:t}=e,r=t.parent;if("AssignmentExpression"!==r.type||"="!==r.operator||r.left!==t||"ExpressionStatement"!==r.parent.type)return;let n=r.parent,o=n.parent;if("BlockStatement"===o.type)return{assignmentExpression:r,assignmentStatement:n,block:o}}(a[0]);if(!i)return;let{assignmentExpression:s,assignmentStatement:l,block:u}=i,[,p]=t.getRange(e),[c,d]=t.getRange(l);if(!hb(u,e.parent)||function e(t,r){if("WithStatement"===t.type||"CallExpression"===t.type&&"Identifier"===t.callee.type&&"eval"===t.callee.name)return!0;for(let n of r[t.type]??[]){let o=t[n];if(Array.isArray(o)){if(o.some(t=>t&&e(t,r)))return!0}else if(o&&e(o,r))return!0}return!1}(e.parent,t.visitorKeys)||c<p||o.some(e=>!hb(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:hh,data:{name:r.id.name}};return r.id.typeAnnotation||hD(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||hE(t,e,"before")||hE(t,e,"after")||hE(t,l,"before")||hE(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield oO(t,{sourceCode:e},a);let i=`const ${o} = `;if(hD(e,r))return void(yield a.replaceText(n,`${i}${e.getText(r.right)};`));let[s]=e.getRange(r),[l]=e.getRange(r.right);yield a.replaceTextRange([s,l],i)}}({sourceCode:t,declaration:e,assignmentExpression:s,assignmentStatement:l,name:r.id.name})),m})(e,t))},meta:{type:"suggestion",docs:{description:"Prefer declaring variables in the smallest possible scope.",recommended:!0},fixable:"code",schema:[],messages:{[hh]:"Move `{{name}}` into the block where it is used."},languages:["js/js"]}},"unicorn/prefer-single-array-predicate":{create:e=>{e.on("LogicalExpression",t=>{if("LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=hC.get(t.operator);if(!r||e.sourceCode.getCommentsInside(t).length>0)return;let n=(function e(t,r){return"LogicalExpression"!==t.type||t.operator!==r?[t]:[...e(t.left,r),...e(t.right,r)]})(t,t.operator).map(t=>(function(e,t,r){if(!td(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let{object:n}=e.callee;if(rK(n,r))return;let o=function(e){if("ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&"BlockStatement"!==e.body.type)return{parameter:e.params[0],body:e.body}}(e.arguments[0]);if(o){var a;let t;return{node:e,object:n,callback:{...o,parameterText:(a=o.parameter,t=r.sourceCode.getText(a),a.typeAnnotation||a.optional?`(${t})`:t)}}}})(t,r,e));if(!(n.length<2||n.includes(void 0)||n.some(e=>{let t;return t=n[0],!tQ(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:hS,data:{method:r},suggest:[{messageId:hv,data:{method:r},fix:r=>r.replaceText(t,function(e,t,r){let{sourceCode:n}=r,[o]=e,{callback:a}=o,i=e.map(({callback:e})=>(function(e,t,r){var n,o;if(eQ(e,r))return eZ(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):hA.has(n.type))?`(${a})`:a})(e.body,t,r)).join(` ${t} `);return`${n.getText(o.node.callee)}(${a.parameterText} => ${i})`}(n,t.operator,e))}]}})},meta:{type:"suggestion",docs:{description:"Prefer a single `Array#some()` or `Array#every()` with a combined predicate.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[hS]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[hv]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(td(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===hV(t.callee.object,e)){let r={node:t.callee.property,messageId:hT};return hK(t,e)&&!eQ(t.callee,e)&&hz(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(e7(t,{name:"String",argumentsLength:1,optional:!1})&&nB(t.callee,e)))return;let[r]=t.arguments;if("url"!==hV(r,e))return;let n={node:t.callee,messageId:hT};return hK(t,e)&&hz(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=eZ(r,e),a=!eQ(r,e)&&n1(r,e)?`(${o})`:o,i=`${a}.href`,(nU(e.sourceCode.getTokenBefore(r.parent),e,i)?";":"")+i))}),n})},meta:{type:"suggestion",docs:{description:"Prefer `URL#href` over stringifying a `URL`.",recommended:"unopinionated"},fixable:"code",messages:{[hT]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new WeakMap,n=[];function*o(e){let n;if(!(te(n=e,{name:"Proxy",argumentsLength:2})||td(n,{object:"Proxy",method:"revocable",argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1})))return;let o=e.arguments[1];if("ObjectExpression"===o.type)for(let e of o.properties){let n=h1(e,t);if(!n)continue;let o=h2(n,t,r);o&&(yield o)}}e.on("onCodePathStart",()=>{n.push(new Set)}),e.on("onCodePathEnd",()=>{n.pop()}),e.on("onCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.onExit("BlockStatement",e=>{if(!(hX.has(e.parent?.type)&&e.parent.body===e))return;let t=[...n.at(-1)].every(e=>!e.reachable);r.set(e.parent,t)}),e.onExit("CallExpression",o),e.onExit("NewExpression",o)},meta:{type:"problem",docs:{description:"Require boolean-returning Proxy traps to return booleans.",recommended:"unopinionated"},fixable:"code",messages:{[hG]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":h4,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:h7,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield oI(o,r,n,e)}});e.on("CallExpression",t=>{if(t.optional||"Identifier"!==t.callee.type||1!==t.arguments.length||"SpreadElement"===t.arguments[0].type)return;let{name:n}=t.callee,o=xe.get(n);if(!o||!nB(t.callee,e))return;let[a]=t.arguments;if(o.isType(a,e))return r(t,a,`\`${n}()\``,o.type)}),e.on("UnaryExpression",e=>{if("+"===e.operator&&nt(e.argument,t.getScope(e.argument)))return r(e,e.argument,"`+`","number")}),e.on("BinaryExpression",t=>{let n;if("+"!==t.operator)return;let{left:o,right:a}=t;if(xt(a)&&nv(o,e))n=o;else{if(!(xt(o)&&nv(a,e)))return;n=a}return r(t,n,"Concatenation with `''`","string")}),e.on("CallExpression",t=>{let{callee:n}=t;if(!t.optional&&!(t.arguments.length>0)&&"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"toString"===n.property.name&&nv(n.object,e))return r(t,n.object,"`.toString()`","string")})},meta:{type:"suggestion",docs:{description:"Disallow useless type coercions of values that are already of the target type.",recommended:"unopinionated"},fixable:"code",messages:{[h7]:"{{description}} is unnecessary because the value is already a {{type}}."},languages:["js/js"]}},"unicorn/no-useless-boolean-cast":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!td(r,{methods:xn,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tl(n))return;let o=function(e){if(!e.async&&!e.generator&&!e.returnType){if("ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type)return e.body;if("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type)return e.body.body[0].argument}}(n);if(!tC(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&nF(n.params[0],a)))return{node:o,messageId:xr,data:{method:r.callee.property.name},fix(e){let r,i=t.getText(a);return"ArrowFunctionExpression"===n.type&&n.body===o&&(r=i,"SequenceExpression"===a.type||r.trimStart().startsWith("{"))&&(i=`(${i})`),e.replaceText(o,i)}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Boolean()` casts in array predicate callbacks.",recommended:"unopinionated"},fixable:"code",messages:{[xr]:"`Boolean()` is unnecessary in `Array#{{method}}()` callbacks."},languages:["js/js"]}},"unicorn/no-useless-continue":{create:e=>{e.on("ContinueStatement",t=>{if(!t.label&&(e=>{if("BlockStatement"!==e.parent.type)return!1;let t=e;for(;;){let{parent:e}=t;if("BlockStatement"===e.type){if(e.body.at(-1)!==t)return!1;t=e;continue}if("IfStatement"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return tp(e)&&e.body===t}})(t))return{node:t,messageId:xo,fix:r=>oO(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[xo]:"Unnecessary `continue` statement."},languages:["js/js"]}},"unicorn/no-useless-override":{create:e=>{let{sourceCode:t}=e;e.on("MethodDefinition",r=>{let n;if("method"!==r.kind||r.accessibility||r.optional||r.decorators?.length>0||r.value.params.some(e=>e.decorators?.length>0))return;let{value:o}=r;if("FunctionExpression"!==o.type||!o.body||o.generator||!r.parent.parent.superClass)return;let a=function(e,t){let r,n,o,{value:a}=e;if(1!==a.body.body.length)return;let[i]=a.body.body;if("ReturnStatement"===i.type?r=i.argument:"ExpressionStatement"===i.type&&(r=i.expression),r?.type!=="CallExpression"||r.optional)return;let{callee:s}=r;if("MemberExpression"!==s.type||s.optional||"Super"!==s.object.type)return;let l=t.getScope(r),u=eI(e,l);if("string"==typeof u&&eI(s,l)===u&&(n=r.arguments,o=a.params,n.length===o.length&&o.every((e,t)=>{let r=n[t];return"Identifier"===e.type?"Identifier"===r.type&&r.name===e.name:"RestElement"===e.type&&"Identifier"===e.argument.type&&"SpreadElement"===r.type&&"Identifier"===r.argument.type&&r.argument.name===e.argument.name})))return{callExpression:r,name:u,isReturned:"ReturnStatement"===i.type}}(r,t);if(!a)return;let{callExpression:i,name:s,isReturned:l}=a;if(n=t.getScope(r),!r.parent.body.some(e=>e!==r&&"MethodDefinition"===e.type&&"method"===e.kind&&e.static===r.static&&null===e.value.body&&eI(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=xs(i,e))||!0!==function e(t,r){let n;if(n=t=r.getNonNullableType(t),!rE.has(n.intrinsicName)){if(t.isUnion()){let n=t.types.map(t=>e(t,r));return!!n.every(Boolean)||!n.every(e=>!1===e)&&void 0}return void 0!==r.getPromisedTypeOfPromise(t)}}(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=xs(i,e))&&xi(t.type)))return}return{node:r.key,messageId:xa,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield o_(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[xa]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!td(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;xD.has(e.parent?.type)&&e.parent.expression===e;)e=e.parent;return e})(e),{parent:r}=t;if(r?.type==="BinaryExpression"&&["!==","===","!=","=="].includes(r.operator)){if(r.left===t)return{node:r,operator:r.operator,value:r.right};if(r.right===t)return{node:r,operator:r.operator,value:r.left}}})(e);if(r){let n,o;if(t.sourceCode.getCommentsInside(e).length>0)return;let a=((e,t,r)=>{let n=xL(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&xk(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(xk(t.value,r)&&x_(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(xV(t.value)&&o&&x_(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!xk(n,t):!xV(n)))return;return{node:e.callee.property,messageId:xl,fix:((e,t,r)=>{var n;let o;if(r.sourceCode.getCommentsInside(t.node).length>r.sourceCode.getCommentsInside(e).length)return;let a=`${(({operator:e})=>"!=="===e||"!="===e)(t)?"":"!"}${(o=eZ(n=e.callee.object,r),!eQ(n,r)&&n1(n,r)?`(${o})`:o)}.has(${((e,t)=>{let[r]=e.arguments;return t.sourceCode.getText(r)})(e,r)})`;return e=>e.replaceText(t.node,a)})(e,r,t)}}if((tA(e,t)||tT(e))&&xL(e.callee.object,t)?.kind==="map"&&x_(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:xl,fix:t=>t.replaceText(e.callee.property,"has")}}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `.has()` when checking existence.",recommended:"unopinionated"},fixable:"code",messages:{[xl]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===xK?e.on("LogicalExpression",t=>{if(xY(t)){if("&&"!==t.operator||ta(t.right)||xH(t.left,t.right,e.sourceCode))return;let r=x1(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&xH(r.reference,t.right,e.sourceCode))return;let n=x3(t.left,e),o=x3(t.right,e);return{node:t,messageId:xG,data:{expectedStyle:"ternary"},*fix(r,{abort:a}){if(e.sourceCode.getCommentsInside(t).length>0)return a();yield r.replaceText(t,`${n} ? ${o} : {}`)}}}}):e.on("ConditionalExpression",t=>{if(xY(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=ta(o);if(a===ta(n))return;let i=a?n:o,s=x1(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?xH(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&xH(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&xH(s.reference,i,t.sourceCode))return;let u=a?x2(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return x2(e.argument,"left",t);let r=eZ(e,t);return!eQ(e,t)&&n3(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=x2(i,"right",t);return{node:e,messageId:xG,data:{expectedStyle:"logical"},*fix(t,{abort:r}){if(l)return r();yield t.replaceText(e,`${u} && ${p}`)}}}(t,e)})},meta:{type:"suggestion",docs:{description:"Enforce consistent conditional object spread style.",recommended:!0},fixable:"code",schema:[{description:"The conditional object spread style to enforce.",enum:[xz,xK]}],defaultOptions:[xz],messages:{[xG]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":bb,"unicorn/no-array-concat-in-loop":{create:e=>{e.on("AssignmentExpression",t=>{let r=function(e,t){var r;if("="!==e.operator)return;let n="Identifier"===e.left.type?e.left:void 0,o=bE(e.right);if(!n||!td(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=bE(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=bD(n,t);if(!a||!i||i!==bD(a,t)||!function(e){let[t]=e?.defs??[];if(!t||1!==e.defs.length||"global"===e.scope.type||"Variable"!==t.type||"Identifier"!==t.node.id.type||"let"!==t.parent.kind&&"var"!==t.parent.kind)return!1;let r=t.node.init&&bE(t.node.init);return!!(r&&to(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tl(r))return;if(tp(r))return r}}(e,t),[l]=i.defs;if(!(!s||function(e,t,r){let[n,o]=r.sourceCode.getRange(e),[a,i]=r.sourceCode.getRange(t);return n>=a&&o<=i}(l.node,s.body,t)))return{callExpression:o,property:o.callee.property}}(t,e);if(r)return{node:r.property,messageId:bS}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[bS]:"Do not use `Array#concat()` to accumulate an array in a loop."},languages:["js/js"]}},"unicorn/no-array-front-mutation":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&ty(t.callee,bC)||rJ(r,e)))return{node:n,messageId:bv,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[bv]:"Avoid front-of-array mutation with `Array#{{method}}()`."},languages:["js/js"]}},"unicorn/no-array-sort-for-min-max":{create:e=>{e.on("MemberExpression",t=>{if(!t.computed||t.optional||!bw(t.property)||r2(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=bk(t.object,e);if(r)return bI(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!td(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(bw(n)?r="first":tm(n)&&(r="last"),!r||r2(t))return;let o=bk(t.callee.object,e);if(o)return bI(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bA]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[bT]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{if(!(e7(t,{minimumArguments:1})&&"MemberExpression"===t.callee.type&&bB.has(eI(t.callee,e.sourceCode.getScope(t.callee))))||rK(t.callee.object,e))return;let[r]=t.arguments;if("SpreadElement"!==r.type){let t=rg(r);if(tl(t)){let n=(e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(t);if(!nd(t,e)&&!bP(r,e))return;return{node:r,messageId:bj,suggest:r===t?((e,t,r)=>{var n;if(!t||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type)||e.params.some(e=>e.typeAnnotation)||e.params.some(e=>e.optional)||e.typeParameters||e.returnType||r.sourceCode.getCommentsInside(e).length>0)return;let[o,a]=e.params;if(o.name===a.name)return;let i="BinaryExpression"===(n=rg(n=t)).type&&b$.has(n.operator)?n:void 0;if(!i||rf(i.left)||rf(i.right)||!bR(i.left,i.right,o,a))return;let[s,l]=">"===i.operator||">="===i.operator?[i.left,i.right]:[i.right,i.left],u=`(${o.name}, ${a.name}) => ${r.sourceCode.getText(s)} - ${r.sourceCode.getText(l)}`;return[{messageId:bF,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(t,n,e):void 0}}return nm(t,e)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||no.has(e.name))&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||"Identifier"!==e.object.type||!t.sourceCode.isGlobalReference(e.object))return!1;let r=na.get(e.object.name),n=eI(e,t.sourceCode.getScope(e));return!!r?.has(n)}(t,e)||bP(r,e)?{node:r,messageId:bj}:void 0}})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bj]:"Do not return a boolean from a sort comparator.",[bF]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n;if(!bq.has(r.operator))return;let o=bU(r.left)?r.left:r.right;if(!bU(o))return;let a=o===r.left,i=a?r.right:r.left;if(bO.has(r.operator)&&ng(i,e))return;let s={node:r,messageId:bL},l=bM.has(o.operator)===bM.has(r.operator)&&("Literal"!==(n=r.right).type||"boolean"!=typeof n.value);if(a&&l&&!bU(r.right)&&!bU(o.left)&&((e,t)=>{if(eQ(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!eP(o.right,t)&&0===t.getCommentsInside(r).length){let n=`${t.getText(r.left)} && ${eZ(o.right,e)} ${r.operator} ${eZ(r.right,e)}`;s.suggest=[{messageId:bN,data:{replacement:n},fix:e=>e.replaceText(r,n)}]}return s})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bL]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[bN]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-constant-zero-expression":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",e=>{if(!(e=>{switch(e.operator){case"*":case"&":return e0(e.left,0)||e0(e.right,0);case"/":return e0(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:bW},n=ew(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:b_,fix:t=>t.replaceText(e,"0")}]),r})},meta:{type:"problem",docs:{description:"Disallow arithmetic and bitwise operations that always evaluate to `0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bW]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[b_]:"Replace this expression with `0`."},languages:["js/js"]}},"unicorn/no-duplicate-logical-operands":{create:e=>{e.on("LogicalExpression",t=>{let r,n;if("&&"!==t.operator&&"||"!==t.operator)return;let o="LogicalExpression"===t.left.type&&t.left.operator===t.operator?t.left.right:t.left;if((e=>{for(let t=e.parent;t;t=t.parent)if("WithStatement"===t.type)return!0;return!1})(t)||!bJ(o)||!bJ(t.right)||!lg(o,t.right))return;let a={node:t.right,messageId:bV};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=eH(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=eZ(t.left,e),s=e=>e.replaceText(t,i);return bG.has(o.type)&&(n=t.right,bG.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:bz,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[bV]:"This operand duplicates the left operand.",[bz]:"Remove the duplicate operand."},languages:["js/js"]}},"unicorn/no-impossible-length-comparison":{create:e=>{e.on("BinaryExpression",t=>{let r,n,o,a;if(!Object.hasOwn(bY,t.operator))return;let i=(r=rg(t.left),n=rg(t.right),rs(r)?{memberExpression:r,operator:t.operator,value:ew(n,e.sourceCode.getScope(n))?.value}:rs(n)?{memberExpression:n,operator:bY[t.operator],value:ew(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=rg(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rg(t)).type||ry(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=ew(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tE(e.parent)&&"&&"===e.parent.operator;)e=e.parent;return e}(e);return"LogicalExpression"===r.type&&"&&"===r.operator&&(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(r).some(r=>r!==e&&tc(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&ri.has(r.property.name)&&tQ(r.object,t.object))}({node:t,lengthOrSizeNode:s}))return;let l=function({operator:e,value:t}){if("number"==typeof t&&Number.isFinite(t))switch(e){case"<":return!(t<=0)&&void 0;case"<=":case"===":case"==":return!(t<0)&&void 0;case">":case"!==":case"!=":return t<0||void 0;case">=":return t<=0||void 0}}(i);if(void 0!==l)return{node:t,messageId:bX,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[bX]:"This comparison is always {{result}} because `.{{property}}` is always a non-negative integer."},languages:["js/js"]}},"unicorn/no-invalid-character-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(bZ.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=e3(n);if(void 0!==o&&o.length>1&&bQ(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:bH,data:{string:o,result:e?"true":"false"}}}}})},meta:{type:"problem",docs:{description:"Disallow comparing a single character from a string to a multi-character string.",recommended:"unopinionated"},schema:[],messages:{[bH]:"A single character can never equal the multi-character string `{{string}}`, so this comparison is always {{result}}."},languages:["js/js"]}},"unicorn/no-loop-iterable-mutation":{create:e=>{let t=new WeakSet,r=n7(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=Et(n.right,e);if(o)return function* e(t,r,n,o){if(b9.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=Et(t.right,o);e&&Ea(e.reference,r.iterable,o)&&(a=En(t,e))}if("CallExpression"===t.type){let e=function(e,t,r,n){if("MemberExpression"!==e.callee.type)return;let{addArgumentIdentifier:o,deleteArgumentIdentifier:a,iterable:i,reportedCallExpressions:s,setKeyIdentifier:l}=t,{object:u,property:p}=e.callee,c=eI(e.callee,n.sourceCode.getScope(e.callee));if(!(!b8[t.collectionKind??"unknown"].has(c)||!Ea(u,i,n)||"delete"===c&&Ei(e,a,n)||Es(e,{addArgumentIdentifier:o,setKeyIdentifier:l},c,n)&&!function e(t,r,n){let o=function(e){let t=e;for(;t.parent&&"BlockStatement"!==t.parent.type&&"SwitchCase"!==t.parent.type;)t=t.parent;if(t.parent)return{parent:t.parent,statement:t,statements:"SwitchCase"===t.parent.type?t.parent.consequent:t.parent.body}}(t);if(!o)return!1;let{statement:a,statements:i}=o,s=i.indexOf(a);return!!i.slice(0,s).some(e=>(function e(t,r,n){let o=function(e){if("ExpressionStatement"!==e.type)return;let t=rg(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eI(o.callee,n.sourceCode.getScope(o.callee))&&Ea(o.callee.object,r.iterable,n)&&Ei(o,r.deleteArgumentIdentifier,n);return"BlockStatement"===t.type?t.body.some(t=>e(t,r,n)):"IfStatement"===t.type&&(!r.branchAlwaysExits(t.consequent)&&e(t.consequent,r,n)||t.alternate&&!r.branchAlwaysExits(t.alternate)&&e(t.alternate,r,n))})(e,r,n))||o.parent!==r.loopBody&&e(o.parent,r,n)}(e,t,n)||r&&Es(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:b0,data:{iterable:n.sourceCode.getText(i)}}}(t,r,n,o);e&&(yield e)}for(let n of o.sourceCode.visitorKeys[t.type]??[]){let i=t[n];if(Array.isArray(i)){for(let t of i)t&&(yield*e(t,r,a,o));continue}i&&(yield*e(i,r,a,o))}}(n.body,{branchAlwaysExits:r,...En(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[b0]:"Do not mutate `{{iterable}}` while iterating over it."},languages:["js/js"]}},"unicorn/no-selector-as-dom-name":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",function*(e){for(let{node:r,expectedPrefix:n}of(e=>{if(td(e,{methods:Eu})&&tc(e.callee.object,{property:"classList",computed:!1})&&!nA(rg(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?Eg(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:Eg(e.arguments.slice(0,2),"."):Eg(e.arguments.slice(0,1),".")}if(td(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!nA(rg(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return Eg(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rg(r),o=Em(e);Ed(o)&&(yield Ef(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[El]:"Do not use selector syntax in DOM names."},languages:["js/js"]}},"unicorn/no-useless-compound-assignment":{create:e=>{let{sourceCode:t}=e;e.on("AssignmentExpression",r=>{if(!Eb.has(r.operator)||!e8(r.right)||r.right.value!==Eb.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:Ey,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:Ey,data:n,suggest:[{messageId:Eh,fix:t=>oO(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:Ey,data:n,suggest:[{messageId:Ex,data:{left:a},fix:e=>e.replaceText(r,a)}]}})},meta:{type:"suggestion",docs:{description:"Disallow useless compound assignments such as `x += 0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Ey]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[Eh]:"Remove the useless assignment.",[Ex]:"Replace the useless assignment with `{{left}}`."},languages:["js/js"]}},"unicorn/no-useless-delete-check":{create:e=>{e.on("IfStatement",t=>{let r=function(e,t){if(e.alternate||"IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=(e=>{if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type?e.expression:void 0})(e.consequent);if(r)return"UnaryExpression"===r.type&&"delete"===r.operator?function(e,t,r){let n,{test:o}=e,{argument:a}=t;if("BinaryExpression"===o.type&&"in"===o.operator&&"MemberExpression"===a.type&&!a.optional&&tQ(o.right,a.object)&&EF(o.right,r)&&EB(o.left,r)&&EB(o.right,r)&&(!a.computed||EB(a.property,r))){if(a.computed)n=((e,t,r)=>{if(tQ(e,t))return!((e,t)=>{var r;let n;if(EF(e,t)||EI(rg(e),t))return!0;let o=ro(rg(e),t);if(!o)return!1;let a=rg(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===Ej(r,t)})(e,r);let n=Ej(e,r),o=Ej(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eI(a,r.sourceCode.getScope(a));n=null!==e&&e===Ej(o.left,r)}return n?{suggest:[{messageId:ED,fix:ER(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(E$(n,"has")&&E$(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rg(e)).type)return!1;let n=ro(e,t);if(!n)return!1;let o=rg(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&Ev.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&tQ(n.callee.object,t.callee.object)&&tQ(n.arguments[0],t.arguments[0])&&EB(n.arguments[0],r))return{fix:ER(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:EE,fix:r.fix,suggest:r.suggest}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary existence checks before deletion.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[EE]:"The existence check before deletion is unnecessary.",[ED]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!EL.has(t.operator)||"LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=function(e,t){let r,n,{operator:o}=e,a=function e(t,r){return"LogicalExpression"===t.type&&t.operator===r?[...e(t.left,r),...e(t.right,r)]:[t]}(e,o),i=(r=EN.get(o),e2(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=EL.get(o),a.filter((e,r)=>e2(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tA(n=e[t].parent,r)||tT(n)||o.every(e=>ng(e,r))}(a,r,t)));if(0===s.length)return;let l=a.filter(e=>!s.includes(e));return{target:s[0],replacementOperands:0===l.length?[s.at(-1)]:l}}(t,e);if(!r)return;let{target:n,replacementOperands:o}=r;if(1===o.length&&e1(rg(o[0]))&&function(e){let{parent:t}=e;if("ExpressionStatement"!==t.type||t.expression!==e)return!1;let r=t.parent,n=r.parent;if("Program"!==r.type&&!("BlockStatement"===r.type&&tl(n)))return!1;let o=r.body.indexOf(t);return r.body.slice(0,o).every(e=>"string"==typeof e.directive)}(t))return;let a={node:n,messageId:EP,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>oI(r,t,o[0],e):a.fix=r=>{var n;let a;return r.replaceText(t,(n=t.operator,a=o.map((t,r)=>{let o,a;return o=eQ(t,e),a=eZ(t,e),!o&&n8(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&EM.has(rg(t).type)&&(a=`(${a})`),a}).join(` ${n} `),nU(e.sourceCode.getTokenBefore(t),e,a)?`;${a}`:a))}),a})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary operands in logical expressions involving boolean literals.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[EP]:"Simplify this `{{operator}}` expression."},languages:["js/js"]}},"unicorn/prefer-boolean-return":{create:e=>{let{sourceCode:t}=e;function r(n,o,a,i=t.getRange(n)){let s;if(!o||!a||"ConditionalExpression"===n.test.type)return;let l=EW(o),u=EW(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:EO},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||t7(e,a),m=!c&&!E_(n.test,e)&&!!(s=ei(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=eZ(t,e);if(r)return n3(t,"!")?`!(${n})`:`!${n}`;if(E_(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>{if(!n.alternate){let o=or(n,e);if(!o||"ReturnStatement"!==o.type)return;let a=r(n,EU(n.consequent),o,[t.getRange(n)[0],t.getRange(o)[1]]);return a?.fix&&t.getTokensBetween(n,o,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:EO}:a}return r(n,EU(n.consequent),EU(n.alternate))})},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[EO]:"Return the boolean expression directly."},languages:["js/js"]}},"unicorn/prefer-flat-math-min-max":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{let r=(e=>{for(let t of Ez)if(EK(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>EK(e,r))||((e,t)=>{let{parent:r}=e;return EK(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:EV,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=EG(e,r).map(e=>t.getText(e)).join(", ");yield n.replaceText(e,`${a}(${i})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer flat `Math.min()` and `Math.max()` calls over nested calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[EV]:"Prefer a flat `Math.{{method}}()` call instead of nested calls."},languages:["js/js"]}},"unicorn/prefer-hoisting-branch-code":{create:e=>{e.on("IfStatement",t=>(function*(e,t){if("IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=function(e){let t=[],r=e;for(;r?.type==="IfStatement";r=r.alternate)t.push(r.consequent);if(r)return t.push(r),t}(e);if(!r||r.some(e=>"BlockStatement"!==e.type))return;let{sourceCode:n}=t,{leading:o,trailing:a,minLength:i}=function(e,t){let r=Math.min(...e.map(e=>e.length)),n=0;for(;n<r&&e.every(r=>E0(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>E0(r.at(-1-o),e[0].at(-1-o),t));)o++;return{leading:n,trailing:o,minLength:r}}(r.map(e=>e.body),n);0===o&&0===a||!(o+a>=i)&&(o>0&&(yield E2({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield E2({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!1},t)))})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer moving code shared by all branches of an `if` statement out of the branches.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[EJ]:"These branches start with the same code. Move it before the `if` statement.",[EX]:"These branches end with the same code. Move it after the `if` statement.",[EY]:"Move the shared code out of the branches."},languages:["js/js"]}},"unicorn/prefer-single-replace":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(void 0===E5(r))return;let n=r.arguments[1];if(!e1(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==E5(e)&&e1(e.arguments[1])&&e.arguments[1].value===o,{parent:i}=r;if("MemberExpression"===i.type&&i.object===r&&"CallExpression"===i.parent.type&&i.parent.callee===i&&a(i.parent))return;let s=[],l=r;for(;a(l);)s.push(E5(l)),l=l.callee.object;if(s.length<2)return;let u=l;s.reverse();let p=[...new Set(s)];if(p.some(e=>o.includes(e)))return;let c={node:r,messageId:E8};if(0===t.getCommentsInside(r).length){let t=p.map((e,t)=>(function(e,t,r){if(E9.has(e))return E9.get(e);if("^"===e)return t?String.raw`\^`:"^";if("-"===e)return t||r?"-":String.raw`\-`;let n=e.codePointAt(0);return n<32||127===n?String.raw`\x${n.toString(16).toUpperCase().padStart(2,"0")}`:e})(e,0===t,t===p.length-1)).join(""),o=eZ(u,e),a=eZ(n,e);c.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return c})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.",recommended:"unopinionated"},fixable:"code",messages:{[E8]:"Combine these single-character replacements into a single `replaceAll()` with a regular expression."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=d.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v68.0.0/docs/rules/${r}.md`)}},create:nY(t.create)}]})))};module.exports=E4;
32
+ ${i}});`)}(a,i,e)),l})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[hT]:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls."},languages:["js/js"]}},"unicorn/prefer-object-destructuring-defaults":{create:e=>{e.on("VariableDeclarator",t=>{let{id:r,init:n}=t;if("ObjectPattern"!==r.type||n?.type!=="ObjectExpression"||0!==e.sourceCode.getCommentsInside(t).length)return;let o=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(hB(n)&&"Identifier"===n.value.type))return;let e=eI(n,t.sourceCode.getScope(n));if(null===e||hj.has(e))return;r.push({node:n,name:e})}return r})(r,e),a=((e,t)=>{let{properties:r}=e,n=r.at(-1);if(n?.type!=="SpreadElement"||eL(n.argument,t.sourceCode,hF))return;let o=new Map;for(let e of r.slice(0,-1)){if(!hB(e)||eL(e.value,t.sourceCode,hF))return;let r=eI(e,t.sourceCode.getScope(e));if(null===r||o.has(r))return;o.set(r,e)}return{defaultProperties:o,spreadElement:n}})(n,e);if(!o||0===o.length||!a)return;let{defaultProperties:i,spreadElement:s}=a;if(o.length!==i.size)return;let l=new Set(o.map(e=>e.node.value.name)),u=[];for(let t of o){let r=i.get(t.name);if(!r||hR(r.value,l,e))return;u.push(hP(t,r,e))}return{node:t,messageId:hk,suggest:[{messageId:hI,fix:r=>r.replaceText(t,`{${u.join(", ")}} = {${e.sourceCode.getText(s)}}`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[hk]:"Prefer object destructuring defaults over default object literals with spread.",[hI]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>hM(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>hM(t,e.body)),e.on("SwitchCase",e=>hM(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[hL]:"Prefer a single object destructuring declaration from `{{source}}`."},languages:["js/js"]}},"unicorn/prefer-smaller-scope":{create:e=>{let{sourceCode:t}=e;e.on("VariableDeclaration",e=>(function(e,t){if(!(e.parent&&("Program"===e.parent.type||"BlockStatement"===e.parent.type)&&"let"===e.kind&&1===e.declarations.length&&"Identifier"===e.declarations[0].id.type&&!e.declarations[0].init))return;let[r]=e.declarations,[n]=t.getDeclaredVariables(r),o=n.references.filter(e=>!e.init),a=o.filter(e=>e.isWrite());if(1!==a.length||o.every(e=>!e.isRead()))return;let i=function(e){let{identifier:t}=e,r=t.parent;if("AssignmentExpression"!==r.type||"="!==r.operator||r.left!==t||"ExpressionStatement"!==r.parent.type)return;let n=r.parent,o=n.parent;if("BlockStatement"===o.type)return{assignmentExpression:r,assignmentStatement:n,block:o}}(a[0]);if(!i)return;let{assignmentExpression:s,assignmentStatement:l,block:u}=i,[,p]=t.getRange(e),[c,d]=t.getRange(l);if(!hq(u,e.parent)||function e(t,r){if("WithStatement"===t.type||"CallExpression"===t.type&&"Identifier"===t.callee.type&&"eval"===t.callee.name)return!0;for(let n of r[t.type]??[]){let o=t[n];if(Array.isArray(o)){if(o.some(t=>t&&e(t,r)))return!0}else if(o&&e(o,r))return!0}return!1}(e.parent,t.visitorKeys)||c<p||o.some(e=>!hq(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:hO,data:{name:r.id.name}};return r.id.typeAnnotation||h_(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||hW(t,e,"before")||hW(t,e,"after")||hW(t,l,"before")||hW(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield o7(t,{sourceCode:e},a);let i=`const ${o} = `;if(h_(e,r))return void(yield a.replaceText(n,`${i}${e.getText(r.right)};`));let[s]=e.getRange(r),[l]=e.getRange(r.right);yield a.replaceTextRange([s,l],i)}}({sourceCode:t,declaration:e,assignmentExpression:s,assignmentStatement:l,name:r.id.name})),m})(e,t))},meta:{type:"suggestion",docs:{description:"Prefer declaring variables in the smallest possible scope.",recommended:!0},fixable:"code",schema:[],messages:{[hO]:"Move `{{name}}` into the block where it is used."},languages:["js/js"]}},"unicorn/prefer-single-array-predicate":{create:e=>{e.on("LogicalExpression",t=>{if("LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=hK.get(t.operator);if(!r||e.sourceCode.getCommentsInside(t).length>0)return;let n=(function e(t,r){return"LogicalExpression"!==t.type||t.operator!==r?[t]:[...e(t.left,r),...e(t.right,r)]})(t,t.operator).map(t=>(function(e,t,r){if(!td(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let{object:n}=e.callee;if(rQ(n,r))return;let o=function(e){if("ArrowFunctionExpression"===e.type&&!e.async&&!e.returnType&&!e.typeParameters&&1===e.params.length&&"Identifier"===e.params[0].type&&"BlockStatement"!==e.body.type)return{parameter:e.params[0],body:e.body}}(e.arguments[0]);if(o){var a;let t;return{node:e,object:n,callback:{...o,parameterText:(a=o.parameter,t=r.sourceCode.getText(a),a.typeAnnotation||a.optional?`(${t})`:t)}}}})(t,r,e));if(!(n.length<2||n.includes(void 0)||n.some(e=>{let t;return t=n[0],!t0(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:hV,data:{method:r},suggest:[{messageId:hz,data:{method:r},fix:r=>r.replaceText(t,function(e,t,r){let{sourceCode:n}=r,[o]=e,{callback:a}=o,i=e.map(({callback:e})=>(function(e,t,r){var n,o;if(eZ(e,r))return eQ(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):hG.has(n.type))?`(${a})`:a})(e.body,t,r)).join(` ${t} `);return`${n.getText(o.node.callee)}(${a.parameterText} => ${i})`}(n,t.operator,e))}]}})},meta:{type:"suggestion",docs:{description:"Prefer a single `Array#some()` or `Array#every()` with a combined predicate.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[hV]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[hz]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(td(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===xr(t.callee.object,e)){let r={node:t.callee.property,messageId:hJ};return xo(t,e)&&!eZ(t.callee,e)&&xn(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(e7(t,{name:"String",argumentsLength:1,optional:!1})&&n_(t.callee,e)))return;let[r]=t.arguments;if("url"!==xr(r,e))return;let n={node:t.callee,messageId:hJ};return xo(t,e)&&xn(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=eQ(r,e),a=!eZ(r,e)&&og(r,e)?`(${o})`:o,i=`${a}.href`,(nQ(e.sourceCode.getTokenBefore(r.parent),e,i)?";":"")+i))}),n})},meta:{type:"suggestion",docs:{description:"Prefer `URL#href` over stringifying a `URL`.",recommended:"unopinionated"},fixable:"code",messages:{[hJ]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new WeakMap,n=[];function*o(e){let n;if(!(te(n=e,{name:"Proxy",argumentsLength:2})||td(n,{object:"Proxy",method:"revocable",argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1})))return;let o=e.arguments[1];if("ObjectExpression"===o.type)for(let e of o.properties){let n=xm(e,t);if(!n)continue;let o=xf(n,t,r);o&&(yield o)}}e.on("onCodePathStart",()=>{n.push(new Set)}),e.on("onCodePathEnd",()=>{n.pop()}),e.on("onCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{n.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{n.at(-1).delete(e)}),e.onExit("BlockStatement",e=>{if(!(xs.has(e.parent?.type)&&e.parent.body===e))return;let t=[...n.at(-1)].every(e=>!e.reachable);r.set(e.parent,t)}),e.onExit("CallExpression",o),e.onExit("NewExpression",o)},meta:{type:"problem",docs:{description:"Require boolean-returning Proxy traps to return booleans.",recommended:"unopinionated"},fixable:"code",messages:{[xa]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":xE,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:xS,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield oZ(o,r,n,e)}});e.on("CallExpression",t=>{if(t.optional||"Identifier"!==t.callee.type||1!==t.arguments.length||"SpreadElement"===t.arguments[0].type)return;let{name:n}=t.callee,o=xD.get(n);if(!o||!n_(t.callee,e))return;let[a]=t.arguments;if(o.isType(a,e))return r(t,a,`\`${n}()\``,o.type)}),e.on("UnaryExpression",e=>{if("+"===e.operator&&nc(e.argument,t.getScope(e.argument)))return r(e,e.argument,"`+`","number")}),e.on("BinaryExpression",t=>{let n;if("+"!==t.operator)return;let{left:o,right:a}=t;if(xv(a)&&nR(o,e))n=o;else{if(!(xv(o)&&nR(a,e)))return;n=a}return r(t,n,"Concatenation with `''`","string")}),e.on("CallExpression",t=>{let{callee:n}=t;if(!t.optional&&!(t.arguments.length>0)&&"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"toString"===n.property.name&&nR(n.object,e))return r(t,n.object,"`.toString()`","string")})},meta:{type:"suggestion",docs:{description:"Disallow useless type coercions of values that are already of the target type.",recommended:"unopinionated"},fixable:"code",messages:{[xS]:"{{description}} is unnecessary because the value is already a {{type}}."},languages:["js/js"]}},"unicorn/no-useless-boolean-cast":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(!td(r,{methods:xA,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tl(n))return;let o=function(e){if(!e.async&&!e.generator&&!e.returnType){if("ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type)return e.body;if("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type)return e.body.body[0].argument}}(n);if(!tA(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&nW(n.params[0],a))&&!(function e(t){return(t=ry(t),t?.type==="ChainExpression")?rh(t):t?.type==="LogicalExpression"?"&&"===t.operator&&e(t.left)||e(t.right):t?.type==="ConditionalExpression"?e(t.consequent)||e(t.alternate):t?.type==="SequenceExpression"&&e(t.expressions.at(-1))}(a)||function(e,t){let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let t=r.getTypeAtLocation(e);return(t.isUnion()?t.types:[t]).some(e=>"void"===e.intrinsicName||rD.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:xC,data:{method:r.callee.property.name},fix(e){let r,i=t.getText(a);return"ArrowFunctionExpression"===n.type&&n.body===o&&(r=i,"SequenceExpression"===a.type||r.trimStart().startsWith("{"))&&(i=`(${i})`),e.replaceText(o,i)}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `Boolean()` casts in array predicate callbacks.",recommended:"unopinionated"},fixable:"code",messages:{[xC]:"`Boolean()` is unnecessary in `Array#{{method}}()` callbacks."},languages:["js/js"]}},"unicorn/no-useless-continue":{create:e=>{e.on("ContinueStatement",t=>{if(!t.label&&(e=>{if("BlockStatement"!==e.parent.type)return!1;let t=e;for(;;){let{parent:e}=t;if("BlockStatement"===e.type){if(e.body.at(-1)!==t)return!1;t=e;continue}if("IfStatement"===e.type&&(e.consequent===t||e.alternate===t)){t=e;continue}return tp(e)&&e.body===t}})(t))return{node:t,messageId:xT,fix:r=>o7(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[xT]:"Unnecessary `continue` statement."},languages:["js/js"]}},"unicorn/no-useless-override":{create:e=>{let{sourceCode:t}=e;e.on("MethodDefinition",r=>{let n;if("method"!==r.kind||r.accessibility||r.optional||r.decorators?.length>0||r.value.params.some(e=>e.decorators?.length>0))return;let{value:o}=r;if("FunctionExpression"!==o.type||!o.body||o.generator||!r.parent.parent.superClass)return;let a=function(e,t){let r,n,o,{value:a}=e;if(1!==a.body.body.length)return;let[i]=a.body.body;if("ReturnStatement"===i.type?r=i.argument:"ExpressionStatement"===i.type&&(r=i.expression),r?.type!=="CallExpression"||r.optional)return;let{callee:s}=r;if("MemberExpression"!==s.type||s.optional||"Super"!==s.object.type)return;let l=t.getScope(r),u=eI(e,l);if("string"==typeof u&&eI(s,l)===u&&(n=r.arguments,o=a.params,n.length===o.length&&o.every((e,t)=>{let r=n[t];return"Identifier"===e.type?"Identifier"===r.type&&r.name===e.name:"RestElement"===e.type&&"Identifier"===e.argument.type&&"SpreadElement"===r.type&&"Identifier"===r.argument.type&&r.argument.name===e.argument.name})))return{callExpression:r,name:u,isReturned:"ReturnStatement"===i.type}}(r,t);if(!a)return;let{callExpression:i,name:s,isReturned:l}=a;if(n=t.getScope(r),!r.parent.body.some(e=>e!==r&&"MethodDefinition"===e.type&&"method"===e.kind&&e.static===r.static&&null===e.value.body&&eI(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=xI(i,e))||!0!==nq(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=xI(i,e))&&xk(t.type)))return}return{node:r.key,messageId:xw,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield an(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[xw]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!td(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;x_.has(e.parent?.type)&&e.parent.expression===e;)e=e.parent;return e})(e),{parent:r}=t;if(r?.type==="BinaryExpression"&&["!==","===","!=","=="].includes(r.operator)){if(r.left===t)return{node:r,operator:r.operator,value:r.right};if(r.right===t)return{node:r,operator:r.operator,value:r.left}}})(e);if(r){let n,o;if(t.sourceCode.getCommentsInside(e).length>0)return;let a=((e,t,r)=>{let n=x8(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&xH(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(xH(t.value,r)&&bt(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(br(t.value)&&o&&bt(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!xH(n,t):!br(n)))return;return{node:e.callee.property,messageId:xj,fix:((e,t,r)=>{var n;let o;if(r.sourceCode.getCommentsInside(t.node).length>r.sourceCode.getCommentsInside(e).length)return;let a=`${(({operator:e})=>"!=="===e||"!="===e)(t)?"":"!"}${(o=eQ(n=e.callee.object,r),!eZ(n,r)&&og(n,r)?`(${o})`:o)}.has(${((e,t)=>{let[r]=e.arguments;return t.sourceCode.getText(r)})(e,r)})`;return e=>e.replaceText(t.node,a)})(e,r,t)}}if((tT(e,t)||tw(e))&&x8(e.callee.object,t)?.kind==="map"&&bt(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:xj,fix:t=>t.replaceText(e.callee.property,"has")}}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `.has()` when checking existence.",recommended:"unopinionated"},fixable:"code",messages:{[xj]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===bo?e.on("LogicalExpression",t=>{if(bu(t)){if("&&"!==t.operator||bl(t.right)||bp(t.left,t.right,e.sourceCode))return;let r=bf(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&bp(r.reference,t.right,e.sourceCode))return;let n=by(t.left,e),o=by(t.right,e);return{node:t,messageId:ba,data:{expectedStyle:"ternary"},*fix(r,{abort:a}){if(e.sourceCode.getCommentsInside(t).length>0)return a();yield r.replaceText(t,`${n} ? ${o} : {}`)}}}}):e.on("ConditionalExpression",t=>{if(bu(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=bl(o);if(a===bl(n))return;let i=a?n:o,s=bf(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?bp(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&bp(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&bp(s.reference,i,t.sourceCode))return;let u=a?bg(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return bg(e.argument,"left",t);let r=eQ(e,t);return!eZ(e,t)&&oh(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=bg(i,"right",t);return{node:e,messageId:ba,data:{expectedStyle:"logical"},*fix(t,{abort:r}){if(l)return r();yield t.replaceText(e,`${u} && ${p}`)}}}(t,e)})},meta:{type:"suggestion",docs:{description:"Enforce consistent conditional object spread style.",recommended:!0},fixable:"code",schema:[{description:"The conditional object spread style to enforce.",enum:[bn,bo]}],defaultOptions:[bn],messages:{[ba]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":bW,"unicorn/no-array-concat-in-loop":{create:e=>{e.on("AssignmentExpression",t=>{let r=function(e,t){var r;if("="!==e.operator)return;let n="Identifier"===e.left.type?e.left:void 0,o=b_(e.right);if(!n||!td(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=b_(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=bV(n,t);if(!a||!i||i!==bV(a,t)||!function(e){let[t]=e?.defs??[];if(!t||1!==e.defs.length||"global"===e.scope.type||"Variable"!==t.type||"Identifier"!==t.node.id.type||"let"!==t.parent.kind&&"var"!==t.parent.kind)return!1;let r=t.node.init&&b_(t.node.init);return!!(r&&to(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tl(r))return;if(tp(r))return r}}(e,t),[l]=i.defs;if(!(!s||function(e,t,r){let[n,o]=r.sourceCode.getRange(e),[a,i]=r.sourceCode.getRange(t);return n>=a&&o<=i}(l.node,s.body,t)))return{callExpression:o,property:o.callee.property}}(t,e);if(r)return{node:r.property,messageId:bz}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[bz]:"Do not use `Array#concat()` to accumulate an array in a loop."},languages:["js/js"]}},"unicorn/no-array-front-mutation":{create:e=>{e.on("CallExpression",t=>{if(!td(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&th(t.callee,bG)||r0(r,e)))return{node:n,messageId:bK,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[bK]:"Avoid front-of-array mutation with `Array#{{method}}()`."},languages:["js/js"]}},"unicorn/no-array-sort-for-min-max":{create:e=>{e.on("MemberExpression",t=>{if(!t.computed||t.optional||!bH(t.property)||nr(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=bY(t.object,e);if(r)return bQ(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!td(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(bH(n)?r="first":tm(n)&&(r="last"),!r||nr(t))return;let o=bY(t.callee.object,e);if(o)return bQ(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bJ]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[bX]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{if(!(e7(t,{minimumArguments:1})&&"MemberExpression"===t.callee.type&&b1.has(eI(t.callee,e.sourceCode.getScope(t.callee))))||rQ(t.callee.object,e))return;let[r]=t.arguments;if("SpreadElement"!==r.type){let t=ry(r);if(tl(t)){let n=(e=>{if("BlockStatement"!==e.body.type)return e.body;if(1!==e.body.body.length)return;let[t]=e.body.body;if("ReturnStatement"===t.type)return t.argument})(t);if(!nD(t,e)&&!b8(r,e))return;return{node:r,messageId:bZ,suggest:r===t?((e,t,r)=>{var n;if(!t||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type)||e.params.some(e=>e.typeAnnotation)||e.params.some(e=>e.optional)||e.typeParameters||e.returnType||r.sourceCode.getCommentsInside(e).length>0)return;let[o,a]=e.params;if(o.name===a.name)return;let i="BinaryExpression"===(n=ry(n=t)).type&&b2.has(n.operator)?n:void 0;if(!i||rg(i.left)||rg(i.right)||!b3(i.left,i.right,o,a))return;let[s,l]=">"===i.operator||">="===i.operator?[i.left,i.right]:[i.right,i.left],u=`(${o.name}, ${a.name}) => ${r.sourceCode.getText(s)} - ${r.sourceCode.getText(l)}`;return[{messageId:b0,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(t,n,e):void 0}}return nv(t,e)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||nf.has(e.name))&&t.sourceCode.isGlobalReference(e);if("MemberExpression"!==e.type||e.optional||"Identifier"!==e.object.type||!t.sourceCode.isGlobalReference(e.object))return!1;let r=ng.get(e.object.name),n=eI(e,t.sourceCode.getScope(e));return!!r?.has(n)}(t,e)||b8(r,e)?{node:r,messageId:bZ}:void 0}})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[bZ]:"Do not return a boolean from a sort comparator.",[b0]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{let n;if(!b7.has(r.operator))return;let o=Ee(r.left)?r.left:r.right;if(!Ee(o))return;let a=o===r.left,i=a?r.right:r.left;if(b4.has(r.operator)&&nA(i,e))return;let s={node:r,messageId:b6},l=b5.has(o.operator)===b5.has(r.operator)&&("Literal"!==(n=r.right).type||"boolean"!=typeof n.value);if(a&&l&&!Ee(r.right)&&!Ee(o.left)&&((e,t)=>{if(eZ(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!eL(o.right,t)&&0===t.getCommentsInside(r).length){let n=`${t.getText(r.left)} && ${eQ(o.right,e)} ${r.operator} ${eQ(r.right,e)}`;s.suggest=[{messageId:b9,data:{replacement:n},fix:e=>e.replaceText(r,n)}]}return s})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[b6]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[b9]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-constant-zero-expression":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",e=>{if(!(e=>{switch(e.operator){case"*":case"&":return e0(e.left,0)||e0(e.right,0);case"/":return e0(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:Et},n=ew(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:Er,fix:t=>t.replaceText(e,"0")}]),r})},meta:{type:"problem",docs:{description:"Disallow arithmetic and bitwise operations that always evaluate to `0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Et]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[Er]:"Replace this expression with `0`."},languages:["js/js"]}},"unicorn/no-duplicate-logical-operands":{create:e=>{e.on("LogicalExpression",t=>{let r,n;if("&&"!==t.operator&&"||"!==t.operator)return;let o="LogicalExpression"===t.left.type&&t.left.operator===t.operator?t.left.right:t.left;if((e=>{for(let t=e.parent;t;t=t.parent)if("WithStatement"===t.type)return!0;return!1})(t)||!Es(o)||!Es(t.right)||!lq(o,t.right))return;let a={node:t.right,messageId:En};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=eY(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=eQ(t.left,e),s=e=>e.replaceText(t,i);return Ei.has(o.type)&&(n=t.right,Ei.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:Eo,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[En]:"This operand duplicates the left operand.",[Eo]:"Remove the duplicate operand."},languages:["js/js"]}},"unicorn/no-impossible-length-comparison":{create:e=>{e.on("BinaryExpression",t=>{let r,n,o,a;if(!Object.hasOwn(Eu,t.operator))return;let i=(r=ry(t.left),n=ry(t.right),rl(r)?{memberExpression:r,operator:t.operator,value:ew(n,e.sourceCode.getScope(n))?.value}:rl(n)?{memberExpression:n,operator:Eu[t.operator],value:ew(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=ry(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=ry(t)).type||rh(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=ew(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tS(e.parent)&&"&&"===e.parent.operator;)e=e.parent;return e}(e);return"LogicalExpression"===r.type&&"&&"===r.operator&&(function e(t){return[t.left,t.right].flatMap(r=>"LogicalExpression"===r.type&&r.operator===t.operator?e(r):[r])})(r).some(r=>r!==e&&tc(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&rs.has(r.property.name)&&t0(r.object,t.object))}({node:t,lengthOrSizeNode:s}))return;let l=function({operator:e,value:t}){if("number"==typeof t&&Number.isFinite(t))switch(e){case"<":return!(t<=0)&&void 0;case"<=":case"===":case"==":return!(t<0)&&void 0;case">":case"!==":case"!=":return t<0||void 0;case">=":return t<=0||void 0}}(i);if(void 0!==l)return{node:t,messageId:El,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[El]:"This comparison is always {{result}} because `.{{property}}` is always a non-negative integer."},languages:["js/js"]}},"unicorn/no-invalid-character-comparison":{create:e=>{e.on("BinaryExpression",t=>{if(Ec.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=e3(n);if(void 0!==o&&o.length>1&&Ed(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:Ep,data:{string:o,result:e?"true":"false"}}}}})},meta:{type:"problem",docs:{description:"Disallow comparing a single character from a string to a multi-character string.",recommended:"unopinionated"},schema:[],messages:{[Ep]:"A single character can never equal the multi-character string `{{string}}`, so this comparison is always {{result}}."},languages:["js/js"]}},"unicorn/no-loop-iterable-mutation":{create:e=>{let t=new WeakSet,r=ov(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=EC(n.right,e);if(o)return function* e(t,r,n,o){if(Eb.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=EC(t.right,o);e&&Ek(e.reference,r.iterable,o)&&(a=ET(t,e))}if("CallExpression"===t.type){let e=function(e,t,r,n){if("MemberExpression"!==e.callee.type)return;let{addArgumentIdentifier:o,deleteArgumentIdentifier:a,iterable:i,reportedCallExpressions:s,setKeyIdentifier:l}=t,{object:u,property:p}=e.callee,c=eI(e.callee,n.sourceCode.getScope(e.callee));if(!(!Eh[t.collectionKind??"unknown"].has(c)||!Ek(u,i,n)||"delete"===c&&EI(e,a,n)||Ej(e,{addArgumentIdentifier:o,setKeyIdentifier:l},c,n)&&!function e(t,r,n){let o=function(e){let t=e;for(;t.parent&&"BlockStatement"!==t.parent.type&&"SwitchCase"!==t.parent.type;)t=t.parent;if(t.parent)return{parent:t.parent,statement:t,statements:"SwitchCase"===t.parent.type?t.parent.consequent:t.parent.body}}(t);if(!o)return!1;let{statement:a,statements:i}=o,s=i.indexOf(a);return!!i.slice(0,s).some(e=>(function e(t,r,n){let o=function(e){if("ExpressionStatement"!==e.type)return;let t=ry(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eI(o.callee,n.sourceCode.getScope(o.callee))&&Ek(o.callee.object,r.iterable,n)&&EI(o,r.deleteArgumentIdentifier,n);return"BlockStatement"===t.type?t.body.some(t=>e(t,r,n)):"IfStatement"===t.type&&(!r.branchAlwaysExits(t.consequent)&&e(t.consequent,r,n)||t.alternate&&!r.branchAlwaysExits(t.alternate)&&e(t.alternate,r,n))})(e,r,n))||o.parent!==r.loopBody&&e(o.parent,r,n)}(e,t,n)||r&&Ej(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:Em,data:{iterable:n.sourceCode.getText(i)}}}(t,r,n,o);e&&(yield e)}for(let n of o.sourceCode.visitorKeys[t.type]??[]){let i=t[n];if(Array.isArray(i)){for(let t of i)t&&(yield*e(t,r,a,o));continue}i&&(yield*e(i,r,a,o))}}(n.body,{branchAlwaysExits:r,...ET(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[Em]:"Do not mutate `{{iterable}}` while iterating over it."},languages:["js/js"]}},"unicorn/no-selector-as-dom-name":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",function*(e){for(let{node:r,expectedPrefix:n}of(e=>{if(td(e,{methods:EB})&&tc(e.callee.object,{property:"classList",computed:!1})&&!nL(ry(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?EM(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:EM(e.arguments.slice(0,2),"."):EM(e.arguments.slice(0,1),".")}if(td(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!nL(ry(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return EM(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=ry(r),o=E$(e);EL(o)&&(yield EN(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[EF]:"Do not use selector syntax in DOM names."},languages:["js/js"]}},"unicorn/no-useless-compound-assignment":{create:e=>{let{sourceCode:t}=e;e.on("AssignmentExpression",r=>{if(!EW.has(r.operator)||!e8(r.right)||r.right.value!==EW.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:EO,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:EO,data:n,suggest:[{messageId:EU,fix:t=>o7(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:EO,data:n,suggest:[{messageId:Eq,data:{left:a},fix:e=>e.replaceText(r,a)}]}})},meta:{type:"suggestion",docs:{description:"Disallow useless compound assignments such as `x += 0`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[EO]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[EU]:"Remove the useless assignment.",[Eq]:"Replace the useless assignment with `{{left}}`."},languages:["js/js"]}},"unicorn/no-useless-delete-check":{create:e=>{e.on("IfStatement",t=>{let r=function(e,t){if(e.alternate||"IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=(e=>{if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type?e.expression:void 0})(e.consequent);if(r)return"UnaryExpression"===r.type&&"delete"===r.operator?function(e,t,r){let n,{test:o}=e,{argument:a}=t;if("BinaryExpression"===o.type&&"in"===o.operator&&"MemberExpression"===a.type&&!a.optional&&t0(o.right,a.object)&&E0(o.right,r)&&E1(o.left,r)&&E1(o.right,r)&&(!a.computed||E1(a.property,r))){if(a.computed)n=((e,t,r)=>{if(t0(e,t))return!((e,t)=>{var r;let n;if(E0(e,t)||EQ(ry(e),t))return!0;let o=ra(ry(e),t);if(!o)return!1;let a=ry(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===EZ(r,t)})(e,r);let n=EZ(e,r),o=EZ(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eI(a,r.sourceCode.getScope(a));n=null!==e&&e===EZ(o.left,r)}return n?{suggest:[{messageId:EV,fix:E3(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(E2(n,"has")&&E2(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=ry(e)).type)return!1;let n=ra(e,t);if(!n)return!1;let o=ry(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&EK.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&t0(n.callee.object,t.callee.object)&&t0(n.arguments[0],t.arguments[0])&&E1(n.arguments[0],r))return{fix:E3(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:E_,fix:r.fix,suggest:r.suggest}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary existence checks before deletion.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[E_]:"The existence check before deletion is unnecessary.",[EV]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!E6.has(t.operator)||"LogicalExpression"===t.parent.type&&t.parent.operator===t.operator)return;let r=function(e,t){let r,n,{operator:o}=e,a=function e(t,r){return"LogicalExpression"===t.type&&t.operator===r?[...e(t.left,r),...e(t.right,r)]:[t]}(e,o),i=(r=E9.get(o),e2(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=E6.get(o),a.filter((e,r)=>e2(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tT(n=e[t].parent,r)||tw(n)||o.every(e=>nA(e,r))}(a,r,t)));if(0===s.length)return;let l=a.filter(e=>!s.includes(e));return{target:s[0],replacementOperands:0===l.length?[s.at(-1)]:l}}(t,e);if(!r)return;let{target:n,replacementOperands:o}=r;if(1===o.length&&e1(ry(o[0]))&&function(e){let{parent:t}=e;if("ExpressionStatement"!==t.type||t.expression!==e)return!1;let r=t.parent,n=r.parent;if("Program"!==r.type&&!("BlockStatement"===r.type&&tl(n)))return!1;let o=r.body.indexOf(t);return r.body.slice(0,o).every(e=>"string"==typeof e.directive)}(t))return;let a={node:n,messageId:E8,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>oZ(r,t,o[0],e):a.fix=r=>{var n;let a;return r.replaceText(t,(n=t.operator,a=o.map((t,r)=>{let o,a;return o=eZ(t,e),a=eQ(t,e),!o&&ox(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&E5.has(ry(t).type)&&(a=`(${a})`),a}).join(` ${n} `),nQ(e.sourceCode.getTokenBefore(t),e,a)?`;${a}`:a))}),a})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary operands in logical expressions involving boolean literals.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[E8]:"Simplify this `{{operator}}` expression."},languages:["js/js"]}},"unicorn/prefer-boolean-return":{create:e=>{let{sourceCode:t}=e;function r(n,o,a,i=t.getRange(n)){let s;if(!o||!a||"ConditionalExpression"===n.test.type)return;let l=St(o),u=St(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:E4},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||re(e,a),m=!c&&!Sr(n.test,e)&&!!(s=ei(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=eQ(t,e);if(r)return oh(t,"!")?`!(${n})`:`!${n}`;if(Sr(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>{if(!n.alternate){let o=oT(n,e);if(!o||"ReturnStatement"!==o.type)return;let a=r(n,Se(n.consequent),o,[t.getRange(n)[0],t.getRange(o)[1]]);return a?.fix&&t.getTokensBetween(n,o,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:E4}:a}return r(n,Se(n.consequent),Se(n.alternate))})},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[E4]:"Return the boolean expression directly."},languages:["js/js"]}},"unicorn/prefer-flat-math-min-max":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",e=>{let r=(e=>{for(let t of So)if(Sa(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>Sa(e,r))||((e,t)=>{let{parent:r}=e;return Sa(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:Sn,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=Si(e,r).map(e=>t.getText(e)).join(", ");yield n.replaceText(e,`${a}(${i})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer flat `Math.min()` and `Math.max()` calls over nested calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Sn]:"Prefer a flat `Math.{{method}}()` call instead of nested calls."},languages:["js/js"]}},"unicorn/prefer-hoisting-branch-code":{create:e=>{e.on("IfStatement",t=>(function*(e,t){if("IfStatement"===e.parent.type&&e.parent.alternate===e)return;let r=function(e){let t=[],r=e;for(;r?.type==="IfStatement";r=r.alternate)t.push(r.consequent);if(r)return t.push(r),t}(e);if(!r||r.some(e=>"BlockStatement"!==e.type))return;let{sourceCode:n}=t,{leading:o,trailing:a,minLength:i}=function(e,t){let r=Math.min(...e.map(e=>e.length)),n=0;for(;n<r&&e.every(r=>Sm(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>Sm(r.at(-1-o),e[0].at(-1-o),t));)o++;return{leading:n,trailing:o,minLength:r}}(r.map(e=>e.body),n);0===o&&0===a||!(o+a>=i)&&(o>0&&(yield Sg({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield Sg({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!1},t)))})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer moving code shared by all branches of an `if` statement out of the branches.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[Ss]:"These branches start with the same code. Move it before the `if` statement.",[Sl]:"These branches end with the same code. Move it after the `if` statement.",[Su]:"Move the shared code out of the branches."},languages:["js/js"]}},"unicorn/prefer-single-replace":{create:e=>{let{sourceCode:t}=e;e.on("CallExpression",r=>{if(void 0===SE(r))return;let n=r.arguments[1];if(!e1(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==SE(e)&&e1(e.arguments[1])&&e.arguments[1].value===o,{parent:i}=r;if("MemberExpression"===i.type&&i.object===r&&"CallExpression"===i.parent.type&&i.parent.callee===i&&a(i.parent))return;let s=[],l=r;for(;a(l);)s.push(SE(l)),l=l.callee.object;if(s.length<2)return;let u=l;s.reverse();let p=[...new Set(s)];if(p.some(e=>o.includes(e)))return;let c={node:r,messageId:Sh};if(0===t.getCommentsInside(r).length){let t=p.map((e,t)=>(function(e,t,r){if(Sb.has(e))return Sb.get(e);if("^"===e)return t?String.raw`\^`:"^";if("-"===e)return t||r?"-":String.raw`\-`;let n=e.codePointAt(0);return n<32||127===n?String.raw`\x${n.toString(16).toUpperCase().padStart(2,"0")}`:e})(e,0===t,t===p.length-1)).join(""),o=eQ(u,e),a=eQ(n,e);c.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return c})},meta:{type:"suggestion",docs:{description:"Enforce combining multiple single-character replacements into a single `String#replaceAll()` with a regular expression.",recommended:"unopinionated"},fixable:"code",messages:{[Sh]:"Combine these single-character replacements into a single `replaceAll()` with a regular expression."},languages:["js/js"]}},"unicorn/consistent-tuple-labels":{create:e=>{e.on("TSTupleType",e=>{let t=e.elementTypes;if(t.length<2)return;let r=t.filter(e=>"TSNamedTupleMember"!==e.type&&("TSRestType"!==e.type||"TSNamedTupleMember"!==e.typeAnnotation.type));if(0!==r.length&&r.length!==t.length)return r.map(e=>({node:e,messageId:SS}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[SS]:"This tuple element should have a label, just like the other elements."},languages:["js/js"]}},"unicorn/no-invalid-well-known-symbol-methods":{create:e=>{e.on("MethodDefinition",t=>Sj(t,e)),e.on("Property",t=>Sj(t,e)),e.on("PropertyDefinition",t=>Sj(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[SD]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[Sv]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[SC]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[SA]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[ST]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=fF(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!td(e,{methods:SP,computed:!1}))return;let{callee:t}=e,r=ry(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=ei(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!r8(o=u.name,e)&&(fk.test(o.name)||r3(o,e))))return;let c=fI(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=SF;return c?m=SR:d&&(m=SB),{node:n,messageId:m,data:{name:i.name,method:s}}})},meta:{type:"problem",docs:{description:"Disallow event-control method calls after the synchronous event dispatch has finished.",recommended:!0},schema:[],messages:{[SF]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[SB]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[SR]:"`{{name}}.{{method}}()` may run after synchronous event dispatch has finished. Call it in the outer handler before deferring work."},languages:["js/js"]}},"unicorn/prefer-abort-signal-timeout":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,i=e.parent,{id:s,init:l}=e;if("VariableDeclaration"!==i.type||"const"!==i.kind||1!==i.declarations.length||"Identifier"!==s.type||!(te(l,{name:"AbortController",argumentsLength:0})&&n_(l.callee,t))||(n=ei(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||rt(t,a.getRange(l))||s.typeAnnotation&&rt(t,a.getRange(s.typeAnnotation)))return;let u=(e=>{let t=Array.isArray(e.parent.body)?e.parent.body:Array.isArray(e.parent.consequent)?e.parent.consequent:void 0;if(t)return t[t.indexOf(e)+1]})(i),p=((e,t)=>{if(e?.type==="ExpressionStatement"&&e7(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1})&&n_(e.expression.callee,t))return e.expression})(u,t);if(!p||((e,t,r)=>{let{sourceCode:n}=e,[,o]=n.getRange(t),[a]=n.getRange(r);return n.getAllComments().some(e=>{let[t,r]=n.getRange(e);return t>=o&&r<=a})})(t,i,u)||rt(t,a.getRange(u))||re(t,u))return;let c=((e,t)=>{let[r]=e.arguments,n=!r||"ArrowFunctionExpression"!==r.type&&"FunctionExpression"!==r.type||r.async||r.generator||r.params.length>0?void 0:"BlockStatement"!==r.body.type?r.body:1===r.body.body.length&&"ExpressionStatement"===r.body.body[0].type?r.body.body[0].expression:void 0;if(e7(n,{argumentsLength:0,optional:!1})&&tc(n.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===n.callee.object.type&&n.callee.object.name===t)return n.callee.object})(p,s.name);if(!c)return;let d=ei(a.getScope(s),s);if(!d||ei(a.getScope(c),c)!==d)return;let m=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(e===t||o.init)continue;if(o.isWrite())return;let a=SO(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(d,c,t);if(!m)return;let f=a.getRange(u),[,g]=p.arguments;if("SequenceExpression"===g.type||!((e,t)=>{let r=ew(e,t.sourceCode.getScope(e));if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=SN})(g,t)||m.some(e=>{let r;return(r=t.sourceCode.getRange(e))[0]>=f[0]&&r[1]<=f[1]}))return;let y=(r=s.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||SU(o,d,d.identifiers[0],t)||m.some(e=>SU(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:SL,suggest:[{messageId:S$,*fix(e){if(yield e.replaceText(l,h),s.typeAnnotation&&(yield e.replaceText(s.typeAnnotation,": AbortSignal")),y!==s.name){let[t]=a.getRange(s);yield e.replaceTextRange([t,t+s.name.length],y)}for(let t of m)yield e.replaceText(t,y);yield o7(u,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[SL]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[S$]:"Replace with `AbortSignal.timeout()`."},languages:["js/js"]}},"unicorn/prefer-aggregate-error":{create:e=>{e.on("IfStatement",t=>{var r;let n,o="ThrowStatement"===(r=t.consequent).type?r:"BlockStatement"===r.type&&1===r.body.length&&"ThrowStatement"===r.body[0].type?r.body[0]:void 0;if(!o)return;let a=function(e,t){let r=e.argument;if(te(r,{name:"Error",maximumArguments:2})&&n_(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=SH(e.test).map(e=>(function(e,t){let r=SJ(e=SV(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=SJ(e.left,t);if(n&&SX(e.operator,e.right,!0))return n;let o=SJ(e.right,t);if(o&&SX(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=n1("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:Sq,fix:e.sourceCode.getCommentsInside(a).length>0?void 0:e=>{let t=[s.getText(i),...a.arguments.map(e=>s.getText(e))].join(", ");return e.replaceText(a,`new AggregateError(${t})`)}}})},meta:{type:"suggestion",docs:{description:"Prefer `AggregateError` when throwing collected errors.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Sq]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{let r;if(td(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!De(t.callee.object,e):!(e7(t,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1})&&n_(t.callee,e)))return;let[n,o]=t.arguments,a=e3(r=ry(n))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(r,e);if(!SQ.has(a))return;let i=((e,t)=>{if(tl(e=ry(e)))return e;if("Identifier"!==e.type)return;let r=ei(t.sourceCode.getScope(e),e);if(!r||1!==r.defs.length)return;let[n]=r.defs;if("FunctionName"===n.type)return n.node;let o=n.node.init&&ry(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tl(o))return o})(o,e);if(i&&Dl(i.body,e))return{node:n,messageId:a}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:SY,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!Df(e,t)||t.sourceCode.getCommentsInside(e).length>0)return;let[r]=e.arguments;if("ArrayExpression"===r.type&&r.elements.length>=2&&r.elements.every(e=>{let r;return Db(e,t)&&(r=e.argument,te(r,{name:"Set",argumentsLength:0})&&n_(r.callee,t)||!eL(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:Du,fix:n=>n.replaceText(e,Dy(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=Dg(r,t);for(let e of n)o+=`.union(${eQ(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!Df(t,e))return;let[n]=t.arguments;return DS((e=>{for(;e?.type==="ParenthesizedExpression"||rg(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=Dx(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return DS(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[Du]:"Use `Set#union()` instead of spreading Sets into a new Set.",[Dp]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[Dc]:"Use `Set#intersection()`.",[Dd]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[Dm]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=Dw(r.consequent),o=Dw(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&Dk(e,t)&&!rh(e.receiver)&&!rh(t.receiver)&&!DI(e,r)&&!DI(t,r)))(n,o,e))return;let a="setAttribute"===n.method?n:o,i=n===a,s=function e(t,r,n,o=!1){if("ChainExpression"===t.type)return e(t.expression,r,n,o);if("UnaryExpression"===t.type&&"!"===t.operator&&t.prefix)return e(t.argument,r,n,!o);let a=DT(t);if(a?.method==="hasAttribute"&&Dk(a,r)&&!rh(a.receiver))return{isNegative:o,isKnownNonDom:DI(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":DC(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==e3(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||t7(e,r,c)?void 0:function*(n){var o;let i,s=(i=eQ(o=a.receiver,e),!eZ(o,e.sourceCode)&&og(o,e)?`(${i})`:i),u=eQ(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),nQ(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield o8(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:DD};if(!t)return n;let o="IfStatement"!==e.type&&!(ti(e)||ti(e.parent));return r||o?n.suggest=[{messageId:Dv,fix:t}]:n.fix=t,n})(r,d,{forceSuggestion:!!l||!a.hasEmptyAttributeValue})})},meta:{type:"suggestion",docs:{description:"Prefer using `Element#toggleAttribute()` to toggle attributes.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[DD]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[Dv]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(td(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&DP("Object",e,t)))return;let[r]=e.arguments,n=DN(r,t);if(!n)return;let o=DO(e,r,DM(n.query,t),t);return Dq({node:e,query:n.query,replacement:o,preservedNodes:[...DU(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rg(r)&&r.expression===t;)t=r,r=r.parent;return r?.arguments?.[0]===t?r:void 0})(t))&&("CallExpression"===r.type&&1===r.arguments.length&&"MemberExpression"===r.callee.type&&"Identifier"===r.callee.object.type&&"Object"===r.callee.object.name&&((e,t,{computed:r})=>r?e3(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||te(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=DN(t,e);if(o)return Dq({node:t,query:o.query,replacement:DM(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=te(e,{name:"Map",argumentsLength:1})&&DP("Map",e,t);if(!r&&!te(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=DN(n,t);if(!o)return;let a=D$(o.query,t),i=DM(o.query,t),s=DO(e,n,r?i:a,t);return Dq({node:e,query:o.query,replacement:s,preservedNodes:[...DU(e,n,t),o.query]},t)})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `URLSearchParams` over manually splitting query strings.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Dj]:"Prefer `URLSearchParams` over manually splitting query strings.",[DF]:"Use `{{replacement}}`."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=d.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v69.0.0/docs/rules/${r}.md`)}},create:op(t.create)}]})))};module.exports=DW;