@eslint-sukka/eslint-plugin-sukka-full 8.14.0 → 8.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +21 -21
  2. package/package.json +4 -3
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";let e,t,r,n;var o,a,i=require("eslint-plugin-sukka"),s=require("node:vm"),l=require("url"),u=require("path"),p=require("fs"),c=require("vm"),d=require("worker_threads"),m=require("node:assert/strict"),f=require("node:util/types"),g=require("node:path"),y=require("node:util"),h=require("eslint/use-at-your-own-risk"),x="u">typeof document?document.currentScript:null;function b(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 E(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function S(e){return e?.type==="MemberExpression"}function v(e){return e?.type==="AwaitExpression"}function C(e,t){return!!E(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function D(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 T(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function A(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function w({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 k(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var I=w({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||!C(t.callee.property,"flatMap")||!(T(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(A(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&A(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 j=new Set(["href","pathname","search","hash","origin"]);var F=w({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(C(e,t))return e;for(;S(e);){if(C(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=B(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=B(t.parent);if(j.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function B(e){if(S(e)&&E(e.property))return e.property.name}var R=w({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(""))}})}})}),P=w({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 L=/^toLocale(?<name>Upper|Lower)Case$/g;var N=w({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||!S(t.callee)||!E(t.callee.property))return;let{property:r}=t.callee,n=L.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),$=w({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=b(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 M=/\P{ASCII}/u;function O(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 U(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=q(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${W(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(q(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function q(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${W(t)}}`:`\\u${W(t)}`})}function W(e){return e.toString(16).padStart(4,"0").toUpperCase()}w({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:M.source,flags:"u",only:void 0}],create(e,[{pattern:t,flags:r,only:n}]){let o=t?new RegExp(t,r):M;return O(o,(t,r)=>{if(n&&n!==r)return;let a=U(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let V=/[\u061C\u202A-\u202E\u2066-\u2069]/;var _=w({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=>O(V,(t,r)=>{let n=RegExp(V.source,"gu"),o={kind:r,text:q(t.value,n)},a=U(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let z=(n=[/\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(`[${n}]`,"u"));var K=w({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=>O(z,t=>{let r=U(t,RegExp(z.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),G=w({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(J);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&&A(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=!v(t=r)||b(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${v(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function J(e){return"ReturnStatement"===e.type&&E(e.argument)}var X=w({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(!T(t))return;let n=function(e,t){let r=t.find(Y);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})=>A(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 Y(e){return"ReturnStatement"===e.type&&E(e.argument)}var H=w({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(!T(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})}})}),Q=w({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 C(e,"XMLHttpRequest")})(t)||C((r=t).callee,"ActiveXObject")&&D(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return C(e,t)||S(e)&&C(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return C(e,r)&&S(t)&&C(t.property,"load")||S(e)&&C(e.object,r)&&C(e.property,["ajax","get","post","getJSON","getScript"])}(t)||Z(t,"axios")||Z(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function Z(e,t){return C(e.callee,"require")&&D(e.arguments[0],t)}let ee=new Set(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var et=w({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||!ee.has(t.callee.name)||function(e){if(!C(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||D(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 = ")}]})}})}),er=w({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){k(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;(C(a,"toString")||D(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))})}}}}),en=w({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 eo=new Set(["BigInt","Boolean","Number","String","Symbol"]);var ea=w({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||!eo.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)})}})}),ei=w({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){k(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 es={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(es))Object.freeze(es[e]);Object.freeze(es);let el=new Set(["parent","leadingComments","trailingComments"]);function eu(e){return!el.has(e)&&"_"!==e[0]}function ep(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 ec(e,t){return"Punctuator"===e.type&&e.value===t}function ed(e){return ec(e,"=>")}function em(e){return ec(e,",")}function ef(e){return ec(e,";")}function eg(e){return ec(e,":")}function ey(e){return ec(e,"(")}function eh(e){return ec(e,")")}function ex(e){return ec(e,"{")}function eb(e){return["Block","Line","Shebang"].includes(e.type)}let eE=e=>!ef(e);function eS(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,ed);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,ey):i.getFirstToken(a,ey)).loc.start}return{start:{...n},end:{...o}}}let ev="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eC=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"])),eD=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)),eT=new Set([Object.freeze,Object.preventExtensions,Object.seal]),eA=[[Map,new Set(["size"])],[RegExp,new Set(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new Set(["size"])]];function ew(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=eI(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eI(o,t);if(null==e)return null;r.push(e.value)}}return r}let ek=Object.freeze({ArrayExpression(e,t){let r=ew(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eI(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eI(e.left,t),n=eI(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=ew(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eI(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=ej(r,t);if(null!=a){let e=o.value,t=a.value;if(eD.has(e[t]))return{value:e[t](...n)};if(eT.has(e[t]))return{value:n[0]}}}}else{let o=eI(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(eD.has(t))return{value:t(...n)};if(eT.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eI(e.test,t);return null!=r?r.value?eI(e.consequent,t):eI(e.alternate,t):null},ExpressionStatement:(e,t)=>eI(e.expression,t),Identifier(e,t){if(null!=t){let r=ep(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eC.has(r.name)&&r.name in ev)return{value:ev[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=eI(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}(ej(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=eI(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=eI(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eI(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=ej(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 eA)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eI(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eI(e.callee,t),n=ew(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(eD.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=ej(n,t),o=eI(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=eI(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eI(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eI(e.tag,t),n=ew(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=ew(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=eI(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)=>eI(e.expression,t),TSSatisfiesExpression:(e,t)=>eI(e.expression,t),TSTypeAssertion:(e,t)=>eI(e.expression,t),TSNonNullExpression:(e,t)=>eI(e.expression,t),TSInstantiationExpression:(e,t)=>eI(e.expression,t)});function eI(e,t){return null!=e&&Object.hasOwnProperty.call(ek,e.type)?ek[e.type](e,t):null}function ej(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eI(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function eF(e,t=null){try{return eI(e,t)}catch(e){return null}}function eB(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=eF(e,t);if(r)try{return String(r.value)}catch{}return null}function eR(e,t){switch(e.type){case"MemberExpression":if(e.computed)return eB(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return eB(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 eP(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=eR(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 eL=Object.freeze(new Set(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eN=Object.freeze(new Set(["-","+","!","~"]));function e$(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let eM=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(eu)){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&&eL.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&&eN.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function eO(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return eM.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||es)}function eU(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&&ey(i)&&eh(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,ey);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,ey);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 eq=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,eW=Function.call.bind(Object.hasOwnProperty),eV=Symbol("read"),e_=Symbol("call"),ez=Symbol("construct"),eK=Symbol("esm"),eG={require:{[e_]:!0}};function eJ(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class eX{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);eJ(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);eJ(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(eG)){let r=eB(t.arguments[0]);if(null==r||!eW(e,r))continue;let n=e[r],o=[r];n[eV]&&(yield{node:t,path:o,type:eV,info:n[eV]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eq.test(t.type)||null==t.source)continue;let r=t.source.value;if(!eW(e,r))continue;let n=e[r],o=[r];if(n[eV]&&(yield{node:t,path:o,type:eV,info:n[eV]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[eV]&&(yield{node:t,path:o.concat(e),type:eV,info:r[eV]})}else for(let e of t.specifiers){let t=eW(n,eK),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(eY),(e.path.length>=2||e.type!==eV)&&(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[eV]&&(yield{node:e,path:t,type:eV,info:r[eV]}),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=eR(o);if(null==e||!eW(r,e))return;t=t.concat(e);let n=r[e];n[eV]&&(yield{node:o,path:t,type:eV,info:n[eV]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[e_]&&(yield{node:o,path:t,type:e_,info:r[e_]});return}if("NewExpression"===o.type){o.callee===n&&r[ez]&&(yield{node:o,path:t,type:ez,info:r[ez]});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=ep(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=eR(n);if(null==e||!eW(r,e))continue;let o=t.concat(e),a=r[e];a[eV]&&(yield{node:n,path:o,type:eV,info:a[eV]}),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(!eW(r,o))return;t=t.concat(o);let a=r[o];a[eV]&&(yield{node:e,path:t,type:eV,info:a[eV]}),yield*this._iterateVariableReferences(ep(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(ep(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!eW(r,n))return;t=t.concat(n);let o=r[n];o[eV]&&(yield{node:e,path:t,type:eV,info:o[eV]})}}}function eY(e,t){return 1!==t||"default"!==e}eX.READ=eV,eX.CALL=e_,eX.CONSTRUCT=ez,eX.ESM=eK;let eH=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*eQ(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=eH,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!ey(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eh(o))return[n,o]}(n,t);){let[o]=n;if(r===eH&&(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,ey);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,ey);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 eZ=new WeakMap;function e0(e,t){if(!e||!eZ.has(e)){let r=[];for(let[n,o]of eQ(e,t))r.unshift(n),r.push(o);eZ.set(e,r)}return eZ.get(e)}function e1(e,t){let r=e0(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function e2(e,t){let[r,n]=e1(e,t);return t.sourceCode.text.slice(r,n)}function e3(e,t){if(eZ.has(e))return eZ.get(e).length>0;let r=eQ(e,t).next().done;return r&&eZ.set(e,[]),!r}function e8(e,t){return e?.type==="Literal"&&e.value===t}let e6=e=>e?.type==="Literal"&&"string"==typeof e.value,e9=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),e5=e=>e6(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,e4=e=>"Literal"===e.type&&"number"==typeof e.value,e7=e=>"Literal"===e.type&&!!e.regex,te=e=>e?.type==="Literal"&&"null"===e.raw,tt=e=>"Literal"===e.type&&!!e.bigint;function tr(e,t,r){return t?"Identifier"===e.type&&e.name===t:!Array.isArray(r)||0===r.length||"Identifier"===e.type&&r.includes(e.name)}let tn={},to=["CallExpression"],ta=["NewExpression"],ti=["CallExpression","NewExpression"];function ts(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=0,maximumArguments:s=1/0,allowSpreadElement:l=!1,optional:u}=t??tn;if(!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 tr(e.callee,n,o)}let tl=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return ts(e,t,ta)},tu=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function tp(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>tp(e,t)):"EmptyStatement"===r||!!t?.(e)}let tc=e=>"ArrayExpression"===e.type&&0===e.elements.length,td=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tm(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tf=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tg(e){return tf.includes(e.type)}let ty=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function th(e){return ty.includes(e.type)}let tx={};function tb(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}=t??tx;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!tr(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&tr(e.object,o,a)}let tE={};function tS(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),ts(e,{argumentsLength:(t??=tE).argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},to)&&tb(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember}))}function tv(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&e4(e.argument)&&1===e.argument.value}function tC(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 tD=e=>ts(e,{name:"require",argumentsLength:1,optional:!1},to)&&e6(e.arguments[0]);function tT(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 tA(e,t){return t.some(t=>tT(e,t))}function tw(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tA(e.parent.tag,t))}function tk(e){return e?.type==="Identifier"&&"undefined"===e.name}let tI=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tb(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tb(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&tc(a)||"Object"===r&&td(a)})(e,{...t,object:"Array"}),tj=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),tF=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tB=e=>tF(e.parent)&&e.parent.argument===e,tR=(e,t)=>tP(e.parent,t)&&e.parent.arguments[0]===e,tP=(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=ep(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tL(e,t){return!!(tF(e)||tB(e)||tP(e,t)||tR(e,t))||!!tj(e.parent)&&tL(e.parent,t)}function tN(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)||!!tj(e.parent)&&tN(e.parent)}function t$(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 tM(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tg(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&&tM(e,t))return!0}return!1}let tO={"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\b":String.raw`\b`,"\f":String.raw`\f`,"\v":String.raw`\v`,"\0":String.raw`\u{0}`};function tU(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return function(e,t="'"){if("string"!=typeof e)throw TypeError("Expected a string.");if("'"!==t&&'"'!==t)throw TypeError("Expected `quote` to be either `'` or `\"`.");let r=[...e].map(e=>{if("\\"===e)return String.raw`\\`;if(e===t)return`\\${t}`;let r=e.codePointAt(0);return r<=31||127===r||8232===r||8233===r||r>=55296&&r<=57343?tO[e]??String.raw`\u{${r.toString(16)}}`:e}).join("");return`${t}${r}${t}`}(e,t)}let tq=["await","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","yield","implements","interface","let","package","private","protected","public","static","arguments","eval"],tW=["globalThis","Infinity","NaN","undefined"];function tV({includeGlobalProperties:e=!1}={}){return new Set([...tq,...e?tW:[]])}let t_=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,tz=`(?!(?:${[...tV({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,tK=new Map,tG=new s.Script("returnValue = functionToRun()"),tJ=Symbol.for("worker"),tX=Symbol.for("events");class tY{constructor(){Object.defineProperty(this,tX,{value:new Map})}dispatchEvent(e){if(e.target=e.currentTarget=this,this["on"+e.type])try{this["on"+e.type](e)}catch(e){console.error(e)}let t=this[tX].get(e.type);null!=t&&t.forEach(t=>{try{t.call(this,e)}catch(e){console.error(e)}})}addEventListener(e,t){let r=this[tX].get(e);r||this[tX].set(e,r=[]),r.push(t)}removeEventListener(e,t){let r=this[tX].get(e);if(r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}}function tH(e,t){this.type=e,this.timeStamp=Date.now(),this.target=this.currentTarget=this.data=null}var tQ="function"==typeof Worker?Worker:d.isMainThread?t0():function(){if("function"==typeof global.WorkerGlobalScope)return;let{mod:e,name:t,type:r}=d.workerData;if(!e)return t0();let n=global.self=global,o=[];function a(){let e=o;o=null,e.forEach(e=>{n.dispatchEvent(e)})}d.parentPort.on("message",e=>{let t=new tH("message");t.data=e,null==o?n.dispatchEvent(t):o.push(t)}),d.parentPort.on("error",e=>{e.type="Error",n.dispatchEvent(e)});class i extends tY{postMessage(e,t){d.parentPort.postMessage(e,t)}close(){process.exit()}importScripts(){for(let t=0;t<arguments.length;t++){let r,n=arguments[t];r=/^data:/.test(n)?t2(n).data:p.readFileSync(new l.URL(u.posix.normalize(n),l.pathToFileURL(e)),"utf-8"),c.runInThisContext(r,{filename:n})}}}let s=Object.getPrototypeOf(global);delete s.constructor,Object.defineProperties(i.prototype,s),s=Object.setPrototypeOf(global,new i),["postMessage","addEventListener","removeEventListener","dispatchEvent"].forEach(e=>{s[e]=s[e].bind(global)}),global.name=t,global.WorkerGlobalScope=i;let m=/^data:/.test(e);if("module"===r)import(m?e:l.pathToFileURL(e)).catch(r=>{if(m&&"Not supported"===r.message)return console.warn("Worker(): Importing data: URLs requires Node 12.10+. Falling back to classic worker."),t1(e,t);console.error(r)}).then(a);else{try{/^data:/.test(e)?t1(e,t):global.importScripts(e)}catch(e){console.error(e)}Promise.resolve().then(a)}}();let tZ=l.pathToFileURL(process.cwd()+"/");function t0(){class e extends tY{constructor(e,t){let r;super();let{name:n,type:o}=t||{};e+="",r=/^data:/.test(e)?e:l.fileURLToPath(new l.URL(e,tZ));let a=new d.Worker(l.fileURLToPath("u"<typeof document?require("url").pathToFileURL(__filename).href:x&&"SCRIPT"===x.tagName.toUpperCase()&&x.src||new URL("index.cjs",document.baseURI).href),{workerData:{mod:r,name:n,type:o}});Object.defineProperty(this,tJ,{value:a}),a.on("message",e=>{let t=new tH("message");t.data=e,this.dispatchEvent(t)}),a.on("error",e=>{e.type="error",this.dispatchEvent(e)}),a.on("exit",()=>{this.dispatchEvent(new tH("close"))})}postMessage(e,t){this[tJ].postMessage(e,t)}terminate(){this[tJ].terminate()}}return e.prototype.onmessage=e.prototype.onerror=e.prototype.onclose=null,e}function t1(e,t){let{data:r}=t2(e);return c.runInThisContext(r,{filename:"worker.<"+(t||"data:")+">"})}function t2(e){let[t,r,n,o]=e.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/)||[];if(!t)throw Error("Invalid Data URL.");if(o=decodeURIComponent(o),n)if("base64"===n.toLowerCase())o=Buffer.from(o,"base64").toString();else throw Error('Unknown Data URL encoding "'+n+'"');return{type:r,data:o}}class t3 extends Error{constructor(e){super(e),this.name="TimeoutError"}}class t8 extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let t6=e=>void 0===globalThis.DOMException?new t8(e):new DOMException(e),t9=e=>{let t=void 0===e.reason?t6("This operation was aborted."):e.reason;return t instanceof Error?t:t6(t)};function t5(e,t,r){"function"==typeof r&&(r={filter:r});let n=function(e,t,r){let n,o=new Promise((o,a)=>{if(!((r={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...r}).count>=0&&(r.count===1/0||Number.isInteger(r.count))))throw TypeError("The `count` option should be at least 0 or more");r.signal?.throwIfAborted();let i=[t].flat(),s=[],{addListener:l,removeListener:u}=(e=>{let t=e.addEventListener||e.on||e.addListener,r=e.removeEventListener||e.off||e.removeListener;if(!t||!r)throw TypeError("Emitter is not compatible");return{addListener:t.bind(e),removeListener:r.bind(e)}})(e),p=(...e)=>{let t=r.multiArgs?e:e[0];(!r.filter||r.filter(t))&&(s.push(t),r.count===s.length&&(n(),o(s)))},c=e=>{n(),a(e)};for(let e of(n=()=>{for(let e of i)u(e,p);for(let e of r.rejectionEvents)u(e,c)},i))l(e,p);for(let e of r.rejectionEvents)l(e,c);r.signal&&r.signal.addEventListener("abort",()=>{c(r.signal.reason)},{once:!0}),r.resolveImmediately&&o(s)});if(o.cancel=n,"number"==typeof r.timeout){let e=function(e,t){let r,n,{milliseconds:o,fallback:a,message:i,customTimers:s={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof o||1!==Math.sign(o))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(t9(e)),n=()=>{u(t9(e))},e.addEventListener("abort",n,{once:!0})}if(o===1/0)return void e.then(l,u);let p=new t3;r=s.setTimeout.call(void 0,()=>{if(a){try{l(a())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===i?l():i instanceof Error?u(i):(p.message=i??`Promise timed out after ${o} milliseconds`,u(p))},o),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),n&&t.signal&&t.signal.removeEventListener("abort",n)});return l.clear=()=>{s.clearTimeout.call(void 0,r),r=void 0},l}(o,{milliseconds:r.timeout});return e.cancel=n,e}return o}(e,t,r={...r,count:1,resolveImmediately:!1}),o=n.then(e=>e[0]);return o.cancel=n.cancel,o}let t4=!!globalThis.process?.versions?.node;function t7(e){let t,r;if(t4){let t;r=new tQ((t=globalThis.Buffer.from(e).toString("base64"),`data:text/javascript;base64,${t}`),{type:"module"})}else r=new tQ(t=URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"})),{type:"module"});return{worker:r,cleanup:()=>{t&&URL.revokeObjectURL(t),r?.terminate()}}}function re(e){let t=`
1
+ let e,t,r,n;"use strict";var o=Map,a=RegExp,i=Set,s=WeakMap,l=WeakSet;var u,p,c=require("eslint-plugin-sukka"),d=require("@eslint-sukka/shared"),m=require("node:vm"),f=require("url"),g=require("path"),y=require("fs"),h=require("vm"),x=require("worker_threads"),b=require("node:assert/strict"),E=require("node:util/types"),v=require("node:path"),C=require("node:util"),D=require("eslint/use-at-your-own-risk"),S="u">typeof document?document.currentScript:null;function T(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 A(e){return e?.type==="Identifier"||e?.type==="PrivateIdentifier"}function w(e){return e?.type==="MemberExpression"}function k(e){return e?.type==="AwaitExpression"}function I(e,t){return!!A(e)&&("function"==typeof t?t(e.name):Array.isArray(t)?t.includes(e.name):e.name===t)}function j(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 F(e){return!!e&&["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"].includes(e.type)}function B(e,t){return e?.type==="Identifier"&&t?.type===e.type&&e.name===t.name}function R({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,s=(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 i([...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,s)},defaultOptions:t,meta:r,name:n}}function P(e){if(!e?.program)throw Error("see https://typescript-eslint.io/docs/linting/type-linting")}var L=R({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||!I(t.callee.property,"flatMap")||!(F(r=t.arguments[0])&&1===r.params.length&&"Identifier"===r.params[0].type&&r.body&&(B(r.params[0],r.body)||"BlockStatement"===r.body.type&&1===r.body.body.length&&"ReturnStatement"===r.body.body[0].type&&B(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 N=new i(["href","pathname","search","hash","origin"]);var $=R({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(I(e,t))return e;for(;w(e);){if(I(e.property,t))return e;e=e.object}}(t.left,"location");if(!r)return;let n=M(r.parent);e.report({node:t,messageId:"instead",data:{name:n},fix:function(e,t,r){let n=M(t.parent);if(N.has(n??"href"))return n=>n.replaceText(r,`${e.getText(t)}.assign(${e.getText(r.right)})`)}(e.sourceCode,r,t)})}})});function M(e){if(w(e)&&A(e.property))return e.property.name}var O=R({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(""))}})}})}),U=R({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 q=/^toLocale(?<name>Upper|Lower)Case$/g;var V=R({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||!w(t.callee)||!A(t.callee.property))return;let{property:r}=t.callee,n=q.exec(r.name);n&&e.report({node:t,data:{name:n.groups?.name},messageId:"instead",fix:e=>e.replaceText(r,r.name.replaceAll("Locale",""))})}})}),W=R({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=T(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{ASCII}/u;function z(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 K(e,t){switch(e.type){case"String":case"Template":return r=>{let n=e.value.slice(0,1),o=e.value.slice(-1),a=G(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${J(e.codePointAt(0))};`);return r.replaceText(e,n)};case"RegularExpression":return r=>{let n=new i(e.regex.flags);n.add("u");let o=new a(G(e.regex.pattern,t),[...n].join(""));return r.replaceText(e,o.toString())}}}function G(e,t){return e.replace(t,e=>{let t=e.codePointAt(0);return t>65535?`\\u{${J(t)}}`:`\\u${J(t)}`})}function J(e){return e.toString(16).padStart(4,"0").toUpperCase()}R({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:_.source,flags:"u",only:void 0}],create(e,[{pattern:t,flags:r,only:n}]){let o=t?new a(t,r):_;return z(o,(t,r)=>{if(n&&n!==r)return;let a=K(t,RegExp(o.source,"gu"));e.report({node:t,messageId:"illegal",fix:a})})}});let X=/[\u061C\u202A-\u202E\u2066-\u2069]/;var Y=R({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=>z(X,(t,r)=>{let n=RegExp(X.source,"gu"),o={kind:r,text:G(t.value,n)},a=K(t,n);e.report({node:t,data:o,messageId:"detected",fix:a})})});let H=(n=[/\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(`[${n}]`,"u"));var Q=R({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=>z(H,t=>{let r=K(t,RegExp(H.source,"gu"));e.report({node:t,messageId:"illegal",fix:r})})}),Z=R({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(ee);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&&B(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=!k(t=r)||T(t,"TryStatement")?t:t.argument,l=(e=>{if(!n.typeAnnotation)return e;let t=o.getText(n.typeAnnotation.typeAnnotation);return`(${e}) as ${k(r)?`Promise<${t}>`:t}`})(o.getText(s));return[e.remove(a),e.replaceText(i.argument,l)]})})}})});function ee(e){return"ReturnStatement"===e.type&&A(e.argument)}var et=R({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(!F(t))return;let n=function(e,t){let r=t.find(er);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})=>B(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 er(e){return"ReturnStatement"===e.type&&A(e.argument)}var en=R({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(!F(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})}})}),eo=R({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 I(e,"XMLHttpRequest")})(t)||I((r=t).callee,"ActiveXObject")&&j(r.arguments[0],/xmlhttp/i))&&e.report({node:t,messageId:"callee"})},CallExpression(t){((function({callee:e}){let t="$http";return I(e,t)||w(e)&&I(e.object,t)})(t)||function({callee:e,parent:t}){let r=["$","jQuery"];return I(e,r)&&w(t)&&I(t.property,"load")||w(e)&&I(e.object,r)&&I(e.property,["ajax","get","post","getJSON","getScript"])}(t)||ea(t,"axios")||ea(t,"request"))&&e.report({node:t,messageId:"callee"})}})});function ea(e,t){return I(e.callee,"require")&&j(e.arguments[0],t)}let ei=new i(["setTimeout","setInterval","requestAnimationFrame","requestIdleCallback"]);var es=R({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||!ei.has(t.callee.name)||function(e){if(!I(e.callee,"setTimeout"))return!1;let t=e.arguments[1];return!t||j(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 = ")}]})}})}),el=R({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){P(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;(I(a,"toString")||j(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))})}}}}),eu=R({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 ep=new i(["BigInt","Boolean","Number","String","Symbol"]);var ec=R({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||!ep.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)})}})}),ed=R({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){P(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 em={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(em))Object.freeze(em[e]);Object.freeze(em);let ef=new i(["parent","leadingComments","trailingComments"]);function eg(e){return!ef.has(e)&&"_"!==e[0]}function ey(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 eh(e,t){return"Punctuator"===e.type&&e.value===t}function ex(e){return eh(e,"=>")}function eb(e){return eh(e,",")}function eE(e){return eh(e,";")}function ev(e){return eh(e,":")}function eC(e){return eh(e,"(")}function eD(e){return eh(e,")")}function eS(e){return eh(e,"{")}function eT(e){return["Block","Line","Shebang"].includes(e.type)}let eA=e=>!eE(e);function ew(e,t){let r=e.parent,n=null,o=null;if("ArrowFunctionExpression"===e.type){let r=t.getTokenBefore(e.body,ex);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,eC):i.getFirstToken(a,eC)).loc.start}return{start:{...n},end:{...o}}}let ek="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},eI=Object.freeze(new i(["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"])),ej=new i([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)),eF=new i([Object.freeze,Object.preventExtensions,Object.seal]),eB=[[Map,new i(["size"])],[RegExp,new i(["dotAll","flags","global","hasIndices","ignoreCase","multiline","source","sticky","unicode"])],[Set,new i(["size"])]];function eR(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=eL(o.argument,t);if(null==e)return null;r.push(...e.value)}else{let e=eL(o,t);if(null==e)return null;r.push(e.value)}}return r}let eP=Object.freeze({ArrayExpression(e,t){let r=eR(e.elements,t);return null!=r?{value:r}:null},AssignmentExpression:(e,t)=>"="===e.operator?eL(e.right,t):null,BinaryExpression(e,t){if("in"===e.operator||"instanceof"===e.operator)return null;let r=eL(e.left,t),n=eL(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=eR(e.arguments,t);if(null!=n)if("MemberExpression"===r.type){if("PrivateIdentifier"===r.property.type)return null;let o=eL(r.object,t);if(null!=o){if(null==o.value&&(o.optional||e.optional))return{value:void 0,optional:!0};let a=eN(r,t);if(null!=a){let e=o.value,t=a.value;if(ej.has(e[t]))return{value:e[t](...n)};if(eF.has(e[t]))return{value:n[0]}}}}else{let o=eL(r,t);if(null!=o){if(null==o.value&&e.optional)return{value:void 0,optional:!0};let t=o.value;if(ej.has(t))return{value:t(...n)};if(eF.has(t))return{value:n[0]}}}return null},ConditionalExpression(e,t){let r=eL(e.test,t);return null!=r?r.value?eL(e.consequent,t):eL(e.alternate,t):null},ExpressionStatement:(e,t)=>eL(e.expression,t),Identifier(e,t){if(null!=t){let r=ey(t,e);if(null!=r){if(null!=r&&0===r.defs.length&&eI.has(r.name)&&r.name in ek)return{value:ek[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=eL(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}(eN(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=eL(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=eL(e.right,t);if(null!=n)return n}return null},MemberExpression(e,t){if("PrivateIdentifier"===e.property.type)return null;let r=eL(e.object,t);if(null!=r){if(null==r.value&&(r.optional||e.optional))return{value:void 0,optional:!0};let n=eN(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 eB)if(r.value instanceof e&&t.has(n.value))return{value:r.value[n.value]}}}return null},ChainExpression(e,t){let r=eL(e.expression,t);return null!=r?{value:r.value}:null},NewExpression(e,t){let r=eL(e.callee,t),n=eR(e.arguments,t);if(null!=r&&null!=n){let e=r.value;if(ej.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=eN(n,t),o=eL(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=eL(n.argument,t);if(null==e)return null;Object.assign(r,e.value)}return{value:r}},SequenceExpression:(e,t)=>eL(e.expressions[e.expressions.length-1],t),TaggedTemplateExpression(e,t){let r=eL(e.tag,t),n=eR(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=eR(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=eL(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)=>eL(e.expression,t),TSSatisfiesExpression:(e,t)=>eL(e.expression,t),TSTypeAssertion:(e,t)=>eL(e.expression,t),TSNonNullExpression:(e,t)=>eL(e.expression,t),TSInstantiationExpression:(e,t)=>eL(e.expression,t)});function eL(e,t){return null!=e&&Object.hasOwnProperty.call(eP,e.type)?eP[e.type](e,t):null}function eN(e,t){let r="Property"===e.type?e.key:e.property;return e.computed?eL(r,t):"Identifier"===r.type?{value:r.name}:"Literal"===r.type?r.bigint?{value:r.bigint}:{value:String(r.value)}:null}function e$(e,t=null){try{return eL(e,t)}catch(e){return null}}function eM(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=e$(e,t);if(r)try{return String(r.value)}catch{}return null}function eO(e,t){switch(e.type){case"MemberExpression":if(e.computed)return eM(e.property,t);if("PrivateIdentifier"===e.property.type)break;return e.property.name;case"Property":case"MethodDefinition":case"PropertyDefinition":if(e.computed)return eM(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 eU(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=eO(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 eq=Object.freeze(new i(["==","!=","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","|","^","&","in"])),eV=Object.freeze(new i(["-","+","!","~"]));function eW(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}let e_=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(eg)){let n=e[o];if(Array.isArray(n)){for(let e of n)if(eW(e)&&this.$visit(e,t,r))return!0}else if(eW(n)&&this.$visit(n,t,r))return!0}return!1},ArrowFunctionExpression:()=>!1,AssignmentExpression:()=>!0,AwaitExpression:()=>!0,BinaryExpression(e,t,r){return!!(t.considerImplicitTypeConversion&&eq.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&&eV.has(e.operator)&&"Literal"!==e.argument.type)||this.$visitChildren(e,t,r)},UpdateExpression:()=>!0,YieldExpression:()=>!0}));function ez(e,t,r={}){let{considerGetters:n=!1,considerImplicitTypeConversion:o=!1}=r;return e_.$visit(e,{considerGetters:n,considerImplicitTypeConversion:o},t.visitorKeys||em)}function eK(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&&eC(i)&&eD(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,eC);return null;case"DoWhileStatement":if(r.test===e)return t.getTokenAfter(r.body,eC);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 eG=/^(?:Import|Export(?:All|Default|Named))Declaration$/u,eJ=Function.call.bind(Object.hasOwnProperty),eX=Symbol("read"),eY=Symbol("call"),eH=Symbol("construct"),eQ=Symbol("esm"),eZ={require:{[eY]:!0}};function e0(e){return null==e||0!==e.defs.length||e.references.some(e=>e.isWrite())}class e1{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);e0(o)||(yield*this._iterateVariableReferences(o,n,r,!0))}for(let t of this.globalObjectNames){let r=[],n=this.globalScope.set.get(t);e0(n)||(yield*this._iterateVariableReferences(n,r,e,!1))}}*iterateCjsReferences(e){for(let{node:t}of this.iterateGlobalReferences(eZ)){let r=eM(t.arguments[0]);if(null==r||!eJ(e,r))continue;let n=e[r],o=[r];n[eX]&&(yield{node:t,path:o,type:eX,info:n[eX]}),yield*this._iteratePropertyReferences(t,o,n)}}*iterateEsmReferences(e){for(let t of this.globalScope.block.body){if(!eG.test(t.type)||null==t.source)continue;let r=t.source.value;if(!eJ(e,r))continue;let n=e[r],o=[r];if(n[eX]&&(yield{node:t,path:o,type:eX,info:n[eX]}),"ExportAllDeclaration"===t.type)for(let e of Object.keys(n)){let r=n[e];r[eX]&&(yield{node:t,path:o.concat(e),type:eX,info:r[eX]})}else for(let e of t.specifiers){let t=eJ(n,eQ),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(e2),(e.path.length>=2||e.type!==eX)&&(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[eX]&&(yield{node:e,path:t,type:eX,info:r[eX]}),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=eO(o);if(null==e||!eJ(r,e))return;t=t.concat(e);let n=r[e];n[eX]&&(yield{node:o,path:t,type:eX,info:n[eX]}),yield*this._iteratePropertyReferences(o,t,n)}return}if("CallExpression"===o.type){o.callee===n&&r[eY]&&(yield{node:o,path:t,type:eY,info:r[eY]});return}if("NewExpression"===o.type){o.callee===n&&r[eH]&&(yield{node:o,path:t,type:eH,info:r[eH]});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=ey(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=eO(n);if(null==e||!eJ(r,e))continue;let o=t.concat(e),a=r[e];a[eX]&&(yield{node:n,path:o,type:eX,info:a[eX]}),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(!eJ(r,o))return;t=t.concat(o);let a=r[o];a[eX]&&(yield{node:e,path:t,type:eX,info:a[eX]}),yield*this._iterateVariableReferences(ey(this.globalScope,e.local),t,a,!1);return}if("ImportNamespaceSpecifier"===n)return void(yield*this._iterateVariableReferences(ey(this.globalScope,e.local),t,r,!1));if("ExportSpecifier"===n){let n="Identifier"===e.local.type?e.local.name:e.local.value;if(!eJ(r,n))return;t=t.concat(n);let o=r[n];o[eX]&&(yield{node:e,path:t,type:eX,info:o[eX]})}}}function e2(e,t){return 1!==t||"default"!==e}e1.READ=eX,e1.CALL=eY,e1.CONSTRUCT=eH,e1.ESM=eQ;let e3=Symbol("SYNTAX_OPENING_PARENTHESIS_INITIAL_VALUE");function*e8(e,t){if(!e||!e.parent||"CatchClause"===e.parent.type&&e.parent.param===e)return;let r=e3,n=[e,e];for(;n=function([e,t],r){let n=r.sourceCode.getTokenBefore(e);if(!n||!eC(n))return;let o=r.sourceCode.getTokenAfter(t);if(o&&eD(o))return[n,o]}(n,t);){let[o]=n;if(r===e3&&(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,eC);return;case"DoWhileStatement":if(r.test===e)return t.sourceCode.getTokenAfter(r.body,eC);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 e6=new s;function e9(e,t){if(!e||!e6.has(e)){let r=[];for(let[n,o]of e8(e,t))r.unshift(n),r.push(o);e6.set(e,r)}return e6.get(e)}function e5(e,t){let r=e9(e,t),[n]=t.sourceCode.getRange(r[0]??e),[,o]=t.sourceCode.getRange(r.at(-1)??e);return[n,o]}function e4(e,t){let[r,n]=e5(e,t);return t.sourceCode.text.slice(r,n)}function e7(e,t){if(e6.has(e))return e6.get(e).length>0;let r=e8(e,t).next().done;return r&&e6.set(e,[]),!r}function te(e,t){return e?.type==="Literal"&&e.value===t}let tt=e=>e?.type==="Literal"&&"string"==typeof e.value,tr=(e,t)=>e?.type==="Literal"&&"boolean"==typeof e.value&&(void 0===t||e.value===t),tn=e=>tt(e)?e.value:e?.type==="TemplateLiteral"&&0===e.expressions.length?e.quasis[0].value.cooked:void 0,to=e=>"Literal"===e.type&&"number"==typeof e.value,ta=e=>"Literal"===e.type&&!!e.regex,ti=e=>e?.type==="Literal"&&"null"===e.raw,ts=e=>"Literal"===e.type&&!!e.bigint;function tl(e,t,r){return t?"Identifier"===e.type&&e.name===t:!Array.isArray(r)||0===r.length||"Identifier"===e.type&&r.includes(e.name)}let tu={},tp=["CallExpression"],tc=["NewExpression"],td=["CallExpression","NewExpression"];function tm(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=0,maximumArguments:s=1/0,allowSpreadElement:l=!1,optional:u}=t??tu;if(!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 tl(e.callee,n,o)}let tf=(e,t)=>{if("boolean"==typeof t?.optional)throw TypeError("Cannot check node.optional in `isNewExpression`.");return tm(e,t,tc)},tg=e=>"ExpressionStatement"===e.type&&"string"==typeof e.directive;function ty(e,t){let{type:r}=e;return"BlockStatement"===r?e.body.every(e=>ty(e,t)):"EmptyStatement"===r||!!t?.(e)}let th=e=>"ArrayExpression"===e.type&&0===e.elements.length,tx=e=>"ObjectExpression"===e.type&&0===e.properties.length;function tb(e){return"ExpressionStatement"===e.type||"ChainExpression"===e.type&&"ExpressionStatement"===e.parent.type}let tE=["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"];function tv(e){return tE.includes(e.type)}let tC=["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"];function tD(e){return tC.includes(e.type)}let tS={};function tT(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}=t??tS;if(!0===i&&e.optional!==i||!1===i&&e.optional)return!1;if(r||Array.isArray(n)&&n.length>0){if(!tl(e.property,r,n))return!1;s??=!1}return(!0!==s||e.computed===s)&&(!1!==s||!e.computed)&&tl(e.object,o,a)}let tA={};function tw(e,t){return e?.type==="CallExpression"&&"MemberExpression"===e.callee.type&&("string"==typeof t?t={methods:[t]}:Array.isArray(t)&&(t={methods:t}),tm(e,{argumentsLength:(t??=tA).argumentsLength,minimumArguments:t.minimumArguments,maximumArguments:t.maximumArguments,allowSpreadElement:t.allowSpreadElement,optional:t.optionalCall},tp)&&tT(e.callee,{object:t.object,objects:t.objects,computed:t.computed,property:t.method,properties:t.methods,optional:t.optionalMember}))}function tk(e){return e?.type==="UnaryExpression"&&"-"===e.operator&&to(e.argument)&&1===e.argument.value}function tI(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 tj=e=>tm(e,{name:"require",argumentsLength:1,optional:!1},tp)&&tt(e.arguments[0]);function tF(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 tB(e,t){return t.some(t=>tF(e,t))}function tR(e,t){return"TemplateLiteral"===e.type&&"TaggedTemplateExpression"===e.parent.type&&e.parent.quasi===e&&(!t||tB(e.parent.tag,t))}function tP(e){return e?.type==="Identifier"&&"undefined"===e.name}let tL=(e,t)=>(function(e,t){let{object:r,property:n,properties:o}={property:"",properties:[],...t};if(!tT(e,{property:n,properties:o,optional:!1}))return;let a=e.object;return tT(a,{object:r,property:"prototype",optional:!1})||"Array"===r&&th(a)||"Object"===r&&tx(a)})(e,{...t,object:"Array"}),tN=e=>e?.type==="LogicalExpression"&&("&&"===e.operator||"||"===e.operator),t$=e=>e?.type==="UnaryExpression"&&"!"===e.operator,tM=e=>t$(e.parent)&&e.parent.argument===e,tO=(e,t)=>tU(e.parent,t)&&e.parent.arguments[0]===e,tU=(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=ey(r.getScope(e),e);return!n||0===n.defs.length})(e.callee,t);function tq(e,t){return!!(t$(e)||tM(e)||tU(e,t)||tO(e,t))||!!tN(e.parent)&&tq(e.parent,t)}function tV(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)||!!tN(e.parent)&&tV(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 t_(e,t){if("AwaitExpression"===e.type||"YieldExpression"===e.type||"ForOfStatement"===e.type&&e.await)return!0;if(tv(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&&t_(e,t))return!0}return!1}let tz={"\n":String.raw`\n`,"\r":String.raw`\r`," ":String.raw`\t`,"\b":String.raw`\b`,"\f":String.raw`\f`,"\v":String.raw`\v`,"\0":String.raw`\u{0}`};function tK(e,t="'"){if("string"!=typeof e)throw TypeError("Unexpected string.");return function(e,t="'"){if("string"!=typeof e)throw TypeError("Expected a string.");if("'"!==t&&'"'!==t)throw TypeError("Expected `quote` to be either `'` or `\"`.");let r=[...e].map(e=>{if("\\"===e)return String.raw`\\`;if(e===t)return`\\${t}`;let r=e.codePointAt(0);return r<=31||127===r||8232===r||8233===r||r>=55296&&r<=57343?tz[e]??String.raw`\u{${r.toString(16)}}`:e}).join("");return`${t}${r}${t}`}(e,t)}let tG=["await","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","yield","implements","interface","let","package","private","protected","public","static","arguments","eval"],tJ=["globalThis","Infinity","NaN","undefined"];function tX({includeGlobalProperties:e=!1}={}){return new i([...tG,...e?tJ:[]])}let tY=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}]*/u,tH=`(?!(?:${[...tX({includeGlobalProperties:!0})].join("|")})(?![$_\\p{ID_Continue}]))`,tQ=new o,tZ=new m.Script("returnValue = functionToRun()"),t0=Symbol.for("worker"),t1=Symbol.for("events");class t2{constructor(){Object.defineProperty(this,t1,{value:new o})}dispatchEvent(e){if(e.target=e.currentTarget=this,this["on"+e.type])try{this["on"+e.type](e)}catch(e){console.error(e)}let t=this[t1].get(e.type);null!=t&&t.forEach(t=>{try{t.call(this,e)}catch(e){console.error(e)}})}addEventListener(e,t){let r=this[t1].get(e);r||this[t1].set(e,r=[]),r.push(t)}removeEventListener(e,t){let r=this[t1].get(e);if(r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}}function t3(e,t){this.type=e,this.timeStamp=Date.now(),this.target=this.currentTarget=this.data=null}var t8="function"==typeof Worker?Worker:x.isMainThread?t9():function(){if("function"==typeof global.WorkerGlobalScope)return;let{mod:e,name:t,type:r}=x.workerData;if(!e)return t9();let n=global.self=global,o=[];function a(){let e=o;o=null,e.forEach(e=>{n.dispatchEvent(e)})}x.parentPort.on("message",e=>{let t=new t3("message");t.data=e,null==o?n.dispatchEvent(t):o.push(t)}),x.parentPort.on("error",e=>{e.type="Error",n.dispatchEvent(e)});class i extends t2{postMessage(e,t){x.parentPort.postMessage(e,t)}close(){process.exit()}importScripts(){for(let t=0;t<arguments.length;t++){let r,n=arguments[t];r=/^data:/.test(n)?t4(n).data:y.readFileSync(new f.URL(g.posix.normalize(n),f.pathToFileURL(e)),"utf-8"),h.runInThisContext(r,{filename:n})}}}let s=Object.getPrototypeOf(global);delete s.constructor,Object.defineProperties(i.prototype,s),s=Object.setPrototypeOf(global,new i),["postMessage","addEventListener","removeEventListener","dispatchEvent"].forEach(e=>{s[e]=s[e].bind(global)}),global.name=t,global.WorkerGlobalScope=i;let l=/^data:/.test(e);if("module"===r)import(l?e:f.pathToFileURL(e)).catch(r=>{if(l&&"Not supported"===r.message)return console.warn("Worker(): Importing data: URLs requires Node 12.10+. Falling back to classic worker."),t5(e,t);console.error(r)}).then(a);else{try{/^data:/.test(e)?t5(e,t):global.importScripts(e)}catch(e){console.error(e)}Promise.resolve().then(a)}}();let t6=f.pathToFileURL(process.cwd()+"/");function t9(){class e extends t2{constructor(e,t){let r;super();let{name:n,type:o}=t||{};e+="",r=/^data:/.test(e)?e:f.fileURLToPath(new f.URL(e,t6));let a=new x.Worker(f.fileURLToPath("u"<typeof document?require("url").pathToFileURL(__filename).href:S&&"SCRIPT"===S.tagName.toUpperCase()&&S.src||new URL("index.cjs",document.baseURI).href),{workerData:{mod:r,name:n,type:o}});Object.defineProperty(this,t0,{value:a}),a.on("message",e=>{let t=new t3("message");t.data=e,this.dispatchEvent(t)}),a.on("error",e=>{e.type="error",this.dispatchEvent(e)}),a.on("exit",()=>{this.dispatchEvent(new t3("close"))})}postMessage(e,t){this[t0].postMessage(e,t)}terminate(){this[t0].terminate()}}return e.prototype.onmessage=e.prototype.onerror=e.prototype.onclose=null,e}function t5(e,t){let{data:r}=t4(e);return h.runInThisContext(r,{filename:"worker.<"+(t||"data:")+">"})}function t4(e){let[t,r,n,o]=e.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/)||[];if(!t)throw Error("Invalid Data URL.");if(o=decodeURIComponent(o),n)if("base64"===n.toLowerCase())o=Buffer.from(o,"base64").toString();else throw Error('Unknown Data URL encoding "'+n+'"');return{type:r,data:o}}class t7 extends Error{constructor(e){super(e),this.name="TimeoutError"}}class re extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let rt=e=>void 0===globalThis.DOMException?new re(e):new DOMException(e),rr=e=>{let t=void 0===e.reason?rt("This operation was aborted."):e.reason;return t instanceof Error?t:rt(t)};function rn(e,t,r){"function"==typeof r&&(r={filter:r});let n=function(e,t,r){let n,o=new Promise((o,a)=>{if(!((r={rejectionEvents:["error"],multiArgs:!1,resolveImmediately:!1,...r}).count>=0&&(r.count===1/0||Number.isInteger(r.count))))throw TypeError("The `count` option should be at least 0 or more");r.signal?.throwIfAborted();let i=[t].flat(),s=[],{addListener:l,removeListener:u}=(e=>{let t=e.addEventListener||e.on||e.addListener,r=e.removeEventListener||e.off||e.removeListener;if(!t||!r)throw TypeError("Emitter is not compatible");return{addListener:t.bind(e),removeListener:r.bind(e)}})(e),p=(...e)=>{let t=r.multiArgs?e:e[0];(!r.filter||r.filter(t))&&(s.push(t),r.count===s.length&&(n(),o(s)))},c=e=>{n(),a(e)};for(let e of(n=()=>{for(let e of i)u(e,p);for(let e of r.rejectionEvents)u(e,c)},i))l(e,p);for(let e of r.rejectionEvents)l(e,c);r.signal&&r.signal.addEventListener("abort",()=>{c(r.signal.reason)},{once:!0}),r.resolveImmediately&&o(s)});if(o.cancel=n,"number"==typeof r.timeout){let e=function(e,t){let r,n,{milliseconds:o,fallback:a,message:i,customTimers:s={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof o||1!==Math.sign(o))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(rr(e)),n=()=>{u(rr(e))},e.addEventListener("abort",n,{once:!0})}if(o===1/0)return void e.then(l,u);let p=new t7;r=s.setTimeout.call(void 0,()=>{if(a){try{l(a())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===i?l():i instanceof Error?u(i):(p.message=i??`Promise timed out after ${o} milliseconds`,u(p))},o),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),n&&t.signal&&t.signal.removeEventListener("abort",n)});return l.clear=()=>{s.clearTimeout.call(void 0,r),r=void 0},l}(o,{milliseconds:r.timeout});return e.cancel=n,e}return o}(e,t,r={...r,count:1,resolveImmediately:!1}),o=n.then(e=>e[0]);return o.cancel=n.cancel,o}let ro=!!globalThis.process?.versions?.node;function ra(e){let t,r;if(ro){let t;r=new t8((t=globalThis.Buffer.from(e).toString("base64"),`data:text/javascript;base64,${t}`),{type:"module"})}else r=new t8(t=URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"})),{type:"module"});return{worker:r,cleanup:()=>{t&&URL.revokeObjectURL(t),r?.terminate()}}}function ri(e){let t=`
3
3
  globalThis.onmessage = async ({data: arguments_}) => {
4
4
  try {
5
5
  const output = await (${e.toString()})(...arguments_);
@@ -8,7 +8,7 @@ Please open an issue at ${i}.`)}function tM(e,t){if("AwaitExpression"===e.type||
8
8
  globalThis.postMessage({error});
9
9
  }
10
10
  };
11
- `;async function r({worker:e,arguments_:t}){let n=t5(e,"message",{rejectionEvents:["error","messageerror"]});e.postMessage(t);let{data:{output:o,error:a}}=await n;if(a)throw a;return o}let n=async(...e)=>{let{worker:n,cleanup:o}=t7(t);try{return await r({arguments_:e,worker:n})}finally{o()}};return n.withSignal=e=>async(...n)=>{e.throwIfAborted();let{worker:o,cleanup:a}=t7(t),i=t5(e,[],{rejectionEvents:["abort"]});try{return await Promise.race([r({arguments_:n,worker:o}),i])}catch(t){throw e.throwIfAborted(),t}finally{i.cancel(),a()}},n}let rt={};function rr(e,{checkReserved:t=!0}={}){if("string"!=typeof e)throw TypeError(`Expected a string, got \`${typeof e}\`.`);return!(e.length>1e5)&&function(e,t,{timeout:r,throwOnTimeout:n}={}){try{return(function(e,{timeout:t,context:r=s.createContext()}={}){let n=(...n)=>(r.functionToRun=()=>e(...n),tG.runInNewContext(r,{timeout:t}),r.returnValue);return Object.defineProperty(n,"name",{value:`functionTimeout(${e.name||"<anonymous>"})`,configurable:!0}),n})(()=>structuredClone(e).test(t),{timeout:(e=>{if(void 0===e||Number.isNaN(e))return;let t=Math.max(1,Math.trunc(Math.abs(e)));if(Number.isFinite(t))return t})(r),context:rt})()}catch(e){if(e?.code==="ERR_SCRIPT_EXECUTION_TIMEOUT"&&!n)return!1;throw e}}(function({exact:e=!0,checkReserved:t=!0}={}){let r=`${e}${t}`,n=tK.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?tz:""}${t_.source}`;n=RegExp(e?`^${o}$`:o,"u"),tK.set(r,n)}return n}({checkReserved:t}),e,{timeout:1e3})}function rn(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}re((e,t,r)=>new RegExp(e,t).test(r)),re((e,t,r)=>{let n=new RegExp(e,t).exec(r);if(null!==n)return{match:n[0],index:n.index,groups:n.slice(1),namedGroups:n.groups??{},input:n.input}}),t=function*(e,t,r){let n=new RegExp(e,t);for(let e of r.matchAll(n))yield{match:e[0],index:e.index,groups:e.slice(1),namedGroups:e.groups??{},input:e.input}},r=`
11
+ `;async function r({worker:e,arguments_:t}){let n=rn(e,"message",{rejectionEvents:["error","messageerror"]});e.postMessage(t);let{data:{output:o,error:a}}=await n;if(a)throw a;return o}let n=async(...e)=>{let{worker:n,cleanup:o}=ra(t);try{return await r({arguments_:e,worker:n})}finally{o()}};return n.withSignal=e=>async(...n)=>{e.throwIfAborted();let{worker:o,cleanup:a}=ra(t),i=rn(e,[],{rejectionEvents:["abort"]});try{return await Promise.race([r({arguments_:n,worker:o}),i])}catch(t){throw e.throwIfAborted(),t}finally{i.cancel(),a()}},n}let rs={};function rl(e,{checkReserved:t=!0}={}){if("string"!=typeof e)throw TypeError(`Expected a string, got \`${typeof e}\`.`);return!(e.length>1e5)&&function(e,t,{timeout:r,throwOnTimeout:n}={}){try{return(function(e,{timeout:t,context:r=m.createContext()}={}){let n=(...n)=>(r.functionToRun=()=>e(...n),tZ.runInNewContext(r,{timeout:t}),r.returnValue);return Object.defineProperty(n,"name",{value:`functionTimeout(${e.name||"<anonymous>"})`,configurable:!0}),n})(()=>structuredClone(e).test(t),{timeout:(e=>{if(void 0===e||Number.isNaN(e))return;let t=Math.max(1,Math.trunc(Math.abs(e)));if(Number.isFinite(t))return t})(r),context:rs})()}catch(e){if(e?.code==="ERR_SCRIPT_EXECUTION_TIMEOUT"&&!n)return!1;throw e}}(function({exact:e=!0,checkReserved:t=!0}={}){let r=`${e}${t}`,n=tQ.get(r);if(!n){let o=`(?<![@#$_\\p{ID_Continue}\\p{ID_Start}])${t?tH:""}${tY.source}`;n=RegExp(e?`^${o}$`:o,"u"),tQ.set(r,n)}return n}({checkReserved:t}),e,{timeout:1e3})}function ru(e,t){for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}}ri((e,t,r)=>new a(e,t).test(r)),ri((e,t,r)=>{let n=new a(e,t).exec(r);if(null!==n)return{match:n[0],index:n.index,groups:n.slice(1),namedGroups:n.groups??{},input:n.input}}),t=function*(e,t,r){let n=new a(e,t);for(let e of r.matchAll(n))yield{match:e[0],index:e.index,groups:e.slice(1),namedGroups:e.groups??{},input:e.input}},r=`
12
12
  const nothing = Symbol('nothing');
13
13
  let iterator = nothing;
14
14
 
@@ -24,34 +24,34 @@ Please open an issue at ${i}.`)}function tM(e,t){if("AwaitExpression"===e.type||
24
24
  globalThis.postMessage({error});
25
25
  }
26
26
  };
27
- `,e=>(...t)=>({async *[Symbol.asyncIterator](){e.throwIfAborted();let{worker:n,cleanup:o}=t7(r),a=t5(e,[],{rejectionEvents:["abort"]});try{let e=!0;for(;;){let r=Promise.race([t5(n,"message",{rejectionEvents:["error","messageerror"]}),a]);n.postMessage(e?t:void 0),e=!1;let{data:{output:o,error:i}}=await r;if(i)throw i;let{value:s,done:l}=o;if(l)break;yield s}}catch(t){throw e.throwIfAborted(),t}finally{a.cancel(),o()}}});let ro=e=>[e,...e.childScopes.flatMap(e=>ro(e))],ra=e=>[...new Set(ro(e).flatMap(({references:e})=>e))],ri=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"]),rs=e=>"string"==typeof e&&rr(e)&&!ri.has(e),rl=(e,t)=>t.every(t=>!(rn(e,t)||ra(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),ru=()=>!0;function rp(e,t,r=ru){if(rs(e)||rs(e+="_")){for(;!rl(e,t)||!r(e,t);)e+="_";return e}}function rc(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return ey(n)&&eh(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rd(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,ey),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:em(a)?a:void 0}}function rm(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rd(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rf(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rf(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=eF(t);if(!r)return;return String(r.value)}}function rg(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rg(e.expression):e}function ry(e,t){if(e=rg(e),t=rg(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=rf(e);if(void 0!==r)return ry(e.object,t.object)&&r===rf(t);return e.computed===t.computed&&ry(e.object,t.object)&&ry(e.property,t.property)}default:return!1}}let rh=e=>null===e||"object"!=typeof e&&"function"!=typeof e,rx=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=eF(e,r.getScope(e));if(n&&rh(n.value))return{value:n.value}},rb=(e,t,r)=>{let n=rx(e,r),o=rx(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&&ry(e,t)},rE=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>rb(e,o,t))&&n.push(o),r.push(o));return n};function rS(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]}let rv=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rC=e=>rv.has(e?.type);function rD(e){for(;rC(e);)e=e.expression;return e}function rT(e){return rr(e,{checkReserved:!1})}function rA(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let rw=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),rk=([e,t],[r,n])=>e>=r&&t<=n;function rI(e,t,r=[]){let{sourceCode:n}=e,o=rw(e,t),a=r.map(t=>rw(e,t));return rA(e).some(e=>{let t=n.getRange(e);return rk(t,o)&&a.every(e=>!rk(t,e))})}function rj(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 rF=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},rB=new Set(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rR=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||rB.has(e.type),rP=e=>rR(e)||"BlockStatement"===e.type&&e.body.some(e=>rR(e));function rL(e,t){if("Identifier"!==e.type)return;let r=ep(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 rN(e,t){let{sourceCode:r}=t,[,n]=e1(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let r$=new Set(["depth","height","width"]);function rM(e){return tb(e,{properties:["length","size"],optional:!1})}function rO(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let rU=["Program","StyleSheet","Document","root"];function rq(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 rW=({identifiers:e,references:t})=>[...new Set([...e,...t.map(({identifier:e})=>e)])];function rV(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(rV(e,t))return!0}else if(rV(n,t))return!0}return!1}function r_(e){let t;return(e=rD(e),e?.type==="ChainExpression")?r_(e.expression):(t=e,(t?.type==="MemberExpression"||t?.type==="CallExpression")&&(!!e.optional||("MemberExpression"===e.type?r_(e.object):r_(e.callee))))}let rz=(e,t)=>{let{references:r=[]}=ep(e,t)||{};return r};function rK(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||rz(t,"arguments").some(({from:e})=>e===t))||!!(n&&rz(t,n).length>0))}let rG=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],rJ=new Set(["any","error","unknown"]),rX=new Set(["null","undefined"]),rY=e=>e.getSymbol()??e.aliasSymbol,rH=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function rQ(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let rZ="target",r0="non-target",r1="nullish",r2="unknown",r3=new Set(["ClassDeclaration","ClassExpression"]),r8=new Set(["FunctionDeclaration","FunctionExpression"]),r6=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),r9=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),r5=new Set(["TSNullKeyword","TSUndefinedKeyword"]),r4=e=>e===r1?r0:e,r7=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==r1):e.map(r4)).length?r0:(t.treatMixedUnionAsTarget?e.includes(rZ):e.every(e=>e===rZ))?rZ:(t.treatMixedUnionAsNonTarget?e.includes(r0):e.every(e=>e===r0))?r0:r2,ne=e=>(e=e.map(r4)).includes(rZ)?rZ:e.every(e=>e===r0)?r0:r2,nt=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>r6.has(e.type));if(r)return r;t=t.upper}},nr=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=nr(e.left);return t?`${t}.${e.right.name}`:void 0}},nn=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?rZ:t.nonTargetTypeNames?.has(e)?r0:r2},no=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?rZ:r0:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||nn(o,r)!==r2||nn(a,r)!==r2?r0:r2};function na(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return na(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?na(e.typeAnnotation,t,r,n):r2;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=nr(t.typeName);if(!s)return r2;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return r2;let n=e.typeName.right.name,o=nt(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?r2:no({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==r2)return l;if(!n.preferTypeReferenceDefinitions){let e=nn(s,n);if(e!==r2)return e}if(o.has(s))return r2;o.add(s);let u=nt(s,r);if(!u)return o.delete(s),nn(s,n);let p=r2,c=((e,t)=>{if("ImportBinding"!==e.type)return r2;if("ImportDefaultSpecifier"===e.node.type)return nn(e.node.local.name,t)===r2?r2:r0;let r=e.node.imported?.name??e.node.imported?.value;return r?no({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):r2})(u,n);return c!==r2?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=na(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=na(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?r0:ne(a.extends.map(t=>nr(t.expression)?e({typeName:t.expression},r,n,o):r2))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?r2:ns(i.superClass,r,n,o):r0),o.delete(s),p}(e,t,r,n);case"TSUnionType":return r7(e.types.map(e=>na(e,t,r,n)),r);case"TSIntersectionType":return ne(e.types.map(e=>na(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return rZ;if(r5.has(e?.type))return r1;return r9.has(e?.type)?r0:r2}}let ni=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?ns(e.superClass,t,r,n):r0;function ns(e,t,r,n=new Set){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return nn(o,r);if(n.has(o))return r2;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=r2;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=ns(i.node.init,t,r,n):i?.type==="ClassName"&&(s=ni(i.node,t,r,n)),n.delete(o),i?s:nn(o,r)}return r3.has(e.type)?ni(e,t,r,n):r2}let nl=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return na(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function nu(e,t,r,n=new Set){if(!e)return r2;if("TSSatisfiesExpression"===e.type)return nu(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=na(e.typeAnnotation,o,r);if(a!==r2)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=ep(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return r2;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=na(a.name?.typeAnnotation,i,r),l=r2;return s!==r2?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=nu(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(r3.has(n.type))return ni(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return r0;if(r8.has(n.type)){let e=nl(n,t,r);if(e!==r2)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return r0;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return r0;continue}break}}return r2})(e,t,r):r2;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 r0;if(r3.has(n.type))return n.superClass?ns(n.superClass,t.sourceCode.getScope(n),r):r0}return r2})(e,t,r):r2;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,ns(a,t.sourceCode.getScope(a),r,void 0)):r2;case"TSAsExpression":case"TSTypeAssertion":{let a=na(e.typeAnnotation,o,r);return a===r2?nu(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return nu(e.expression,t,r,n);case"SequenceExpression":return nu(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return r7([nu(e.consequent,t,r,n),nu(e.alternate,t,r,n)],r);default:return r2}})(e,t,r,n);if(i!==r2)return i;if("Identifier"!==e.type){let t,n=(t=eF(e,o))?r.getStaticType?.(t.value,e)??r2:r2;if(n!==r2)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tl(e,{name:t}))||r.targetCallNames?.some(t=>ts(e,{name:t},to)))return rZ;let s=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return r2;try{let{program:t}=n;return function e(t,r,n,o){if(rJ.has(t.intrinsicName))return r2;if(rX.has(t.intrinsicName))return r1;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):r2}if(t.isUnion())return r7(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return ne(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return rZ;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&rQ(t,r).some(t=>e(t,r,n,o)===rZ))return rZ;if(t.intrinsicName)return r0;let i=rY(t);if(!i)return r2;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?rZ:r0}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return r2}})(e,t,r);return s!==r2?s:r.isNonTargetNode?.(e,t)?r0:r2}let np=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>r4(nu(t,r,{...e,...n})),isTarget:(t,r,n)=>nu(t,r,{...e,...n})===rZ,isKnownNonTarget:(t,r,n)=>r4(nu(t,r,{...e,...n}))===r0}),nc=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>np({...n,targetTypeNames:new Set([e]),typeReferenceAliases:new Map(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),nd=new Set(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),nm=new Set([...rG,"Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),{isTarget:nf,isKnownNonTarget:ng}=np({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new Set(["Array","ReadonlyArray"]),nonTargetTypeNames:nm,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tS(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||nd.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)?rZ:"Identifier"===t.type||"MemberExpression"===t.type?r2:r0}),ny=new Set(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function nh(e,t){return!ny.has(e.type)&&ng(e,t)}let nx=new Set(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),nb=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",...nx]),{isTarget:nE,isKnownNonTarget:nS}=np({preferTypeReferenceDefinitions:!0,targetTypeImports:new Map([["react",nx]]),targetTypeNamespaceImports:new Map([["react",nx]]),targetTypeNames:nb}),{isTarget:nv}=nc({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?rZ:r2}),{isTarget:nC}=nc({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?rZ:r2}),nD=new Set(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),nT=new Set(["KeyboardEvent","React.KeyboardEvent"]),nA=new Set(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:nw}=np({targetTypeNames:nD,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?rZ:r2}}),{isKnownNonTarget:nk}=np({targetTypeNames:nT,nonTargetTypeNames:nA}),nI=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,nj=(e,t)=>"CallExpression"===e.type&&!e.optional&&"Identifier"===e.callee.type&&e.callee.name===t,nF=(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),nB=new Set(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),nR=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"]),nP=new Set(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),nL=new Set(["parseFloat","parseInt"]),nN=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&e4(e.literal),n$=new Set(["-","*","/","%","**","<<",">>","|","^","&"]);function nM(e,t){let r;if(e4(e)||nF(e,"Math",nB)||"CallExpression"===e.type&&!e.optional&&nF(e.callee,"Math",nR)||nj(e,"Number")||nF(e,"Number",nP)||"CallExpression"===e.type&&!e.optional&&nF(e.callee,"Number",nL)||nj(e,"parseInt")||nj(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&&nM(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&nM(e.left,t)&&nM(e.right,t)||">>>"===r||n$.has(r)&&(nM(e.left,t)||nM(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&nM(e.argument,t))return!0;break}case"UpdateExpression":if(nM(e.argument,t))return!0;break;case"ConditionalExpression":{let r=nM(e.consequent,t),n=nM(e.alternate,t);if(r&&n)return!0;let o=eF(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(nM(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=ep(t,e))&&r.defs.some(e=>nN(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(nN(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(nM(e.expression,t))return!0}return"number"==typeof eF(e,t)?.value}np({targetTypeNames:new Set,targetCallNames:["Number"],isTargetTypeAnnotation:nN,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?rZ:r2});let nO=new Set([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),nU=new Set(["boolean","true","false"]),nq=new Set(["isFinite","isNaN"]),nW=new Map([["Array",new Set(["isArray"])],["ArrayBuffer",new Set(["isView"])],["Atomics",new Set(["isLockFree"])],["Error",new Set(["isError"])],["Number",new Set(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new Set(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new Set(["deleteProperty","has"])],["URL",new Set(["canParse"])]]),nV=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"])]]),n_=new Map([["regexp",new Set(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function nz(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):nU.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function nK(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>nJ(e.returnType,t,r,n))}function nG({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:o}){let a=function(e){if(e?.type==="Identifier")return e.name}(e.typeName);if(!a||n.has(a))return!1;n.add(a);let i=rn(a,r),[s]=i?.defs??[],l=s?.type==="Type"?t.sourceCode.getScope(s.node):r,u=s?.type==="Type"&&o(s.node,l);return n.delete(a),u}function nJ(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nJ(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return nG({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&nJ(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>nJ(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function nX(e,t,r,n=new Set){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nX(e.typeAnnotation,t,r,n);case"TSFunctionType":return nJ(e.returnType,t,r,n);case"TSTypeLiteral":return nK(e.members,t,r,n);case"TSTypeReference":return nG({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&nX(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&nK(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>nX(e,t,r,n));default:return!1}}function nY(e,t,r=new Set){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!nJ(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?nZ(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&nZ(e.body,t,r))}function nH(e,t,r=new Set){if(e?.type!=="Identifier")return!1;let n=ep(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=>nY(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(nX(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&&nY(a,t,r)}}return r.delete(n),o}function nQ(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=ep(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=nQ(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return nQ(e.expression,t,r)}}function nZ(e,t,r=new Set){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!nJ(e.typeAnnotation,t,n)||"boolean"==typeof eF(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&&nJ(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&nZ(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)&&nZ(e.right,t,r)}return r.delete(e),a}(ep(t.sourceCode.getScope(e),e),t,r)||nz(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return nZ(e.left,t,r)&&nZ(e.right,t,r);case"BinaryExpression":return nO.has(e.operator);case"ConditionalExpression":return nZ(e.consequent,t,r)&&nZ(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),nJ(e.typeAnnotation,t,n)||nZ(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=nW.get(e.callee.object.name),n=eR(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=nV.get(nQ(e.callee.object,t)),n=eR(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?nz(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||nq.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||nH(e.callee,t,r)||nz(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=n_.get(nQ(e.object,t)),n=eR(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return nZ(e.argument??e.expression,t,r);case"SequenceExpression":return nZ(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&nZ(e.right,t,r)}return}}(e,t,r)??nz(e,t))}let n0=new Set(["asIntN","asUintN"]),n1=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n1(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return tt(e.literal);default:return!1}},{isTarget:n2}=np({targetTypeNames:new Set,targetCallNames:["BigInt"],isTargetNode:e=>tt(e)||nj(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&nF(e.callee,"BigInt",n0),isTargetTypeAnnotation:n1,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?rZ:r2}),n3=new Set(["fromCharCode","fromCodePoint"]),n8=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n8(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return e6(e.literal);default:return!1}},{isTarget:n6,isKnownNonTarget:n9}=np({targetTypeNames:new Set,targetCallNames:["String"],isTargetNode:(e,t)=>{if(e6(e)||nj(e,"String")||"CallExpression"===e.type&&!e.optional&&nF(e.callee,"String",n3))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(n5(e.left,t)||n5(e.right,t));case"AssignmentExpression":if("="===e.operator)return n5(e.right,t);return"+="===e.operator&&(n5(e.left,t)||n5(e.right,t));default:return!1}},isTargetTypeAnnotation:n8,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?rZ:r2});function n5(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&n8(e.typeAnnotation)||n6(e,t))||"string"==typeof eF(e,t.sourceCode.getScope(e))?.value)}let n4=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),n7=e=>n4.has(e.type)||tk(e),oe=new Set(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),ot=new Set(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),or=e=>oe.has(e.type)||ot.has(e.type)||tk(e)||ts(e,void 0,to)&&!tS(e,{method:"bind",optionalCall:!1,optionalMember:!1}),on=(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&&on(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&on(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&&on(e,t))return!0;continue}if(on(r,t))return!0}}return!1};function oo(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function oa(e,t){let r;if(r=e=t.getNonNullableType(e),!rJ.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>oa(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let oi=e=>"use"===e||/^use[\dA-Z]/.test(e),os=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function ol(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!ep(t.sourceCode.getScope(e),e))}let ou=(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],op=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&ou(n,o,t)&&n===e},oc=new Set(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function od(e){return oc.has(e.type)}let om=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,of=e=>tm(e.parent),og=new Set(["String","Null","Boolean","Numeric","RegularExpression"]),oy=new Set(["[","(","/","`","+","-","*",",","."]);function oh(e,t,r){if(""===r||r&&!oy.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!!og.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let ox=e=>"type"===e.importKind||"type"===e.parent.importKind,ob=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],oE=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},oS=new Set(["Map","ReadonlyMap"]),ov=new Set(["Set","ReadonlySet"]),oC=oS.union(ov),oD=e=>new Set([e]),oT=e=>oC.has(e)?e:void 0,oA=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),ow=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>oA.has(e.type)))return!0;n=n.upper}return!1},ok=e=>{let t=new Set;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},oI=(e,t)=>{if(rJ.has(e.intrinsicName))return;if(e.isUnion())return ok(e.types.map(e=>oI(e,t)));let r=rY(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&oT(n);return o&&oD(o)},oj=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oj(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?oj(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||ow(e.typeName.name,e,t))return;let r=oT(e.typeName.name);return r&&oD(r)}case"TSUnionType":return ok(e.types.map(e=>oj(e,t)))}},oF=(e,t,r=new Set)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=oI(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(ow(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tl(e,{names:["Map","Set"]})&&ol(e.callee,t))return oD(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=ep(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=oj(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=oF(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return oj(e.typeAnnotation,t)??oF(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return oF(e.expression,t,r);case"ConditionalExpression":return ok([oF(e.consequent,t,r),oF(e.alternate,t,r)])}})(e,t,r),oB=(e,t)=>{let r=oF(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(oS.has(e)){n=!0;continue}if(ov.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function oR(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)oR(r,t)}class oP extends Error{name="FixAbortError"}let oL={abort(){throw new oP("Fix aborted.")}};function oN(e){return t=>{let r=e(t,oL),n=[];try{return oR(r,e=>{n.push(e)}),n}catch(e){if(e instanceof oP)return;throw e}}}class o${#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){let r=t=>{let r;t&&e.report((r={...t},t.fix&&(r.fix=oN(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:oN(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&oR(t,r)}}}(this.#e,r);return e}}let oM=new Set;function oO(e){return oM.has(e)?e:t=>{let r=new o$(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return m.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function oU(e,t){var r;let{visitScriptBlock:n=!0}={},o=oO(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},oM.add(r),r}let oq={"??":4,"||":4,"&&":5},oW={"|":6,"^":7,"&":8,"==":9,"!=":9,"===":9,"!==":9,"<":10,"<=":10,">":10,">=":10,in:10,instanceof:10,"<<":11,">>":11,">>>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":15};function oV(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return oq[e.operator];case"BinaryExpression":return oW[e.operator];case"TSAsExpression":case"TSSatisfiesExpression":return 10;case"UnaryExpression":case"AwaitExpression":case"TSTypeAssertion":case"TSNonNullExpression":return 16;case"UpdateExpression":return e.prefix?16:17;case"CallExpression":case"ChainExpression":case"ImportExpression":return 18;case"NewExpression":return 19;default:return 20}}function o_(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let oz=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function oK(e){if(e4(e=rD(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=oK(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!rc(e,t);case"Literal":let r;return!!(e4(e)&&(r=e.raw,oz.test(r)));default:return!0}}let oJ=new Set(["!","typeof","void","delete","~","+","-"]),oX=new Set(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function oY(e,t){if(!oJ.has(t))throw Error("Unexpected operator");return 16>oV(e)||oX.has(e.type)}function oH(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))}function oQ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oZ={exports:{}},o0=oZ.exports,o1=oQ(function(){return o?oZ.exports:(o=1,oZ.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}(),oZ.exports)}());function o2(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 o3(e,t){let r=[],n=new WeakMap,o=new WeakMap,a=new WeakSet;return e.on("onCodePathStart",()=>{r.push(new Set)}),e.on("onCodePathEnd",()=>{r.pop()}),e.on("onCodePathSegmentStart",e=>{r.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{r.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable)&&a.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{n.set(e,new Set(r.at(-1)))}),e.onExit("IfStatement",e=>{let i=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let s=n.get(r),l=s&&[...i].every(e=>e.prevSegments.every(e=>!s.has(e)))||t?.(r);o.set(r,a.has(e)&&!!l)}}),e=>!!(e&&o.get(e))}function o8(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 o6=(e,t)=>o8(e,t,-1),o9=(e,t)=>o8(e,t,1),o5=e=>e.charAt(0).toUpperCase()+e.slice(1),o4=e=>e.charAt(0).toLowerCase()+e.slice(1),o7="too-deep",ae="should-parenthesized",at="prefer-event-target",ar=new Set(["@angular/core","eventemitter3"]),an=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 ao(e){let t;return!!e&&(tD(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(e6(t)&&ar.has(t.value)))}let aa={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"},ai="prefer-keyboard-event-key",as="prefer-keyboard-event-key/suggestion",al=new Set(["keyCode","charCode","which"]),au=new Set(["onKeyDown","onKeyPress","onKeyUp"]),ap=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)},ac=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tS(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&&au.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))ap(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!nk(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},ad=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,am=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tg(n)&&r.push(...ac(e,n));return r},af=(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)&&e4(a)))return;let i=Object.hasOwn(aa,t=a.value)?aa[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:ai,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tU(r.key))];return t?n.fix=o:n.suggest=[{messageId:as,data:{key:r.key},fix:o}],n},ag=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),ay=(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)},ah="error",ax="suggestion";function*ab(e,t,r){for(let n of e0(e,r))yield t.remove(n)}function aE(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=em(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function aS(e,t,r){let n=function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=e0(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(1===r.arguments.length){let e=s.getTokenAfter(i);em(e)&&([,u]=s.getRange(e))}else if(0===n){let e=s.getTokenAfter(i),t=s.getTokenAfter(e,{includeComments:!0});[u]=s.getRange(t)}else{let e=s.getTokenBefore(a);[l]=s.getRange(e)}return[l,u]}(t,r),o=t.parent;if(0===o.arguments.indexOf(t)&&o.arguments.length>1&&rF(r,n)){let{sourceCode:o}=r,a=e0(t,r).at(-1)||t,[,i]=o.getRange(a),s=o.getTokenAfter(a),[l,u]=o.getRange(s),p=o.text.slice(...n),c=p.slice(i-n[0],l-n[0])+p.slice(u-n[0]);return e.replaceTextRange(n,c)}return e.removeRange(n)}function av(e,t,r,n){return e.replaceTextRange(e1(t,n),r)}function aC(e,t,r,n){let o=e2(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!oG(r,n):od(r))||e3(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),oh(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*aD(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);ef(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function aT(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*aA(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield aT(n,t,r),rc(e,t)||(yield r.insertTextAfter(e,"()")),oo(n,e.callee,t)||e3(e,t)||(yield aD(r,e.parent,t))}let aw=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*ak(e,t,r){let{sourceCode:n}=r,o=e1(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&aw(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&aw(i)&&(yield e.insertTextBefore(i," "))}function*aI(e,t,r){var n;yield ak(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!e3(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 aj(e,t,r,n){let[,o]=e1(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let aF=(e,t,r)=>aj(e,t,r,"");function*aB(e,t,r){let n=t.callee;yield aF(e,n,r);let[,o]=e1(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function aR(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);ef(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 aP(e,t,r,n){if(om(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&om(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(op(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&&ou(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 aL=(e,t,r,n)=>rW(e).map(e=>aP(e,t,r,n)),aN=(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*a$(e,t,r,n,o){for(let t of e0(e,o?{sourceCode:o}:n))yield a$(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 aM="require-array-join-separator",aO="no-thenable-object",aU="no-thenable-export",aq="no-thenable-class",aW=(e,t)=>eF(e,t.sourceCode.getScope(e))?.value==="then",aV=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===eR(e,t.sourceCode.getScope(e)):"then"===r.name},a_=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&aV(r,t)&&(yield r.key)},messageId:aO},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){aV(e,t)&&(yield e.key)},messageId:aq},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&aV(e,t)&&(yield e.property)},messageId:aO},{selector:"CallExpression",*getNodes(e,t){if(!tS(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})||"SpreadElement"===e.arguments[0].type)return;let[,r]=e.arguments;aW(r,t)&&(yield r)},messageId:aO},{selector:"CallExpression",*getNodes(e,t){if(tS(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;aW(e,t)&&(yield e)}},messageId:aO},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:aU},{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:aU},{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:aU}],az="no-invalid-remove-event-listener",aK="consistent-function-scoping",aG=(e,t)=>e&&t&&(e===t||e.block===t.block),aJ=(e,t)=>e.some(e=>aG(e,t)),aX=["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,aQ=new Set(["FunctionExpression","ArrowFunctionExpression"]),aZ={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tf,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&&on(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tf.includes(t.type)&&tA(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&&tA(l.block.parent.callee,aX)||l&&(a=s,aQ.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||ra(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(aJ(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&aJ(u,t.scope)})||e.defs.some(e=>aJ(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||aG(i,r))&&aJ(u,r.upper)}))}(e,n,r))return{node:e,loc:eS(e,r),messageId:aK,data:{functionNameWithKind:eP(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:{[aK]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},a0="error",a1="error-unknown",a2="suggestion";function a3(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield aA(e,t,n)}}let a8="no-console-spaces",a6=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),a9=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),a5="no-empty-file",a4={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:a5}}if(r.body.some(e=>!tp(e,tu)))return;let{sourceCode:n}=e,o=rA(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:a5}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=rA(e);if(!t||!(n.length>0))return{node:r,messageId:a5}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=rA(e);if(!t||!(n.length>0))return{node:r,messageId:a5}}),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:a5}}))},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:{[a5]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},a7="no-useless-fallback-in-spread";function ie(e){return"AwaitExpression"===e.parent.type&&e.parent.argument===e?{expression:e.parent,parent:e.parent.parent,isAwaited:!0}:{expression:e,parent:e.parent,isAwaited:!1}}function it(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let ir="zero-fraction",io="dangling-dot",ia="error",ii="suggestion",is=Symbol.for("default"),il=Symbol("NAMESPACE_SPECIFIER_NAME"),iu=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},ip=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*ic(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?em:ex),[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);em(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function id(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 im={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=>{e6(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:ox(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:is,text:"default",...n};case"ImportSpecifier":return{name:iu(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:il,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:is,text:"default",isTypeExport:ip(r)};case"ExportSpecifier":return{node:r,name:iu(r.exported),text:t.getText(r.exported),isTypeExport:ip(r)};case"VariableDeclarator":{let n=r.parent.parent;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"===n.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:n,name:Symbol.for(r.id.name),text:t.getText(r.id),isJSDocumentComment:function(e,t){let r=t.getTokenBefore(e,{includeComments:!0});if(r?.type!=="Block"||!r.value.startsWith("*")||r.value.startsWith("**"))return!1;let n=t.getTokenBefore(r),o=t.getLoc(r).start,a=t.getLoc(r).end,i=t.getLoc(e).start;return(!n||t.getLoc(n).end.line<o.line)&&(a.line===i.line||a.line===i.line-1)}(n,t)}}}}(n,t);o&&(e.name!==il||o.name!==is)&&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 function*(e){for(let t of e)t.isJSDocumentComment||(yield t)}(r)){let r={node:n.node,messageId:ia,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===il)yield n.insertTextAfter(o,`
28
- export ${l?"type ":""}* as ${r.text} ${id(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,ex);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
29
- export {${s}} ${id(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield ic(t.node,n,e)),yield ic(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:ii,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:{[ia]:"Use `export…from` to re-export `{{exported}}`.",[ii]:"Switch to `export…from`."},languages:["js/js"]}},ig="prefer-native-coercion-functions",iy=new Set(["String","Number","BigInt","Boolean","Symbol"]),ih=new Set(["every","filter","find","findLast","findIndex","findLastIndex","some"]),ix=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&iy.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,ib=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},iE=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},iE(e[r],n)):e[r]=n}};class iS{static READ=eX.READ;static CALL=eX.CALL;static CONSTRUCT=eX.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=eX.READ,context:n,filter:o,handle:a}){for(let e of t)iE(this.#n,ib(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 eX(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))}}let iv="no-document-cookie",iC=new iS({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:iv})}),iD=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],iT=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",...iD("AnimationStart"),...iD("AnimationEnd"),...iD("AnimationIteration"),...iD("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"]),iA="prefer-add-event-listener",iw={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=>{tD(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(!iT.has(u))return;let p="addEventListener",c="";if(tk(i)||te(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||or(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);e3(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);e3(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:iA,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:{[iA]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},ik=new Set(["false","true"]),iI=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(os(e.left,t)||os(e.right,t)),ij=({type:e,name:t},r)=>"Identifier"===e&&t===r;function iF({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(!tS(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&iI(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&&iI(p.body.body[0].argument,p.params[0]))||nh(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(ij(f,y))l=g,u=f;else{if(!ij(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||ep(h,m).references.some(({identifier:e})=>e!==u)||rK(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);e3(l,n)&&!e3(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return eO(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!tS(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(os(r,t))return r;if("CallExpression"===r.type&&!r.optional&&ij(r.callee,"Boolean")&&1===r.arguments.length&&os(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=>ik.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||ep(p,a).references.some(({identifier:e})=>e!==u)||rK(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 iB=iF({method:"findIndex",replacement:"indexOf"}),iR=iF({method:"findLastIndex",replacement:"lastIndexOf"}),iP={create(e){iB.listen(e),iR.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:{...iB.messages,...iR.messages},languages:["js/js"]}},iL="error",iN="prefer-date",i$="prefer-date-now-over-methods",iM="prefer-date-now-over-number-data-object",iO=e=>tl(e,{name:"Date",argumentsLength:0}),iU=(e,t,r)=>({node:e,messageId:iN,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield ak(t,e,r))},...t}),iq="prefer-dataset",iW="prefer-attributes",iV=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,i_=e=>tb(e,{property:"dataset"}),iz=e=>e.computed||"Identifier"!==e.property.type?e.computed&&e6(e.property)?e.property.value:void 0:e.property.name,iK=new Set(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),iG=/[\s\u0000-\u001F"'/<=>]/,iJ=e=>iK.has(e)||e.includes("-")||iG.test(e);function iX(e,t){let r=e2(e,t);return!e3(e,t.sourceCode)&&oG(e,t)?`(${r})`:r}let iY={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(iJ(n.value)||nw(o.object,e))return;let a=iX(o.object,e),i=o.optional?"?.":".",s=tU(iV(n.value),n.raw.charAt(0)),l=rI(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return oh(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:iW,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&e6(e.left)&&i_(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tS(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&i_(e.arguments[0])&&e6(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tS(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&i_(e.callee.object)&&e6(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&i_(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||nw(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:iW,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=iz(n);if(void 0===o||iJ(o))return;let{parent:a}=n;if(nI(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=>ep(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)&&!rI(t,o)&&i.every(e=>!rI(t,e))))return;let s=iX(n.object,t);return function*(e){for(let r of(yield aR(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tU(iV(iz(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?!e6(e.key)||iJ(e.key.value):iJ(e.key.name))))return;let a=t.parent,i=iX(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!rI(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=rS(a,e),n=o.map(e=>{let t=tU(iV(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
30
- ${t}`)};`)}return{node:n,messageId:iW,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!i_(o)||nw(o.object,e))return;let a=iz(r);if(void 0===a||iJ(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(nI(r)&&!s&&!l)return;let u=iX(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tU(iV(a),c);return s&&of(i)&&!rI(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${e2(i.right,e)})`):l&&tm(i.parent)&&!rI(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return oh(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||rI(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:iW,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((tS(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tS(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tS(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&e6(t.arguments[0]))||nw(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:iq,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&r_(e.callee)||"setAttribute"===r&&!of(e)||"removeAttribute"===r&&!tm(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!rI(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=`${iX(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=rT(a)?`.${a}`:`[${tU(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${e2(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tU(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:{[iq]:"Prefer `.dataset` over `{{method}}(…)`.",[iW]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},iH="prefer-modern-math-apis",iQ=(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,iZ=(e,t)=>"CallExpression"===e.type&&!e.optional&&iQ(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function i0({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(iZ(n.left,"log")&&iQ(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):iZ(n.right,"log")&&iQ(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:iH,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${e2(s,o)})`)}}}function i1({constantName:e,replacementMethod:t}){let r={messageId:iH,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&iZ(n.left,"log")&&iQ(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${e2(a,o)})`)}}}let i2=[i0({constantName:"LOG10E",replacementMethod:"log10"}),i0({constantName:"LOG2E",replacementMethod:"log2"}),i1({constantName:"LN10",replacementMethod:"log10"}),i1({constantName:"LN2",replacementMethod:"log2"})],i3=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>i3(e)):[e],i8="number-literal-case",i6=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},i9={create:oU(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(e4(t)?o=i6(r,n):tt(t)&&(o=i6(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:i8,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:{[i8]:"Invalid number literal casing."},languages:["js/js"]}},i5="error",i4="suggestion",i7={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},se=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function st(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=se(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:i5,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 ak(e,a,t)},s;let l=e=>aP(r,`Number.${i}`,t,e);return i7[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&&nM(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:i4,fix:l}],s}let sr={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new iS({objects:Object.keys(i7).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:st,filter(t){let{node:r,path:n}=t,[o]=n;return!nI(r)&&!("Infinity"===o&&(e=>{if(!se(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&&eF(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:{[i5]:"Prefer `Number.{{property}}` over `{{description}}`.",[i4]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},sn="prefer-reflect-apply",so=(e,t)=>(te(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),sa=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,si="prefer-set-size";var ss={exports:{}},sl=oQ(function(){var e,t,r,n;return a?ss.exports:(a=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&&V("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)||V("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 S(){var t,r=[],n=H;for(r.push(v());y("|");)r.push(v());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function v(){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 C("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=H;if(t=T()||!1){if(!Y&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;H=s,V("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);V("atomEscape")}return t;case"[":return N();case"(":if(n.lookbehind&&(t=C("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=D("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(H,H+2)||":"==e[H+2])return C("(?:","ignore","(","normal");return o=H,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||V("Invalid flags for modifiers group"):a||V("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))&&V("flags cannot be duplicated for modifiers group"),y(":")||V("Invalid flags for modifiers group"),(u=D("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=T()||!1)&&(H=s,V("Expected atom")),!Y&&y("{")?u=l("{"):V("Expected atom")),t=T()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&V("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 C(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return D(o,a)}function D(t,r){var n,o=S();o||V("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 T(){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))&&V("numbers out of order in {} quantifier","",o,H),e=u(t,r,o,H)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&V("iterations outside JS safe integer range in quantifier","",o,H)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function A(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(_.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 L();V("\\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(!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)}}}()||L();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)}||L();case"-":if(t&&Y)return m(),s("singleEscape",45,"\\-");return L();default:return j()}}function k(e,t){Y&&V("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?A(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)&&V("Invalid escape sequence",null,t,H),e}return L()}function F(t){var n=h(),o=H;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||V("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(R);for(n||V("Invalid identifier");t=F(P);)n+=t;return{type:"identifier",value:n,range:[r,H],raw:e.substring(r,H)}}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 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 N(){var e,t=H;return g("[^")?(e=$(),f("]"),p(e,!0,t,H)):y("[")?(e=$(),f("]"),p(e,!1,t,H)):null}function $(){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("&")&&V("&& 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())||V("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||V("classAtom"),n=H;var r,n,o,a,i,s,u=$();return(u||V("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:Y?V("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||V("classAtom"),(o=x("]")?s:e(s))||V("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||V("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("\\");V("classEscape")}return A(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=U();)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;V("Invalid escape","\\"+h(),o)}else if(n=q())r=n;else{if(n=N())return n;V("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=U())return c(r,n,o,H);V("Invalid range end",h())}return r}function U(){if(y("\\")){var e,t=H;if(e=W())return e;V("Invalid escape","\\"+h(),t)}return q()}function q(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&V("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"))V("\\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 V(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 _=[],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 Q=S();return(Q.range[1]!==e.length&&V("Could not parse entire input - got stuck","",Q.range[1]),G=G||_.some(function(e){return e<=z}))?(H=0,K=!1,S()):Q}},ss.exports?ss.exports=n:window.regjsparser=n,ss.exports)}());let su=String.raw`\$&`,sp=new Set(String.raw`\^$.*+?()[]{}|/-`),{parse:sc}=sl,sd="method",sm="pattern",sf="split-join",sg=new Set(["i","y"]),sy=new Set(["anchor","reference"]),sh=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function sx(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`:sh(r);if("null"===t||"octal"===t)return sh(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function sb(e){return"value"===e.type?sx(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?sE(e.body):void 0:sx(e.body[0])}function sE(e){let t=[];for(let r of e){let e=sb(r);if(void 0===e)return;t.push(e)}return t.join("")}let sS=e=>{let{pattern:t,flags:r}=e.regex;try{return sc(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},sv=e=>{let t=0;for(let r of e)t+=sC(r);return t};function sC(e){return sy.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?sv(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>sC(e))):"quantifier"===e.type?e.min*sv(e.body):"group"===e.type&&"ignore"===e.behavior?sv(e.body):0}let sD=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>sD(e)),sT=e=>e4(e)&&Number.isSafeInteger(e.value)&&e.value>=0,sA=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(ry(e.left,t)&&e8(e.right,1)||e8(e.left,1)&&ry(e.right,t)))return t},sw=e=>e4(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-sw(e.argument):void 0,sk=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,sI="prefer-string-trim-start-end",sj="no-unreadable-iife",sF="suggestion",sB="throw-new-error",sR=/^(?:[A-Z][\da-z]*)*Error$/,sP="escape-uppercase",sL="escape-lowercase",sN=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,s$=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,sM=({node:e,original:t,regex:r=sN,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?sL:sP,fix:t=>o?o(t,a):t.replaceText(e,a)}},sO="prefer-unicode-code-point-escapes",sU="prefer-unicode-code-point-escapes/add-unicode-flag",sq=String.raw`\u{`,sW=/^[\da-f]$/iv,sV=/^[0-7]$/v,s_=/^[A-Za-z]$/v;function sz(e){return sV.test(e)}function sK(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function sG(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function sJ(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!sW.test(e))))return Number.parseInt(n,16)}function sX(e){return e>=55296&&e<=56319}function sY(e){return e>=56320&&e<=57343}function sH(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function sQ(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)&&!sG(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!sG(e,i)){o--,n+=s;continue}if("\\"!==s||!sK(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=sJ(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:sH(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=sJ(e,t+2,4);if(void 0===o||!n&&(sX(o)||sY(o)))return;let a=t+6;if(r&&sX(o)&&"\\"===e[a]&&sK(e,a)&&"u"===e[a+1]){let t=sJ(e,a+2,4);if(sY(t))return{end:a+6,replacement:sH((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:sH(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&s_.test(r))return{end:t+3,replacement:sH(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!sz(e[t+2])||!sz(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&sz(e[o]);)o++;return{end:o,replacement:sH(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 sZ(e,t,r){let{fixed:n,hasReplacement:o}=sQ(t);if(o)return{node:e,messageId:sO,fix:t=>r?r(t,n):t.replaceText(e,n)}}function s0(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let s1=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],s2=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],s3="missing-message",s8="message-is-empty-string",s6="message-is-not-a-string",s9=new Map([["AggregateError",1],["SuppressedError",2]]),s5=e=>"instanceof"===e.value&&"Keyword"===e.type,s4="no-instanceof-builtins",s7="switch-to-type-of",le=new Set(["String","Number","Boolean","BigInt","Symbol"]),lt=new Set(["global","globalThis","self","window"]),lr=[...s2,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...rG,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],ln=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=rq(t,e),s=i.getTokenAfter(o,s5),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield ak(n,e,t);let c=e1(o,{sourceCode:i});!e3(o,t)&&oY(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=e1(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},lo=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,la={create:oU(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new Set("strict"===r?[...lr,...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&&lt.has(n.object.name)&&ol(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:s4};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=rq(e,r),s=i.getTokenAfter(o,s5);yield ak(t,r,e);let l=e1(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield a$(s,"",t,e,i),yield a$(a,"",t,e,i)},p}return"Function"===l?(lo(n,e)||(p.fix=ln(r,e,l)),p):le.has(l)?(lo(n,e)||(p.suggest=[{messageId:s7,data:{type:l.toLowerCase()},fix:ln(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:{[s4]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[s7]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},li="prefer-type-error",ls=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"]),ll=new Set(["isNaN","isFinite"]),lu=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&ls.has(e.name)||!1===r&&ll.has(e.name)),lp=(e,t)=>!!lu(e.property,t,!0)||"MemberExpression"===e.object.type&&lp(e.object,t),lc=/^(?:[A-Z][\da-z]*)*Error$/,ld=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,lm=(e,t)=>{switch(e.type){case"Identifier":return lu(e,t,!1);case"MemberExpression":return lp(e,t);case"CallExpression":return lm(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&lm(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?lc.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&lc.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(ld(r)&&e8(n,"undefined")||ld(n)&&e8(r,"undefined"))})(e))return!1;return lm(n,t)||lm(o,t)}case"LogicalExpression":return lm(e.left,t)&&lm(e.right,t);default:return!1}},lf="consistentDestructuring",lg="consistentDestructuringSuggest",ly=new Set(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),lh=e=>{for(;e.parent;)if(e=e.parent,ly.has(e.type))return e},lx=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,lb=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=ep(n.getScope(o.value),o.value);if(e&&ep(r,o.value)===e)return o}},lE=({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=rD(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?ep(r,l):void 0,c="ThisExpression"===l.type?lh(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},lS=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&e6(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&&(lS(e.left,t,r)||lS(e.right,t,r)),lv=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&lS(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&lS(e.left,r,n);default:return!1}},lC=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),lD=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...s2,...["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}`),...rG],lT=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],lA="error-date",lw="suggestion-date";function lk(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let lI=new iS({objects:["BigInt","Boolean","Number","String","Symbol"],type:iS.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=>aA(r,t,e)),o}}),lj=new iS({objects:lD,type:iS.CALL,handle:function(e,t){let{node:r}=e;if(r.optional||r_(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 ak(e,r,t)}let e={node:r,messageId:lA};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:lw,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>aI(r,t,e)}}}),lF=new iS({objects:lT,type:iS.CALL,handle:lk}),lB=new iS({objects:lT,type:iS.CONSTRUCT,handle:lk}),lR="error/array-push",lP="suggestion",lL=e=>tb(e,{property:"classList",computed:!1}),lN=e=>e.arguments.some(e=>"SpreadElement"===e.type),l$=[{description:"Array#push()",test:e=>tS(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=>tS(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=>tS(e,{method:"add",optionalCall:!1,optionalMember:!1})&&lL(e.callee.object)},{description:"Element#classList.remove()",test:e=>tS(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&lL(e.callee.object)},{description:"importScripts()",test:e=>ts(e,{name:"importScripts"},to)}],lM={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 l$){if(!a(n))continue;let l=[...i,...t];if(tA(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=o6(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)||!ry(c.callee,n.callee))continue;let{shouldKeepSecondCall:d,shouldPrependSourceArguments:m,targetCall:f,sourceCall:g}=function(e,t,r){let n=r&&(!r_(t.callee)||r_(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&&!ef(r.getLastToken(p))&&ef(r.getLastToken(u)),S=d&&oh(r.getTokenBefore(p),e,r.text.slice(x[0],x[0]+1)),v={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:lR,data:{description:o}},C=function*(t){if(y.length>0){let r=rm(e,g,!m),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rd(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&&(lN(e)||lN(t))||r&&o.some(e=>null===eF(e,n.getScope(e)))||o.some(e=>eO(e,n))}(c,n,s,r)?v.suggest=[{messageId:lP,fix:C}]:v.fix=C),yield v}})},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:{[lR]:"Do not call `{{description}}` multiple times.",[lP]:"Merge with previous one."},languages:["js/js"]}},lO="no-process-exit",lU=e=>e8(e,"node:worker_threads")||e8(e,"worker_threads"),lq="no-single-promise-in-promise-methods/error",lW="no-single-promise-in-promise-methods/unwrap",lV="no-single-promise-in-promise-methods/use-promise-resolve",l_=["all","any","race"],lz=(e,t)=>{let[r]=e.arguments[0].elements,n=e2(r,t);return!e3(r,t)&&16>oV(r)&&(n=`(${n})`),n},lK=(e,t)=>e.getCommentsInside(t).length>0,lG=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",lJ="no-static-only-class",lX=({type:e,value:t})=>"Punctuator"===e&&"="===t,lY=e=>"PropertyDefinition"===e.type,lH="ignored-elements",lQ="property-assignment",lZ={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:lH},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;!e3(c,e)&&oG(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield ak(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rC(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:lQ}})},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:{[lH]:"Array destructuring may not contain consecutive ignored values.",[lQ]:"Do not assign destructured values to object properties."},languages:["js/js"]}},l0="spread-in-list",l1="iterable-to-array",l2="iterable-to-array-in-for-of",l3="iterable-to-array-in-yield-star",l8="spread-in-collection-constructor",l6="spread-in-object-assign",l9="clone-array",l5="suggestion/remove-object-assign-spread",l4=["Map","WeakMap","Set","WeakSet"],l7=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],ue=[...l7,"filter","flatMap","map"],ut=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",ur={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*un(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),em(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||oo(o,i,r)||e3(t,r)?yield ak(e,t,r):yield aD(e,u,r)}let uo=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&ng(e.callee.object,t),ua="no-useless-switch-case/error",ui="no-useless-switch-case/suggestion",us=e=>e.consequent.every(e=>tp(e)),ul=e=>tk(e.test)||te(e.test),uu=new Set(["CallExpression","MemberExpression"]),up=new Set(["Identifier","MemberExpression","Super","ThisExpression"]);[...new Map([["===","!=="],["!==","==="],["==","!="],["!=","=="]])];let uc=e=>"MemberExpression"===(e=rD(e)).type?{...e,object:uc(e.object),property:e.computed?uc(e.property):e.property}:e,ud=(e,t)=>ry(uc(e),uc(t)),um=e=>up.has(rD(e).type),uf=e=>!!("ChainExpression"===e.type||uu.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&uf(e)):t.type&&uf(t))),ug="no-useless-undefined",uy="no-useless-undefined/suggestion",uh=new Set(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),ux=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},ub={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},uE={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},uS={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},uv={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},uC=new Set(["<","<=",">",">="]);function uD(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function uT(e,t){return tb(e=rD(e),{property:"length",optional:!1,computed:!1})&&ud(e.object,t)}function uA(e,t){return uT(e=rD(e),t)?"length":"BinaryExpression"===e.type&&"-"===e.operator&&uT(e.left,t)&&1===oK(e.right)?"lengthMinusOne":void 0}function uw(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let uk={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=ux(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:ug,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tk(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=ux(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>a$(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>a$(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>a$(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||rO(e.physicalFilename))&&!n.optional&&tg(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tk(r.consequent);if(n===tk(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tb(e=rD(e),{computed:!0,optional:!1})||uf(e)||eO(e.object,t,{considerGetters:!0})||eO(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rD(e)).type&&"-"===e.operator){let t=oK(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=rD(e)).type||!uC.has(e.operator)||uf(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=oK(n),i=oK(o);return Number.isSafeInteger(i)&&ud(n,t.node)?uD(ub,r,i,t.offset):Number.isSafeInteger(a)&&ud(o,t.node)?uD(uE,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=uA(o,t.node.object);if(a&&ud(n,t.index.node))return uw(uS,r,a);let i=uA(n,t.node.object);if(i&&ud(o,t.index.node))return uw(uv,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:ug};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:uy,fix(n){let a=t.getText(o),i=oh(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||rO(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tk(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),uh.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:ug,fix:t=>aS(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:{[ug]:"Do not use useless `undefined`.",[uy]:"Use the indexed access directly."},languages:["js/js"]}},uI="numeric-separators-style";function uj(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 uF={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},uB={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(!(e4(e)||tt(e))||e4(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";tt(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+uj(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 uj(r,t)+n+uj(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+uj(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:uI,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(uF).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:uF.binary,octal:uF.octal,hexadecimal:uF.hexadecimal,number:uF.number}],messages:{[uI]:"Invalid group length in numeric value."},languages:["js/js"]}},uR="error-zero-index",uP="error-shift",uL="error-pop",uN="error-at-zero",u$="error-at-minus-one",uM="error-slice-minus-one",uO="error-destructuring-declaration",uU="error-destructuring-assignment",uq="error-variable",uW="suggest-nullish-coalescing-operator",uV="suggest-logical-or-operator",u_=(e,t,r)=>tS(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!ng(e.callee.object,t),uz=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,uK=(e,t)=>tS(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&uz(e.arguments[0])&&u_(e.callee.object,t),uG=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*uJ(e,t,r){let{left:n}=uG(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||eU(e,t))return!1;let{left:r}=uG(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 uX=e=>"AssignmentPattern"===uG(e).left.elements[0].type,uY=(e,t)=>{let r,n,{property:o}=uG(t).right.callee;return uX(t)?r=[{operator:"??",messageId:uW},{operator:"||",messageId:uV}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=uG(e),[i]=o.elements,s=i.right,l=t.getText(s);return(eU(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 uJ(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield uJ(t,e,r)},{fix:n,suggest:r}},uH=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,uQ=e=>{let{left:t,right:r}=uG(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},uZ={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&&u_(t.object,e))||nI(t)))return{node:t.object.callee.property,messageId:uR,fix:r=>[r.replaceText(t.object.callee.property,"find"),aF(r,t,e)]}}),e.on("CallExpression",t=>{if(tS(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&u_(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uP,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...aB(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&&u_(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:uO,...uY(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&&u_(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:uU,...uY(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&u_(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=ep(n,r.id),a=rW(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(uH(e))i.push(e.parent);else{if(!uQ(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:uq};return s.every(e=>!uX(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=o1.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=rp(l,ro(n));yield aL(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 aF(a,t,e);for(let e of s)yield uJ(e,t,a)}),l}),e.on("CallExpression",t=>{if(tS(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&u_(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uN,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...aB(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(tS(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&u_(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uL,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...aB(r,t,e)]}}),e.on("CallExpression",t=>{if(tS(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&uz(t.arguments[0])&&u_(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:u$,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...aB(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nI(r)&&uK(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:uM,*fix(o,{abort:a}){if(rF(e,[e1(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield aB(o,r.object,e),yield aF(o,r,e)}}}),e.on("CallExpression",r=>{if(!(tS(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uK(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:uM,*fix(o,{abort:a}){if(rF(e,[e1(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield aB(o,r.callee.object,e),yield aB(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:{[uq]:"Prefer `.find(…)` over `.filter(…)`.",[uR]:"Prefer `.find(…)` over `.filter(…)[0]`.",[uN]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[uP]:"Prefer `.find(…)` over `.filter(…).shift()`.",[uL]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[u$]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[uM]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[uO]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[uU]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[uW]:"Replace `.filter(…)` with `.find(…) ?? …`.",[uV]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},u0="prefer-array-flat-map",u1="prefer-array-flat-map/filter-flat-map",u2="prefer-array-flat-map/filter-flat-map-suggestion",u3=["React.Children","Children"],u8=new Set(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),u6=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,u9="prefer-array-flat",u5={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tS(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&os(r.params[0],r.body)&&!pn(e.callee.object,t)}},u4={testFunction(e){if(!tS(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[t,r]=e.arguments;if(!("ArrowFunctionExpression"===t.type&&!t.async&&2===t.params.length&&tc(r)))return!1;let n=t.body,[o,a]=t.params;return tS(n,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&os(o,n.callee.object)&&os(a,n.arguments[0])||"ArrayExpression"===n.type&&2===n.elements.length&&n.elements.every((e,r)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&os(t.params[r],e.argument))},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},u7={testFunction:e=>tS(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tc(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},pe={testFunction(e){if(!(tS(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tI(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return tc(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()"},pt=["_.flatten","lodash.flatten","underscore.flatten"],pr=/^\p{Uppercase_Letter}/u,pn=(e,t)=>{let r,n;return"Identifier"===e.type&&pr.test(e.name)&&(!(r=rL(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=rL(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))},po={create:function(e){let{functions:t}=e.options[0],r=[...t,...pt],n=[u5,u4,u7,pe,{testFunction:e=>ts(e,{argumentsLength:1,optional:!1},to)&&tA(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>tT(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:u9,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=e2(t,r);n?s=`[${s}]`:!e3(t,i)&&oG(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,oh(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield ak(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:{[u9]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},pa="some",pi="some-suggestion",ps="filter",pl={create:oU(e=>{e.on("CallExpression",t=>{if(!tS(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||ng(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tk(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&te(t.parent.right));if(!r&&!(tL(t,e)||tN(t)||function(e,t){if(!nf(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()&&(tL(r,t)||tN(r))})}(t,e)))return;let n=t.callee.property,o=r&&rF(e,[e1(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:pa,data:{method:n.name},suggest:o?void 0:[{messageId:pi,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=e1(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(!(tS(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)&&e8(n,0)))||ng(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:pa,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(rF(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&&tb(t.left,{property:"length",optional:!1})&&tS(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if(ng(n,e)||"Identifier"===n.type&&n.name.startsWith("$"))return;let[o]=r.arguments;if(!o||or(o))return;let a=r.callee.property;return{node:a,messageId:ps,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(rF(e,[e1(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield aF(n,s,e),yield n.removeRange([e1(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:{[pa]:"Prefer `.some(…)` over `.{{method}}(…)`.",[pi]:"Replace `.{{method}}(…)` with `.some(…)`.",[ps]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},pu=(e,t,r=!0)=>({node:e,messageId:`error/${e.name}`,...r&&{suggest:[{messageId:`suggestion/${t}`,fix:r=>r.replaceText(e,t)}]}}),pp=new Set(["+","-","*","/","%","**","&","|","^","<<",">>",">>>"]),pc=new Set(["+","-","~"]),pd="preferDefaultParameters",pm="preferDefaultParametersSuggest",pf=new Set(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),pg=(e,t)=>{if(!t)return!1;if(pf.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(pg(e,t))return!0}else if(pg(e,n))return!0}return!1},py="prefer-logical-operator-over-ternary/error",ph="prefer-logical-operator-over-ternary/optional-chain-error",px="prefer-logical-operator-over-ternary/suggestion",pb="prefer-logical-operator-over-ternary/optional-chain-suggestion",pE=new Set(["==","==="]),pS=new Set(["!=","!=="]);function pv(e,t,r){if(ry(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return pv(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&pv(e.left,t.left,r)&&pv(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&pv(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function pC({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:py}:{node:t,messageId:py,suggest:o.map(o=>({messageId:px,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=e3(e,t),o=n?e2(e,t):i.getText(e);return!n&&oH(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return oh(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function pD(e){return te(e)?"null":tk(e)?"undefined":void 0}function pT(e){if("BinaryExpression"!==e.type||!pE.has(e.operator)&&!pS.has(e.operator))return;let t=pD(e.left),r=pD(e.right);if(!!t==!!r)return;let n=pE.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let pA=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,pw="with-name",pk="without-name",pI="regexp-exec",pj="string-match",pF="string-search",pB="suggestion",pR="string",pP="regexp",pL="other",pN="string-or-other",p$="regexp-or-other",pM="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);eU(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!eU(t,a)&&oG(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let pU=[{type:pI,test:e=>tS(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:pj,test:e=>tS(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:pF,test:e=>tS(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}],pq=e=>e7(e)||tl(e,{name:"RegExp"}),pW=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},pV=e=>{if(e.includes(pM))return pM;let t=new Set(e),r=t.has(pR)||t.has(pN),n=t.has(pP)||t.has(p$);if(r&&n)return pN;let o=t.has(pL)||t.has(pN)||t.has(p$);return r?o?pN:pR:n?o?p$:pP:pL},p_=e=>{let t=new Set(e);return t.has(pM)?pM:t.has(pP)?pP:t.has(pR)?pR:pL},pz=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),pK=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return pK(e.typeAnnotation);case"TSStringKeyword":return pR;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?pR:pL;case"TSTypeReference":if("Identifier"!==e.typeName.type)return pM;if("String"===e.typeName.name)return pR;if("RegExp"===e.typeName.name)return pP;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return pL;return pM;case"TSUnionType":return pV(e.types.map(e=>pK(e)));case"TSIntersectionType":return p_(e.types.map(e=>pK(e)));default:return pz.has(e?.type)?pL:pM}},pG=(e,t)=>{let r,n;if(r=e,rJ.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),rJ.has(n.intrinsicName)))return pM;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?pG(r,t):pM}return e.isUnion()?pV(e.types.map(e=>pG(e,t))):e.isIntersection()?p_(e.types.map(e=>pG(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?pR:"RegExp"===rY(e)?.getName()||rQ(e,t).some(e=>pG(e,t)===pP)?pP:pL},pJ=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function pX(e,t,r=new Set){let n;if(pq(e))return pP;if(n5(e,t))return pR;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=ep(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return pM;r.add(o);let[a]=o.defs,i=pK(a.name?.typeAnnotation),s=pM;return i!==pM?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=pX(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==pM)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=pK(e.typeAnnotation);return n===pM?pX(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return pX(e.expression,t,r);case"SequenceExpression":return pX(e.expressions.at(-1),t,r);case"ConditionalExpression":return pV([pX(e.consequent,t,r),pX(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=eF(e,o))?"string"==typeof n.value?pR:pW(n.value)?pP: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)?pL:pM:pM;return a!==pM?a:pJ.has(e.type)?pL:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return pM;try{let{program:t}=r;return pG(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return pM}})(e,t)}let pY=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tj(e.parent)||tP(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},pH=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),pQ=(e,t,r)=>[e1(t,r)[1],r.sourceCode.getRange(e.node)[1]],pZ=e=>[{messageId:pB,fix:e}],p0=e=>[pP,p$,pL].includes(e),p1=e=>[pR,pN,pL].includes(e),p2=({type:e,stringType:t,regexpType:r})=>e===pI?p1(r)||p0(t):p0(t)||p1(r),p3=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[e1(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([e1(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!pH(r.sourceCode,e))&&(e.suggest=pZ(t));return}if(!o||!pH(r.sourceCode,pQ(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=pZ(t)}},p8={create:oU(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tb(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(pY(o,t))return;if(tL(o,t)||tN(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&e8(a.right,0)&&!pY(a,t)&&(tL(a,t)||tN(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)&&tv(n)||">="===r&&e8(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tv(n)||"<"===r&&e8(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tL(t,e)||tN(t))for(let{type:o,test:a,getNodes:i,fix:s}of pU){if(o===pF!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=eF(p,c),m=d?pW(d.value):void 0,f=pq(p);if(p2({type:o,stringType:pX(l.stringNode,e),regexpType:pX(p,e)}))continue;let g={node:o===pI?u:t,messageId:o};p3(g,function*(o){for(let a of(r?(yield aF(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([e1(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(pQ(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:{[pI]:"Prefer `.test(…)` over `.exec(…)`.",[pj]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[pF]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[pB]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},p6="error",p9="suggestion",p5=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],p4=["slice","concat"],p7=e=>tS(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e,ce=new Set(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),ct=(e,t,r=new Set)=>"ArrayExpression"===e.type||ts(e,{name:"Array",optional:!1},ti)||tS(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tS(e,{methods:p5,optionalCall:!1,optionalMember:!1})||tS(e,{methods:p4,optionalCall:!1,optionalMember:!1})&&void 0===e5(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new Set)=>{if("Identifier"!==e.type)return!1;let n=ep(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&&ct(o.node.init,t,r)})(e.callee.object,t,r)),cr=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,cn=e=>e.some(e=>e?.type==="SpreadElement"),co=(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])}),ca=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,ci=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(;ca(r.parent,r);)r=r.parent;return nI(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},cs=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)||tS(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},cl={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)&&ct(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?cn(i.elements)?void 0:i.elements.length:ts(i,{name:"Array",optional:!1},ti)?((e,t)=>{if(cn(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=eF(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:cr(n)?n:void 0})(i,s):tS(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?cn(i.arguments)?void 0:i.arguments.length:tS(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 cn(r.elements)?void 0:r.elements.length;if(void 0!==e5(r)){let e=eF(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=eF(r.value,t);return cr(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=ep(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(p7(o)){t.push(o);continue}if(ci(o)){r.push(o),n.push(o);continue}if(cs(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(rW(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!cn(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=eF(t,e.sourceCode.getScope(t)))&&rh(r.value)&&!Object.is(r.value,-0)}))||0!==rE(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(ce.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:p6,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(co(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(co(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&&!co(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:p9,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:{[p6]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[p9]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},cu=e=>tS(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&ts(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},to),cp="prefer-string-raw",cc="unnecessary-string-raw";function cd(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let cm="prefer-switch",cf=(e,t)=>e===t||ry(e,t),cg=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tk(e))),cy=new Set(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),ch=e=>{for(;e.parent;e=e.parent)if(cy.has(e.type))return e},cx=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},cb={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||=cg(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>cf(e,r)||cf(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:cm};!eO(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!cx(n,t,r))continue;let e=ch(n);if(!e||cx(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=rS(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,`
27
+ `,e=>(...t)=>({async *[Symbol.asyncIterator](){e.throwIfAborted();let{worker:n,cleanup:o}=ra(r),a=rn(e,[],{rejectionEvents:["abort"]});try{let e=!0;for(;;){let r=Promise.race([rn(n,"message",{rejectionEvents:["error","messageerror"]}),a]);n.postMessage(e?t:void 0),e=!1;let{data:{output:o,error:i}}=await r;if(i)throw i;let{value:s,done:l}=o;if(l)break;yield s}}catch(t){throw e.throwIfAborted(),t}finally{a.cancel(),o()}}});let rp=e=>[e,...e.childScopes.flatMap(e=>rp(e))],rc=e=>[...new i(rp(e).flatMap(({references:e})=>e))],rd=new i(["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"]),rm=e=>"string"==typeof e&&rl(e)&&!rd.has(e),rf=(e,t)=>t.every(t=>!(ru(e,t)||rc(t).some(({identifier:t,resolved:r})=>t?.name===e&&!r))),rg=()=>!0;function ry(e,t,r=rg){if(rm(e)||rm(e+="_")){for(;!rf(e,t)||!r(e,t);)e+="_";return e}}function rh(e,t){if(e.arguments.length>0)return!0;let{sourceCode:r}=t,[n,o]=r.getLastTokens(e,2);return eC(n)&&eD(o)&&r.getRange(e.callee)[1]<r.getRange(e)[1]}function rx(e,t){let{sourceCode:r}=t,n=e.typeArguments??e.callee,o=r.getTokenAfter(n,eC),[a,i]=r.getLastTokens(e,2);return{openingParenthesisToken:o,closingParenthesisToken:i,trailingCommaToken:eb(a)?a:void 0}}function rb(e,t,r=!0){let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a,trailingCommaToken:i}=rx(t,e),[,s]=n.getRange(o),[l]=n.getRange(r?a:i??a);return n.text.slice(s,l)}function rE(e){let t;switch(e?.type){case"MemberExpression":t=e.property;break;case"ChainExpression":return rE(e.expression);case"Property":case"MethodDefinition":t=e.key}if(t){if("Identifier"===t.type&&!e.computed)return t.name;let r=e$(t);if(!r)return;return String(r.value)}}function rv(e){return["ChainExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?rv(e.expression):e}function rC(e,t){if(e=rv(e),t=rv(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=rE(e);if(void 0!==r)return rC(e.object,t.object)&&r===rE(t);return e.computed===t.computed&&rC(e.object,t.object)&&rC(e.property,t.property)}default:return!1}}let rD=e=>null===e||"object"!=typeof e&&"function"!=typeof e,rS=(e,t)=>{if(!e)return{value:void 0};let{sourceCode:r}=t,n=e$(e,r.getScope(e));if(n&&rD(n.value))return{value:n.value}},rT=(e,t,r)=>{let n=rS(e,r),o=rS(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&&rC(e,t)},rA=(e,t)=>{let r=[],n=[];for(let o of e)o?.type!=="SpreadElement"&&(r.some(e=>rT(e,o,t))&&n.push(o),r.push(o));return n};function rw(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]}let rk=new i(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),rI=e=>rk.has(e?.type);function rj(e){for(;rI(e);)e=e.expression;return e}function rF(e){return rl(e,{checkReserved:!1})}function rB(e){let{sourceCode:t}=e,r=t.getAllComments?.();return r?.length?r:t.comments??[]}let rR=(e,t)=>Array.isArray(t)?t:e.sourceCode.getRange(t),rP=([e,t],[r,n])=>e>=r&&t<=n;function rL(e,t,r=[]){let{sourceCode:n}=e,o=rR(e,t),a=r.map(t=>rR(e,t));return rB(e).some(e=>{let t=n.getRange(e);return rP(t,o)&&a.every(e=>!rP(t,e))})}function rN(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 r$=(e,[t,r])=>{let{sourceCode:n}=e;return n.getAllComments().some(e=>{let[o,a]=n.getRange(e);return o>=t&&a<=r})},rM=new i(["ClassDeclaration","FunctionDeclaration","TSEnumDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSTypeAliasDeclaration"]),rO=e=>"VariableDeclaration"===e.type&&"var"!==e.kind||rM.has(e.type),rU=e=>rO(e)||"BlockStatement"===e.type&&e.body.some(e=>rO(e));function rq(e,t){if("Identifier"!==e.type)return;let r=ey(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 rV(e,t){let{sourceCode:r}=t,[,n]=e5(e.object,t);return[n,e.computed?r.getRange(r.getTokenBefore(e.property,e=>"["===e.value))[1]:r.getRange(e.property)[0]]}let rW=new i(["depth","height","width"]);function r_(e){return tT(e,{properties:["length","size"],optional:!1})}function rz(e){return/\.(?:ts|mts|cts|tsx)$/i.test(e)}let rK=["Program","StyleSheet","Document","root"];function rG(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 rJ=({identifiers:e,references:t})=>[...new i([...e,...t.map(({identifier:e})=>e)])];function rX(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(rX(e,t))return!0}else if(rX(n,t))return!0}return!1}function rY(e){let t;return(e=rj(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=[]}=ey(e,t)||{};return r};function rQ(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 rZ=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],r0=new i(["any","error","unknown"]),r1=new i(["null","undefined"]),r2=e=>e.getSymbol()??e.aliasSymbol,r3=(e,t)=>e?.declarations?.some(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))??!1;function r8(e,t){try{return t.getBaseTypes(e)??e.getBaseTypes?.()??[]}catch{return[]}}let r6="target",r9="non-target",r5="nullish",r4="unknown",r7=new i(["ClassDeclaration","ClassExpression"]),ne=new i(["FunctionDeclaration","FunctionExpression"]),nt=new i(["ClassName","ImportBinding","TSEnumName","Type"]),nr=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNumberKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSArrayType","TSLiteralType","TSTupleType","TSTypeLiteral","TSFunctionType","TSConstructorType"]),nn=new i(["TSNullKeyword","TSUndefinedKeyword"]),no=e=>e===r5?r9:e,na=(e,t)=>0===(e=t.allowNullishInMixedUnion?e.filter(e=>e!==r5):e.map(no)).length?r9:(t.treatMixedUnionAsTarget?e.includes(r6):e.every(e=>e===r6))?r6:(t.treatMixedUnionAsNonTarget?e.includes(r9):e.every(e=>e===r9))?r9:r4,ni=e=>(e=e.map(no)).includes(r6)?r6:e.every(e=>e===r9)?r9:r4,ns=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>nt.has(e.type));if(r)return r;t=t.upper}},nl=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=nl(e.left);return t?`${t}.${e.right.name}`:void 0}},nu=(e,t)=>{let r=t.typeReferenceAliases?.get(e);return t.targetTypeNames.has(e)||r&&t.targetTypeNames.has(r)?r6:t.nonTargetTypeNames?.has(e)?r9:r4},np=(e,t,r)=>{let{source:n,importedName:o,localName:a}=e,i=t?.get(n);return i?i.has(o)?r6:r9:t&&((e,t)=>{for(let r of t.values())if(r.has(e))return!0;return!1})(o,t)||nu(o,r)!==r4||nu(a,r)!==r4?r9:r4};function nc(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return nc(e.typeAnnotation,t,r,n);case"TSTypeOperator":return"readonly"===e.operator?nc(e.typeAnnotation,t,r,n):r4;case"TSTypeReference":return function e(t,r,n,o){var a,i;let s=nl(t.typeName);if(!s)return r4;let l=((e,t,r)=>{if("TSQualifiedName"!==e.typeName.type||"Identifier"!==e.typeName.left.type||!r.targetTypeNamespaceImports)return r4;let n=e.typeName.right.name,o=ns(e.typeName.left.name,t);return o?.type!=="ImportBinding"||"ImportNamespaceSpecifier"!==o.node.type&&"ImportDefaultSpecifier"!==o.node.type?r4:np({source:o.parent?.source?.value,importedName:n,localName:n},r.targetTypeNamespaceImports,r)})(t,r,n);if(l!==r4)return l;if(!n.preferTypeReferenceDefinitions){let e=nu(s,n);if(e!==r4)return e}if(o.has(s))return r4;o.add(s);let u=ns(s,r);if(!u)return o.delete(s),nu(s,n);let p=r4,c=((e,t)=>{if("ImportBinding"!==e.type)return r4;if("ImportDefaultSpecifier"===e.node.type)return nu(e.node.local.name,t)===r4?r4:r9;let r=e.node.imported?.name??e.node.imported?.value;return r?np({source:e.parent?.source?.value,importedName:r,localName:e.node.local.name},t.targetTypeImports,t):r4})(u,n);return c!==r4?p=c:"Type"===u.type&&"TSTypeAliasDeclaration"===u.node.type?p=nc(u.node.typeAnnotation,r,n,o):"Type"===u.type&&"TSTypeParameter"===u.node.type?p=nc(u.node.constraint,r,n,o):"Type"===u.type&&"TSInterfaceDeclaration"===u.node.type?(a=u.node,p=0===a.extends.length?r9:ni(a.extends.map(t=>nl(t.expression)?e({typeName:t.expression},r,n,o):r4))):"ClassName"===u.type&&(i=u.node,p=i.superClass&&n.checkClassHeritage?"Identifier"!==i.superClass.type?r4:nm(i.superClass,r,n,o):r9),o.delete(s),p}(e,t,r,n);case"TSUnionType":return na(e.types.map(e=>nc(e,t,r,n)),r);case"TSIntersectionType":return ni(e.types.map(e=>nc(e,t,r,n)));default:if(r.isTargetTypeAnnotation?.(e))return r6;if(nn.has(e?.type))return r5;return nr.has(e?.type)?r9:r4}}let nd=(e,t,r,n)=>e.superClass&&r.checkClassHeritage?nm(e.superClass,t,r,n):r9;function nm(e,t,r,n=new i){if("Identifier"===e.type){let o=e.name;if(!r.checkClassHeritage)return nu(o,r);if(n.has(o))return r4;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=r4;return i?.type==="Variable"&&"const"===i.parent.kind&&i.node.id===i.name&&i.node.init?s=nm(i.node.init,t,r,n):i?.type==="ClassName"&&(s=nd(i.node,t,r,n)),n.delete(o),i?s:nu(o,r)}return r7.has(e.type)?nd(e,t,r,n):r4}let nf=(e,t,r)=>{let n=e.params.find(e=>"Identifier"===e.type&&"this"===e.name);return nc(n?.typeAnnotation,t.sourceCode.getScope(e),r)};function ng(e,t,r,n=new i){if(!e)return r4;if("TSSatisfiesExpression"===e.type)return ng(e.expression,t,r,n);let o=t.sourceCode.getScope(e),a=nc(e.typeAnnotation,o,r);if(a!==r4)return a;let s=((e,t,r,n)=>{let o=t.sourceCode.getScope(e);switch(e.type){case"Identifier":return((e,t,r,n)=>{let o=ey(t.sourceCode.getScope(e),e);if(!o||n.has(o)||1!==o.defs.length)return r4;n.add(o);let[a]=o.defs,i=t.sourceCode.getScope(a.name),s=nc(a.name?.typeAnnotation,i,r),l=r4;return s!==r4?l=s:"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&(l=ng(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(r7.has(n.type))return nd(n,t.sourceCode.getScope(n),r);if("StaticBlock"===n.type||("AccessorProperty"===n.type||"PropertyDefinition"===n.type)&&n.static)return r9;if(ne.has(n.type)){let e=nf(n,t,r);if(e!==r4)return e;if(n.parent?.type==="Property"&&n.parent.parent?.type==="ObjectExpression")return r9;if(n.parent?.type==="MethodDefinition"){if(n.parent.static)return r9;continue}break}}return r4})(e,t,r):r4;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 r9;if(r7.has(n.type))return n.superClass?nm(n.superClass,t.sourceCode.getScope(n),r):r9}return r4})(e,t,r):r4;case"NewExpression":let a;return r.checkClassSyntax?(a=e.callee,nm(a,t.sourceCode.getScope(a),r,void 0)):r4;case"TSAsExpression":case"TSTypeAssertion":{let a=nc(e.typeAnnotation,o,r);return a===r4?ng(e.expression,t,r,n):a}case"TSNonNullExpression":case"ParenthesizedExpression":return ng(e.expression,t,r,n);case"SequenceExpression":return ng(e.expressions.at(-1),t,r,n);case"ConditionalExpression":return na([ng(e.consequent,t,r,n),ng(e.alternate,t,r,n)],r);default:return r4}})(e,t,r,n);if(s!==r4)return s;if("Identifier"!==e.type){let t,n=(t=e$(e,o))?r.getStaticType?.(t.value,e)??r4:r4;if(n!==r4)return n}if(r.isTargetNode?.(e,t)||r.targetConstructorNames?.some(t=>tf(e,{name:t}))||r.targetCallNames?.some(t=>tm(e,{name:t},tp)))return r6;let l=((e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return r4;try{let{program:t}=n;return function e(t,r,n,o){if(r0.has(t.intrinsicName))return r4;if(r1.has(t.intrinsicName))return r5;if(t.isTypeParameter?.()){let a=t.getConstraint();return a?e(a,r,n,o):r4}if(t.isUnion())return na(t.types.map(t=>e(t,r,n,o)),o);if(t.isIntersection())return ni(t.types.map(t=>e(t,r,n,o)));if(o.isTargetType?.(t,r,n))return r6;let a=r.getBaseConstraintOfType(t);if(a&&a!==t)return e(a,r,n,o);if(o.checkClassHeritage&&r8(t,r).some(t=>e(t,r,n,o)===r6))return r6;if(t.intrinsicName)return r9;let i=r2(t);if(!i)return r4;let s=i.getName(),l=o.typeReferenceAliases?.get(s);return o.targetTypeNames.has(s)||l&&o.targetTypeNames.has(l)?r6:r9}(n.getTypeAtLocation(e),t.getTypeChecker(),t,r)}catch{return r4}})(e,t,r);return l!==r4?l:r.isNonTargetNode?.(e,t)?r9:r4}let ny=e=>(e={checkClassHeritage:!0,checkClassSyntax:!1,...e},{getType:(t,r,n)=>no(ng(t,r,{...e,...n})),isTarget:(t,r,n)=>ng(t,r,{...e,...n})===r6,isKnownNonTarget:(t,r,n)=>no(ng(t,r,{...e,...n}))===r9}),nh=({name:e,aliases:t=[],checkConstructor:r=!0,...n})=>ny({...n,targetTypeNames:new i([e]),typeReferenceAliases:new o(t.map(t=>[t,e])),targetConstructorNames:r?[e]:void 0}),nx=new i(["ObjectExpression","FunctionExpression","ArrowFunctionExpression","ClassExpression","TemplateLiteral"]),nb=new i([...rZ,"Map","ReadonlyMap","WeakMap","Set","ReadonlySet","WeakSet"]),{isTarget:nE,isKnownNonTarget:nv}=ny({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:new i(["Array","ReadonlyArray"]),nonTargetTypeNames:nb,targetCallNames:["Array"],targetConstructorNames:["Array"],isTargetNode:e=>"ArrayExpression"===e.type||tw(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}),isNonTargetNode:e=>"NewExpression"===e.type||nx.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)?r6:"Identifier"===t.type||"MemberExpression"===t.type?r4:r9}),nC=new i(["ArrayExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]);function nD(e,t){return!nC.has(e.type)&&nv(e,t)}let nS=new i(["AnimationEvent","BaseSyntheticEvent","ChangeEvent","ClipboardEvent","CompositionEvent","DragEvent","FocusEvent","FormEvent","InputEvent","InvalidEvent","KeyboardEvent","MouseEvent","PointerEvent","SubmitEvent","SyntheticEvent","TouchEvent","ToggleEvent","TransitionEvent","UIEvent","WheelEvent"]),nT=new i(["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",...nS]),{isTarget:nA,isKnownNonTarget:nw}=ny({preferTypeReferenceDefinitions:!0,targetTypeImports:new o([["react",nS]]),targetTypeNamespaceImports:new o([["react",nS]]),targetTypeNames:nT}),{isTarget:nk}=nh({name:"Set",aliases:["ReadonlySet"],getStaticType:e=>e instanceof Set?r6:r4}),{isTarget:nI}=nh({name:"Map",aliases:["ReadonlyMap"],getStaticType:e=>e instanceof Map?r6:r4}),nj=new i(["CharacterData","Document","DocumentFragment","Element","HTMLElement","Node","SVGElement","Text"]),nF=new i(["KeyboardEvent","React.KeyboardEvent"]),nB=new i(["Event","MouseEvent","PointerEvent","React.MouseEvent","React.PointerEvent"]),{isKnownNonTarget:nR}=ny({targetTypeNames:nj,getStaticType:e=>{let{Node:t}=globalThis;return"function"==typeof t&&e instanceof t?r6:r4}}),{isKnownNonTarget:nP}=ny({targetTypeNames:nF,nonTargetTypeNames:nB}),nL=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,n$=(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),nM=new i(["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"]),nO=new i(["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"]),nU=new i(["EPSILON","MAX_SAFE_INTEGER","MAX_VALUE","MIN_SAFE_INTEGER","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]),nq=new i(["parseFloat","parseInt"]),nV=e=>e?.type==="TSNumberKeyword"||e?.type==="TSLiteralType"&&to(e.literal),nW=new i(["-","*","/","%","**","<<",">>","|","^","&"]);function n_(e,t){let r;if(to(e)||n$(e,"Math",nM)||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"Math",nO)||nN(e,"Number")||n$(e,"Number",nU)||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"Number",nq)||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&&n_(e.right,t))return!0}case"BinaryExpression":{let{operator:r}=e;if("AssignmentExpression"===e.type&&(r=r.slice(0,-1)),"+"===r&&n_(e.left,t)&&n_(e.right,t)||">>>"===r||nW.has(r)&&(n_(e.left,t)||n_(e.right,t)))return!0;break}case"UnaryExpression":{let{operator:r}=e;if("+"===r||("-"===r||"~"===r)&&n_(e.argument,t))return!0;break}case"UpdateExpression":if(n_(e.argument,t))return!0;break;case"ConditionalExpression":{let r=n_(e.consequent,t),n=n_(e.alternate,t);if(r&&n)return!0;let o=e$(e.test,t);if(null!==o&&(r&&o.value||n&&!o.value))return!0;break}case"SequenceExpression":if(n_(e.expressions.at(-1),t))return!0;break;case"Identifier":if((r=ey(t,e))&&r.defs.some(e=>nV(e.name?.typeAnnotation?.typeAnnotation)))return!0;break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":if(nV(e.typeAnnotation))return!0;break;case"TSNonNullExpression":if(n_(e.expression,t))return!0}return"number"==typeof e$(e,t)?.value}ny({targetTypeNames:new i,targetCallNames:["Number"],isTargetTypeAnnotation:nV,isTargetType:e=>e.isNumberLiteral?.()||"number"===e.intrinsicName,getStaticType:e=>"number"==typeof e?r6:r4});let nz=new i([">",">=","<","<=","==","===","!=","!==","in","instanceof"]),nK=new i(["boolean","true","false"]),nG=new i(["isFinite","isNaN"]),nJ=new o([["Array",new i(["isArray"])],["ArrayBuffer",new i(["isView"])],["Atomics",new i(["isLockFree"])],["Error",new i(["isError"])],["Number",new i(["isFinite","isInteger","isNaN","isSafeInteger"])],["Object",new i(["hasOwn","is","isExtensible","isFrozen","isSealed"])],["Reflect",new i(["deleteProperty","has"])],["URL",new i(["canParse"])]]),nX=new o([["array",new i(["every","includes","some"])],["map",new i(["has"])],["regexp",new i(["test"])],["set",new i(["has","isDisjointFrom","isSubsetOf","isSupersetOf"])],["string",new i(["endsWith","includes","isWellFormed","startsWith"])],["weakSet",new i(["has"])]]),nY=new o([["regexp",new i(["dotAll","global","hasIndices","ignoreCase","multiline","sticky","unicode","unicodeSets"])]]);function nH(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):nK.has(r.typeToString(t))}(r.getTypeAtLocation(e),r.program.getTypeChecker())}catch{return!1}}function nQ(e,t,r,n){let o=e.filter(e=>"TSCallSignatureDeclaration"===e.type);return o.length>0&&o.every(e=>n0(e.returnType,t,r,n))}function nZ({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:o}){let a=function(e){if(e?.type==="Identifier")return e.name}(e.typeName);if(!a||n.has(a))return!1;n.add(a);let i=ru(a,r),[s]=i?.defs??[],l=s?.type==="Type"?t.sourceCode.getScope(s.node):r,u=s?.type==="Type"&&o(s.node,l);return n.delete(a),u}function n0(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n0(e.typeAnnotation,t,r,n);case"TSBooleanKeyword":return!0;case"TSLiteralType":return"boolean"==typeof e.literal.value;case"TSTypeReference":return nZ({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&n0(e.typeAnnotation,t,r,n)});case"TSTypePredicate":return!e.asserts;case"TSUnionType":return e.types.every(e=>n0(e,t,r,n));case"TypeAnnotation":return e.typeAnnotation?.type==="BooleanTypeAnnotation";default:return!1}}function n1(e,t,r,n=new i){switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n1(e.typeAnnotation,t,r,n);case"TSFunctionType":return n0(e.returnType,t,r,n);case"TSTypeLiteral":return nQ(e.members,t,r,n);case"TSTypeReference":return nZ({node:e,context:t,scope:r,visitedTypeReferenceNames:n,predicate:(e,r)=>"TSTypeAliasDeclaration"===e.type&&n1(e.typeAnnotation,t,r,n)||"TSInterfaceDeclaration"===e.type&&nQ(e.body.body,t,r,n)});case"TSUnionType":return e.types.every(e=>n1(e,t,r,n));default:return!1}}function n2(e,t,r=new i){if(e.async||e.generator)return!1;let n=t.sourceCode.getScope(e);return!!n0(e.returnType,t,n)||!!e.body&&("BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type?n6(e.body.body[0].argument,t,r):"ArrowFunctionExpression"===e.type&&"BlockStatement"!==e.body.type&&n6(e.body,t,r))}function n3(e,t,r=new i){if(e?.type!=="Identifier")return!1;let n=ey(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=>n2(e.node,t,r))}else if(1===n.defs.length){let[e]=n.defs,a=t.sourceCode.getScope(e.name);if(n1(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&&n2(a,t,r)}}return r.delete(n),o}function n8(e,t,r=new i){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=ey(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=n8(o.node.init,t,r);return r.delete(n),a}(e,t,r);case"ParenthesizedExpression":case"TSNonNullExpression":case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":return n8(e.expression,t,r)}}function n6(e,t,r=new i){if(!e)return!1;let n=t.sourceCode.getScope(e);return!!n0(e.typeAnnotation,t,n)||"boolean"==typeof e$(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&&n0(n.name.typeAnnotation,t,o);let a="Variable"===n.type&&"const"===n.parent.kind&&n6(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)&&n6(e.right,t,r)}return r.delete(e),a}(ey(t.sourceCode.getScope(e),e),t,r)||nH(e,t);case"UnaryExpression":return["!","delete"].includes(e.operator);case"LogicalExpression":return n6(e.left,t,r)&&n6(e.right,t,r);case"BinaryExpression":return nz.has(e.operator);case"ConditionalExpression":return n6(e.consequent,t,r)&&n6(e.alternate,t,r);case"TSAsExpression":case"TSTypeAssertion":case"TSSatisfiesExpression":let n;return n=t.sourceCode.getScope(e),n0(e.typeAnnotation,t,n)||n6(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=nJ.get(e.callee.object.name),n=eO(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=nX.get(n8(e.callee.object,t)),n=eO(e.callee,t.sourceCode.getScope(e.callee));return!!r?.has(n)}(e,t))||("Identifier"!==e.callee.type?nH(e,t):!!("Boolean"===e.callee.name&&t.sourceCode.isGlobalReference(e.callee)||nG.has(e.callee.name)&&t.sourceCode.isGlobalReference(e.callee))||n3(e.callee,t,r)||nH(e,t));case"MemberExpression":return function(e,t){if("MemberExpression"!==e.type||e.optional)return!1;let r=nY.get(n8(e.object,t)),n=eO(e,t.sourceCode.getScope(e));return!!r?.has(n)}(e,t)||void 0;default:switch(e.type){case"AwaitExpression":case"TSNonNullExpression":case"ParenthesizedExpression":return n6(e.argument??e.expression,t,r);case"SequenceExpression":return n6(e.expressions.at(-1),t,r);case"AssignmentExpression":return"="===e.operator&&n6(e.right,t,r)}return}}(e,t,r)??nH(e,t))}let n9=new i(["asIntN","asUintN"]),n5=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return n5(e.typeAnnotation);case"TSBigIntKeyword":return!0;case"TSLiteralType":return ts(e.literal);default:return!1}},{isTarget:n4}=ny({targetTypeNames:new i,targetCallNames:["BigInt"],isTargetNode:e=>ts(e)||nN(e,"BigInt")||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"BigInt",n9),isTargetTypeAnnotation:n5,isTargetType:e=>e.isBigIntLiteral?.()||"bigint"===e.intrinsicName,getStaticType:e=>"bigint"==typeof e?r6:r4}),n7=new i(["fromCharCode","fromCodePoint"]),oe=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oe(e.typeAnnotation);case"TSStringKeyword":return!0;case"TSLiteralType":return tt(e.literal);default:return!1}},{isTarget:ot,isKnownNonTarget:or}=ny({targetTypeNames:new i,targetCallNames:["String"],isTargetNode:(e,t)=>{if(tt(e)||nN(e,"String")||"CallExpression"===e.type&&!e.optional&&n$(e.callee,"String",n7))return!0;switch(e.type){case"TemplateLiteral":return!0;case"UnaryExpression":return"typeof"===e.operator;case"BinaryExpression":return"+"===e.operator&&(on(e.left,t)||on(e.right,t));case"AssignmentExpression":if("="===e.operator)return on(e.right,t);return"+="===e.operator&&(on(e.left,t)||on(e.right,t));default:return!1}},isTargetTypeAnnotation:oe,isTargetType:e=>e.isStringLiteral?.()||"string"===e.intrinsicName,getStaticType:e=>"string"==typeof e?r6:r4});function on(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&oe(e.typeAnnotation)||ot(e,t))||"string"==typeof e$(e,t.sourceCode.getScope(e))?.value)}let oo=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","Literal","ObjectExpression","TemplateLiteral"]),oa=e=>oo.has(e.type)||tP(e),oi=new i(["ArrayExpression","BinaryExpression","ClassExpression","Literal","ObjectExpression","TemplateLiteral","UnaryExpression","UpdateExpression"]),os=new i(["AssignmentExpression","AwaitExpression","NewExpression","TaggedTemplateExpression","ThisExpression"]),ol=e=>oi.has(e.type)||os.has(e.type)||tP(e)||tm(e,void 0,tp)&&!tw(e,{method:"bind",optionalCall:!1,optionalMember:!1}),ou=(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&&ou(e.superClass,t))return!0;for(let r of e.body.body)if(r.computed&&ou(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&&ou(e,t))return!0;continue}if(ou(r,t))return!0}}return!1};function op(e,t,r){let[n,o]=[e,t].map(e=>r.sourceCode.getLoc(e).start.line);return n===o}function oc(e,t){let r;if(r=e=t.getNonNullableType(e),!r0.has(r.intrinsicName)){if(e.isUnion()){let r=e.types.map(e=>oc(e,t));return!!r.every(Boolean)||!r.every(e=>!1===e)&&void 0}return void 0!==t.getPromisedTypeOfPromise(e)}}let od=e=>"use"===e||/^use[\dA-Z]/.test(e),om=(e,t)=>"Identifier"===e.type&&"Identifier"===t.type&&e.name===t.name;function of(e,t){return"Identifier"===e.type&&(t.sourceCode.isGlobalReference(e)||!ey(t.sourceCode.getScope(e),e))}let og=(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],oy=(e,t)=>{let{type:r,local:n,imported:o}=e.parent;return"ImportSpecifier"===r&&og(n,o,t)&&n===e},oh=new i(["ArrayExpression","CallExpression","ChainExpression","Identifier","ImportExpression","Literal","MemberExpression","NewExpression","Super","TaggedTemplateExpression","TemplateLiteral","ThisExpression","TSNonNullExpression"]);function ox(e){return oh.has(e.type)}let ob=e=>"Property"===e.parent.type&&e.parent.shorthand&&e===e.parent.value,oE=e=>tb(e.parent),ov=new i(["String","Null","Boolean","Numeric","RegularExpression"]),oC=new i(["[","(","/","`","+","-","*",",","."]);function oD(e,t,r){if(""===r||r&&!oC.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!!ov.has(o)||("Template"===o?a.endsWith("`"):"ObjectExpression"===s.type||"Identifier"===o&&("of"!==a||"ForOfStatement"!==s.type)&&("await"!==a||"AwaitExpression"!==s.type))}let oS=e=>"type"===e.importKind||"type"===e.parent.importKind,oT=(e,t,r)=>r.sourceCode.getRange(e.name??e.node)[0]<=r.sourceCode.getRange(t)[0],oA=(e,t)=>{for(;t;){let r=t.set.get(e);if(r)return r;t=t.upper}},ow=new i(["Map","ReadonlyMap"]),ok=new i(["Set","ReadonlySet"]),oI=ow.union(ok),oj=e=>new i([e]),oF=e=>oI.has(e)?e:void 0,oB=new i(["ClassName","ImportBinding","TSEnumName","Type"]),oR=(e,t,r)=>{let n=r.sourceCode.getScope(t);for(;n;){if(n.set.get(e)?.defs.find(e=>oB.has(e.type)))return!0;n=n.upper}return!1},oP=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},oL=(e,t)=>{if(r0.has(e.intrinsicName))return;if(e.isUnion())return oP(e.types.map(e=>oL(e,t)));let r=r2(e);if(!(r?.declarations?.length>0&&r.declarations.every(e=>t.isSourceFileDefaultLibrary(e.getSourceFile()))))return;let n=r.getName(),o=n&&oF(n);return o&&oj(o)},oN=(e,t)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return oN(e.typeAnnotation,t);case"TSTypeOperator":return"readonly"===e.operator?oN(e.typeAnnotation,t):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type||oR(e.typeName.name,e,t))return;let r=oF(e.typeName.name);return r&&oj(r)}case"TSUnionType":return oP(e.types.map(e=>oN(e,t)))}},o$=(e,t,r=new i)=>((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:n}=r,o=oL(r.getTypeAtLocation(e),n);if(o&&!((e,t,r)=>{for(let n of e)if(oR(n,t,r))return!0;return!1})(o,e,t))return o}catch{}})(e,t)??((e,t,r)=>{if(tf(e,{names:["Map","Set"]})&&of(e.callee,t))return oj(e.callee.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n,o=ey(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=oN(a.name?.typeAnnotation,t);return i?n=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(n=o$(a.node.init,t,r)),r.delete(o),n})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return oN(e.typeAnnotation,t)??o$(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return o$(e.expression,t,r);case"ConditionalExpression":return oP([o$(e.consequent,t,r),o$(e.alternate,t,r)])}})(e,t,r),oM=(e,t)=>{let r=o$(e,t);if(!r?.size)return;let n=!1,o=!1;for(let e of r){if(ow.has(e)){n=!0;continue}if(ok.has(e)){o=!0;continue}return}if(!n||!o)return n?"Map":"Set"};function oO(e,t){if("function"!=typeof e?.[Symbol.iterator])return void t(e);for(let r of e)oO(r,t)}class oU extends Error{name="FixAbortError"}let oq={abort(){throw new oU("Fix aborted.")}};function oV(e){return t=>{let r=e(t,oq),n=[];try{return oO(r,e=>{n.push(e)}),n}catch(e){if(e instanceof oU)return;throw e}}}class oW{#e;#t=new o;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){let r=t=>{let r;t&&e.report((r={...t},t.fix&&(r.fix=oV(t.fix)),Array.isArray(t.suggest)&&(r.suggest=t.suggest.map(e=>({...e,fix:oV(e.fix),data:{...t.data,...e.data}}))),r))};return(e,n,o)=>{for(let a of t){let t=a(e,n,o);t&&oO(t,r)}}}(this.#e,r);return e}}let o_=new i;function oz(e){return o_.has(e)?e:t=>{let r=new oW(t),n=e(new Proxy(t,{get:(e,t,n)=>"on"===t||"onExit"===t?r[t].bind(r):Reflect.get(e,t,n)}));return b.equal(n,void 0,`[${t.id}] Rule \`create\` function should return \`undefined\`, please use \`context.on()\` instead of return listeners.`),r.toEslintListeners()}}function oK(e,t){var r;let{visitScriptBlock:n=!0}={},o=oz(e);return r=e=>{let t=o(e),{parserServices:r}=e.sourceCode;return r?.defineTemplateBodyVisitor?n?r.defineTemplateBodyVisitor(t,t):r.defineTemplateBodyVisitor(t):t},o_.add(r),r}let oG={"??":4,"||":4,"&&":5},oJ={"|":6,"^":7,"&":8,"==":9,"!=":9,"===":9,"!==":9,"<":10,"<=":10,">":10,">=":10,in:10,instanceof:10,"<<":11,">>":11,">>>":11,"+":12,"-":12,"*":13,"/":13,"%":13,"**":15};function oX(e){switch(e.type){case"SequenceExpression":return 0;case"AssignmentExpression":case"ArrowFunctionExpression":case"YieldExpression":return 1;case"ConditionalExpression":return 3;case"LogicalExpression":return oG[e.operator];case"BinaryExpression":return oJ[e.operator];case"TSAsExpression":case"TSSatisfiesExpression":return 10;case"UnaryExpression":case"AwaitExpression":case"TSTypeAssertion":case"TSNonNullExpression":return 16;case"UpdateExpression":return e.prefix?16:17;case"CallExpression":case"ChainExpression":case"ImportExpression":return 18;case"NewExpression":return 19;default:return 20}}function oY(e){return["AwaitExpression","AssignmentExpression","YieldExpression","SequenceExpression","TSAsExpression","TSTypeAssertion"].includes(e.type)}let oH=/^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;function oQ(e){if(to(e=rj(e)))return e.value;if("UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)){let t=oQ(e.argument);if("number"==typeof t)return"-"===e.operator?-t:t}}function oZ(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!rh(e,t);case"Literal":let r;return!!(to(e)&&(r=e.raw,oH.test(r)));default:return!0}}let o0=new i(["!","typeof","void","delete","~","+","-"]),o1=new i(["UpdateExpression","TSNonNullExpression","TSTypeAssertion"]);function o2(e,t){if(!o0.has(t))throw Error("Unexpected operator");return 16>oX(e)||o1.has(e.type)}function o3(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))}function o8(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o6={exports:{}},o9=o6.exports,o5=o8(function(){return u?o6.exports:(u=1,o6.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}(),o6.exports)}());function o4(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 o7(e,t){let r=[],n=new s,o=new s,a=new l;return e.on("onCodePathStart",()=>{r.push(new i)}),e.on("onCodePathEnd",()=>{r.pop()}),e.on("onCodePathSegmentStart",e=>{r.at(-1).add(e)}),e.on("onCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("onUnreachableCodePathSegmentStart",e=>{r.at(-1).add(e)}),e.on("onUnreachableCodePathSegmentEnd",e=>{r.at(-1).delete(e)}),e.on("IfStatement",e=>{[...r.at(-1)].some(e=>e.reachable)&&a.add(e)}),e.onExit(["IfStatement > .consequent","IfStatement > .alternate"],e=>{n.set(e,new i(r.at(-1)))}),e.onExit("IfStatement",e=>{let i=r.at(-1);for(let r of[e.consequent,e.alternate]){if(!r)continue;let s=n.get(r),l=s&&[...i].every(e=>e.prevSegments.every(e=>!s.has(e)))||t?.(r);o.set(r,a.has(e)&&!!l)}}),e=>!!(e&&o.get(e))}function ae(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 at=(e,t)=>ae(e,t,-1),ar=(e,t)=>ae(e,t,1),an=e=>e.charAt(0).toUpperCase()+e.slice(1),ao=e=>e.charAt(0).toLowerCase()+e.slice(1),aa="too-deep",ai="should-parenthesized",as="prefer-event-target",al=new i(["@angular/core","eventemitter3"]),au=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 ap(e){let t;return!!e&&(tj(e)?[t]=e.arguments:"AwaitExpression"===e.type&&"ImportExpression"===e.argument.type&&({source:t}=e.argument),!!(tt(t)&&al.has(t.value)))}let ac={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"},ad="prefer-keyboard-event-key",am="prefer-keyboard-event-key/suggestion",af=new i(["keyCode","charCode","which"]),ag=new i(["onKeyDown","onKeyPress","onKeyUp"]),ay=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)},ah=(e,t)=>{var r;let n,o=[],a="ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type;for(let e of(a&&tw(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&&ag.has(n.name.name)&&o.push({parameter:t.params[0],shouldAutofix:!1}),t.params))ay(e.typeAnnotation)&&o.push({parameter:e,shouldAutofix:!1});let i=e.sourceCode.getDeclaredVariables(t);return o.filter(({parameter:t})=>t&&!nP(t,e)).map(e=>({...e,references:i.find(t=>t.identifiers.includes(e.parameter))?.references}))},ax=(e,t)=>e?.parent?.type==="MemberExpression"&&e.parent.property===e&&!e.parent.computed&&e.parent.object===t,ab=(e,t)=>{let r=[];for(let n=t.parent;n;n=n.parent)tv(n)&&r.push(...ah(e,n));return r},aE=(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)&&to(a)))return;let i=Object.hasOwn(ac,t=a.value)?ac[t]:Number.isSafeInteger(t)&&t>=0&&t<=1114111?String.fromCodePoint(t):void 0;if(i)return{key:i,right:a}})(e),n={messageId:ad,data:{name:e.name},node:e};if(!r)return n;let o=t=>[t.replaceText(e,"key"),t.replaceText(r.right,tK(r.key))];return t?n.fix=o:n.suggest=[{messageId:am,data:{key:r.key},fix:o}],n},av=(e,{parameter:t})=>t?.type==="ObjectPattern"&&t.properties.includes(e.parent),aC=(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)},aD="error",aS="suggestion";function*aT(e,t,r){for(let n of e9(e,r))yield t.remove(n)}function aA(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=eb(a)?` ${r},`:`, ${r}`),e.insertTextBefore(i,r)}function aw(e,t,r){let n=function(e,t){let r=e.parent,n=r.arguments.indexOf(e),o=e9(e,t),a=o[0]||e,i=o.at(-1)||e,{sourceCode:s}=t,[l]=s.getRange(a),[,u]=s.getRange(i);if(1===r.arguments.length){let e=s.getTokenAfter(i);eb(e)&&([,u]=s.getRange(e))}else if(0===n){let e=s.getTokenAfter(i),t=s.getTokenAfter(e,{includeComments:!0});[u]=s.getRange(t)}else{let e=s.getTokenBefore(a);[l]=s.getRange(e)}return[l,u]}(t,r),o=t.parent;if(0===o.arguments.indexOf(t)&&o.arguments.length>1&&r$(r,n)){let{sourceCode:o}=r,a=e9(t,r).at(-1)||t,[,i]=o.getRange(a),s=o.getTokenAfter(a),[l,u]=o.getRange(s),p=o.text.slice(...n),c=p.slice(i-n[0],l-n[0])+p.slice(u-n[0]);return e.replaceTextRange(n,c)}return e.removeRange(n)}function ak(e,t,r,n){return e.replaceTextRange(e5(t,n),r)}function aI(e,t,r,n){let o=e4(r,n);return("MemberExpression"===t.parent.type&&t.parent.object===t?!oZ(r,n):ox(r))||e7(r,n)||(o=`(${o})`),o.startsWith("{")&&(o=`(${o})`),oD(n.sourceCode.getTokenBefore(t),n,o)&&(o=`;${o}`),e.replaceText(t,o)}function*aj(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);eE(a)?yield e.insertTextBefore(a,")"):yield e.insertTextAfter(t,")")}function aF(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*aB(e,t,r){let n=t.sourceCode.getFirstToken(e);yield r.remove(n),yield aF(n,t,r),rh(e,t)||(yield r.insertTextAfter(e,"()")),op(n,e.callee,t)||e7(e,t)||(yield aj(r,e.parent,t))}let aR=({type:e,value:t})=>"Keyword"===e&&/^[a-z]*$/.test(t)||"Identifier"===e&&"of"===t||"Identifier"===e&&"await"===t;function*aP(e,t,r){let{sourceCode:n}=r,o=e5(t,r),a=n.getTokenBefore({range:o},{includeComments:!0});a&&o[0]===n.getRange(a)[1]&&aR(a)&&(yield e.insertTextAfter(a," "));let i=n.getTokenAfter({range:o},{includeComments:!0});i&&o[1]===n.getRange(i)[0]&&aR(i)&&(yield e.insertTextBefore(i," "))}function*aL(e,t,r){var n;yield aP(r,e,t),yield r.insertTextBefore(e,"new ");let{callee:o}=e;!e7(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 aN(e,t,r,n){let[,o]=e5(t.object,r),[,a]=r.sourceCode.getRange(t);return e.replaceTextRange([o,a],n)}let a$=(e,t,r)=>aN(e,t,r,"");function*aM(e,t,r){let n=t.callee;yield a$(e,n,r);let[,o]=e5(n,r),[,a]=r.sourceCode.getRange(t);yield e.removeRange([o,a])}function aO(e,t,r,n=!1){let{sourceCode:o}=t,{lines:a}=o,i=e;if(n){let[t,r]=o.getLastTokens(e,2);eE(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 aU(e,t,r,n){if(ob(e)||"AssignmentPattern"===e.parent.type&&e.parent.left===e&&ob(e.parent))return n.replaceText(e,`${e.name}: ${t}`);if(oy(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&&og(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 aq=(e,t,r,n)=>rJ(e).map(e=>aU(e,t,r,n)),aV=(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*aW(e,t,r,n,o){for(let t of e9(e,o?{sourceCode:o}:n))yield aW(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 a_="require-array-join-separator",az="no-thenable-object",aK="no-thenable-export",aG="no-thenable-class",aJ=(e,t)=>e$(e,t.sourceCode.getScope(e))?.value==="then",aX=(e,t)=>{let r="MemberExpression"===e.type?e.property:e.key;return"Literal"===r.type?"then"===r.value:e.computed||"Identifier"!==r.type?"then"===eO(e,t.sourceCode.getScope(e)):"then"===r.name},aY=[{selector:"ObjectExpression",*getNodes(e,t){for(let r of e.properties)"Property"===r.type&&aX(r,t)&&(yield r.key)},messageId:az},{selectors:["PropertyDefinition","MethodDefinition"],*getNodes(e,t){aX(e,t)&&(yield e.key)},messageId:aG},{selector:"MemberExpression",*getNodes(e,t){"AssignmentExpression"===e.parent.type&&e.parent.left===e&&aX(e,t)&&(yield e.property)},messageId:az},{selector:"CallExpression",*getNodes(e,t){if(!tw(e,{objects:["Object","Reflect"],method:"defineProperty",minimumArguments:3,optionalCall:!1,optionalMember:!1})||"SpreadElement"===e.arguments[0].type)return;let[,r]=e.arguments;aJ(r,t)&&(yield r)},messageId:az},{selector:"CallExpression",*getNodes(e,t){if(tw(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;aJ(e,t)&&(yield e)}},messageId:az},{selector:"Identifier",*getNodes(e){"then"===e.name&&"ExportSpecifier"===e.parent.type&&e.parent.exported===e&&(yield e)},messageId:aK},{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:aK},{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:aK}],aH="no-invalid-remove-event-listener",aQ="consistent-function-scoping",aZ=(e,t)=>e&&t&&(e===t||e.block===t.block),a0=(e,t)=>e.some(e=>aZ(e,t)),a1=["useState","useEffect","useContext","useReducer","useCallback","useMemo","useRef","useImperativeHandle","useLayoutEffect","useDebugValue"].flatMap(e=>[e,`React.${e}`]),a2=new i(["DoWhileStatement","ForInStatement","ForOfStatement","ForStatement","WhileStatement"]),a3=e=>e?.type==="BlockStatement"&&a2.has(e.parent.type)&&e.parent.body===e,a8=new i(["FunctionExpression","ArrowFunctionExpression"]),a6={create:e=>{let{checkArrowFunctions:t}=e.options[0],{sourceCode:r}=e,{scopeManager:n}=r;e.onExit(tE,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&&ou(e,o))||function(e){let t=e;for(;t.parent;){let{parent:e}=t;if("CallExpression"===e.type&&e.arguments[1]===t&&tE.includes(t.type)&&tB(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),a3(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&&tB(l.block.parent.callee,a1)||l&&(a=s,a8.has(a.type)&&"CallExpression"===a.parent.type&&a.parent.callee===a))||rc(i).map(({resolved:e})=>e).filter(Boolean).some(e=>e.references.some(e=>{if(a0(u,e.from))return!0;let{resolved:t}=e,[r]=t.defs;return(r?.type!=="FunctionName"||t.name!==r.name.name)&&a0(u,t.scope)})||e.defs.some(e=>a0(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||aZ(i,r))&&a0(u,r.upper)}))}(e,n,r))return{node:e,loc:ew(e,r),messageId:aQ,data:{functionNameWithKind:eU(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:{[aQ]:"Move {{functionNameWithKind}} to the outer scope."},languages:["js/js"]}},a9="error",a5="error-unknown",a4="suggestion";function a7(e,t,r){return function*(n){yield n.insertTextAfter(e.callee,`.${r}`),yield aB(e,t,n)}}let ie="no-console-spaces",it=e=>e.length>1&&" "===e.charAt(0)&&" "!==e.charAt(1),ir=e=>e.length>1&&" "===e.at(-1)&&" "!==e.at(-2),io="no-empty-file",ia={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:io}}if(r.body.some(e=>!ty(e,tg)))return;let{sourceCode:n}=e,o=rB(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:io}}}),e.on("StyleSheet",r=>{if(r.children.length>0)return;let n=rB(e);if(!t||!(n.length>0))return{node:r,messageId:io}}),e.on("Document",r=>{if(r.parent?.type==="Program"||null!==r.body&&void 0!==r.body)return;let n=rB(e);if(!t||!(n.length>0))return{node:r,messageId:io}}),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:io}}))},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:{[io]:"Empty files are not allowed."},languages:["js/js","css/css","html/html","json/json","json/jsonc","json/json5","markdown/commonmark","markdown/gfm"]}},ii="no-useless-fallback-in-spread";function is(e){return"AwaitExpression"===e.parent.type&&e.parent.argument===e?{expression:e.parent,parent:e.parent.parent,isAwaited:!0}:{expression:e,parent:e.parent,isAwaited:!1}}function il(e,t){let r=e?t.sourceCode.getText(e):"";return e?.type==="SequenceExpression"?`(${r})`:r}let iu="zero-fraction",ip="dangling-dot",ic="error",id="suggestion",im=Symbol.for("default"),ig=Symbol("NAMESPACE_SPECIFIER_NAME"),iy=e=>{switch(e.type){case"Identifier":return Symbol.for(e.name);case"Literal":return e.value}},ih=e=>"type"===e.exportKind||"type"===e.parent.exportKind;function*ix(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?eb:eS),[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);eb(r)&&(yield t.remove(r))}}}(e,t,r));case"ImportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":yield t.remove(e)}}function ib(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 iE={create:function(e){let{sourceCode:t}=e,{checkUsedVariables:r}=e.options[0],n=new i,o=[];e.on("ImportDeclaration",e=>{e.specifiers.length>0&&n.add(e)}),e.on("ExportNamedDeclaration",e=>{tt(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:oS(r)};switch(r.type){case"ImportDefaultSpecifier":return{name:im,text:"default",...n};case"ImportSpecifier":return{name:iy(r.imported),text:t.getText(r.imported),...n};case"ImportNamespaceSpecifier":return{name:ig,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:im,text:"default",isTypeExport:ih(r)};case"ExportSpecifier":return{node:r,name:iy(r.exported),text:t.getText(r.exported),isTypeExport:ih(r)};case"VariableDeclarator":{let n=r.parent.parent;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"===n.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:n,name:Symbol.for(r.id.name),text:t.getText(r.id),isJSDocumentComment:function(e,t){let r=t.getTokenBefore(e,{includeComments:!0});if(r?.type!=="Block"||!r.value.startsWith("*")||r.value.startsWith("**"))return!1;let n=t.getTokenBefore(r),o=t.getLoc(r).start,a=t.getLoc(r).end,i=t.getLoc(e).start;return(!n||t.getLoc(n).end.line<o.line)&&(a.line===i.line||a.line===i.line-1)}(n,t)}}}}(n,t);o&&(e.name!==ig||o.name!==im)&&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 function*(e){for(let t of e)t.isJSDocumentComment||(yield t)}(r)){let r={node:n.node,messageId:ic,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===ig)yield n.insertTextAfter(o,`
28
+ export ${l?"type ":""}* as ${r.text} ${ib(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,eS);yield n.insertTextAfter(t,s)}}else yield n.insertTextAfter(o,`
29
+ export {${s}} ${ib(i,e)}`)}let s=r.isTypeExport&&!t.isTypeImport;1!==t.variable.references.length||s||(yield ix(t.node,n,e)),yield ix(r.node,n,e)}}({context:e,imported:t,exported:n,exportDeclarations:o,program:a});s?r.suggest=[{messageId:id,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:{[ic]:"Use `export…from` to re-export `{{exported}}`.",[id]:"Switch to `export…from`."},languages:["js/js"]}},iv="prefer-native-coercion-functions",iC=new i(["String","Number","BigInt","Boolean","Symbol"]),iD=new i(["every","filter","find","findLast","findIndex","findLastIndex","some"]),iS=(e,t)=>e?.type==="CallExpression"&&!e.optional&&"Identifier"===e.callee.type&&iC.has(e.callee.name)&&e.arguments[0]?.type==="Identifier"&&e.arguments[0].name===t,iT=(e,t)=>{let r={[t]:!0};for(let t of e.split(".").toReversed())r={[t]:r};return r},iA=(e,t)=>{for(let r of Reflect.ownKeys(t)){let n=t[r];"object"==typeof n?(e[r]??={},iA(e[r],n)):e[r]=n}};class iw{static READ=e1.READ;static CALL=e1.CALL;static CONSTRUCT=e1.CONSTRUCT;#n={};#e;#o;#a;constructor({object:e,objects:t=[e],type:r=e1.READ,context:n,filter:o,handle:a}){for(let e of t)iA(this.#n,iT(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 e1(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))}}let ik="no-document-cookie",iI=new iw({object:"document.cookie",filter:({node:e})=>"AssignmentExpression"===e.parent.type&&e.parent.left===e,handle:({node:e})=>({node:e,messageId:ik})}),ij=e=>[`webkit${e}`,`o${e.toLowerCase()}`,e.toLowerCase()],iF=new i(["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",...ij("AnimationStart"),...ij("AnimationEnd"),...ij("AnimationIteration"),...ij("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"]),iB="prefer-add-event-listener",iR={create:e=>{let t,r,n=new i(e.options[0].excludedPackages),o=new s;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=>{tj(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(!iF.has(u))return;let p="addEventListener",c="";if(tP(i)||ti(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||ol(i)||(n=t=>((e,t,r,n)=>{let{sourceCode:o}=t,a=n.property.name.slice(2),i=o.getText(n.object);e7(n.object,t)&&(i=`(${i})`);let s=o.getText(r.right);e7(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:iB,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:{[iB]:"Prefer `{{replacement}}` over `{{method}}`.{{extra}}"},languages:["js/js"]}},iP=new i(["false","true"]),iL=(e,t)=>"BinaryExpression"===e.type&&"==="===e.operator&&(om(e.left,t)||om(e.right,t)),iN=({type:e,name:t},r)=>"Identifier"===e&&t===r;function i$({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(!tw(r,{method:e,argumentsLength:1,optionalCall:!1})||!("ArrowFunctionExpression"===(p=r.arguments[0]).type&&!p.async&&1===p.params.length&&iL(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&&iL(p.body.body[0].argument,p.params[0]))||nD(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(iN(f,y))l=g,u=f;else{if(!iN(g,y))return;l=f,u=g}let h=s.acquire(c);if(!h||ey(h,m).references.some(({identifier:e})=>e!==u)||rQ(c,h))return;let x=r.callee.property,b={node:x,messageId:o,suggest:[]},E=function*(e){let r=i.getText(l);e7(l,n)&&!e7(c,n)&&(r=`(${r})`),yield e.replaceText(x,t),yield e.replaceText(c,r)};return ez(l,i)?b.suggest.push({messageId:a,fix:E}):b.fix=E,b}),r&&i.parserServices?.program&&n.on("CallExpression",r=>{if(!tw(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(om(r,t))return r;if("CallExpression"===r.type&&!r.optional&&iN(r.callee,"Boolean")&&1===r.arguments.length&&om(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=>iP.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||ey(p,a).references.some(({identifier:e})=>e!==u)||rQ(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 iM=i$({method:"findIndex",replacement:"indexOf"}),iO=i$({method:"findLastIndex",replacement:"lastIndexOf"}),iU={create(e){iM.listen(e),iO.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:{...iM.messages,...iO.messages},languages:["js/js"]}},iq="error",iV="prefer-date",iW="prefer-date-now-over-methods",i_="prefer-date-now-over-number-data-object",iz=e=>tf(e,{name:"Date",argumentsLength:0}),iK=(e,t,r)=>({node:e,messageId:iV,*fix(t){yield t.replaceText(e,"Date.now()"),"UnaryExpression"===e.type&&(yield aP(t,e,r))},...t}),iG="prefer-dataset",iJ="prefer-attributes",iX=e=>`data-${e.replaceAll(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`,iY=e=>tT(e,{property:"dataset"}),iH=e=>e.computed||"Identifier"!==e.property.type?e.computed&&tt(e.property)?e.property.value:void 0:e.property.name,iQ=new i(["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf","__proto__","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),iZ=/[\s\u0000-\u001F"'/<=>]/,i0=e=>iQ.has(e)||e.includes("-")||iZ.test(e);function i1(e,t){let r=e4(e,t);return!e7(e,t.sourceCode)&&oZ(e,t)?`(${r})`:r}let i2={create:e=>{let{preferAttributes:t}=e.options[0];if(t){let{sourceCode:t}=e,r=(r,n,o)=>{if(i0(n.value)||nR(o.object,e))return;let a=i1(o.object,e),i=o.optional?"?.":".",s=tK(iX(n.value),n.raw.charAt(0)),l=rL(e,r,[o.object])?void 0:n=>{let o=`${a}${i}hasAttribute(${s})`;return oD(t.getTokenBefore(r),e,o)&&(o=`;${o}`),n.replaceText(r,o)};return{node:r,messageId:iJ,data:{method:"hasAttribute"},fix:l}};e.on("BinaryExpression",e=>{if("in"===e.operator&&tt(e.left)&&iY(e.right))return r(e,e.left,e.right)}),e.on("CallExpression",e=>tw(e,{object:"Object",method:"hasOwn",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&iY(e.arguments[0])&&tt(e.arguments[1])?r(e,e.arguments[1],e.arguments[0]):tw(e,{method:"hasOwnProperty",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&iY(e.callee.object)&&tt(e.arguments[0])?r(e,e.arguments[0],e.callee.object):void 0),e.on("VariableDeclarator",t=>{let r;if(!(t.init&&iY(t.init)&&("ObjectPattern"===t.id.type||"Identifier"===t.id.type))||nR(t.init.object,e))return;let n=t.init;if("Identifier"===t.id.type)return{node:n,messageId:iJ,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=iH(n);if(void 0===o||i0(o))return;let{parent:a}=n;if(nL(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=>ey(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)&&!rL(t,o)&&i.every(e=>!rL(t,e))))return;let s=i1(n.object,t);return function*(e){for(let r of(yield aO(o,t,e),i)){let t=r.computed?r.property.raw.charAt(0):void 0,n=tK(iX(iH(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?!tt(e.key)||i0(e.key.value):i0(e.key.name))))return;let a=t.parent,i=i1(n.object,e),s=n.optional?"?.":".";if(o.length>0&&1===a.declarations.length&&!a.parent.type.startsWith("For")&&"ExportNamedDeclaration"!==a.parent.type&&!rL(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=rw(a,e),n=o.map(e=>{let t=tK(iX(e.key.name),"'");return`${a.kind} ${e.value.name} = ${i}${s}getAttribute(${t})`});r=e=>e.replaceText(a,`${n.join(`;
30
+ ${t}`)};`)}return{node:n,messageId:iJ,data:{method:"getAttribute"},fix:r}}),e.on("MemberExpression",r=>{let n,{object:o}=r;if(!iY(o)||nR(o.object,e))return;let a=iH(r);if(void 0===a||i0(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(nL(r)&&!s&&!l)return;let u=i1(o.object,e),p=o.optional?"?.":".",c=r.computed?r.property.raw.charAt(0):void 0,d=tK(iX(a),c);return s&&oE(i)&&!rL(e,i,[o.object,i.right])?n=t=>t.replaceText(i,`${u}${p}setAttribute(${d}, ${e4(i.right,e)})`):l&&tb(i.parent)&&!rL(e,i,[o.object])?n=r=>{let n=`${u}${p}removeAttribute(${d})`;return oD(t.getTokenBefore(i),e,n)&&(n=`;${n}`),r.replaceText(i,n)}:s||l||rL(e,r,[o.object])||(n=e=>e.replaceText(r,`${u}${p}getAttribute(${d})`)),{node:r,messageId:iJ,data:{method:s?"setAttribute":l?"removeAttribute":"getAttribute"},fix:n}});return}e.on("CallExpression",t=>{if(!((tw(t,{method:"setAttribute",argumentsLength:2,optionalCall:!1,optionalMember:!1})||tw(t,{methods:["removeAttribute","hasAttribute"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(t,{method:"getAttribute",argumentsLength:1,optionalCall:!1}))&&tt(t.arguments[0]))||nR(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:iG,data:{method:r},fix:function(e,t){let r=e.callee.property.name;if("setAttribute"===r&&rY(e.callee)||"setAttribute"===r&&!oE(e)||"removeAttribute"===r&&!tb(e.parent))return;let n=[e.callee.object];if("setAttribute"===r&&n.push(e.arguments[1]),!rL(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=`${i1(e.callee.object,t)}${e.callee.optional?"?":""}.dataset`;switch(r){case"setAttribute":case"getAttribute":case"removeAttribute":i=rF(a)?`.${a}`:`[${tK(a,o.raw.charAt(0))}]`,i=`${s}${i}`,"setAttribute"===r?i+=` = ${e4(e.arguments[1],t)}`:"removeAttribute"===r&&(i=`delete ${i}`);break;case"hasAttribute":i=`Object.hasOwn(${s}, ${tK(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:{[iG]:"Prefer `.dataset` over `{{method}}(…)`.",[iJ]:"Prefer `.{{method}}(…)` over `.dataset`."},languages:["js/js"]}},i3="prefer-modern-math-apis",i8=(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,i6=(e,t)=>"CallExpression"===e.type&&!e.optional&&i8(e.callee,t)&&1===e.arguments.length&&"SpreadElement"!==e.arguments[0].type;function i9({constantName:e,replacementMethod:t}){let r=`Math.${t}(…)`;return function(n,o){let a,i;if("BinaryExpression"!==n.type||"*"!==n.operator||(i6(n.left,"log")&&i8(n.right,e)?(a=n.left,i=`Math.log(…) * Math.${e}`):i6(n.right,"log")&&i8(n.left,e)&&(a=n.right,i=`Math.${e} * Math.log(…)`),!a))return;let[s]=a.arguments;return{node:n,messageId:i3,data:{replacement:r,description:i},fix:e=>e.replaceText(n,`Math.${t}(${e4(s,o)})`)}}}function i5({constantName:e,replacementMethod:t}){let r={messageId:i3,data:{replacement:`Math.${t}(…)`,description:`Math.log(…) / Math.${e}`}};return function(n,o){if(!("BinaryExpression"===n.type&&"/"===n.operator&&i6(n.left,"log")&&i8(n.right,e)))return;let[a]=n.left.arguments;return{...r,node:n,fix:e=>e.replaceText(n,`Math.${t}(${e4(a,o)})`)}}}let i4=[i9({constantName:"LOG10E",replacementMethod:"log10"}),i9({constantName:"LOG2E",replacementMethod:"log2"}),i5({constantName:"LN10",replacementMethod:"log10"}),i5({constantName:"LN2",replacementMethod:"log2"})],i7=e=>"BinaryExpression"===e.type&&"+"===e.operator?[e.left,e.right].flatMap(e=>i7(e)):[e],se="number-literal-case",st=(e,{hexadecimalValue:t})=>{let r=e.toLowerCase();return r.startsWith("0x")&&(r="0x"+r.slice(2)["lowercase"===t?"toLowerCase":"toUpperCase"]()),r},sr={create:oK(e=>{e.on("Literal",t=>{let{raw:r}=t,n=e.options[0]??{};n.hexadecimalValue??="uppercase";let o=r;if(to(t)?o=st(r,n):ts(t)&&(o=st(r.slice(0,-1),n)+"n"),r!==o)return{node:t,messageId:se,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:{[se]:"Invalid number literal casing."},languages:["js/js"]}},sn="error",so="suggestion",sa={parseInt:!0,parseFloat:!0,NaN:!0,Infinity:!0,isNaN:!1,isFinite:!1},si=e=>{let{parent:t}=e;return"UnaryExpression"===t.type&&"-"===t.operator&&t.argument===e};function ss(e,t){let{node:r,path:n}=e,[o]=n,{parent:a}=r,i=o;"Infinity"===o&&(i=si(r)?"NEGATIVE_INFINITY":"POSITIVE_INFINITY");let s={node:r,messageId:sn,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 aP(e,a,t)},s;let l=e=>aU(r,`Number.${i}`,t,e);return sa[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&&n_(n,t.sourceCode.getScope(e))})(r,t)?s.fix=l:s.suggest=[{messageId:so,fix:l}],s}let sl={create:e=>{let{checkInfinity:t,checkNaN:r}=e.options[0];new iw({objects:Object.keys(sa).filter(e=>(!!t||"Infinity"!==e)&&(r||"NaN"!==e)),context:e,handle:ss,filter(t){let{node:r,path:n}=t,[o]=n;return!nL(r)&&!("Infinity"===o&&(e=>{if(!si(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&&e$(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:{[sn]:"Prefer `Number.{{property}}` over `{{description}}`.",[so]:"Replace `{{description}}` with `Number.{{property}}`."},languages:["js/js"]}},su="prefer-reflect-apply",sp=(e,t)=>(ti(e)||"ThisExpression"===e.type)&&("ArrayExpression"===t.type||"Identifier"===t.type&&"arguments"===t.name),sc=(e,t,r,n)=>`Reflect.apply(${e.getText(t)}, ${e.getText(r)}, ${e.getText(n)})`,sd="prefer-set-size";var sm={exports:{}},sf=o8(function(){var e,t,r,n;return p?sm.exports:(p=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&&W("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)||W("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 v(){var t,r=[],n=H;for(r.push(C());y("|");)r.push(C());return 1===r.length?r[0]:{type:"disjunction",body:r,range:[n,t=H],raw:e.substring(n,t)}}function C(){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 D("(?=","lookahead","(?!","negativeLookahead");default:return}}();if(r){var s=H;if(t=T()||!1){if(!Y&&"group"===r.type)return t.body=d(r),o(t,r.range[0]),t;H=s,W("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);W("atomEscape")}return t;case"[":return N();case"(":if(n.lookbehind&&(t=D("(?<=","lookbehind","(?<!","negativeLookbehind")))return t;if(n.namedGroups&&g("(?<")){var r,o,a,s,u,p=B();f(">");var c=S("normal",p.range[0]-3);return c.name=p,c}if(!n.modifiers||"(?"!==e.substring(H,H+2)||":"==e[H+2])return D("(?:","ignore","(","normal");return o=H,m(2),a=E(/^[sim]+/),y("-")&&":"!==h()?(r=E(/^[sim]+/))||W("Invalid flags for modifiers group"):a||W("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))&&W("flags cannot be duplicated for modifiers group"),y(":")||W("Invalid flags for modifiers group"),(u=S("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=T()||!1)&&(H=s,W("Expected atom")),!Y&&y("{")?u=l("{"):W("Expected atom")),t=T()||!1){var p=u.type,c=u.behavior;return"group"===p&&("negativeLookbehind"===c||"lookbehind"===c)&&W("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 D(e,t,r,n){var o,a=H;if(g(e))o=t;else{if(!g(r))return!1;o=n}return S(o,a)}function S(t,r){var n,o=v();o||W("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 T(){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))&&W("numbers out of order in {} quantifier","",o,H),e=u(t,r,o,H)),(t&&!Number.isSafeInteger(t)||r&&!Number.isSafeInteger(r))&&W("iterations outside JS safe integer range in quantifier","",o,H)}return e&&y("?")&&(e.greedy=!1,e.range[1]+=1),e}function A(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(_.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 L();W("\\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(!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)}}}()||L();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)}||L();case"-":if(t&&Y)return m(),s("singleEscape",45,"\\-");return L();default:return j()}}function k(e,t){Y&&W("Invalid decimal escape in unicode mode",null,e,t)}function I(e){var t;return(t=E(/^u([0-9a-fA-F]{4})/))?A(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)&&W("Invalid escape sequence",null,t,H),e}return L()}function F(t){var n=h(),o=H;if("\\"===n){m();var a=I(!0);return a&&t(a.codePoint)||W("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(R);for(n||W("Invalid identifier");t=F(P);)n+=t;return{type:"identifier",value:n,range:[r,H],raw:e.substring(r,H)}}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 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 N(){var e,t=H;return g("[^")?(e=$(),f("]"),p(e,!0,t,H)):y("[")?(e=$(),f("]"),p(e,!1,t,H)):null}function $(){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("&")&&W("&& 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())||W("classAtom"),(e=x("]")?[t]:function e(t){if(x("-")&&!b("]")){r=t.range[0],m(),i=l("-"),(a=M())||W("classAtom"),n=H;var r,n,o,a,i,s,u=$();return(u||W("classContents"),"codePoint"in t&&"codePoint"in a?o=[c(t,a,r,n)]:Y?W("invalid character class"):o=[t,i,a],"empty"===u.type)?o:o.concat(u.body)}return(s=M())||W("classAtom"),(o=x("]")?s:e(s))||W("nonEmptyClassRangesNoDash"),[t].concat(o)}(t))||W("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("\\");W("classEscape")}return A(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=U();)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=V())return n;W("Invalid escape","\\"+h(),o)}else if(n=q())r=n;else{if(n=N())return n;W("Invalid character",h())}if(t&&x("-")&&!b("-")){if(m(),n=U())return c(r,n,o,H);W("Invalid range end",h())}return r}function U(){if(y("\\")){var e,t=H;if(e=V())return e;W("Invalid escape","\\"+h(),t)}return q()}function q(){var e;if(E(/^(?:&&|!!|##|\$\$|%%|\*\*|\+\+|,,|\.\.|::|;;|<<|==|>>|\?\?|@@|\^\^|``|~~)/)&&W("Invalid set operation in character class"),e=E(/^[^()[\]{}/\-\\|]/))return l(e)}function V(){var e;if(y("b"))return s("singleEscape",8,"\\b");if(y("B"))W("\\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 W(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 _=[],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 Q=v();return(Q.range[1]!==e.length&&W("Could not parse entire input - got stuck","",Q.range[1]),G=G||_.some(function(e){return e<=z}))?(H=0,K=!1,v()):Q}},sm.exports?sm.exports=n:window.regjsparser=n,sm.exports)}());let sg=String.raw`\$&`,sy=new i(String.raw`\^$.*+?()[]{}|/-`),{parse:sh}=sf,sx="method",sb="pattern",sE="split-join",sv=new i(["i","y"]),sC=new i(["anchor","reference"]),sD=e=>String.raw`\u{${e.toString(16).toUpperCase()}}`;function sS(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`:sD(r);if("null"===t||"octal"===t)return sD(r);let o=n;return(("identifier"===t||"symbol"===t&&n.length>1&&n.startsWith("\\"))&&(o=o.slice(1)),"'"===o||"\\"===o)?`\\${o}`:o}function sT(e){return"value"===e.type?sS(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?sA(e.body):void 0:sS(e.body[0])}function sA(e){let t=[];for(let r of e){let e=sT(r);if(void 0===e)return;t.push(e)}return t.join("")}let sw=e=>{let{pattern:t,flags:r}=e.regex;try{return sh(t,r,{unicodePropertyEscape:r.includes("u"),unicodeSet:r.includes("v"),namedGroups:!0,lookbehind:!0})}catch{}},sk=e=>{let t=0;for(let r of e)t+=sI(r);return t};function sI(e){return sC.has(e.type)?0:["value","dot","characterClass","characterClassEscape","unicodePropertyEscape"].includes(e.type)?1:"alternative"===e.type?sk(e.body):"disjunction"===e.type?Math.min(...e.body.map(e=>sI(e))):"quantifier"===e.type?e.min*sk(e.body):"group"===e.type&&"ignore"===e.behavior?sk(e.body):0}let sj=e=>"group"===e.type&&"normal"===e.behavior||Array.isArray(e.body)&&e.body.some(e=>sj(e)),sF=e=>to(e)&&Number.isSafeInteger(e.value)&&e.value>=0,sB=(e,t)=>{if("BinaryExpression"===e.type&&"+"===e.operator&&(rC(e.left,t)&&te(e.right,1)||te(e.left,1)&&rC(e.right,t)))return t},sR=e=>to(e)?e.value:"UnaryExpression"===e.type&&"-"===e.operator?-sR(e.argument):void 0,sP=e=>e?.type==="MemberExpression"&&!1===e.computed&&"Identifier"===e.property.type&&"length"===e.property.name,sL="prefer-string-trim-start-end",sN="no-unreadable-iife",s$="suggestion",sM="throw-new-error",sO=/^(?:[A-Z][\da-z]*)*Error$/,sU="escape-uppercase",sq="escape-lowercase",sV=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+})/g,sW=/(?<=(?:^|[^\\])(?:\\\\)*\\)(?<data>x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|u{[\dA-Fa-f]+}|c[A-Za-z])/g,s_=({node:e,original:t,regex:r=sV,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?sq:sU,fix:t=>o?o(t,a):t.replaceText(e,a)}},sz="prefer-unicode-code-point-escapes",sK="prefer-unicode-code-point-escapes/add-unicode-flag",sG=String.raw`\u{`,sJ=/^[\da-f]$/iv,sX=/^[0-7]$/v,sY=/^[A-Za-z]$/v;function sH(e){return sX.test(e)}function sQ(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==0}function sZ(e,t){let r=0;for(let n=t-1;n>=0&&"\\"===e[n];n--)r++;return r%2==1}function s0(e,t,r){let n=e.slice(t,t+r);if(!(n.length!==r||[...n].some(e=>!sJ.test(e))))return Number.parseInt(n,16)}function s1(e){return e>=55296&&e<=56319}function s2(e){return e>=56320&&e<=57343}function s3(e){return String.raw`\u{${e.toString(16).toUpperCase()}}`}function s8(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)&&!sZ(e,i)){o++,n+=s;continue}if(t&&"]"===s&&l&&!sZ(e,i)){o--,n+=s;continue}if("\\"!==s||!sQ(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=s0(e,t+2,2);if(void 0!==r)return{end:t+4,replacement:s3(r)}}(e,t)??function(e,t,{allowSurrogatePair:r,allowSurrogate:n}){if("u"!==e[t+1]||"{"===e[t+2])return;let o=s0(e,t+2,4);if(void 0===o||!n&&(s1(o)||s2(o)))return;let a=t+6;if(r&&s1(o)&&"\\"===e[a]&&sQ(e,a)&&"u"===e[a+1]){let t=s0(e,a+2,4);if(s2(t))return{end:a+6,replacement:s3((o-55296)*1024+(t-56320)+65536)}}return{end:t+6,replacement:s3(o)}}(e,t,{allowSurrogatePair:!n,allowSurrogate:!r||!n})??(r?function(e,t){let r=e[t+2];if("c"===e[t+1]&&sY.test(r))return{end:t+3,replacement:s3(r.toUpperCase().codePointAt(0)%32)}}(e,t):function(e,t){let r=e[t+1];if("0"===r&&!sH(e[t+2])||!sH(r))return;let n=r>="0"&&r<="3"?3:2,o=t+1;for(;o<t+1+n&&sH(e[o]);)o++;return{end:o,replacement:s3(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 s6(e,t,r){let{fixed:n,hasReplacement:o}=s8(t);if(o)return{node:e,messageId:sz,fix:t=>r?r(t,n):t.replaceText(e,n)}}function s9(e){return e.includes("u")||e.includes("v")?e:`${e}u`}let s5=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],s4=["Error","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","AggregateError","SuppressedError"],s7="missing-message",le="message-is-empty-string",lt="message-is-not-a-string",lr=new o([["AggregateError",1],["SuppressedError",2]]),ln=e=>"instanceof"===e.value&&"Keyword"===e.type,lo="no-instanceof-builtins",la="switch-to-type-of",li=new i(["String","Number","Boolean","BigInt","Symbol"]),ls=new i(["global","globalThis","self","window"]),ll=[...s4,"Map","Set","WeakMap","WeakRef","WeakSet","ArrayBuffer",...rZ,"Object","RegExp","Promise","Proxy","DataView","Date","SharedArrayBuffer","FinalizationRegistry"],lu=(e,t,r)=>function*(n){let{left:o,right:a}=e,i=rG(t,e),s=i.getTokenAfter(o,ln),{sourceCode:l}=t,u=l.getAncestors(e).findLast(e=>"VExpressionContainer"===e.type),p=u?'"'===l.getText(u)[0]?"'":'"':"'";yield aP(n,e,t);let c=e5(o,{sourceCode:i});!e7(o,t)&&o2(o,"typeof")?(yield n.insertTextBeforeRange(c,"typeof ("),yield n.insertTextAfterRange(c,")")):yield n.insertTextBeforeRange(c,"typeof "),yield n.replaceText(s,"===");let d=e5(a,{sourceCode:i});yield n.replaceTextRange(d,p+r.toLowerCase()+p)},lp=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,lc={create:oK(e=>{let{useErrorIsError:t=!1,strategy:r="loose",include:n=[],exclude:o=[]}=e.options[0]??{},a=new i("strict"===r?[...ll,...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&&ls.has(n.object.name)&&of(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:lo};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=rG(e,r),s=i.getTokenAfter(o,ln);yield aP(t,r,e);let l=e5(o,{sourceCode:i});yield t.insertTextBeforeRange(l,n+"("),yield t.insertTextAfterRange(l,")"),yield aW(s,"",t,e,i),yield aW(a,"",t,e,i)},p}return"Function"===l?(lp(n,e)||(p.fix=lu(r,e,l)),p):li.has(l)?(lp(n,e)||(p.suggest=[{messageId:la,data:{type:l.toLowerCase()},fix:lu(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:{[lo]:"Avoid using `instanceof` for type checking as it can lead to unreliable results.",[la]:"Switch to `typeof … === '{{type}}'`."},languages:["js/js"]}},ld="prefer-type-error",lm=new i(["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"]),lf=new i(["isNaN","isFinite"]),lg=(e,t,r)=>void 0!==t&&t.arguments.length>0&&"Identifier"===e.type&&(!0===r&&lm.has(e.name)||!1===r&&lf.has(e.name)),ly=(e,t)=>!!lg(e.property,t,!0)||"MemberExpression"===e.object.type&&ly(e.object,t),lh=/^(?:[A-Z][\da-z]*)*Error$/,lx=e=>"UnaryExpression"===e.type&&"typeof"===e.operator,lb=(e,t)=>{switch(e.type){case"Identifier":return lg(e,t,!1);case"MemberExpression":return ly(e,t);case"CallExpression":return lb(e.callee,e);case"UnaryExpression":return"typeof"===e.operator||"!"===e.operator&&lb(e.argument);case"BinaryExpression":{let{operator:r,left:n,right:o}=e;if("instanceof"===r)return!("Identifier"===o.type?lh.test(o.name):"MemberExpression"===o.type&&!o.optional&&!o.computed&&"Identifier"===o.property.type&&lh.test(o.property.name));if((e=>{let{operator:t,left:r,right:n}=e;return("=="===t||"!="===t||"==="===t||"!=="===t)&&(lx(r)&&te(n,"undefined")||lx(n)&&te(r,"undefined"))})(e))return!1;return lb(n,t)||lb(o,t)}case"LogicalExpression":return lb(e.left,t)&&lb(e.right,t);default:return!1}},lE="consistentDestructuring",lv="consistentDestructuringSuggest",lC=new i(["FunctionDeclaration","FunctionExpression","MethodDefinition","PropertyDefinition","AccessorProperty","StaticBlock","Program"]),lD=e=>{for(;e.parent;)if(e=e.parent,lC.has(e.type))return e},lS=e=>"Property"===e.type&&!e.computed&&"Identifier"===e.key.type,lT=(e,t,r,n)=>{for(let o of e){if(o.key.name!==t)continue;let e=ey(n.getScope(o.value),o.value);if(e&&ey(r,o.value)===e)return o}},lA=({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=rj(t.object),u="Identifier"===l.type?l.name:void 0,p="Identifier"===l.type?ey(r,l):void 0,c="ThisExpression"===l.type?lD(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},lw=(e,t,r)=>!!("BinaryExpression"===e.type&&"in"===e.operator&&tt(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&&(lw(e.left,t,r)||lw(e.right,t,r)),lk=(e,t,r,n)=>{switch(e.type){case"ConditionalExpression":case"IfStatement":return e.consequent===t&&lw(e.test,r,n);case"LogicalExpression":return"&&"===e.operator&&e.right===t&&lw(e.left,r,n);default:return!1}},lI=e=>["AccessorProperty","FunctionDeclaration","MethodDefinition","PropertyDefinition"].includes(e.type),lj=["Object","Array","ArrayBuffer","DataView","Date","Function","Map","WeakMap","Set","WeakSet","Promise","RegExp","SharedArrayBuffer","Proxy","WeakRef","FinalizationRegistry","DisposableStack","AsyncDisposableStack",...s4,...["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}`),...rZ],lF=["Temporal.Now","WebAssembly","WebAssembly.JSTag"],lB="error-date",lR="suggestion-date";function lP(e){let{node:t}=e;return{node:t,messageId:"disallowCallOrNew",data:{name:e.path.join(".")}}}let lL=new iw({objects:["BigInt","Boolean","Number","String","Symbol"],type:iw.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=>aB(r,t,e)),o}}),lN=new iw({objects:lj,type:iw.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 aP(e,r,t)}let e={node:r,messageId:lB};return 0===t.sourceCode.getCommentsInside(r).length&&0===r.arguments.length?e.fix=o:e.suggest=[{messageId:lR,fix:o}],e}return{node:r,messageId:"enforce",data:{name:n},fix:e=>aL(r,t,e)}}}),l$=new iw({objects:lF,type:iw.CALL,handle:lP}),lM=new iw({objects:lF,type:iw.CONSTRUCT,handle:lP}),lO="error/array-push",lU="suggestion",lq=e=>tT(e,{property:"classList",computed:!1}),lV=e=>e.arguments.some(e=>"SpreadElement"===e.type),lW=[{description:"Array#push()",test:e=>tw(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=>tw(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=>tw(e,{method:"add",optionalCall:!1,optionalMember:!1})&&lq(e.callee.object)},{description:"Element#classList.remove()",test:e=>tw(e,{method:"remove",optionalCall:!1,optionalMember:!1})&&lq(e.callee.object)},{description:"importScripts()",test:e=>tm(e,{name:"importScripts"},tp)}],l_={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 lW){if(!a(n))continue;let l=[...i,...t];if(tB(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=at(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)||!rC(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&&!eE(r.getLastToken(p))&&eE(r.getLastToken(u)),v=d&&oD(r.getTokenBefore(p),e,r.text.slice(x[0],x[0]+1)),C={node:"Identifier"===n.callee.type?n.callee:n.callee.property,messageId:lO,data:{description:o}},D=function*(t){if(y.length>0){let r=rb(e,g,!m),{openingParenthesisToken:n,trailingCommaToken:o,closingParenthesisToken:a}=rx(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||v?";":"")};!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&&(lV(e)||lV(t))||r&&o.some(e=>null===e$(e,n.getScope(e)))||o.some(e=>ez(e,n))}(c,n,s,r)?C.suggest=[{messageId:lU,fix:D}]:C.fix=D),yield C}})},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:{[lO]:"Do not call `{{description}}` multiple times.",[lU]:"Merge with previous one."},languages:["js/js"]}},lz="no-process-exit",lK=e=>te(e,"node:worker_threads")||te(e,"worker_threads"),lG="no-single-promise-in-promise-methods/error",lJ="no-single-promise-in-promise-methods/unwrap",lX="no-single-promise-in-promise-methods/use-promise-resolve",lY=["all","any","race"],lH=(e,t)=>{let[r]=e.arguments[0].elements,n=e4(r,t);return!e7(r,t)&&16>oX(r)&&(n=`(${n})`),n},lQ=(e,t)=>e.getCommentsInside(t).length>0,lZ=e=>"ArrayPattern"===e.type&&!e.typeAnnotation&&1===e.elements.length&&e.elements[0]?.type==="Identifier",l0="no-static-only-class",l1=({type:e,value:t})=>"Punctuator"===e&&"="===t,l2=e=>"PropertyDefinition"===e.type,l3="ignored-elements",l8="property-assignment",l6={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:l3},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;!e7(c,e)&&oZ(c,e)?(yield i.insertTextBefore(c,"("),yield i.insertTextAfter(a,`)${p}`)):yield i.insertTextAfter(a,p),yield aP(i,n,e)})}return i}),e.on("MemberExpression",e=>{if(function e(t){let{parent:r}=t;if(r){if(rI(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:l8}})},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:{[l3]:"Array destructuring may not contain consecutive ignored values.",[l8]:"Do not assign destructured values to object properties."},languages:["js/js"]}},l9="spread-in-list",l5="iterable-to-array",l4="iterable-to-array-in-for-of",l7="iterable-to-array-in-yield-star",ue="spread-in-collection-constructor",ut="spread-in-object-assign",ur="clone-array",un="suggestion/remove-object-assign-spread",uo=["Map","WeakMap","Set","WeakSet"],ua=["copyWithin","flat","slice","splice","toReversed","toSorted","toSpliced","with"],ui=[...ua,"filter","flatMap","map"],us=e=>"ArrayExpression"===e.type&&1===e.elements.length&&e.elements[0]?.type==="SpreadElement",ul={ArrayExpression:"array literal",ObjectExpression:"object literal",CallExpression:"arguments",NewExpression:"arguments"};function*uu(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),eb(s)&&(yield e.remove(s));let{parent:u}=t;"ReturnStatement"!==u.type&&"ThrowStatement"!==u.type||u.argument!==t||op(o,i,r)||e7(t,r)?yield aP(e,t,r):yield aj(e,u,r)}let up=(e,t)=>"CallExpression"===e.type&&"MemberExpression"===e.callee.type&&nv(e.callee.object,t),uc="no-useless-switch-case/error",ud="no-useless-switch-case/suggestion",um=e=>e.consequent.every(e=>ty(e)),uf=e=>tP(e.test)||ti(e.test),ug=new i(["CallExpression","MemberExpression"]),uy=new i(["Identifier","MemberExpression","Super","ThisExpression"]);[...new o([["===","!=="],["!==","==="],["==","!="],["!=","=="]])];let uh=e=>"MemberExpression"===(e=rj(e)).type?{...e,object:uh(e.object),property:e.computed?uh(e.property):e.property}:e,ux=(e,t)=>rC(uh(e),uh(t)),ub=e=>uy.has(rj(e).type),uE=e=>!!("ChainExpression"===e.type||ug.has(e.type)&&e.optional)||Object.entries(e).some(([e,t])=>"parent"!==e&&!!t&&(Array.isArray(t)?t.some(e=>e?.type&&uE(e)):t.type&&uE(t))),uv="no-useless-undefined",uC="no-useless-undefined/suggestion",uD=new i(["is","equal","notEqual","strictEqual","notStrictEqual","propertyVal","notPropertyVal","not","include","property","toBe","toHaveBeenCalledWith","toContain","toContainEqual","toEqual","same","notSame","strictSame","strictNotSame"]),uS=e=>{for(;e;e=e.upper)if("function"===e.type)return e.block},uT={">=":{valid:!0,addend:0},">":{valid:!0,addend:-1},"<":{valid:!1,addend:0},"<=":{valid:!1,addend:-1}},uA={"<=":{valid:!0,addend:0},"<":{valid:!0,addend:-1},">":{valid:!1,addend:0},">=":{valid:!1,addend:-1}},uw={"<":{valid:!0,kind:"length"},"<=":{valid:!0,kind:"lengthMinusOne"},">=":{valid:!1,kind:"length"},">":{valid:!1,kind:"lengthMinusOne"}},uk={">":{valid:!0,kind:"length"},">=":{valid:!0,kind:"lengthMinusOne"},"<=":{valid:!1,kind:"length"},"<":{valid:!1,kind:"lengthMinusOne"}},uI=new i(["<","<=",">",">="]);function uj(e,t,r,n){let o=e[t];if(o&&r===n+o.addend)return o.valid}function uF(e,t){return tT(e=rj(e),{property:"length",optional:!1,computed:!1})&&ux(e.object,t)}function uB(e,t){return uF(e=rj(e),t)?"length":"BinaryExpression"===e.type&&"-"===e.operator&&uF(e.left,t)&&1===oQ(e.right)?"lengthMinusOne":void 0}function uR(e,t,r){let n=e[t];if(n?.kind===r)return n.valid}let uP={create:e=>{let{sourceCode:t}=e,r=(e,r,n)=>{if(n){let r=uS(t.getScope(e));if(r?.returnType)return}return{node:e,messageId:uv,fix:r}},n=e.options[0];e.on("Identifier",o=>{if(!tP(o))return;let{parent:a}=o;if("ReturnStatement"===a.type&&a.argument===o){let n,a=uS(t.getScope(o));if(a?.returnType&&"TSUndefinedKeyword"!==(n=a.returnType?.typeAnnotation?.type)&&"TSVoidKeyword"!==n)return;return r(o,t=>aW(o,"",t,e))}if("YieldExpression"===a.type&&!a.delegate&&a.argument===o)return r(o,t=>aW(o,"",t,e));if(n.checkArrowFunctionBody&&"ArrowFunctionExpression"===a.type&&a.body===o)return r(o,t=>aW(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||rz(e.physicalFilename))&&!n.optional&&tv(a.parent)&&a.parent.params.includes(a)&&(yield n.typeAnnotation?r.insertTextBefore(n.typeAnnotation,"?"):r.insertTextAfter(n,"?"))})}),e.on("ConditionalExpression",r=>{let n=tP(r.consequent);if(n===tP(r.alternate))return;let o=n?r.alternate:r.consequent,a=function(e,t){if(!(!tT(e=rj(e),{computed:!0,optional:!1})||uE(e)||ez(e.object,t,{considerGetters:!0})||ez(e.property,t,{considerGetters:!0})))return{node:e,index:function(e){if("BinaryExpression"===(e=rj(e)).type&&"-"===e.operator){let t=oQ(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=rj(e)).type||!uI.has(e.operator)||uE(e)))return function(e,t){let{operator:r,left:n,right:o}=e,a=oQ(n),i=oQ(o);return Number.isSafeInteger(i)&&ux(n,t.node)?uj(uT,r,i,t.offset):Number.isSafeInteger(a)&&ux(o,t.node)?uj(uA,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=uB(o,t.node.object);if(a&&ux(n,t.index.node))return uR(uw,r,a);let i=uB(n,t.node.object);if(i&&ux(o,t.index.node))return uR(uk,r,i)}(e,t)}(r.test,a)!==!n)return;let i={node:n?r.consequent:r.alternate,messageId:uv};return 0===t.getCommentsInside(r).length&&(i.suggest=[{messageId:uC,fix(n){let a=t.getText(o),i=oD(t.getTokenBefore(r),e,a)?";":"";return n.replaceText(r,i+a)}}]),i}),!n.checkArguments||rz(e.physicalFilename)||e.on("CallExpression",t=>{var r;let n,o=t.arguments,a=o.at(-1);if(!(!tP(a)||("Identifier"===(r=t.callee).type?n=r.name:"MemberExpression"===r.type&&!1===r.computed&&"Identifier"===r.property.type&&(n=r.property.name),uD.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:uv,fix:t=>aw(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:{[uv]:"Do not use useless `undefined`.",[uC]:"Use the indexed access directly."},languages:["js/js"]}},uL="numeric-separators-style";function uN(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 u$={binary:{minimumDigits:0,groupLength:4},octal:{minimumDigits:0,groupLength:4},hexadecimal:{minimumDigits:0,groupLength:2},number:{minimumDigits:5,groupLength:3,fractionGroupLength:1/0}},uM={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(!(to(e)||ts(e))||to(e)&&/^0\d+$/.test(e.raw))return;let{raw:n}=e,o=n,a="";ts(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+uN(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 uN(r,t)+n+uN(o,{...t,groupLength:t.fractionGroupLength},!0)}(a,o)+i+s+uN(l,n[""])}(s,{prefix:l,data:u},i)+a;if(n!==c)return{node:e,messageId:uL,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(u$).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:u$.binary,octal:u$.octal,hexadecimal:u$.hexadecimal,number:u$.number}],messages:{[uL]:"Invalid group length in numeric value."},languages:["js/js"]}},uO="error-zero-index",uU="error-shift",uq="error-pop",uV="error-at-zero",uW="error-at-minus-one",u_="error-slice-minus-one",uz="error-destructuring-declaration",uK="error-destructuring-assignment",uG="error-variable",uJ="suggest-nullish-coalescing-operator",uX="suggest-logical-or-operator",uY=(e,t,r)=>tw(e,{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,...r})&&!nv(e.callee.object,t),uH=e=>"UnaryExpression"===e.type&&"-"===e.operator&&e.prefix&&"Literal"===e.argument.type&&"1"===e.argument.raw,uQ=(e,t)=>tw(e,{method:"slice",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&uH(e.arguments[0])&&uY(e.callee.object,t),uZ=e=>e?"AssignmentExpression"===e.type?e:"VariableDeclarator"===e.type?{left:e.id,right:e.init}:{}:{};function*u0(e,t,r){let{left:n}=uZ(e),[o]=n.elements,a=t.getText("AssignmentPattern"===o.type?o.left:o);yield r.replaceText(n,a),((e,t)=>{if("AssignmentExpression"!==e.type||eK(e,t))return!1;let{left:r}=uZ(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 u1=e=>"AssignmentPattern"===uZ(e).left.elements[0].type,u2=(e,t)=>{let r,n,{property:o}=uZ(t).right.callee;return u1(t)?r=[{operator:"??",messageId:uJ},{operator:"||",messageId:uX}].map(({messageId:r,operator:n})=>({messageId:r,*fix(r){yield r.replaceText(o,"find"),yield((e,t,r,n)=>{let{left:o,right:a}=uZ(e),[i]=o.elements,s=i.right,l=t.getText(s);return(eK(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 u0(t,e,r)}})):n=function*(r){yield r.replaceText(o,"find"),yield u0(t,e,r)},{fix:n,suggest:r}},u3=e=>"MemberExpression"===e.parent.type&&!0===e.parent.computed&&e.parent.object===e&&"Literal"===e.parent.property.type&&"0"===e.parent.property.raw,u8=e=>{let{left:t,right:r}=uZ(e.parent);return t&&r&&r===e&&"ArrayPattern"===t.type&&1===t.elements.length&&t.elements[0]&&"RestElement"!==t.elements[0].type},u6={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&&uY(t.object,e))||nL(t)))return{node:t.object.callee.property,messageId:uO,fix:r=>[r.replaceText(t.object.callee.property,"find"),a$(r,t,e)]}}),e.on("CallExpression",t=>{if(tw(t,{method:"shift",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uU,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...aM(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&&uY(r.init,e,{optionalMember:!1}))return{node:r.init.callee.property,messageId:uz,...u2(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&&uY(r.right,e,{optionalMember:!1}))return{node:r.right.callee.property,messageId:uK,...u2(t,r)}}),e.on("VariableDeclarator",r=>{if(!("Identifier"===r.id.type&&uY(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=ey(n,r.id),a=rJ(o).filter(e=>e!==r.id);if(0===a.length)return;let i=[],s=[];for(let e of a)if(u3(e))i.push(e.parent);else{if(!u8(e))return;s.push(e.parent)}let l={node:r.init.callee.property,messageId:uG};return s.every(e=>!u1(e))&&(l.fix=function*(a){yield a.replaceText(r.init.callee.property,"find");let l=(e=>{let t=o5.singular(e);if(t!==e)return t})(r.id.name);if(l){let r=ry(l,rp(n));yield aq(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 a$(a,t,e);for(let e of s)yield u0(e,t,a)}),l}),e.on("CallExpression",t=>{if(tw(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&"Literal"===t.arguments[0].type&&"0"===t.arguments[0].raw&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uV,fix:r=>[r.replaceText(t.callee.object.callee.property,"find"),...aM(r,t,e)]}}),r&&(e.on("CallExpression",t=>{if(tw(t,{method:"pop",argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uq,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...aM(r,t,e)]}}),e.on("CallExpression",t=>{if(tw(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&uH(t.arguments[0])&&uY(t.callee.object,e))return{node:t.callee.object.callee.property,messageId:uW,fix:r=>[r.replaceText(t.callee.object.callee.property,"findLast"),...aM(r,t,e)]}}),e.on("MemberExpression",r=>{if(!(r.computed&&!r.optional&&"Literal"===r.property.type&&"0"===r.property.raw&&!nL(r)&&uQ(r.object,e)))return;let n=r.object.callee.object;return{node:n.callee.property,messageId:u_,*fix(o,{abort:a}){if(r$(e,[e5(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield aM(o,r.object,e),yield a$(o,r,e)}}}),e.on("CallExpression",r=>{if(!(tw(r,{methods:["pop","shift"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&uQ(r.callee.object,e)))return;let n=r.callee.object.callee.object;return{node:n.callee.property,messageId:u_,*fix(o,{abort:a}){if(r$(e,[e5(n,e)[1],t.getRange(r)[1]]))return a();yield o.replaceText(n.callee.property,"findLast"),yield aM(o,r.callee.object,e),yield aM(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:{[uG]:"Prefer `.find(…)` over `.filter(…)`.",[uO]:"Prefer `.find(…)` over `.filter(…)[0]`.",[uV]:"Prefer `.find(…)` over `.filter(…).at(0)`.",[uU]:"Prefer `.find(…)` over `.filter(…).shift()`.",[uq]:"Prefer `.findLast(…)` over `.filter(…).pop()`.",[uW]:"Prefer `.findLast(…)` over `.filter(…).at(-1)`.",[u_]:"Prefer `.findLast(…)` over `.filter(…).slice(-1)`.",[uz]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[uK]:"Prefer `.find(…)` over destructuring `.filter(…)`.",[uJ]:"Replace `.filter(…)` with `.find(…) ?? …`.",[uX]:"Replace `.filter(…)` with `.find(…) || …`."},languages:["js/js"]}},u9="prefer-array-flat-map",u5="prefer-array-flat-map/filter-flat-map",u4="prefer-array-flat-map/filter-flat-map-suggestion",u7=["React.Children","Children"],pe=new i(["ArrowFunctionExpression","AssignmentExpression","ClassExpression","ConditionalExpression","FunctionExpression","ObjectExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),pt=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,pr="prefer-array-flat",pn={getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#flatMap()",testFunction(e,t){if(!tw(e,{method:"flatMap",argumentsLength:1,optionalCall:!1}))return!1;let[r]=e.arguments;return"ArrowFunctionExpression"===r.type&&!r.async&&1===r.params.length&&om(r.params[0],r.body)&&!pu(e.callee.object,t)}},po={testFunction(e){if(!tw(e,{method:"reduce",argumentsLength:2,optionalCall:!1}))return!1;let[t,r]=e.arguments;if(!("ArrowFunctionExpression"===t.type&&!t.async&&2===t.params.length&&th(r)))return!1;let n=t.body,[o,a]=t.params;return tw(n,{method:"concat",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&om(o,n.callee.object)&&om(a,n.arguments[0])||"ArrayExpression"===n.type&&2===n.elements.length&&n.elements.every((e,r)=>e?.type==="SpreadElement"&&"Identifier"===e.argument.type&&om(t.params[r],e.argument))},getArrayNode:e=>e.callee.object,isOptionalArray:e=>e.callee.optional,description:"Array#reduce()"},pa={testFunction:e=>tw(e,{method:"concat",argumentsLength:1,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&th(e.callee.object)&&"SpreadElement"===e.arguments[0].type,getArrayNode:e=>e.arguments[0].argument,description:"[].concat()"},pi={testFunction(e){if(!(tw(e,{methods:["apply","call"],argumentsLength:2,allowSpreadElement:!0,optionalCall:!1,optionalMember:!1})&&tL(e.callee.object,{property:"concat"})))return!1;let[t,r]=e.arguments;return th(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()"},ps=["_.flatten","lodash.flatten","underscore.flatten"],pl=/^\p{Uppercase_Letter}/u,pu=(e,t)=>{let r,n;return"Identifier"===e.type&&pl.test(e.name)&&(!(r=rq(e,t))||"ArrayExpression"!==r.type&&("NewExpression"!==r.type||"Identifier"!==r.callee.type||"Array"!==r.callee.name))||!!((n=rq(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))},pp={create:function(e){let{functions:t}=e.options[0],r=[...t,...ps],n=[pn,po,pa,pi,{testFunction:e=>tm(e,{argumentsLength:1,optional:!1},tp)&&tB(e.callee,r),getArrayNode:e=>e.arguments[0],description:e=>`${r.find(t=>tF(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:pr,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=e4(t,r);n?s=`[${s}]`:!e7(t,i)&&oZ(t,r)&&(s=`(${s})`),s+=`${o?"?":""}.flat()`,oD(i.getTokenBefore(e),r,s)&&(s=`;${s}`),yield a.replaceText(e,s),yield aP(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:{[pr]:"Prefer `Array#flat()` over `{{description}}` to flatten an array."},languages:["js/js"]}},pc="some",pd="some-suggestion",pm="filter",pf={create:oK(e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:["find","findLast"],minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||t.typeArguments||t.typeParameters||nv(t.callee.object,e))return;let r="BinaryExpression"===t.parent.type&&t.parent.left===t&&(["!=","==","===","!=="].includes(t.parent.operator)&&tP(t.parent.right)||("!="===t.parent.operator||"=="===t.parent.operator)&&ti(t.parent.right));if(!r&&!(tq(t,e)||tV(t)||function(e,t){if(!nE(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()&&(tq(r,t)||tV(r))})}(t,e)))return;let n=t.callee.property,o=r&&r$(e,[e5(t,e)[1],e.sourceCode.getRange(t.parent)[1]]);return{node:n,messageId:pc,data:{method:n.name},suggest:o?void 0:[{messageId:pd,*fix(o){if(yield o.replaceText(n,"some"),!r)return;let{sourceCode:a}=e,i=e5(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(!(tw(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)&&te(n,0)))||nv(r.callee.object,e))return;let a=r.callee.property;return{node:a,messageId:pc,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(r$(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&&tT(t.left,{property:"length",optional:!1})&&tw(t.left.object,{method:"filter",optionalCall:!1,optionalMember:!1})))return;let r=t.left.object,n=r.callee.object;if(nv(n,e)||"Identifier"===n.type&&n.name.startsWith("$"))return;let[o]=r.arguments;if(!o||ol(o))return;let a=r.callee.property;return{node:a,messageId:pm,*fix(n,{abort:o}){let{sourceCode:i}=e,s=t.left;if(r$(e,[e5(r,e)[1],i.getRange(t)[1]]))return o();yield n.replaceText(a,"some"),yield a$(n,s,e),yield n.removeRange([e5(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:{[pc]:"Prefer `.some(…)` over `.{{method}}(…)`.",[pd]:"Replace `.{{method}}(…)` with `.some(…)`.",[pm]:"Prefer `.some(…)` over non-zero length check from `.filter(…)`."},hasSuggestions:!0,languages:["js/js"]}},pg=(e,t,r=!0)=>({node:e,messageId:`error/${e.name}`,...r&&{suggest:[{messageId:`suggestion/${t}`,fix:r=>r.replaceText(e,t)}]}}),py=new i(["+","-","*","/","%","**","&","|","^","<<",">>",">>>"]),ph=new i(["+","-","~"]),px="preferDefaultParameters",pb="preferDefaultParametersSuggest",pE=new i(["CallExpression","NewExpression","ImportExpression","TaggedTemplateExpression"]),pv=(e,t)=>{if(!t)return!1;if(pE.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(pv(e,t))return!0}else if(pv(e,n))return!0}return!1},pC="prefer-logical-operator-over-ternary/error",pD="prefer-logical-operator-over-ternary/optional-chain-error",pS="prefer-logical-operator-over-ternary/suggestion",pT="prefer-logical-operator-over-ternary/optional-chain-suggestion",pA=new i(["==","==="]),pw=new i(["!=","!=="]);function pk(e,t,r){if(rC(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return pk(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&pk(e.left,t.left,r)&&pk(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&pk(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function pI({context:e,conditionalExpression:t,left:r,right:n,operators:o=["??","||"]}){return e.sourceCode.getCommentsInside(t).length>0?{node:t,messageId:pC}:{node:t,messageId:pC,suggest:o.map(o=>({messageId:pS,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=e7(e,t),o=n?e4(e,t):i.getText(e);return!n&&o3(e,{operator:a,property:0===r?"left":"right"})&&(o=`(${o})`),o}).join(` ${a} `);return oD(i.getTokenBefore(r),t,s)&&(s=`;${s}`),e.replaceText(r,s)})({fixer:a,context:e,conditionalExpression:t,left:r,right:n,operator:o})}))}}function pj(e){return ti(e)?"null":tP(e)?"undefined":void 0}function pF(e){if("BinaryExpression"!==e.type||!pA.has(e.operator)&&!pw.has(e.operator))return;let t=pj(e.left),r=pj(e.right);if(!!t==!!r)return;let n=pA.has(e.operator);return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:n}}let pB=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind,pR="with-name",pP="without-name",pL="regexp-exec",pN="string-match",p$="string-search",pM="suggestion",pO="string",pU="regexp",pq="other",pV="string-or-other",pW="regexp-or-other",p_="unknown";function*pz(e,{stringNode:t,methodNode:r,regexpNode:n},o){let{sourceCode:a}=o;yield e.replaceText(r,"test");let i=a.getText(t);eK(n,a)||"SequenceExpression"!==t.type||(i=`(${i})`),yield e.replaceText(n,i);let s=a.getText(n);!eK(t,a)&&oZ(n,o)&&(s=`(${s})`),yield e.replaceText(t,s)}let pK=[{type:pL,test:e=>tw(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:pN,test:e=>tw(e,{method:"match",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:pz},{type:p$,test:e=>tw(e,{method:"search",argumentsLength:1,optionalCall:!1,optionalMember:!1}),getNodes:e=>({stringNode:e.callee.object,methodNode:e.callee.property,regexpNode:e.arguments[0]}),fix:pz}],pG=e=>ta(e)||tf(e,{name:"RegExp"}),pJ=e=>{if("[object RegExp]"===Object.prototype.toString.call(e))return e},pX=e=>{if(e.includes(p_))return p_;let t=new i(e),r=t.has(pO)||t.has(pV),n=t.has(pU)||t.has(pW);if(r&&n)return pV;let o=t.has(pq)||t.has(pV)||t.has(pW);return r?o?pV:pO:n?o?pW:pU:pq},pY=e=>{let t=new i(e);return t.has(p_)?p_:t.has(pU)?pU:t.has(pO)?pO:pq},pH=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSVoidKeyword","TSArrayType","TSTypeLiteral","TSTupleType","TSFunctionType","TSConstructorType"]),pQ=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return pQ(e.typeAnnotation);case"TSStringKeyword":return pO;case"TSLiteralType":return"Literal"===e.literal.type&&"string"==typeof e.literal.value?pO:pq;case"TSTypeReference":if("Identifier"!==e.typeName.type)return p_;if("String"===e.typeName.name)return pO;if("RegExp"===e.typeName.name)return pU;if("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)return pq;return p_;case"TSUnionType":return pX(e.types.map(e=>pQ(e)));case"TSIntersectionType":return pY(e.types.map(e=>pQ(e)));default:return pH.has(e?.type)?pq:p_}},pZ=(e,t)=>{let r,n;if(r=e,r0.has(r.intrinsicName)||(n=e=t.getNonNullableType(e),r0.has(n.intrinsicName)))return p_;if(e.isTypeParameter?.()){let r=e.getConstraint();return r?pZ(r,t):p_}return e.isUnion()?pX(e.types.map(e=>pZ(e,t))):e.isIntersection()?pY(e.types.map(e=>pZ(e,t))):"string"===e.intrinsicName||e.isStringLiteral?.()?pO:"RegExp"===r2(e)?.getName()||r8(e,t).some(e=>pZ(e,t)===pU)?pU:pq},p0=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]);function p1(e,t,r=new i){let n;if(pG(e))return pU;if(on(e,t))return pO;switch(e.type){case"Identifier":{let n=((e,t,r)=>{let{sourceCode:n}=t,o=ey(n.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return p_;r.add(o);let[a]=o.defs,i=pQ(a.name?.typeAnnotation),s=p_;return i!==p_?s=i:"Variable"===a.type&&"const"===a.parent.kind&&a.node.init&&(s=p1(a.node.init,t,r)),r.delete(o),s})(e,t,r);if(n!==p_)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let n=pQ(e.typeAnnotation);return n===p_?p1(e.expression,t,r):n}case"TSNonNullExpression":case"ParenthesizedExpression":return p1(e.expression,t,r);case"SequenceExpression":return p1(e.expressions.at(-1),t,r);case"ConditionalExpression":return pX([p1(e.consequent,t,r),p1(e.alternate,t,r)])}let o=t.sourceCode.getScope(e),a=(n=e$(e,o))?"string"==typeof n.value?pO:pJ(n.value)?pU: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)?pq:p_:p_;return a!==p_?a:p0.has(e.type)?pq:((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return p_;try{let{program:t}=r;return pZ(r.getTypeAtLocation(e),t.getTypeChecker())}catch{return p_}})(e,t)}let p2=(e,t)=>{let r;return"UnaryExpression"===(r=((e,t)=>{for(;;){if(tN(e.parent)||tU(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},p3=(e,[t,r])=>e.getAllComments().some(n=>{let[o,a]=e.getRange(n);return o>=t&&a<=r}),p8=(e,t,r)=>[e5(t,r)[1],r.sourceCode.getRange(e.node)[1]],p6=e=>[{messageId:pM,fix:e}],p9=e=>[pU,pW,pq].includes(e),p5=e=>[pO,pV,pq].includes(e),p4=({type:e,stringType:t,regexpType:r})=>e===pL?p5(r)||p9(t):p9(t)||p5(r),p7=(e,t,r,{lengthCheck:n,searchCheck:o,callExpression:a,isRegExp:i,staticRegExp:s})=>{if(n){((e,t)=>{let{sourceCode:r}=t,n=[[e5(e.lengthNode.object,t)[1],r.getRange(e.lengthNode)[1]]];return e.comparisonLeftNode&&n.push([e5(e.comparisonLeftNode,t)[1],r.getRange(e.node)[1]]),n})(n,r).every(e=>!p3(r.sourceCode,e))&&(e.suggest=p6(t));return}if(!o||!p3(r.sourceCode,p8(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=p6(t)}},ce={create:oK(e=>{e.on("CallExpression",function*(t){let r=((e,t)=>{let r,n="ChainExpression"===(r=e.parent).type?r.expression:r;if(!tT(n,{property:"length"})||n.object!==e)return;let o="ChainExpression"===n.parent.type?n.parent:n;if(p2(o,t))return;if(tq(o,t)||tV(o))return{lengthNode:n,node:o};let{parent:a}=o;if(a?.type==="BinaryExpression"&&a.left===o&&">"===a.operator&&te(a.right,0)&&!p2(a,t)&&(tq(a,t)||tV(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)&&tk(n)||">="===r&&te(n,0)?{node:t,negate:!1}:["===","=="].includes(r)&&tk(n)||"<"===r&&te(n,0)?{node:t,negate:!0}:void 0})(t);if(r||n||tq(t,e)||tV(t))for(let{type:o,test:a,getNodes:i,fix:s}of pK){if(o===p$!=!!n||!a(t))continue;let l=i(t),{methodNode:u,regexpNode:p}=l,c=e.sourceCode.getScope(p),d=e$(p,c),m=d?pJ(d.value):void 0,f=pG(p);if(p4({type:o,stringType:p1(l.stringNode,e),regexpType:p1(p,e)}))continue;let g={node:o===pL?u:t,messageId:o};p7(g,function*(o){for(let a of(r?(yield a$(o,r.lengthNode,e),r.comparisonLeftNode&&(yield o.removeRange([e5(r.comparisonLeftNode,e)[1],e.sourceCode.getRange(r.node)[1]]))):n&&(n.negate&&(yield o.insertTextBefore(n.node,"!")),yield o.removeRange(p8(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:{[pL]:"Prefer `.test(…)` over `.exec(…)`.",[pN]:"Prefer `RegExp#test(…)` over `String#match(…)`.",[p$]:"Prefer `RegExp#test(…)` over `String#search(…)` when checking for existence.",[pM]:"Switch to `RegExp#test(…)`."},languages:["js/js"]}},ct="error",cr="suggestion",cn=["copyWithin","fill","filter","flat","flatMap","map","reverse","sort","splice","toReversed","toSorted","toSpliced","with","split","toArray"],co=["slice","concat"],ca=e=>tw(e.parent.parent,{method:"includes",optionalCall:!1,optionalMember:!1,argumentsLength:1})&&e.parent.object===e,ci=new i(["ForOfStatement","ForStatement","ForInStatement","WhileStatement","DoWhileStatement","FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),cs=(e,t,r=new i)=>"ArrayExpression"===e.type||tm(e,{name:"Array",optional:!1},td)||tw(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tw(e,{methods:cn,optionalCall:!1,optionalMember:!1})||tw(e,{methods:co,optionalCall:!1,optionalMember:!1})&&void 0===tn(e.callee.object)&&("Identifier"!==e.callee.object.type||((e,t,r=new i)=>{if("Identifier"!==e.type)return!1;let n=ey(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&&cs(o.node.init,t,r)})(e.callee.object,t,r)),cl=e=>Number.isSafeInteger(e)&&e>=0&&e<=0xffffffff,cu=e=>e.some(e=>e?.type==="SpreadElement"),cp=(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])}),cc=(e,t)=>(e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion"||e?.type==="TSNonNullExpression")&&e.expression===t,cd=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(;cc(r.parent,r);)r=r.parent;return nL(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},cm=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)||tw(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},cf={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)&&cs(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?cu(i.elements)?void 0:i.elements.length:tm(i,{name:"Array",optional:!1},td)?((e,t)=>{if(cu(e.arguments))return;if(1!==e.arguments.length)return e.arguments.length;let r=e$(e.arguments[0],t);if(!r)return;let{value:n}=r;return"number"!=typeof n?1:cl(n)?n:void 0})(i,s):tw(i,{object:"Array",method:"of",optionalCall:!1,optionalMember:!1})?cu(i.arguments)?void 0:i.arguments.length:tw(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 cu(r.elements)?void 0:r.elements.length;if(void 0!==tn(r)){let e=e$(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=e$(r.value,t);return cl(e?.value)?e.value:void 0}})(r,t)}})(i,s):void 0);if(void 0===e||e<t)return}let l=ey(r.getScope(n),n);if(!l)return;let u=(e=>{let t=[],r=[],n=[];for(let o of e){if(ca(o)){t.push(o);continue}if(cd(o)){r.push(o),n.push(o);continue}if(cm(o)){n.push(o);continue}return}return{includes:t,lengths:r,extra:n}})(rJ(l).filter(e=>e!==n));if(!u||0===u.includes.length||u.extra.length>0&&(o=a.init,!("ArrayExpression"===o.type&&!cu(o.elements)&&o.elements.every(Boolean)&&o.elements.every(t=>{let r;return(r=e$(t,e.sourceCode.getScope(t)))&&rD(r.value)&&!Object.is(r.value,-0)}))||0!==rA(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(ci.has(n.type))return!0;n=n.parent}return!1})(u.includes[0],n))return;let p={node:n,messageId:ct,data:{name:n.name}},c=n.typeAnnotation&&((e,t)=>{if("TSArrayType"===e.type){if(cp(t,e,e.elementType))return;return`Set<${t.getText(e.elementType)}>`}if("TSTypeOperator"===e.type&&"readonly"===e.operator&&"TSArrayType"===e.typeAnnotation.type){if(cp(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&&!cp(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:cr,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:{[ct]:"`{{name}}` should be a `Set`, and use `{{name}}.has()` to check existence or non-existence.",[cr]:"Switch `{{name}}` to `Set`."},languages:["js/js"]}},cg=e=>tw(e.parent,{method:"toMatchInlineSnapshot",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&e.parent.arguments[0]===e&&tm(e.parent.callee.object,{name:"expect",argumentsLength:1,optionalCall:!1,optionalMember:!1},tp),cy="prefer-string-raw",ch="unnecessary-string-raw";function cx(e,t=""){return e.replaceAll(RegExp(String.raw`\\(?<escapedCharacter>[\\${t}])`,"g"),"$<escapedCharacter>")}let cb="prefer-switch",cE=(e,t)=>e===t||rC(e,t),cv=({left:e,right:t})=>[e,t].filter(e=>!("Literal"===e.type||tP(e))),cC=new i(["WhileStatement","DoWhileStatement","ForStatement","ForOfStatement","ForInStatement","SwitchStatement"]),cD=e=>{for(;e.parent;e=e.parent)if(cC.has(e.type))return e},cS=(e,t,r)=>{let{sourceCode:n}=r;return n.getRange(e)[0]>=n.getRange(t)[0]&&n.getRange(e)[1]<=n.getRange(t)[1]},cT={create:e=>{let t={...e.options[0]},{sourceCode:r}=e,n=new i,o=[],a=new i;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||=cv(o[0]);let a=function(e,t){for(let{left:r,right:n}of e)if(0===(t=t.filter(e=>cE(e,r)||cE(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:cb};!ez(n,r)&&s.every(({statement:t})=>!function(e,t,r){for(let n of e){if(!cS(n,t,r))continue;let e=cD(n);if(!e||cS(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=rw(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,`
31
31
  ${l}default: `)}else switch(n.emptyDefaultCase){case"no-default-comment":yield i.insertTextAfter(s,`
32
32
  ${l}// No default`);break;case"do-nothing-comment":yield i.insertTextAfter(s,`
33
33
  ${l}default:
34
34
  ${l}// Do nothing`)}for(let{statement:r,compareExpressions:n}of(yield i.insertTextAfter(s,`
35
- ${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=cf(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
35
+ ${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=cE(r,e)?a:r,s=o.getText(n);yield i.insertTextBefore(t,`
36
36
  ${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,`
37
37
  ${n}break;
38
38
  ${n}`)}else yield t.insertTextAfter(e,`
39
39
  ${n}break;`)}(t,i,o,l),yield function*(e,t,r){e&&"BlockStatement"!==e.type&&(yield t.insertTextBefore(e,`{
40
40
  ${r}`),yield t.insertTextAfter(e,`
41
- ${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:{[cm]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},cE="require-number-to-fixed-digits-argument";function cS(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 cv=/^(?:( )+|\t+)/,cC="space";function cD(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(cv);if(null===e)a=0,r="";else{let i=e[0].length,s=e[1]?cC:"tab";if(t&&s===cC&&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===cC&&1===e)continue;n=(s===cC?"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 cT(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=cD(e,!0);0===r.size&&(r=cD(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]?cC:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===cC?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let cA="template-indent",cw=(e,t=new Set)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),ck=[{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."}}}],cI="no-await-in-promise-methods/error",cj="no-await-in-promise-methods/suggestion",cF=["all","allSettled","any","race"],cB="no-negation-in-equality-check/error",cR="no-negation-in-equality-check/suggestion",cP=new Set(["===","!==","==","!="]),cL=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function cN(e,{methods:t,messageId:r}){e.on("CallExpression",n=>{if(!tS(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(tb(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tb(e,{property:"length",computed:!1})&&ry(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=>aS(t,o,e)}})}let c$="no-unnecessary-slice-end",cM="catch-error-name",cO={create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>f.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(o5(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&&(tS(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tS(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=ep(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=rp(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:cM,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>aL(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:{[cM]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},cU="invalidExport",cq="doNotPassMessageToSuper",cW="doNotAssignMessageWithoutSetter",cV="missingOptionsParameter",c_="invalidOptionsParameter",cz="passMessageToSuper",cK="passOptionsToSuper",cG=/^(?:[A-Z][\da-z]*)*Error$/,cJ=e=>`
41
+ ${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:{[cb]:"Use `switch` instead of multiple `else-if`."},languages:["js/js"]}},cA="require-number-to-fixed-digits-argument";function cw(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 ck=/^(?:( )+|\t+)/,cI="space";function cj(e,t){let r,n,a=new o,i=0;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(ck);if(null===e)i=0,r="";else{let o=e[0].length,s=e[1]?cI:"tab";if(t&&s===cI&&1===o)continue;s!==r&&(i=0),r=s;let l=1,u=0,p=o-i;if(i=o,0===p)l=0,u=1;else{let e=Math.abs(p);if(t&&s===cI&&1===e)continue;n=(s===cI?"s":"t")+String(e)}let c=a.get(n);a.set(n,void 0===c?[1,0]:[c[0]+l,c[1]+u])}}return a}function cF(e){let t;if("string"!=typeof e)throw TypeError("Expected a string");let r=cj(e,!0);0===r.size&&(r=cj(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]?cI:"tab",amount:Number(n.slice(1))}),i=t,s=o,a=(i===cI?" ":" ").repeat(s)}return{amount:o,type:t,indent:a}}let cB="template-indent",cR=(e,t=new i)=>e.map((e,r)=>t.has(r+1)||""===e.trim()?"":e).join("\n"),cP=[{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."}}}],cL="no-await-in-promise-methods/error",cN="no-await-in-promise-methods/suggestion",c$=["all","allSettled","any","race"],cM="no-negation-in-equality-check/error",cO="no-negation-in-equality-check/suggestion",cU=new i(["===","!==","==","!="]),cq=e=>"UnaryExpression"===e.type&&e.prefix&&"!"===e.operator;function cV(e,{methods:t,messageId:r}){e.on("CallExpression",n=>{if(!tw(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(tT(e,{object:"Number",property:"POSITIVE_INFINITY",computed:!1,optional:!1}))return"Number.POSITIVE_INFINITY";let r="ChainExpression"===e.type;if(r&&(e=e.expression),tT(e,{property:"length",computed:!1})&&rC(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=>aw(t,o,e)}})}let cW="no-unnecessary-slice-end",c_="catch-error-name",cz={create:e=>{let t=e.options[0],{name:r}=t,n=t.ignore.map(e=>E.isRegExp(e)?e:RegExp(e,"u")),o=e=>e===r||n.some(t=>t.test(e))||e.endsWith(r)||e.endsWith(an(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&&(tw(t.parent.parent,{method:"then",argumentsLength:2,optionalCall:!1})||tw(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=ey(e.sourceCode.getScope(t),t);if(!a||"_"===n&&0===a.references.length)return;let i=ry(r,[a.scope,...a.references.map(({from:e})=>e)]),s={node:t,messageId:c_,data:{originalName:n,fixedName:i||r}};return i&&(s.fix=t=>aq(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:{[c_]:"The catch parameter `{{originalName}}` should be named `{{fixedName}}`."},languages:["js/js"]}},cK="invalidExport",cG="doNotPassMessageToSuper",cJ="doNotAssignMessageWithoutSetter",cX="missingOptionsParameter",cY="invalidOptionsParameter",cH="passMessageToSuper",cQ="passOptionsToSuper",cZ=/^(?:[A-Z][\da-z]*)*Error$/,c0=e=>`
42
42
  name = '${e}';
43
- `,cX=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&&cG.test(r)},cY=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&tT(e.expression.callee,"super"),cH=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&tT(e.expression.left,`this.${t}`),cQ=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),cZ=(e,t)=>e5(e?.value)===t,c0=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,c1=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,c2=e=>c1(e)?.name==="options",c3=(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&&c3(e,t)))return!0;continue}if(c3(n,t))return!0}}return!1},c8=e=>{let t=c1(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},c6=(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])||tk(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},c9=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*c5(e,t){if(!cX(t)||null===t.id)return;let{name:r}=t.id,n=o5(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(cZ(s,r))return;let e=a.getRange(t.body);yield{...cQ(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,cJ(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],cJ(r))};return}let l=o.some(e=>c0(e,"get")),u=o.some(e=>c0(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])||tk(r)))m=!0,yield{node:u,messageId:cq};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:cW};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=c1(l),f=1===t.value.params.length&&m&&!c2(l),g=f||c2(d);if(0===u.expression.arguments.length){if(c!==p+1||c3(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${e2(s,e)}, options`:e2(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,`, ${c8(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?e5(a.expression.right)!==n?cQ(a.expression.right??e,n):void 0:cZ(o,n)?void 0:cQ(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=c1(a);if(0===o.length||!i)return;let s=r.expression;if(c2(a)){if(!c2(s.arguments[1])){let t={node:s,messageId:cK};return c9(s.arguments[0],i)||(t.fix=c6(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!==e5(r)&&"ObjectExpression"===n.type&&1===n.properties.length&&"cause"===eR(n.properties[0])})(s,u))return;return{node:a,messageId:cV,fix:function*(r){let{sourceCode:n}=e,o=c6(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${c8(a)}`),yield o}}}if(!c2(l))return{node:l,messageId:c_};if(u&&!c9(s.arguments[0],i)){let t;return{node:s,messageId:cz,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])||tk(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!c2(s.arguments[1]))return{node:s,messageId:cK,fix:c6(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 c4="no-lonely-if",c7=e=>"IfStatement"===e.type&&!e.alternate;function de(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 dt=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),dr=e=>e.trim()?e:"",dn=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,da=(e,t)=>dt(e.ifToken,e.openingParenthesisToken,t),di=(e,t,r)=>{let n,o=dt(e.openingParenthesisToken,e.closingParenthesisToken,r);return e3(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},ds="no-magic-array-flat-depth",dl="no-negated-condition",du="identifier",dp="non-identifier",dc="prefer-negative-index",dd=new Map([["slice",{argumentsIndexes:[0,1],supportObjects:new Set(["Array","String","ArrayBuffer",...rG])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new Set(rG)}],["splice",{argumentsIndexes:[0],supportObjects:new Set(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new Set(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new Set(["Array","String",...rG])}]]),dm=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var df=["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 dg(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new Set(df)).has(t)}let dy="prefer-node-protocol",dh="node:",dx="consistent-date-clone/error",db="no-accessor-recursion/error",dE=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,dS=(e,t)=>["type","name"].every(r=>e[r]===t[r]),dv=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&dE(e.parent.property)&&dS(e.parent.property,t.key),dC="error/calculate-dirname",dD="error/calculate-filename";function dT(e,{modules:t,functionName:r,sourceCode:n}){if(!ts(e,{optional:!1,argumentsLength:1},to))return!1;let o=new Set;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tb(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&tS(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=ep(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 dA(e,t){return dT(e,{modules:new Set(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function dw(e,t){return dT(e,{modules:new Set(["path","node:path"]),functionName:"dirname",sourceCode:t})}let dk="no-unnecessary-array-flat-depth",dI="no-unnecessary-array-splice-count",dj="no-useless-error-capture-stack-trace/error",dF="prefer-class-fields/error",dB="prefer-class-fields/suggestion",dR="prefer-bigint-literals/error",dP="prefer-bigint-literals/suggestion",dL="prefer-classlist-toggle/error",dN="prefer-classlist-toggle/suggestion",d$=e=>tb(e,{property:"classList",computed:!1}),dM=(e,t,r)=>{let n={node:r??e,messageId:dL};return"IfStatement"===e.type||tm(e)||tm(e.parent)?n.fix=t:n.suggest=[{messageId:dN,fix:t}],n},dO=(e,t,r)=>{let{sourceCode:n}=t,o=e2(e,t);return r?(!e3(e,n)&&oY(e,"!")&&(o=`(${o})`),o=`!${o}`):(e3(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},dU=(e,t)=>tS(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&d$(e.callee.object),dq=(e,t)=>ry(e.callee.object,t.callee.object)&&ry(e.arguments[0],t.arguments[0]),dW=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),dU(e,["contains"])&&dq(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?dW(e.argument,!t,r):void 0,dV="require-module-attributes",d_="error",dz="suggestion/array",dK="suggestion/object",dG="suggestion/object-assign",dJ="suggestion/set",dX="suggestion/map",dY=(e,t,r)=>{let{sourceCode:n}=r,o=rW(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(!tl(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*dQ(e,t,r){let n=!ef(t.sourceCode.getTokenBefore(e));yield aR(e,t,r,n)}function dZ(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!em(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*d0({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(rc(r,e)){let[o]=r.arguments;if(o)yield dZ(e,t,o,n);else{let{openingParenthesisToken:o}=rc(r,e)?rd(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*dQ(o,e,t)}let d1=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tS(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:d_,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>eO(e,a))?l.suggest=[{messageId:dz,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=rm(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):dZ(e,a,t,i),yield dQ(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&&tb(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:d_,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&eO(l,a)||eO(s,a)?p.suggest=[{messageId:dK,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=e2(o,e);n.computed&&(s=`[${s}]`);let l=e2(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!em(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield dQ(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!tS(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:d_,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return eO(i,a)?s.suggest=[{messageId:dG,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(em(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${e2(o,e)}`,i&&(yield dZ(e,a,t,i)),2!==n.arguments.length)?yield aS(a,o,e):yield dQ(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),tS(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:d_,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eO(e,i))?s.suggest=[{messageId:dJ,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rm(e,r,!1);return d0({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(tS(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:d_,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>eO(e,i))?s.suggest=[{messageId:dX,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rm(e,r,!1);return d0({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],d2="no-useless-collection-argument/error",d3="no-useless-collection-argument/suggestion",d8="prefer-response-static-json",d6=/([\p{Ll}\d])(\p{Lu})/gu,d9=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,d5=/(\d)\p{Ll}|(\p{L})\d/u,d4=/[^\p{L}\d]+/giu,d7="$1\0$2";function me(e){let t=e.trim();t=(t=t.replace(d6,d7).replace(d9,d7)).replace(d4,"\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 mt(e){let t=me(e);for(let e=0;e<t.length;e++){let r=t[e],n=d5.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 mr(e,t){let[r,n,o]=ml(e,t);return r+n.map(ma(t?.locale)).join(t?.delimiter??" ")+o}function mn(e,t){var r,n;let[o,a,i]=ml(e,t),s=ma(t?.locale),l=mi(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):ms(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function mo(e,t){let[r,n,o]=ml(e,t),a=ms(ma(t?.locale),mi(t?.locale));return r+n.map(a).join("")+o}function ma(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function mi(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function ms(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function ml(e,t={}){let r=t.split??(t.separateNumbers?mt:me),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 mu="filename-case",mp="directory-case",mc="filename-extension",md=e=>!/^[\w-]$/.test(e),mm=new Set(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),mf=new Intl.ListFormat("en-US",{type:"disjunction"}),mg=/^[\da-z]+$/i,my=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,mh=e=>e>="0"&&e<="9",mx=e=>e>="a"&&e<="z",mb=e=>e>="A"&&e<="Z",mE={camelCase:{fn:mn,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!mx(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(mx(r)||mh(r))continue;if(!mb(r))return!1;let n=t;for(;mb(e[t+1]);)t++;if(t!==n){if(mx(e[t+1])){t--;continue}for(;mh(e[t+1]);)t++;if(t===e.length-1)return!0;if(!mb(e[t+1]))return!1}}return!0}(e)?mn(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return mr(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return mr(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(mg.test(e)){let t=my.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&mo(r)===r)return e}return mo(e)},name:"pascal case"}};function mS(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function mv(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 mC=/^(?<leading>_+)(?<tailing>.*)$/;function mD(e){let t,{leading:r="",tailing:n=e}=(mC.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=md(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function mT(e){let t;return t=e.map(e=>mE[e].name),mf.format(t)}let mA=[{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}]}],mw="consistent-template-literal-escape",mk=["entries","keys","values"],mI=["drop","filter","flatMap","map","take"],mj=["concat","from","zip","zipKeyed"],mF=new Set(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator"]),{isTarget:mB}=np({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:mF}),mR=e=>{for(;rC(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},mP="iterable-accepting",mL="for-of",mN="yield-star",m$="spread",mM="iterator-method",mO="iterable-accepting/suggestion",mU="iterator-method/suggestion",mq=["every","find","forEach","some"],mW="reduce",mV=e=>tS(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),m_=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>aB(r,e,t)},mz=(e,t,r,n)=>{let o=m_(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},mK="prefer-simple-condition-first",mG="prefer-simple-condition-first/unsafe";function mJ(e){return"Identifier"===(e=rD(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rD(e.argument).type}function mX(e){if(mJ(e=rD(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rD(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function mY(e){if("Identifier"===(e=rD(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return mY(e.argument);if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)){let t=rD(e.left),r=rD(e.right);return mX(t)&&mX(r)&&(mJ(t)||mJ(r))}return!1}let mH="switch-case-break-position",mQ=new Set(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),mZ="first-child",m0="first-element-child",m1="query-selector",m2="closest",m3="merge-query-selector",m8="suggestion-first-child",m6="suggestion-first-element-child",m9="suggestion-merge-query-selector",m5={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},m4=(e,t)=>tb(e,{property:t,optional:!1,computed:!1}),m7=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&e4(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,fe=(e,t)=>t.getCommentsInside(e).length>0,ft=(e,t,r,n)=>{let{sourceCode:o}=n;if(fe(e,o))return;let[,a]=e1(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},fr=e=>tb(e,{property:"parentElement",optional:!1,computed:!1}),fn=e=>void 0!==e5(e),fo=e=>tS(e,m5),fa=new Set(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),fi=new Set(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),fs=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("/"))},fl="consistent-compound-words/error",fu="consistent-compound-words/rename",fp={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"},fc=new Set(String.raw`\^$.*+?()[]{}|`),fd=e=>{let t="";for(let r of e)t+=fc.has(r)?`\\${r}`:r;return t},fm=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,ff=(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(o4(e));if(r){let t;return(t=e[0])===t.toUpperCase()?o5(r):o4(r)}})(e,r));if(o!==e)return o},fg=(e,t)=>({node:e,messageId:fl,data:{name:e.name,replacement:t}}),fy={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]}}}},fh="no-blob-to-file",fx="suggestion";function fb(e,t){let r=ep(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function fE(e,t){if(e?.type!=="Identifier")return;let r=ep(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 fS="no-canvas-to-image",fv=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function fC(e,t){if(e=fv(e),e?.type!=="Identifier")return e;let r=ep(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 fv(n.parent.init)}let fD=e=>e.toLowerCase().includes("canvas"),fT="replace-one-element",fA="insert-at-negative-one",fw="suggestion-replace-one-element",fk="suggestion-insert-at-negative-one";function fI(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&fI(e.object)}let fj=(e,t)=>t.getCommentsInside(e).length>0,fF="no-duplicate-set-values",fB="first-match",fR="id-selector",fP="length-check",fL="query-selector-all-nullish",fN="query-selector-undefined",f$=e=>tS(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!n7(e.callee.object),fM=e=>tS(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!n7(e.callee.object),fO=e=>{let t,r;return t=e,r=fM,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&e8(t.property,0)},fU=e=>{let t,r;return t=e,r=fM,tS(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&e8(t.arguments[0],0)},fq=e=>nI(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,fW=(e,t,r,n)=>{let[,o]=e1(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},fV=(e,t,r)=>{if("Identifier"!==e.type)return;let n=ep(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},f_=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tB(e))r=!r,e=e.parent;else if(tR(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tN(n)||(fM(e)?!e:!fV(e,r,fM)))return;let a=r.getText(e);return{node:e,messageId:fP,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"}`)}},fz=(e,t,r)=>({node:e,messageId:fB,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?aF(n,e,r):aB(n,e,r)}}),fK=(e,t)=>te(e)||tk(e)&&t.isGlobalReference(e),fG=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:fV(n,r,t))&&fK(a,r)?{node:n,value:a}:(t(a)?a:fV(a,r,t))&&fK(n,r)?{node:a,value:n}:void 0:void 0},fJ="no-invalid-file-input-accept/invalid",fX="no-invalid-file-input-accept/static",fY="no-invalid-file-input-accept/normalize",fH=new Set(["audio/*","image/*","video/*"]),fQ=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"]]),fZ=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,f0=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},f1=e=>{if(e.startsWith("."))return e.length>1&&!f0(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]&&!f0(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 fH.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new y.MIMEType(e);return{replacement:fQ.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},f2=e=>{if("JSXIdentifier"===e.type)return e.name},f3=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&f2(e.name)===t),f8=(e,t)=>{let r=e.sourceCode.getScope(t),n=eF(t,r)?.value;if("string"==typeof n)return n},f6=e=>">"===e||""===e.trim(),f9=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},f5=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],f4=(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}},f7=(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&&!f6(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},ge=(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=f9(n,i,a),!f5(n,i,a));){let e=f4(n,i,a);if(i=f9(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=f9(n,++i,a);let t=f7(n,i,a);if(i=t.index,e.name===r)return t}},gt=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:fJ,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:fX};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=f1(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:fJ,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:fY,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},gr=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,gn=e=>{for(let t=e.parent;t;t=t.parent)if(tg(t))return t},go=(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}},ga=e=>{let{sourceCode:t}=e,r=new Set,n=e=>{let t=gn(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(go(o,n)&&tM(o,t.visitorKeys))return!0;return!1}}},gi="after-suspension",gs="in-nested-function",gl="no-unnecessary-nested-ternary";function gu(e,t,r){return r.getText(e)===r.getText(t)}function gp(e,t,r,n){let o=e2(e,t);return!e3(e,t)&&oH(e,{operator:r,property:n})&&(o=`(${o})`),o}function gc(e,t){let r=e2(e,t);return!e3(e,t)&&o_(e)&&(r=`(${r})`),r}function gd(e,t,r){let n={node:t,messageId:gl};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=[gp(r,e,n,"left"),gp(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${gc(a,e)} : ${gc(i,e)}`;return oh(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let gm="no-unused-array-method-return",gf=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"]),gg=/^\p{Uppercase_Letter}/v,gy=Symbol("uncertainValue"),gh=["BigInt","Boolean","Number","RegExp","String","Symbol"],gx=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),gb="prefer-array-last-methods",gE="replace",gS=new Map([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),gv=["reverse","toReversed"],gC="prefer-math-abs",gD=new Set([">",">=","<","<="]),gT={">":"<",">=":"<=","<":">","<=":">="},gA={">":"<",">=":"<="};function gw(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&tt(e.literal)||"TSTypeAnnotation"===e.type&&gw(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>gw(e))||"TSIntersectionType"===e.type&&e.types.some(e=>gw(e))}function gk(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?gk(e.expression):e}function gI(e){let t;return tt(e)||ts(e,{name:"BigInt",argumentsLength:1,optional:!1},to)||"UnaryExpression"===e.type&&"-"===e.operator&&gI(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&gw(t)}function gj(e,t){return gI(e)||function(e,t){let r=gk(e);if("Identifier"!==r.type)return!1;let n=ep(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&gw(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&gI(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&gw(e.node.id.typeAnnotation)||e.node.init&&gI(e.node.init)))??!1}(e,t)}function gF(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?ry(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&e8(e.left,0)?ry(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(ry(e.left,t)&&tv(e.right)||tv(e.left)&&ry(e.right,t))}function gB(e,t){if(!("BinaryExpression"!==e.type||!gD.has(e.operator)||gj(e.left,t)||gj(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:gT[e.operator]}}function gR(e,t){if(!("BinaryExpression"!==e.type||!gD.has(e.operator)||gj(e.left,t)||gj(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:gT[e.operator]}}function gP(e,t){let r=e2(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function gL(e,t,r){let n={node:e,messageId:gC};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function gN(e){return["Identifier","Literal","ThisExpression"].includes((e=gk(e)).type)}let g$="prefer-split-limit",gM=(e,t)=>{let r=eF(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},gO=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tS(r,{method:"split",argumentsLength:1})&&(e6(t=r.arguments[0])&&""!==t.value||e7(t)))return r},gU=(e,t,r,n)=>({node:e,messageId:g$,fix:e=>aE(e,t,String(r),n)}),gq=(e,t,r)=>{let{elements:n}=e,o=gO(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return gU(e,o,n.length,r)},gW="prefer-queue-microtask",gV={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tb(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&ol(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:gW,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&&!or(n.arguments[0])&&of(n)&&ol(n.callee,e)?{node:n.callee,messageId:gW,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&&!or(n.arguments[0])&&of(n)&&ol(n.callee,e)?{node:n.callee,messageId:gW,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(!rF(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:{[gW]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},g_="prefer-string-pad-start-end",gz="suggest-padding-method",gK=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),gG=(e,t)=>{let r,n=((e,t)=>{if("Identifier"!==e.type)return;let r=ep(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=eF(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||gK.has(e.type)||gK.has(n?.type)||n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"},gJ=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,gX=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,gY=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&e4(t)&&gX(r),gH=(e,t)=>{if(!tS(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=eF(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]}},gQ=(e,t)=>{let r,n=gH(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}},gZ=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=e2(t,a),s=e2(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${e2(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},g0=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:g_,data:{method:t}};return o&&!gJ(e,n)&&(a.fix=function(t){let o=oh(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},g1=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:g_,data:{method:t}};return o&&!gJ(e,n)&&(a.suggest=[{messageId:gz,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},g2="require-css-escape",g3=["closest","matches","querySelector","querySelectorAll"],g8=e=>e.value.cooked,g6=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=g8(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=g8(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},g9=e=>tS(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),g5=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],g4={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tS(e,{methods:g3,minimumArguments:1})||n7(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!g9(n)&&(t||g6(r,e))&&(yield{node:n,messageId:g2,fix:g5(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:{[g2]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},g7="require-passive-events",ye=new Set(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),yt=e=>e.computed||"Identifier"!==e.property.type?e6(e.property)?e.property.value:void 0:e.property.name,yr=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===yt(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)},yn=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=yt(e.parent);return t&&"preventDefault"!==t&&!nI((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},yo="this",ya="class",yi="class-unavailable",ys="super",yl="super-class",yu="super-class-unavailable",yp="suggestion",yc=new Set(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),yd=new Set(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),ym=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,yf=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,yg=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(yf(r)&&!ym(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(yc.has(r.type))return}},yy=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},yh=(e,t,r)=>ep(e.getScope(t),t)===ep(e.getScope(r),r),yx=(e,t,r)=>ep(e.getScope(t),r.name)===ep(e.getScope(r),r),yb=(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,yE=e=>{let t;return(t=e.parent,yd.has(t.type)&&t.expression===e)?e.parent:void 0},yS=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=yE(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)},yv=e=>{let t=e;for(;t.parent;){if(yb(t.parent,t))return!0;let e=yS(t);if(!e)break;t=e}return!1},yC=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,yD=e=>{let t=e;for(;t.parent;){let e=yE(t);if(!e)break;t=e}return t},yT=e=>{let t=yD(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},yA=e=>{let t=yD(e);return yC(t)&&"PrivateIdentifier"===t.parent.property.type},yw=e=>{let t=yD(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},yk=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,yI=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:yp,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),yj=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),yF={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||yv(e)||yT(e)||yA(e)||yw(e))return;let n=yg(e);if(!n)return;let o=yy(n.parent.parent);return o&&yx(t,e,o)?yI({node:e,messageId:ya,source:"this",replacement:o.name,name:o.name}):yj(e,yi)}),e.on("Super",e=>{if(n||yv(e))return;let r=yg(e);if(!r)return;let o=yk(r.parent.parent);return o&&yx(t,e,o)?yI({node:e,messageId:yl,source:"super",replacement:o.name,name:o.name}):yj(e,yu)}),e.on("Identifier",o=>{if(!tC(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)||yv(o)||yT(o)||yA(o)||yw(o))return;let a=yg(o);if(!a)return;let i=a.parent.parent;if(r){let e=yy(i);if(e&&o.name===e.name&&yh(t,o,e))return yI({node:o,messageId:yo,source:o.name,replacement:"this",name:o.name})}if(!n||!(yC(o)&&!o.parent.optional&&!yv(o.parent))||e3(o,e))return;let s=yk(i);if(s&&o.name===s.name&&yh(t,o,s))return yI({node:o,messageId:ys,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:{[yo]:"Use `this` instead of `{{name}}` in static methods.",[ya]:"Use `{{name}}` instead of `this` in static methods.",[yi]:"Use the class name instead of `this` in static methods.",[ys]:"Use `super` instead of `{{name}}` in static methods.",[yl]:"Use `{{name}}` instead of `super` in static methods.",[yu]:"Use the superclass name instead of `super` in static methods.",[yp]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},yB="consistent-optional-chaining/remove-optional",yR="consistent-optional-chaining/use-optional",yP="consistent-optional-chaining/suggest-remove-optional",yL="consistent-optional-chaining/suggest-use-optional",yN=new Set(["Identifier","ThisExpression","Super"]);function y$(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rD(e)).type&&(e=e.expression);return e}function yM(e){return"MemberExpression"===(e=y$(e)).type?e:void 0}function yO(e){return e=y$(e),!!yN.has(e.type)||"MemberExpression"===e.type&&yO(e.object)}function yU(e,t){let r=rN(e,t);return!rF(t,r)}function yq({memberExpression:e,context:t,fixer:r,replacement:n}){let o=rN(e,t);return r.replaceTextRange(o,n)}function yW(e,t,r){return yq({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let yV="always",y_="never",yz="missing-delay",yK="redundant-delay",yG=new Set(["setTimeout","setInterval"]),yJ=new Set(["window","globalThis","global","self"]),yX=e=>e8(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&yX(e.argument),yY="negative-index",yH="length-index",yQ="no-duplicate-loops",yZ=["filter","map"],y0="no-declarations-before-early-exit",y1=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),y2=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,y3=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eb(n)},y8=(e,t)=>{let[r,n]=e.getRange(t);return new Set(ra(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*y6(e,t,r){let n;for(let[o,a]of t.entries())if(y1(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?oi(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&oi(t.property.name)})(r.init)||r.init&&tM(r.init,e.visitorKeys)||a>o+1&&!y2(r.init)||r.init&&(i=r.init,s=y8(e,n),[...y8(e,i)].some(e=>s.has(e)))&&(eO(r.init,e)||eO(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:y0};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&y2(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!y3(e,t,"before")&&!y3(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eb(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 y9="no-optional-chaining-on-undeclared-variable",y5=e=>"Type"===e.type||"ImportBinding"===e.type&&ox(e.node);function y4(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rD(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let y7="no-object-methods-with-collections/error",he="no-object-methods-with-collections/suggestion",ht=new Set(["entries","keys","values"]),hr="no-subtraction-comparison/error",hn="no-subtraction-comparison/suggestion",ho={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},ha=new Set(Object.keys(ho)),hi=new Set([">","<"]),hs=e=>"BinaryExpression"===e.type&&"-"===e.operator,hl=(e,t)=>{let r=eF(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},hu="no-unnecessary-global-this",hp=new Set(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function hc(e){for(;hp.has(e.type);)e=e.expression;return e}let hd=e=>{for(;hp.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},hm=tV();function hf(e){return"CallExpression"===(e=hd(e)).parent.type&&e.parent.callee===e}let hg=new Set(["==","!=","===","!=="]),hy="computed-key",hh="nested-array",hx="deep-object",hb="property-assignment";function hE(e){let{parent:t}=e;if(t){if(rC(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return hE(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 hS(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=hE(e);return t}let hv="no-useless-else",hC=new Set(["Program","BlockStatement","StaticBlock","SwitchCase"]),hD=new Set(["[","(","<","/","`","+","-"]),hT=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},hA=e=>hD.has(e.value[0]),hw="no-useless-recursion",hk=new Set(["using","await using"]),hI=e=>e?.type==="VariableDeclaration"&&hk.has(e.kind),hj=e=>"ForStatement"===e.type?hI(e.init):"ForOfStatement"===e.type&&hI(e.left),hF="prefer-add-event-listener-options",hB="prefer-direct-iteration",hR="Array",hP="FormData",hL="URLSearchParams",hN=new Set([hR,"Map","Set",hP,hL,...rG]),h$=new Map([["ReadonlyArray",hR],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),hM=new Map([[hR,["values"]],["Map",["entries"]],["Set",["values","keys"]],[hP,["entries"]],[hL,["entries"]],...rG.map(e=>[e,["values"]])]),hO=["Map","WeakMap","Set","WeakSet"],hU=["all","allSettled","any","race"],hq=new Set(["ArrayExpression","CallExpression","NewExpression"]),hW=e=>new Set([e]),hV=(e,t)=>tS(e,{objects:rG,methods:t,optionalCall:!1,optionalMember:!1}),h_=e=>hN.has(e)?e:h$.get(e),hz=e=>{let t=new Set;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},hK=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return hz(e.types.map(e=>hK(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return hW(hR);let n=rY(e);if(!rH(n,r))return;let o=n.getName(),a=o&&h_(o);return a&&hW(a)},hG=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return hG(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return hW(hR);case"TSTypeOperator":return"readonly"===e.operator?hG(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=h_(e.typeName.name);return t&&hW(t)}case"TSUnionType":return hz(e.types.map(e=>hG(e)))}},hJ=(e,t,r=new Set)=>((e,t,r)=>{if("ArrayExpression"===e.type||tl(e,{name:"Array"}))return hW(hR);if(tl(e,{names:rG})||tl(e,{names:["Map","Set",hP,hL]}))return hW(e.callee.name);if(ts(e,{name:"Array"},to)||tS(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return hW(hR);if(hV(e,["from","of"]))return hW(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=ep(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=hG(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?hJ(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return hG(e.typeAnnotation)??hJ(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return hJ(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return hK(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),hX="prefer-number-is-safe-integer/error",hY="prefer-number-is-safe-integer/suggestion",hH="prefer-number-is-safe-integer/integer-check-error",hQ="prefer-number-is-safe-integer/integer-check-suggestion",hZ=["_","lodash","underscore"],h0=["floor","trunc"],h1=(e,t)=>{let r=ep(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},h2=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&e8(e.right,1))return e.left},h3=(e,t)=>{if(tS(e,{object:"Math",methods:h0,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},h8="prefer-object-define-properties";function h6(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tS(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let h9="prefer-object-destructuring-defaults",h5="prefer-object-destructuring-defaults/suggestion",h4=new Set(Object.getOwnPropertyNames(Object.prototype)),h7={considerGetters:!0,considerImplicitTypeConversion:!0},xe=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,xt=(e,t,r)=>ra(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)),xr=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=e2(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},xn="prefer-single-object-destructuring",xo=(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=ep(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}},xa=(e,t,r)=>{let n,o,a=xo(e,t),i=xo(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=>eb(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:xn,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*xi(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=xa(e,t[r-1],n);o&&(yield o)}}let xs="prefer-smaller-scope",xl=new Set(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function xu(e,t){let r=e.parent;for(;r&&r!==t;){if(xl.has(r.type))return!1;r=r.parent}return r===t}function xp(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eb(n))}function xc(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let xd="prefer-single-array-predicate/error",xm="prefer-single-array-predicate/suggestion",xf=new Map([["||","some"],["&&","every"]]),xg=new Set(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),xy="prefer-url-href",xh="non-url",xx="unknown",xb=new Set(["ClassName","ImportBinding","Type"]),xE=new Set(["any","error","unknown"]),xS=new Set(["node:url","url"]),xv=e=>xb.has(e.type),xC=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>ob(e,r,n)))return o;t=t.upper}},xD=e=>e.every(e=>"url"===e)?"url":!e.includes(xx)&&e.includes(xh)?xh:xx,xT=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,xS.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},xA=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||ox(e.node)),xw=e=>"Type"===e.type||xA(e),xk=e=>xT(e)&&!xA(e),xI=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r)=>{for(;e;){let n=e.set.get("URL");if(n?.defs.some(e=>!xw(e)&&ob(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(ol(e,t))return!0;let r=ep(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>xw(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=ep(t.sourceCode.getScope(e),e);return r?.defs.some(e=>xk(e))??!1})(r,t))},xj=(e,t)=>t.sourceCode.getScope(e.name??e.node),xF=(e,t,r,n=new Set)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return xF(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return xx;let o=e.typeName.name,a=xC(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=>xv(e)))return!0;t=t.upper}return!1})(o,r)?xx:"url";if(n.has(o))return xx;if(xT(i))return"url";n.add(o);let s=xx;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=xF(i.node.typeAnnotation,t,xj(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=xx:"ClassName"===i.type&&(s=xh),n.delete(o),s})(e,t,r,n);case"TSUnionType":return xD(e.types.map(e=>xF(e,t,r,n)));case"TSIntersectionType":return xD(e.types.map(e=>xF(e,t,r,n)));case"TSImportType":let o;return(o=e.source,xS.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":xh;default:return e?xh:xx}},xB=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(xE.has(e.intrinsicName)||e.isTypeParameter?.())return xx;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return xB(i,t);if(e.isUnion()||e.isIntersection())return xD(e.types.map(e=>xB(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return xx;let n=xC(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||xT(e))??[];return 0===o.length?xx:o.every(e=>xT(e))?"url":xh})(r.typeToString(e),o,n);if(s!==xx)return s;let l=rY(e);return rH(l,a)&&"URL"===l.getName()?"url":xh},xR=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return xx;try{let{program:n}=r;return xB(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return xx}};function xP(e,t,r=new Set){if(!e)return xx;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=ep(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return xx;let[o]=n.defs;if(!ob(o,e,t))return xx;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?xP(o.node.init,t,r):xx,i=xF(o.name?.typeAnnotation,t,xj(o,t)),s=xx;return a!==xx?s=a:i!==xx&&(s=i),r.delete(n),s})(e,t,r);if(n!==xx)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=xF(e.typeAnnotation,t,n);return o===xx?xP(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return xP(e.expression,t,r);case"SequenceExpression":return xP(e.expressions.at(-1),t,r);case"ConditionalExpression":return xD([xP(e.consequent,t,r),xP(e.alternate,t,r)])}if(xI(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=ep(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!xw(e)&&!xk(e))??!1})(e.callee,t))return xh;let r=xR(e,t);return r===xx?xh:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return xx;let r=ep(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return xx;let[n]=r.defs;return xF(n.node.returnType,t,xj(n,t))})(e,t);return o!==xx?o:xR(e,t)}let xL=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return xL(e.expression,t);case"SequenceExpression":return xL(e.expressions.at(-1),t);case"ConditionalExpression":return xL(e.consequent,t)&&xL(e.alternate,t);case"NewExpression":return xI(e,t);default:return!1}},xN=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,x$="require-proxy-trap-boolean-return",xM=new Set(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),xO=new Set(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),xU=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),xq=new Set(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),xW=(e,t)=>({node:e,messageId:x$,data:{name:t}}),xV=e=>{if(e)return xW(e.node,e.data.name)},x_=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?xV(x_(e.right,t,r)):xW(e,t);if("ConditionalExpression"===e.type)return x_(e.consequent,t,r)??x_(e.alternate,t,r);if("LogicalExpression"===e.type)return xV(x_(e.left,t,r)??x_(e.right,t,r));if("SequenceExpression"===e.type)return xV(x_(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=eF(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(xU.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&xq.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{...xW(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},xz=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eR(e,t.getScope(e));if(xM.has(r)&&xO.has(e.value.type))return{name:r,functionNode:e.value}},xK=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return xW(e,t);if("BlockStatement"!==e.body.type)return x_(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&&xO.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 xW(e,t)}for(let e of o){if(!e.argument)return xW(e,t);let n=x_(e.argument,t,r);if(n)return n}if(!a)return xW(e,t)},xG=h.builtinRules.get("logical-assignment-operators"),xJ="ifNullish",xX="convertIf",xY={...xG.meta.messages,[xJ]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},xH=e=>e.fix??e.suggest?.[0]?.fix,xQ={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 xH(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:xJ};if(t.getCommentsInside(e.node).length>0)return n;let o=xH(e);return{...n,suggest:[{messageId:xX,data:{operator:"||="},fix:o},{messageId:xX,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:xY,languages:["js/js"]}},xZ="no-useless-coercion",x0=new Map([["Boolean",{type:"boolean",isType:nZ}],["String",{type:"string",isType:n5}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&n1(e.typeAnnotation)||n2(e,t))||"bigint"==typeof eF(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>nM(e,t.sourceCode.getScope(e))}]]),x1="no-useless-boolean-cast",x2=["every","filter","find","findIndex","findLast","findLastIndex","some"],x3="no-useless-continue",x8="no-useless-override",x6=e=>e.isUnion()?e.types.every(e=>x6(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,x9=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},x5="prefer-has-check",x4=new Set(["Map","ReadonlyMap","WeakMap"]),x7=new Set(["Map","WeakMap"]),be=new Set(["FormData","Headers","URLSearchParams"]),bt=new Set(["Array","ReadonlyArray"]),br=x7.union(be),bn=new Set(["ClassName","ImportBinding","TSEnumName","Type"]),bo=new Set(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),ba=new Set(["TSTypeAnnotation","TSParenthesizedType"]),bi=new Set(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),bs=new Set(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),bl=new Set(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),bu=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),bp=new Set(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),bc=e=>{for(;bp.has(e.type);)e=e.expression;return e},bd=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=bd(e.left);return t?`${t}.${e.right.name}`:void 0}},bm=e=>e.typeArguments?.params??e.typeParameters?.params??[],bf=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>bn.has(e.type));if(r)return r;t=t.upper}},bg=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===bm(e.node).length)return e.node.typeAnnotation},by=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=ep(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},bh=(e,t)=>tk(e)&&by(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,bx=(e,t)=>x4.has(e)?{kind:"map",typeName:e,valueType:t}:be.has(e)?{kind:"null-sentinel",typeName:e}:void 0,bb=(e,t,r=new Set)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return bb(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?bb(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=bd(e.typeName);if(!n)return;if((x4.has(n)||be.has(n))&&!bf(n,t))return bx(n,bm(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),bg(bf(e,t))})(n,t,r);return o?bb(o,t,r):void 0}}},bE=(e,t)=>{let r=t.sourceCode.getScope(e);return bb(e.typeAnnotation,r)},bS=(e,t,r=new Set)=>{let n=bE(e,t);if(n)return n;if(tl(e=bc(e))&&"Identifier"===e.callee.type&&br.has(e.callee.name)&&by(e.callee,t))return bx(e.callee.name);if("Identifier"!==e.type)return;let o=ep(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,i=bb(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?bS(a.node.init,t,r):void 0)},bv=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=rY(r);if(rH(e,t))return e.getName()}},bC=(e,t,r)=>{if(rJ.has(e.intrinsicName)||rX.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>bC(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=>bC(e,t,r)).find(e=>e?.kind==="map");let n=bv(e,r);return bx(n,x4.has(n)?t.getTypeArguments(e).at(-1):void 0)},bD=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return bC(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},bT=(e,t)=>bD(e,t)??bS(e,t),bA=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,bw=(e,t,r,n=new Set)=>{if(!e||bi.has(e.type))return!1;if(ba.has(e.type))return bw(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&bw(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>bw(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(bs.has(e.type))return"truthy"!==r;if(bl.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&&bA(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=bd(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=bg(o=bf(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=bw(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},bk=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,bI=(e,t,r)=>{if(rJ.has(e.intrinsicName))return!1;let n=bk(e,t);return n&&n!==e?bI(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>bI(e,t,r)):!r.has(e.intrinsicName))},bj=(e,t,r)=>{if(rJ.has(e.intrinsicName)||rX.has(e.intrinsicName))return!1;let n=bk(e,t);if(n&&n!==e)return bj(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>bj(e,t,r));if(bo.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)||bt.has(bv(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},bF=(e,t,r)=>{if(!tl(e)||"Identifier"!==e.callee.type||!x7.has(e.callee.name)||!by(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=eF(n,t.sourceCode.getScope(n)))?bA(o.value,r):!tk(n)&&bu.has(n.type))})},bB=(e,t,r)=>{let n=bF(bc(e),t,r);if(void 0!==n)return n;let o=bD(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?bj(o,n,e):"not-undefined"===r?bI(o,n,new Set(["undefined","void"])):bI(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=bE(t,r);if(l?.kind==="map")return!!l.valueType&&bw(l.valueType,r,n);let u=((e,t,r,n)=>{if(!tl(e)||"Identifier"!==e.callee.type||!x7.has(e.callee.name)||!by(e.callee,t))return;if(n){let n=bF(e,t,r);if(void 0!==n)return n}let o=bm(e).at(-1);return!!o&&bw(o,t,r)})(t=bc(t),r,n,s);if(void 0!==u)return u;let p=((e,t,r)=>{if("Identifier"!==e.type)return;let n=ep(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=bb(c.name?.typeAnnotation,r.sourceCode.getScope(c.name)),a?.kind==="map"?!!a.valueType&&bw(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="logical",bP="ternary",bL="consistent-conditional-object-spread",bN=new Set(["==","==="]),b$=new Set(["!=","!=="]),bM=e=>td(e)||tk(e)||te(e),bO=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function bU(e,t,r){if(ry(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return bU(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&bU(e.left,t.left,r)&&bU(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&bU(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function bq(e){return te(e)?"null":tk(e)?"undefined":void 0}function bW(e){if("BinaryExpression"!==e.type||!bN.has(e.operator)&&!b$.has(e.operator))return;let t=bq(e.left),r=bq(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:bN.has(e.operator)}}let bV=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function b_(e,t){let r=bW(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=bW(e.left),o=bW(e.right);if(n&&o&&bU(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&bV(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&bV(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function bz(e,t,r){let n=e2(e,r);return!e3(e,r)&&oH(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function bK(e,t){let r=e2(e,t);return!e3(e,t)&&o_(e)&&(r=`(${r})`),r}let bG="default-export-style/inline",bJ="default-export-style/separate",bX="default-export-style/suggestion-inline",bY="default-export-style/suggestion-separate",bH="inline",bQ="separate",bZ="ignore",b0="class",b1="function",b2=()=>({enum:[bH,bQ,bZ]}),b3=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,b8=e=>e.id?.name,b6=e=>{switch(e.type){case"ClassDeclaration":return b0;case"FunctionDeclaration":return b1}},b9=e=>e===b0?"classes":"functions",b5=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return rA(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},b4=(e,t)=>ep(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,b7=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),Ee=(e,t)=>{if(b7(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&Ee(e,t)))return!0;continue}if(n?.type&&Ee(n,t))return!0}return!1},Et=(e,t)=>e.params.every(e=>!rV(e,t.sourceCode.visitorKeys)),Er=(e,t,r)=>ep(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,En=(e,t)=>{let r=b8(e);if(r){let t=b6(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||b7(r.id)||r.init?.type!=="ArrowFunctionExpression"||Ee(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:b1,name:n.id.name,declaration:e,functionNode:n.init}},Eo=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),Ea=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||Er(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!Ee(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&Et(t,e)&&!rV(t.body,e.sourceCode.visitorKeys))return[{messageId:bY,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${Eo(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
44
- export default ${n};`)}]},Ei=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===bZ||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return rA(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||b4(i,r.declaration))&&(o!==b1||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===b1&&"FunctionDeclaration"===t.type&&Ee(t,e.sourceCode.visitorKeys))){if(n===bH)return"VariableDeclaration"===t.type?{node:r,messageId:bG,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||b5(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||Er(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!Ee(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&Et(i,e)&&!rV(i.body,e.sourceCode.visitorKeys))return[{messageId:bX,data:{kind:b1},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${Eo(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${e2(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===b0&&Ee(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||b5(e,r)?{node:r,messageId:bG,data:{kind:o}}:{node:r,messageId:bG,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===bQ&&o===b1&&"FunctionDeclaration"===t.type)return{node:r,messageId:bJ,data:{kind:o,style:"const arrow function"},suggest:Ea({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},Es=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=b8(o),i=e.sourceCode.getScope(t);if(!(!a||r===bZ||r===bH||b4(i,a)||n===b1&&(o.generator||Ee(o,e.sourceCode.visitorKeys)))){if(n===b1)return{node:t,messageId:bJ,data:{kind:n,style:"const arrow function"},suggest:Ea({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===b0&&Ee(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:bJ,data:{kind:n,style:"class declaration"}}:{node:t,messageId:bJ,data:{kind:n,style:"class declaration"},fix:r=>{let{declaration:n}=t;return r.replaceText(t,`${e.sourceCode.getText(n)}
45
- export default ${n.id.name};`)}}}},El={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=b6(r),a=b8(r);if(!n||!a)continue;let i=Es({context:e,exportDeclaration:o,expectedStyle:t[b9(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=En(o,e);if(!i||!b3(a,i.name))continue;let s=Ei({context:e,exportDeclaration:a,expectedStyle:t[b9(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:b2(),classes:b2()},additionalProperties:!1}],defaultOptions:[{functions:bH,classes:bH}],messages:{[bG]:"Prefer declaring this default-exported {{kind}} inline.",[bJ]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[bX]:"Use an inline default {{kind}} declaration.",[bY]:"Use a separate const arrow function default export."},languages:["js/js"]}};function Eu(e){for(;;){let t=rD(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function Ep(e,t){return ep(t.sourceCode.getScope(e),e)}let Ec="no-array-concat-in-loop",Ed="no-array-front-mutation",Em=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],Ef="no-array-sort-for-min-max/error",Eg="no-array-sort-for-min-max/suggestion",Ey=e=>e4(e)&&0===e.value,Eh=(e,t)=>{if(!tS(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||ng(e.callee.object,t)||r_(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tg(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rD((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(ry(t.left,r)&&ry(t.right,n))return"ascending";if(ry(t.left,n)&&ry(t.right,r))return"descending"}})(r);if(n)return{direction:n,node:e.callee.object}},Ex=(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:Ef,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=od(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:Eg,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},Eb="no-boolean-sort-comparator",EE="no-boolean-sort-comparator/suggestion",ES=new Set(["sort","toSorted"]),Ev=new Set([">",">=","<","<="]),EC=(e,t,r,n)=>(e=rD(e),t=rD(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?!!ry(e.property,t.property):e.property.name===t.property.name)&&EC(e.object,t.object,r,n),ED=(e,t)=>{for(;rC(e);){if(e.typeAnnotation&&nX(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},ET="no-chained-comparison/error",EA="no-chained-comparison/suggestion",Ew=new Set(["<",">","<=",">="]),Ek=new Set(["===","!==","==","!="]),EI=Ew.union(Ek),Ej=e=>"BinaryExpression"===e.type&&EI.has(e.operator),EF="no-constant-zero-expression/error",EB="no-constant-zero-expression/suggestion",ER="no-duplicate-logical-operands",EP="no-duplicate-logical-operands/suggestion",EL=new Set(["Identifier","ThisExpression","Literal"]),EN=new Set(["Identifier","ThisExpression"]),E$=e=>{if(uf(e=rD(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return E$(e.object)&&(!e.computed||(t=rD(t=e.property),EL.has(t.type)));default:return!1}},EM="no-impossible-length-comparison",EO={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},EU="no-invalid-character-comparison",Eq=new Set(["==","===","!=","!=="]),EW=(e,t)=>!!(tS(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&n5(e.callee.object,t)||tS(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&n5(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(e4(e))return!0;if(!e6(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&n5(e.object,t),EV="no-loop-iterable-mutation",E_=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],Ez=["add","clear","delete"],EK=["clear","delete","set"],EG={array:new Set(E_),set:new Set(Ez),map:new Set(EK),unknown:new Set([...E_,...Ez,...EK])},EJ=new Set(["entries","keys","values"]),EX=new Set(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function EY(e,t){return nf(e,t)?"array":nv(e,t)?"set":nC(e,t)?"map":void 0}function EH(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function EQ(e){return"Identifier"===(e=rD(e)).type?e:void 0}function EZ(e){if("ArrayPattern"!==(e=rD(e)).type)return;let[t]=e.elements;return t&&EQ(t)}function E0(e,t){if(uf(e=rD(e)))return;if(um(e))return{collectionKind:EY(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eR(e.callee,t.sourceCode.getScope(e.callee));if(!(!EJ.has(r)||uf(e.callee.object))&&um(e.callee.object))return{collectionKind:EY(e.callee.object,t),reference:e.callee.object,method:r}}function E1(e,t){let r=EH(e);return"keys"===t.method?EQ(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?EZ(r):void 0}function E2(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=EH(e),"entries"===t.method?EZ(r):"direct"!==t.method||"map"!==t.collectionKind?EQ(r):void 0),a=E1(e,t),i=(n=EH(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?EQ(n):"direct"===t.method&&"map"!==t.collectionKind?EQ(n)??EZ(n):E1(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*E3(e){"Identifier"===(e=rD(e)).type?yield e:"MemberExpression"===e.type&&(yield*E3(e.object),e.computed&&(yield*E3(e.property)))}function E8(e,t,r){if(!ud(e,t))return!1;let n=[...E3(e)],o=[...E3(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=ep(r.sourceCode.getScope(e),e),i=ep(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function E6(e,t,r){let[n]=e.arguments;return!!(t&&n&&E8(n,t,r))}function E9(e,t,r,n){return"add"===r&&E6(e,t.addArgumentIdentifier,n)||"set"===r&&E6(e,t.setKeyIdentifier,n)}let E5="no-selector-as-dom-name",E4=["add","remove","contains","toggle","replace"],E7=/^[#.]-?[A-Z_a-z][\w-]*$/u,Se=new Set([".","#"]),St=e=>Se.has(e?.[0]),Sr=e=>e5(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),Sn=(e,t,r,n)=>({node:e,messageId:E5,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(E7.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),So=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),Sa="no-useless-compound-assignment/error",Si="no-useless-compound-assignment/remove",Ss="no-useless-compound-assignment/replace",Sl=new Map([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),Su="no-useless-delete-check",Sp="removeCheck",Sc={considerGetters:!0},Sd=new Set(["Map","Set","WeakMap","WeakSet"]),Sm=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),Sf=new Set(["ClassName","FunctionName"]),Sg=new Set(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),Sy=e=>null!==e&&("object"==typeof e||"function"==typeof e),Sh=e=>!!Sg.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>Sh(e)),Sx=(e,t)=>{if("Identifier"!==e.type)return!1;let r=ep(t.sourceCode.getScope(e),e);return r?.defs.some(e=>Sf.has(e.type))??!1},Sb=(e,t)=>{let r=eF(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!Sy(r.value)?String(r.value):void 0},SE=(e,t)=>{let r=eF(e,t.sourceCode.getScope(e));if(r)return Sy(r.value);let n=rL(rD(e),t);if(n){let e=rD(n),r=eF(e,t.sourceCode.getScope(e));if(r)return Sy(r.value);if(Sm.has(e.type))return!0}return!Sx(rD(e),t)&&Sh(((e,t)=>{if("Identifier"!==(e=rD(e)).type)return;let r=ep(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},SS=(e,t)=>!eO(e,t.sourceCode,Sc),Sv=(e,t)=>tS(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),SC=(e,t,r)=>n=>{if(rF(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),oh(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},SD="no-useless-logical-operand",ST=new Map([["&&",!0],["||",!1]]),SA=new Map([["&&",!1],["||",!0]]),Sw=new Set(["FunctionExpression","ClassExpression","ObjectExpression"]),Sk="prefer-boolean-return",SI=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function Sj(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return Sj(t[0])}return e}}let SF=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function SB(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return SI.has(e.operator);case"LogicalExpression":return SB(e.left,t)&&SB(e.right,t);case"CallExpression":return tP(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 SR="prefer-flat-math-min-max",SP=["min","max"],SL=(e,t)=>tS(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),SN=(e,t)=>{let r=[];for(let n of e.arguments){if(SL(n,t)){r.push(...SN(n,t));continue}r.push(n)}return r},S$="prefer-hoisting-branch-code/start",SM="prefer-hoisting-branch-code/end",SO="prefer-hoisting-branch-code/suggestion",SU=new Set(["await using","using"]),Sq=(e,t)=>eO(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),SW=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},SV=(e,t,r)=>{let n=SW(e,r),o=SW(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 S_(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 Sz({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=>!rP(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 rF(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&&rF(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(rF(a,[r,n-1]))return!0}return rF(a,S_(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"&&SU.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?S$:SM};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=rS(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=rS(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&&oh(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
46
- ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&oh(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
47
- ${s}${c}${n}`)}for(let e of t)yield l.removeRange(S_(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(Sq(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!Sq(e,s))?c.fix=i:c.suggest=[{messageId:SO,fix:i}]}return c}let{parse:SK}=sl,SG="prefer-single-replace",SJ=new Set(["g","m","s"]),SX=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 SY(e){if(!tS(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(e6(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(e7(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!SJ.has(e))return;try{r=SK(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 SH="consistent-tuple-labels",SQ="no-invalid-well-known-symbol-methods/async-dispose",SZ="no-invalid-well-known-symbol-methods/dispose-generator",S0="no-invalid-well-known-symbol-methods/sync-iterator",S1="no-invalid-well-known-symbol-methods/async-iterator",S2="no-invalid-well-known-symbol-methods/suggestion",S3=new Set(["Promise","PromiseLike"]),S8=new Set(["dispose","iterator","asyncIterator"]);function S6(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&S3.has(e.typeName.name)}function S9(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(!S8.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:SZ};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?S6(r):"TSUnionType"===r.type&&r.types.some(e=>S6(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===oa(t.getReturnTypeOfSignature(o),t);return r.getTypeAtLocation(e).getCallSignatures().some(e=>!0===oa(t.getReturnTypeOfSignature(e),t))}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a))return{node:e.key,messageId:SQ,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:S0};return o.generator&&(t.suggest=[{messageId:S2,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:S1}}let S5="after-suspension",S4="in-generator",S7="in-nested-function",ve=["preventDefault","stopImmediatePropagation","stopPropagation"],vt="prefer-abort-signal-timeout",vr="prefer-abort-signal-timeout/suggestion",vn=new Set(["reason","throwIfAborted"]),vo=(e,t)=>{let r,{parent:n}=e;if(!(!tb(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nI(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tb(n.parent)&&n.parent.object===n&&(r=n.parent,vn.has(eR(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rC(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)||rF(t,t.sourceCode.getRange(n))))return n},va=(e,t,r,n)=>{let o=ep(n.sourceCode.getScope(r),e);return o&&o!==t},vi="prefer-aggregate-error",vs=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,vl=new Set(s2);function vu(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return rD(e)}function vp(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=vp(e.left);return t?`${t}.${e.right.name}`:void 0}}function vc(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?vc(e.typeAnnotation):e}function vd(e,t,r,n=new Set){switch(e=vc(e),e?.type){case"TSTypeReference":{let o=vp(e.typeName);if(!o)return!1;let a=oE(o,t);if(vl.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&&vd(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>vd(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>vd(e,t,r,n));default:return!1}}function vm(e,t){let r;if(tb(e=vu(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,vs.test(r))&&nf(e.object,t)&&function(e,t){let r=oE(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=vc(t),t?.type){case"TSArrayType":return vd(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>vd("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=vp(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return vd(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=oE(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=rY(t);return!!(vl.has(i?.getName())&&rH(i,n))||rQ(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 vf=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&e8(vu(t),0))return!0;let o=(n=vu(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)},vg=e=>"LogicalExpression"!==(e=vu(e)).type||"&&"!==e.operator?[e]:[...vg(e.left),...vg(e.right)],vy={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},vh=new Set(Object.keys(vy)),vx=new Set(["globalThis","self","window"]),vb=new Set(["getBoundingClientRect","getClientRects"]),vE=new Set(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),vS=new Set(["innerHeight","innerWidth"]),vv=new Set(["height","width"]),vC=new Set(["Window"]),vD=new Set(["VisualViewport"]),vT=new Set(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),vA=(e,t,r)=>{let n;if(rJ.has(e.intrinsicName))return!1;if(rX.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>vA(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return vA(o,t,r);let a=rY(e);return!(!a||rQ(e,t).some(e=>!vA(e,t,r)))&&(!rH(a,r)||(n=a.getName(),!(vT.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},vw=(e,t,r,n)=>{if(rJ.has(e.intrinsicName)||rX.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!rX.has(e.intrinsicName));return o.length>0&&o.every(e=>vw(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>vw(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return vw(o,t,r,n);let a=rY(e);return!!(a&&rH(a,r)&&n.has(a.getName()))||rQ(e,t).some(e=>vw(e,t,r,n))},vk=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return vw(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},vI=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return vA(r.getTypeAtLocation(e),n,t)}catch{return!1}},vj=e=>e.computed||"Identifier"!==e.property.type?e5(rD(e.property)):e.property.name,vF=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?e5(rD(e.key)):e.key.name})(e))),vB=(e,t)=>"Identifier"===e.type&&vx.has(e.name)&&ol(e,t),vR=e=>nI(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),vP=(e,t)=>"Identifier"===(e=rD(e)).type?"visualViewport"===e.name&&ol(e,t):"MemberExpression"===e.type&&"visualViewport"===vj(e)&&vB(rD(e.object),t),vL=(e,t)=>{var r;return vB(e=rD(e),t)||("Identifier"===(r=rD(r=e)).type?"document"===r.name&&ol(r,t):"MemberExpression"===r.type&&"document"===vj(r)&&vB(rD(r.object),t))||vP(e,t)},vN=(e,t,r)=>{let n=rD(t);return vF(e,vS)&&(vB(n,r)||vk(t,r,vC))||vF(e,vv)&&(vP(n,r)||vk(t,r,vD))||vF(e,vE)&&!vL(n,r)&&!vI(t,r)},v$=(e,t,r=e)=>{let n,o,a,i;if(!e||e!==r&&tg(e))return!1;if(a=e,i=t,ts(a,void 0,to)&&"MemberExpression"===a.callee.type&&vb.has(vj(a.callee))&&!vL(a.callee.object,i)&&!vI(a.callee.object,i)||tC(e)&&vS.has(e.name)&&!vR(e)&&ol(e,t)||"MemberExpression"===e.type&&!vR(e)&&(n=vj(e),o=rD(e.object),vS.has(n)&&(vB(o,t)||vk(e.object,t,vC))||vv.has(n)&&(vP(o,t)||vk(e.object,t,vD))||vE.has(vj(e))&&!vL(e.object,t)&&!vI(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?vN(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&vN(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=>v$(e,t,r)))return!0;continue}if(v$(o,t,r))return!0}return!1},vM="prefer-set-methods/union",vO="prefer-set-methods/intersection",vU="prefer-set-methods/intersection-suggestion",vq="prefer-set-methods/difference",vW="prefer-set-methods/difference-suggestion",vV=(e,t)=>tl(e,{name:"Set",argumentsLength:1})&&ol(e.callee,t),v_=(e,t)=>{let r=e2(e,t);return oG(e,t)&&!e3(e,t)?`(${r})`:r},vz=(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)&&oh(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,vK=(e,t)=>("ParenthesizedExpression"===e.type||rC(e))&&e.expression===t,vG=e=>{for(;e.parent;){let{parent:t}=e;if(vK(t,e)){e=t;continue}break}return e},vJ=(e,t)=>e?.type==="SpreadElement"&&"Set"===oB(e.argument,t),vX=(e,t,r)=>{if(!(!tS(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!ry(e.arguments[0],t)||ry(e.callee.object,t))&&"Set"===oB(e.callee.object,r))return e.callee.object},vY=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=vG(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rC(e.parent))return;let o=((e,t)=>{if(!tS(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&&vJ(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=vX(e,t,r);if(n)return{method:"intersection",messageId:vO,suggestionMessageId:vU,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=vX(e.argument,t,r);if(o)return{method:"difference",messageId:vq,suggestionMessageId:vW,otherSet:o}})(n.body,n.params[0],t);if(!(!o||eO(o.otherSet,t.sourceCode,{considerGetters:!0})))return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${v_(r,t)}.${o.method}(${e2(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,vz(t,o.replacement,r))}]}},vH="prefer-toggle-attribute/error",vQ="prefer-toggle-attribute/suggestion",vZ=(e,t,r)=>{let n=e2(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?vZ(e.argument,t,!1):(!e3(e,t.sourceCode)&&oY(e,"!")&&(n=`(${n})`),`!${n}`):e3(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},v0=(e,t,r)=>tS(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function v1(e){if(e?.type==="ChainExpression"&&(e=e.expression),v0(e,["removeAttribute","hasAttribute"],1)||v0(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(e5(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||e8(n,"")}}}function v2(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),v1(e)}}let v3=(e,t)=>e.isOptional===t.isOptional&&ry(e.receiver,t.receiver)&&ry(e.attributeName,t.attributeName),v8=(e,t)=>n7(e.receiver)||nw(e.receiver,t),v6="prefer-url-search-parameters/error",v9="prefer-url-search-parameters/suggestion",v5=new Set(["node:url","url"]),v4=e=>"Type"===e.type||"ImportBinding"===e.type&&ox(e.node),v7=(e,t,r)=>{let n=ep(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>v4(e))},Ce=(e,t)=>e5(rD(e))===t,Ct=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},Cr=(e,t)=>{if(!tS(e=rD(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(tS(e=rD(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&!(!Ce(e.arguments[0],"&")||n9(e.callee.object,t)||(n=eF(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!!tS(e=rD(e),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&!!os(rD(e.callee.object),t)&&!!Ce(e.arguments[0],"=")&&(1===e.arguments.length||2===(n=e.arguments[1],eF(n,r.sourceCode.getScope(n))?.value))})(o.returnExpression,o.parameter,t))return{node:e,query:r.callee.object}},Cn=(e,t)=>`new URLSearchParams(${Ct(e,t)})`,Co=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=e1(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},Ca=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=e1(t,r);return[[n,a],[i,o]]},Ci=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=ep(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>v4(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return v5.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||rI(n,e,r)))return[{messageId:v9,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:v6,suggest:a}},Cs="no-unsafe-promise-all-settled-values",Cl=new Set(["PromiseSettledResult","PromiseRejectedResult"]),Cu=new Set(["PromiseFulfilledResult"]),Cp=new Set(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),Cc=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",Cd=e=>{for(;e&&Cp.has(e.type);)e=e.expression;return e},Cm=e=>tS(Cd(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),Cf=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,Cg=e=>tS(Cd(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1});function Cy(e){return"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?Cy(e.right):void 0}function Ch(e){for(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e;e?.type==="TSParenthesizedType"||e?.type==="TSTypeOperator";)e=e.typeAnnotation;return e?.type==="TSArrayType"?e.elementType:e?.type==="TSTypeReference"&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?e.typeArguments?.params[0]??e.typeParameters?.params[0]:void 0}function Cx(e){return function e(t){if(t?.type==="TSTypeReference"){let e=Cy(t.typeName);return Cl.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(Ch(e))}function Cb(e){return function e(t){if(t?.type==="TSTypeReference"){let e=Cy(t.typeName);return Cu.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(Ch(e))}function CE(e){if(e.isUnion())return e.types.every(e=>CE(e));let t=e.aliasSymbol??e.getSymbol();return Cu.has(t?.getName())}function CS(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>CS(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function Cv(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let CC=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function CD(e,t,r=new Set){var n;let o;return!!(CC(o=e)&&Cx(o.typeAnnotation))||!!(e=Cd(e))&&(n=Cd(n=e),!!(n?.type==="AwaitExpression"&&Cm(n.argument)||Cx(e.typeAnnotation)||function(e,t){let r=Cv(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=CS(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return Cl.has(r?.getName())}(a))}(e,t))||(Cg(e)?CD(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=ep(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(Cx(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&CD(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let CT=e=>(e=Cd(e),e?.type==="Identifier"?e.name:void 0),CA=e=>{if(e=Cd(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===eR(t)&&"Identifier"===t.value.type)return t.value}},Cw=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function Ck(e,t){return e=Cd(e),!!(t.statusVariable&&CM(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&CM(e.object,t.entryVariable,t.context)&&"status"===eR(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&CT(e.object)===t.entryName&&"status"===eR(e))}function CI(e,t){if(e=Cd(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=Ck(e.left,t)?Cw(e.right):Ck(e.right,t)?Cw(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function Cj(e,t){return"fulfilled"===CI(e=Cd(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(Cj(e.left,t)||Cj(e.right,t))}function CF(e,t){return"unfulfilled"===CI(e=Cd(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(CF(e.left,t)||CF(e.right,t))}let CB=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&Cj(e.test,r)||e.alternate===t&&CF(e.test,r)),CR=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&Cj(e.left,r)||"||"===e.operator&&e.right===t&&CF(e.left,r)),CP=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&Cj(e.test,r)||e.alternate===t&&CF(e.test,r)),CL=e=>{let t;if(!Cc(e)||0===e.params.length)return!1;let r={entryName:CT(e.params[0]),statusName:(t=e.params[0],CA(t)?.name)},n=Cd(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&Cj(e.argument,r)}return Cj(n,r)};function CN(e){if(e=Cd(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===eR(t))return t}}let C$=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function CM(e,t,r){return e=Cd(e),e?.type==="Identifier"&&t&&ep(r.sourceCode.getScope(e),e)===t}function CO(e){for(e=Cd(e);Cg(e);){if(CL(e.arguments[0]))return!0;e=Cd(e.callee.object)}return!1}function CU(e,t,{knownPromiseSettledResultArray:r=!1}={}){let n,o;if(!tS(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!CD(e.callee.object,t)||function e(t,r,n=new Set){return!!(CC(t)&&Cb(t.typeAnnotation)||function(e,t){let r=Cv(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=CS(n,o);return!!(a&&CE(a))}(t=Cd(t),r))||("Identifier"===t.type?function(t,r,n){let o=ep(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(Cb(a.name?.typeAnnotation)||"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&e(a.node.init,r,n));return n.delete(o),i}(t,r,n):Cg(t)&&CO(t)&&CD(t,r))}(e.callee.object,t))return;let[a]=e.arguments;if(!Cc(a)||0===a.params.length)return;let[i]=a.params;if(function(e,t){let r=Cv(e,t);if(!r)return!1;let{type:n}=r;return CE(n)}(i,t))return;let s=CN(i);if(s&&"Identifier"!==s.value.type)return{node:s.key,messageId:Cs};let l=CT(i),u=l&&ep(t.sourceCode.getScope(i),i),p=(n=CN(i),o=n?.value,o?.type==="Identifier"?o:o?.type==="AssignmentPattern"&&"Identifier"===o.left.type?o.left:void 0),c=p&&ep(t.sourceCode.getScope(p),p),d=CA(i),m=d?.name,f=d&&ep(t.sourceCode.getScope(d),d),g=function e(t,r){var n;if(n=t=Cd(t),n=Cd(n),(n?.type==="MemberExpression"&&CM(n.object,r.entryVariable,r.context)&&"value"===eR(n)||n?.type==="Identifier"&&CM(n,r.valueVariable,r.context))&&!function(e,t){for(let r=e,n=e.parent;n&&"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type;r=n,n=n.parent){if(CB(n,r,t)||CR(n,r,t)||CP(n,r,t)||function(e,t){let r=e.parent?.body;if(!Array.isArray(r))return!1;let n=r.indexOf(e),o=r[n-1];return o?.type==="IfStatement"&&!o.alternate&&CF(o.test,t)&&function e(t){return t=Cd(t),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||t?.type==="BlockStatement"&&t.body.length>0&&e(t.body.at(-1))}(o.consequent)}(n,t))return!0;if(Cf(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||C$(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||Cc(n)||"ClassExpression"===n.type||"ClassDeclaration"===n.type)continue;let t=e(n,r);if(t)return t}}(Array.isArray(o)?o:[o],r);if(a)return a}}(a.body,{entryName:l,entryVariable:u,statusName:m,statusVariable:f,valueVariable:c,context:t});if(g)return{node:g,messageId:Cs}}let Cq="prefer-abort-signal-any",CW="prefer-abort-signal-any/suggestion",CV=new Set(["reason","throwIfAborted"]),C_=new Set(["capture","once","passive"]),Cz=new Set(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),CK=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]},CG=(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})},CJ=e=>{let t=e,{parent:r}=e;for(;rC(r);)t=r,r=r.parent;return{expression:t,parent:r}},CX=(e,t)=>{let{parent:r}=e;if(!(!tb(r,{property:"signal",computed:!1,optional:!1})||r.object!==e||nI(r)||("ForInStatement"===r.parent.type||"ForOfStatement"===r.parent.type)&&r.parent.left===r||((e,t)=>{let{expression:r,parent:n}=CJ(e);return tb(n)&&n.object===r&&CV.has(eR(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{expression:t,parent:r}=CJ(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(r)||rF(t,t.sourceCode.getRange(r))))return r},CY=(e,t,r)=>{if(rJ.has(e.intrinsicName))return;if(rX.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!rX.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>CY(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>CY(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return CY(n,t,r);let o=rY(e);if(o&&rH(o,r))return"AbortSignal"===o.getName();let a=rQ(e,t).map(e=>CY(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},CH=(e,t)=>ts(e,{optional:!1},to)&&tb(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),CQ=e=>CH(e,["any","timeout"]),CZ=e=>CH(e,["any"]),C0=(e,t)=>{if("Identifier"!==(e=rD(e)).type)return;let r=ep(t.sourceCode.getScope(e),e),n=r?.defs[0];if(r&&1===r.defs.length&&"Variable"===n.type&&"const"===n.parent.kind)return n.node.init},C1=(e,t)=>{if("Identifier"!==(e=rD(e)).type)return!1;let r=ep(t.sourceCode.getScope(e),e),n=r?.defs[0];if(!r||1!==r.defs.length||"Variable"!==n.type||"const"!==n.parent.kind||!n.node.init)return!1;let[,o]=t.sourceCode.getRange(n.node.init),[a]=t.sourceCode.getRange(e);return r.references.some(r=>{if(r.init||r.identifier===e)return!1;let[n]=t.sourceCode.getRange(r.identifier);return n>o&&n<a})},C2=(e,t,r)=>ts(e,{optional:!1},to)&&tb(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&ol(e.callee.object,r),C3=(e,t)=>(ts(e,{name:"Array",optional:!1},to)||tl(e,{name:"Array"}))&&ol(e.callee,t),C8=(e,t,r=new Set)=>{if(e=rD(e),r.has(e))return!1;if(r.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&C8(e,t,r));if(C2(e,"of",t)||C3(e,t))return e.arguments.some(e=>C8(e,t,r));if(C2(e,"from",t)){if(1!==e.arguments.length)return!0;let[n]=e.arguments;if("SpreadElement"===n.type)return!0;let o=C0(n,t);if(o)return!!(!nf(o,t)||C1(n,t))||C8(o,t,r);let a=rD(n);return"ArrayExpression"!==a.type||C8(a,t,r)}if(CZ(e))return e.arguments[0]&&C8(e.arguments[0],t,r);let n=C0(e,t);return n?!!(nf(n,t)&&C1(e,t))||C8(n,t,r):CH(rD(e),["abort"])},C6=(e,t,r,n=new Set)=>{var o;if(e=rD(e),n.has(e))return!1;if(n.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&C6(e,t,r,n));if(C2(e,"of",r)||C3(e,r))return e.arguments.some(e=>C6(e,t,r,n));if(C2(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=C0(o,r);if(a)return!!(!nf(a,r)||C1(o,r))||C6(a,t,r,n);let i=rD(o);return"ArrayExpression"!==i.type||C6(i,t,r,n)}if(CZ(e))return e.arguments[0]&&C6(e.arguments[0],t,r,n);let a=C0(e,r);return a?!!(nf(a,r)&&C1(e,r))||C6(a,t,r,n):tb(o=rD(o=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===o.object.type&&o.object.name===t},C9=(e,t)=>{let r=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return CY(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e=rD(e),t);if(!0===r)return!0;if(!1===r||t.sourceCode.parserServices?.program)return!1;if("Identifier"===e.type){let t;return"signal"===(t=e.name)||t.endsWith("Signal")}return CQ(e)},C5=(e,t)=>"Identifier"===(e=rD(e)).type?C9(e,t):CQ(e)&&e.arguments.every(e=>"SpreadElement"!==e.type&&!eO(e,t.sourceCode)),C4=(e,t)=>{if(!C2(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rD(r);if("ArrayExpression"===n.type)return n;let o=C0(r,t);if(o&&nf(o,t)&&!C1(r,t))return o},C7=(e,t,r=new Set)=>{if(e=rD(e),r.has(e))return;if(r.add(e),"ArrayExpression"===e.type)return e.elements.every(e=>e&&"SpreadElement"!==e.type)?e.elements:void 0;if(C2(e,"of",t)||C3(e,t))return e.arguments.every(e=>"SpreadElement"!==e.type)?e.arguments:void 0;let n=C4(e,t);if(n)return C7(n,t,r);let o=C0(e,t);if(o&&nf(o,t)&&!C1(e,t))return C7(o,t,r)},De=(e,t,r=new Set)=>{if(e=rD(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||C2(e,"of",t)||C3(e,t))return!0;let n=C4(e,t);return!!n&&De(n,t,r)},Dt=e=>"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?Dt(e.right):void 0,Dr=(e,t,r=new Set)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Dr(e.typeAnnotation,t,r);if(e?.type!=="TSTypeReference")return!1;var n=e;let o=Dt(n.typeName);if("AbortSignal"===o)return!0;if(!o||"Identifier"!==n.typeName.type||r.has(n.typeName.name))return!1;r.add(n.typeName.name);let a=ep(t.sourceCode.getScope(n),n.typeName),i=a?.defs[0],s=i?.type==="Type"&&"TSTypeAliasDeclaration"===i.node.type&&Dr(i.node.typeAnnotation,t,r);return r.delete(n.typeName.name),s},Dn=(e,t,r=new Set)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")?Dn(e.typeAnnotation,t,r):e?.type==="TSTypeOperator"?"readonly"===e.operator?Dn(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?Dr(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>Dr("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=Dt(e.typeName),a=e.typeArguments?.params??e.typeParameters?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return Dr(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=ep(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=Dn(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,Do=(e,t,r=new Set)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Do(e.typeAnnotation,t,r);if(e?.type==="TSTypeOperator")return"readonly"===e.operator&&("TSArrayType"===e.typeAnnotation.type||"TSTupleType"===e.typeAnnotation.type);if(e?.type!=="TSTypeReference")return!1;if("ReadonlyArray"===Dt(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=ep(t.sourceCode.getScope(e),e.typeName),o=n?.defs[0];return o?.type==="Type"&&"TSTypeAliasDeclaration"===o.node.type&&Do(o.node.typeAnnotation,t,r)},Da=(e,t,r,n=new Set)=>{if(!e||rJ.has(e.intrinsicName)||rX.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>Da(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Da(o,t,r,n);let a=rY(e);if(a&&rH(a,r)&&"ReadonlyArray"===a.getName())return!0;let i=t.typeToString(e);return!!(i.startsWith("readonly ")||i.startsWith("ReadonlyArray<"))||rQ(e,t).some(e=>Da(e,t,r,n))},Di=(e,t)=>{if(Cz.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===Dt(r.typeName)||Do(e.typeAnnotation,t)||Di(e.expression,t)}if("Identifier"!==(e=rD(e)).type)return!1;let r=ep(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&Do(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&Di(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return Da(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},Ds=(e,t,r=new Set)=>{if(r.has(e))return!1;if(r.add(e),Cz.has(e.type))return Dn(e.typeAnnotation,t)??Ds(e.expression,t,r);if("Identifier"===(e=rD(e)).type){let n=ep(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=Dn(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&Ds(o.node.init,t,r))return!0}return nf(e,t)},Dl=(e,t,r,n)=>{var o,a;let i,s=!e||"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||e.params.length>0?void 0:"BlockStatement"!==e.body.type?e.body:1===e.body.body.length&&"ExpressionStatement"===e.body.body[0].type?e.body.body[0].expression:void 0;if(ts(s,{optional:!1},to)&&tb(s.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===s.callee.object.type&&s.callee.object.name===t&&(0===s.arguments.length||1===s.arguments.length&&(i=s.arguments[0],tb(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rD(o),a=rD(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&ep(n.sourceCode.getScope(o),o)===ep(n.sourceCode.getScope(a),a)))))return s.callee.object},Du=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(ts(r,{minimumArguments:2,maximumArguments:3,optional:!1},to)&&tb(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===e5(rD(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rD(t)).type&&"boolean"==typeof t.value||"ObjectExpression"===t.type&&t.properties.every(e=>{if("Property"!==e.type||e.computed||"init"!==e.kind||e.method||e.shorthand||"Literal"!==e.value.type||"boolean"!=typeof e.value.value)return!1;let t="Identifier"===e.key.type?e.key.name:e.key.value;return C_.has(t)})))return{call:r,sourceSignal:r.callee.object}},Dp=(e,t)=>!rF(t,t.sourceCode.getRange(e))&&!rj(t,e),Dc=(e,t,r,n)=>{let o=ep(n.sourceCode.getScope(r),e);return o&&o!==t},Dd="prefer-block-statement-over-iife",Dm=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,Df=(e,t)=>e!==t&&tg(e),Dg=(e,t)=>Df(e,t)&&"ArrowFunctionExpression"!==e.type;function Dy(e,t,r,n=Df){return function o(a){if(r(a))return!0;if(n(a,e))return!1;for(let e of t[a.type]??[]){let t=a[e];for(let e of Array.isArray(t)?t:[t])if(e?.type&&o(e))return!0}return!1}(e)}let Dh=(e,t)=>{let[r,n]=t.getRange(e),o=t.getLastToken(e);return[r,ef(o)?t.getRange(o)[1]:n]},Dx="no-multiple-promise-resolver-calls",Db=e=>rC(e)||e?.type==="TSInstantiationExpression";function DE(e){for(;Db(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function DS(e){for(;Db(e);)e=e.expression;return e}let Dv=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=DE(e);return tl(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&ol(r.parent.callee,t)},DC=e=>e.references.some(e=>e.isWrite()),DD=({resolverUncalled:e=!1,resolverCalled:t=!1,catchClausesAfterResolverCall:r=new Set,pendingFinallyBlocksByCatchClause:n=new Map}={})=>({resolverUncalled:e,resolverCalled:t,catchClausesAfterResolverCall:r,pendingFinallyBlocksByCatchClause:n}),DT=e=>DD({resolverUncalled:e.resolverUncalled,resolverCalled:e.resolverCalled,catchClausesAfterResolverCall:new Set(e.catchClausesAfterResolverCall),pendingFinallyBlocksByCatchClause:function(e){let t=new Map;for(let[r,n]of e)t.set(r,new Set(n));return t}(e.pendingFinallyBlocksByCatchClause)}),DA=(e,t,r)=>{if(t.executor===r){let r=DT(e);for(let[e,n]of r.pendingFinallyBlocksByCatchClause)t.finallyBlocks.some(e=>n.has(e))&&r.catchClausesAfterResolverCall.add(e);return r.resolverCalled=e.resolverUncalled||e.resolverCalled,r.resolverUncalled=!1,r}if(t.executor)return e;let n=DT(e);if(t.catchClause){if(e.resolverUncalled){let e=n.pendingFinallyBlocksByCatchClause.get(t.catchClause);for(let r of(e||(e=new Set,n.pendingFinallyBlocksByCatchClause.set(t.catchClause,e)),t.finallyBlocks))e.add(r)}e.resolverCalled&&n.catchClausesAfterResolverCall.add(t.catchClause)}return n};function Dw(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let Dk=(e,t)=>void 0!==t&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&Dw(e.catchClausesAfterResolverCall,t.catchClausesAfterResolverCall)&&function(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||!Dw(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function DI(e,t,r){let n=DD({resolverUncalled:e===r.codePath.initialSegment});for(let o of e.prevSegments){let a=function(e,t,r,n){if(!t.reachable||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return DD();let o=n.catchClausesBySegment.get(r);return o?DD({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(o)??DD(),o,e,r);for(let e of(n.resolverUncalled||=a.resolverUncalled,n.resolverCalled||=a.resolverCalled,a.catchClausesAfterResolverCall))n.catchClausesAfterResolverCall.add(e);for(let[e,t]of a.pendingFinallyBlocksByCatchClause){let r=n.pendingFinallyBlocksByCatchClause.get(e);for(let o of(r||(r=new Set,n.pendingFinallyBlocksByCatchClause.set(e,r)),t))r.add(o)}}return n}let Dj=e=>{let t=DS(e.test);return t?.type==="Literal"&&!t.value},DF=e=>{let t=DE(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t},DB="no-unnecessary-string-trim",DR=["startsWith","endsWith"],DP=new Set(["bigint","boolean","number","string","undefined"]),DL=new Set(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),DN=(e,t)=>eF(e=rD(e),t.sourceCode.getScope(e)),D$="no-useless-re-export",DM=e=>"Identifier"===e.type?e.name:e.value;function DO(e,t){let r=e.attributes??[];return`${e.source.value}\u0000${r.map(e=>t.getText(e)).join("\0")}`}let DU={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return DU}},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 DU}},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"]}},recommended:{...i.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return DU}},rules:{...i.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 DU}},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",{preferThis:!1,preferSuper:!1}],"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","sukka/unicorn/no-unsafe-promise-all-settled-values":"error","sukka/unicorn/prefer-abort-signal-any":"warn","sukka/unicorn/prefer-block-statement-over-iife":"warn","sukka/unicorn/no-multiple-promise-resolver-calls":"error","sukka/unicorn/no-unnecessary-string-trim":"warn","sukka/unicorn/no-useless-re-export":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return DU}},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:{...i.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return DU}},rules:{...i.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:{...i.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return DU}}}},rules:Object.assign(i.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":I,"browser/prefer-location-assign":F,"jsx/no-template-literal":R,"jsx/no-unneeded-nested":P,"string/no-locale-case":N,"string/no-simple-template-literal":$,"unicode/no-bidi":_,"unicode/no-invisible":K,"no-redundant-variable":G,"no-single-return":X,"prefer-early-return":H,"prefer-fetch":Q,"prefer-timer-id":et,"string/no-unneeded-to-string":er,"type/no-force-cast-via-top-type":en,"type/no-wrapper-type-reference":ea,"no-default-error":ei},Object.fromEntries(Object.entries({"unicorn/catch-error-name":cO,"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>c5(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return c5(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||!cX(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:cU,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[cU]:"Exported error name should match error class",[cq]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[cW]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[cV]:"Error constructors should accept `options` as the second parameter.",[c_]:"Error constructors should use `options` as the second parameter.",[cz]:"Pass the error message to `super()` as the first argument.",[cK]:"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||e3(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:o7}:void 0:{node:t,messageId:ae,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[o7]:"Do not nest ternary expressions.",[ae]:"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!!(ar.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)&&an(e.parent.parent)&&ao(e.parent.parent.parent.init))||!!(an(e)&&tb(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&ao(e.parent.init.object))}(ep(r,t)?.defs[0]?.name))return{node:t,messageId:at}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[at]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(al.has(t.name)){for(let r of am(e,t))if(r.references?.some(e=>ad(t,e.identifier)))return af(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&al.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 am(e,t))if(ay(t.key,r))return af(t.key,r);for(let r of am(e,t))if(ag(t.key,r))return af(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[ai]:"Use `.key` instead of `.{{name}}`.",[as]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tb(t,{property:"innerText"})||nw(t.object,e))return;let r=t.property;return{node:r,messageId:ah,suggest:[{messageId:ax,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(nw(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&nw(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&nw(r.right,t)})(t.parent.parent,e))return{node:t,messageId:ah,suggest:[{messageId:ax,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:{[ah]:"Prefer `.textContent` over `.innerText`.",[ax]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tS(t,{method:"join",argumentsLength:0,optionalCall:!1})||tS(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tI(t.callee.object,{property:"join"}))||0===t.arguments.length&&nh(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:aM,fix:r=>aE(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[aM]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of a_)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:{[aO]:"Do not add `then` to an object.",[aU]:"Do not export `then`.",[aq]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tS(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||tS(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:eS(r,e.sourceCode),messageId:az}:{node:r.callee.property,messageId:az}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[az]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":aZ,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tl(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(nM(r,t))return"alloc";let n=eF(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:a0,data:{method:n},fix:a3(r,e,n)}:{node:r,messageId:a1,suggest:["from","alloc"].map(t=>({messageId:a2,data:{replacement:t},fix:a3(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:{[a0]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[a1]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[a2]:"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:o2(l,e),messageId:a8,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tS(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(!e6(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&a6(o)&&(yield r(i,n,"leading")),e!==a-1&&a9(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:{[a8]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":a4,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(td(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:a7,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=e3(i,e),[,l]=s?e1(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield ab(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[a7]:"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&&tb(e.left,{property:"length",optional:!1})&&tj(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("CallExpression",t=>{tS(t,{optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===t.callee.property.type&&!ng(t.callee.object,e)&&("some"===t.callee.property.name?o.add(t):"every"===t.callee.property.name&&a.add(t))}),e.on("LogicalExpression",e=>{tj(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)&&ry(e.left.object,t.callee.object))||"&&"===t&&n.has(e)&&i.some(t=>o.has(t)&&ry(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=e1(n,e),i=e1(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=>{let{expression:r,parent:n}=ie(t);if(!(tS(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===n.type&&n.body===r||"ReturnStatement"===n.type&&n.argument===r||"YieldExpression"===n.type&&!n.delegate&&n.argument===r)))return;let{functionNode:o,isInTryStatement:a}=function(e){let t,r=!1;for(;e;e=e.parent){if(tg(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(o&&(o.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}(o)))return function(e,t){let{callee:r}=e,n=r.property.name,{parent:o}=ie(e);return{node:r,messageId:n,data:{type:"YieldExpression"===o.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,arguments:o}=e,{expression:a,parent:i,isAwaited:s}=ie(e),[l]=o;if(l?.type==="SpreadElement")return;let u="reject"===n.property.name,p="YieldExpression"===i.type;if(u&&(t||p&&"ExpressionStatement"!==i.parent.type))return;let c=function({callExpression:e,parent:t,expression:r,isAwaited:n,isReject:o,context:a}){return n&&!o?e1(e,a):o&&"YieldExpression"===t.type?e1(t,a):"ArrowFunctionExpression"===t.type?o?e1(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!rI(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=it(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(e1(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(e1(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(e1(e,r),(n=it(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>oV(c)?`(${n})`:n))}p?o=`yield${o?" ":""}${o}`:"ReturnStatement"===i.type?o=`return${o?" ":""}${o};`:(l?.type==="ObjectExpression"&&(o=`(${o})`),o||="{}")}return t.replaceText(n?e:i,o)}}(t,a,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(!e4(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:o2([p-(r.length-s.length),p],e),messageId:l?io:ir,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&oz.test(s)&&!e3(t,e)&&(n=`(${n})`,oh(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield ak(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[ir]:"Don't use a zero fraction in the number.",[io]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":im,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tf,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&&ih.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&&ix(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&ix(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:eS(t,n),messageId:ig,data:{functionNameWithKind:eP(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:{[ig]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){iC.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[iv]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":iw,"unicorn/prefer-array-index-of":iP,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tS(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:iL,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:{[iL]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(tS(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&iO(e.callee.object)){let t=e.callee.property;return iU(e,{node:t,messageId:i$,data:{method:t.name}})}if(ts(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1},to)&&iO(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?iU(e,{messageId:iM}):iU(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&iO(t.argument))return iU("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&iO(e.right))return iU(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])iO(t)&&(yield iU(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[iN]:"Prefer `Date.now()` over `new Date()`.",[i$]:"Prefer `Date.now()` over `Date#{{method}}()`.",[iM]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":iY,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tS(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=i3(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&ry(e.left,e.right)||"**"===e.operator&&e8(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:iH,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 a$(t,",",a,e),yield ab(r,a,e)}for(let t of r)yield a.removeRange([e1(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 i2){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:{[iH]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":i9,"unicorn/prefer-number-properties":sr,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tS(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"===eR(e.callee)&&2===e.arguments.length&&so(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,sa(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===eR(e.callee)&&"apply"===eR(e.callee.object)&&"prototype"===eR(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&so(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,sa(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:sn,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[sn]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tb(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:tS(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&nv(n,e))return{node:t.property,messageId:si,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 ak(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[si]:"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(!tS(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tS(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(n9(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=e5(o);if("string"==typeof i){if(0===i.length)return;r=tU(i)}else if(!(r=(e=>{if(!e7(e)||e.regex.flags.includes("y"))return;let t=sS(e);if(!t||sD(t)||0===sC(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=e5(a);if("string"==typeof s)return`${e2(n.callee.object,t)}.replaceAll(${r}, ${tU(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:sf,fix:e=>e.replaceText(t,o)};if(!tS(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tS(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&e7(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||!sp.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&e6(n=t.arguments[1])&&n.value===su)return;let{arguments:a,callee:{property:i}}=t;if(n9(t.callee.object,e))return;let[s]=a;if(!((e,t)=>{if(e7(e))return e.regex.flags.includes("g");if(tl(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=eF(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(!e7(e))return;let t=sS(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(sg.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?sE(t.body):sb(t);if(n)return"'"+n+"'"}(s);if("replaceAll"===l){if(!u)return;return{node:s,messageId:sm,data:{replacement:u.length<20?u:"a string literal"},fix:e=>e.replaceText(s,u)}}return{node:i,messageId:sd,*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:{[sd]:"Prefer `String#replaceAll()` over `String#replace()`.",[sm]:"This pattern can be replaced with {{replacement}}.",[sf]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tS(t,{methods:["substr","substring"]})||n9(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tS(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(sT(t)&&sT(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&e8(e.right,1))return e.left})(t);return sA(r,t)??(sA(t,r)?r:void 0)??(n&&ry(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=eF(a,s.getScope(e)),u=e1(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(e4(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!sk(e.left)||!("Identifier"===t.type||e6(t))||!ry(e.left.object,t)||(o=((e,t)=>{let[r,n]=e1(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 av(t,i,n,r));if(e4(i)||sk(i))return;let o=sw(i);return"number"==typeof o?void(yield av(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>e4(e))){let e;return void(yield(e=String(a.value+i.value),av(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?sw(o):void 0;if(!a){if(sk(o))return;if(void 0!==i)return void(yield av(t,o,String(Math.max(0,i)),r));let e=e1(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=sw(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 av(t,o,String(e[0]),r)),e[1]!==s&&(yield av(t,a,String(e[1]),r));return}if(0===i||0===s){let e=e2(o,r),n=e2(a,r);yield av(t,o,"0",r),yield av(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(!tS(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||n9(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:sI,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:{[sI]:"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||!e3(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:o2(e1(r,e),e),messageId:sj};return!function(e,t){let{sourceCode:r}=t,[n,o]=e1(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:sF,fix:t=>t.replaceTextRange(e1(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[sj]:"IIFE with parenthesized arrow function body is considered unreadable.",[sF]:"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||r_(r))&&("Identifier"===r.type&&sR.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&sR.test(r.property.name))&&!tb(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:sB,fix:r=>aI(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[sB]:"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(e6(e))return sM({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(e7(e))return sM({node:e,original:e.raw,regex:s$,lowercase:t})}),e.on("TemplateElement",r=>{if(!tw(r.parent))return sM({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>aN(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:{[sP]:"Use uppercase characters for the value of the escape sequence.",[sL]:"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=>e6(e)?sZ(e,e.raw):e7(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}=sQ(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(sq,t))return;let n=t+sq.length;for(;r=e[n],sW.test(r);)n++;if(n===t+sq.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+sq.length,n),16);if(!(o>1114111))return o}(e,t)&&sK(e,t))return!0;return!1}(n);if(!i&&(s||!l))return;let u=`/${i?a:n}/${s0(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,s0(o))?{node:e,messageId:sO}:{node:e,messageId:sO,suggest:[{messageId:sU,fix:t=>t.replaceText(e,u)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tw(t.parent))return sZ(t,t.value.raw,(r,n)=>aN(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.",[sU]:"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 eX(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(s1.map(e=>[e,{[eX.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tS(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tS(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(!tb(e,{optional:!1}))return;let n=e.object;if(tc(n)||td(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eR(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(tb(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield ak(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(!(ts(t,{names:s2,optional:!1},ti)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=s9.has(r)?s9.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:s3,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:s6};let i=eF(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:s6}:""===s?{node:a,messageId:s8}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[s3]:"Pass a message to the `{{constructorName}}` constructor.",[s8]:"Error message should not be an empty string.",[s6]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":la,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(tl(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&lm(t.test)))return;let r=e.argument.callee;return{node:r,messageId:li,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[li]:"`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=rD(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?ep(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?lh(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&&ep(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?lh(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let s=e=>{let n,a;if((a=e).computed||ts(a.parent,void 0,ti)&&a.parent.callee===a||"TaggedTemplateExpression"===a.parent.type&&a.parent.tag===a||nI(a))return;let i=rD(e.object),s=r.get(t.getText(i));if(!s)return;let l=t.getScope(e),u="Identifier"===i.type?i:void 0,p=u&&ep(l,u),c="ThisExpression"===i.type?lh(i):void 0,d=t.getText(e.property);for(let r of s.toReversed())if(lE({declaration:r,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:o,sourceCode:t})&&(n=lb(r.objectPattern.properties.filter(e=>lx(e)&&"Identifier"===e.value.type),d,l,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!lC(n);){if(lv(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:lf};let m=t.getText(e),f=n.value.name;return{node:e,messageId:lf,suggest:[{messageId:lg,data:{expression:m,property:f},fix:t=>t.replaceText(e,f)}]}};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:{[lf]:"Use destructured variables over properties.",[lg]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{lI.listen({context:e}),lj.listen({context:e}),lF.listen({context:e}),lB.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.",[lA]:"Use `String(new Date())` instead of `Date()`.",[lw]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":lM,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tS(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tD(e)&&lU(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&lU(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tS(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(!!lY(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:lJ,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(lY(e)&&(e.typeAnnotation||e.value&&p.getText(e.value).includes("this")))return;return function*(n){let a=p.getFirstToken(e);if(t$(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 aT(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);t$(o,{expected:{type:"Keyword",value:"static"},ruleId:"no-static-only-class"}),yield r.remove(o),yield aT(o,t,r);let a=lY(e)?n.getLastToken(e):n.getTokenAfter(e),i=ef(a);if(lY(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,lX);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:{[lJ]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":lZ,"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)||ts(r.parent.parent,void 0,ti)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:l0,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:ur[a]}};return"NewExpression"===a&&ut(r)&&tl(n.parent,{names:l4,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield ab(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),em(u)&&(yield i.remove(u)),tc(r)||td(r)){let e=t.getTokenAfter(n);em(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 em(e)?e:void 0}let a=t.getTokenAfter(e||s,em);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(!tS(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:l6};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:l5,fix:t=>t.replaceText(r,r.properties.map(t=>e2(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tl(e,{names:l4,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:l8,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!ut(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tl(r,{names:l4,argumentsLength:1})||tl(r,{names:rG,minimumArguments:1})||tS(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tS(r,{objects:["Array",...rG],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tS(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=l1;switch(r.type){case"ForOfStatement":o=l2;break;case"YieldExpression":o=l3;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=>un(r,t,e)}}),e.on("ArrayExpression",t=>{if(!ut(t))return;let r=t.elements[0].argument,n=!!tS(r,{methods:ue,optionalCall:!1,optionalMember:!1})&&nf(r.callee.object,e)&&nf(r,e);if(!n&&!(!ng(r,e)&&(tS(r,{methods:l7,optionalCall:!1,optionalMember:!1})?!uo(r,e):tS(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||uo(r,e)):tS(r,{method:"split",optionalCall:!1,optionalMember:!1})||tS(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tS(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tS(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tl(r,{name:"Array"}))))return;let o={node:t,messageId:l9};return tl(r,{name:"Array"})||tS(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>un(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[l0]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[l1]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[l2]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[l3]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[l8]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[l6]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[l9]:"Unnecessarily cloning an array.",[l5]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=rO(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(!us(o))break;t&&ul(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,eg);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:ua,suggest:[{messageId:ui,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[ua]:"Useless case in switch statement.",[ui]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":uk,"unicorn/numeric-separators-style":uB,"unicorn/prefer-array-find":uZ,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tS(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)&&tS(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tA(r.callee.object,u3)||nh(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=rI(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield aB(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:u0,fix:a}}),e.on("CallExpression",t=>{let r;if(!tS(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tS(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||r_(n.callee.object)||ng(n.callee.object,e))return;let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let[a]=n.arguments,[i]=t.arguments;if(!u6(a)||!u6(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!os(s,l))return;let u=function(e,t){if(e3(e,t))return e2(e,t);let r=t.sourceCode.getText(e);return oG(e,t)?`(${r})`:r}(n.callee.object,e),p=o.getText(s),c=function(e,t){if(e3(e,t))return e2(e,t);let r=t.sourceCode.getText(e);return u8.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return{node:t.callee.property,messageId:u1,suggest:[{messageId:u2,fix:e=>e.replaceText(t,`${u}.flatMap(${p} => ${c} ? ${d} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[u0]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[u1]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[u2]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":po,"unicorn/prefer-array-some":pl,"unicorn/prefer-code-point":{create:e=>{e.on("CallExpression",e=>{if(tS(e,{method:"charCodeAt",optionalCall:!1}))return pu(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 pp.has(r.operator);case"UnaryExpression":return pc.has(r.operator);case"AssignmentExpression":return r.right===t&&pp.has(r.operator.slice(0,-1));default:return!1}})(e))}),e.on("MemberExpression",e=>{if(tb(e,{object:"String",property:"fromCharCode",optional:!1}))return pu(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=ep(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(pg(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:pd,suggest:[{messageId:pm,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(tf,e=>{r.push(e)}),e.onExit(tf,()=>{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:{[pd]:"Prefer default parameters over reassignment.",[pm]:"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=pT(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=pT(e.left),o=pT(e.right);if(n&&o&&pv(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&pA(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&pA(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&&pv(i,o,t.sourceCode))return pC({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&pv(i,n,t.sourceCode))return pC({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tk(s)||!tb(l)||l.optional||!ry(rD(i),rD(l.object))||function(e){let t=e,{parent:r}=t;for(;rC(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=rN(e,t);if(rF(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:ph,suggest:[{messageId:pb,fix(r){let n=u;return oh(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(pv(n,o,t)?pC({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&pv(n.argument,a,t)?pC({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:{[py]:"Prefer using a logical operator over a ternary.",[ph]:"Prefer using optional chaining over a ternary.",[px]:"Switch to `{{operator}}` operator.",[pb]:"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?pw:pk,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);t$(t,{test:ey,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);t$(o,{test:eh,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:{[pw]:"Remove unused catch binding `{{name}}`.",[pk]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":p8,"unicorn/prefer-set-has":cl,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!e6(t)||function(e){let{parent:t}=e,{type:r}=t;return tu(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)||cu(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=cd(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:cp,*fix(r){yield ak(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)||cd(t)!==e)||cu(t)))return{node:t,messageId:cp,*fix(r){for(let n of(yield ak(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield aN(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tb(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:cc,*fix(r){let n=a.getTokenBefore(t);oh(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||oo(n,t.quasi,e)||e3(t,e)||(yield aD(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||oo(n,t.quasi,e)||e3(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield ab(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:{[cp]:"`String.raw` should be used to avoid escaping `\\`.",[cc]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":cb,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tS(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:cE,fix:r=>aE(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[cE]:"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 cT(cw(e.lines,t)).indent||cT(cS(r=cw(n.split(/\r?\n/)))).indent||cT(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=cS(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:cA,fix:t=>g.split(s).map((r,n)=>aN(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!!(cu(e)||r.tags.length>0&&tw(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tA(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:ck,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[cA]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tS(t,{object:"Promise",methods:l_,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:lq,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tm(t.parent.parent)))return n.fix=r=>r.replaceText(t,lz(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(lK(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&&lG(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&lG(t.left)&&tm(t.parent)?t.left:void 0})(n);if(o){if(lK(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,lz(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&e8(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!lK(r,a))return r=>r.replaceText(a,`await ${lz(e,t)}`)})(t,e),n):(n.suggest=[{messageId:lW,fix:r=>{let[n]=t.arguments[0].elements,o=e2(n,e);return e3(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),oh(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:lV,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),em(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:{[lq]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[lW]:"Use the value directly.",[lV]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(tS(t,{object:"Promise",methods:cF,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:cI,data:{method:t.callee.property.name},suggest:[{messageId:cj,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield aT(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cI]:"Promise in `Promise.{{method}}()` should not be awaited.",[cj]:"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&&cP.has(t.operator)&&cL(n))||cL(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:cB,suggest:[{messageId:cR,data:{operator:i},*fix(s){yield ak(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!e3(t,e)&&(oo(o.getFirstToken(u),l,e)||(yield aD(s,u,e))),yield s.remove(a),oh(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:{[cB]:"Negated expression is not allowed in equality check.",[cR]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){cN(e,{methods:["slice"],messageId:c$})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[c$]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(c7(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&c7(t.parent.parent)&&t.parent.parent.consequent===t.parent||c7(t.parent)&&t.parent.consequent===t))return{node:t,messageId:c4,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,...de(i,r)},l={...e,...de(e,r)},u=da(s,r),p=di(s,t,r),c=dn(dr(da(l,r)),di(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(eE(a)){let t=n.getTokenAfter(e);t&&oh(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?dr(dt(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?dr(dt(s.openingBraceToken,l.ifToken,r)):dr(dt(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?dr(dt(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:dr(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:dr(dn(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=dt(t.closingParenthesisToken,t.openingBraceToken,n),r=dt(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=dt(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:{[c4]:"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(!tS(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!e4(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=rd(t,e);if(!n.commentsExistBetween(o,a))return{node:r,messageId:ds}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[ds]:"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:dl,*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 ab(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=e1(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 ak(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||oo(i,s,e)||e3(t,e)||e3(r,e)?oh(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield aD(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[dl]:"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&&tg(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:du,data:{parameter:t.name}}:{node:r,messageId:dp}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[du]:"Do not use an object literal as default for parameter `{{parameter}}`.",[dp]:"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(dd.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=dm(t.object),!dd.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=dd.get(n),l=t.object.object;if(tc(l)||"slice"===n&&e8(l,"")||"prototype"===dm(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}=dd.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=rD(t);if("BinaryExpression"!==o||"-"!==a||!(e4(n=rD(s))&&n.value>0))return;let l=rD(i);return"MemberExpression"===l.type&&!l.computed&&!l.optional&&"Identifier"===l.property.type&&"length"===l.property.name&&ud(l.object,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:dc,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=e1(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:{[dc]:"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||(tS(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tD(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(dh)&&dg(r)&&dg(`${dh}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:dy,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],dh)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[dy]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tl(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tS(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:dx,fix:t=>aB(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[dx]:"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)&&dE(n.key)&&("get"===n.kind&&(dv(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&&dS(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!dv(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:db,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[db]:"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(!tb(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(dA(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tl(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&&dA(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&&dA(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(dw(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=ep(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;dw(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?dC:dD,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:{[dC]:"Do not construct dirname.",[dD]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tS(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&e8(t.arguments[0],1)))return;let[r]=t.arguments;return{node:r,messageId:dk,fix:t=>aS(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[dk]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){cN(e,{methods:["splice","toSpliced"],messageId:dI})},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:{[dI]:"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&&s2.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))&&tS(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||tb(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=ep(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:dj},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:{[dj]:"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:dF};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 ef(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=rS(n,e),c=`${p}${a} = ${i};
43
+ `,c1=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&&cZ.test(r)},c2=e=>"ExpressionStatement"===e.type&&"CallExpression"===e.expression.type&&tF(e.expression.callee,"super"),c3=(e,t)=>"ExpressionStatement"===e.type&&"AssignmentExpression"===e.expression.type&&"="===e.expression.operator&&tF(e.expression.left,`this.${t}`),c8=(e,t)=>({node:e,message:`The \`name\` property should be set to \`${t}\`.`}),c6=(e,t)=>tn(e?.value)===t,c9=(e,t)=>"MethodDefinition"===e.type&&e.kind===t&&!e.static&&!e.computed&&"Identifier"===e.key.type&&"message"===e.key.name,c5=e=>e?.type==="Identifier"?e:e?.type==="AssignmentPattern"&&"Identifier"===e.left.type?e.left:void 0,c4=e=>c5(e)?.name==="options",c7=(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&&c7(e,t)))return!0;continue}if(c7(n,t))return!0}}return!1},de=e=>{let t=c5(e);return t.typeAnnotation?t.optional?"options?: ErrorOptions":"options: ErrorOptions":"options"},dt=(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])||tP(e))?n.replaceText(o[0],`${r}, options`):n.insertTextAfter(o[0],", options")}},dr=(e,t)=>e?.type==="Identifier"&&e.name===t.name;function*dn(e,t){if(!c1(t)||null===t.id)return;let{name:r}=t.id,n=an(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(c6(s,r))return;let e=a.getRange(t.body);yield{...c8(s?.value??t,r),fix:t=>s?.value?t.replaceText(s.value,`'${r}'`):s?t.replaceText(s,c0(r).trim()):t.insertTextAfterRange([e[0],e[0]+1],c0(r))};return}let l=o.some(e=>c9(e,"get")),u=o.some(e=>c9(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=>c2(e)),p=a.findIndex(e=>c2(e)),c=a.findIndex(e=>c3(e,"message")),d=i||s,m=!1;if(u){let r;if(d&&!(!(r=u.expression.arguments[0])||tP(r)))m=!0,yield{node:u,messageId:cG};else if(i&&!s&&-1!==c)m=!0,yield{node:a[c],messageId:cJ};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=c5(l),f=1===t.value.params.length&&m&&!c4(l),g=f||c4(d);if(0===u.expression.arguments.length){if(c!==p+1||c7(s,n.visitorKeys))return;let[t]=n.getRange(u);yield i.insertTextAfterRange([t,t+6],g?`${e4(s,e)}, options`:e4(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,`, ${de(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=>c3(e,"name"));return a?tn(a.expression.right)!==n?c8(a.expression.right??e,n):void 0:c6(o,n)?void 0:c8(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=c5(a);if(0===o.length||!i)return;let s=r.expression;if(c4(a)){if(!c4(s.arguments[1])){let t={node:s,messageId:cQ};return dr(s.arguments[0],i)||(t.fix=dt(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!==tn(r)&&"ObjectExpression"===n.type&&1===n.properties.length&&"cause"===eO(n.properties[0])})(s,u))return;return{node:a,messageId:cX,fix:function*(r){let{sourceCode:n}=e,o=dt(n,s,p)(r);if(!o)return;let a=t.value.params[0];yield r.insertTextAfter(a,`, ${de(a)}`),yield o}}}if(!c4(l))return{node:l,messageId:cY};if(u&&!dr(s.arguments[0],i)){let t;return{node:s,messageId:cH,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])||tP(r))return e.replaceText(n[0],1===n.length?`${p}, options`:p)})}}if(!c4(s.arguments[1]))return{node:s,messageId:cQ,fix:dt(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 da="no-lonely-if",di=e=>"IfStatement"===e.type&&!e.alternate;function ds(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 dl=(e,t,r)=>r.text.slice(r.getRange(e)[1],r.getRange(t)[0]),du=e=>e.trim()?e:"",dp=(e,t)=>/\s$/u.test(e)&&/^\s/u.test(t)?e+t.trimStart():e+t,dc=(e,t)=>dl(e.ifToken,e.openingParenthesisToken,t),dd=(e,t,r)=>{let n,o=dl(e.openingParenthesisToken,e.closingParenthesisToken,r);return e7(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},dm="no-magic-array-flat-depth",df="no-negated-condition",dg="identifier",dy="non-identifier",dh="prefer-negative-index",dx=new o([["slice",{argumentsIndexes:[0,1],supportObjects:new i(["Array","String","ArrayBuffer",...rZ])}],["subarray",{argumentsIndexes:[0,1],supportObjects:new i(rZ)}],["splice",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["toSpliced",{argumentsIndexes:[0],supportObjects:new i(["Array"])}],["at",{argumentsIndexes:[0],supportObjects:new i(["Array","String",...rZ])}]]),db=e=>{let{type:t,property:r}=e;if("MemberExpression"===t&&"Identifier"===r.type)return r.name};var dE=["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 dv(t){if("string"!=typeof t)throw TypeError("Expected a string");return(e??=new i(dE)).has(t)}let dC="prefer-node-protocol",dD="node:",dS="consistent-date-clone/error",dT="no-accessor-recursion/error",dA=e=>"Identifier"===e.type||"PrivateIdentifier"===e.type,dw=(e,t)=>["type","name"].every(r=>e[r]===t[r]),dk=(e,t)=>"MemberExpression"===e.parent.type&&e.parent.object===e&&!e.parent.computed&&dA(e.parent.property)&&dw(e.parent.property,t.key),dI="error/calculate-dirname",dj="error/calculate-filename";function dF(e,{modules:t,functionName:r,sourceCode:n}){if(!tm(e,{optional:!1,argumentsLength:1},tp))return!1;let o=new i;return function e(t,i){if("MemberExpression"===t.type)return!!("property"===i&&tT(t,{property:r,computed:!1,optional:!1}))&&e(t.object,"module");if("CallExpression"===t.type)return"module"===i&&tw(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=ey(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 dB(e,t){return dF(e,{modules:new i(["url","node:url"]),functionName:"fileURLToPath",sourceCode:t})}function dR(e,t){return dF(e,{modules:new i(["path","node:path"]),functionName:"dirname",sourceCode:t})}let dP="no-unnecessary-array-flat-depth",dL="no-unnecessary-array-splice-count",dN="no-useless-error-capture-stack-trace/error",d$="prefer-class-fields/error",dM="prefer-class-fields/suggestion",dO="prefer-bigint-literals/error",dU="prefer-bigint-literals/suggestion",dq="prefer-classlist-toggle/error",dV="prefer-classlist-toggle/suggestion",dW=e=>tT(e,{property:"classList",computed:!1}),d_=(e,t,r)=>{let n={node:r??e,messageId:dq};return"IfStatement"===e.type||tb(e)||tb(e.parent)?n.fix=t:n.suggest=[{messageId:dV,fix:t}],n},dz=(e,t,r)=>{let{sourceCode:n}=t,o=e4(e,t);return r?(!e7(e,n)&&o2(e,"!")&&(o=`(${o})`),o=`!${o}`):(e7(e,n)||"SequenceExpression"!==e.type||(o=`(${o})`),o)},dK=(e,t)=>tw(e,{methods:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})&&dW(e.callee.object),dG=(e,t)=>rC(e.callee.object,t.callee.object)&&rC(e.arguments[0],t.arguments[0]),dJ=(e,t,r)=>t?("ChainExpression"===e.type&&(e=e.expression),dK(e,["contains"])&&dG(e,r))?e:void 0:"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix?dJ(e.argument,!t,r):void 0,dX="require-module-attributes",dY="error",dH="suggestion/array",dQ="suggestion/object",dZ="suggestion/object-assign",d0="suggestion/set",d1="suggestion/map",d2=(e,t,r)=>{let{sourceCode:n}=r,o=rJ(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 d3(e,t){if(!tf(e,{names:t,maximumArguments:1}))return!1;let[r]=e.arguments;return!r||"ArrayExpression"===r.type}function*d8(e,t,r){let n=!eE(t.sourceCode.getTokenBefore(e));yield aO(e,t,r,n)}function d6(e,t,r,n){let{sourceCode:o}=e,[a,i]=o.getLastTokens(r,2),s=("ArrayExpression"===r.type?r.elements:r.properties).length>0&&!eb(a);return t.insertTextBefore(i,`${s?",":""} ${n}`)}function*d9({context:e,fixer:t,newExpression:r,elementsText:n,nextExpressionStatement:o}){if(rh(r,e)){let[o]=r.arguments;if(o)yield d6(e,t,o,n);else{let{openingParenthesisToken:o}=rh(r,e)?rx(r,e):{};yield t.insertTextAfter(o,`[${n}]`)}}else yield t.insertTextAfter(r,`([${n}])`);yield*d8(o,e,t)}let d5=[{testValue:e=>e?.type==="ArrayExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tw(n,{object:t.name,methods:["push","unshift"],optionalMember:!1,optionalCall:!1})&&n.arguments.length>0&&!d2(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:dY,data:{objectType:"array"}},u="unshift"===s.name,p=o(t,{callExpression:e,isPrepend:u});return e.arguments.some(e=>ez(e,a))?l.suggest=[{messageId:dH,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=rb(e,n,!1);yield o?a.insertTextAfter(e.sourceCode.getFirstToken(t),`${i}, `):d6(e,a,t,i),yield d8(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&&tT(n.left,{object:t.name,optional:!1})))return;let o=n.right,a=n.left,{property:i}=a;if(!d2(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:dY,data:{objectType:"object"}},c=o(t,{assignmentExpression:e,memberExpression:i,property:l,value:s});return i.computed&&ez(l,a)||ez(s,a)?p.suggest=[{messageId:dQ,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=e4(o,e);n.computed&&(s=`[${s}]`);let l=e4(a,e),u=`${s}: ${l},`,[p,c]=e.sourceCode.getLastTokens(t,2),d=t.properties.length>0&&!eb(p);yield i.insertTextBefore(c,`${d?",":""} ${u}`),yield d8(r,e,i)}},{testValue:e=>e?.type==="ObjectExpression",getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(!tw(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||d2(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:dY,data:{objectType:"object"}},l=o(t,{callExpression:e,firstValue:i});return ez(i,a)?s.suggest=[{messageId:dZ,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(eb(o)?o:a);return r.text.slice(i,s)}(o,e)):i=`...${e4(o,e)}`,i&&(yield d6(e,a,t,i)),2!==n.arguments.length)?yield aw(a,o,e):yield d8(r,e,a)}},{testValue:e=>d3(e,["Set","WeakSet"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(("ChainExpression"===n.type&&(n=n.expression),tw(n,{object:t.name,method:"add",argumentsLength:1,optionalMember:!1,optionalCall:!1}))&&!d2(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:dY,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>ez(e,i))?s.suggest=[{messageId:d0,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rb(e,r,!1);return d9({context:e,fixer:o,newExpression:n,elementsText:a,nextExpressionStatement:t})}},{testValue:e=>d3(e,["Map","WeakMap"]),getProblematicNode({context:e,variable:t,nextExpressionStatement:r}){let n=r.expression;if(tw(n,{object:t.name,method:"set",argumentsLength:2,optionalCall:!1})&&!d2(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:dY,data:{objectType:`\`${o.callee.name}\``}},l=a(t,{callExpression:e,newExpression:o});return e.arguments.some(e=>ez(e,i))?s.suggest=[{messageId:d1,data:{assignType:n},fix:l}]:s.fix=l,s},getFix:({context:e,nextExpressionStatement:t},{callExpression:r,newExpression:n})=>o=>{let a=rb(e,r,!1);return d9({context:e,fixer:o,newExpression:n,elementsText:`[${a}]`,nextExpressionStatement:t})}}],d4="no-useless-collection-argument/error",d7="no-useless-collection-argument/suggestion",me="prefer-response-static-json",mt=/([\p{Ll}\d])(\p{Lu})/gu,mr=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,mn=/(\d)\p{Ll}|(\p{L})\d/u,mo=/[^\p{L}\d]+/giu,ma="$1\0$2";function mi(e){let t=e.trim();t=(t=t.replace(mt,ma).replace(mr,ma)).replace(mo,"\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 ms(e){let t=mi(e);for(let e=0;e<t.length;e++){let r=t[e],n=mn.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 ml(e,t){let[r,n,o]=mf(e,t);return r+n.map(mc(t?.locale)).join(t?.delimiter??" ")+o}function mu(e,t){var r,n;let[o,a,i]=mf(e,t),s=mc(t?.locale),l=md(t?.locale),u=t?.mergeAmbiguousCharacters?(r=s,n=l,e=>`${n(e[0])}${r(e.slice(1))}`):mm(s,l);return o+a.map((e,t)=>0===t?s(e):u(e,t)).join(t?.delimiter??"")+i}function mp(e,t){let[r,n,o]=mf(e,t),a=mm(mc(t?.locale),md(t?.locale));return r+n.map(a).join("")+o}function mc(e){return!1===e?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function md(e){return!1===e?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function mm(e,t){return(r,n)=>{let o=r[0];return(n>0&&o>="0"&&o<="9"?"_"+o:t(o))+e(r.slice(1))}}function mf(e,t={}){let r=t.split??(t.separateNumbers?ms:mi),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 mg="filename-case",my="directory-case",mh="filename-extension",mx=e=>!/^[\w-]$/.test(e),mb=new i(["index.js","index.mjs","index.cjs","index.ts","index.tsx","index.vue"]),mE=new Intl.ListFormat("en-US",{type:"disjunction"}),mv=/^[\da-z]+$/i,mC=/^[A-Z]{3,}(?=\d*[A-Z](?:[a-z]|\d+[a-z]))/,mD=e=>e>="0"&&e<="9",mS=e=>e>="a"&&e<="z",mT=e=>e>="A"&&e<="Z",mA={camelCase:{fn:mu,name:"camel case"},camelCaseWithAcronyms:{fn:function(e){return!function(e){if(!mS(e[0]))return!1;for(let t=1;t<e.length;t++){let r=e[t];if(mS(r)||mD(r))continue;if(!mT(r))return!1;let n=t;for(;mT(e[t+1]);)t++;if(t!==n){if(mS(e[t+1])){t--;continue}for(;mD(e[t+1]);)t++;if(t===e.length-1)return!0;if(!mT(e[t+1]))return!1}}return!0}(e)?mu(e):e},name:"camel case with acronyms"},kebabCase:{fn:function(e,t){return ml(e,{delimiter:"-",...t})},name:"kebab case"},snakeCase:{fn:function(e,t){return ml(e,{delimiter:"_",...t})},name:"snake case"},pascalCase:{fn:function(e){if(mv.test(e)){let t=mC.exec(e)?.[0],r=t&&e.slice(t.length);if(r&&mp(r)===r)return e}return mp(e)},name:"pascal case"}};function mw(e,t){return e.filter(({ignored:e})=>!e).every(({word:e})=>t.some(t=>t(e)===e))}function mk(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 i(o.map(e=>`${r}${e.join("")}${n}`))]}let mI=/^(?<leading>_+)(?<tailing>.*)$/;function mj(e){let t,{leading:r="",tailing:n=e}=(mI.exec(e)||{groups:{}}).groups,o=[];for(let e of n){let r=mx(e);t?.ignored===r?t.word+=e:(t={word:e,ignored:r},o.push(t))}return{leading:r,words:o}}function mF(e){let t;return t=e.map(e=>mA[e].name),mE.format(t)}let mB=[{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}]}],mR="consistent-template-literal-escape",mP=["entries","keys","values"],mL=["drop","filter","flatMap","map","take"],mN=["concat","from","zip","zipKeyed"],m$=new i(["ArrayIterator","Generator","IterableIterator","Iterator","IteratorObject","MapIterator","RegExpStringIterator","SetIterator"]),{isTarget:mM}=ny({checkClassHeritage:!1,preferTypeReferenceDefinitions:!0,targetTypeNames:m$}),mO=e=>{for(;rI(e)||"ChainExpression"===e.type||"ParenthesizedExpression"===e.type;)e=e.expression;return e},mU="iterable-accepting",mq="for-of",mV="yield-star",mW="spread",m_="iterator-method",mz="iterable-accepting/suggestion",mK="iterator-method/suggestion",mG=["every","find","forEach","some"],mJ="reduce",mX=e=>tw(e,{method:"toArray",argumentsLength:0,optionalCall:!1,optionalMember:!1}),mY=(e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>aM(r,e,t)},mH=(e,t,r,n)=>{let o=mY(e,t);if(o)return{messageId:r,...n&&{data:n},fix:o}},mQ="prefer-simple-condition-first",mZ="prefer-simple-condition-first/unsafe";function m0(e){return"Identifier"===(e=rj(e)).type||"UnaryExpression"===e.type&&"typeof"===e.operator&&"Identifier"===rj(e.argument).type}function m1(e){if(m0(e=rj(e))||"Literal"===e.type)return!0;if("UnaryExpression"!==e.type||"-"!==e.operator&&"+"!==e.operator)return!1;let t=rj(e.argument);return"Literal"===t.type&&("number"==typeof t.value||"-"===e.operator&&"bigint"==typeof t.value)}function m2(e){if("Identifier"===(e=rj(e)).type)return!0;if("UnaryExpression"===e.type&&"!"===e.operator)return m2(e.argument);if("BinaryExpression"===e.type&&("==="===e.operator||"!=="===e.operator)){let t=rj(e.left),r=rj(e.right);return m1(t)&&m1(r)&&(m0(t)||m0(r))}return!1}let m3="switch-case-break-position",m8=new i(["BreakStatement","ReturnStatement","ContinueStatement","ThrowStatement"]),m6="first-child",m9="first-element-child",m5="query-selector",m4="closest",m7="merge-query-selector",fe="suggestion-first-child",ft="suggestion-first-element-child",fr="suggestion-merge-query-selector",fn={method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1},fo=(e,t)=>tT(e,{property:t,optional:!1,computed:!1}),fa=e=>"MemberExpression"===e.type&&!e.optional&&e.computed&&to(e.property)&&Number.isSafeInteger(e.property.value)&&e.property.value>=0,fi=(e,t)=>t.getCommentsInside(e).length>0,fs=(e,t,r,n)=>{let{sourceCode:o}=n;if(fi(e,o))return;let[,a]=e5(e.object,n),[,i]=o.getRange(e);return[{messageId:r,fix:r=>[r.replaceText(e.object.property,t),r.removeRange([a,i])]}]},fl=e=>tT(e,{property:"parentElement",optional:!1,computed:!1}),fu=e=>void 0!==tn(e),fp=e=>tw(e,fn),fc=new i(["FunctionDeclaration","ClassDeclaration","TSTypeAliasDeclaration","TSInterfaceDeclaration","TSEnumDeclaration"]),fd=new i(["AccessorProperty","MethodDefinition","PropertyDefinition","TSAbstractAccessorProperty","TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSMethodSignature","TSPropertySignature"]),fm=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("/"))},ff="consistent-compound-words/error",fg="consistent-compound-words/rename",fy={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"},fh=new i(String.raw`\^$.*+?()[]{}|`),fx=e=>{let t="";for(let r of e)t+=fh.has(r)?`\\${r}`:r;return t},fb=String.raw`(?=$|[\d_$]|\p{Uppercase_Letter})`,fE=(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(ao(e));if(r){let t;return(t=e[0])===t.toUpperCase()?an(r):ao(r)}})(e,r));if(o!==e)return o},fv=(e,t)=>({node:e,messageId:ff,data:{name:e.name,replacement:t}}),fC={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]}}}},fD="no-blob-to-file",fS="suggestion";function fT(e,t){let r=ey(t.sourceCode.getScope(e),e);return!r||0===r.defs.length}function fA(e,t){if(e?.type!=="Identifier")return;let r=ey(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 fw="no-canvas-to-image",fk=e=>{for(;e?.type==="AwaitExpression";)e=e.argument;return e};function fI(e,t){if(e=fk(e),e?.type!=="Identifier")return e;let r=ey(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 fk(n.parent.init)}let fj=e=>e.toLowerCase().includes("canvas"),fF="replace-one-element",fB="insert-at-negative-one",fR="suggestion-replace-one-element",fP="suggestion-insert-at-negative-one";function fL(e){return"Identifier"===e.type||"ThisExpression"===e.type||"MemberExpression"===e.type&&!e.computed&&!e.optional&&fL(e.object)}let fN=(e,t)=>t.getCommentsInside(e).length>0,f$="no-duplicate-set-values",fM="first-match",fO="id-selector",fU="length-check",fq="query-selector-all-nullish",fV="query-selector-undefined",fW=e=>tw(e,{method:"querySelector",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oa(e.callee.object),f_=e=>tw(e,{method:"querySelectorAll",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&!oa(e.callee.object),fz=e=>{let t,r;return t=e,r=f_,"MemberExpression"===t.type&&t.computed&&!t.optional&&r(t.object)&&te(t.property,0)},fK=e=>{let t,r;return t=e,r=f_,tw(t,{methods:["at","item"],argumentsLength:1,optionalCall:!1,optionalMember:!1})&&r(t.callee.object)&&te(t.arguments[0],0)},fG=e=>nL(e)||("ForInStatement"===e.parent.type||"ForOfStatement"===e.parent.type)&&e.parent.left===e,fJ=(e,t,r,n)=>{let[,o]=e5(t,n),[,a]=r.getRange(e);return r.getAllComments().some(e=>{let[t,n]=r.getRange(e);return t>=o&&n<=a})},fX=(e,t,r)=>{if("Identifier"!==e.type)return;let n=ey(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},fY=(e,t)=>{let{sourceCode:r}=t,{node:n,isNegative:o}=function(e,t){let r=!1;for(;;)if(tM(e))r=!r,e=e.parent;else if(tO(e,t))e=e.parent;else break;return{node:e,isNegative:r}}(e,t);if(!tV(n)||(f_(e)?!e:!fX(e,r,f_)))return;let a=r.getText(e);return{node:e,messageId:fU,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"}`)}},fH=(e,t,r)=>({node:e,messageId:fM,*fix(n){yield n.replaceText(t.callee.property,"querySelector"),yield"MemberExpression"===e.type?a$(n,e,r):aM(n,e,r)}}),fQ=(e,t)=>ti(e)||tP(e)&&t.isGlobalReference(e),fZ=(e,t,r)=>{let{left:n,operator:o,right:a}=e;return["==","===","!=","!=="].includes(o)?(t(n)?n:fX(n,r,t))&&fQ(a,r)?{node:n,value:a}:(t(a)?a:fX(a,r,t))&&fQ(n,r)?{node:a,value:n}:void 0:void 0},f0="no-invalid-file-input-accept/invalid",f1="no-invalid-file-input-accept/static",f2="no-invalid-file-input-accept/normalize",f3=new i(["audio/*","image/*","video/*"]),f8=new o([["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"]]),f6=/&(?:#\d+|#x[\da-f]+|[a-z][\da-z]*);/iv,f9=e=>{for(let t of e)if(""===t.trim()||","===t||"/"===t||"*"===t||"$"===t||"{"===t||"}"===t)return!0;return!1},f5=e=>{if(e.startsWith("."))return e.length>1&&!f9(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]&&!f9(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 f3.has(t)?{replacement:t}:{reason:"Wildcard MIME types must be `audio/*`, `image/*`, or `video/*`."};try{let{essence:t}=new C.MIMEType(e);return{replacement:f8.get(t)??t}}catch{return{reason:"MIME types must use valid `type/subtype` syntax."}}},f4=e=>{if("JSXIdentifier"===e.type)return e.name},f7=(e,t)=>e.attributes.find(e=>"JSXAttribute"===e.type&&f4(e.name)===t),ge=(e,t)=>{let r=e.sourceCode.getScope(t),n=e$(t,r)?.value;if("string"==typeof n)return n},gt=e=>">"===e||""===e.trim(),gr=(e,t,r)=>{for(;t<r&&""===e[t].trim();)t++;return t},gn=(e,t,r)=>t>=r||">"===e[t]||"/"===e[t]&&">"===e[t+1],go=(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}},ga=(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&&!gt(e[t]);)t++;return{value:e.slice(o,t),valueRange:[o,t],isQuoted:!1,index:t}},gi=(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=gr(n,i,a),!gn(n,i,a));){let e=go(n,i,a);if(i=gr(n,e.index,a),"="!==n[i]){if(e.name===r)return{missing:!0};continue}i=gr(n,++i,a);let t=ga(n,i,a);if(i=t.index,e.name===r)return t}},gs=({valueInfo:e,fix:t})=>{if(e.missing)return{node:e.node,messageId:f0,data:{reason:"The `accept` attribute must have a value."}};if(e.dynamic)return{node:e.node,messageId:f1};let r=(e=>{let t=e.split(","),r=new i,n=[];for(let e of t){let t=e.trim();if(0===t.length)return{reason:"Empty entries are not allowed."};let o=f5(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:f0,data:{reason:t.reason}};if(t.replacement){let n={node:e,messageId:f2,data:{replacement:t.replacement}};return r&&(n.fix=r),n}})({valueNode:e.node,checkResult:r,fix:n?t(r.replacement):void 0})},gl=/^(?:e|event|evt|[a-z][\dA-Za-z]*Event)$/u,gu=e=>{for(let t=e.parent;t;t=t.parent)if(tv(t))return t},gp=(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}},gc=e=>{let{sourceCode:t}=e,r=new i,n=e=>{let t=gu(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(gp(o,n)&&t_(o,t.visitorKeys))return!0;return!1}}},gd="after-suspension",gm="in-nested-function",gf="no-unnecessary-nested-ternary";function gg(e,t,r){return r.getText(e)===r.getText(t)}function gy(e,t,r,n){let o=e4(e,t);return!e7(e,t)&&o3(e,{operator:r,property:n})&&(o=`(${o})`),o}function gh(e,t){let r=e4(e,t);return!e7(e,t)&&oY(e)&&(r=`(${r})`),r}function gx(e,t,r){let n={node:t,messageId:gf};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=[gy(r,e,n,"left"),gy(o,e,n,"right")].join(` ${n} `),u=`${l} ? ${gh(a,e)} : ${gh(i,e)}`;return oD(s.getTokenBefore(t),e,u)&&(u=`;${u}`),u}({context:e,node:t,...r}))),n}let gb="no-unused-array-method-return",gE=new i(["at","concat","entries","every","filter","find","findIndex","findLast","findLastIndex","flat","flatMap","includes","indexOf","join","keys","lastIndexOf","map","some","slice","toReversed","toSorted","toSpliced","values","with"]),gv=/^\p{Uppercase_Letter}/v,gC=Symbol("uncertainValue"),gD=["BigInt","Boolean","Number","RegExp","String","Symbol"],gS=(e,t,r)=>"Identifier"===e.type&&e.name===t&&r.sourceCode.isGlobalReference(e),gT="prefer-array-last-methods",gA="replace",gw=new o([["find","findLast"],["findIndex","findLastIndex"],["indexOf","lastIndexOf"],["reduce","reduceRight"]]),gk=["reverse","toReversed"],gI="prefer-math-abs",gj=new i([">",">=","<","<="]),gF={">":"<",">=":"<=","<":">","<=":">="},gB={">":"<",">=":"<="};function gR(e){return"TSBigIntKeyword"===e.type||"TSLiteralType"===e.type&&ts(e.literal)||"TSTypeAnnotation"===e.type&&gR(e.typeAnnotation)||"TSUnionType"===e.type&&e.types.some(e=>gR(e))||"TSIntersectionType"===e.type&&e.types.some(e=>gR(e))}function gP(e){return["TSAsExpression","TSTypeAssertion","TSNonNullExpression"].includes(e.type)?gP(e.expression):e}function gL(e){let t;return ts(e)||tm(e,{name:"BigInt",argumentsLength:1,optional:!1},tp)||"UnaryExpression"===e.type&&"-"===e.operator&&gL(e.argument)||(t=function e(t){return"TSNonNullExpression"===t.type?e(t.expression):"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?t.typeAnnotation:void 0}(e))&&gR(t)}function gN(e,t){return gL(e)||function(e,t){let r=gP(e);if("Identifier"!==r.type)return!1;let n=ey(t.sourceCode.getScope(r),r);return n?.defs.some(e=>"Parameter"===e.type?e.name.typeAnnotation&&gR(e.name.typeAnnotation)||"AssignmentPattern"===e.name.parent.type&&gL(e.name.parent.right):"Variable"===e.type&&(e.node.id.typeAnnotation&&gR(e.node.id.typeAnnotation)||e.node.init&&gL(e.node.init)))??!1}(e,t)}function g$(e,t){return"UnaryExpression"===e.type&&"-"===e.operator?rC(e.argument,t):"BinaryExpression"===e.type&&"-"===e.operator&&te(e.left,0)?rC(e.right,t):"BinaryExpression"===e.type&&"*"===e.operator&&(rC(e.left,t)&&tk(e.right)||tk(e.left)&&rC(e.right,t))}function gM(e,t){if(!("BinaryExpression"!==e.type||!gj.has(e.operator)||gN(e.left,t)||gN(e.right,t)))return">"===e.operator||">="===e.operator?{value:e.left,threshold:e.right,operator:e.operator}:{value:e.right,threshold:e.left,operator:gF[e.operator]}}function gO(e,t){if(!("BinaryExpression"!==e.type||!gj.has(e.operator)||gN(e.left,t)||gN(e.right,t)))return"<"===e.operator||"<="===e.operator?{value:e.left,negativeThreshold:e.right,operator:e.operator}:{value:e.right,negativeThreshold:e.left,operator:gF[e.operator]}}function gU(e,t){let r=e4(e,t);return"SequenceExpression"===e.type?`(${r})`:r}function gq(e,t,r){let n={node:e,messageId:gI};return r&&!(t.sourceCode.getCommentsInside(e).length>0)&&(n.fix=r),n}function gV(e){return["Identifier","Literal","ThisExpression"].includes((e=gP(e)).type)}let gW="prefer-split-limit",g_=(e,t)=>{let r=e$(e,t.getScope(e));if(r&&Number.isSafeInteger(r.value)&&!(r.value<0)&&!(r.value>=0xfffffffe))return r.value},gz=e=>{let t,r=e?.type==="ChainExpression"?e.expression:e;if(tw(r,{method:"split",argumentsLength:1})&&(tt(t=r.arguments[0])&&""!==t.value||ta(t)))return r},gK=(e,t,r,n)=>({node:e,messageId:gW,fix:e=>aA(e,t,String(r),n)}),gG=(e,t,r)=>{let{elements:n}=e,o=gz(t);if(0!==n.length&&n.at(-1)?.type!=="RestElement"&&o)return gK(e,o,n.length,r)},gJ="prefer-queue-microtask",gX={create:e=>{let{checkSetImmediate:t,checkSetTimeout:r}=e.options[0];e.on("MemberExpression",t=>{if(tT(t,{object:"process",property:"nextTick",computed:!1,optional:!1})&&of(t.object,e)&&("CallExpression"!==t.parent.type||t.parent.callee!==t||!t.parent.optional))return{node:t.property,messageId:gJ,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&&!ol(n.arguments[0])&&oE(n)&&of(n.callee,e)?{node:n.callee,messageId:gJ,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&&!ol(n.arguments[0])&&oE(n)&&of(n.callee,e)?{node:n.callee,messageId:gJ,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(!r$(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:{[gJ]:"Prefer `queueMicrotask()` over `{{name}}`."},languages:["js/js"]}},gY="prefer-string-pad-start-end",gH="suggest-padding-method",gQ=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),gZ=(e,t)=>{let r,n=((e,t)=>{if("Identifier"!==e.type)return;let r=ey(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=e$(e,t.sourceCode.getScope(e)))&&"string"!=typeof r.value||gQ.has(e.type)||gQ.has(n?.type)||n?.type==="FunctionDeclaration"||n?.type==="ClassDeclaration"},g0=(e,t)=>t.sourceCode.getCommentsInside(e).length>0,g1=e=>"Literal"===e.type&&"string"==typeof e.value||"TemplateLiteral"===e.type&&0===e.expressions.length,g2=({targetNode:e,targetLengthNode:t,paddingNode:r})=>"Identifier"===e.type&&to(t)&&g1(r),g3=(e,t)=>{if(!tw(e,{method:"repeat",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=e.callee.object,n=((e,t)=>{let r=e$(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]}},g8=(e,t)=>{let r,n=g3(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}},g6=({method:e,targetNode:t,targetLengthNode:r,paddingNode:n,paddingString:o},a)=>{let i=e4(t,a),s=e4(r,a),l=(({paddingNode:e,paddingString:t},r)=>" "===t?"":`, ${e4(e,r)}`)({paddingNode:n,paddingString:o},a);return`${i}.${e}(${s}${l})`},g9=({node:e,method:t,replacement:r,context:n,canFix:o})=>{let a={node:e,messageId:gY,data:{method:t}};return o&&!g0(e,n)&&(a.fix=function(t){let o=oD(n.sourceCode.getTokenBefore(e),n,r)?";":"";return t.replaceText(e,`${o}${r}`)}),a},g5=({node:e,method:t,replacement:r,context:n,canSuggest:o})=>{let a={node:e,messageId:gY,data:{method:t}};return o&&!g0(e,n)&&(a.suggest=[{messageId:gH,data:{method:t},fix:t=>t.replaceText(e,r)}]),a},g4="require-css-escape",g7=["closest","matches","querySelector","querySelectorAll"],ye=e=>e.value.cooked,yt=(e,t)=>{let r,n="";for(let r of e.quasis.slice(0,t+1)){let e=ye(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=ye(r);if(void 0===e)break;if(e.includes("]"))return!0}return!1},yr=e=>tw(e,{object:"CSS",method:"escape",argumentsLength:1,optionalCall:!1,optionalMember:!1}),yn=e=>t=>"SequenceExpression"===e.type?[t.insertTextBefore(e,"CSS.escape(("),t.insertTextAfter(e,"))")]:[t.insertTextBefore(e,"CSS.escape("),t.insertTextAfter(e,")")],yo={create:e=>{let{checkAllSelectors:t}=e.options[0];e.on("CallExpression",function*(e){if(!tw(e,{methods:g7,minimumArguments:1})||oa(e.callee.object))return;let[r]=e.arguments;if("TemplateLiteral"===r.type&&0!==r.expressions.length)for(let[e,n]of r.expressions.entries())!yr(n)&&(t||yt(r,e))&&(yield{node:n,messageId:g4,fix:yn(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:{[g4]:"Use `CSS.escape()` for interpolated values in CSS selectors."},languages:["js/js"]}},ya="require-passive-events",yi=new i(["touchstart","touchmove","touchenter","touchend","touchleave","wheel","mousewheel"]),ys=e=>e.computed||"Identifier"!==e.property.type?tt(e.property)?e.property.value:void 0:e.property.name,yl=e=>{var t,r;return"MemberExpression"===e.parent.type&&e.parent.object===e&&"MemberExpression"===(t=e.parent).type&&"preventDefault"===ys(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)},yu=e=>{if("MemberExpression"!==e.parent.type||e.parent.object!==e)return!1;let t=ys(e.parent);return t&&"preventDefault"!==t&&!nL((e=>{for(;"MemberExpression"===e.parent.type&&e.parent.object===e;)e=e.parent;return e})(e.parent))},yp="this",yc="class",yd="class-unavailable",ym="super",yf="super-class",yg="super-class-unavailable",yy="suggestion",yh=new i(["PropertyDefinition","AccessorProperty","StaticBlock","ClassBody"]),yx=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]),yb=e=>"MethodDefinition"===e.parent.type&&e.parent.value===e,yE=e=>"FunctionDeclaration"===e.type||"FunctionExpression"===e.type,yv=e=>{let t=e;for(let{parent:r}=e;r;t=r,r=r.parent)if("ArrowFunctionExpression"!==r.type){if(yE(r)&&!yb(r))return;if("MethodDefinition"===r.type)return r.static&&r.value===t?r:void 0;if(yh.has(r.type))return}},yC=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},yD=(e,t,r)=>ey(e.getScope(t),t)===ey(e.getScope(r),r),yS=(e,t,r)=>ey(e.getScope(t),r.name)===ey(e.getScope(r),r),yT=(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,yA=e=>{let t;return(t=e.parent,yx.has(t.type)&&t.expression===e)?e.parent:void 0},yw=e=>{let{parent:t}=e;if("MemberExpression"===t.type&&t.object===e||"ChainExpression"===t.type&&t.expression===e)return t;let r=yA(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)},yk=e=>{let t=e;for(;t.parent;){if(yT(t.parent,t))return!0;let e=yw(t);if(!e)break;t=e}return!1},yI=e=>"MemberExpression"===e.parent.type&&e.parent.object===e,yj=e=>{let t=e;for(;t.parent;){let e=yA(t);if(!e)break;t=e}return t},yF=e=>{let t=yj(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},yB=e=>{let t=yj(e);return yI(t)&&"PrivateIdentifier"===t.parent.property.type},yR=e=>{let t=yj(e);return"BinaryExpression"===t.parent.type&&"in"===t.parent.operator&&"PrivateIdentifier"===t.parent.left.type&&t.parent.right===t},yP=e=>e.superClass?.type==="Identifier"?e.superClass:void 0,yL=({node:e,messageId:t,source:r,replacement:n,name:o})=>({node:e,messageId:t,data:{name:o},suggest:[{messageId:yy,data:{source:r,replacement:n},fix:t=>t.replaceText("ChainExpression"===e.parent.type?e.parent:e,n)}]}),yN=(e,t,r)=>({node:e,messageId:t,data:{name:r}}),y$={create:e=>{let{sourceCode:t}=e,{preferThis:r,preferSuper:n}=e.options[0];e.on("ThisExpression",e=>{if(r||yk(e)||yF(e)||yB(e)||yR(e))return;let n=yv(e);if(!n)return;let o=yC(n.parent.parent);return o&&yS(t,e,o)?yL({node:e,messageId:yc,source:"this",replacement:o.name,name:o.name}):yN(e,yd)}),e.on("Super",e=>{if(n||yk(e))return;let r=yv(e);if(!r)return;let o=yP(r.parent.parent);return o&&yS(t,e,o)?yL({node:e,messageId:yf,source:"super",replacement:o.name,name:o.name}):yN(e,yg)}),e.on("Identifier",o=>{if(!tI(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)||yk(o)||yF(o)||yB(o)||yR(o))return;let a=yv(o);if(!a)return;let i=a.parent.parent;if(r){let e=yC(i);if(e&&o.name===e.name&&yD(t,o,e))return yL({node:o,messageId:yp,source:o.name,replacement:"this",name:o.name})}if(!n||!(yI(o)&&!o.parent.optional&&!yk(o.parent))||e7(o,e))return;let s=yP(i);if(s&&o.name===s.name&&yD(t,o,s))return yL({node:o,messageId:ym,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:{[yp]:"Use `this` instead of `{{name}}` in static methods.",[yc]:"Use `{{name}}` instead of `this` in static methods.",[yd]:"Use the class name instead of `this` in static methods.",[ym]:"Use `super` instead of `{{name}}` in static methods.",[yf]:"Use `{{name}}` instead of `super` in static methods.",[yg]:"Use the superclass name instead of `super` in static methods.",[yy]:"Replace `{{source}}` with `{{replacement}}`."},languages:["js/js"]}},yM="consistent-optional-chaining/remove-optional",yO="consistent-optional-chaining/use-optional",yU="consistent-optional-chaining/suggest-remove-optional",yq="consistent-optional-chaining/suggest-use-optional",yV=new i(["Identifier","ThisExpression","Super"]);function yW(e){let t;for(;e!==t;)t=e,"ChainExpression"===(e=rj(e)).type&&(e=e.expression);return e}function y_(e){return"MemberExpression"===(e=yW(e)).type?e:void 0}function yz(e){return e=yW(e),!!yV.has(e.type)||"MemberExpression"===e.type&&yz(e.object)}function yK(e,t){let r=rV(e,t);return!r$(t,r)}function yG({memberExpression:e,context:t,fixer:r,replacement:n}){let o=rV(e,t);return r.replaceTextRange(o,n)}function yJ(e,t,r){return yG({memberExpression:e,context:t,fixer:r,replacement:e.computed?"[":"."})}let yX="always",yY="never",yH="missing-delay",yQ="redundant-delay",yZ=new i(["setTimeout","setInterval"]),y0=new i(["window","globalThis","global","self"]),y1=e=>te(e,0)||"UnaryExpression"===e.type&&("+"===e.operator||"-"===e.operator)&&y1(e.argument),y2="negative-index",y3="length-index",y8="no-duplicate-loops",y6=["filter","map"],y9="no-declarations-before-early-exit",y5=e=>"VariableDeclaration"===e.type&&("let"===e.kind||"const"===e.kind),y4=e=>!e||"Literal"===e.type||"TemplateLiteral"===e.type&&0===e.expressions.length,y7=(e,t,r)=>{let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return n&&eT(n)},he=(e,t)=>{let[r,n]=e.getRange(t);return new i(rc(e.getScope(t)).filter(({identifier:t})=>{let[o,a]=e.getRange(t);return o>=r&&a<=n}).map(({identifier:e})=>e.name))};function*ht(e,t,r){let n;for(let[o,a]of t.entries())if(y5(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?od(t.name):"MemberExpression"===t.type&&!t.computed&&"Identifier"===t.object.type&&/^[A-Z]/.test(t.object.name)&&"Identifier"===t.property.type&&od(t.property.name)})(r.init)||r.init&&t_(r.init,e.visitorKeys)||a>o+1&&!y4(r.init)||r.init&&(i=r.init,s=he(e,n),[...he(e,i)].some(e=>s.has(e)))&&(ez(r.init,e)||ez(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:y9};return(({sourceCode:e,declaration:t,guardStatement:r,declarationIndex:n,guardIndex:o})=>o===n+1&&1===t.declarations.length&&y4(t.declarations[0].init)&&0===e.getCommentsInside(t).length&&!y7(e,t,"before")&&!y7(e,r,"after")&&!e.getTokensBetween(t,r,{includeComments:!0}).some(e=>eT(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 hr="no-optional-chaining-on-undeclared-variable",hn=e=>"Type"===e.type||"ImportBinding"===e.type&&oS(e.node);function ho(e){let t;for(;e!==t;)t=e,("ChainExpression"===(e=rj(e)).type||"TSInstantiationExpression"===e.type)&&(e=e.expression);return e}let ha="no-object-methods-with-collections/error",hi="no-object-methods-with-collections/suggestion",hs=new i(["entries","keys","values"]),hl="no-subtraction-comparison/error",hu="no-subtraction-comparison/suggestion",hp={">":"<",">=":"<=","<":">","<=":">=","===":"===","!==":"!==","==":"==","!=":"!="},hc=new i(Object.keys(hp)),hd=new i([">","<"]),hm=e=>"BinaryExpression"===e.type&&"-"===e.operator,hf=(e,t)=>{let r=e$(e,t)?.value;return"number"==typeof r&&Number.isFinite(r)},hg="no-unnecessary-global-this",hy=new i(["TSAsExpression","TSInstantiationExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion"]);function hh(e){for(;hy.has(e.type);)e=e.expression;return e}let hx=e=>{for(;hy.has(e.parent.type)&&e.parent.expression===e;)e=e.parent;return e},hb=tX();function hE(e){return"CallExpression"===(e=hx(e)).parent.type&&e.parent.callee===e}let hv=new i(["==","!=","===","!=="]),hC="computed-key",hD="nested-array",hS="deep-object",hT="property-assignment";function hA(e){let{parent:t}=e;if(t){if(rI(t)&&t.expression===e||"AssignmentPattern"===t.type&&t.left===e||"RestElement"===t.type&&t.argument===e)return hA(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 hw(e){let t=0;for(;e;)"ObjectPattern"===e.type&&t++,e=hA(e);return t}let hk="no-useless-else",hI=new i(["Program","BlockStatement","StaticBlock","SwitchCase"]),hj=new i(["[","(","<","/","`","+","-"]),hF=(e,t)=>{let r=e.text.lastIndexOf("\n",t-1)+1;return/^[\t ]*/.exec(e.text.slice(r,t))[0]},hB=e=>hj.has(e.value[0]),hR="no-useless-recursion",hP=new i(["using","await using"]),hL=e=>e?.type==="VariableDeclaration"&&hP.has(e.kind),hN=e=>"ForStatement"===e.type?hL(e.init):"ForOfStatement"===e.type&&hL(e.left),h$="prefer-add-event-listener-options",hM="prefer-direct-iteration",hO="Array",hU="FormData",hq="URLSearchParams",hV=new i([hO,"Map","Set",hU,hq,...rZ]),hW=new o([["ReadonlyArray",hO],["ReadonlyMap","Map"],["ReadonlySet","Set"]]),h_=new o([[hO,["values"]],["Map",["entries"]],["Set",["values","keys"]],[hU,["entries"]],[hq,["entries"]],...rZ.map(e=>[e,["values"]])]),hz=["Map","WeakMap","Set","WeakSet"],hK=["all","allSettled","any","race"],hG=new i(["ArrayExpression","CallExpression","NewExpression"]),hJ=e=>new i([e]),hX=(e,t)=>tw(e,{objects:rZ,methods:t,optionalCall:!1,optionalMember:!1}),hY=e=>hV.has(e)?e:hW.get(e),hH=e=>{let t=new i;for(let r of e){if(!r)return;for(let e of r)t.add(e)}return t},hQ=(e,t,r)=>{if("any"===e.intrinsicName||"unknown"===e.intrinsicName)return;if(e.isUnion())return hH(e.types.map(e=>hQ(e,t,r)));if(t.isArrayType(e)||t.isTupleType(e))return hJ(hO);let n=r2(e);if(!r3(n,r))return;let o=n.getName(),a=o&&hY(o);return a&&hJ(a)},hZ=e=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return hZ(e.typeAnnotation);case"TSArrayType":case"TSTupleType":return hJ(hO);case"TSTypeOperator":return"readonly"===e.operator?hZ(e.typeAnnotation):void 0;case"TSTypeReference":{if("Identifier"!==e.typeName.type)return;let t=hY(e.typeName.name);return t&&hJ(t)}case"TSUnionType":return hH(e.types.map(e=>hZ(e)))}},h0=(e,t,r=new i)=>((e,t,r)=>{if("ArrayExpression"===e.type||tf(e,{name:"Array"}))return hJ(hO);if(tf(e,{names:rZ})||tf(e,{names:["Map","Set",hU,hq]}))return hJ(e.callee.name);if(tm(e,{name:"Array"},tp)||tw(e,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1}))return hJ(hO);if(hX(e,["from","of"]))return hJ(e.callee.object.name);switch(e.type){case"Identifier":return((e,t,r)=>{let n=ey(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return;r.add(n);let[o]=n.defs,a=hZ(o.name?.typeAnnotation);return a||("Variable"===o.type&&"const"===o.parent.kind&&o.node.init?h0(o.node.init,t,r):void 0)})(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return hZ(e.typeAnnotation)??h0(e.expression,t,r);case"TSNonNullExpression":case"ParenthesizedExpression":return h0(e.expression,t,r)}})(e,t,r)??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return hQ(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e,t),h1="prefer-number-is-safe-integer/error",h2="prefer-number-is-safe-integer/suggestion",h3="prefer-number-is-safe-integer/integer-check-error",h8="prefer-number-is-safe-integer/integer-check-suggestion",h6=["_","lodash","underscore"],h9=["floor","trunc"],h5=(e,t)=>{let r=ey(t.getScope(e),"Number");return!r||"global"===r.scope.type&&0===r.defs.length},h4=e=>{if("BinaryExpression"===e.type&&"%"===e.operator&&te(e.right,1))return e.left},h7=(e,t)=>{if(tw(e,{object:"Math",methods:h9,argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return e.arguments[0]},xe="prefer-object-define-properties";function xt(e){if(e?.type!=="ExpressionStatement")return;let{expression:t}=e;if(tw(t,{object:"Object",method:"defineProperty",argumentsLength:3,optionalCall:!1,optionalMember:!1,computed:!1}))return t}let xr="prefer-object-destructuring-defaults",xn="prefer-object-destructuring-defaults/suggestion",xo=new i(Object.getOwnPropertyNames(Object.prototype)),xa={considerGetters:!0,considerImplicitTypeConversion:!0},xi=e=>"Property"===e.type&&"init"===e.kind&&!e.computed&&!e.method,xs=(e,t,r)=>rc(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)),xl=(e,t,r)=>{let{sourceCode:n}=r,o=n.getText(e.node.value),a=e4(t.value,r);return e.node.shorthand?`${o} = ${a}`:`${n.getText(e.node.key)}: ${o} = ${a}`},xu="prefer-single-object-destructuring",xp=(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=ey(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}},xc=(e,t,r)=>{let n,o,a=xp(e,t),i=xp(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=>eT(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:xu,data:{source:a.source},fix:t=>t.replaceTextRange([e.getRange(a.node)[0],e.getRange(i.node)[1]],l)}};function*xd(e,t){for(let[r,n]of t.entries()){if(0===r)continue;let o=xc(e,t[r-1],n);o&&(yield o)}}let xm="prefer-smaller-scope",xf=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression","StaticBlock","WithStatement"]);function xg(e,t){let r=e.parent;for(;r&&r!==t;){if(xf.has(r.type))return!1;r=r.parent}return r===t}function xy(e,t,r){let n="before"===r?e.getTokenBefore(t,{includeComments:!0}):e.getTokenAfter(t,{includeComments:!0});return!!(n&&eT(n))}function xh(e,t){let r=e.getTokenBefore(t),n=e.getTokenAfter(t);return r?.value==="("&&n?.value===")"}let xx="prefer-single-array-predicate/error",xb="prefer-single-array-predicate/suggestion",xE=new o([["||","some"],["&&","every"]]),xv=new i(["AssignmentExpression","ArrowFunctionExpression","ConditionalExpression","SequenceExpression","TSAsExpression","TSNonNullExpression","TSSatisfiesExpression","TSTypeAssertion","YieldExpression"]),xC="prefer-url-href",xD="non-url",xS="unknown",xT=new i(["ClassName","ImportBinding","Type"]),xA=new i(["any","error","unknown"]),xw=new i(["node:url","url"]),xk=e=>xT.has(e.type),xI=(e,t,r,n)=>{for(;t;){let o=t.set.get(e);if(o?.defs.some(e=>oT(e,r,n)))return o;t=t.upper}},xj=e=>e.every(e=>"url"===e)?"url":!e.includes(xS)&&e.includes(xD)?xD:xS,xF=e=>{let t;if("ImportBinding"!==e.type)return!1;let{node:r,parent:n}=e;return t=n.source,xw.has(t.value)&&"ImportSpecifier"===r.type&&"Identifier"===r.imported.type&&"URL"===r.imported.name},xB=e=>"ImportBinding"===e.type&&("type"===e.parent.importKind||oS(e.node)),xR=e=>"Type"===e.type||xB(e),xP=e=>xF(e)&&!xB(e),xL=(e,t)=>{let r;return"NewExpression"===e.type&&(((e,t)=>{if("Identifier"!==e.type||"URL"!==e.name||((e,t,r)=>{for(;e;){let n=e.set.get("URL");if(n?.defs.some(e=>!xR(e)&&oT(e,t,r)))return!0;e=e.upper}return!1})(t.sourceCode.getScope(e),e,t))return!1;if(of(e,t))return!0;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.length>0&&r.defs.every(e=>xR(e))})(r=e.callee,t)||((e,t)=>{if("Identifier"!==e.type)return!1;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.some(e=>xP(e))??!1})(r,t))},xN=(e,t)=>t.sourceCode.getScope(e.name??e.node),x$=(e,t,r,n=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return x$(e.typeAnnotation,t,r,n);case"TSTypeReference":return((e,t,r,n)=>{if("Identifier"!==e.typeName.type)return xS;let o=e.typeName.name,a=xI(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=>xk(e)))return!0;t=t.upper}return!1})(o,r)?xS:"url";if(n.has(o))return xS;if(xF(i))return"url";n.add(o);let s=xS;return"Type"===i.type&&"TSTypeAliasDeclaration"===i.node.type?s=x$(i.node.typeAnnotation,t,xN(i,t),n):"Type"===i.type&&"TSTypeParameter"===i.node.type?s=xS:"ClassName"===i.type&&(s=xD),n.delete(o),s})(e,t,r,n);case"TSUnionType":return xj(e.types.map(e=>x$(e,t,r,n)));case"TSIntersectionType":return xj(e.types.map(e=>x$(e,t,r,n)));case"TSImportType":let o;return(o=e.source,xw.has(o.value)&&e.qualifier?.type==="Identifier"&&"URL"===e.qualifier.name)?"url":xD;default:return e?xD:xS}},xM=(e,t)=>{let{checker:r,context:n,node:o,program:a}=t;if(xA.has(e.intrinsicName)||e.isTypeParameter?.())return xS;let i=r.getBaseConstraintOfType(e);if(i&&i!==e)return xM(i,t);if(e.isUnion()||e.isIntersection())return xj(e.types.map(e=>xM(e,t)));let s=((e,t,r)=>{if(!/^[\w$]+$/.test(e))return xS;let n=xI(e,r.sourceCode.getScope(t),t,r),o=n?.defs.filter(e=>"Type"===e.type||"ClassName"===e.type||xF(e))??[];return 0===o.length?xS:o.every(e=>xF(e))?"url":xD})(r.typeToString(e),o,n);if(s!==xS)return s;let l=r2(e);return r3(l,a)&&"URL"===l.getName()?"url":xD},xO=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return xS;try{let{program:n}=r;return xM(r.getTypeAtLocation(e),{checker:n.getTypeChecker(),context:t,node:e,program:n})}catch{return xS}};function xU(e,t,r=new i){if(!e)return xS;let n=t.sourceCode.getScope(e);switch(e.type){case"Identifier":{let n=((e,t,r)=>{let n=ey(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return xS;let[o]=n.defs;if(!oT(o,e,t))return xS;r.add(n);let a="Variable"===o.type&&"const"===o.parent.kind&&o.node.init?xU(o.node.init,t,r):xS,i=x$(o.name?.typeAnnotation,t,xN(o,t)),s=xS;return a!==xS?s=a:i!==xS&&(s=i),r.delete(n),s})(e,t,r);if(n!==xS)return n;break}case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":{let o=x$(e.typeAnnotation,t,n);return o===xS?xU(e.expression,t,r):o}case"TSNonNullExpression":case"ParenthesizedExpression":return xU(e.expression,t,r);case"SequenceExpression":return xU(e.expressions.at(-1),t,r);case"ConditionalExpression":return xj([xU(e.consequent,t,r),xU(e.alternate,t,r)])}if(xL(e,t))return"url";if("NewExpression"===e.type){if(((e,t)=>{if("Identifier"!==e.type)return!1;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.some(e=>!xR(e)&&!xP(e))??!1})(e.callee,t))return xD;let r=xO(e,t);return r===xS?xD:r}let o=((e,t)=>{if("CallExpression"!==e.type||"Identifier"!==e.callee.type)return xS;let r=ey(t.sourceCode.getScope(e.callee),e.callee);if(r?.defs.length!==1)return xS;let[n]=r.defs;return x$(n.node.returnType,t,xN(n,t))})(e,t);return o!==xS?o:xO(e,t)}let xq=(e,t)=>{switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"ParenthesizedExpression":case"TSNonNullExpression":return xq(e.expression,t);case"SequenceExpression":return xq(e.expressions.at(-1),t);case"ConditionalExpression":return xq(e.consequent,t)&&xq(e.alternate,t);case"NewExpression":return xL(e,t);default:return!1}},xV=(e,t)=>0===t.sourceCode.getCommentsInside(e).length,xW="require-proxy-trap-boolean-return",x_=new i(["defineProperty","deleteProperty","has","isExtensible","preventExtensions","set","setPrototypeOf"]),xz=new i(["ArrowFunctionExpression","FunctionDeclaration","FunctionExpression"]),xK=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression","TemplateLiteral","UpdateExpression"]),xG=new i(["%","&","*","**","+","-","/","<<",">>",">>>","^","|"]),xJ=(e,t)=>({node:e,messageId:xW,data:{name:t}}),xX=e=>{if(e)return xJ(e.node,e.data.name)},xY=(e,t,r)=>{if("AssignmentExpression"===e.type)return"="===e.operator?xX(xY(e.right,t,r)):xJ(e,t);if("ConditionalExpression"===e.type)return xY(e.consequent,t,r)??xY(e.alternate,t,r);if("LogicalExpression"===e.type)return xX(xY(e.left,t,r)??xY(e.right,t,r));if("SequenceExpression"===e.type)return xX(xY(e.expressions.at(-1),t,r));let n=((e,t)=>{let r=e$(e,t.getScope(e));if(null!==r&&"boolean"!=typeof r.value)return!!r.value})(e,r);if(void 0===n&&!(xK.has(e.type)||"UnaryExpression"===e.type&&"!"!==e.operator&&"delete"!==e.operator||"BinaryExpression"===e.type&&xG.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{...xJ(e,t),...o&&{fix:t=>t.replaceText(e,o)}}},xH=(e,t)=>{if("Property"!==e.type||"init"!==e.kind)return;let r=eO(e,t.getScope(e));if(x_.has(r)&&xz.has(e.value.type))return{name:r,functionNode:e.value}},xQ=({functionNode:e,name:t},r,n)=>{if(e.async||e.generator)return xJ(e,t);if("BlockStatement"!==e.body.type)return xY(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&&xz.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 xJ(e,t)}for(let e of o){if(!e.argument)return xJ(e,t);let n=xY(e.argument,t,r);if(n)return n}if(!a)return xJ(e,t)},xZ=D.builtinRules.get("logical-assignment-operators"),x0="ifNullish",x1="convertIf",x2={...xZ.meta.messages,[x0]:"'if' statement can be replaced with a logical operator assignment with operator ||= or ??=."},x3=e=>e.fix??e.suggest?.[0]?.fix,x8={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 x3(e))return e;let n={...(r={...e},delete r.fix,delete r.suggest,r),messageId:x0};if(t.getCommentsInside(e.node).length>0)return n;let o=x3(e);return{...n,suggest:[{messageId:x1,data:{operator:"||="},fix:o},{messageId:x1,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(xZ.create(r)))e.on(t,n)},meta:{type:xZ.meta.type,docs:{description:xZ.meta.docs.description,recommended:!0},fixable:xZ.meta.fixable,hasSuggestions:xZ.meta.hasSuggestions,schema:xZ.meta.schema,defaultOptions:[xZ.meta.defaultOptions?.[0]],messages:x2,languages:["js/js"]}},x6="no-useless-coercion",x9=new o([["Boolean",{type:"boolean",isType:n6}],["String",{type:"string",isType:on}],["BigInt",{type:"bigint",isType:function(e,t){return!!e&&(!!("TSSatisfiesExpression"===e.type&&n5(e.typeAnnotation)||n4(e,t))||"bigint"==typeof e$(e,t.sourceCode.getScope(e))?.value)}}],["Number",{type:"number",isType:(e,t)=>n_(e,t.sourceCode.getScope(e))}]]),x5="no-useless-boolean-cast",x4=["every","filter","find","findIndex","findLast","findLastIndex","some"],x7="no-useless-continue",be="no-useless-override",bt=e=>e.isUnion()?e.types.every(e=>bt(e)):"void"===e.intrinsicName||"undefined"===e.intrinsicName,br=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{return{type:r.getTypeAtLocation(e),checker:r.program.getTypeChecker()}}catch{}},bn="prefer-has-check",bo=new i(["Map","ReadonlyMap","WeakMap"]),ba=new i(["Map","WeakMap"]),bi=new i(["FormData","Headers","URLSearchParams"]),bs=new i(["Array","ReadonlyArray"]),bl=ba.union(bi),bu=new i(["ClassName","ImportBinding","TSEnumName","Type"]),bp=new i(["any","bigint","boolean","false","number","string","unknown","undefined","null","void"]),bc=new i(["TSTypeAnnotation","TSParenthesizedType"]),bd=new i(["TSAnyKeyword","TSNeverKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword"]),bm=new i(["TSBigIntKeyword","TSBooleanKeyword","TSNumberKeyword","TSStringKeyword"]),bf=new i(["TSArrayType","TSConstructorType","TSFunctionType","TSObjectKeyword","TSSymbolKeyword","TSTupleType"]),bg=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","NewExpression","ObjectExpression"]),by=new i(["ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression"]),bh=e=>{for(;by.has(e.type);)e=e.expression;return e},bx=e=>{if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=bx(e.left);return t?`${t}.${e.right.name}`:void 0}},bb=e=>e.typeArguments?.params??e.typeParameters?.params??[],bE=(e,t)=>{for(;t;){let r=t.set.get(e)?.defs.find(e=>bu.has(e.type));if(r)return r;t=t.upper}},bv=e=>{if(e?.type==="Type"&&"TSTypeAliasDeclaration"===e.node.type&&0===bb(e.node).length)return e.node.typeAnnotation},bC=(e,t)=>{if(t.sourceCode.isGlobalReference(e))return!0;let r=ey(t.sourceCode.getScope(e),e);return!r||0===r.defs.length},bD=(e,t)=>tP(e)&&bC(e,t)||"UnaryExpression"===e.type&&"void"===e.operator&&"Literal"===e.argument.type&&0===e.argument.value,bS=(e,t)=>bo.has(e)?{kind:"map",typeName:e,valueType:t}:bi.has(e)?{kind:"null-sentinel",typeName:e}:void 0,bT=(e,t,r=new i)=>{switch(e?.type){case"TSTypeAnnotation":case"TSParenthesizedType":return bT(e.typeAnnotation,t,r);case"TSTypeOperator":return"readonly"===e.operator?bT(e.typeAnnotation,t,r):void 0;case"TSTypeReference":{let n=bx(e.typeName);if(!n)return;if((bo.has(n)||bi.has(n))&&!bE(n,t))return bS(n,bb(e).at(-1));let o=((e,t,r)=>{if(!r.has(e))return r.add(e),bv(bE(e,t))})(n,t,r);return o?bT(o,t,r):void 0}}},bA=(e,t)=>{let r=t.sourceCode.getScope(e);return bT(e.typeAnnotation,r)},bw=(e,t,r=new i)=>{let n=bA(e,t);if(n)return n;if(tf(e=bh(e))&&"Identifier"===e.callee.type&&bl.has(e.callee.name)&&bC(e.callee,t))return bS(e.callee.name);if("Identifier"!==e.type)return;let o=ey(t.sourceCode.getScope(e),e);if(!o||r.has(o)||1!==o.defs.length)return;r.add(o);let[a]=o.defs,s=bT(a.name?.typeAnnotation,t.sourceCode.getScope(a.name));return s||("Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init?bw(a.node.init,t,r):void 0)},bk=(e,t)=>{for(let r of[e,e.target]){if(!r)continue;let e=r2(r);if(r3(e,t))return e.getName()}},bI=(e,t,r)=>{if(r0.has(e.intrinsicName)||r1.has(e.intrinsicName))return;if(e.isUnion()){let n=e.types.map(e=>bI(e,t,r));if(1===new i(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=>bI(e,t,r)).find(e=>e?.kind==="map");let n=bk(e,r);return bS(n,bo.has(n)?t.getTypeArguments(e).at(-1):void 0)},bj=(e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return bI(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}},bF=(e,t)=>bj(e,t)??bw(e,t),bB=(e,t)=>"truthy"===t?!!e:"not-undefined"===t?void 0!==e:null!=e,bR=(e,t,r,n=new i)=>{if(!e||bd.has(e.type))return!1;if(bc.has(e.type))return bR(e.typeAnnotation,t,r,n);if("TSTypeOperator"===e.type)return"readonly"===e.operator&&bR(e.typeAnnotation,t,r,n);if("TSUnionType"===e.type||"TSIntersectionType"===e.type)return e.types.every(e=>bR(e,t,r,n));if("TSNullKeyword"===e.type)return"not-undefined"===r;if(bm.has(e.type))return"truthy"!==r;if(bf.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&&bB(t,r)}return"TSTypeReference"===e.type&&((e,t,r,n)=>{let o,a,i=bx(e.typeName);if(!i||n.has(i))return!1;n.add(i);let s=(a=bv(o=bE(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=bR(s.node,t,r,n):s?.type==="object"&&(l="truthy"!==r),n.delete(i),l})(e,t,r,n)},bP=(e,t)=>e.isTypeParameter?.()?e.getConstraint()??t.getBaseConstraintOfType(e):e,bL=(e,t,r)=>{if(r0.has(e.intrinsicName))return!1;let n=bP(e,t);return n&&n!==e?bL(n,t,r):!e.isTypeParameter?.()&&(e.isUnion()||e.isIntersection()?e.types.every(e=>bL(e,t,r)):!r.has(e.intrinsicName))},bN=(e,t,r)=>{if(r0.has(e.intrinsicName)||r1.has(e.intrinsicName))return!1;let n=bP(e,t);if(n&&n!==e)return bN(n,t,r);if(e.isUnion()||e.isIntersection())return e.types.every(e=>bN(e,t,r));if(bp.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)||bs.has(bk(e,r))||e.getCallSignatures().length>0||e.getConstructSignatures().length>0},b$=(e,t,r)=>{if(!tf(e)||"Identifier"!==e.callee.type||!ba.has(e.callee.name)||!bC(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=e$(n,t.sourceCode.getScope(n)))?bB(o.value,r):!tP(n)&&bg.has(n.type))})},bM=(e,t,r)=>{let n=b$(bh(e),t,r);if(void 0!==n)return n;let o=bj(e,t)?.valueType;if(o){let{program:e}=t.sourceCode.parserServices,n=e.getTypeChecker();if("truthy"===r?bN(o,n,e):"not-undefined"===r?bL(o,n,new i(["undefined","void"])):bL(o,n,new i(["undefined","void","null"])))return!0}return function e(t,r,n,o={}){let a,s=o.visitedVariables??new i,l=o.checkConstructorValues??!0,u=bA(t,r);if(u?.kind==="map")return!!u.valueType&&bR(u.valueType,r,n);let p=((e,t,r,n)=>{if(!tf(e)||"Identifier"!==e.callee.type||!ba.has(e.callee.name)||!bC(e.callee,t))return;if(n){let n=b$(e,t,r);if(void 0!==n)return n}let o=bb(e).at(-1);return!!o&&bR(o,t,r)})(t=bh(t),r,n,l);if(void 0!==p)return p;let c=((e,t,r)=>{if("Identifier"!==e.type)return;let n=ey(t.sourceCode.getScope(e),e);if(!(!n||r.has(n))&&1===n.defs.length)return n})(t,r,s);if(!c)return!1;s.add(c);let[d]=c.defs,m=(a=bT(d.name?.typeAnnotation,r.sourceCode.getScope(d.name)),a?.kind==="map"?!!a.valueType&&bR(a.valueType,r,n):"Variable"===d.type&&"const"===d.parent.kind&&d.node.id===d.name&&!!d.node.init&&e(d.node.init,r,n,{visitedVariables:s,checkConstructorValues:!1}));return s.delete(c),m}(e,t,r)},bO="logical",bU="ternary",bq="consistent-conditional-object-spread",bV=new i(["==","==="]),bW=new i(["!=","!=="]),b_=e=>tx(e)||tP(e)||ti(e),bz=e=>"SpreadElement"===e.parent.type&&e.parent.argument===e&&"ObjectExpression"===e.parent.parent.type&&e.parent.parent.properties.includes(e.parent);function bK(e,t,r){if(rC(e,t))return!0;if(e.type!==t.type)return!1;switch(e.type){case"AwaitExpression":return bK(e.argument,t.argument,r);case"LogicalExpression":return e.operator===t.operator&&bK(e.left,t.left,r)&&bK(e.right,t.right,r);case"UnaryExpression":return e.operator===t.operator&&e.prefix===t.prefix&&bK(e.argument,t.argument,r);case"UpdateExpression":return!1}return r.getText(e)===r.getText(t)}function bG(e){return ti(e)?"null":tP(e)?"undefined":void 0}function bJ(e){if("BinaryExpression"!==e.type||!bV.has(e.operator)&&!bW.has(e.operator))return;let t=bG(e.left),r=bG(e.right);if(!!t!=!!r)return{reference:t?e.right:e.left,kind:2===e.operator.length?"nullish":t??r,isTrueWhenNullish:bV.has(e.operator)}}let bX=(e,t)=>"null"===e.kind&&"undefined"===t.kind||"undefined"===e.kind&&"null"===t.kind;function bY(e,t){let r=bJ(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=bJ(e.left),o=bJ(e.right);if(n&&o&&bK(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&bX(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&bX(n,o))return{reference:n.reference,isTrueWhenNullish:!1}}}function bH(e,t,r){let n=e4(e,r);return!e7(e,r)&&o3(e,{operator:"&&",property:t})&&(n=`(${n})`),n}function bQ(e,t){let r=e4(e,t);return!e7(e,t)&&oY(e)&&(r=`(${r})`),r}let bZ="default-export-style/inline",b0="default-export-style/separate",b1="default-export-style/suggestion-inline",b2="default-export-style/suggestion-separate",b3="inline",b8="separate",b6="ignore",b9="class",b5="function",b4=()=>({enum:[b3,b8,b6]}),b7=(e,t)=>e?.type==="ExportDefaultDeclaration"&&"Identifier"===e.declaration.type&&e.declaration.name===t,Ee=e=>e.id?.name,Et=e=>{switch(e.type){case"ClassDeclaration":return b9;case"FunctionDeclaration":return b5}},Er=e=>e===b9?"classes":"functions",En=(e,t)=>{let[,r]=e.sourceCode.getRange(t),n=e.sourceCode.getLoc(t).end.line;return rB(e).some(t=>e.sourceCode.getRange(t)[0]>=r&&e.sourceCode.getLoc(t).start.line===n)},Eo=(e,t)=>ey(e,t)?.references.some(e=>!e.init&&e.isWrite())??!1,Ea=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),Ei=(e,t)=>{if(Ea(e))return!0;for(let r of t[e.type]??[]){let n=e[r];if(Array.isArray(n)){if(n.some(e=>e?.type&&Ei(e,t)))return!0;continue}if(n?.type&&Ei(n,t))return!0}return!1},Es=(e,t)=>e.params.every(e=>!rX(e,t.sourceCode.visitorKeys)),El=(e,t,r)=>ey(e,t)?.references.some(e=>!e.init&&e.identifier!==r)??!1,Eu=(e,t)=>{let r=Ee(e);if(r){let t=Et(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||Ea(r.id)||r.init?.type!=="ArrowFunctionExpression"||Ei(r.init,t.sourceCode.visitorKeys)))return r})(e,t);if(n)return{kind:b5,name:n.id.name,declaration:e,functionNode:n.init}},Ep=(e,t)=>e.params.map(e=>t.getText(e)).join(", "),Ec=({context:e,declaration:t,exportDeclaration:r,name:n,scope:o,rangeStartNode:a=t})=>{if(!(e.sourceCode.getCommentsInside(r).length>e.sourceCode.getCommentsInside(t).length||El(o,t.id,"Identifier"===r.declaration.type?r.declaration:void 0))&&"FunctionDeclaration"===t.type&&!t.generator&&!Ei(t,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(t).length&&Es(t,e)&&!rX(t.body,e.sourceCode.visitorKeys))return[{messageId:b2,fix:o=>o.replaceTextRange([e.sourceCode.getRange(a)[0],e.sourceCode.getRange(r)[1]],`const ${n} = ${t.async?"async ":""}(${Ep(t,e.sourceCode)}) => ${e.sourceCode.getText(t.body)};
44
+ export default ${n};`)}]},Ed=({context:e,declaration:t,exportDeclaration:r,expectedStyle:n,kind:o,name:a,scope:i})=>{if(!(n===b6||((e,t,r)=>{let[,n]=e.sourceCode.getRange(t),[o]=e.sourceCode.getRange(r);return rB(e).some(t=>{let[r,a]=e.sourceCode.getRange(t);return r>=n&&a<=o})})(e,t,r)||Eo(i,r.declaration))&&(o!==b5||"FunctionDeclaration"!==t.type||!t.generator)&&!(o===b5&&"FunctionDeclaration"===t.type&&Ei(t,e.sourceCode.visitorKeys))){if(n===b3)return"VariableDeclaration"===t.type?{node:r,messageId:bZ,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||En(e,r)||e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(i).length||El(o,a,r.declaration))&&"ArrowFunctionExpression"===i.type&&!Ei(i,e.sourceCode.visitorKeys)&&0===e.sourceCode.getCommentsInside(i).length&&Es(i,e)&&!rX(i.body,e.sourceCode.visitorKeys))return[{messageId:b1,data:{kind:b5},fix:o=>o.replaceTextRange([e.sourceCode.getRange(t)[0],e.sourceCode.getRange(r)[1]],`export default ${i.async?"async ":""}function ${n}(${Ep(i,e.sourceCode)}) ${"BlockStatement"===i.body.type?e.sourceCode.getText(i.body):`{ return ${e4(i.body,e)}; }`}`)}]})({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}:o===b9&&Ei(t,e.sourceCode.visitorKeys)?void 0:e.sourceCode.getCommentsInside(r).length>0||En(e,r)?{node:r,messageId:bZ,data:{kind:o}}:{node:r,messageId:bZ,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===b8&&o===b5&&"FunctionDeclaration"===t.type)return{node:r,messageId:b0,data:{kind:o,style:"const arrow function"},suggest:Ec({context:e,declaration:t,exportDeclaration:r,name:a,scope:i})}}},Em=({context:e,exportDeclaration:t,expectedStyle:r,kind:n})=>{let{declaration:o}=t,a=Ee(o),i=e.sourceCode.getScope(t);if(!(!a||r===b6||r===b3||Eo(i,a)||n===b5&&(o.generator||Ei(o,e.sourceCode.visitorKeys)))){if(n===b5)return{node:t,messageId:b0,data:{kind:n,style:"const arrow function"},suggest:Ec({context:e,declaration:o,exportDeclaration:t,name:a,scope:i,rangeStartNode:t})};if(!(n===b9&&Ei(o,e.sourceCode.visitorKeys)))return e.sourceCode.getCommentsInside(t).length>e.sourceCode.getCommentsInside(o).length?{node:t,messageId:b0,data:{kind:n,style:"class declaration"}}:{node:t,messageId:b0,data:{kind:n,style:"class declaration"},fix:r=>{let{declaration:n}=t;return r.replaceText(t,`${e.sourceCode.getText(n)}
45
+ export default ${n.id.name};`)}}}},Ef={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=Et(r),a=Ee(r);if(!n||!a)continue;let i=Em({context:e,exportDeclaration:o,expectedStyle:t[Er(n)],kind:n});if(i)return i;continue}let a=r.body[n+1],i=Eu(o,e);if(!i||!b7(a,i.name))continue;let s=Ed({context:e,exportDeclaration:a,expectedStyle:t[Er(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:b4(),classes:b4()},additionalProperties:!1}],defaultOptions:[{functions:b3,classes:b3}],messages:{[bZ]:"Prefer declaring this default-exported {{kind}} inline.",[b0]:"Prefer declaring this default-exported {{kind}} as a separate {{style}}.",[b1]:"Use an inline default {{kind}} declaration.",[b2]:"Use a separate const arrow function default export."},languages:["js/js"]}};function Eg(e){for(;;){let t=rj(e);if(t!==e){e=t;continue}if(e?.type!=="ParenthesizedExpression")return e;e=e.expression}}function Ey(e,t){return ey(t.sourceCode.getScope(e),e)}let Eh="no-array-concat-in-loop",Ex="no-array-front-mutation",Eb=["stream.unshift","this.unshift","this.stream.unshift","process.stdin.unshift","process.stdout.unshift","process.stderr.unshift"],EE="no-array-sort-for-min-max/error",Ev="no-array-sort-for-min-max/suggestion",EC=e=>to(e)&&0===e.value,ED=(e,t)=>{if(!tw(e,{methods:["sort","toSorted"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||nv(e.callee.object,t)||rY(e.callee.object))return;let[r]=e.arguments,n=(e=>{if(!tv(e)||e.async||e.generator||2!==e.params.length||e.params.some(e=>"Identifier"!==e.type))return;let t=rj((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(rC(t.left,r)&&rC(t.right,n))return"ascending";if(rC(t.left,n)&&rC(t.right,r))return"descending"}})(r);if(n)return{direction:n,node:e.callee.object}},ES=(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:EE,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=ox(a)?i.getText(a):`(${i.getText(a)})`,`Math.${s}(...${r})`);l.suggest=[{messageId:Ev,data:{replacement:o},fix:t=>t.replaceText(e,o)}]}return l},ET="no-boolean-sort-comparator",EA="no-boolean-sort-comparator/suggestion",Ew=new i(["sort","toSorted"]),Ek=new i([">",">=","<","<="]),EI=(e,t,r,n)=>(e=rj(e),t=rj(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?!!rC(e.property,t.property):e.property.name===t.property.name)&&EI(e.object,t.object,r,n),Ej=(e,t)=>{for(;rI(e);){if(e.typeAnnotation&&n1(e.typeAnnotation,t,t.sourceCode.getScope(e)))return!0;e=e.expression}return!1},EF="no-chained-comparison/error",EB="no-chained-comparison/suggestion",ER=new i(["<",">","<=",">="]),EP=new i(["===","!==","==","!="]),EL=ER.union(EP),EN=e=>"BinaryExpression"===e.type&&EL.has(e.operator),E$="no-constant-zero-expression/error",EM="no-constant-zero-expression/suggestion",EO="no-duplicate-logical-operands",EU="no-duplicate-logical-operands/suggestion",Eq=new i(["Identifier","ThisExpression","Literal"]),EV=new i(["Identifier","ThisExpression"]),EW=e=>{if(uE(e=rj(e)))return!1;switch(e.type){case"Identifier":case"Super":case"ThisExpression":return!0;case"MemberExpression":var t;return EW(e.object)&&(!e.computed||(t=rj(t=e.property),Eq.has(t.type)));default:return!1}},E_="no-impossible-length-comparison",Ez={"<":">","<=":">=",">":"<",">=":"<=","===":"===","!==":"!==","==":"==","!=":"!="},EK="no-invalid-character-comparison",EG=new i(["==","===","!=","!=="]),EJ=(e,t)=>!!(tw(e,{method:"charAt",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&on(e.callee.object,t)||tw(e,{method:"at",maximumArguments:1,optionalCall:!1,optionalMember:!1})&&on(e.callee.object,t))||"MemberExpression"===e.type&&e.computed&&!e.optional&&(e=>{if(to(e))return!0;if(!tt(e))return!1;let t=Number(e.value);return Number.isSafeInteger(t)&&t>=0&&String(t)===e.value})(e.property)&&on(e.object,t),EX="no-loop-iterable-mutation",EY=["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"],EH=["add","clear","delete"],EQ=["clear","delete","set"],EZ={array:new i(EY),set:new i(EH),map:new i(EQ),unknown:new i([...EY,...EH,...EQ])},E0=new i(["entries","keys","values"]),E1=new i(["ArrowFunctionExpression","ClassDeclaration","ClassExpression","FunctionDeclaration","FunctionExpression"]);function E2(e,t){return nE(e,t)?"array":nk(e,t)?"set":nI(e,t)?"map":void 0}function E3(e){return"VariableDeclaration"===e.left.type?e.left.declarations[0].id:e.left}function E8(e){return"Identifier"===(e=rj(e)).type?e:void 0}function E6(e){if("ArrayPattern"!==(e=rj(e)).type)return;let[t]=e.elements;return t&&E8(t)}function E9(e,t){if(uE(e=rj(e)))return;if(ub(e))return{collectionKind:E2(e,t),reference:e,method:"direct"};if("CallExpression"!==e.type||"MemberExpression"!==e.callee.type||e.arguments.length>0)return;let r=eO(e.callee,t.sourceCode.getScope(e.callee));if(!(!E0.has(r)||uE(e.callee.object))&&ub(e.callee.object))return{collectionKind:E2(e.callee.object,t),reference:e.callee.object,method:r}}function E5(e,t){let r=E3(e);return"keys"===t.method?E8(r):"entries"===t.method||"direct"===t.method&&"set"!==t.collectionKind?E6(r):void 0}function E4(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=E3(e),"entries"===t.method?E6(r):"direct"!==t.method||"map"!==t.collectionKind?E8(r):void 0),a=E5(e,t),i=(n=E3(e),"set"===t.collectionKind&&("direct"===t.method||"values"===t.method)?E8(n):"direct"===t.method&&"map"!==t.collectionKind?E8(n)??E6(n):E5(e,t));return{addArgumentIdentifier:o,collectionKind:t.collectionKind,deleteArgumentIdentifier:i,iterable:t.reference,loopBody:e.body,setKeyIdentifier:a}}function*E7(e){"Identifier"===(e=rj(e)).type?yield e:"MemberExpression"===e.type&&(yield*E7(e.object),e.computed&&(yield*E7(e.property)))}function ve(e,t,r){if(!ux(e,t))return!1;let n=[...E7(e)],o=[...E7(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=ey(r.sourceCode.getScope(e),e),i=ey(r.sourceCode.getScope(n),n),a||i?a===i:e.name===n.name})}function vt(e,t,r){let[n]=e.arguments;return!!(t&&n&&ve(n,t,r))}function vr(e,t,r,n){return"add"===r&&vt(e,t.addArgumentIdentifier,n)||"set"===r&&vt(e,t.setKeyIdentifier,n)}let vn="no-selector-as-dom-name",vo=["add","remove","contains","toggle","replace"],va=/^[#.]-?[A-Z_a-z][\w-]*$/u,vi=new i([".","#"]),vs=e=>vi.has(e?.[0]),vl=e=>tn(e)??("TemplateLiteral"===e.type&&e.quasis[0].value.cooked),vu=(e,t,r,n)=>({node:e,messageId:vn,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(va.test(t))return e=>e.removeRange(o)}})(e,t,r,n)}),vp=(e,t)=>e.map(e=>({node:e,expectedPrefix:t})),vc="no-useless-compound-assignment/error",vd="no-useless-compound-assignment/remove",vm="no-useless-compound-assignment/replace",vf=new o([["+=",0],["-=",0],["*=",1],["/=",1],["**=",1]]),vg="no-useless-delete-check",vy="removeCheck",vh={considerGetters:!0},vx=new i(["Map","Set","WeakMap","WeakSet"]),vb=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),vE=new i(["ClassName","FunctionName"]),vv=new i(["TSConstructorType","TSFunctionType","TSObjectKeyword"]),vC=e=>null!==e&&("object"==typeof e||"function"==typeof e),vD=e=>!!vv.has(e?.type)||e?.type==="TSUnionType"&&e.types.every(e=>vD(e)),vS=(e,t)=>{if("Identifier"!==e.type)return!1;let r=ey(t.sourceCode.getScope(e),e);return r?.defs.some(e=>vE.has(e.type))??!1},vT=(e,t)=>{let r=e$(e,t.sourceCode.getScope(e));return r&&"symbol"!=typeof r.value&&!vC(r.value)?String(r.value):void 0},vA=(e,t)=>{let r=e$(e,t.sourceCode.getScope(e));if(r)return vC(r.value);let n=rq(rj(e),t);if(n){let e=rj(n),r=e$(e,t.sourceCode.getScope(e));if(r)return vC(r.value);if(vb.has(e.type))return!0}return!vS(rj(e),t)&&vD(((e,t)=>{if("Identifier"!==(e=rj(e)).type)return;let r=ey(t.sourceCode.getScope(e),e);return r?.defs[0]?.name?.typeAnnotation?.typeAnnotation??e.typeAnnotation?.typeAnnotation})(e,t))},vw=(e,t)=>!ez(e,t.sourceCode,vh),vk=(e,t)=>tw(e,{method:t,argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}),vI=(e,t,r)=>n=>{if(r$(r,r.sourceCode.getRange(e)))return;let o=r.sourceCode.getText(t.parent);return o.trimEnd().endsWith(";")||(o+=";"),oD(r.sourceCode.getTokenBefore(e),r,o)&&(o=`;${o}`),n.replaceText(e,o)},vj="no-useless-logical-operand",vF=new o([["&&",!0],["||",!1]]),vB=new o([["&&",!1],["||",!0]]),vR=new i(["FunctionExpression","ClassExpression","ObjectExpression"]),vP="prefer-boolean-return",vL=new i(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function vN(e){if(e){if("BlockStatement"===e.type){let t=e.body.filter(({type:e})=>"EmptyStatement"!==e);if(1===t.length)return vN(t[0])}return e}}let v$=e=>{if(e?.type==="ReturnStatement"&&e.argument?.type==="Literal"&&"boolean"==typeof e.argument.value)return e.argument.value};function vM(e,t){switch(e.type){case"Literal":return"boolean"==typeof e.value;case"UnaryExpression":return["!","delete"].includes(e.operator);case"BinaryExpression":return vL.has(e.operator);case"LogicalExpression":return vM(e.left,t)&&vM(e.right,t);case"CallExpression":return tU(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 vO="prefer-flat-math-min-max",vU=["min","max"],vq=(e,t)=>tw(e,{object:"Math",method:t,optionalCall:!1,optionalMember:!1}),vV=(e,t)=>{let r=[];for(let n of e.arguments){if(vq(n,t)){r.push(...vV(n,t));continue}r.push(n)}return r},vW="prefer-hoisting-branch-code/start",v_="prefer-hoisting-branch-code/end",vz="prefer-hoisting-branch-code/suggestion",vK=new i(["await using","using"]),vG=(e,t)=>ez(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),vJ=(e,t)=>{let r=t.getTokens(e),n=r.at(-1);return n?.type==="Punctuator"&&";"===n.value?r.slice(0,-1):r},vX=(e,t,r)=>{let n=vJ(e,r),o=vJ(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 vY(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 vH({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=>!rU(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 r$(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&&r$(a,[r+1,n]))return!0;if(!i.isStart){let[,r]=t.getRange(e.body.at(-1)),[,n]=t.getRange(e);if(r$(a,[r,n-1]))return!0}return r$(a,vY(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"&&vK.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?vW:v_};if(p){let i=function({ifStatement:e,blocks:t,leading:r,trailing:n,isStart:o},a){let{sourceCode:i}=a,s=rw(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=rw(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&&oD(t,a,c)?";":"";yield l.insertTextBefore(e,`${r}${c}
46
+ ${s}`)}else{let t=i.getLastToken(p.at(-1)),r=i.getTokenAfter(e),n=r&&oD(t,a,r.value)?";":"";yield l.insertTextAfter(e,`
47
+ ${s}${c}${n}`)}for(let e of t)yield l.removeRange(vY(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(vG(r.test,t))return!1;return!0}(e,s)&&u.every(e=>"ExpressionStatement"===e.type&&!vG(e,s))?c.fix=i:c.suggest=[{messageId:vz,fix:i}]}return c}let{parse:vQ}=sf,vZ="prefer-single-replace",v0=new i(["g","m","s"]),v1=new o([["\\",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 v2(e){if(!tw(e,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1,optionalMember:!1,computed:!1}))return;let[t]=e.arguments;if(tt(t)){if("replaceAll"!==e.callee.property.name)return;return 1===t.value.length?t.value:void 0}if(ta(t))return function({pattern:e,flags:t}){let r;if(t.includes("g")){for(let e of t)if(!v0.has(e))return;try{r=vQ(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 v3="consistent-tuple-labels",v8="no-invalid-well-known-symbol-methods/async-dispose",v6="no-invalid-well-known-symbol-methods/dispose-generator",v9="no-invalid-well-known-symbol-methods/sync-iterator",v5="no-invalid-well-known-symbol-methods/async-iterator",v4="no-invalid-well-known-symbol-methods/suggestion",v7=new i(["Promise","PromiseLike"]),Ce=new i(["dispose","iterator","asyncIterator"]);function Ct(e){return"TSTypeReference"===e.type&&"Identifier"===e.typeName.type&&v7.has(e.typeName.name)}function Cr(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(!Ce.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:v6};let a=!o.async&&(!!(r=o.returnType?.typeAnnotation)&&("TSTypeReference"===r.type?Ct(r):"TSUnionType"===r.type&&r.types.some(e=>Ct(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===oc(t.getReturnTypeOfSignature(o),t);return r.getTypeAtLocation(e).getCallSignatures().some(e=>!0===oc(t.getReturnTypeOfSignature(e),t))}catch{return!1}}(o,t));if("dispose"===n&&(o.async||a))return{node:e.key,messageId:v8,fix:t=>t.replaceText(e.key.property,"asyncDispose")};if("iterator"===n&&(o.async||a)){let t={node:e.key,messageId:v9};return o.generator&&(t.suggest=[{messageId:v4,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:v5}}let Cn="after-suspension",Co="in-generator",Ca="in-nested-function",Ci=["preventDefault","stopImmediatePropagation","stopPropagation"],Cs="prefer-abort-signal-timeout",Cl="prefer-abort-signal-timeout/suggestion",Cu=new i(["reason","throwIfAborted"]),Cp=(e,t)=>{let r,{parent:n}=e;if(!(!tT(n,{property:"signal",computed:!1,optional:!1})||n.object!==e||nL(n)||("ForInStatement"===n.parent.type||"ForOfStatement"===n.parent.type)&&n.parent.left===n||tT(n.parent)&&n.parent.object===n&&(r=n.parent,Cu.has(eO(r,t.sourceCode.getScope(r))))||(e=>{let{expression:t,parent:r}=(e=>{let t=e,{parent:r}=e;for(;rI(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)||r$(t,t.sourceCode.getRange(n))))return n},Cc=(e,t,r,n)=>{let o=ey(n.sourceCode.getScope(r),e);return o&&o!==t},Cd="prefer-aggregate-error",Cm=/[Ee]rrors$|[Ee]rror(?:List|Array|Collection)$/u,Cf=new i(s4);function Cg(e){for(;e?.type==="ParenthesizedExpression";)e=e.expression;return rj(e)}function Cy(e){if("Identifier"===e.type)return e.name;if("TSQualifiedName"===e.type){let t=Cy(e.left);return t?`${t}.${e.right.name}`:void 0}}function Ch(e){return e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e,e?.type==="TSTypeOperator"&&"readonly"===e.operator&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType"?Ch(e.typeAnnotation):e}function Cx(e,t,r,n=new i){switch(e=Ch(e),e?.type){case"TSTypeReference":{let o=Cy(e.typeName);if(!o)return!1;let a=oA(o,t);if(Cf.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&&Cx(i.node.typeAnnotation,s,r,n);return n.delete(o),l}case"TSUnionType":return e.types.every(e=>Cx(e,t,r,n));case"TSIntersectionType":return e.types.some(e=>Cx(e,t,r,n));default:return!1}}function Cb(e,t){let r;if(tT(e=Cg(e),{property:"length",optional:!1})&&"Identifier"===e.object.type&&(r=e.object.name,Cm.test(r))&&nE(e.object,t)&&function(e,t){let r=oA(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 i){switch(t=Ch(t),t?.type){case"TSArrayType":return Cx(t.elementType,r,n,o);case"TSTupleType":return t.elementTypes.length>0&&t.elementTypes.every(e=>Cx("TSNamedTupleMember"===e.type?e.elementType:"TSRestType"===e.type?e.typeAnnotation:e,r,n,o));case"TSTypeReference":return function(t,r,n,o){let a=Cy(t.typeName),i=t.typeArguments?.params??t.typeParameters?.params;if(("Array"===a||"ReadonlyArray"===a)&&i?.length===1)return Cx(i[0],r,n,o);if(!a||o.has(a))return!1;o.add(a);let s=oA(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 i){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 s=r.getTypeArguments(t);return s.length>0&&s.every(e=>(function e(t,r,n,o=new i){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 s=r2(t);return!!(Cf.has(s?.getName())&&r3(s,n))||r8(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 CE=(e,t,r)=>{var n;if(("!=="===e||"!="===e)&&te(Cg(t),0))return!0;let o=(n=Cg(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)},Cv=e=>"LogicalExpression"!==(e=Cg(e)).type||"&&"!==e.operator?[e]:[...Cv(e.left),...Cv(e.right)],CC={resize:"Prefer ResizeObserver over a resize listener with layout reads.",scroll:"Prefer IntersectionObserver over a scroll listener with layout reads."},CD=new i(Object.keys(CC)),CS=new i(["globalThis","self","window"]),CT=new i(["getBoundingClientRect","getClientRects"]),CA=new i(["clientHeight","clientLeft","clientTop","clientWidth","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","scrollHeight","scrollWidth"]),Cw=new i(["innerHeight","innerWidth"]),Ck=new i(["height","width"]),CI=new i(["Window"]),Cj=new i(["VisualViewport"]),CF=new i(["Document","Element","HTMLElement","Node","SVGElement","VisualViewport","Window"]),CB=(e,t,r)=>{let n;if(r0.has(e.intrinsicName))return!1;if(r1.has(e.intrinsicName)||e.intrinsicName)return!0;if(e.isUnion()||e.isIntersection())return e.types.every(e=>CB(e,t,r));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CB(o,t,r);let a=r2(e);return!(!a||r8(e,t).some(e=>!CB(e,t,r)))&&(!r3(a,r)||(n=a.getName(),!(CF.has(n)||/^HTML\w*Element$/.test(n)||/^SVG\w*Element$/.test(n))))},CR=(e,t,r,n)=>{if(r0.has(e.intrinsicName)||r1.has(e.intrinsicName))return!1;if(e.isUnion()){let o=e.types.filter(e=>!r1.has(e.intrinsicName));return o.length>0&&o.every(e=>CR(e,t,r,n))}if(e.isIntersection())return e.types.some(e=>CR(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return CR(o,t,r,n);let a=r2(e);return!!(a&&r3(a,r)&&n.has(a.getName()))||r8(e,t).some(e=>CR(e,t,r,n))},CP=(e,t,r)=>{let{parserServices:n}=t.sourceCode;if(!n?.program)return!1;try{let{program:t}=n,o=t.getTypeChecker();return CR(n.getTypeAtLocation(e),o,t,r)}catch{return!1}},CL=(e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r,n=t.getTypeChecker();return CB(r.getTypeAtLocation(e),n,t)}catch{return!1}},CN=e=>e.computed||"Identifier"!==e.property.type?tn(rj(e.property)):e.property.name,C$=(e,t)=>e.properties.some(e=>t.has((e=>{if("Property"===e.type)return e.computed||"Identifier"!==e.key.type?tn(rj(e.key)):e.key.name})(e))),CM=(e,t)=>"Identifier"===e.type&&CS.has(e.name)&&of(e,t),CO=e=>nL(e)&&"UpdateExpression"!==e.parent.type&&("AssignmentExpression"!==e.parent.type||e.parent.left!==e||"="===e.parent.operator),CU=(e,t)=>"Identifier"===(e=rj(e)).type?"visualViewport"===e.name&&of(e,t):"MemberExpression"===e.type&&"visualViewport"===CN(e)&&CM(rj(e.object),t),Cq=(e,t)=>{var r;return CM(e=rj(e),t)||("Identifier"===(r=rj(r=e)).type?"document"===r.name&&of(r,t):"MemberExpression"===r.type&&"document"===CN(r)&&CM(rj(r.object),t))||CU(e,t)},CV=(e,t,r)=>{let n=rj(t);return C$(e,Cw)&&(CM(n,r)||CP(t,r,CI))||C$(e,Ck)&&(CU(n,r)||CP(t,r,Cj))||C$(e,CA)&&!Cq(n,r)&&!CL(t,r)},CW=(e,t,r=e)=>{let n,o,a,i;if(!e||e!==r&&tv(e))return!1;if(a=e,i=t,tm(a,void 0,tp)&&"MemberExpression"===a.callee.type&&CT.has(CN(a.callee))&&!Cq(a.callee.object,i)&&!CL(a.callee.object,i)||tI(e)&&Cw.has(e.name)&&!CO(e)&&of(e,t)||"MemberExpression"===e.type&&!CO(e)&&(n=CN(e),o=rj(e.object),Cw.has(n)&&(CM(o,t)||CP(e.object,t,CI))||Ck.has(n)&&(CU(o,t)||CP(e.object,t,Cj))||CA.has(CN(e))&&!Cq(e.object,t)&&!CL(e.object,t))||("VariableDeclarator"===e.type&&"ObjectPattern"===e.id.type&&e.init?CV(e.id,e.init,t):"AssignmentExpression"===e.type&&"ObjectPattern"===e.left.type&&CV(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=>CW(e,t,r)))return!0;continue}if(CW(o,t,r))return!0}return!1},C_="prefer-set-methods/union",Cz="prefer-set-methods/intersection",CK="prefer-set-methods/intersection-suggestion",CG="prefer-set-methods/difference",CJ="prefer-set-methods/difference-suggestion",CX=(e,t)=>tf(e,{name:"Set",argumentsLength:1})&&of(e.callee,t),CY=(e,t)=>{let r=e4(e,t);return oZ(e,t)&&!e7(e,t)?`(${r})`:r},CH=(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)&&oD(r.sourceCode.getTokenBefore(e),r,t)?`;${t}`:t,CQ=(e,t)=>("ParenthesizedExpression"===e.type||rI(e))&&e.expression===t,CZ=e=>{for(;e.parent;){let{parent:t}=e;if(CQ(t,e)){e=t;continue}break}return e},C0=(e,t)=>e?.type==="SpreadElement"&&"Set"===oM(e.argument,t),C1=(e,t,r)=>{if(!(!tw(e,{method:"has",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!rC(e.arguments[0],t)||rC(e.callee.object,t))&&"Set"===oM(e.callee.object,r))return e.callee.object},C2=(e,t,r)=>{var n;if(r.sourceCode.getCommentsInside(t).length>0||(n=CZ(n=e),n.parent?.type==="MemberExpression"&&n.parent.object===n)||e===t&&rI(e.parent))return;let o=((e,t)=>{if(!tw(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&&C0(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=C1(e,t,r);if(n)return{method:"intersection",messageId:Cz,suggestionMessageId:CK,otherSet:n};if("UnaryExpression"!==e.type||"!"!==e.operator||!e.prefix)return;let o=C1(e.argument,t,r);if(o)return{method:"difference",messageId:CG,suggestionMessageId:CJ,otherSet:o}})(n.body,n.params[0],t);if(!(!o||ez(o.otherSet,t.sourceCode,{considerGetters:!0})))return{messageId:o.messageId,suggestionMessageId:o.suggestionMessageId,replacement:`${CY(r,t)}.${o.method}(${e4(o.otherSet,t)})`}})(e,r);if(o)return{node:t,messageId:o.messageId,suggest:[{messageId:o.suggestionMessageId,fix:e=>e.replaceText(t,CH(t,o.replacement,r))}]}},C3="prefer-toggle-attribute/error",C8="prefer-toggle-attribute/suggestion",C6=(e,t,r)=>{let n=e4(e,t);return r?"UnaryExpression"===e.type&&"!"===e.operator&&e.prefix&&t.sourceCode.getCommentsInside(e).length===t.sourceCode.getCommentsInside(e.argument).length?C6(e.argument,t,!1):(!e7(e,t.sourceCode)&&o2(e,"!")&&(n=`(${n})`),`!${n}`):e7(e,t.sourceCode)||"SequenceExpression"!==e.type?n:`(${n})`},C9=(e,t,r)=>tw(e,{methods:t,argumentsLength:r,optionalCall:!1,computed:!1});function C5(e){if(e?.type==="ChainExpression"&&(e=e.expression),C9(e,["removeAttribute","hasAttribute"],1)||C9(e,["setAttribute"],2)){let{callee:t}=e,[r,n]=e.arguments;if(tn(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||te(n,"")}}}function C4(e){if(e){if("BlockStatement"===e.type){if(1!==e.body.length)return;e=e.body[0]}return"ExpressionStatement"===e.type&&(e=e.expression),C5(e)}}let C7=(e,t)=>e.isOptional===t.isOptional&&rC(e.receiver,t.receiver)&&rC(e.attributeName,t.attributeName),De=(e,t)=>oa(e.receiver)||nR(e.receiver,t),Dt="prefer-url-search-parameters/error",Dr="prefer-url-search-parameters/suggestion",Dn=new i(["node:url","url"]),Do=e=>"Type"===e.type||"ImportBinding"===e.type&&oS(e.node),Da=(e,t,r)=>{let n=ey(r.sourceCode.getScope(t),e);return!n||n.defs.every(e=>Do(e))},Di=(e,t)=>tn(rj(e))===t,Ds=(e,t)=>{let r=t.sourceCode.getText(e);return"SequenceExpression"===e.type?`(${r})`:r},Dl=(e,t)=>{if(!tw(e=rj(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(tw(e=rj(e),{method:"split",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&!(!Di(e.arguments[0],"&")||or(e.callee.object,t)||(n=e$(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!!tw(e=rj(e),{method:"split",minimumArguments:1,maximumArguments:2,computed:!1,optionalCall:!1,optionalMember:!1})&&!!om(rj(e.callee.object),t)&&!!Di(e.arguments[0],"=")&&(1===e.arguments.length||2===(n=e.arguments[1],e$(n,r.sourceCode.getScope(n))?.value))})(o.returnExpression,o.parameter,t))return{node:e,query:r.callee.object}},Du=(e,t)=>`new URLSearchParams(${Ds(e,t)})`,Dp=(e,t,r,n)=>{let{sourceCode:o}=n,[a,i]=o.getRange(e),[s,l]=e5(t,n);return o.text.slice(a,s)+r+o.text.slice(l,i)},Dc=(e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=e5(t,r);return[[n,a],[i,o]]},Dd=({node:e,query:t,replacement:r,preservedNodes:n=[t]},o)=>{let a=(({node:e,replacement:t,preservedNodes:r},n)=>{let o;if(!(!(!(o=ey(n.sourceCode.getScope(e),"URLSearchParams"))||o.defs.every(e=>Do(e))||o.defs.some(e=>(e=>{if("ImportBinding"!==e.type)return!1;let{node:t,parent:r}=e;return Dn.has(r.source.value)&&"type"!==r.importKind&&"ImportSpecifier"===t.type&&"type"!==t.importKind&&"Identifier"===t.imported.type&&"URLSearchParams"===t.imported.name})(e)))||rL(n,e,r)))return[{messageId:Dr,data:{replacement:t},fix:r=>r.replaceText(e,t)}]})({node:e,replacement:r,preservedNodes:n},o);if(a)return{node:e,messageId:Dt,suggest:a}},Dm="no-unsafe-promise-all-settled-values",Df=new i(["PromiseSettledResult","PromiseRejectedResult"]),Dg=new i(["PromiseFulfilledResult"]),Dy=new i(["ChainExpression","ParenthesizedExpression","TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion"]),Dh=e=>e?.type==="ArrowFunctionExpression"||e?.type==="FunctionExpression"||e?.type==="FunctionDeclaration",Dx=e=>{for(;e&&Dy.has(e.type);)e=e.expression;return e},Db=e=>tw(Dx(e),{object:"Promise",method:"allSettled",argumentsLength:1,optionalCall:!1,optionalMember:!1}),DE=e=>e?.parent.type==="ReturnStatement"&&e.parent.argument===e,Dv=e=>tw(Dx(e),{method:"filter",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1});function DC(e){return"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?DC(e.right):void 0}function DD(e){for(e=e?.type==="TSTypeAnnotation"?e.typeAnnotation:e;e?.type==="TSParenthesizedType"||e?.type==="TSTypeOperator";)e=e.typeAnnotation;return e?.type==="TSArrayType"?e.elementType:e?.type==="TSTypeReference"&&"Identifier"===e.typeName.type&&("Array"===e.typeName.name||"ReadonlyArray"===e.typeName.name)?e.typeArguments?.params[0]??e.typeParameters?.params[0]:void 0}function DS(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DC(t.typeName);return Df.has(e)}return t?.type==="TSUnionType"&&t.types.some(t=>e(t))}(DD(e))}function DT(e){return function e(t){if(t?.type==="TSTypeReference"){let e=DC(t.typeName);return Dg.has(e)}return t?.type==="TSUnionType"&&t.types.every(t=>e(t))}(DD(e))}function DA(e){if(e.isUnion())return e.types.every(e=>DA(e));let t=e.aliasSymbol??e.getSymbol();return Dg.has(t?.getName())}function Dw(e,t){if((e=t.getNonNullableType(e)).isUnion()){let r=e.types.map(e=>Dw(e,t));return r.every(Boolean)?t.getUnionType(r):void 0}if(t.isArrayType(e)||t.isTupleType(e))return t.getTypeArguments(e)[0]}function Dk(e,t){let{parserServices:r}=t.sourceCode;if(r?.program)try{return{checker:r.program.getTypeChecker(),type:r.getTypeAtLocation(e)}}catch{}}let DI=e=>e?.type==="TSAsExpression"||e?.type==="TSTypeAssertion";function Dj(e,t,r=new i){var n;let o;return!!(DI(o=e)&&DS(o.typeAnnotation))||!!(e=Dx(e))&&(n=Dx(n=e),!!(n?.type==="AwaitExpression"&&Db(n.argument)||DS(e.typeAnnotation)||function(e,t){let r=Dk(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=Dw(n,o);return!!(a&&function e(t){if(t.isUnion())return t.types.some(t=>e(t));let r=t.aliasSymbol??t.getSymbol();return Df.has(r?.getName())}(a))}(e,t))||(Dv(e)?Dj(e.callee.object,t,r):"Identifier"===e.type&&function(e,t,r){let n=ey(t.sourceCode.getScope(e),e);if(!n||r.has(n)||1!==n.defs.length)return!1;r.add(n);let[o]=n.defs,a=!!(DS(o.name?.typeAnnotation)||"Variable"===o.type&&"const"===o.parent.kind&&o.node.id===o.name&&o.node.init&&Dj(o.node.init,t,r));return r.delete(n),a}(e,t,r)))}let DF=e=>(e=Dx(e),e?.type==="Identifier"?e.name:void 0),DB=e=>{if(e=Dx(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"status"===eO(t)&&"Identifier"===t.value.type)return t.value}},DR=e=>{if(e?.type==="Literal"&&("fulfilled"===e.value||"rejected"===e.value))return e.value};function DP(e,t){return e=Dx(e),!!(t.statusVariable&&D_(e,t.statusVariable,t.context)||!t.statusVariable&&t.statusName&&e?.type==="Identifier"&&e.name===t.statusName||t.entryVariable&&e?.type==="MemberExpression"&&D_(e.object,t.entryVariable,t.context)&&"status"===eO(e))||!!(!t.entryVariable&&t.entryName&&e?.type==="MemberExpression"&&DF(e.object)===t.entryName&&"status"===eO(e))}function DL(e,t){if(e=Dx(e),e?.type!=="BinaryExpression"||!["===","==","!==","!="].includes(e.operator))return;let r=DP(e.left,t)?DR(e.right):DP(e.right,t)?DR(e.left):void 0;if(!r)return;let n="==="===e.operator||"=="===e.operator;return n&&"fulfilled"===r||!n&&"rejected"===r?"fulfilled":"unfulfilled"}function DN(e,t){return"fulfilled"===DL(e=Dx(e),t)||e?.type==="LogicalExpression"&&"&&"===e.operator&&(DN(e.left,t)||DN(e.right,t))}function D$(e,t){return"unfulfilled"===DL(e=Dx(e),t)||e?.type==="LogicalExpression"&&"||"===e.operator&&(D$(e.left,t)||D$(e.right,t))}let DM=(e,t,r)=>"ConditionalExpression"===e.type&&(e.consequent===t&&DN(e.test,r)||e.alternate===t&&D$(e.test,r)),DO=(e,t,r)=>"LogicalExpression"===e.type&&("&&"===e.operator&&e.right===t&&DN(e.left,r)||"||"===e.operator&&e.right===t&&D$(e.left,r)),DU=(e,t,r)=>"IfStatement"===e.type&&(e.consequent===t&&DN(e.test,r)||e.alternate===t&&D$(e.test,r)),Dq=e=>{let t;if(!Dh(e)||0===e.params.length)return!1;let r={entryName:DF(e.params[0]),statusName:(t=e.params[0],DB(t)?.name)},n=Dx(e.body);if(n?.type==="BlockStatement"){let[e]=n.body;return 1===n.body.length&&"ReturnStatement"===e.type&&e.argument&&DN(e.argument,r)}return DN(n,r)};function DV(e){if(e=Dx(e),e?.type==="ObjectPattern"){for(let t of e.properties)if("Property"===t.type&&!t.computed&&"value"===eO(t))return t}}let DW=(e,t)=>"MemberExpression"===e.type&&"property"===t&&!e.computed||["Property","PropertyDefinition","MethodDefinition"].includes(e.type)&&"key"===t&&!e.computed;function D_(e,t,r){return e=Dx(e),e?.type==="Identifier"&&t&&ey(r.sourceCode.getScope(e),e)===t}function Dz(e){for(e=Dx(e);Dv(e);){if(Dq(e.arguments[0]))return!0;e=Dx(e.callee.object)}return!1}function DK(e,t,{knownPromiseSettledResultArray:r=!1}={}){let n,o;if(!tw(e,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})||!r&&!Dj(e.callee.object,t)||function e(t,r,n=new i){return!!(DI(t)&&DT(t.typeAnnotation)||function(e,t){let r=Dk(e,t);if(!r)return!1;let{type:n,checker:o}=r,a=Dw(n,o);return!!(a&&DA(a))}(t=Dx(t),r))||("Identifier"===t.type?function(t,r,n){let o=ey(r.sourceCode.getScope(t),t);if(!o||n.has(o)||1!==o.defs.length)return!1;n.add(o);let[a]=o.defs,i=!!(DT(a.name?.typeAnnotation)||"Variable"===a.type&&"const"===a.parent.kind&&a.node.id===a.name&&a.node.init&&e(a.node.init,r,n));return n.delete(o),i}(t,r,n):Dv(t)&&Dz(t)&&Dj(t,r))}(e.callee.object,t))return;let[a]=e.arguments;if(!Dh(a)||0===a.params.length)return;let[s]=a.params;if(function(e,t){let r=Dk(e,t);if(!r)return!1;let{type:n}=r;return DA(n)}(s,t))return;let l=DV(s);if(l&&"Identifier"!==l.value.type)return{node:l.key,messageId:Dm};let u=DF(s),p=u&&ey(t.sourceCode.getScope(s),s),c=(n=DV(s),o=n?.value,o?.type==="Identifier"?o:o?.type==="AssignmentPattern"&&"Identifier"===o.left.type?o.left:void 0),d=c&&ey(t.sourceCode.getScope(c),c),m=DB(s),f=m?.name,g=m&&ey(t.sourceCode.getScope(m),m),y=function e(t,r){var n;if(n=t=Dx(t),n=Dx(n),(n?.type==="MemberExpression"&&D_(n.object,r.entryVariable,r.context)&&"value"===eO(n)||n?.type==="Identifier"&&D_(n,r.valueVariable,r.context))&&!function(e,t){for(let r=e,n=e.parent;n&&"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type;r=n,n=n.parent){if(DM(n,r,t)||DO(n,r,t)||DU(n,r,t)||function(e,t){let r=e.parent?.body;if(!Array.isArray(r))return!1;let n=r.indexOf(e),o=r[n-1];return o?.type==="IfStatement"&&!o.alternate&&D$(o.test,t)&&function e(t){return t=Dx(t),t?.type==="ReturnStatement"||t?.type==="ThrowStatement"||t?.type==="BlockStatement"&&t.body.length>0&&e(t.body.at(-1))}(o.consequent)}(n,t))return!0;if(DE(n))break}return!1}(t,r))return t;for(let[n,o]of Object.entries(t)){if("parent"===n||DW(t,n)||!o||"object"!=typeof o)continue;let a=function(t,r){for(let n of t){if(!n?.type||Dh(n)||"ClassExpression"===n.type||"ClassDeclaration"===n.type)continue;let t=e(n,r);if(t)return t}}(Array.isArray(o)?o:[o],r);if(a)return a}}(a.body,{entryName:u,entryVariable:p,statusName:f,statusVariable:g,valueVariable:d,context:t});if(y)return{node:y,messageId:Dm}}let DG="prefer-abort-signal-any",DJ="prefer-abort-signal-any/suggestion",DX=new i(["reason","throwIfAborted"]),DY=new i(["capture","once","passive"]),DH=new i(["TSAsExpression","TSTypeAssertion","TSSatisfiesExpression"]),DQ=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]},DZ=(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})},D0=e=>{let t=e,{parent:r}=e;for(;rI(r);)t=r,r=r.parent;return{expression:t,parent:r}},D1=(e,t)=>{let{parent:r}=e;if(!(!tT(r,{property:"signal",computed:!1,optional:!1})||r.object!==e||nL(r)||("ForInStatement"===r.parent.type||"ForOfStatement"===r.parent.type)&&r.parent.left===r||((e,t)=>{let{expression:r,parent:n}=D0(e);return tT(n)&&n.object===r&&DX.has(eO(n,t.sourceCode.getScope(n)))})(r,t)||(e=>{let{expression:t,parent:r}=D0(e);return"VariableDeclarator"===r.type&&r.init===t||"AssignmentExpression"===r.type&&r.right===t})(r)||r$(t,t.sourceCode.getRange(r))))return r},D2=(e,t,r)=>{if(r0.has(e.intrinsicName))return;if(r1.has(e.intrinsicName))return!1;if(e.isUnion()){let n=e.types.filter(e=>!r1.has(e.intrinsicName));if(0===n.length)return!1;let o=n.map(e=>D2(e,t,r));return!!o.every(Boolean)||!o.every(e=>!1===e)&&void 0}if(e.isIntersection()){let n=e.types.map(e=>D2(e,t,r));return!!n.some(Boolean)||!n.every(e=>!1===e)&&void 0}let n=t.getBaseConstraintOfType(e);if(n&&n!==e)return D2(n,t,r);let o=r2(e);if(o&&r3(o,r))return"AbortSignal"===o.getName();let a=r8(e,t).map(e=>D2(e,t,r));return!!a.some(Boolean)||!(a.length>0&&a.every(e=>!1===e))&&void 0},D3=(e,t)=>tm(e,{optional:!1},tp)&&tT(e.callee,{object:"AbortSignal",properties:t,computed:!1,optional:!1}),D8=e=>D3(e,["any","timeout"]),D6=e=>D3(e,["any"]),D9=(e,t)=>{if("Identifier"!==(e=rj(e)).type)return;let r=ey(t.sourceCode.getScope(e),e),n=r?.defs[0];if(r&&1===r.defs.length&&"Variable"===n.type&&"const"===n.parent.kind)return n.node.init},D5=(e,t)=>{if("Identifier"!==(e=rj(e)).type)return!1;let r=ey(t.sourceCode.getScope(e),e),n=r?.defs[0];if(!r||1!==r.defs.length||"Variable"!==n.type||"const"!==n.parent.kind||!n.node.init)return!1;let[,o]=t.sourceCode.getRange(n.node.init),[a]=t.sourceCode.getRange(e);return r.references.some(r=>{if(r.init||r.identifier===e)return!1;let[n]=t.sourceCode.getRange(r.identifier);return n>o&&n<a})},D4=(e,t,r)=>tm(e,{optional:!1},tp)&&tT(e.callee,{object:"Array",property:t,computed:!1,optional:!1})&&of(e.callee.object,r),D7=(e,t)=>(tm(e,{name:"Array",optional:!1},tp)||tf(e,{name:"Array"}))&&of(e.callee,t),Se=(e,t,r=new i)=>{if(e=rj(e),r.has(e))return!1;if(r.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&Se(e,t,r));if(D4(e,"of",t)||D7(e,t))return e.arguments.some(e=>Se(e,t,r));if(D4(e,"from",t)){if(1!==e.arguments.length)return!0;let[n]=e.arguments;if("SpreadElement"===n.type)return!0;let o=D9(n,t);if(o)return!!(!nE(o,t)||D5(n,t))||Se(o,t,r);let a=rj(n);return"ArrayExpression"!==a.type||Se(a,t,r)}if(D6(e))return e.arguments[0]&&Se(e.arguments[0],t,r);let n=D9(e,t);return n?!!(nE(n,t)&&D5(e,t))||Se(n,t,r):D3(rj(e),["abort"])},St=(e,t,r,n=new i)=>{var o;if(e=rj(e),n.has(e))return!1;if(n.add(e),"SpreadElement"===e.type)return!0;if("ArrayExpression"===e.type)return e.elements.some(e=>e&&St(e,t,r,n));if(D4(e,"of",r)||D7(e,r))return e.arguments.some(e=>St(e,t,r,n));if(D4(e,"from",r)){if(1!==e.arguments.length)return!0;let[o]=e.arguments;if("SpreadElement"===o.type)return!0;let a=D9(o,r);if(a)return!!(!nE(a,r)||D5(o,r))||St(a,t,r,n);let i=rj(o);return"ArrayExpression"!==i.type||St(i,t,r,n)}if(D6(e))return e.arguments[0]&&St(e.arguments[0],t,r,n);let a=D9(e,r);return a?!!(nE(a,r)&&D5(e,r))||St(a,t,r,n):tT(o=rj(o=e),{property:"signal",computed:!1,optional:!1})&&"Identifier"===o.object.type&&o.object.name===t},Sr=(e,t)=>{let r=((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{let{program:t}=r;return D2(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{}})(e=rj(e),t);if(!0===r)return!0;if(!1===r||t.sourceCode.parserServices?.program)return!1;if("Identifier"===e.type){let t;return"signal"===(t=e.name)||t.endsWith("Signal")}return D8(e)},Sn=(e,t)=>"Identifier"===(e=rj(e)).type?Sr(e,t):D8(e)&&e.arguments.every(e=>"SpreadElement"!==e.type&&!ez(e,t.sourceCode)),So=(e,t)=>{if(!D4(e,"from",t)||1!==e.arguments.length)return;let[r]=e.arguments;if("SpreadElement"===r.type)return;let n=rj(r);if("ArrayExpression"===n.type)return n;let o=D9(r,t);if(o&&nE(o,t)&&!D5(r,t))return o},Sa=(e,t,r=new i)=>{if(e=rj(e),r.has(e))return;if(r.add(e),"ArrayExpression"===e.type)return e.elements.every(e=>e&&"SpreadElement"!==e.type)?e.elements:void 0;if(D4(e,"of",t)||D7(e,t))return e.arguments.every(e=>"SpreadElement"!==e.type)?e.arguments:void 0;let n=So(e,t);if(n)return Sa(n,t,r);let o=D9(e,t);if(o&&nE(o,t)&&!D5(e,t))return Sa(o,t,r)},Si=(e,t,r=new i)=>{if(e=rj(e),r.has(e))return!1;if(r.add(e),"Identifier"===e.type||"ArrayExpression"===e.type||D4(e,"of",t)||D7(e,t))return!0;let n=So(e,t);return!!n&&Si(n,t,r)},Ss=e=>"Identifier"===e.type?e.name:"TSQualifiedName"===e.type?Ss(e.right):void 0,Sl=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Sl(e.typeAnnotation,t,r);if(e?.type!=="TSTypeReference")return!1;var n=e;let o=Ss(n.typeName);if("AbortSignal"===o)return!0;if(!o||"Identifier"!==n.typeName.type||r.has(n.typeName.name))return!1;r.add(n.typeName.name);let a=ey(t.sourceCode.getScope(n),n.typeName),s=a?.defs[0],l=s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&Sl(s.node.typeAnnotation,t,r);return r.delete(n.typeName.name),l},Su=(e,t,r=new i)=>(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")?Su(e.typeAnnotation,t,r):e?.type==="TSTypeOperator"?"readonly"===e.operator?Su(e.typeAnnotation,t,r):void 0:e?.type==="TSArrayType"?Sl(e.elementType,t,r):e?.type==="TSTupleType"?e.elementTypes.length>0&&e.elementTypes.every(e=>Sl("TSNamedTupleMember"===e.type?e.elementType:e,t,r)):e?.type==="TSTypeReference"?((e,t,r)=>{let n,o=Ss(e.typeName),a=e.typeArguments?.params??e.typeParameters?.params;if(("Array"===o||"ReadonlyArray"===o)&&a?.length===1)return Sl(a[0],t,r);if(!o||"Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let i=ey(t.sourceCode.getScope(e),e.typeName),s=i?.defs[0];return s?.type==="Type"&&"TSTypeAliasDeclaration"===s.node.type&&(n=Su(s.node.typeAnnotation,t,r)),r.delete(e.typeName.name),n})(e,t,r):void 0,Sp=(e,t,r=new i)=>{if(e?.type==="TSTypeAnnotation"&&(e=e.typeAnnotation),e?.type==="TSParenthesizedType")return Sp(e.typeAnnotation,t,r);if(e?.type==="TSTypeOperator")return"readonly"===e.operator&&("TSArrayType"===e.typeAnnotation.type||"TSTupleType"===e.typeAnnotation.type);if(e?.type!=="TSTypeReference")return!1;if("ReadonlyArray"===Ss(e.typeName))return!0;if("Identifier"!==e.typeName.type||r.has(e.typeName.name))return!1;r.add(e.typeName.name);let n=ey(t.sourceCode.getScope(e),e.typeName),o=n?.defs[0];return o?.type==="Type"&&"TSTypeAliasDeclaration"===o.node.type&&Sp(o.node.typeAnnotation,t,r)},Sc=(e,t,r,n=new i)=>{if(!e||r0.has(e.intrinsicName)||r1.has(e.intrinsicName)||n.has(e))return!1;if(n.add(e),e.isUnion()||e.isIntersection())return e.types.some(e=>Sc(e,t,r,n));let o=t.getBaseConstraintOfType(e);if(o&&o!==e)return Sc(o,t,r,n);let a=r2(e);if(a&&r3(a,r)&&"ReadonlyArray"===a.getName())return!0;let s=t.typeToString(e);return!!(s.startsWith("readonly ")||s.startsWith("ReadonlyArray<"))||r8(e,t).some(e=>Sc(e,t,r,n))},Sd=(e,t)=>{if(DH.has(e.type)){let r;return r=e.typeAnnotation,r?.type==="TSTypeReference"&&"const"===Ss(r.typeName)||Sp(e.typeAnnotation,t)||Sd(e.expression,t)}if("Identifier"!==(e=rj(e)).type)return!1;let r=ey(t.sourceCode.getScope(e),e),n=r?.defs[0];return!!(n?.name?.typeAnnotation&&Sp(n.name.typeAnnotation,t)||n?.type==="Variable"&&n.node.init&&Sd(n.node.init,t)||((e,t)=>{let{parserServices:r}=t.sourceCode;if(!r?.program)return!1;try{let{program:t}=r;return Sc(r.getTypeAtLocation(e),t.getTypeChecker(),t)}catch{return!1}})(e,t))},Sm=(e,t,r=new i)=>{if(r.has(e))return!1;if(r.add(e),DH.has(e.type))return Su(e.typeAnnotation,t)??Sm(e.expression,t,r);if("Identifier"===(e=rj(e)).type){let n=ey(t.sourceCode.getScope(e),e),o=n?.defs[0];if(o?.name?.typeAnnotation){let e=Su(o.name.typeAnnotation,t);if(void 0!==e)return e}if(o?.type==="Variable"&&o.node.init&&Sm(o.node.init,t,r))return!0}return nE(e,t)},Sf=(e,t,r,n)=>{var o,a;let i,s=!e||"ArrowFunctionExpression"!==e.type&&"FunctionExpression"!==e.type||e.async||e.generator||e.params.length>0?void 0:"BlockStatement"!==e.body.type?e.body:1===e.body.body.length&&"ExpressionStatement"===e.body.body[0].type?e.body.body[0].expression:void 0;if(tm(s,{optional:!1},tp)&&tT(s.callee,{property:"abort",computed:!1,optional:!1})&&"Identifier"===s.callee.object.type&&s.callee.object.name===t&&(0===s.arguments.length||1===s.arguments.length&&(i=s.arguments[0],tT(i,{property:"reason",computed:!1,optional:!1})&&(o=i.object,a=r,o=rj(o),a=rj(a),"Identifier"===o.type&&"Identifier"===a.type&&o.name===a.name&&ey(n.sourceCode.getScope(o),o)===ey(n.sourceCode.getScope(a),a)))))return s.callee.object},Sg=e=>{var t;if(e?.type!=="ExpressionStatement")return;let{expression:r}=e;if(tm(r,{minimumArguments:2,maximumArguments:3,optional:!1},tp)&&tT(r.callee,{property:"addEventListener",computed:!1,optional:!1})&&"abort"===tn(rj(r.arguments[0]))&&(!(t=r.arguments[2])||"Literal"===(t=rj(t)).type&&"boolean"==typeof t.value||"ObjectExpression"===t.type&&t.properties.every(e=>{if("Property"!==e.type||e.computed||"init"!==e.kind||e.method||e.shorthand||"Literal"!==e.value.type||"boolean"!=typeof e.value.value)return!1;let t="Identifier"===e.key.type?e.key.name:e.key.value;return DY.has(t)})))return{call:r,sourceSignal:r.callee.object}},Sy=(e,t)=>!r$(t,t.sourceCode.getRange(e))&&!rN(t,e),Sh=(e,t,r,n)=>{let o=ey(n.sourceCode.getScope(r),e);return o&&o!==t},Sx="prefer-block-statement-over-iife",Sb=e=>"ThisExpression"===e.type||"MetaProperty"===e.type&&"new"===e.meta.name&&"target"===e.property.name||"Identifier"===e.type&&"arguments"===e.name,SE=(e,t)=>e!==t&&tv(e),Sv=(e,t)=>SE(e,t)&&"ArrowFunctionExpression"!==e.type;function SC(e,t,r,n=SE){return function o(a){if(r(a))return!0;if(n(a,e))return!1;for(let e of t[a.type]??[]){let t=a[e];for(let e of Array.isArray(t)?t:[t])if(e?.type&&o(e))return!0}return!1}(e)}let SD=(e,t)=>{let[r,n]=t.getRange(e),o=t.getLastToken(e);return[r,eE(o)?t.getRange(o)[1]:n]},SS="no-multiple-promise-resolver-calls",ST=e=>rI(e)||e?.type==="TSInstantiationExpression";function SA(e){for(;ST(e.parent)&&e.parent.expression===e;)e=e.parent;return e}function Sw(e){for(;ST(e);)e=e.expression;return e}let Sk=(e,t)=>{if(!(("FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)&&!e.generator))return!1;let r=SA(e);return tf(r.parent,{name:"Promise",argumentsLength:1})&&r.parent.arguments[0]===r&&of(r.parent.callee,t)},SI=e=>e.references.some(e=>e.isWrite()),Sj=({resolverUncalled:e=!1,resolverCalled:t=!1,catchClausesAfterResolverCall:r=new i,pendingFinallyBlocksByCatchClause:n=new o}={})=>({resolverUncalled:e,resolverCalled:t,catchClausesAfterResolverCall:r,pendingFinallyBlocksByCatchClause:n}),SF=e=>Sj({resolverUncalled:e.resolverUncalled,resolverCalled:e.resolverCalled,catchClausesAfterResolverCall:new i(e.catchClausesAfterResolverCall),pendingFinallyBlocksByCatchClause:function(e){let t=new o;for(let[r,n]of e)t.set(r,new i(n));return t}(e.pendingFinallyBlocksByCatchClause)}),SB=(e,t,r)=>{if(t.executor===r){let r=SF(e);for(let[e,n]of r.pendingFinallyBlocksByCatchClause)t.finallyBlocks.some(e=>n.has(e))&&r.catchClausesAfterResolverCall.add(e);return r.resolverCalled=e.resolverUncalled||e.resolverCalled,r.resolverUncalled=!1,r}if(t.executor)return e;let n=SF(e);if(t.catchClause){if(e.resolverUncalled){let e=n.pendingFinallyBlocksByCatchClause.get(t.catchClause);for(let r of(e||(e=new i,n.pendingFinallyBlocksByCatchClause.set(t.catchClause,e)),t.finallyBlocks))e.add(r)}e.resolverCalled&&n.catchClausesAfterResolverCall.add(t.catchClause)}return n};function SR(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let SP=(e,t)=>void 0!==t&&e.resolverUncalled===t.resolverUncalled&&e.resolverCalled===t.resolverCalled&&SR(e.catchClausesAfterResolverCall,t.catchClausesAfterResolverCall)&&function(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||!SR(n,e))return!1}return!0}(e.pendingFinallyBlocksByCatchClause,t.pendingFinallyBlocksByCatchClause);function SL(e,t,r){let n=Sj({resolverUncalled:e===r.codePath.initialSegment});for(let o of e.prevSegments){let a=function(e,t,r,n){if(!t.reachable||n.ignoredLoopEdges.some(e=>e.previousSegment===t&&e.segment===r))return Sj();let o=n.catchClausesBySegment.get(r);return o?Sj({resolverUncalled:e.pendingFinallyBlocksByCatchClause.has(o),resolverCalled:e.catchClausesAfterResolverCall.has(o)}):e}(t.get(o)??Sj(),o,e,r);for(let e of(n.resolverUncalled||=a.resolverUncalled,n.resolverCalled||=a.resolverCalled,a.catchClausesAfterResolverCall))n.catchClausesAfterResolverCall.add(e);for(let[e,t]of a.pendingFinallyBlocksByCatchClause){let r=n.pendingFinallyBlocksByCatchClause.get(e);for(let o of(r||(r=new i,n.pendingFinallyBlocksByCatchClause.set(e,r)),t))r.add(o)}}return n}let SN=e=>{let t=Sw(e.test);return t?.type==="Literal"&&!t.value},S$=e=>{let t=SA(e);return t.parent?.type==="AwaitExpression"&&t.parent.argument===t},SM="no-unnecessary-string-trim",SO=["startsWith","endsWith"],SU=new i(["bigint","boolean","number","string","undefined"]),Sq=new i(["ArrayExpression","ArrowFunctionExpression","ClassExpression","FunctionExpression","ObjectExpression"]),SV=(e,t)=>e$(e=rj(e),t.sourceCode.getScope(e)),SW="no-useless-re-export",S_=e=>"Identifier"===e.type?e.name:e.value;function Sz(e,t){let r=e.attributes??[];return`${e.source.value}\u0000${r.map(e=>t.getText(e)).join("\0")}`}let SK={configs:{node:{name:"@eslint-sukka/eslint-plugin-sukka-full node preset",plugins:{get sukka(){return SK}},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 SK}},rules:{"sukka/ban-eslint-disable":["error","allow-with-description"]}},recommended:{...c.eslint_plugin_sukka.configs.recommended,plugins:{get sukka(){return SK}},rules:Object.assign({"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"},d.collectRules(c.eslint_plugin_sukka.configs.recommended))},recommended_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full recommended unicorn preset",plugins:{get sukka(){return SK}},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":"error","sukka/unicorn/prefer-queue-microtask":"warn","sukka/unicorn/prefer-string-pad-start-end":"warn","sukka/unicorn/require-css-escape":"warn","sukka/unicorn/require-passive-events":"warn","sukka/unicorn/class-reference-in-static-methods":["warn",{preferThis:!1,preferSuper:!1}],"sukka/unicorn/consistent-optional-chaining":"error","sukka/unicorn/explicit-timer-delay":"error","sukka/unicorn/no-confusing-array-with":"error","sukka/unicorn/no-duplicate-loops":"warn","sukka/unicorn/no-declarations-before-early-exit":"error","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":"error","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":"error","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":"error","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","sukka/unicorn/no-unsafe-promise-all-settled-values":"error","sukka/unicorn/prefer-abort-signal-any":"warn","sukka/unicorn/prefer-block-statement-over-iife":"warn","sukka/unicorn/no-multiple-promise-resolver-calls":"error","sukka/unicorn/no-unnecessary-string-trim":"error","sukka/unicorn/no-useless-re-export":"warn"}},stylistic_unicorn:{name:"@eslint-sukka/eslint-plugin-sukka-full stylistic unicorn preset",plugins:{get sukka(){return SK}},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:{...c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint,plugins:{get sukka(){return SK}},rules:Object.assign({"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"},d.collectRules(c.eslint_plugin_sukka.configs.recommended_extra_with_typed_lint))},recommended_react:{...c.eslint_plugin_sukka.configs.recommended_react,plugins:{get sukka(){return SK}}}},rules:Object.assign(c.eslint_plugin_sukka.rules,{"array/no-unneeded-flat-map":L,"browser/prefer-location-assign":$,"jsx/no-template-literal":O,"jsx/no-unneeded-nested":U,"string/no-locale-case":V,"string/no-simple-template-literal":W,"unicode/no-bidi":Y,"unicode/no-invisible":Q,"no-redundant-variable":Z,"no-single-return":et,"prefer-early-return":en,"prefer-fetch":eo,"prefer-timer-id":es,"string/no-unneeded-to-string":el,"type/no-force-cast-via-top-type":eu,"type/no-wrapper-type-reference":ec,"no-default-error":ed},Object.fromEntries(Object.entries({"unicorn/catch-error-name":cz,"unicorn/custom-error-definition":{create:e=>{e.on("ClassDeclaration",t=>dn(e,t)),e.on("AssignmentExpression",t=>{if("ClassExpression"===t.right.type)return dn(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||!c1(t)||!t.id)return;let r=t.id.name;return e.left.property.name!==r?{node:e.left.property,messageId:cK,fix:t=>t.replaceText(e.left.property,r)}:void 0}})},meta:{type:"problem",docs:{description:"Enforce correct `Error` subclassing.",recommended:!1},fixable:"code",messages:{[cK]:"Exported error name should match error class",[cG]:"Do not pass the error message to `super()` when the class defines a `message` accessor.",[cJ]:"Do not assign to `this.message` when the class defines a `message` getter without a setter.",[cX]:"Error constructors should accept `options` as the second parameter.",[cY]:"Error constructors should use `options` as the second parameter.",[cH]:"Pass the error message to `super()` as the first argument.",[cQ]:"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||e7(t,e)?o>1?{node:o>2?n[o-3]:t,messageId:aa}:void 0:{node:t,messageId:ai,fix:e=>[e.insertTextBefore(t,"("),e.insertTextAfter(t,")")]}})},meta:{type:"suggestion",docs:{description:"Disallow nested ternary expressions.",recommended:!0},fixable:"code",messages:{[aa]:"Do not nest ternary expressions.",[ai]:"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!!(al.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)&&au(e.parent.parent)&&ap(e.parent.parent.parent.init))||!!(au(e)&&tT(e.parent.init,{property:"EventEmitter",optional:!1,computed:!1})&&ap(e.parent.init.object))}(ey(r,t)?.defs[0]?.name))return{node:t,messageId:as}})},meta:{type:"suggestion",docs:{description:"Prefer `EventTarget` over `EventEmitter`.",recommended:"unopinionated"},messages:{[as]:"Prefer `EventTarget` over `EventEmitter`."},languages:["js/js"]}},"unicorn/prefer-keyboard-event-key":{create:e=>{e.on("Identifier",t=>{if(af.has(t.name)){for(let r of ab(e,t))if(r.references?.some(e=>ax(t,e.identifier)))return aE(t,r)}}),e.on("Property",t=>{let r;if("Identifier"===t.key.type&&af.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 ab(e,t))if(aC(t.key,r))return aE(t.key,r);for(let r of ab(e,t))if(av(t.key,r))return aE(t.key,r)}})},meta:{type:"suggestion",docs:{description:"Prefer `KeyboardEvent#key` over deprecated keyboard event properties.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[ad]:"Use `.key` instead of `.{{name}}`.",[am]:"Use `.key` with `{{key}}`."},languages:["js/js"]}},"unicorn/prefer-text-content":{create:e=>{e.on("MemberExpression",t=>{if(!tT(t,{property:"innerText"})||nR(t.object,e))return;let r=t.property;return{node:r,messageId:aD,suggest:[{messageId:aS,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(nR(e,t))return!0;let{parent:r}=e;return"VariableDeclarator"===r.type?r.id===e&&r.init&&nR(r.init,t):"AssignmentExpression"===r.type&&r.left===e&&nR(r.right,t)})(t.parent.parent,e))return{node:t,messageId:aD,suggest:[{messageId:aS,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:{[aD]:"Prefer `.textContent` over `.innerText`.",[aS]:"Switch to `.textContent`."},languages:["js/js"]}},"unicorn/require-array-join-separator":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{method:"join",argumentsLength:0,optionalCall:!1})||tw(t,{method:"call",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&tL(t.callee.object,{property:"join"}))||0===t.arguments.length&&nD(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:a_,fix:r=>aA(r,t,"','",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the separator argument with `Array#join()`.",recommended:"unopinionated"},fixable:"code",messages:{[a_]:"Missing the separator argument."},languages:["js/js"]}},"unicorn/no-thenable":{create:e=>{for(let{selector:t,selectors:r,messageId:n,getNodes:o}of aY)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:{[az]:"Do not add `then` to an object.",[aK]:"Do not export `then`.",[aG]:"Do not add `then` to a class."},languages:["js/js"]}},"unicorn/no-invalid-remove-event-listener":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{method:"removeEventListener",minimumArguments:2,optionalCall:!1})&&"SpreadElement"!==t.arguments[0].type&&("FunctionExpression"===t.arguments[1].type||"ArrowFunctionExpression"===t.arguments[1].type||tw(t.arguments[1],{method:"bind",optionalCall:!1,optionalMember:!1}))))return;let[,r]=t.arguments;return["ArrowFunctionExpression","FunctionExpression"].includes(r.type)?{node:r,loc:ew(r,e.sourceCode),messageId:aH}:{node:r.callee.property,messageId:aH}})},meta:{type:"problem",docs:{description:"Prevent calling `EventTarget#removeEventListener()` with the result of an expression.",recommended:"unopinionated"},messages:{[aH]:"The listener argument should be a function reference."},languages:["js/js"]}},"unicorn/consistent-function-scoping":a6,"unicorn/no-new-buffer":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tf(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(n_(r,t))return"alloc";let n=e$(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:a9,data:{method:n},fix:a7(r,e,n)}:{node:r,messageId:a5,suggest:["from","alloc"].map(t=>({messageId:a4,data:{replacement:t},fix:a7(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:{[a9]:"`new Buffer()` is deprecated, use `Buffer.{{method}}()` instead.",[a5]:"`new Buffer()` is deprecated, use `Buffer.alloc()` or `Buffer.from()` instead.",[a4]:"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:o4(l,e),messageId:ie,data:{method:n,position:o},fix:e=>e.removeRange(l)}};e.on("CallExpression",function*(e){if(!tw(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(!tt(i)&&"TemplateLiteral"!==i.type)continue;let o=t.getText(i).slice(1,-1);0!==e&&it(o)&&(yield r(i,n,"leading")),e!==a-1&&ir(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:{[ie]:"Do not use {{position}} space between `console.{{method}}` parameters."},languages:["js/js"]}},"unicorn/no-empty-file":ia,"unicorn/no-useless-fallback-in-spread":{create:e=>{e.on("ObjectExpression",t=>{if(tx(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:ii,*fix(r,{abort:n}){let{sourceCode:o}=e,a=t.parent;if(o.getCommentsInside(a).length>0)return n();let{left:i}=a,s=e7(i,e),[,l]=s?e5(i,e):o.getRange(i),[,u]=o.getRange(a);yield r.removeRange([l,u]),(s||"SequenceExpression"!==i.type)&&(yield aT(a,r,e))}}})},meta:{type:"suggestion",docs:{description:"Disallow useless fallback when spreading in object literals.",recommended:"unopinionated"},fixable:"code",messages:{[ii]:"The empty object is useless."},languages:["js/js"]}},"unicorn/no-useless-length-check":{create:e=>{let t=[],r=new i,n=new i,o=new i,a=new i;e.on("BinaryExpression",e=>{if(!("BinaryExpression"===e.type&&"Literal"===e.right.type&&"0"===e.right.raw&&tT(e.left,{property:"length",optional:!1})&&tN(e.parent)))return;let{operator:t}=e;"==="===t?r.add(e):(">"===t||"!=="===t)&&n.add(e)}),e.on("CallExpression",t=>{tw(t,{optionalCall:!1,optionalMember:!1,computed:!1})&&"Identifier"===t.callee.property.type&&!nv(t.callee.object,e)&&("some"===t.callee.property.name?o.add(t):"every"===t.callee.property.name&&a.add(t))}),e.on("LogicalExpression",e=>{tN(e)&&t.push(e)}),e.on("Program:exit",function*(){let s=new i(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)&&rC(e.left.object,t.callee.object))||"&&"===t&&n.has(e)&&i.some(t=>o.has(t)&&rC(e.left.object,t.callee.object))})({node:e,operator:t,siblings:[s[i-1],s[i+1]].filter(Boolean)}))})(e))),{sourceCode:l}=e;for(let t of s)yield{loc:{start:l.getLoc(t.left.property).start,end:l.getLoc(t).end},messageId:r.has(t)?"zero":"non-zero",fix(r){let{left:n,right:o}=t.parent,a=e5(n,e),i=e5(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=>{let{expression:r,parent:n}=is(t);if(!(tw(t,{object:"Promise",methods:["resolve","reject"],optionalCall:!1,optionalMember:!1})&&("ArrowFunctionExpression"===n.type&&n.body===r||"ReturnStatement"===n.type&&n.argument===r||"YieldExpression"===n.type&&!n.delegate&&n.argument===r)))return;let{functionNode:o,isInTryStatement:a}=function(e){let t,r=!1;for(;e;e=e.parent){if(tv(e)){t=e;break}"TryStatement"===e.type&&(r=!0)}return{functionNode:t,isInTryStatement:r}}(t);if(o&&(o.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}(o)))return function(e,t){let{callee:r}=e,n=r.property.name,{parent:o}=is(e);return{node:r,messageId:n,data:{type:"YieldExpression"===o.type?"yield":"return"},fix:t}}(t,function(e,t,r){if(e.arguments.length>1)return;let{callee:n,arguments:o}=e,{expression:a,parent:i,isAwaited:s}=is(e),[l]=o;if(l?.type==="SpreadElement")return;let u="reject"===n.property.name,p="YieldExpression"===i.type;if(u&&(t||p&&"ExpressionStatement"!==i.parent.type))return;let c=function({callExpression:e,parent:t,expression:r,isAwaited:n,isReject:o,context:a}){return n&&!o?e5(e,a):o&&"YieldExpression"===t.type?e5(t,a):"ArrowFunctionExpression"===t.type?o?e5(r,a):e:t}({callExpression:e,parent:i,expression:a,isAwaited:s,isReject:u,context:r});if(!rL(r,c,l?[l]:[]))return function(t){let n="ArrowFunctionExpression"===i.type,o=il(l,r);if(u){if(o||="undefined",o=`throw ${o}`,p)return t.replaceTextRange(e5(i,r),o);if(o+=";",n)return o=`{ ${o} }`,t.replaceTextRange(e5(a,r),o)}else{if(s){var c;let n;return t.replaceTextRange(e5(e,r),(n=il(c=l,r)||"undefined",c&&"SequenceExpression"!==c.type&&16>oX(c)?`(${n})`:n))}p?o=`yield${o?" ":""}${o}`:"ReturnStatement"===i.type?o=`return${o?" ":""}${o};`:(l?.type==="ObjectExpression"&&(o=`(${o})`),o||="{}")}return t.replaceText(n?e:i,o)}}(t,a,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(!to(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:o4([p-(r.length-s.length),p],e),messageId:l?ip:iu,*fix(r){let n=s;"MemberExpression"===t.parent.type&&t.parent.object===t&&oH.test(s)&&!e7(t,e)&&(n=`(${n})`,oD(u.getTokenBefore(t),e,n)&&(n=`;${n}`)),yield r.replaceText(t,n),yield aP(r,t,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow number literals with zero fractions or dangling dots.",recommended:"unopinionated"},fixable:"code",messages:{[iu]:"Don't use a zero fraction in the number.",[ip]:"Don't use a dangling dot in the number."},languages:["js/js"]}},"unicorn/prefer-export-from":iE,"unicorn/prefer-native-coercion-functions":{create:e=>{e.on(tE,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&&iD.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&&iS(e.body,t)?e.body:"BlockStatement"===e.body.type&&1===e.body.body.length&&"ReturnStatement"===e.body.body[0].type&&iS(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:ew(t,n),messageId:iv,data:{functionNameWithKind:eU(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:{[iv]:"{{functionNameWithKind}} is equivalent to `{{replacementFunction}}`. Use `{{replacementFunction}}` directly."},languages:["js/js"]}},"unicorn/no-document-cookie":{create(e){iI.listen({context:e})},meta:{type:"problem",docs:{description:"Do not use `document.cookie` directly.",recommended:"unopinionated"},messages:{[ik]:"Do not use `document.cookie` directly."},languages:["js/js"]}},"unicorn/prefer-add-event-listener":iR,"unicorn/prefer-array-index-of":iU,"unicorn/prefer-blob-reading-methods":{create:e=>{e.on("CallExpression",e=>{if(!tw(e,{methods:["readAsText","readAsArrayBuffer"],argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let t=e.callee.property,r=t.name;return{node:t,messageId:iq,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:{[iq]:"Prefer `Blob#{{replacement}}()` over `FileReader#{{method}}(blob)`."},languages:["js/js"]}},"unicorn/prefer-date-now":{create:e=>{e.on("CallExpression",e=>{if(tw(e,{methods:["getTime","valueOf"],argumentsLength:0,optionalCall:!1,optionalMember:!1})&&iz(e.callee.object)){let t=e.callee.property;return iK(e,{node:t,messageId:iW,data:{method:t.name}})}if(tm(e,{names:["Number","BigInt"],argumentsLength:1,optional:!1},tp)&&iz(e.arguments[0])){let{name:t}=e.callee;return"Number"===t?iK(e,{messageId:i_}):iK(e.arguments[0])}}),e.on("UnaryExpression",t=>{if(("+"===t.operator||"-"===t.operator)&&iz(t.argument))return iK("-"===t.operator?t.argument:t,{},e)}),e.on("AssignmentExpression",e=>{if(("-="===e.operator||"*="===e.operator||"/="===e.operator||"%="===e.operator||"**="===e.operator)&&iz(e.right))return iK(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])iz(t)&&(yield iK(t))})},meta:{type:"suggestion",docs:{description:"Prefer `Date.now()` to get the number of milliseconds since the Unix Epoch.",recommended:"unopinionated"},fixable:"code",messages:{[iV]:"Prefer `Date.now()` over `new Date()`.",[iW]:"Prefer `Date.now()` over `Date#{{method}}()`.",[i_]:"Prefer `Date.now()` over `Number(new Date())`."},languages:["js/js"]}},"unicorn/dom-node-dataset":i2,"unicorn/prefer-modern-math-apis":{create:e=>{let t=[];e.on("CallExpression",t=>{if(!tw(t,{object:"Math",method:"sqrt",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let r=i7(t.arguments[0]);if(r.some(e=>!("BinaryExpression"===e.type&&("*"===e.operator&&rC(e.left,e.right)||"**"===e.operator&&te(e.right,2)))))return;let n=1===r.length?"abs":"hypot",o=new i(1===r.length?[]:r.map(e=>e.parent));return{node:t.callee.property,messageId:i3,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 aW(t,",",a,e),yield aT(r,a,e)}for(let t of r)yield a.removeRange([e5(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 i4){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:{[i3]:"Prefer `{{replacement}}` over `{{description}}`."},languages:["js/js"]}},"unicorn/number-literal-case":sr,"unicorn/prefer-number-properties":sl,"unicorn/prefer-reflect-apply":{create:e=>{e.on("CallExpression",t=>{if(!tw(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"===eO(e.callee)&&2===e.arguments.length&&sp(e.arguments[0],e.arguments[1]))return r=>r.replaceText(e,sc(t,e.callee.object,e.arguments[0],e.arguments[1]))})(t,r)||((e,t)=>{if("call"===eO(e.callee)&&"apply"===eO(e.callee.object)&&"prototype"===eO(e.callee.object.object)&&e.callee.object.object.object?.type==="Identifier"&&"Function"===e.callee.object.object.object.name&&3===e.arguments.length&&sp(e.arguments[1],e.arguments[2]))return r=>r.replaceText(e,sc(t,e.arguments[0],e.arguments[1],e.arguments[2]))})(t,r);if(n)return{node:t,messageId:su,fix:n}})},meta:{type:"suggestion",docs:{description:"Prefer `Reflect.apply()` over `Function#apply()`.",recommended:"unopinionated"},fixable:"code",messages:{[su]:"Prefer `Reflect.apply()` over `Function#apply()`."},languages:["js/js"]}},"unicorn/prefer-set-size":{create:e=>{e.on("MemberExpression",t=>{var r;if(!tT(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:tw(r,{object:"Array",method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})?r.arguments[0]:void 0;if(n&&nk(n,e))return{node:t.property,messageId:sd,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);oZ(r,e)&&(s=`(${s})`),yield i.replaceText(o,s),"ArrayExpression"===o.type&&(yield aP(i,t,e))}}(e,t,n)}})},meta:{type:"suggestion",docs:{description:"Prefer using `Set#size` instead of `Array#length`.",recommended:"unopinionated"},fixable:"code",messages:{[sd]:"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(!tw(e,{method:"join",argumentsLength:1,optionalCall:!1,optionalMember:!1})||!tw(e.callee.object,{method:"split",argumentsLength:1,optionalCall:!1,optionalMember:!1})||t.sourceCode.getCommentsInside(e).length>0)return;let n=e.callee.object;if(or(n.callee.object,t))return;let[o]=n.arguments,[a]=e.arguments,i=tn(o);if("string"==typeof i){if(0===i.length)return;r=tK(i)}else if(!(r=(e=>{if(!ta(e)||e.regex.flags.includes("y"))return;let t=sw(e);if(!t||sj(t)||0===sI(t))return;let{pattern:r,flags:n}=e.regex;return`/${r}/${n.includes("g")?n:`g${n}`}`})(o)))return;let s=tn(a);if("string"==typeof s)return`${e4(n.callee.object,t)}.replaceAll(${r}, ${tK(s.replaceAll("$","$$$$"))})`})(t,e);if(o)return{node:t.callee.property,messageId:sE,fix:e=>e.replaceText(t,o)};if(!tw(t,{methods:["replace","replaceAll"],argumentsLength:2,optionalCall:!1})||tw(t,{method:"replace",argumentsLength:2,optionalCall:!1,optionalMember:!1})&&ta(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 i,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||!sy.has(n))return;t.add(n)}return t})(r.regex.pattern)?.size>=8&&tt(n=t.arguments[1])&&n.value===sg)return;let{arguments:a,callee:{property:s}}=t;if(or(t.callee.object,e))return;let[l]=a;if(!((e,t)=>{if(ta(e))return e.regex.flags.includes("g");if(tf(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=e$(e,t);if(!r)return!1;let{value:n}=r;return"[object RegExp]"===Object.prototype.toString.call(n)&&n.global})(l,e.sourceCode.getScope(l)))return;let u=s.name,p=function(e){if(!ta(e))return;let t=sw(e);if(!t)return;let{flags:r}=e.regex;if(!function(e){if(!e.includes("g"))return!1;for(let t of e)if(sv.has(t))return!1;return!0}(r))return;let n="alternative"===t.type?sA(t.body):sT(t);if(n)return"'"+n+"'"}(l);if("replaceAll"===u){if(!p)return;return{node:l,messageId:sb,data:{replacement:p.length<20?p:"a string literal"},fix:e=>e.replaceText(l,p)}}return{node:s,messageId:sx,*fix(e){yield e.insertTextAfter(s,"All"),p&&(yield e.replaceText(l,p))}}})},meta:{type:"suggestion",docs:{description:"Prefer `String#replaceAll()` over regex searches with the global flag and `String#split().join()`.",recommended:"unopinionated"},fixable:"code",messages:{[sx]:"Prefer `String#replaceAll()` over `String#replace()`.",[sb]:"This pattern can be replaced with {{replacement}}.",[sE]:"Prefer `String#replaceAll()` over `String#split().join()`."},languages:["js/js"]}},"unicorn/prefer-string-slice":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:["substr","substring"]})||or(t.callee.object,e))return;let r=t.callee.property.name;if(!("substring"===r&&(e=>{if(!tw(e,{method:"substring",argumentsLength:2}))return;let[t,r]=e.arguments;if(sF(t)&&sF(r)&&1===Math.abs(t.value-r.value))return t.value<r.value?t:r;let n=(e=>{if("BinaryExpression"===e.type&&"-"===e.operator&&te(e.right,1))return e.left})(t);return sB(r,t)??(sB(t,r)?r:void 0)??(n&&rC(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=e$(a,s.getScope(e)),u=e5(i,r);if(l?.value===0){let n=((e,t,r)=>{let n,o,{sourceCode:a}=r;if(!("BinaryExpression"!==e.type||"-"!==e.operator||!(to(n=e.right)&&Number.isSafeInteger(n.value)&&n.value>0)||!sP(e.left)||!("Identifier"===t.type||tt(t))||!rC(e.left.object,t)||(o=((e,t)=>{let[r,n]=e5(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 ak(t,i,n,r));if(to(i)||sP(i))return;let o=sR(i);return"number"==typeof o?void(yield ak(t,i,String(Math.max(0,o)),r)):(yield t.insertTextBeforeRange(u,"Math.max(0, "),void(yield t.insertTextAfterRange(u,")")))}if(o.every(e=>to(e))){let e;return void(yield(e=String(a.value+i.value),ak(t,i,e,r)))}return n()}:function*({node:e,fixer:t,context:r,abort:n}){let[o,a]=e.arguments,i=o?sR(o):void 0;if(!a){if(sP(o))return;if(void 0!==i)return void(yield ak(t,o,String(Math.max(0,i)),r));let e=e5(o,r);return yield t.insertTextBeforeRange(e,"Math.max(0, "),void(yield t.insertTextAfterRange(e,")"))}let s=sR(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 ak(t,o,String(e[0]),r)),e[1]!==s&&(yield ak(t,a,String(e[1]),r));return}if(0===i||0===s){let e=e4(o,r),n=e4(a,r);yield ak(t,o,"0",r),yield ak(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(!tw(t,{methods:["trimLeft","trimRight"],argumentsLength:0,optionalCall:!1})||or(t.callee.object,e))return;let r=t.callee.property,n=r.name,o="trimLeft"===n?"trimStart":"trimEnd";return{node:r,messageId:sL,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:{[sL]:"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||!e7(t.callee.body,e))return;let{body:r}=t.callee,n={node:t,loc:o4(e5(r,e),e),messageId:sN};return!function(e,t){let{sourceCode:r}=t,[n,o]=e5(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:s$,fix:t=>t.replaceTextRange(e5(r,e),`{ return ${e.sourceCode.getText(r)}; }`)}]),n})},meta:{type:"suggestion",docs:{description:"Disallow unreadable IIFEs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[sN]:"IIFE with parenthesized arrow function body is considered unreadable.",[s$]:"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&&sO.test(r.name)||"MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&sO.test(r.property.name))&&!tT(r,{object:"Data",property:"TaggedError",computed:!1}))return{node:t,messageId:sM,fix:r=>aL(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Require `new` when creating an error.",recommended:"unopinionated"},fixable:"code",messages:{[sM]:"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(tt(e))return s_({node:e,original:e.raw,lowercase:t})}),e.on("Literal",e=>{if(ta(e))return s_({node:e,original:e.raw,regex:sW,lowercase:t})}),e.on("TemplateElement",r=>{if(!tR(r.parent))return s_({node:r,original:r.value.raw,lowercase:t,fix:(t,n)=>aV(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:{[sU]:"Use uppercase characters for the value of the escape sequence.",[sq]:"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=>tt(e)?s6(e,e.raw):ta(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:i,hasReplacement:s}=s8(n,{isRegex:!0,supportsNestedCharacterClasses:o.includes("v")}),l=o.includes("u")||o.includes("v"),u=function(e){for(let t=0;t<e.length;t++)if(void 0!==function(e,t){var r;if(!e.startsWith(sG,t))return;let n=t+sG.length;for(;r=e[n],sJ.test(r);)n++;if(n===t+sG.length||"}"!==e[n])return;let o=Number.parseInt(e.slice(t+sG.length,n),16);if(!(o>1114111))return o}(e,t)&&sQ(e,t))return!0;return!1}(n);if(!s&&(l||!u))return;let p=`/${s?i:n}/${s9(o)}`;return l?{node:e,messageId:sz,fix:t=>t.replaceText(e,p)}:!function(e,t){try{return new a(e,t),!0}catch{return!1}}(s?i:n,s9(o))?{node:e,messageId:sz}:{node:e,messageId:sz,suggest:[{messageId:sK,fix:t=>t.replaceText(e,p)}]}}(e):void 0),e.on("TemplateElement",t=>{if(!tR(t.parent))return s6(t,t.value.raw,(r,n)=>aV(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:{[sz]:"Prefer Unicode code point escapes.",[sK]:"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 s;for(let{node:e,path:r}of new e1(t.getScope(n)).iterateGlobalReferences(Object.fromEntries(s5.map(e=>[e,{[e1.READ]:!0}]))))o.set(e,r);for(let t of r)yield function(e,{context:t,globalReferences:r}){let n;tw(e,{object:"Reflect",method:"apply",minimumArguments:1,optionalCall:!1,optionalMember:!1})?n=e.arguments[0]:tw(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(!tT(e,{optional:!1}))return;let n=e.object;if(th(n)||tx(n))return{constructorName:"ArrayExpression"===n.type?"Array":"Object",methodName:eO(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(tT(n)){let o=n.object;yield r.replaceText(o,`${a}.prototype`),("ArrayExpression"===o.type||"ObjectExpression"===o.type)&&(yield aP(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(!(tm(t,{names:s4,optional:!1},td)&&e.sourceCode.isGlobalReference(t.callee)))return;let r=t.callee.name,n=lr.has(r)?lr.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:s7,data:{constructorName:r}};if("ArrayExpression"===a.type||"ObjectExpression"===a.type)return{node:a,messageId:lt};let i=e$(a,e.sourceCode.getScope(a));if(!i)return;let{value:s}=i;return"string"!=typeof s?{node:a,messageId:lt}:""===s?{node:a,messageId:le}:void 0})},meta:{type:"problem",docs:{description:"Enforce passing a `message` value when creating a built-in error.",recommended:"unopinionated"},messages:{[s7]:"Pass a message to the `{{constructorName}}` constructor.",[le]:"Error message should not be an empty string.",[lt]:"Error message should be a string."},languages:["js/js"]}},"unicorn/no-instanceof-builtins":lc,"unicorn/prefer-type-error":{create:e=>{e.on("ThrowStatement",e=>{let t;if(!(tf(e.argument,{name:"Error"})&&e.parent&&e.parent.body&&1===e.parent.body.length&&e.parent.parent&&"IfStatement"===(t=e.parent.parent).type&&lb(t.test)))return;let r=e.argument.callee;return{node:r,messageId:ld,fix:e=>e.insertTextBefore(r,"Type")}})},meta:{type:"suggestion",docs:{description:"Enforce throwing `TypeError` in type checking conditions.",recommended:"unopinionated"},fixable:"code",messages:{[ld]:"`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 o,n=[],a=[],i=e=>{let r=rj(e.object);if(e.computed||"Identifier"!==e.property.type||!["Identifier","ThisExpression"].includes(r.type))return;let n=t.getScope(e);a.push({propertyName:e.property.name,rootIdentifierName:"Identifier"===r.type?r.name:void 0,rootVariable:"Identifier"===r.type?ey(n,r):void 0,thisScopeBoundary:"ThisExpression"===r.type?lD(r):void 0,start:t.getRange(e)[0],scope:n})},s=e=>{switch(e.type){case"MemberExpression":i(e);break;case"AssignmentPattern":s(e.left);break;case"RestElement":s(e.argument);break;case"ObjectPattern":for(let t of e.properties)s("Property"===t.type?t.value:t.argument);break;case"ArrayPattern":for(let t of e.elements)t&&s(t)}};e.on("AssignmentExpression",e=>{s(e.left)}),e.on(["ForInStatement","ForOfStatement"],e=>{"VariableDeclaration"!==e.left.type&&s(e.left)}),e.on("UpdateExpression",e=>{"MemberExpression"===e.argument.type&&i(e.argument)}),e.on("UnaryExpression",e=>{"delete"===e.operator&&"MemberExpression"===e.argument.type&&i(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&&ey(t.getScope(e),o),thisScopeBoundary:"ThisExpression"===e.init.type?lD(e.init):void 0,objectPattern:e.id},i=t.getText(e.init);r.set(i,[...r.get(i)??[],a])});let l=e=>{let n,o;if((o=e).computed||tm(o.parent,void 0,td)&&o.parent.callee===o||"TaggedTemplateExpression"===o.parent.type&&o.parent.tag===o||nL(o))return;let i=rj(e.object),s=r.get(t.getText(i));if(!s)return;let l=t.getScope(e),u="Identifier"===i.type?i:void 0,p=u&&ey(l,u),c="ThisExpression"===i.type?lD(i):void 0,d=t.getText(e.property);for(let r of s.toReversed())if(lA({declaration:r,memberExpressionNode:e,memberScope:l,memberRootIdentifier:u,memberRootVariable:p,memberThisScopeBoundary:c,memberExpressionWrites:a,sourceCode:t})&&(n=lT(r.objectPattern.properties.filter(e=>lS(e)&&"Identifier"===e.value.type),d,l,t)))break;if(!n||((e,t)=>{let r=e,{parent:n}=e;for(;n&&!lI(n);){if(lk(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:lE};let m=t.getText(e),f=n.value.name;return{node:e,messageId:lE,suggest:[{messageId:lv,data:{expression:m,property:f},fix:t=>t.replaceText(e,f)}]}};e.on("MemberExpression",e=>{n.push(e)}),e.onExit("Program",function*(){for(let e of n){let t=l(e);t&&(yield t)}})},meta:{type:"suggestion",docs:{description:"Use destructured variables over properties.",recommended:!1},hasSuggestions:!0,messages:{[lE]:"Use destructured variables over properties.",[lv]:"Replace `{{expression}}` with destructured property `{{property}}`."},languages:["js/js"]}},"unicorn/new-for-builtins":{create:e=>{lL.listen({context:e}),lN.listen({context:e}),l$.listen({context:e}),lM.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.",[lB]:"Use `String(new Date())` instead of `Date()`.",[lR]:"Switch to `String(new Date())`."},languages:["js/js"]}},"unicorn/prefer-single-call":l_,"unicorn/no-process-exit":{create:e=>{if(0===e.sourceCode.lines[0].indexOf("#!"))return;let t=0,r=!1,n=[],o=e=>tw(e,{object:"process",methods:["on","once"],minimumArguments:1,optionalCall:!1,optionalMember:!1});e.on("CallExpression",e=>{tj(e)&&lK(e.arguments[0])&&(r=!0)}),e.on("ImportDeclaration",e=>{"Literal"===e.source.type&&lK(e.source)&&(r=!0)}),e.on("CallExpression",e=>{o(e)&&t++}),e.onExit("CallExpression",e=>{o(e)&&t--}),e.on("CallExpression",e=>{0===t&&tw(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:lz}})},meta:{type:"suggestion",docs:{description:"Disallow `process.exit()`.",recommended:"unopinionated"},messages:{[lz]:"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(!!l2(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:l0,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(l2(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 aF(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 aF(o,t,r);let a=l2(e)?n.getLastToken(e):n.getTokenAfter(e),i=eE(a);if(l2(e)){let{key:t,value:o}=e;if(o){let e=n.getTokenAfter(t,l1);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:{[l0]:"Use an object instead of a class with only static members."},languages:["js/js"]}},"unicorn/no-unreadable-array-destructuring":l6,"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)||tm(r.parent.parent,void 0,td)&&r.parent.parent.arguments.includes(r.parent)))))return;let n=r.parent,o=t.getFirstToken(n),a=n.parent.type,i={node:o,messageId:l9,data:{argumentType:"ArrayExpression"===r.type?"array":"object",parentDescription:ul[a]}};return"NewExpression"===a&&us(r)&&tf(n.parent,{names:uo,argumentsLength:1,allowSpreadElement:!0})?i:{...i,*fix(i){let s;yield i.remove(o),yield aT(r,i,e);let l=t.getFirstToken(r);yield i.remove(l);let[u,p]=t.getLastTokens(r,2);if(yield i.remove(p),eb(u)&&(yield i.remove(u)),th(r)||tx(r)){let e=t.getTokenAfter(n);eb(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 eb(e)?e:void 0}let a=t.getTokenAfter(e||s,eb);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(!tw(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:ut};return t.getCommentsInside(r).length>0?i:{...i,suggest:[{messageId:un,fix:t=>t.replaceText(r,r.properties.map(t=>e4(t.argument,e)).join(", "))}]}}),e.on("NewExpression",e=>{if(tf(e,{names:uo,argumentsLength:1,allowSpreadElement:!0})&&"SpreadElement"===e.arguments[0].type&&"ArrayExpression"!==e.arguments[0].argument.type)return{node:e.arguments[0],messageId:ue,data:{constructorName:`new ${e.callee.name}(…)`}}}),e.on("ArrayExpression",t=>{if(!us(t))return;let{parent:r}=t;if(!("ForOfStatement"===r.type&&r.right===t||"YieldExpression"===r.type&&r.delegate&&r.argument===t||(tf(r,{names:uo,argumentsLength:1})||tf(r,{names:rZ,minimumArguments:1})||tw(r,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(r,{objects:["Array",...rZ],method:"from",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(r,{object:"Object",method:"fromEntries",argumentsLength:1,optionalCall:!1,optionalMember:!1}))&&r.arguments[0]===t))return;let n="",o=l5;switch(r.type){case"ForOfStatement":o=l4;break;case"YieldExpression":o=l7;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=>uu(r,t,e)}}),e.on("ArrayExpression",t=>{if(!us(t))return;let r=t.elements[0].argument,n=!!tw(r,{methods:ui,optionalCall:!1,optionalMember:!1})&&nE(r.callee.object,e)&&nE(r,e);if(!n&&!(!nv(r,e)&&(tw(r,{methods:ua,optionalCall:!1,optionalMember:!1})?!up(r,e):tw(r,{method:"concat",optionalCall:!1,optionalMember:!1})?!("Identifier"===r.callee.object.type&&"Iterator"===r.callee.object.name||up(r,e)):tw(r,{method:"split",optionalCall:!1,optionalMember:!1})||tw(r,{object:"Object",methods:["keys","values"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||"AwaitExpression"===r.type&&tw(r.argument,{object:"Promise",methods:["all","allSettled"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||tw(r,{object:"Array",methods:["from","of"],optionalCall:!1,optionalMember:!1})||tf(r,{name:"Array"}))))return;let o={node:t,messageId:ur};return tf(r,{name:"Array"})||tw(r,{method:"slice",optionalCall:!1,optionalMember:!1})&&!n?o:Object.assign(o,{fix:r=>uu(r,t,e)})})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary spread.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[l9]:"Spread an {{argumentType}} literal in {{parentDescription}} is unnecessary.",[l5]:"`{{parentDescription}}` accepts an iterable as an argument, it's unnecessary to convert to an array.",[l4]:"`for…of` can iterate over an iterable, it's unnecessary to convert to an array.",[l7]:"`yield*` can delegate to an iterable, it's unnecessary to convert to an array.",[ue]:"`{{constructorName}}` accepts a single iterable argument, spreading is misleading.",[ut]:"`Object.assign(…)` source object with only spread properties is unnecessary.",[ur]:"Unnecessarily cloning an array.",[un]:"Remove the object literal wrapper."},languages:["js/js"]}},"unicorn/no-useless-switch-case":{create:e=>{let t=rz(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(!um(o))break;t&&uf(o)||(yield{node:o,loc:function(e,t){let{sourceCode:r}=t,n=e.test||r.getFirstToken(e),o=r.getTokenAfter(n,ev);return{start:r.getLoc(e).start,end:r.getLoc(o).end}}(o,e),messageId:uc,suggest:[{messageId:ud,fix:e=>e.remove(o)}]})}})},meta:{type:"suggestion",docs:{description:"Disallow useless case in switch statements.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[uc]:"Useless case in switch statement.",[ud]:"Remove this case."},languages:["js/js"]}},"unicorn/no-useless-undefined":uP,"unicorn/numeric-separators-style":uM,"unicorn/prefer-array-find":u6,"unicorn/prefer-array-flat-map":{create:e=>{e.on("CallExpression",t=>{if(!(tw(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)&&tw(t.callee.object,{method:"map",optionalCall:!1})))return;let r=t.callee.object;if(tB(r.callee.object,u7)||nD(r.callee.object,e))return;let{sourceCode:n}=e,o=r.callee.property,a=rL(e,t,[r])||t.typeArguments||t.typeParameters||r.typeArguments||r.typeParameters?void 0:function*(r){yield aM(r,t,e),yield r.replaceText(o,"flatMap")};return{node:t,loc:{start:n.getLoc(o).start,end:n.getLoc(t).end},messageId:u9,fix:a}}),e.on("CallExpression",t=>{let r;if(!tw(t,{method:"flatMap",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||t.typeArguments||t.typeParameters)return;let n=t.callee.object;if(!tw(n,{method:"filter",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||n.typeArguments||n.typeParameters||rY(n.callee.object)||nv(n.callee.object,e))return;let{sourceCode:o}=e;if(o.getCommentsInside(t).length>0)return;let[a]=n.arguments,[i]=t.arguments;if(!pt(a)||!pt(i)||!("ArrayExpression"===(r=i.body).type&&r.elements.length>1))return;let[s]=a.params,[l]=i.params;if(!om(s,l))return;let u=function(e,t){if(e7(e,t))return e4(e,t);let r=t.sourceCode.getText(e);return oZ(e,t)?`(${r})`:r}(n.callee.object,e),p=o.getText(s),c=function(e,t){if(e7(e,t))return e4(e,t);let r=t.sourceCode.getText(e);return pe.has(e.type)?`(${r})`:r}(a.body,e),d=o.getText(i.body);return{node:t.callee.property,messageId:u5,suggest:[{messageId:u4,fix:e=>e.replaceText(t,`${u}.flatMap(${p} => ${c} ? ${d} : [])`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer `.flatMap(…)` over `.map(…).flat()` and `.filter(…).flatMap(…)`.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[u9]:"Prefer `.flatMap(…)` over `.map(…).flat()`.",[u5]:"Prefer a single `.flatMap(…)` over `.filter(…).flatMap(…)`.",[u4]:"Replace `.filter(…).flatMap(…)` with a single `.flatMap(…)`."},languages:["js/js"]}},"unicorn/prefer-array-flat":pp,"unicorn/prefer-array-some":pf,"unicorn/prefer-code-point":{create:e=>{e.on("CallExpression",e=>{if(tw(e,{method:"charCodeAt",optionalCall:!1}))return pg(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 py.has(r.operator);case"UnaryExpression":return ph.has(r.operator);case"AssignmentExpression":return r.right===t&&py.has(r.operator.slice(0,-1));default:return!1}})(e))}),e.on("MemberExpression",e=>{if(tT(e,{object:"String",property:"fromCharCode",optional:!1}))return pg(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=ey(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(pv(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:px,suggest:[{messageId:pb,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(tE,e=>{r.push(e)}),e.onExit(tE,()=>{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:{[px]:"Prefer default parameters over reassignment.",[pb]:"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=pF(e);if(r?.kind==="nullish")return r;if("LogicalExpression"!==e.type)return;let n=pF(e.left),o=pF(e.right);if(n&&o&&pk(n.reference,o.reference,t)){if("||"===e.operator&&n.isTrueWhenNullish&&o.isTrueWhenNullish&&pB(n,o))return{reference:n.reference,isTrueWhenNullish:!0};if("&&"===e.operator&&!n.isTrueWhenNullish&&!o.isTrueWhenNullish&&pB(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&&pk(i,o,t.sourceCode))return pI({context:t,conditionalExpression:e,left:o,right:n,operators:["??"]});if(!a.isTrueWhenNullish&&pk(i,n,t.sourceCode))return pI({context:t,conditionalExpression:e,left:n,right:o,operators:["??"]});let s=a.isTrueWhenNullish?n:o,l=a.isTrueWhenNullish?o:n;if(!tP(s)||!tT(l)||l.optional||!rC(rj(i),rj(l.object))||function(e){let t=e,{parent:r}=t;for(;rI(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=rV(e,t);if(r$(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:pD,suggest:[{messageId:pT,fix(r){let n=u;return oD(t.sourceCode.getTokenBefore(e),t,n)&&(n=`;${n}`),r.replaceText(e,n)}}]}}(r,e);return i||(pk(n,o,t)?pI({context:e,conditionalExpression:r,left:n,right:a}):"UnaryExpression"===n.type&&"!"===n.operator&&n.prefix&&pk(n.argument,a,t)?pI({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:{[pC]:"Prefer using a logical operator over a ternary.",[pD]:"Prefer using optional chaining over a ternary.",[pS]:"Switch to `{{operator}}` operator.",[pT]:"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?pR:pP,data:{name:a},fix:s?void 0:function*(e){let t=n.getTokenBefore(r);tW(t,{test:eC,expected:"(",ruleId:"prefer-optional-catch-binding"});let o=n.getTokenAfter(r);tW(o,{test:eD,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:{[pR]:"Remove unused catch binding `{{name}}`.",[pP]:"Remove unused catch binding."},languages:["js/js"]}},"unicorn/prefer-regexp-test":ce,"unicorn/prefer-set-has":cf,"unicorn/prefer-string-raw":{create:e=>{e.on("Literal",t=>{if(!tt(t)||function(e){let{parent:t}=e,{type:r}=t;return tg(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)||cg(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=cx(n.slice(1,-1),n.charAt(0));if(o===t.value)return{node:t,messageId:cy,*fix(r){yield aP(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)||cx(t)!==e)||cg(t)))return{node:t,messageId:cy,*fix(r){for(let n of(yield aP(r,t,e),yield r.insertTextBefore(t,"String.raw"),t.quasis)){let{cooked:t,raw:o}=n.value;t!==o&&(yield aV(n,t,e,r))}}}}),e.on("TaggedTemplateExpression",t=>{let{quasi:r,tag:n,parent:o}=t,{sourceCode:a}=e;if(!tT(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:ch,*fix(r){let n=a.getTokenBefore(t);oD(n,e,s)&&(yield r.insertTextBefore(t,";")),"ReturnStatement"!==o.type&&"ThrowStatement"!==o.type||op(n,t.quasi,e)||e7(t,e)||(yield aj(r,o,e)),"YieldExpression"!==o.type||o.delegate||o.argument!==t||op(n,t.quasi,e)||e7(t,e)||(yield r.insertTextBefore(t,"("),yield r.insertTextAfter(t,")")),yield r.replaceText(t.quasi,s),yield aT(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:{[cy]:"`String.raw` should be used to avoid escaping `\\`.",[ch]:"Using `String.raw` is unnecessary as the string does not contain any `\\`."},languages:["js/js"]}},"unicorn/prefer-switch":cT,"unicorn/require-number-to-fixed-digits-argument":{create:e=>{e.on("CallExpression",t=>{if(!tw(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:cA,fix:r=>aA(r,t,"0",e)}})},meta:{type:"suggestion",docs:{description:"Enforce using the digits argument with `Number#toFixed()`.",recommended:"unopinionated"},fixable:"code",messages:{[cA]:"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 i,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 l,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 cF(cR(e.lines,t)).indent||cF(cw(r=cR(n.split(/\r?\n/)))).indent||cF(r).indent||" "}return r.startsWith(" ")?" ":" "})(t,n,m,l);let f=cw(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:cB,fix:t=>g.split(s).map((r,n)=>aV(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!!(cg(e)||r.tags.length>0&&tR(e,r.tags))||!!(r.functions.length>0&&"CallExpression"===e.parent.type&&e.parent.arguments.includes(e)&&tB(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:cP,defaultOptions:[{tags:["outdent","dedent","gql","sql","html","styled"],functions:["dedent","stripIndent"],selectors:[],comments:["HTML","indent"]}],messages:{[cB]:"Templates should be properly indented."},languages:["js/js"]}},"unicorn/no-single-promise-in-promise-methods":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{object:"Promise",methods:lY,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:lG,data:{method:r}},{sourceCode:o}=e;if("AwaitExpression"===t.parent.type&&t.parent.argument===t&&("all"!==r||tb(t.parent.parent)))return n.fix=r=>r.replaceText(t,lH(t,e)),n;return"all"===r?(n.fix=((e,t)=>{let{sourceCode:r}=t;if(lQ(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&&lZ(t.id)?t.id:"AssignmentExpression"===t.type&&t.right===e&&lZ(t.left)&&tb(t.parent)?t.left:void 0})(n);if(o){if(lQ(r,o))return;return function*(n){yield n.replaceText(o,r.getText(o.elements[0])),yield n.replaceText(e,lH(e,t))}}let a=n.parent;if("MemberExpression"===a.type&&a.computed&&te(a.property,0)&&a.object===n&&("VariableDeclarator"===a.parent.type&&a.parent.init===a||"AssignmentExpression"===a.parent.type&&a.parent.right===a)&&!lQ(r,a))return r=>r.replaceText(a,`await ${lH(e,t)}`)})(t,e),n):(n.suggest=[{messageId:lJ,fix:r=>{let[n]=t.arguments[0].elements,o=e4(n,e);return e7(n,e)||"Identifier"===n.type||"MemberExpression"===n.type||(o=`(${o})`),oD(e.sourceCode.getTokenBefore(t),e,o)&&(o=`;${o}`),r.replaceText(t,o)}},{messageId:lX,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),eb(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:{[lG]:"Wrapping single-element array with `Promise.{{method}}()` is unnecessary.",[lJ]:"Use the value directly.",[lX]:"Switch to `Promise.resolve(…)`."},languages:["js/js"]}},"unicorn/no-await-in-promise-methods":{create:e=>{e.on("CallExpression",function*(t){if(tw(t,{object:"Promise",methods:c$,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:cL,data:{method:t.callee.property.name},suggest:[{messageId:cN,*fix(t){let n=e.sourceCode.getFirstToken(r);yield t.remove(n),yield aF(n,e,t)}}]})})},meta:{type:"suggestion",docs:{description:"Disallow using `await` in `Promise` method parameters.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[cL]:"Promise in `Promise.{{method}}()` should not be awaited.",[cN]:"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&&cU.has(t.operator)&&cq(n))||cq(n.argument))return;let{sourceCode:o}=e,a=o.getFirstToken(n),i=`${r.startsWith("!")?"=":"!"}${r.slice(1)}`;return{node:a,messageId:cM,suggest:[{messageId:cO,data:{operator:i},*fix(s){yield aP(s,t,e);let l=o.getTokenAfter(a),{parent:u}=t;("ReturnStatement"===u.type||"ThrowStatement"===u.type)&&!e7(t,e)&&(op(o.getFirstToken(u),l,e)||(yield aj(s,u,e))),yield s.remove(a),oD(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:{[cM]:"Negated expression is not allowed in equality check.",[cO]:"Switch to '{{operator}}' check."},languages:["js/js"]}},"unicorn/no-unnecessary-slice-end":{create(e){cV(e,{methods:["slice"],messageId:cW})},meta:{type:"suggestion",docs:{description:"Disallow using `.length` or `Infinity` as the `end` argument of `{Array,String,TypedArray}#slice()`.",recommended:"unopinionated"},fixable:"code",messages:{[cW]:"Passing `{{description}}` as the `end` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-lonely-if":{create:e=>{e.on("IfStatement",t=>{if(di(t)&&("BlockStatement"===t.parent.type&&1===t.parent.body.length&&t.parent.body[0]===t&&di(t.parent.parent)&&t.parent.parent.consequent===t.parent||di(t.parent)&&t.parent.consequent===t))return{node:t,messageId:da,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,...ds(i,r)},l={...e,...ds(e,r)},u=dc(s,r),p=dd(s,t,r),c=dp(du(dc(l,r)),dd(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(eA(a)){let t=n.getTokenAfter(e);t&&oD(a,r,t.value)&&(o[1]=n.getRange(t)[0])}return o}(i,l.consequent,t,r),m={outerConditionGap:s.openingBraceToken?du(dl(s.closingParenthesisToken,s.openingBraceToken,r)):"",outerLeadingContent:s.openingBraceToken?du(dl(s.openingBraceToken,l.ifToken,r)):du(dl(s.closingParenthesisToken,l.ifToken,r)),outerTrailingContent:s.openingBraceToken?du(dl(l,s.closingBraceToken,r)):""},f=(o=m.outerConditionGap,a=m.outerLeadingContent,o.trimStart().startsWith("//")?{leadingStatementText:du(a).trimStart(),conditionSuffixText:o}:{leadingStatementText:du(dp(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=dl(t.closingParenthesisToken,t.openingBraceToken,n),r=dl(t.openingBraceToken,t.closingBraceToken,n);return`${s}${e}{${r}${i}}`}let l=dl(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:{[da]:"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(!tw(t,{method:"flat",argumentsLength:1,optionalCall:!1}))return;let[r]=t.arguments;if(!to(r)||1===r.value)return;let{sourceCode:n}=e,{openingParenthesisToken:o,closingParenthesisToken:a}=rx(t,e);if(!n.commentsExistBetween(o,a))return{node:r,messageId:dm}})},meta:{type:"suggestion",docs:{description:"Disallow a magic number as the `depth` argument in `Array#flat(…).`",recommended:"unopinionated"},messages:{[dm]:"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:df,*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 aT(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=e5(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 aP(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||op(i,s,e)||e7(t,e)||e7(r,e)?oD(o.getTokenBefore(t),e,s.value)&&(yield n.insertTextBefore(t,";")):yield aj(n,a,e)}}})},meta:{type:"suggestion",docs:{description:"Disallow negated conditions.",recommended:"unopinionated"},fixable:"code",messages:{[df]:"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&&tv(e.parent)&&e.parent.params.includes(e)))return;let{left:t,right:r}=e;return"Identifier"===t.type?{node:t,messageId:dg,data:{parameter:t.name}}:{node:r,messageId:dy}})},meta:{type:"problem",docs:{description:"Disallow the use of objects as default parameters.",recommended:"unopinionated"},messages:{[dg]:"Do not use an object literal as default for parameter `{{parameter}}`.",[dy]:"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(dx.has(n))return{method:n,target:o,argumentsNodes:a};if("call"!==n&&"apply"!==n||(n=db(t.object),!dx.has(n)))return;let i="apply"===t.property.name,{supportObjects:s}=dx.get(n),l=t.object.object;if(th(l)||"slice"===n&&te(l,"")||"prototype"===db(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}=dx.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=rj(t);if("BinaryExpression"!==o||"-"!==a||!(to(n=rj(s))&&n.value>0))return;let l=rj(i);return"MemberExpression"===l.type&&!l.computed&&!l.optional&&"Identifier"===l.property.type&&"length"===l.property.name&&ux(l.object,r)?i:e(i,r)})(a[e],o)).filter(Boolean);if(0!==s.length)return{node:t,messageId:dh,data:{method:n},*fix(t){for(let r of s)yield function(e,t,r){let[n,o]=e5(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:{[dh]:"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||(tw(t.parent,{object:"process",method:"getBuiltinModule",argumentsLength:1,optionalCall:!1,optionalMember:!1})||tj(t.parent))&&t.parent.arguments[0]===t))return;let{value:r}=t;if(!("string"==typeof r&&!r.startsWith(dD)&&dv(r)&&dv(`${dD}${r}`)))return;let n=e.sourceCode.getRange(t)[0]+1;return{node:t,messageId:dC,data:{moduleName:r},fix:e=>e.insertTextAfterRange([n,n],dD)}})},meta:{type:"suggestion",docs:{description:"Prefer using the `node:` protocol when importing Node.js builtin modules.",recommended:"unopinionated"},fixable:"code",messages:{[dC]:"Prefer `node:{{moduleName}}` over `{{moduleName}}`."},languages:["js/js"]}},"unicorn/consistent-date-clone":{create:e=>{e.on("NewExpression",t=>{if(!tf(t,{name:"Date",argumentsLength:1}))return;let[r]=t.arguments;if(!tw(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:dS,fix:t=>aM(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer passing `Date` directly to the constructor when cloning.",recommended:"unopinionated"},fixable:"code",messages:{[dS]:"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)&&dA(n.key)&&("get"===n.kind&&(dk(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&&dw(e.key,n.key)))||"set"===n.kind&&((e,t)=>{if(!dk(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:dT,data:{kind:n.kind}}})},meta:{type:"problem",docs:{description:"Disallow recursive access to `this` within getters and setters.",recommended:"unopinionated"},defaultOptions:[],messages:{[dT]:"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(!tT(r,{properties:["url","filename"],computed:!1,optional:!1}))return;let n=r.property.name;if("url"===n){if(dB(r.parent,t)&&r.parent.arguments[0]===r)return void(yield a(r.parent,{reportFilenameNode:!0}));if(tf(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&&dB(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&&dB(n,t)&&n.arguments[0]===e&&(yield i(n,"dirname"))}return}function*a(e,{reportFilenameNode:r=!1}={}){let{parent:n}=e;if(dR(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=ey(t.getScope(n.id),n.id);if(o)for(let e of o.references){if(!e.isReadOnly())continue;let{parent:r}=e.identifier;dR(r,t)&&r.arguments[0]===e.identifier&&(yield i(r,"dirname"))}}function i(e,t){return{node:e,messageId:"dirname"===t?dI:dj,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:{[dI]:"Do not construct dirname.",[dj]:"Do not construct filename using `fileURLToPath()`."},languages:["js/js"]}},"unicorn/no-unnecessary-array-flat-depth":{create:e=>{e.on("CallExpression",t=>{if(!(tw(t,{method:"flat",argumentsLength:1,optionalCall:!1})&&te(t.arguments[0],1)))return;let[r]=t.arguments;return{node:r,messageId:dP,fix:t=>aw(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Disallow using `1` as the `depth` argument of `Array#flat()`.",recommended:"unopinionated"},fixable:"code",messages:{[dP]:"Passing `1` as the `depth` argument is unnecessary."},languages:["js/js"]}},"unicorn/no-unnecessary-array-splice-count":{create(e){cV(e,{methods:["splice","toSpliced"],messageId:dL})},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:{[dL]:"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&&s4.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))&&tw(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||tT(e,{property:"constructor",computed:!1,optional:!1})&&"ThisExpression"===e.object.type)return!0;if("Identifier"!==e.type||!t.id)return!1;let n=ey(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:dN},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:{[dN]:"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:d$};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 eE(r)?void(yield s.insertTextBefore(r,e)):void(yield s.insertTextAfter(l,`${e};`))}let u=t.getLastToken(r),p=rw(n,e),c=`${p}${a} = ${i};
48
48
  `;"\n"!==t.getText()[t.getRange(u)[0]-1]&&(c=`
49
- ${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:dB,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:{[dF]:"Prefer class field declaration over `this` assignment in constructor for static values.",[dB]:"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(!ts(t,{name:"BigInt",argumentsLength:1,optional:!1},to))return;let[r]=t.arguments,n=function(e){let t,r;if(e6(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:dR},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!e3(t,e)&&s<0n&&(n=`(${n})`,oh(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:dP,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:{[dR]:"Prefer using bigint literal over `BigInt(…)`.",[dP]:"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=>!dU(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&dq(o,a))return dM(r,function*(n){let i=e2(o.callee.object.object,e),s=e2(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=dW(p,u,o),d=c?"":dO(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+=";"),oh(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield ak(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>e6(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&&d$(t.parent.object)&&ts(t.parent.parent,{optional:!1,argumentsLength:1},to)&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return dM(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=dW(i,a,o)?"":dO(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield aj(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:{[dL]:"Prefer using `Element#classList.toggle()` to toggle class names.",[dN]:"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:dV,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)&&td(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:dV,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(em(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,em),...t.getTokens(a),...e0(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:{[dV]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of d1)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=o9(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):ep(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:{[d_]:"Immediate mutation on {{objectType}} is not allowed.",[dz]:"{{operation}} the elements to the {{assignType}}.",[dK]:"Move this property to the {{assignType}}.",[dG]:"{{description}} the {{assignType}}.",[dJ]:"Move the element to the {{assignType}}.",[dX]:"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(!tl(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=tc(r=i)?"empty array":e8(r,"")?"empty string":te(r)?"`null`":tk(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=e3(o,e),[,s]=a?e1(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield ab(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>aS(t,i,e);let u={node:i,messageId:d2,data:{description:s}};return l?u.suggest=[{messageId:d3,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:{[d2]:"The {{description}} is useless.",[d3]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tl(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(tS(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:d8,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield aA(t,e,n);let[o]=r.arguments,a=e1(r,e),i=e1(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!e3(t,e)&&e3(t.callee,e)&&oh(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:{[d8]:"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=>f.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>mE[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=g.relative(r,g.resolve(r,t)))||".."===l||l.startsWith(`..${g.sep}`)||g.isAbsolute(l)?[g.basename(t)]:l.split(g.sep).filter(e=>"."!==e)),{basename:c,filename:d,middle:m,extension:f}=function(e,{multipleFileExtensions:t}){let r=g.extname(e),n=g.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".",1);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}=mD(e);if(e.startsWith("$")||mS(a,r))return;let i=mv(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:mp,data:{directory:e,chosenCases:mT(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),mf.format(n))}}}(e,n,s);if(t)return t}if(mm.has(c))return;let{leading:y,words:h}=mD(d);if(d.startsWith("$")||mS(h,s))return f!==f.toLowerCase()?{loc:{column:0,line:1},messageId:mc,data:{filename:d+m+f.toLowerCase(),extension:f}}:void 0;let x=mv(h,s,{leading:y,trailing:m+f.toLowerCase()});return{loc:{column:0,line:1},messageId:mu,data:{chosenCases:mT(n),renamedFilenames:(u=x.map(e=>`\`${e}\``),mf.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:mA,defaultOptions:[],messages:{[mu]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[mp]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[mc]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tw(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:mw,fix:r=>aN(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[mw]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tl(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tl(t,{names:rG,minimumArguments:1}))||!mV(t.arguments[0]))return;let r=t.arguments[0],n=1===t.arguments.length?m_(r,e):void 0,o=t.arguments.length>1?mz(r,e,mO):void 0;return{node:r.callee.property,messageId:mP,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tS(e,{objects:["Array",...rG],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mV(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?m_(r,t):void 0,o=e.arguments.length>1?mz(r,t,mO):void 0;return{node:r.callee.property,messageId:mP,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tS(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mV(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?m_(r,t):void 0,o=e.arguments.length>1?mz(r,t,mO):void 0;return{node:r.callee.property,messageId:mP,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tS(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!mV(e.arguments[0]))return;let r=e.arguments[0],n=mz(r,t,mO);return{node:r.callee.property,messageId:mP,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tS(e,{methods:mq,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tS(e,{method:mW,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!mV(e.callee.object))return;let o=e.arguments[0],a=e.callee.property.name,i=a===mW;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"===(r=mR(r)).type||"FunctionExpression"===r.type)&&(r.params.length>n||r.params.at(-1)?.type==="RestElement"||"FunctionExpression"===r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value)))return;let s=e.callee.object,l=mz(s,t,mU,{method:a});return{node:s.callee.property,messageId:mM,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!mV(t.right))return;let r=m_(t.right,e);return{node:t.right.callee.property,messageId:mL,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!mV(t.argument))return;let r=m_(t.argument,e);return{node:t.argument.callee.property,messageId:mN,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!mV(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=m_(t.argument,e);return{node:t.argument.callee.property,messageId:m$,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mP]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[mL]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[mN]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[m$]:"Spread works on iterables, `.toArray()` is unnecessary.",[mM]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[mO]:"Remove `.toArray()`.",[mU]:"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||function(e){let{operator:t}=e,{parent:r}=e;for(;rC(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tL(t,r)||tN(t))return!0;let{parent:n}=t;return rC(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rD(t);return"LogicalExpression"!==o.type||o.operator!==r?n.push(t):(e(o.left,r,n),e(o.right,r,n)),n}(r,r.operator),o=n.map(e=>({operand:e,isSimple:mY(e)})),a=o.findIndex(({isSimple:e})=>!e),i=o.findIndex(({isSimple:e},t)=>e&&t>a);if(-1===a||-1===i)return;let s=[...o.filter(({isSimple:e})=>e),...o.filter(({isSimple:e})=>!e)].map(({operand:e})=>e),l=o.findLastIndex(({isSimple:e})=>e),u=o.every(({operand:e,isSimple:t},r)=>{var n;return t||r>l||mY(n=e)||function e(t){let r=rD(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>mY(t)||mX(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rC(t)){let e=rD(t);return"LogicalExpression"===e.type&&e.operator===r}return"LogicalExpression"===t.type&&t.operator===r&&(e(t.left,r)||e(t.right,r))}(r,r.operator)&&!function(e,t,r){let{sourceCode:n}=r;if(n.getCommentsInside(e).length>0)return!0;let[o]=t,a=t.at(-1),[i]=e1(o,r),[,s]=e1(a,r),l={range:[i,s]};return eb(n.getTokenBefore(l,{includeComments:!0}))||eb(n.getTokenAfter(l,{includeComments:!0}))}(r,n,e)?n=>n.replaceTextRange(t.getRange(r),s.map((t,n)=>(function(e,t,{operator:r,property:n}){let o=e3(e,t),a=o?e2(e,t):t.sourceCode.getText(e);return!o&&oH(e,{operator:r,property:n})&&(a=`(${a})`),a})(t,e,{operator:r.operator,property:0===n?"left":"right"})).join(` ${r.operator} `)):void 0;return{node:r,loc:t.getLoc(n[i]),messageId:u?mK:mG,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[mK]:"Prefer this simple condition first in the `{{operator}}` expression.",[mG]:"Consider moving this simple condition first after verifying short-circuit behavior."},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(!mQ.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:mH,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=>eb(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||rj(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=rS(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
50
- ${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:{[mH]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(m7(e)){if(m4(e.object,"childNodes"))return"childNodes";if(m4(e.object,"children"))return"children"}})(t);if(!n||n7(t.object.object)||"children"===n&&m4(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tb(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&m4(t.parent,"children")&&m7(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:mZ,suggest:ft(t,"firstChild",m8,e)}:"children"===n&&0===o?{node:t,messageId:m0,suggest:ft(t,"firstElementChild",m6,e)}:"children"===n?{node:t,messageId:m1}:void 0}),e.on("MemberExpression",e=>{if(!(!fr(e)||!fr(e.object)||!(!fr(e.parent)||e.parent.object!==e)||n7((e=>{for(;fr(e);)e=e.object;return e})(e))))return{node:e,messageId:m2}}),e.on("CallExpression",t=>{if(!fo(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&fo(t.parent.parent)&&fn(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(;fo(e);){let[r]=e.arguments;if(!fn(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||n7(e))return;let r=[];for(let e of t)r.unshift(e5(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:m3,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(fe(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=e2(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(${tU(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:m9,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[mZ]:"Prefer `.firstChild` over `.childNodes[0]`.",[m0]:"Prefer `.firstElementChild` over `.children[0]`.",[m1]:"Consider `.querySelector()` over positional child traversal.",[m2]:"Consider `.closest()` over chaining `.parentElement`.",[m3]:"Consider merging chained `.querySelector()` calls.",[m8]:"Switch to `.firstChild`.",[m6]:"Switch to `.firstElementChild`.",[m9]:"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?{...fp,...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(fd(n)),r.push(fd(o5(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${fm}`,"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=ff(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&&tD(a.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||fs(s)))||!(!op(s.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||fs(s)))||!t.checkShorthandProperties&&om(s.name))return;let l=[...r.references.map(e=>e.from),r.scope],u=rT(i)?rp(i,l,o):void 0,p=fg(s.name,u??i);if(u&&rW(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!fa.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:fu,data:{replacement:u},fix:t=>aL(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=ff(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||fi.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=fg(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 ro(e.sourceCode.getScope(r)))s(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:fy,defaultOptions:[{}],messages:{[fl]:"Prefer `{{replacement}}` over `{{name}}`.",[fu]:"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(!tl(e,{name:"File",minimumArguments:2,maximumArguments:2})||!fb(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===e5(n))return;let[o]=r.elements;if(function(e,t,r){let n=fE(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tl(o,{name:"Blob",maximumArguments:1})||tl(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&fb(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=ep(r.getScope(n),n);if(!i)return;let s=rW(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return tS(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&fb(n.callee.object,t)?{call:n,kind:"blobArgument"}:tS(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=fE(n.callee.object,t)?.init,tl(r,{name:"FormData",argumentsLength:0})&&fb(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 ep(n.getScope(e),e)===ep(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)||rj(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:fh,suggest:[{messageId:fx,*fix(n){yield aR(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:{[fh]:"Use the original `Blob` instead of converting it to a `File`.",[fx]:"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(!tS(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=fC(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tS(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?fD(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&fD(o.property.name))))return{node:a,messageId:fS}}),e.on("CallExpression",e=>{if(!tS(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tS(fC(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:fS}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[fS]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tS(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=oK(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?fT:-1===Math.trunc(oK(e))&&0===r?fA: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=e2(o,r),p=n.getText(i),c=n.getText(s);if(t===fT){if(fj(e,n))return;if("toSpliced"===l){var d,m;if(0>Math.trunc(oK(i))||(d=i,m=o,d=rD(d),m=rD(m),"MemberExpression"===d.type&&!d.optional&&!d.computed&&"Identifier"===d.property.type&&"length"===d.property.name&&ud(d.object,m)))return;return{messageId:fw,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&fI(o)&&(oK(i)??0)>=0?{messageId:fw,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===fA&&fI(o)&&!fj(i,n))return{messageId:fk,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:{[fT]:"Prefer a direct element replacement instead of `{{method}}()`.",[fA]:"Avoid using `{{method}}()` to insert at `-1`.",[fw]:"Use direct element replacement.",[fk]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tl(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return rE(n.elements,e).map(e=>({node:e??n,messageId:fF,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[fF]:"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(!fO(r)||fq(r))return;let n=r.object;if(!fW(r,n,t,e))return fz(r,n,e)}),e.on("CallExpression",r=>{let n;if(fU(r)){if(fq(r))return;let n=r.callee.object;if(fW(r,n,t,e))return;return fz(r,n,e)}let o=f_(r,e);if(o)return o;if(fM(r)&&!(fO(n=r.parent)||fU(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&fU(r.parent.parent))){let e;if(e=e5(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:fR}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(fG(e,fM,r))return{node:e,messageId:fL}})(r,e)??((e,t)=>{let r=fG(e,f$,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tk(r.value))return{node:e,messageId:fN}})(r,t)),e.on("Identifier",t=>f_(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[fB]:"Prefer `.querySelector()` when only the first match is used.",[fR]:"Prefer `.querySelector()` for a simple ID selector.",[fP]:"Check `.length` instead of the `NodeList` object itself.",[fL]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[fN]:"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"!==f2(t.name))return;let r=((e,t)=>{if(t?.value){if(e6(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return f8(e,t.value.expression)}})(e,f3(t,"type"));if(r?.toLowerCase()!=="file")return;let n=f3(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(e6(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=f8(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return gt({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=ge(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=ge(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}:fZ.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 gt({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:{[fJ]:"Invalid file input `accept` value: {{reason}}",[fX]:"The file input `accept` value must be static.",[fY]:"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=ga(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tb(e,{property:"currentTarget"})||!gr.test(e.object.name))return;let n=ep(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=gn(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?gs:gi,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[gi]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[gs]:"`{{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&&gu(o.alternate,a,t)?gd(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&gu(o,a.consequent,t)?gd(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:{[gl]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{let r="MemberExpression"===t.callee.type?eR(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!gf.has(r)||!(e=>{for(;;){if(of(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)||((e,t,r)=>{let n,o=function e(t,r,n=new Set){if(!t||t===gy||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=ep(t.sourceCode.getScope(e),e);if(!r||0===r.defs.length)return;if(1!==r.defs.length||function(e,t,r){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 gy;let[n]=r.defs;if("Parameter"===n.type&&n.node.params?.includes(n.name))return n.name.typeAnnotation&&!nf(n.name.typeAnnotation,t)?gy:void 0;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&"VariableDeclaration"===n.parent.type){let{typeAnnotation:e}=n.node.id;return e?nf(e,t)?void 0:gy:n.node.init??gy}return gy}(t,r);return o===gy?o:void 0===o?t:e(o,r,n)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n):"MemberExpression"===t.type?gy:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?nf(t,r)?t:gy:t}(e,r);return!!(ts(n=o,"expect",to)||tS(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?o===gy||!nf(o,r):o===gy||((e,t)=>{let r,n;return gx(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"BinaryExpression"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&!gx(e.callee,"Array",t)||(r=e,n=t,ts(r,gh,to)&&n.sourceCode.isGlobalReference(r.callee))})(o,r)||"Identifier"===o.type&&gg.test(o.name)&&!nf(o,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:gm,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[gm]:"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(!tS(r,{methods:gS.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tS(n,{methods:gv,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=gS.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:gb,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:gE,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield aB(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:{[gb]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[gE]:"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||!gD.has(e.operator)||gj(e.left,t)||gj(e.right,t))){if(e8(e.right,0))return{value:e.left,operator:e.operator};if(e8(e.left,0))return{value:e.right,operator:gT[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&gF(a,n)&&ry(i,n)||(">"===o||">="===o)&&ry(a,n)&&gF(i,n))return n}(t,e);if(!r)return;let n=gN(r)?function*(n){yield ak(n,t,e),yield n.replaceText(t,`Math.abs(${gP(r,e)})`)}:void 0;return gL(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=gB(e.left,t),n=gR(e.right,t);if(r&&n&&ry(r.value,n.value)&&gA[r.operator]===n.operator&&gF(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=gB(e.right,t),a=gR(e.left,t);if(o&&a&&ry(o.value,a.value)&&gA[o.operator]===a.operator&&gF(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=gN(n)&&gN(o)?function*(r){yield ak(r,t,e),yield r.replaceText(t,`Math.abs(${gP(n,e)}) ${a} ${e2(o,e)}`)}:void 0;return gL(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:{[gC]:"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||nI(r))return;let n=gO(r.object);if(!n)return;let o=gM(r.property,t);if(void 0!==o)return gU(r,n,o+1,e)}),e.on("CallExpression",r=>{if(!tS(r,{method:"at",argumentsLength:1}))return;let n=gO(r.callee.object);if(!n)return;let o=gM(r.arguments[0],t);if(void 0!==o)return gU(r,n,o+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return gq(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&of(t))return gq(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[g$]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":gV,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=gQ(e.left,t);if(r&&ry(e.right,r.targetNode)&&!gG(e.right,t)){let n=gY({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return g0({node:e,method:"padStart",replacement:n&&gZ({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=gQ(e.right,t);if(n&&ry(e.left,n.targetNode)&&!gG(e.left,t)){let r=gY({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return g0({node:e,method:"padEnd",replacement:r&&gZ({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tS(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=gH(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&e4(a.widthNode)&&ry(a.widthNode,i)&&"Identifier"===r.right.type&&!gG(r.right,t)){let n=gX(a.paddingNode);return g1({node:e,method:"padStart",replacement:gZ({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=gH(r.right,t);if(2===e.arguments.length&&s&&e4(n)&&0===n.value&&e4(s.widthNode)&&ry(s.widthNode,o)&&"Identifier"===r.left.type&&!gG(r.left,t)){let n=gX(s.paddingNode);return g1({node:e,method:"padEnd",replacement:gZ({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:{[g_]:"Prefer `String#{{method}}()` over manual string padding.",[gz]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":g4,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tS(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!e6(r)||!ye.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&ro(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(yr(e)||!yn(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(e1(r,e),", {passive: true}"))}}if(e9(r,!0)||e9(r,!1))return{fix:e=>e.replaceText(r,e9(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(e6(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=rS(o,e);return","===a.value?t.insertTextAfter(a,`
49
+ ${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:dM,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:{[d$]:"Prefer class field declaration over `this` assignment in constructor for static values.",[dM]:"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(!tm(t,{name:"BigInt",argumentsLength:1,optional:!1},tp))return;let[r]=t.arguments,n=function(e){let t,r;if(tt(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:dO},{shouldUseSuggestion:a,text:i,bigint:s}=n,l=r=>{let n=i;return!e7(t,e)&&s<0n&&(n=`(${n})`,oD(e.sourceCode.getTokenBefore(t),e,n)&&(n=`;${n}`)),r.replaceText(t,n)};return a||e.sourceCode.getCommentsInside(t).length>0?o.suggest=[{messageId:dU,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:{[dO]:"Prefer using bigint literal over `BigInt(…)`.",[dU]:"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=>!dK(e,["add","remove"])))return;let[o,a]=n;if(o.callee.property.name!==a.callee.property.name&&dG(o,a))return d_(r,function*(n){let i=e4(o.callee.object.object,e),s=e4(o.arguments[0],e),l="ConditionalExpression"===r.type,u="remove"===o.callee.property.name,p=r.test,c=dJ(p,u,o),d=c?"":dz(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+=";"),oD(t.getTokenBefore(r),e,f)&&(f=`;${f}`),yield n.replaceText(r,f),l&&(yield aP(n,r,e))})}),e.on("ConditionalExpression",t=>{let r=[t.consequent,t.alternate];if(!(r.every(e=>tt(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&&dW(t.parent.object)&&tm(t.parent.parent,{optional:!1,argumentsLength:1},tp)&&t.parent.parent.callee===t.parent))return;let n=t.parent,o=n.parent;return d_(o,function*(r){let a="remove"===t.consequent.value,i=t.test,s=dJ(i,a,o)?"":dz(i,e,a);s&&(yield r.insertTextAfter(o.arguments[0],`, ${s}`)),yield aN(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:{[dq]:"Prefer using `Element#classList.toggle()` to toggle class names.",[dV]:"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:dX,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)&&tx(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:dX,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(eb(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,eb),...t.getTokens(a),...e9(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:{[dX]:"{{type}} with empty attribute list is not allowed."},languages:["js/js"]}},"unicorn/no-immediate-mutation":{create:e=>{for(let t of d5)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=ar(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):ey(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:{[dY]:"Immediate mutation on {{objectType}} is not allowed.",[dH]:"{{operation}} the elements to the {{assignType}}.",[dQ]:"Move this property to the {{assignType}}.",[dZ]:"{{description}} the {{assignType}}.",[d0]:"Move the element to the {{assignType}}.",[d1]:"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(!tf(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=th(r=i)?"empty array":te(r,"")?"empty string":ti(r)?"`null`":tP(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=e7(o,e),[,s]=a?e5(o,e):r.getRange(o),[,l]=r.getRange(n);yield t.removeRange([s,l]),(a||"SequenceExpression"!==o.type)&&(yield aT(n,t,e))};else e.sourceCode.getCommentsInside(i).length>0&&(l=!0),n=t=>aw(t,i,e);let u={node:i,messageId:d4,data:{description:s}};return l?u.suggest=[{messageId:d7,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:{[d4]:"The {{description}} is useless.",[d7]:"Remove the {{description}}"},languages:["js/js"]}},"unicorn/prefer-response-static-json":{create:e=>{e.on("NewExpression",t=>{if(!tf(t,{name:"Response",minimumArguments:1}))return;let[r]=t.arguments;if(tw(r,{object:"JSON",method:"stringify",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return{node:r.callee,messageId:me,*fix(n){yield n.insertTextAfter(t.callee,".json"),yield aB(t,e,n);let[o]=r.arguments,a=e5(r,e),i=e5(o,e);yield n.removeRange([a[0],i[0]]),yield n.removeRange([i[1],a[1]]),!e7(t,e)&&e7(t.callee,e)&&oD(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:{[me]:"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=>E.isRegExp(e)?e:RegExp(e,"u")),a=!1!==r.multipleFileExtensions,i=!1!==r.checkDirectories,s=n.map(e=>mA[e].fn);e.on(rK,r=>{if("Document"!==r.type||r.parent?.type!=="Program")return(()=>{var r;let l,u,p=(r=e.cwd,""===(l=v.relative(r,v.resolve(r,t)))||".."===l||l.startsWith(`..${v.sep}`)||v.isAbsolute(l)?[v.basename(t)]:l.split(v.sep).filter(e=>"."!==e)),{basename:c,filename:d,middle:m,extension:f}=function(e,{multipleFileExtensions:t}){let r=v.extname(e),n=v.basename(e,r),o={basename:n+r,filename:n,middle:"",extension:r};if(t){let[e]=n.split(".",1);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}=mj(e);if(e.startsWith("$")||mw(a,r))return;let i=mk(a,r,{leading:o,trailing:""});return{loc:{column:0,line:1},messageId:my,data:{directory:e,chosenCases:mF(t),renamedDirectories:(n=i.map(e=>`\`${e}\``),mE.format(n))}}}(e,n,s);if(t)return t}if(mb.has(c))return;let{leading:g,words:y}=mj(d);if(d.startsWith("$")||mw(y,s))return f!==f.toLowerCase()?{loc:{column:0,line:1},messageId:mh,data:{filename:d+m+f.toLowerCase(),extension:f}}:void 0;let h=mk(y,s,{leading:g,trailing:m+f.toLowerCase()});return{loc:{column:0,line:1},messageId:mg,data:{chosenCases:mF(n),renamedFilenames:(u=h.map(e=>`\`${e}\``),mE.format(u))}}})()})},meta:{type:"suggestion",docs:{description:"Enforce a case style for filenames and directory names.",recommended:!0},schema:mB,defaultOptions:[],messages:{[mg]:"Filename is not in {{chosenCases}}. Rename it to {{renamedFilenames}}.",[my]:"Directory name `{{directory}}` is not in {{chosenCases}}. Rename it to {{renamedDirectories}}.",[mh]:"File extension `{{extension}}` is not in lowercase. Rename it to `{{filename}}`."},languages:["*"]}},"unicorn/consistent-template-literal-escape":{create:e=>{e.on("TemplateElement",t=>{if(tR(t.parent))return;let{raw:r}=t.value,n=r.replaceAll(/(?<=(?:^|[^\\])(?:\\\\)*)\\?\$\\{/g,"\\${");if(r!==n)return{node:t,messageId:mR,fix:r=>aV(t,n,e,r)}})},meta:{type:"suggestion",docs:{description:"Enforce consistent style for escaping `${` in template literals.",recommended:!0},fixable:"code",messages:{[mR]:"Use `\\${` instead of `$\\{` to escape in template literals."},languages:["js/js"]}},"unicorn/no-useless-iterator-to-array":{create:e=>{e.on("NewExpression",t=>{if(!(tf(t,{names:["Map","WeakMap","Set","WeakSet"],argumentsLength:1})||tf(t,{names:rZ,minimumArguments:1}))||!mX(t.arguments[0]))return;let r=t.arguments[0],n=1===t.arguments.length?mY(r,e):void 0,o=t.arguments.length>1?mH(r,e,mz):void 0;return{node:r.callee.property,messageId:mU,data:{description:`new ${t.callee.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}}),e.on("CallExpression",t=>((e,t)=>{if(!tw(e,{objects:["Array",...rZ],method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mX(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?mY(r,t):void 0,o=e.arguments.length>1?mH(r,t,mz):void 0;return{node:r.callee.property,messageId:mU,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tw(e,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!mX(e.arguments[0]))return;let r=e.arguments[0],n=1===e.arguments.length?mY(r,t):void 0,o=e.arguments.length>1?mH(r,t,mz):void 0;return{node:r.callee.property,messageId:mU,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{fix:n},...o&&{suggest:[o]}}})(t,e)??((e,t)=>{if(!tw(e,{object:"Promise",methods:["all","allSettled","any","race"],argumentsLength:1,optionalCall:!1,optionalMember:!1})||!mX(e.arguments[0]))return;let r=e.arguments[0],n=mH(r,t,mz);return{node:r.callee.property,messageId:mU,data:{description:`${e.callee.object.name}.${e.callee.property.name}(…)`},...n&&{suggest:[n]}}})(t,e)??((e,t)=>{var r,n;if(!(tw(e,{methods:mG,maximumArguments:1,optionalCall:!1,optionalMember:!1})||tw(e,{method:mJ,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))||!mX(e.callee.object))return;let o=e.arguments[0],a=e.callee.property.name,i=a===mJ;if(r=o,n=i?3:2,r&&("ArrowFunctionExpression"===(r=mO(r)).type||"FunctionExpression"===r.type)&&(r.params.length>n||r.params.at(-1)?.type==="RestElement"||"FunctionExpression"===r.type&&t.sourceCode.getTokens(r).some(e=>"Identifier"===e.type&&"arguments"===e.value)))return;let s=e.callee.object,l=mH(s,t,mK,{method:a});return{node:s.callee.property,messageId:m_,data:{method:a},...l&&{suggest:[l]}}})(t,e)),e.on("ForOfStatement",t=>{if(!mX(t.right))return;let r=mY(t.right,e);return{node:t.right.callee.property,messageId:mq,...r&&{fix:r}}}),e.on("YieldExpression",t=>{if(!t.delegate||!mX(t.argument))return;let r=mY(t.argument,e);return{node:t.argument.callee.property,messageId:mV,...r&&{fix:r}}}),e.on("SpreadElement",t=>{if(!mX(t.argument))return;let{parent:r}=t;if("ArrayExpression"!==r.type&&"CallExpression"!==r.type&&"NewExpression"!==r.type)return;let n=mY(t.argument,e);return{node:t.argument.callee.property,messageId:mW,...n&&{fix:n}}})},meta:{type:"suggestion",docs:{description:"Disallow unnecessary `.toArray()` on iterators.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[mU]:"`{{description}}` accepts an iterable, `.toArray()` is unnecessary.",[mq]:"`for…of`/`for await…of` can iterate over an iterable, `.toArray()` is unnecessary.",[mV]:"`yield*` can delegate to an iterable, `.toArray()` is unnecessary.",[mW]:"Spread works on iterables, `.toArray()` is unnecessary.",[m_]:"`Iterator` has a `.{{method}}()` method, `.toArray()` is unnecessary.",[mz]:"Remove `.toArray()`.",[mK]:"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||function(e){let{operator:t}=e,{parent:r}=e;for(;rI(r)&&r.expression===e;)r=(e=r).parent;return r?.type==="LogicalExpression"&&r.operator===t}(r)||!function e(t,r){if(tq(t,r)||tV(t))return!0;let{parent:n}=t;return rI(n)&&n.expression===t&&e(n,r)}(r,e))return;let n=function e(t,r,n=[]){let o=rj(t);return"LogicalExpression"!==o.type||o.operator!==r?n.push(t):(e(o.left,r,n),e(o.right,r,n)),n}(r,r.operator),o=n.map(e=>({operand:e,isSimple:m2(e)})),a=o.findIndex(({isSimple:e})=>!e),i=o.findIndex(({isSimple:e},t)=>e&&t>a);if(-1===a||-1===i)return;let s=[...o.filter(({isSimple:e})=>e),...o.filter(({isSimple:e})=>!e)].map(({operand:e})=>e),l=o.findLastIndex(({isSimple:e})=>e),u=o.every(({operand:e,isSimple:t},r)=>{var n;return t||r>l||m2(n=e)||function e(t){let r=rj(t);return"ConditionalExpression"===r.type&&[r.test,r.consequent,r.alternate].every(t=>m2(t)||m1(t)||e(t))}(n)}),p=u&&!function e(t,r){if(rI(t)){let e=rj(t);return"LogicalExpression"===e.type&&e.operator===r}return"LogicalExpression"===t.type&&t.operator===r&&(e(t.left,r)||e(t.right,r))}(r,r.operator)&&!function(e,t,r){let{sourceCode:n}=r;if(n.getCommentsInside(e).length>0)return!0;let[o]=t,a=t.at(-1),[i]=e5(o,r),[,s]=e5(a,r),l={range:[i,s]};return eT(n.getTokenBefore(l,{includeComments:!0}))||eT(n.getTokenAfter(l,{includeComments:!0}))}(r,n,e)?n=>n.replaceTextRange(t.getRange(r),s.map((t,n)=>(function(e,t,{operator:r,property:n}){let o=e7(e,t),a=o?e4(e,t):t.sourceCode.getText(e);return!o&&o3(e,{operator:r,property:n})&&(a=`(${a})`),a})(t,e,{operator:r.operator,property:0===n?"left":"right"})).join(` ${r.operator} `)):void 0;return{node:r,loc:t.getLoc(n[i]),messageId:u?mQ:mZ,data:{operator:r.operator},...p&&{fix:p}}})},meta:{type:"suggestion",docs:{description:"Prefer simple conditions first in logical expressions.",recommended:!0},fixable:"code",messages:{[mQ]:"Prefer this simple condition first in the `{{operator}}` expression.",[mZ]:"Consider moving this simple condition first after verifying short-circuit behavior."},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(!m8.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:m3,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=>eT(e)))return;let a=t.getLoc(i);if(a.start.line===a.end.line||rN(e,o))return;let s=i.body.at(-1),l=t.getText(o),u=rw(s,e),p=t.getTokenBefore(n,{includeComments:!0});yield r.insertTextAfter(p,`
50
+ ${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:{[m3]:"Move `{{keyword}}` inside the block statement."},languages:["js/js"]}},"unicorn/better-dom-traversing":{create:e=>{e.on("MemberExpression",t=>{let r,n=(e=>{if(fa(e)){if(fo(e.object,"childNodes"))return"childNodes";if(fo(e.object,"children"))return"children"}})(t);if(!n||oa(t.object.object)||"children"===n&&fo(r=t.object,"children")&&("Identifier"===r.object.type&&"props"===r.object.name||tT(r.object,{property:"props",optional:!1,computed:!1}))||t.parent?.type==="MemberExpression"&&t.parent.object===t&&fo(t.parent,"children")&&fa(t.parent.parent))return;let o=t.property.value;return"childNodes"===n&&0===o?{node:t,messageId:m6,suggest:fs(t,"firstChild",fe,e)}:"children"===n&&0===o?{node:t,messageId:m9,suggest:fs(t,"firstElementChild",ft,e)}:"children"===n?{node:t,messageId:m5}:void 0}),e.on("MemberExpression",e=>{if(!(!fl(e)||!fl(e.object)||!(!fl(e.parent)||e.parent.object!==e)||oa((e=>{for(;fl(e);)e=e.object;return e})(e))))return{node:e,messageId:m4}}),e.on("CallExpression",t=>{if(!fp(t)||t.parent?.type==="MemberExpression"&&t.parent.object===t&&t.parent.parent?.callee===t.parent&&fp(t.parent.parent)&&fu(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(;fp(e);){let[r]=e.arguments;if(!fu(r))break;t.push(e),e=e.callee.object}if(t.length<2||"ChainExpression"===e.type||oa(e))return;let r=[];for(let e of t)r.unshift(tn(e.arguments[0]));return{root:e,selectors:r,quoteNode:t.at(-1).arguments[0]}})(t);if(r)return{node:t,messageId:m7,suggest:((e,t,r)=>{let n,o,{sourceCode:a}=r;if(fi(e,a)||!t.selectors.every(e=>!e.includes(",")&&!e.includes(":scope")))return;let i=e4(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(${tK(s,"Literal"===(o=t.quoteNode).type&&o.raw.startsWith('"')?'"':"'")})`;return[{messageId:fr,fix:t=>t.replaceText(e,l)}]})(t,r,e)}})},meta:{type:"suggestion",docs:{description:"Prefer better DOM traversal APIs.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[m6]:"Prefer `.firstChild` over `.childNodes[0]`.",[m9]:"Prefer `.firstElementChild` over `.children[0]`.",[m5]:"Consider `.querySelector()` over positional child traversal.",[m4]:"Consider `.closest()` over chaining `.parentElement`.",[m7]:"Consider merging chained `.querySelector()` calls.",[fe]:"Switch to `.firstChild`.",[ft]:"Switch to `.firstElementChild`.",[fr]:"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:a=!1,extendDefaultReplacements:s=!0,replacements:l={},allowList:u={}}={})=>{let p=new o(Object.entries(s?{...fy,...l}:l).filter(([,e])=>!1!==e));return{checkProperties:e,checkVariables:t,checkDefaultAndNamespaceImports:r,checkShorthandImports:n,checkShorthandProperties:a,replacements:p,replacementRegExp:p.size>0?(e=>{let t=[],r=[];for(let n of e.keys())t.push(fx(n)),r.push(fx(an(n)));return RegExp(`(?:^(?:${t.join("|")})|(?:${r.join("|")}))${fb}`,"gv")})(p):void 0,allowList:new i(Object.keys(u))}})(e.options[0]),r=new s,n=new s,a=(e,t)=>t.every(t=>{let r=n.get(t);return!r||!r.has(e)}),l=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?u({name:e.name,scope:e.scope,defs:e.defs,identifiers:e.identifiers,references:[...e.references,...n.references]}):u(e)}let[t]=e.defs;return void r.set(t.name,e)}return u(e)},u=r=>{var o;if(0===r.defs.length)return;let s=fE(r.name,t);if(!s)return;let[l]=r.defs;if(!(!("ImportDefaultSpecifier"===(o=l.name).parent.type&&o.parent.local===o||"ImportNamespaceSpecifier"===o.parent.type&&o.parent.local===o||"ImportSpecifier"===o.parent.type&&o.parent.local===o&&"Identifier"===o.parent.imported.type&&"default"===o.parent.imported.name||"VariableDeclarator"===o.parent.type&&o.parent.id===o&&tj(o.parent.init))||t.checkDefaultAndNamespaceImports&&("internal"!==t.checkDefaultAndNamespaceImports||fm(l)))||!(!oy(l.name,e)||t.checkShorthandImports&&("internal"!==t.checkShorthandImports||fm(l)))||!t.checkShorthandProperties&&ob(l.name))return;let u=[...r.references.map(e=>e.from),r.scope],p=rF(s)?ry(s,u,a):void 0,c=fv(l.name,p??s);if(p&&rJ(r).every(e=>!("VariableDeclarator"===e.parent.type&&e.parent.id===e?"VariableDeclaration"===e.parent.parent.type&&"ExportNamedDeclaration"===e.parent.parent.parent.type:!!fc.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 u)n.has(e)||n.set(e,new i),n.get(e).add(p);c.suggest=[{messageId:fg,data:{replacement:p},fix:t=>aq(r,p,e,t)}]}e.report(c)},p=e=>{for(let t of e.variables)l(t)},c=r=>{if(!t.checkProperties||"__proto__"===r.name)return;let n=fE(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||fd.has(r.parent.type)&&r.parent.key===r&&!r.parent.computed))return;let o=fv(r,n);e.report(o)};e.on("Identifier",c),e.on("PrivateIdentifier",c),e.on("Program:exit",r=>{if(t.checkVariables)for(let t of rp(e.sourceCode.getScope(r)))p(t)})},meta:{type:"suggestion",docs:{description:"Enforce consistent spelling of compound words in identifiers.",recommended:"unopinionated"},hasSuggestions:!0,schema:fC,defaultOptions:[{}],messages:{[ff]:"Prefer `{{replacement}}` over `{{name}}`.",[fg]:"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(!tf(e,{name:"File",minimumArguments:2,maximumArguments:2})||!fT(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===tn(n))return;let[o]=r.elements;if(function(e,t,r){let n=fA(e,r);if(!n||r.sourceCode.getRange(n)[0]>r.sourceCode.getRange(t)[0])return!1;let o=n.init;return(tf(o,{name:"Blob",maximumArguments:1})||tf(o,{name:"File",minimumArguments:2,maximumArguments:2}))&&fT(o.callee,r)}(o,e,t))return o}(o,t);if(!a)return;let i=ey(r.getScope(n),n);if(!i)return;let s=rJ(i).filter(e=>e!==n);if(1!==s.length)return;let[l]=s,u=function(e,t){let r,{parent:n}=e;return tw(n,{object:"URL",method:"createObjectURL",argumentsLength:1,optionalCall:!1,optionalMember:!1})&&n.arguments[0]===e&&fT(n.callee.object,t)?{call:n,kind:"blobArgument"}:tw(n,{methods:["append","set"],minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})&&n.arguments[1]===e&&(r=fA(n.callee.object,t)?.init,tf(r,{name:"FormData",argumentsLength:0})&&fT(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 ey(n.getScope(e),e)===ey(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)||rN(t,e)}(e.parent,t))&&("formData"!==u.kind||2!==u.call.arguments.length||p))return{node:o,messageId:fD,suggest:[{messageId:fS,*fix(n){yield aO(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:{[fD]:"Use the original `Blob` instead of converting it to a `File`.",[fS]:"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(!tw(e,{method:"drawImage",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[a]=e.arguments;if("SpreadElement"!==a.type&&(r=fI(a,t),r?.type==="CallExpression"&&!r.optional&&"Identifier"===r.callee.type&&"loadImage"===r.callee.name&&r.arguments.length>0&&"SpreadElement"!==r.arguments[0].type&&tw(n=r.arguments[0],{method:"toDataURL",optionalCall:!1,optionalMember:!1})&&("Identifier"===(o=n.callee.object).type?fj(o.name):"MemberExpression"===o.type&&!o.computed&&"Identifier"===o.property.type&&fj(o.property.name))))return{node:a,messageId:fw}}),e.on("CallExpression",e=>{if(!tw(e,{method:"putImageData",minimumArguments:1,optionalCall:!1,optionalMember:!1}))return;let[r]=e.arguments;if("SpreadElement"!==r.type&&tw(fI(r,t),{method:"getImageData",optionalCall:!1,optionalMember:!1}))return{node:r,messageId:fw}})},meta:{type:"suggestion",docs:{description:"Prefer drawing canvases directly instead of converting them to images.",recommended:"unopinionated"},messages:{[fw]:"Prefer drawing the canvas directly with `drawImage()`."},languages:["js/js"]}},"unicorn/no-confusing-array-splice":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:["splice","toSpliced"],argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let r=function([e,t]){let r=function(e){let t=oQ(e);if("number"==typeof t)return Math.max(Math.trunc(t),0)}(t);return 1===r?fF:-1===Math.trunc(oQ(e))&&0===r?fB: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=e4(o,r),p=n.getText(i),c=n.getText(s);if(t===fF){if(fN(e,n))return;if("toSpliced"===l){var d,m;if(0>Math.trunc(oQ(i))||(d=i,m=o,d=rj(d),m=rj(m),"MemberExpression"===d.type&&!d.optional&&!d.computed&&"Identifier"===d.property.type&&"length"===d.property.name&&ux(d.object,m)))return;return{messageId:fR,fix:t=>t.replaceText(e,`${u}.with(${p}, ${c})`)}}return"ExpressionStatement"===e.parent.type&&fL(o)&&(oQ(i)??0)>=0?{messageId:fR,fix:t=>t.replaceText(e,`${u}[${p}] = ${c}`)}:void 0}if(t===fB&&fL(o)&&!fN(i,n))return{messageId:fP,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:{[fF]:"Prefer a direct element replacement instead of `{{method}}()`.",[fB]:"Avoid using `{{method}}()` to insert at `-1`.",[fR]:"Use direct element replacement.",[fP]:"Resolve the insertion index explicitly."},languages:["js/js"]}},"unicorn/no-duplicate-set-values":{create:e=>{let{sourceCode:t}=e;e.on("NewExpression",r=>{if(!tf(r,{name:"Set",argumentsLength:1}))return;let[n]=r.arguments;if("ArrayExpression"===n.type)return rA(n.elements,e).map(e=>({node:e??n,messageId:f$,data:{value:e?t.getText(e):"undefined"}}))})},meta:{type:"suggestion",docs:{description:"Disallow duplicate values in `Set` constructor array literals.",recommended:!0},messages:{[f$]:"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(!fz(r)||fG(r))return;let n=r.object;if(!fJ(r,n,t,e))return fH(r,n,e)}),e.on("CallExpression",r=>{let n;if(fK(r)){if(fG(r))return;let n=r.callee.object;if(fJ(r,n,t,e))return;return fH(r,n,e)}let o=fY(r,e);if(o)return o;if(f_(r)&&!(fz(n=r.parent)||fK(n)||"MemberExpression"===r.parent.type&&r.parent.object===r&&fK(r.parent.parent))){let e;if(e=tn(r.arguments[0]),/^#[\-A-Z_a-z][\w\-]*$/v.test(e))return{node:r.callee.property,messageId:fO}}}),e.on("BinaryExpression",r=>((e,t)=>{let{sourceCode:r}=t;if(fZ(e,f_,r))return{node:e,messageId:fq}})(r,e)??((e,t)=>{let r=fZ(e,fW,t);if(r&&("==="===e.operator||"!=="===e.operator)&&tP(r.value))return{node:e,messageId:fV}})(r,t)),e.on("Identifier",t=>fY(t,e))},meta:{type:"suggestion",docs:{description:"Disallow incorrect `querySelector()` and `querySelectorAll()` usage.",recommended:!0},fixable:"code",schema:[],messages:{[fM]:"Prefer `.querySelector()` when only the first match is used.",[fO]:"Prefer `.querySelector()` for a simple ID selector.",[fU]:"Check `.length` instead of the `NodeList` object itself.",[fq]:"Check `.length` instead of comparing the `NodeList` object with `null` or `undefined`.",[fV]:"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"!==f4(t.name))return;let r=((e,t)=>{if(t?.value){if(tt(t.value))return t.value.value;if("JSXExpressionContainer"===t.value.type)return ge(e,t.value.expression)}})(e,f7(t,"type"));if(r?.toLowerCase()!=="file")return;let n=f7(t,"accept");if(!n)return;let o=((e,t)=>{if(!t.value)return{node:t,missing:!0};if(tt(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=ge(e,t.value.expression);return void 0===r?{node:t.value,dynamic:!0}:{node:t.value,value:r,fixable:!1}})(e,n);return gs({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=gi(e,t,"type")?.value;if(r?.toLowerCase()!=="file")return;let n=((e,t,r)=>{let n=gi(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}:f6.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 gs({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:{[f0]:"Invalid file input `accept` value: {{reason}}",[f1]:"The file input `accept` value must be static.",[f2]:"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=gc(e);e.on("MemberExpression",e=>{if("Identifier"!==e.object.type||!tT(e,{property:"currentTarget"})||!gl.test(e.object.name))return;let n=ey(t.getScope(e.object),e.object),o=n?.defs.find(({type:e})=>"Parameter"===e);if(!o)return;let a=o.node,i=gu(e)!==a;if(i||r.isFunctionSuspended(a)||r.isInsideSuspendingLoop(e,a))return{node:e,messageId:i?gm:gd,data:{name:e.object.name}}})},meta:{type:"problem",docs:{description:"Disallow accessing `event.currentTarget` after the synchronous event dispatch has finished.",recommended:!0},messages:{[gd]:"`{{name}}.currentTarget` is `null` after the handler suspends. It is only set during synchronous event dispatch; save it to a variable beforehand.",[gm]:"`{{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&&gg(o.alternate,a,t)?gx(e,r,{left:n,operator:"&&",right:o.test,consequent:o.consequent,alternate:o.alternate}):"ConditionalExpression"===a.type&&gg(o,a.consequent,t)?gx(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:{[gf]:"Do not use unnecessary nested ternary expressions."},languages:["js/js"]}},"unicorn/no-unused-array-method-return":{create:e=>{e.on("CallExpression",t=>{let r="MemberExpression"===t.callee.type?eO(t.callee,e.sourceCode.getScope(t.callee)):void 0;if(!(!gE.has(r)||!(e=>{for(;;){if(oE(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)||((e,t,r)=>{let n,o=function e(t,r,n=new i){if(!t||t===gC||n.has(t))return t;if(n.add(t),"Identifier"===t.type){let o=function(e,t){let r=ey(t.sourceCode.getScope(e),e);if(!r||0===r.defs.length)return;if(1!==r.defs.length||function(e,t,r){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 gC;let[n]=r.defs;if("Parameter"===n.type&&n.node.params?.includes(n.name))return n.name.typeAnnotation&&!nE(n.name.typeAnnotation,t)?gC:void 0;if("Variable"===n.type&&"VariableDeclarator"===n.node.type&&"Identifier"===n.node.id.type&&n.node.id.name===e.name&&"VariableDeclaration"===n.parent.type){let{typeAnnotation:e}=n.node.id;return e?nE(e,t)?void 0:gC:n.node.init??gC}return gC}(t,r);return o===gC?o:void 0===o?t:e(o,r,n)}return["ChainExpression","TSNonNullExpression","TSSatisfiesExpression"].includes(t.type)?e(t.expression,r,n):"MemberExpression"===t.type?gC:"TSAsExpression"===t.type||"TSTypeAssertion"===t.type?nE(t,r)?t:gC:t}(e,r);return!!(tm(n=o,"expect",tp)||tw(n,{object:"expect",methods:["element","poll","soft"]}))||("values"===t?o===gC||!nE(o,r):o===gC||((e,t)=>{let r,n;return gS(e,"undefined",t)||"ObjectExpression"===e.type||"Literal"===e.type||"BinaryExpression"===e.type||"TemplateLiteral"===e.type||"ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type||"ClassExpression"===e.type||"NewExpression"===e.type&&!gS(e.callee,"Array",t)||(r=e,n=t,tm(r,gD,tp)&&n.sourceCode.isGlobalReference(r.callee))})(o,r)||"Identifier"===o.type&&gv.test(o.name)&&!nE(o,r))})(t.callee.object,r,e)))return{node:t.callee.property,messageId:gb,data:{method:r}}})},meta:{type:"suggestion",docs:{description:"Disallow ignoring the return value of selected array methods.",recommended:"unopinionated"},messages:{[gb]:"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(!tw(r,{methods:gw.keys().toArray(),optionalCall:!1,optionalMember:!1}))return;let n=r.callee.object;if(!tw(n,{methods:gk,argumentsLength:0,optionalCall:!1,optionalMember:!1}))return;let o=r.callee.property.name,a=gw.get(o),i={method:o,replacement:a,reversingMethod:n.callee.property.name},s={node:r.callee.property,messageId:gT,data:i};return 0===t.getCommentsInside(r).length&&(s.suggest=[{messageId:gA,data:i,*fix(t){yield t.replaceText(r.callee.property,a),yield aM(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:{[gT]:"Prefer `Array#{{replacement}}()` over `Array#{{reversingMethod}}().{{method}}()`.",[gA]:"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||!gj.has(e.operator)||gN(e.left,t)||gN(e.right,t))){if(te(e.right,0))return{value:e.left,operator:e.operator};if(te(e.left,0))return{value:e.right,operator:gF[e.operator]}}}(e.test,t);if(!r)return;let{value:n,operator:o}=r,{consequent:a,alternate:i}=e;if(("<"===o||"<="===o)&&g$(a,n)&&rC(i,n)||(">"===o||">="===o)&&rC(a,n)&&g$(i,n))return n}(t,e);if(!r)return;let n=gV(r)?function*(n){yield aP(n,t,e),yield n.replaceText(t,`Math.abs(${gU(r,e)})`)}:void 0;return gq(t,e,n)}),e.on("LogicalExpression",t=>{let r=function(e,t){if("||"!==e.operator)return;let r=gM(e.left,t),n=gO(e.right,t);if(r&&n&&rC(r.value,n.value)&&gB[r.operator]===n.operator&&g$(n.negativeThreshold,r.threshold))return{value:r.value,threshold:r.threshold,operator:r.operator};let o=gM(e.right,t),a=gO(e.left,t);if(o&&a&&rC(o.value,a.value)&&gB[o.operator]===a.operator&&g$(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=gV(n)&&gV(o)?function*(r){yield aP(r,t,e),yield r.replaceText(t,`Math.abs(${gU(n,e)}) ${a} ${e4(o,e)}`)}:void 0;return gq(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:{[gI]:"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||nL(r))return;let n=gz(r.object);if(!n)return;let o=g_(r.property,t);if(void 0!==o)return gK(r,n,o+1,e)}),e.on("CallExpression",r=>{if(!tw(r,{method:"at",argumentsLength:1}))return;let n=gz(r.callee.object);if(!n)return;let o=g_(r.arguments[0],t);if(void 0!==o)return gK(r,n,o+1,e)}),e.on("VariableDeclarator",t=>{if("ArrayPattern"===t.id.type)return gG(t.id,t.init,e)}),e.on("AssignmentExpression",t=>{if("ArrayPattern"===t.left.type&&oE(t))return gG(t.left,t.right,e)})},meta:{type:"suggestion",docs:{description:"Prefer `String#split()` with a limit.",recommended:"unopinionated"},fixable:"code",messages:{[gW]:"Prefer `String#split()` with a limit."},languages:["js/js"]}},"unicorn/prefer-queue-microtask":gX,"unicorn/prefer-string-pad-start-end":{create:e=>{e.on("BinaryExpression",t=>((e,t)=>{if("+"!==e.operator)return;let r=g8(e.left,t);if(r&&rC(e.right,r.targetNode)&&!gZ(e.right,t)){let n=g2({targetNode:e.right,targetLengthNode:r.targetLengthNode,paddingNode:r.paddingNode});return g9({node:e,method:"padStart",replacement:n&&g6({method:"padStart",targetNode:e.right,...r},t),context:t,canFix:n})}let n=g8(e.right,t);if(n&&rC(e.left,n.targetNode)&&!gZ(e.left,t)){let r=g2({targetNode:e.left,targetLengthNode:n.targetLengthNode,paddingNode:n.paddingNode});return g9({node:e,method:"padEnd",replacement:r&&g6({method:"padEnd",targetNode:e.left,...n},t),context:t,canFix:r})}})(t,e)),e.on("CallExpression",t=>((e,t)=>{if(!tw(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=g3(r.left,t),i=(e=>{if(e?.type==="UnaryExpression"&&"-"===e.operator)return e.argument})(n);if(1===e.arguments.length&&a&&i&&to(a.widthNode)&&rC(a.widthNode,i)&&"Identifier"===r.right.type&&!gZ(r.right,t)){let n=g1(a.paddingNode);return g5({node:e,method:"padStart",replacement:g6({method:"padStart",targetNode:r.right,targetLengthNode:a.widthNode,...a},t),context:t,canSuggest:n})}let s=g3(r.right,t);if(2===e.arguments.length&&s&&to(n)&&0===n.value&&to(s.widthNode)&&rC(s.widthNode,o)&&"Identifier"===r.left.type&&!gZ(r.left,t)){let n=g1(s.paddingNode);return g5({node:e,method:"padEnd",replacement:g6({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:{[gY]:"Prefer `String#{{method}}()` over manual string padding.",[gH]:"Replace with `String#{{method}}()`."},languages:["js/js"]}},"unicorn/require-css-escape":yo,"unicorn/require-passive-events":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1}))return;let[r,n,o]=t.arguments;if(!tt(r)||!yi.has(r.value)||"ArrowFunctionExpression"!==n.type&&"FunctionExpression"!==n.type||!((e,t)=>{let r;if(r=t.sourceCode,"FunctionExpression"===e.type&&rp(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(yl(e)||!yu(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(e5(r,e),", {passive: true}"))}}if(tr(r,!0)||tr(r,!1))return{fix:e=>e.replaceText(r,tr(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(tt(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=rw(o,e);return","===a.value?t.insertTextAfter(a,`
51
51
  ${i}passive: true,`):t.insertTextAfter(o,`,
52
- ${i}passive: true`)}};if(e9(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:g7,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[g7]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":yF,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=yM(r),i=yM(o);if(!a||!i)return;let s=y$(a.object),l=y$(i.object);if(yO(s)&&yO(l)&&ry(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:yB,...yU(i,t)&&{suggest:[{messageId:yP,fix:e=>yW(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:yB,...yU(i,t)&&{suggest:[{messageId:yP,fix:e=>yW(i,t,e)}]}}:{node:i,messageId:yR,...yU(i,t)&&{suggest:[{messageId:yL,fix:e=>yq({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:{[yB]:"Remove unnecessary optional chaining.",[yR]:"Use optional chaining consistently.",[yP]:"Remove optional chaining.",[yL]:"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&&yG.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&yG.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&yJ.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===yV&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:yz,data:{name:a},fix:r=>r.insertTextAfterRange(e1(t,e),", 0")}}if(t===y_&&2===i.length){let t=i[1];if(yX(t))return{node:t,messageId:yK,data:{name:a},fix(r){let[n]=i,[,o]=e1(n,e),[,a]=e1(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:[yV,y_],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[yV],messages:{[yz]:"`{{name}}` should have an explicit delay argument.",[yK]:"`{{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(!tS(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(oK(t))?yY:(n=t,o=r,n=rD(n),o=rD(o),"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"length"===n.property.name&&ud(n.object,o))?yH: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:{[yY]:"Avoid using a negative index with `Array#with()`.",[yH]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=mR(t.right);if(tS(r,{methods:yZ,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a,i;return n=t=mR(t),tS(n,{methods:mj,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=mR(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=mR(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||tS(o=t,{methods:mk,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||tS(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tS(a=t,{methods:mI,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)||!((e,t)=>{for(let r=t.sourceCode.getScope(e);r;r=r.upper)for(let e of mF)if(r.set.get(e)?.defs.length>0)return!0;return!1})(i=t,r)&&!nf(i,r)&&mB(i,r)}(r.callee.object,e))return{node:r.callee.property,messageId:yQ,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:{[yQ]:"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=o3(e);e.onExit("Program",e=>y6(t,e.body,r)),e.onExit("BlockStatement",e=>y6(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:{[y0]:"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=y4(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=y4(e);"MemberExpression"===e.type;)e=y4(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=>!y5(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:y9,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[y9]:"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||!ol(n.object,t)||"Identifier"!==n.property.type||!ht.has(n.property.name))return;let[o]=e.arguments,a=oB(o,t);if(!a)return;let i=n.property.name,s=`${(r=e2(o,t),oG(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:y7,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:he,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:{[y7]:"`Object.{{method}}()` does not return {{type}} contents.",[he]:"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(!ha.has(r.operator))return;if(e8(r.right,0)&&hs(r.left))n=r.left,o=r.operator;else{if(!(e8(r.left,0)&&hs(r.right)))return;n=r.right,o=ho[r.operator]}let a={node:r,messageId:hr};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${e2(i,e)} ${o} ${e2(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(hi.has(o)?nM(i,p)&&nM(s,p):hl(i,p)&&hl(s,p))?a.fix=u:a.suggest=[{messageId:hn,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:{[hr]:"Prefer comparing the values directly over comparing the difference with `0`.",[hn]:"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=hc(t.object),u=hd(t);if("Identifier"!==l.type||"globalThis"!==l.name||!ol(l,e)||nI(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||r_(n=t)||("MemberExpression"===(n=hd(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=hd(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!hg.has(t.operator))return!1;let r=hc(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tN(o)||tL(o,e))return;let p=t.computed?e6(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||!(rT(p)&&(!hm.has(p)||"eval"===p||"arguments"===p))||"eval"===p&&hf(t)||(s=ep(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:hu,data:{name:p}};return hf(t)||"TaggedTemplateExpression"===(a=hd(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:{[hu]:"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===eF(t.key,e.sourceCode.getScope(t.key))&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:hy}}),e.on("ArrayPattern",e=>{if(0!==hS(e))return{node:e,messageId:hh}}),e.on("ObjectPattern",e=>{if(3===hS(e))return{node:e,messageId:hx}}),e.on("MemberExpression",e=>{if(hE(e)?.type==="ObjectPattern")return{node:e,messageId:hb}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[hy]:"Do not use computed keys in object destructuring.",[hh]:"Do not use array destructuring inside object destructuring.",[hx]:"Do not use object destructuring deeper than two levels.",[hb]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=o3(e,t=>(function e(t,r,n){let o;if(n(t)||"ExpressionStatement"===t.type&&(o=t.expression,tS(o,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&ol(o.callee.object,r)))return!0;if("BlockStatement"===t.type){let o=t.body.at(-1);return!!(o&&e(o,r,n))}return"IfStatement"===t.type&&t.alternate&&e(t.consequent,r,n)&&e(t.alternate,r,n)})(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&hC.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:hv,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(rP(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&&(oh(i,t,a.value)||hA(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&&(oh(s,t,l.value)||hA(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!rF(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?`
53
- ${hT(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=hT(r,r.getRange(t)[0]),u=s&&s!==o?hT(r,r.getRange(s)[0]):l;return`
54
- ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=hT(t,t.getRange(e)[0]);return`
55
- ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[hv]:"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(tg(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(hj(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=>hI(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=ep(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:hw}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[hw]:"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(!tS(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!e9(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:hF,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:{[hF]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tS(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 hq.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tl(t,{names:hO,argumentsLength:1})||tl(t,{names:rG,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tS(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||hV(t,["from"])||tS(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tS(t,{object:"Promise",methods:hU,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=hM.get(r);if(!t?.includes(e))return!1}return!0})(r,hJ(t.callee.object,e)))return{node:t.callee.property,messageId:hB,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>aB(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[hB]:"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:hH};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:hQ,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(tS(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:hX,suggest:[{messageId:hY,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tS(e,{objects:hZ,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&h1(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(e8(e.right,0))return h2(e.left);if(e8(e.left,0))return h2(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=h3(e.left,t);if(r&&ry(r,e.right))return r;let n=h3(e.right,t);if(n&&ry(n,e.left))return n})(e,t);if(n&&h1(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[hX]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[hY]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[hH]:"Prefer `Number.isSafeInteger()` over this integer check.",[hQ]:"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=h6(r);if(!n)return;let o=h6(o6(r,e));if(o&&ry(o.arguments[0],n.arguments[0]))return;let a=[r],i=[n],s=o9(r,e);for(;;){let t=h6(s);if(!t||!ry(n.arguments[0],t.arguments[0]))break;a.push(s),i.push(t),s=o9(s,e)}if(i.length<2)return;let l={node:n.callee.property,messageId:h8},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=eF(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=>ry(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=rS(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}]`:rT(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}, {
52
+ ${i}passive: true`)}};if(tr(n.value,!1))return{fix:e=>e.replaceText(n.value,"true")}})(e,t,o);if(a)return{node:r,messageId:ya,...a}})},meta:{type:"suggestion",docs:{description:"Require passive event listeners for high-frequency events.",recommended:"unopinionated"},fixable:"code",messages:{[ya]:"Use `{passive: true}` for this high-frequency event listener."},languages:["js/js"]}},"unicorn/class-reference-in-static-methods":y$,"unicorn/consistent-optional-chaining":{create:e=>{e.on("LogicalExpression",t=>(function(e,t){let{left:r,operator:n,right:o}=e,a=y_(r),i=y_(o);if(!a||!i)return;let s=yW(a.object),l=yW(i.object);if(yz(s)&&yz(l)&&rC(s,l)){if("&&"===n&&i.optional)return{node:i,messageId:yM,...yK(i,t)&&{suggest:[{messageId:yU,fix:e=>yJ(i,t,e)}]}};if("||"===n&&a.optional!==i.optional)return i.optional?{node:i,messageId:yM,...yK(i,t)&&{suggest:[{messageId:yU,fix:e=>yJ(i,t,e)}]}}:{node:i,messageId:yO,...yK(i,t)&&{suggest:[{messageId:yq,fix:e=>yG({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:{[yM]:"Remove unnecessary optional chaining.",[yO]:"Use optional chaining consistently.",[yU]:"Remove optional chaining.",[yq]:"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&&yZ.has(r.name)&&t.isGlobalReference(r))return{isTimer:!0,name:r.name};if("MemberExpression"===r.type&&!r.computed&&"Identifier"===r.property.type&&yZ.has(r.property.name)){let{object:e}=r;if("Identifier"===e.type&&y0.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===yX&&!s){if(0===i.length)return;let[t]=i;if(1===i.length&&t?.type==="SpreadElement")return;return{node:n,messageId:yH,data:{name:a},fix:r=>r.insertTextAfterRange(e5(t,e),", 0")}}if(t===yY&&2===i.length){let t=i[1];if(y1(t))return{node:t,messageId:yQ,data:{name:a},fix(r){let[n]=i,[,o]=e5(n,e),[,a]=e5(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:[yX,yY],description:"Whether to always require an explicit `delay` argument, or disallow an explicit `0` delay."}],defaultOptions:[yX],messages:{[yH]:"`{{name}}` should have an explicit delay argument.",[yQ]:"`{{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(!tw(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(oQ(t))?y2:(n=t,o=r,n=rj(n),o=rj(o),"MemberExpression"===n.type&&!n.optional&&!n.computed&&"Identifier"===n.property.type&&"length"===n.property.name&&ux(n.object,o))?y3: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:{[y2]:"Avoid using a negative index with `Array#with()`.",[y3]:"Avoid using `.length` as the index in `Array#with()`."},languages:["js/js"]}},"unicorn/no-duplicate-loops":{create:e=>{e.on("ForOfStatement",t=>{let r=mO(t.right);if(tw(r,{methods:y6,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&!function e(t,r){let n,o,a,i;return n=t=mO(t),tw(n,{methods:mN,optionalCall:!1,optionalMember:!1,computed:!1})&&((e,t)=>{if("Identifier"===(e=mO(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=mO(e.object);return"Identifier"===r.type&&"globalThis"===r.name&&t.sourceCode.isGlobalReference(r)})(n.callee.object,r)||tw(o=t,{methods:mP,argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})||tw(o,{method:"matchAll",argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1})||tw(a=t,{methods:mL,minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1})&&e(a.callee.object,r)||!((e,t)=>{for(let r=t.sourceCode.getScope(e);r;r=r.upper)for(let e of m$)if(r.set.get(e)?.defs.length>0)return!0;return!1})(i=t,r)&&!nE(i,r)&&mM(i,r)}(r.callee.object,e))return{node:r.callee.property,messageId:y8,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:{[y8]:"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=o7(e);e.onExit("Program",e=>ht(t,e.body,r)),e.onExit("BlockStatement",e=>ht(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:{[y9]:"Move this declaration after the early exit."},languages:["js/js"]}},"unicorn/no-optional-chaining-on-undeclared-variable":{create:e=>{let t=new l;e.on("ChainExpression",r=>{let n=function(e,t){let r=function e(t){return"MemberExpression"===(t=ho(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=ho(e);"MemberExpression"===e.type;)e=ho(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=>!hn(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:hr,data:{name:n.name}}})},meta:{type:"problem",docs:{description:"Disallow optional chaining on undeclared variables.",recommended:!0},schema:[],messages:{[hr]:"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||!of(n.object,t)||"Identifier"!==n.property.type||!hs.has(n.property.name))return;let[o]=e.arguments,a=oM(o,t);if(!a)return;let i=n.property.name,s=`${(r=e4(o,t),oZ(o,t)?`(${r})`:r)}.${i}()`,l={node:n.property,messageId:ha,data:{method:i,type:a}};return 0===t.sourceCode.getCommentsInside(e).length&&(l.suggest=[{messageId:hi,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:{[ha]:"`Object.{{method}}()` does not return {{type}} contents.",[hi]:"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(!hc.has(r.operator))return;if(te(r.right,0)&&hm(r.left))n=r.left,o=r.operator;else{if(!(te(r.left,0)&&hm(r.right)))return;n=r.right,o=hp[r.operator]}let a={node:r,messageId:hl};if(t.getCommentsInside(r).length>0)return a;let{left:i,right:s}=n,l=`${e4(i,e)} ${o} ${e4(s,e)}`,u=e=>e.replaceText(r,l),p=t.getScope(r);return(hd.has(o)?n_(i,p)&&n_(s,p):hf(i,p)&&hf(s,p))?a.fix=u:a.suggest=[{messageId:hu,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:{[hl]:"Prefer comparing the values directly over comparing the difference with `0`.",[hu]:"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=hh(t.object),u=hx(t);if("Identifier"!==l.type||"globalThis"!==l.name||!of(l,e)||nL(r=u)||("ForInStatement"===(i=r).parent.type||"ForOfStatement"===i.parent.type)&&i.parent.left===i||rY(n=t)||("MemberExpression"===(n=hx(n)).parent.type||"CallExpression"===n.parent.type)&&n.parent.optional&&(n.parent.object===n||n.parent.callee===n)||"LogicalExpression"===(o=hx(o=t)).parent.type||function(e){let{parent:t}=e;if("BinaryExpression"!==t.type||!hv.has(t.operator))return!1;let r=hh(t.left===e?t.right:t.left);return"Literal"===r.type&&null===r.value||"Identifier"===r.type&&"undefined"===r.name}(o)||tV(o)||tq(o,e))return;let p=t.computed?tt(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||!(rF(p)&&(!hb.has(p)||"eval"===p||"arguments"===p))||"eval"===p&&hE(t)||(s=ey(e.sourceCode.getScope(t),p),s?.scope.type!=="global"||0!==s.defs.length))return;let c={node:t,messageId:hg,data:{name:p}};return hE(t)||"TaggedTemplateExpression"===(a=hx(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:{[hg]:"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===e$(t.key,e.sourceCode.getScope(t.key))&&t.parent.properties.some(e=>"RestElement"===e.type)))return{node:t,messageId:hC}}),e.on("ArrayPattern",e=>{if(0!==hw(e))return{node:e,messageId:hD}}),e.on("ObjectPattern",e=>{if(3===hw(e))return{node:e,messageId:hS}}),e.on("MemberExpression",e=>{if(hA(e)?.type==="ObjectPattern")return{node:e,messageId:hT}})},meta:{type:"suggestion",docs:{description:"Disallow unreadable object destructuring.",recommended:"unopinionated"},schema:[],messages:{[hC]:"Do not use computed keys in object destructuring.",[hD]:"Do not use array destructuring inside object destructuring.",[hS]:"Do not use object destructuring deeper than two levels.",[hT]:"Do not assign destructured values to object properties."},languages:["js/js"]}},"unicorn/no-useless-else":{create:e=>{let{sourceCode:t}=e,r=o7(e,t=>(function e(t,r,n){let o;if(n(t)||"ExpressionStatement"===t.type&&(o=t.expression,tw(o,{object:"process",method:"exit",optionalCall:!1,optionalMember:!1})&&of(o.callee.object,r)))return!0;if("BlockStatement"===t.type){let o=t.body.at(-1);return!!(o&&e(o,r,n))}return"IfStatement"===t.type&&t.alternate&&e(t.consequent,r,n)&&e(t.alternate,r,n)})(t,e,r));e.onExit("IfStatement",n=>{if(!(n.alternate&&hI.has(n.parent.type)&&r(n.consequent)))return;let o=t.getTokenBefore(n.alternate);return{node:n.alternate,loc:t.getLoc(o),messageId:hk,fix:t=>{let{sourceCode:r}=e,{alternate:o,consequent:a}=n;if(rU(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&&(oD(i,t,a.value)||hB(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&&(oD(s,t,l.value)||hB(l)))})(n,e))return;let i=[r.getRange(a)[1],r.getRange(o)[1]];if(!r$(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?`
53
+ ${hF(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=hF(r,r.getRange(t)[0]),u=s&&s!==o?hF(r,r.getRange(s)[0]):l;return`
54
+ ${i.map(e=>""===e.trim()?"":e.startsWith(u)?`${l}${e.slice(u.length)}`:`${l}${e.trimStart()}`).join("\n")}`})(r,e,t);let n=hF(t,t.getRange(e)[0]);return`
55
+ ${n}${t.getText(r)}`})(n,r))}}})},meta:{type:"suggestion",docs:{description:"Disallow `else` after a statement that exits.",recommended:!0},fixable:"code",messages:{[hk]:"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(tv(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(hN(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=>hL(e)))return!0}return!1})(e,a)&&o.callee.name===a.id.name&&(r=o.callee,n=ey(t.getScope(r),r),n?.identifiers.includes(a.id)))})(e,t))return{node:e.argument.callee,messageId:hR}})},meta:{type:"suggestion",docs:{description:"Disallow simple recursive function calls that can be replaced with a loop.",recommended:!0},messages:{[hR]:"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(!tw(e,{method:"addEventListener",argumentsLength:3,optionalCall:!1,optionalMember:!1}))return;let t=e.arguments[2];if(!tr(t))return;let r=`{capture: ${t.value}}`;return{node:t,messageId:h$,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:{[h$]:"Prefer `{{replacement}}` over `{{value}}`."},languages:["js/js"]}},"unicorn/prefer-direct-iteration":{create:e=>{e.on("CallExpression",t=>{if(!tw(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 hG.has(t.type)})(t))return!0;if("NewExpression"===t.type)return 1===t.arguments.length&&t.arguments[0]===e&&(tf(t,{names:hz,argumentsLength:1})||tf(t,{names:rZ,argumentsLength:1}));if("CallExpression"===t.type)return t.arguments[0]===e&&(tw(t,{object:"Array",method:"from",minimumArguments:1,optionalCall:!1,optionalMember:!1})||hX(t,["from"])||tw(t,{object:"Object",method:"fromEntries",minimumArguments:1,optionalCall:!1,optionalMember:!1})||tw(t,{object:"Promise",methods:hK,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=h_.get(r);if(!t?.includes(e))return!1}return!0})(r,h0(t.callee.object,e)))return{node:t.callee.property,messageId:hM,data:{method:r},fix:((e,t)=>{if(!(t.sourceCode.getCommentsInside(e).length>0))return r=>aM(r,e,t)})(t,e)}})},meta:{type:"suggestion",docs:{description:"Prefer direct iteration over default iterator method calls.",recommended:"unopinionated"},fixable:"code",messages:{[hM]:"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:h3};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:h8,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(tw(e,{object:"Number",method:"isInteger",optionalCall:!1,optionalMember:!1,computed:!1})&&t.isGlobalReference(e.callee.object))return{node:e.callee.property,messageId:h1,suggest:[{messageId:h2,fix:t=>t.replaceText(e.callee.property,"isSafeInteger")}]};let n=(e=>{if(tw(e,{objects:h6,methods:["isInteger","isSafeInteger"],argumentsLength:1,optionalCall:!1,optionalMember:!1,computed:!1}))return e.arguments[0]})(e);if(n&&h5(e,t))return r(e,n)}),e.on("BinaryExpression",e=>{let n=(e=>{if("==="===e.operator){if(te(e.right,0))return h4(e.left);if(te(e.left,0))return h4(e.right)}})(e)??((e,t)=>{if("==="!==e.operator)return;let r=h7(e.left,t);if(r&&rC(r,e.right))return r;let n=h7(e.right,t);if(n&&rC(n,e.left))return n})(e,t);if(n&&h5(e,t))return r(e,n)})},meta:{type:"suggestion",docs:{description:"Prefer `Number.isSafeInteger()` over integer checks.",recommended:!0},hasSuggestions:!0,messages:{[h1]:"Prefer `Number.isSafeInteger()` over `Number.isInteger()`.",[h2]:"Replace `Number.isInteger()` with `Number.isSafeInteger()`.",[h3]:"Prefer `Number.isSafeInteger()` over this integer check.",[h8]:"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=xt(r);if(!n)return;let o=xt(at(r,e));if(o&&rC(o.arguments[0],n.arguments[0]))return;let a=[r],s=[n],l=ar(r,e);for(;;){let t=xt(l);if(!t||!rC(n.arguments[0],t.arguments[0]))break;a.push(l),s.push(t),l=ar(l,e)}if(s.length<2)return;let u={node:n.callee.property,messageId:xe},p=[t.getRange(a[0])[0],t.getRange(a.at(-1))[1]];return function(e,t){let r=new i,n=[];for(let o of e){let e=o.arguments[1],a=function(e,t){let r=e$(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=>rC(t,e)))return!0;n.push(e);continue}if(r.has(a))return!0;r.add(a)}return!1}(s,t)||t.getAllComments().some(e=>{let[r,n]=t.getRange(e);return r>=p[0]&&n<=p[1]})||(u.fix=function(e,t,r){let{sourceCode:n}=r,o=e[0],a=e.at(-1),i=rw(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}]`:rF(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}, {
56
56
  ${u}
57
- ${i}});`)}(a,i,e)),l})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[h8]:"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(!(xe(n)&&"Identifier"===n.value.type))return;let e=eR(n,t.sourceCode.getScope(n));if(null===e||h4.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"||eO(n.argument,t.sourceCode,h7))return;let o=new Map;for(let e of r.slice(0,-1)){if(!xe(e)||eO(e.value,t.sourceCode,h7))return;let r=eR(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||xt(r.value,l,e))return;u.push(xr(t,r,e))}return{node:t,messageId:h9,suggest:[{messageId:h5,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:{[h9]:"Prefer object destructuring defaults over default object literals with spread.",[h5]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>xi(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>xi(t,e.body)),e.on("SwitchCase",e=>xi(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[xn]:"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(!xu(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=>!xu(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:xs,data:{name:r.id.name}};return r.id.typeAnnotation||xc(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||xp(t,e,"before")||xp(t,e,"after")||xp(t,l,"before")||xp(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield aR(t,{sourceCode:e},a);let i=`const ${o} = `;if(xc(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:{[xs]:"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=xf.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(!tS(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let{object:n}=e.callee;if(ng(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],!ry(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:xd,data:{method:r},suggest:[{messageId:xm,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(e3(e,r))return e2(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):xg.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:{[xd]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[xm]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tS(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===xP(t.callee.object,e)){let r={node:t.callee.property,messageId:xy};return xN(t,e)&&!e3(t.callee,e)&&xL(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(ts(t,{name:"String",argumentsLength:1,optional:!1},to)&&ol(t.callee,e)))return;let[r]=t.arguments;if("url"!==xP(r,e))return;let n={node:t.callee,messageId:xy};return xN(t,e)&&xL(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=e2(r,e),a=!e3(r,e)&&oG(r,e)?`(${o})`:o,i=`${a}.href`,(oh(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:{[xy]:"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(!(tl(n=e,{name:"Proxy",argumentsLength:2})||tS(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=xz(e,t);if(!n)continue;let o=xK(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(!(xO.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:{[x$]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":xQ,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:xZ,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield aC(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=x0.get(n);if(!o||!ol(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&&nM(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(e8(a,"")&&n5(o,e))n=o;else{if(!(e8(o,"")&&n5(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&&n5(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:{[xZ]:"{{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(!tS(r,{methods:x2,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tg(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(!tP(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&os(n.params[0],a))&&!(function e(t){return(t=rD(t),t?.type==="ChainExpression")?r_(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||rX.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:x1,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:{[x1]:"`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 th(e)&&e.body===t}})(t))return{node:t,messageId:x3,fix:r=>aR(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[x3]:"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=eR(e,l);if("string"==typeof u&&eR(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&&eR(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=x9(i,e))||!0!==oa(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=x9(i,e))&&x6(t.type)))return}return{node:r.key,messageId:x8,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield a$(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[x8]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tS(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;bp.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=bT(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&bh(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(bh(t.value,r)&&bB(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(te(t.value)&&o&&bB(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!bh(n,t):!te(n)))return;return{node:e.callee.property,messageId:x5,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=e2(n=e.callee.object,r),!e3(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((tL(e,t)||tN(e))&&bT(e.callee.object,t)?.kind==="map"&&bB(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:x5,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:{[x5]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===bP?e.on("LogicalExpression",t=>{if(bO(t)){if("&&"!==t.operator||bM(t.right)||bU(t.left,t.right,e.sourceCode))return;let r=b_(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&bU(r.reference,t.right,e.sourceCode))return;let n=bK(t.left,e),o=bK(t.right,e);return{node:t,messageId:bL,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(bO(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=bM(o);if(a===bM(n))return;let i=a?n:o,s=b_(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?bU(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&bU(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&bU(s.reference,i,t.sourceCode))return;let u=a?bz(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return bz(e.argument,"left",t);let r=e2(e,t);return!e3(e,t)&&oY(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=bz(i,"right",t);return{node:e,messageId:bL,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:[bR,bP]}],defaultOptions:[bR],messages:{[bL]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":El,"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=Eu(e.right);if(!n||!tS(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=Eu(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=Ep(n,t);if(!a||!i||i!==Ep(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&&Eu(t.node.init);return!!(r&&tc(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tg(r))return;if(th(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:Ec}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[Ec]:"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(!tS(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tA(t.callee,Em)||nh(r,e)))return{node:n,messageId:Ed,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[Ed]:"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||!Ey(t.property)||nI(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=Eh(t.object,e);if(r)return Ex(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tS(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(Ey(n)?r="first":tv(n)&&(r="last"),!r||nI(t))return;let o=Eh(t.callee.object,e);if(o)return Ex(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Ef]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[Eg]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{let r,n;if(r=t,n=e,!(ts(r,{minimumArguments:1},to)&&"MemberExpression"===r.callee.type&&ES.has(eR(r.callee,n.sourceCode.getScope(r.callee))))||ng(t.callee.object,e))return;let[o]=t.arguments;if("SpreadElement"!==o.type){let t=rD(o);if(tg(t)){let r=(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(!nY(t,e)&&!ED(o,e))return;return{node:o,messageId:Eb,suggest:o===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=rD(n=t)).type&&Ev.has(n.operator)?n:void 0;if(!i||rC(i.left)||rC(i.right)||!EC(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:EE,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(t,r,e):void 0}}return nH(t,e)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||nq.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=nW.get(e.object.name),n=eR(e,t.sourceCode.getScope(e));return!!r?.has(n)}(t,e)||ED(o,e)?{node:o,messageId:Eb}:void 0}})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[Eb]:"Do not return a boolean from a sort comparator.",[EE]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!EI.has(r.operator))return;let n=Ej(r.left)?r.left:r.right;if(!Ej(n))return;let o=n===r.left,a=o?r.right:r.left;if(Ek.has(r.operator)&&nZ(a,e))return;let i={node:r,messageId:ET},s=Ew.has(n.operator)===Ew.has(r.operator)&&!e9(r.right);if(o&&s&&!Ej(r.right)&&!Ej(n.left)&&((e,t)=>{if(e3(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!eO(n.right,t)&&0===t.getCommentsInside(r).length){let o=`${t.getText(r.left)} && ${e2(n.right,e)} ${r.operator} ${e2(r.right,e)}`;i.suggest=[{messageId:EA,data:{replacement:o},fix:e=>e.replaceText(r,o)}]}return i})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[ET]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[EA]:"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 e8(e.left,0)||e8(e.right,0);case"/":return e8(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:EF},n=eF(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:EB,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:{[EF]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[EB]:"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)||!E$(o)||!E$(t.right)||!ud(o,t.right))return;let a={node:t.right,messageId:ER};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=e1(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=e2(t.left,e),s=e=>e.replaceText(t,i);return EN.has(o.type)&&(n=t.right,EN.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:EP,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[ER]:"This operand duplicates the left operand.",[EP]:"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(EO,t.operator))return;let i=(r=rD(t.left),n=rD(t.right),rM(r)?{memberExpression:r,operator:t.operator,value:eF(n,e.sourceCode.getScope(n))?.value}:rM(n)?{memberExpression:n,operator:EO[t.operator],value:eF(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=rD(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rD(t)).type||r_(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=eF(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tj(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&&tb(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&r$.has(r.property.name)&&ry(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:EM,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[EM]:"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(Eq.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=e5(n);if(void 0!==o&&o.length>1&&EW(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:EU,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:{[EU]:"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=o3(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=E0(n.right,e);if(o)return function* e(t,r,n,o){if(EX.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=E0(t.right,o);e&&E8(e.reference,r.iterable,o)&&(a=E2(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=eR(e.callee,n.sourceCode.getScope(e.callee));if(!(!EG[t.collectionKind??"unknown"].has(c)||!E8(u,i,n)||"delete"===c&&E6(e,a,n)||E9(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=rD(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eR(o.callee,n.sourceCode.getScope(o.callee))&&E8(o.callee.object,r.iterable,n)&&E6(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&&E9(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:EV,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,...E2(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[EV]:"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(tS(e,{methods:E4})&&tb(e.callee.object,{property:"classList",computed:!1})&&!n7(rD(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?So(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:So(e.arguments.slice(0,2),"."):So(e.arguments.slice(0,1),".")}if(tS(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!n7(rD(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return So(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rD(r),o=Sr(e);St(o)&&(yield Sn(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[E5]:"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(!Sl.has(r.operator)||!e4(r.right)||r.right.value!==Sl.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:Sa,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:Sa,data:n,suggest:[{messageId:Si,fix:t=>aR(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:Sa,data:n,suggest:[{messageId:Ss,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:{[Sa]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[Si]:"Remove the useless assignment.",[Ss]:"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&&ry(o.right,a.object)&&SE(o.right,r)&&SS(o.left,r)&&SS(o.right,r)&&(!a.computed||SS(a.property,r))){if(a.computed)n=((e,t,r)=>{if(ry(e,t))return!((e,t)=>{var r;let n;if(SE(e,t)||Sx(rD(e),t))return!0;let o=rL(rD(e),t);if(!o)return!1;let a=rD(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===Sb(r,t)})(e,r);let n=Sb(e,r),o=Sb(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eR(a,r.sourceCode.getScope(a));n=null!==e&&e===Sb(o.left,r)}return n?{suggest:[{messageId:Sp,fix:SC(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(Sv(n,"has")&&Sv(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rD(e)).type)return!1;let n=rL(e,t);if(!n)return!1;let o=rD(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&Sd.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&ry(n.callee.object,t.callee.object)&&ry(n.arguments[0],t.arguments[0])&&SS(n.arguments[0],r))return{fix:SC(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:Su,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:{[Su]:"The existence check before deletion is unnecessary.",[Sp]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!ST.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=SA.get(o),e9(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=ST.get(o),a.filter((e,r)=>e9(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tL(n=e[t].parent,r)||tN(n)||o.every(e=>nZ(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&&e6(rD(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&&tg(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:SD,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>aC(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=e3(t,e),a=e2(t,e),!o&&oH(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&Sw.has(rD(t).type)&&(a=`(${a})`),a}).join(` ${n} `),oh(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:{[SD]:"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=SF(o),u=SF(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:Sk},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||rj(e,a),m=!c&&!SB(n.test,e)&&!!(s=ep(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=e2(t,e);if(r)return oY(t,"!")?`!(${n})`:`!${n}`;if(SB(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>n.alternate?r(n,Sj(n.consequent),Sj(n.alternate)):function(n){let o,a=o9(n,e);if(!a||"ReturnStatement"!==a.type)return;let i=Sj(n.consequent),s=SF(i);if(void 0!==s&&(o=o6(n,e),o?.type==="IfStatement"&&!o.alternate&&SF(Sj(o.consequent))===s))return;let l=r(n,i,a,[t.getRange(n)[0],t.getRange(a)[1]]);return l?.fix&&t.getTokensBetween(n,a,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:Sk}:l}(n))},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Sk]:"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 SP)if(SL(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>SL(e,r))||((e,t)=>{let{parent:r}=e;return SL(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:SR,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=SN(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:{[SR]:"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=>SV(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>SV(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 Sz({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield Sz({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:{[S$]:"These branches start with the same code. Move it before the `if` statement.",[SM]:"These branches end with the same code. Move it after the `if` statement.",[SO]:"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===SY(r))return;let n=r.arguments[1];if(!e6(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==SY(e)&&e6(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(SY(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:SG};if(0===t.getCommentsInside(r).length){let t=p.map((e,t)=>(function(e,t,r){if(SX.has(e))return SX.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=e2(u,e),a=e2(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:{[SG]:"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:SH}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[SH]:"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=>S9(t,e)),e.on("Property",t=>S9(t,e)),e.on("PropertyDefinition",t=>S9(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[SQ]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[SZ]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[S0]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[S1]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[S2]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=ga(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!tS(e,{methods:ve,computed:!1}))return;let{callee:t}=e,r=rD(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=ep(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!nS(o=u.name,e)&&(gr.test(o.name)||nE(o,e))))return;let c=gn(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=S5;return c?m=S7:d&&(m=S4),{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:{[S5]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[S4]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[S7]:"`{{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||!(tl(l,{name:"AbortController",argumentsLength:0})&&ol(l.callee,t))||(n=ep(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||rF(t,a.getRange(l))||s.typeAnnotation&&rF(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"&&ts(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},to)&&ol(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)||rF(t,a.getRange(u))||rj(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(ts(n,{argumentsLength:0,optional:!1},to)&&tb(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=ep(a.getScope(s),s);if(!d||ep(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=vo(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=eF(e,t.sourceCode.getScope(e));if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=0x7fffffff})(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||va(o,d,d.identifiers[0],t)||m.some(e=>va(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:vt,suggest:[{messageId:vr,*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 aR(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:{[vt]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[vr]:"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(tl(r,{name:"Error",maximumArguments:2})&&ol(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=vg(e.test).map(e=>(function(e,t){let r=vm(e=vu(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=vm(e.left,t);if(n&&vf(e.operator,e.right,!0))return n;let o=vm(e.right,t);if(o&&vf(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=oE("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:vi,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:{[vi]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(r=t,n=e,tS(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!vI(r.callee.object,n):!(ts(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},to)&&ol(r.callee,n)))return;let[a,i]=t.arguments,s=e5(o=rD(a))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(o,e);if(!vh.has(s))return;let l=((e,t)=>{if(tg(e=rD(e)))return e;if("Identifier"!==e.type)return;let r=ep(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&&rD(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tg(o))return o})(i,e);if(l&&v$(l.body,e))return{node:a,messageId:s}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:vy,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!vV(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 vJ(e,t)&&(r=e.argument,tl(r,{name:"Set",argumentsLength:0})&&ol(r.callee,t)||!eO(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:vM,fix:n=>n.replaceText(e,vz(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=v_(r,t);for(let e of n)o+=`.union(${e2(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!vV(t,e))return;let[n]=t.arguments;return vY((e=>{for(;e?.type==="ParenthesizedExpression"||rC(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=vG(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return vY(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[vM]:"Use `Set#union()` instead of spreading Sets into a new Set.",[vO]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[vU]:"Use `Set#intersection()`.",[vq]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[vW]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=v2(r.consequent),o=v2(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&v3(e,t)&&!r_(e.receiver)&&!r_(t.receiver)&&!v8(e,r)&&!v8(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=v1(t);if(a?.method==="hasAttribute"&&v3(a,r)&&!r_(a.receiver))return{isNegative:o,isKnownNonDom:v8(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":vZ(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==e5(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||rI(e,r,c)?void 0:function*(n){var o;let i,s=(i=e2(o=a.receiver,e),!e3(o,e.sourceCode)&&oG(o,e)?`(${i})`:i),u=e2(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),oh(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield ak(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:vH};if(!t)return n;let o="IfStatement"!==e.type&&!(tm(e)||tm(e.parent));return r||o?n.suggest=[{messageId:vQ,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:{[vH]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[vQ]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tS(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&v7("Object",e,t)))return;let[r]=e.arguments,n=Cr(r,t);if(!n)return;let o=Co(e,r,Cn(n.query,t),t);return Ci({node:e,query:n.query,replacement:o,preservedNodes:[...Ca(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rC(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?e5(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tl(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=Cr(t,e);if(o)return Ci({node:t,query:o.query,replacement:Cn(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tl(e,{name:"Map",argumentsLength:1})&&v7("Map",e,t);if(!r&&!tl(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=Cr(n,t);if(!o)return;let a=Ct(o.query,t),i=Cn(o.query,t),s=Co(e,n,r?i:a,t);return Ci({node:e,query:o.query,replacement:s,preservedNodes:[...Ca(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:{[v6]:"Prefer `URLSearchParams` over manually splitting query strings.",[v9]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{e.on("CallExpression",t=>(function(e,t){if(!tS(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!Cm(e.callee.object))return;let[r]=e.arguments;if(!Cc(r)||0===r.params.length)return;let[n]=r.params,o=CT(n)&&ep(t.sourceCode.getScope(n),n);if(o)return function e(t,r,n){if(t=Cd(t),!(!t?.type||Cc(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tS(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!CM(t=Cd(t),r,n)||Cg(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!CO(t.callee.object)){let e=CU(t,n,{knownPromiseSettledResultArray:!0});if(e)return e}for(let[o,a]of Object.entries(t))if(!("parent"===o||C$(t,o))&&a&&"object"==typeof a)for(let t of Array.isArray(a)?a:[a]){let o=e(t,r,n);if(o)return o}}}(r.body,o,t)})(t,e)??CU(t,e))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[Cs]:"Do not read `.value` from `Promise.allSettled()` results without checking that the result is fulfilled."},languages:["js/js"]}},"unicorn/prefer-abort-signal-any":{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||!(tl(l,{name:"AbortController",argumentsLength:0})&&ol(l.callee,t))||(n=ep(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||rF(t,a.getRange(l))||s.typeAnnotation&&rF(t,a.getRange(s.typeAnnotation)))return;let u=((e,t,r)=>{var n;let o,a=CK(e);if(a?.type!=="ForOfStatement"||a.await||!Dp(a,r)||CG(r,e,a)||!De(a.right,r)||C1(a.right,r)||C6(a.right,t,r)||C8(a.right,r)||!Ds(a.right,r)||!(!(o=C7(a.right,r))||o.length>1&&o.every(e=>C5(e,r))))return;let i=(e=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[t]=e.declarations;if("Identifier"===t.id.type&&!t.init)return t.id})(a.left);if(!i||!C9(i,r))return;let s=Du("ExpressionStatement"===(n=a.body).type?n:"BlockStatement"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type?n.body[0]:void 0);if(!s||!ry(rD(s.sourceSignal),i))return;let l=Dl(s.call.arguments[1],t,i,r);if(l)return{abortReferences:new Set([l]),replacement:`AbortSignal.any(${((e,t)=>{let r=t.sourceCode.getText(e);if(!Di(e,t))return r;let n=rD(e);if("ArrayExpression"===n.type)return t.sourceCode.getText(n);let o=n===e?r:`(${r})`;return`[...${o}]`})(a.right,r)})`,statements:[a]}})(i,s.name,t)??((e,t,r)=>{let n=[],o=[],a=new Set,i=e,s=CK(e);for(;s;){let e=Du(s);if(!e||!Dp(s,r)||CG(r,i,s)||C6(e.sourceSignal,t,r)||C8(e.sourceSignal,r)||!C5(e.sourceSignal,r))break;let l=Dl(e.call.arguments[1],t,e.sourceSignal,r);if(!l)break;n.push(s),o.push(e.sourceSignal),a.add(l),i=s,s=CK(s)}if(!(n.length<2))return{abortReferences:a,replacement:`AbortSignal.any([${o.map(e=>r.sourceCode.getText(e)).join(", ")}])`,statements:n}})(i,s.name,t);if(!u)return;let p=ep(a.getScope(s),s);if(!p)return;for(let e of u.abortReferences)if(ep(a.getScope(e),e)!==p)return;let c=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(t.has(e)||o.init)continue;if(o.isWrite())return;let a=CX(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(p,u.abortReferences,t);if(!c)return;let d=(r=s.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||Dc(o,p,p.identifiers[0],t)||c.some(e=>Dc(o,p,e,t)))?r:o);return{node:s,messageId:Cq,suggest:[{messageId:CW,*fix(e){if(yield e.replaceText(l,u.replacement),s.typeAnnotation&&(yield e.replaceText(s.typeAnnotation,": AbortSignal")),d!==s.name){let[t]=a.getRange(s);yield e.replaceTextRange([t,t+s.name.length],d)}for(let t of c)yield e.replaceText(t,d);yield((e,t,r)=>{if(1===e.length)return aR(e[0],t,r);let{sourceCode:n}=t,{lines:o}=n,a=e[0],i=e.at(-1),s=n.getLoc(a).start,l=n.getLoc(i).end,u=o[s.line-1].slice(0,s.column),p=o[l.line-1].slice(l.column),{text:c}=n,[d]=n.getRange(a),[,m]=n.getRange(i);return/^\s*$/.test(u)&&/^\s*$/.test(p)&&(m+=p.length,0===d?"\r"===c[m]&&"\n"===c[m+1]?m+=2:("\n"===c[m]||"\r"===c[m])&&m++:"\r"===c[(d-=u.length)-2]&&"\n"===c[d-1]?d-=2:("\n"===c[d-1]||"\r"===c[d-1])&&d--),r.removeRange([d,m])})(u.statements,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[Cq]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[CW]:"Replace with `AbortSignal.any()`."},languages:["js/js"]}},"unicorn/prefer-block-statement-over-iife":{create:e=>{let{sourceCode:t}=e,{visitorKeys:r}=t;e.on("ExpressionStatement",n=>{let o,a,{expression:i}=n;if("CallExpression"!==i.type||i.optional||i.arguments.length>0)return;let{callee:s}=i;if(!("FunctionExpression"!==s.type&&"ArrowFunctionExpression"!==s.type||s.id||s.async||s.generator||s.params.length>0||"BlockStatement"!==s.body.type||s.body.body.some(e=>tu(e))||Dy(s.body,r,e=>"ReturnStatement"===e.type||"VariableDeclaration"===e.type&&"var"===e.kind||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)||(o=s.body,"script"===t.ast.sourceType&&Dy(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,rI(e,Dh(n,e.sourceCode),[a]))||"FunctionExpression"===s.type&&Dy(s.body,r,Dm,Dg))){let t;return{node:i,messageId:Dd,fix:(t=s.body,r=>r.replaceTextRange(Dh(n,e.sourceCode),e.sourceCode.getText(t)))}}})},meta:{type:"suggestion",docs:{description:"Prefer block statements over IIFEs used only for scoping.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Dd]:"Prefer a block statement over an IIFE used only for scoping."},languages:["js/js"]}},"unicorn/no-multiple-promise-resolver-calls":{create:e=>{let t,{sourceCode:r}=e,n=new WeakMap,o=(e,r)=>{var n;t.currentSegments.add(e),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)},a=e=>{t.currentSegments.delete(e)};e.on("onCodePathStart",(o,a)=>{let i=t;t={upper:i,codePath:o,currentSegments:new Set,eventsBySegment:new Map,executors:new Set,catchClausesBySegment:new Map,ignoredLoopEdges:[],hasResolverReferences:i?.hasResolverReferences??!1},Dv(a,e)&&function(e,t,r){let n=!1;for(let o of e.params.slice(0,2)){if("Identifier"!==o.type)continue;let a=ep(r.getScope(o),o);if(!(!a||DC(a)))for(let r of a.references)t.set(r.identifier,e),n=!0}return n}(a,n,r)&&(t.hasResolverReferences=!0)}),e.on("onCodePathEnd",()=>{!function(e,t){var r;let n;if(0===e.executors.size)return;let o=(r=e.codePath,n=[],r.traverseSegments(e=>{e.reachable&&n.push(e)}),n),a=new WeakSet;for(let r of e.executors){let n=function(e,t,r){let n,o=new Map;do for(let a of(n=!1,r)){let r=function(e,t,r){for(let n of t)e=DA(e,n,r);return e}(DI(a,o,e),e.eventsBySegment.get(a)??[],t);Dk(r,o.get(a))||(o.set(a,r),n=!0)}while(n);return o}(e,r,o);for(let i of o){let o=DI(i,n,e);for(let n of e.eventsBySegment.get(i)??[])n.executor===r&&o.resolverCalled&&!a.has(n.node)&&(a.add(n.node),t.report({node:n.node,messageId:Dx})),o=DA(o,n,r)}}}(t,e),t=t.upper}),e.on("onCodePathSegmentStart",o),e.on("onUnreachableCodePathSegmentStart",o),e.on("onCodePathSegmentEnd",a),e.on("onUnreachableCodePathSegmentEnd",a),e.on("onCodePathSegmentLoop",(e,r,n)=>{(Dj(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;o&&!tg(o);){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&th(o))return r;n=o,{parent:o}=o}return!1}(n))&&t.ignoredLoopEdges.push({previousSegment:e,segment:r})}),e.onExit(["Identifier","CallExpression","ImportExpression","MemberExpression","NewExpression","ThrowStatement","YieldExpression"],r=>{if(!t.hasResolverReferences||"Identifier"===r.type&&(n.has(r)||!DF(r))||"ImportExpression"===r.type&&!DF(r))return;let o=((e,t)=>{if("CallExpression"!==e.type)return;let r=DS(e.callee);return"Identifier"===r.type?t.get(r):void 0})(r,n),{catchClause:a,finallyBlocks:i}=o?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tg(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tg(n);){if("TryStatement"===n.type){if(n.block===r&&n.handler)return{catchClause:n.handler,finallyBlocks:t};n.finalizer&&(n.block===r||n.handler===r)&&t.push(n.finalizer)}r=n,{parent:n}=n}return{catchClause:void 0,finallyBlocks:t}}(r);if((o||a)&&!(function(e){let t=e,{parent:r}=e;for(;r;){if(Dj(r)&&("WhileStatement"===r.type&&r.body===t||"ForStatement"===r.type&&(r.body===t||r.update===t)))return!0;t=r,{parent:r}=r}return!1}(r)||o&&function(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&Dv(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}(r,e))){var s=t,l={catchClause:a,finallyBlocks:i,node:r,executor:o};for(let e of s.currentSegments){if(!e.reachable)continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}o&&t.executors.add(o)}})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[Dx]:"Promise executor resolver functions may be called multiple times on the same execution path."},languages:["js/js"]}},"unicorn/no-unnecessary-string-trim":{create:e=>{e.on("CallExpression",t=>{if(!tS(t,{methods:DR,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let r=t.callee.object;if(!tS(r,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||r_(t))return;let n=r.callee.object;if(((e,t)=>{if(e=rD(e),e=rD(rL(e,t)??e),DL.has(e.type))return!0;let r=DN(e,t);return!!r&&"string"!=typeof r.value})(n,e)||n9(n,e))return;let{property:o}=t.callee,{property:a}=r.callee,i=o.name,[s]=t.arguments;if(s){let t=((e,t)=>{let r=DN(e,t);if(!r)return;let{value:n}=r;return null===n||DP.has(typeof n)?String(n):void 0})(s,e);if(void 0===t||("startsWith"===i?t!==t.trimEnd():t!==t.trimStart()))return}let l="startsWith"===i?"trimStart":"trimEnd";return{node:a,messageId:DB,data:{method:i,replacement:l},fix:e=>e.replaceText(a,l)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[DB]:"Prefer `String#{{replacement}}()` before `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-useless-re-export":{create:e=>{let{sourceCode:t}=e,r=[],n=[];e.on("ExportAllDeclaration",e=>{e.exported||r.push({node:e,request:DO(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let o=(e,n)=>{let o=DM(n.exported);if("default"===o)return;let a=DM(n.local),[i]=t.getRange(n.local),[s]=t.getRange(n.exported);if(a===o&&i!==s)return;let l="type"===n.exportKind||"type"===e.exportKind,u=DO(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:D$}};e.on("Program:exit",function*(){if(1===new Set(r.map(e=>e.request)).size)for(let e of n)for(let t of e.specifiers){let r=o(e,t);r&&(yield r)}})},meta:{type:"suggestion",docs:{description:"Disallow redundant re-exports.",recommended:"unopinionated"},schema:[],messages:{[D$]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=g.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v72.0.0/docs/rules/${r}.md`)}},create:oO(t.create)}]})))};module.exports=DU;
57
+ ${i}});`)}(a,s,e)),u})},meta:{type:"suggestion",docs:{description:"Prefer `Object.defineProperties()` over multiple `Object.defineProperty()` calls.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[xe]:"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 a=((e,t)=>{if(e.typeAnnotation)return;let r=[];for(let n of e.properties){if(!(xi(n)&&"Identifier"===n.value.type))return;let e=eO(n,t.sourceCode.getScope(n));if(null===e||xo.has(e))return;r.push({node:n,name:e})}return r})(r,e),s=((e,t)=>{let{properties:r}=e,n=r.at(-1);if(n?.type!=="SpreadElement"||ez(n.argument,t.sourceCode,xa))return;let a=new o;for(let e of r.slice(0,-1)){if(!xi(e)||ez(e.value,t.sourceCode,xa))return;let r=eO(e,t.sourceCode.getScope(e));if(null===r||a.has(r))return;a.set(r,e)}return{defaultProperties:a,spreadElement:n}})(n,e);if(!a||0===a.length||!s)return;let{defaultProperties:l,spreadElement:u}=s;if(a.length!==l.size)return;let p=new i(a.map(e=>e.node.value.name)),c=[];for(let t of a){let r=l.get(t.name);if(!r||xs(r.value,p,e))return;c.push(xl(t,r,e))}return{node:t,messageId:xr,suggest:[{messageId:xn,fix:r=>r.replaceText(t,`{${c.join(", ")}} = {${e.sourceCode.getText(u)}}`)}]}})},meta:{type:"suggestion",docs:{description:"Prefer object destructuring defaults over default object literals with spread.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[xr]:"Prefer object destructuring defaults over default object literals with spread.",[xn]:"Use object destructuring defaults."},languages:["js/js"]}},"unicorn/prefer-single-object-destructuring":{create:e=>{let{sourceCode:t}=e;e.on("Program",e=>xd(t,e.body)),e.on(["BlockStatement","StaticBlock"],e=>xd(t,e.body)),e.on("SwitchCase",e=>xd(t,e.consequent))},meta:{type:"suggestion",docs:{description:"Prefer a single object destructuring declaration per local const source.",recommended:!0},fixable:"code",schema:[],messages:{[xu]:"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(!xg(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=>!xg(e.identifier,u))||o.some(e=>e.isRead()&&t.getRange(e.identifier)[0]<d))return;let m={node:r.id,messageId:xm,data:{name:r.id.name}};return r.id.typeAnnotation||xh(t,s)&&"SequenceExpression"===s.right.type||t.getCommentsInside(e).length>0||t.getCommentsInside(l).length>0||xy(t,e,"before")||xy(t,e,"after")||xy(t,l,"before")||xy(t,l,"after")||(m.fix=function({sourceCode:e,declaration:t,assignmentExpression:r,assignmentStatement:n,name:o}){return function*(a){yield aO(t,{sourceCode:e},a);let i=`const ${o} = `;if(xh(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:{[xm]:"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=xE.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(!tw(e,{method:t,argumentsLength:1,optionalCall:!1,optionalMember:!1})||e.typeArguments||e.typeParameters)return;let{object:n}=e.callee;if(nv(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],!rC(t.object,e.object)||t.callback.parameterText!==e.callback.parameterText})))return{node:t,messageId:xx,data:{method:r},suggest:[{messageId:xb,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(e7(e,r))return e4(e,r);let a=r.sourceCode.getText(e);return(n=e,o=t,"LogicalExpression"===n.type?n.operator!==o&&("||"!==o||"&&"!==n.operator):xv.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:{[xx]:"Prefer a single `Array#{{method}}()` with a combined predicate.",[xb]:"Merge predicates into one `Array#{{method}}()` call."},languages:["js/js"]}},"unicorn/prefer-url-href":{create:e=>{e.on("CallExpression",t=>{if(tw(t,{method:"toString",argumentsLength:0,optionalCall:!1,optionalMember:!1,computed:!1})&&"url"===xU(t.callee.object,e)){let r={node:t.callee.property,messageId:xC};return xV(t,e)&&!e7(t.callee,e)&&xq(t.callee.object,e)&&(r.fix=r=>r.replaceTextRange([e.sourceCode.getRange(t.callee.property)[0],e.sourceCode.getRange(t)[1]],"href")),r}if(!(tm(t,{name:"String",argumentsLength:1,optional:!1},tp)&&of(t.callee,e)))return;let[r]=t.arguments;if("url"!==xU(r,e))return;let n={node:t.callee,messageId:xC};return xV(t,e)&&xq(r,e)&&(n.fix=n=>{let o,a,i;return n.replaceText(t,(o=e4(r,e),a=!e7(r,e)&&oZ(r,e)?`(${o})`:o,i=`${a}.href`,(oD(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:{[xC]:"Prefer `URL#href` over stringifying a `URL`."},languages:["js/js"]}},"unicorn/require-proxy-trap-boolean-return":{create:e=>{let{sourceCode:t}=e,r=new s,n=[];function*o(e){let n;if(!(tf(n=e,{name:"Proxy",argumentsLength:2})||tw(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=xH(e,t);if(!n)continue;let o=xQ(n,t,r);o&&(yield o)}}e.on("onCodePathStart",()=>{n.push(new i)}),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(!(xz.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:{[xW]:"Proxy trap `{{name}}` should return a boolean."},languages:["js/js"]}},"unicorn/logical-assignment-operators":x8,"unicorn/no-useless-coercion":{create:e=>{let{sourceCode:t}=e,r=(r,n,o,a)=>({node:r,messageId:x6,data:{description:o,type:a},*fix(o,{abort:a}){if(t.getCommentsInside(r).length>0)return a();yield aI(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=x9.get(n);if(!o||!of(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&&n_(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(te(a,"")&&on(o,e))n=o;else{if(!(te(o,"")&&on(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&&on(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:{[x6]:"{{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(!tw(r,{methods:x4,minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1}))return;let[n]=r.arguments;if(!tv(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(!tU(o,e)||t.getCommentsInside(o).length>0)return;let[a]=o.arguments;if(!(n.params[0]?.type==="Identifier"&&om(n.params[0],a))&&!(function e(t){return(t=rj(t),t?.type==="ChainExpression")?rY(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||r1.has(e.intrinsicName))}catch{return!1}}(a,e)))return{node:o,messageId:x5,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:{[x5]:"`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 tD(e)&&e.body===t}})(t))return{node:t,messageId:x7,fix:r=>aO(t,e,r)}})},meta:{type:"suggestion",docs:{description:"Disallow useless `continue` statements.",recommended:"unopinionated"},fixable:"code",messages:{[x7]:"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=eO(e,l);if("string"==typeof u&&eO(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&&eO(e,n)===s)){if(l){let t;if(o.async&&(void 0===(t=br(i,e))||!0!==oc(t.type,t.checker)))return}else{let t;if(o.async||!(void 0!==(t=br(i,e))&&bt(t.type)))return}return{node:r.key,messageId:be,data:{superCall:t.getText(i.callee)},*fix(n,{abort:o}){if(t.getCommentsInside(r).length>0)return o();yield aW(r,"",n,e)}}}})},meta:{type:"suggestion",docs:{description:"Disallow useless overrides of class methods.",recommended:"unopinionated"},fixable:"code",messages:{[be]:"Useless override; this method only forwards to `{{superCall}}(…)`."},languages:["js/js"]}},"unicorn/prefer-has-check":{create:e=>{e.on("CallExpression",t=>((e,t)=>{if(!tw(e,{method:"get",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1,allowSpreadElement:!1}))return;let r=(e=>{let t=(e=>{for(;by.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=bF(e.callee.object,r);if(!n)return;let o="!="===t.operator||"=="===t.operator;if("null-sentinel"===n.kind)return o&&bD(t.value,r)?{missingType:"undefined"}:{missingType:"null"};if("map"===n.kind){if(bD(t.value,r)&&bM(e.callee.object,r,o?"not-nullish":"not-undefined"))return{missingType:"undefined"};if(ti(t.value)&&o&&bM(e.callee.object,r,"not-nullish"))return{missingType:"nullish"}}})(e,r,t);if(!a||(n=r.value,o=a.missingType,"undefined"===o?!bD(n,t):!ti(n)))return;return{node:e.callee.property,messageId:bn,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=e4(n=e.callee.object,r),!e7(n,r)&&oZ(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((tq(e,t)||tV(e))&&bF(e.callee.object,t)?.kind==="map"&&bM(e.callee.object,t,"truthy")){if(t.sourceCode.getCommentsInside(e).length>0)return;return{node:e.callee.property,messageId:bn,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:{[bn]:"Prefer `.has(…)` when checking existence."},languages:["js/js"]}},"unicorn/consistent-conditional-object-spread":{create:e=>{e.options[0]===bU?e.on("LogicalExpression",t=>{if(bz(t)){if("&&"!==t.operator||b_(t.right)||bK(t.left,t.right,e.sourceCode))return;let r=bY(t.left,e.sourceCode);if(r&&!r.isTrueWhenNullish&&bK(r.reference,t.right,e.sourceCode))return;let n=bQ(t.left,e),o=bQ(t.right,e);return{node:t,messageId:bq,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(bz(t))return function(e,t){let{test:r,consequent:n,alternate:o}=e,a=b_(o);if(a===b_(n))return;let i=a?n:o,s=bY(r,t.sourceCode),l=t.sourceCode.getCommentsInside(e).length>0;if((a?bK(r,i,t.sourceCode):"UnaryExpression"===r.type&&"!"===r.operator&&r.prefix&&bK(r.argument,i,t.sourceCode))||s&&!l&&(s.isTrueWhenNullish?!a:a)&&bK(s.reference,i,t.sourceCode))return;let u=a?bH(r,"left",t):function(e,t){if("UnaryExpression"===e.type&&"!"===e.operator&&e.prefix)return bH(e.argument,"left",t);let r=e4(e,t);return!e7(e,t)&&o2(e,"!")&&(r=`(${r})`),`!${r}`}(r,t),p=bH(i,"right",t);return{node:e,messageId:bq,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:[bO,bU]}],defaultOptions:[bO],messages:{[bq]:"Prefer {{expectedStyle}} conditional object spreads."},languages:["js/js"]}},"unicorn/default-export-style":Ef,"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=Eg(e.right);if(!n||!tw(o,{method:"concat",minimumArguments:1,optionalCall:!1,optionalMember:!1,computed:!1}))return;let a=(r=Eg(r=o.callee.object),r?.type==="Identifier"?r:void 0),i=Ey(n,t);if(!a||!i||i!==Ey(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&&Eg(t.node.init);return!!(r&&th(r))}(i))return;let s=function(e,t){for(let r of t.sourceCode.getAncestors(e).toReversed()){if(tv(r))return;if(tD(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:Eh}})},meta:{type:"suggestion",docs:{description:"Disallow array accumulation with `Array#concat()` in loops.",recommended:!0},schema:[],messages:{[Eh]:"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(!tw(t,{methods:["shift","unshift"],optionalCall:!1,computed:!1}))return;let{object:r,property:n}=t.callee,{name:o}=n;if(!("unshift"===o&&tB(t.callee,Eb)||nD(r,e)))return{node:n,messageId:Ex,data:{method:o}}})},meta:{type:"suggestion",docs:{description:"Disallow front-of-array mutation.",recommended:!1},schema:[],messages:{[Ex]:"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||!EC(t.property)||nL(t)||("ForInStatement"===t.parent.type||"ForOfStatement"===t.parent.type)&&t.parent.left===t)return;let r=ED(t.object,e);if(r)return ES(t,r,"first",e)}),e.on("CallExpression",t=>{let r;if(!tw(t,{method:"at",argumentsLength:1,optionalCall:!1,optionalMember:!1}))return;let[n]=t.arguments;if(EC(n)?r="first":tk(n)&&(r="last"),!r||nL(t))return;let o=ED(t.callee.object,e);if(o)return ES(t,o,r,e)})},meta:{type:"suggestion",docs:{description:"Disallow sorting arrays to get the minimum or maximum value.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[EE]:"Use `Math.{{method}}()` instead of sorting to get the {{extreme}} value.",[Ev]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-boolean-sort-comparator":{create:e=>{e.on("CallExpression",t=>{let r,n;if(r=t,n=e,!(tm(r,{minimumArguments:1},tp)&&"MemberExpression"===r.callee.type&&Ew.has(eO(r.callee,n.sourceCode.getScope(r.callee))))||nv(t.callee.object,e))return;let[o]=t.arguments;if("SpreadElement"!==o.type){let t=rj(o);if(tv(t)){let r=(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(!n2(t,e)&&!Ej(o,e))return;return{node:o,messageId:ET,suggest:o===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=rj(n=t)).type&&Ek.has(n.operator)?n:void 0;if(!i||rI(i.left)||rI(i.right)||!EI(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:EA,data:{replacement:u},fix:t=>t.replaceText(e,u)}]})(t,r,e):void 0}}return n3(t,e)||function(e,t){if("Identifier"===e.type)return("Boolean"===e.name||nG.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=nJ.get(e.object.name),n=eO(e,t.sourceCode.getScope(e));return!!r?.has(n)}(t,e)||Ej(o,e)?{node:o,messageId:ET}:void 0}})},meta:{type:"problem",docs:{description:"Disallow boolean-returning sort comparators.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[ET]:"Do not return a boolean from a sort comparator.",[EA]:"Replace with `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-chained-comparison":{create:e=>{let{sourceCode:t}=e;e.on("BinaryExpression",r=>{if(!EL.has(r.operator))return;let n=EN(r.left)?r.left:r.right;if(!EN(n))return;let o=n===r.left,a=o?r.right:r.left;if(EP.has(r.operator)&&n6(a,e))return;let i={node:r,messageId:EF},s=ER.has(n.operator)===ER.has(r.operator)&&!tr(r.right);if(o&&s&&!EN(r.right)&&!EN(n.left)&&((e,t)=>{if(e7(e,t))return!0;let{parent:r}=e;return"BinaryExpression"!==r.type&&("LogicalExpression"!==r.type||"??"!==r.operator)})(r,e)&&!ez(n.right,t)&&0===t.getCommentsInside(r).length){let o=`${t.getText(r.left)} && ${e4(n.right,e)} ${r.operator} ${e4(r.right,e)}`;i.suggest=[{messageId:EB,data:{replacement:o},fix:e=>e.replaceText(r,o)}]}return i})},meta:{type:"problem",docs:{description:"Disallow chained comparisons such as `a < b < c`.",recommended:"unopinionated"},hasSuggestions:!0,messages:{[EF]:"Comparison operators cannot be chained. The inner comparison evaluates to a boolean, which is then compared instead of the operands.",[EB]:"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 te(e.left,0)||te(e.right,0);case"/":return te(e.left,0);default:return!1}})(e))return;let r={node:e,messageId:E$},n=e$(e,t.getScope(e));return n&&Object.is(n.value,0)&&0===t.getCommentsInside(e).length&&(r.suggest=[{messageId:EM,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:{[E$]:"This operation always evaluates to `0` (or `-0`/`NaN`), which is likely a mistake.",[EM]:"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)||!EW(o)||!EW(t.right)||!ux(o,t.right))return;let a={node:t.right,messageId:EO};if(r=t.left,!e.sourceCode.getCommentsInside(t).every(t=>((e,t,r)=>{let[n,o]=r.sourceCode.getRange(e),[a,i]=e5(t,r);return n>=a&&o<=i})(t,r,e)))return a;let i=e4(t.left,e),s=e=>e.replaceText(t,i);return EV.has(o.type)&&(n=t.right,EV.has(n.type))?{...a,fix:s}:{...a,suggest:[{messageId:EU,fix:s}]}})},meta:{type:"problem",docs:{description:"Disallow adjacent duplicate operands in logical expressions.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,schema:[],messages:{[EO]:"This operand duplicates the left operand.",[EU]:"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(Ez,t.operator))return;let i=(r=rj(t.left),n=rj(t.right),r_(r)?{memberExpression:r,operator:t.operator,value:e$(n,e.sourceCode.getScope(n))?.value}:r_(n)?{memberExpression:n,operator:Ez[t.operator],value:e$(r,e.sourceCode.getScope(r))?.value}:void 0);if(!i)return;let{memberExpression:s}=i;if("ThisExpression"===(o=rj(s.object)).type||"Super"===o.type||function e(t){return!!("ChainExpression"===(t=rj(t)).type||rY(t))||("MemberExpression"===t.type?e(t.object):"CallExpression"===t.type&&e(t.callee))}(s.object)||(a=e$(s,e.sourceCode.getScope(s)))&&(!Number.isSafeInteger(a.value)||a.value<0)||function({node:e,lengthOrSizeNode:t}){let r=function(e){for(;tN(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&&tT(r,{computed:!1,optional:!1})&&"Identifier"===r.property.type&&rW.has(r.property.name)&&rC(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:E_,data:{property:s.property.name,result:String(l)}}})},meta:{type:"problem",docs:{description:"Disallow impossible comparisons against `.length` or `.size`.",recommended:"unopinionated"},messages:{[E_]:"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(EG.has(t.operator))for(let[r,n]of[[t.left,t.right],[t.right,t.left]]){let o=tn(n);if(void 0!==o&&o.length>1&&EJ(r,e)){let e="!=="===t.operator||"!="===t.operator;return{node:t,messageId:EK,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:{[EK]:"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 l,r=o7(e);e.onExit("ForOfStatement",n=>{if(n.await)return;let o=E9(n.right,e);if(o)return function* e(t,r,n,o){if(E1.has(t.type))return;let a=n;if("ForOfStatement"===t.type&&!t.await){let e=E9(t.right,o);e&&ve(e.reference,r.iterable,o)&&(a=E4(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=eO(e.callee,n.sourceCode.getScope(e.callee));if(!(!EZ[t.collectionKind??"unknown"].has(c)||!ve(u,i,n)||"delete"===c&&vt(e,a,n)||vr(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=rj(e.expression);return"CallExpression"===t.type?t:void 0}(t);if(o)return"MemberExpression"===o.callee.type&&"delete"===eO(o.callee,n.sourceCode.getScope(o.callee))&&ve(o.callee.object,r.iterable,n)&&vt(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&&vr(e,r,c,n))&&!s.has(e))return s.add(e),{node:p,messageId:EX,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,...E4(n,o),reportedCallExpressions:t},void 0,e)})},meta:{type:"problem",docs:{description:"Disallow mutating a loop iterable during iteration.",recommended:!0},schema:[],messages:{[EX]:"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(tw(e,{methods:vo})&&tT(e.callee.object,{property:"classList",computed:!1})&&!oa(rj(e.callee.object.object))){let t=e.callee.property.name;return"add"===t||"remove"===t?vp(e.arguments,"."):"replace"===t?e.arguments[0]?.type==="SpreadElement"?[]:vp(e.arguments.slice(0,2),"."):vp(e.arguments.slice(0,1),".")}if(tw(e,{methods:["getElementById","getElementsByClassName"],argumentsLength:1})&&!oa(rj(e.callee.object))){let t="getElementById"===e.callee.property.name?"#":".";return vp(e.arguments,t)}return[]})(e)){if("SpreadElement"===r.type)continue;let e=rj(r),o=vl(e);vs(o)&&(yield vu(e,o,n,t))}})},meta:{type:"problem",docs:{description:"Disallow selector syntax in DOM names.",recommended:!0},fixable:"code",messages:{[vn]:"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(!vf.has(r.operator)||!to(r.right)||r.right.value!==vf.get(r.operator))return;let n={operator:r.operator,value:r.right.raw};if(t.getCommentsInside(r).length>0)return{node:r,messageId:vc,data:n};let{parent:o}=r;if("ExpressionStatement"===o.type&&["Program","BlockStatement","StaticBlock","SwitchCase"].includes(o.parent.type))return{node:r,messageId:vc,data:n,suggest:[{messageId:vd,fix:t=>aO(o,e,t)}]};let a=t.getText(r.left);return{node:r,messageId:vc,data:n,suggest:[{messageId:vm,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:{[vc]:"This compound assignment is useless as `{{operator}} {{value}}` does not change the value.",[vd]:"Remove the useless assignment.",[vm]:"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&&rC(o.right,a.object)&&vA(o.right,r)&&vw(o.left,r)&&vw(o.right,r)&&(!a.computed||vw(a.property,r))){if(a.computed)n=((e,t,r)=>{if(rC(e,t))return!((e,t)=>{var r;let n;if(vA(e,t)||vS(rj(e),t))return!0;let o=rq(rj(e),t);if(!o)return!1;let a=rj(o);return"NewExpression"===a.type||"CallExpression"===(r="ChainExpression"===(n=r=a).type?n.expression:n).type&&void 0===vT(r,t)})(e,r);let n=vT(e,r),o=vT(t,r);return void 0!==n&&n===o})(o.left,a.property,r);else{let e=eO(a,r.sourceCode.getScope(a));n=null!==e&&e===vT(o.left,r)}return n?{suggest:[{messageId:vy,fix:vI(e,t,r)}]}:void 0}}(e,r,t):function(e,t,r){let{test:n}=e;if(vk(n,"has")&&vk(t,"delete")&&((e,t)=>{let r;if("Identifier"!==(e=rj(e)).type)return!1;let n=rq(e,t);if(!n)return!1;let o=rj(n);return"NewExpression"===o.type&&(r=o.callee,"Identifier"===r.type&&vx.has(r.name)&&t.sourceCode.isGlobalReference(r))})(n.callee.object,r)&&rC(n.callee.object,t.callee.object)&&rC(n.arguments[0],t.arguments[0])&&vw(n.arguments[0],r))return{fix:vI(e,t,r)}}(e,r,t)}(t,e);if(r)return{node:t.test,messageId:vg,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:{[vg]:"The existence check before deletion is unnecessary.",[vy]:"Remove the existence check."},languages:["js/js"]}},"unicorn/no-useless-logical-operand":{create:e=>{e.on("LogicalExpression",t=>{if(!vF.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=vB.get(o),tr(a[0],r)?a[0]:void 0);if(i)return{target:i,replacementOperands:[i]};let s=(n=vF.get(o),a.filter((e,r)=>tr(e,n)&&function(e,t,r){var n;if(t<e.length-1)return!0;let o=e.slice(0,-1);return tq(n=e[t].parent,r)||tV(n)||o.every(e=>n6(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&&tt(rj(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&&tv(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:vj,data:{operator:t.operator}};return e.sourceCode.getCommentsInside(t).length>0||(1===o.length?a.fix=r=>aI(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=e7(t,e),a=e4(t,e),!o&&o3(t,{operator:n,property:0===r?"left":"right"})&&(a=`(${a})`),0===r&&!o&&vR.has(rj(t).type)&&(a=`(${a})`),a}).join(` ${n} `),oD(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:{[vj]:"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=v$(o),u=v$(a);if(void 0===l||void 0===u||l===u)return;let p={node:n,messageId:vP},c=!l,d=t.getCommentsInside(n).length>0||t.getCommentsInside(a).length>0||rN(e,a),m=!c&&!vM(n.test,e)&&!!(s=ey(t.getScope(n),"Boolean"))&&0!==s.defs.length;return d||m?p:{...p,fix:t=>t.replaceTextRange(i,`return ${function(t,r){let n=e4(t,e);if(r)return o2(t,"!")?`!(${n})`:`!${n}`;if(vM(t,e))return n;let o="SequenceExpression"===t.type?`(${n})`:n;return`Boolean(${o})`}(n.test,c)};`)}}e.on("IfStatement",n=>n.alternate?r(n,vN(n.consequent),vN(n.alternate)):function(n){let o,a=ar(n,e);if(!a||"ReturnStatement"!==a.type)return;let i=vN(n.consequent),s=v$(i);if(void 0!==s&&(o=at(n,e),o?.type==="IfStatement"&&!o.alternate&&v$(vN(o.consequent))===s))return;let l=r(n,i,a,[t.getRange(n)[0],t.getRange(a)[1]]);return l?.fix&&t.getTokensBetween(n,a,{includeComments:!0}).some(e=>"Block"===e.type||"Line"===e.type)?{node:n,messageId:vP}:l}(n))},meta:{type:"suggestion",docs:{description:"Prefer directly returning boolean expressions over `if` statements.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[vP]:"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 vU)if(vq(e,t))return t})(e);if(!(!r||!e.arguments.some(e=>vq(e,r))||((e,t)=>{let{parent:r}=e;return vq(r,t)&&r.arguments.includes(e)})(e,r)))return{node:e,messageId:vO,data:{method:r},*fix(n,{abort:o}){if(t.getCommentsInside(e).length>0)return o();let a=t.getText(e.callee),i=vV(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:{[vO]:"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=>vX(r[n],e[0][n],t));)n++;let o=0;for(;n+o<r&&e.every(r=>vX(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 vH({ifStatement:e,blocks:r,leading:o,trailing:a,isStart:!0},t)),a>0&&(yield vH({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:{[vW]:"These branches start with the same code. Move it before the `if` statement.",[v_]:"These branches end with the same code. Move it after the `if` statement.",[vz]:"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===v2(r))return;let n=r.arguments[1];if(!tt(n))return;let o=n.value;if(o.includes("$`")||o.includes("$'"))return;let a=e=>void 0!==v2(e)&&tt(e.arguments[1])&&e.arguments[1].value===o,{parent:s}=r;if("MemberExpression"===s.type&&s.object===r&&"CallExpression"===s.parent.type&&s.parent.callee===s&&a(s.parent))return;let l=[],u=r;for(;a(u);)l.push(v2(u)),u=u.callee.object;if(l.length<2)return;let p=u;l.reverse();let c=[...new i(l)];if(c.some(e=>o.includes(e)))return;let d={node:r,messageId:vZ};if(0===t.getCommentsInside(r).length){let t=c.map((e,t)=>(function(e,t,r){if(v1.has(e))return v1.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===c.length-1)).join(""),o=e4(p,e),a=e4(n,e);d.fix=e=>e.replaceText(r,`${o}.replaceAll(/[${t}]/g, ${a})`)}return d})},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:{[vZ]:"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:v3}))})},meta:{type:"suggestion",docs:{description:"Enforce consistent labels on tuple type elements.",recommended:!0},messages:{[v3]:"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=>Cr(t,e)),e.on("Property",t=>Cr(t,e)),e.on("PropertyDefinition",t=>Cr(t,e))},meta:{type:"problem",docs:{description:"Disallow invalid implementations of well-known symbol methods.",recommended:"unopinionated"},fixable:"code",hasSuggestions:!0,messages:{[v8]:"`Symbol.dispose` must not return a Promise. Use `Symbol.asyncDispose` instead.",[v6]:"`Symbol.dispose` must not be a generator. Use a normal method for synchronous disposal or `Symbol.asyncDispose` for asynchronous disposal.",[v9]:"`Symbol.iterator` must return a sync iterator. Use `Symbol.asyncIterator` for async iterators.",[v5]:"`Symbol.asyncIterator` must return an async iterator directly. Use an async generator or return the iterator synchronously.",[v4]:"Use `Symbol.{{replacement}}` instead."},languages:["js/js"]}},"unicorn/no-late-event-control":{create:e=>{let{sourceCode:t}=e,r=gc(e);e.onExit("CallExpression",n=>{var o;let a=(e=>{if(!tw(e,{methods:Ci,computed:!1}))return;let{callee:t}=e,r=rj(t.object);if("Identifier"===r.type)return{event:r,method:t.property.name}})(n);if(!a)return;let{event:i,method:s}=a,l=ey(t.getScope(i),i),u=l?.defs.find(({type:e})=>"Parameter"===e);if(!u)return;let p=u.node;if(!(!nw(o=u.name,e)&&(gl.test(o.name)||nA(o,e))))return;let c=gu(n)!==p,d=p.generator;if(!c&&!d&&!r.isFunctionSuspended(p)&&!r.isInsideSuspendingLoop(n,p))return;let m=Cn;return c?m=Ca:d&&(m=Co),{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:{[Cn]:"`{{name}}.{{method}}()` has no effect after the handler suspends. Call it before `await` or `yield` while the event is still being dispatched.",[Co]:"`{{name}}.{{method}}()` is not called during event dispatch inside a generator function. Use a normal function handler instead.",[Ca]:"`{{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||!(tf(l,{name:"AbortController",argumentsLength:0})&&of(l.callee,t))||(n=ey(t.sourceCode.getScope(s),"AbortSignal"))&&0!==n.defs.length||r$(t,a.getRange(l))||s.typeAnnotation&&r$(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"&&tm(e.expression,{name:"setTimeout",argumentsLength:2,optional:!1},tp)&&of(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)||r$(t,a.getRange(u))||rN(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(tm(n,{argumentsLength:0,optional:!1},tp)&&tT(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=ey(a.getScope(s),s);if(!d||ey(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=Cp(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=e$(e,t.sourceCode.getScope(e));if(!r)return!0;let{value:n}=r;return"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&n<=0x7fffffff})(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||Cc(o,d,d.identifiers[0],t)||m.some(e=>Cc(o,d,e,t)))?r:o),h=`AbortSignal.timeout(${a.getText(g)})`;return{node:s,messageId:Cs,suggest:[{messageId:Cl,*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 aO(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:{[Cs]:"Prefer `AbortSignal.timeout()` over manually aborting an `AbortController` with `setTimeout()`.",[Cl]:"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(tf(r,{name:"Error",maximumArguments:2})&&of(r.callee,t))return r}(o,e);if(!a)return;let i=function(e,t){let r=Cv(e.test).map(e=>(function(e,t){let r=Cb(e=Cg(e),t);if(r)return r;if("BinaryExpression"!==e.type)return;let n=Cb(e.left,t);if(n&&CE(e.operator,e.right,!0))return n;let o=Cb(e.right,t);if(o&&CE(e.operator,e.left,!1))return o})(e,t)).filter(Boolean);if(1===r.length)return r[0]}(t,e);if(!i||(n=oA("AggregateError",e.sourceCode.getScope(a)))&&0!==n.defs.length)return;let{sourceCode:s}=e;return{node:a.callee,messageId:Cd,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:{[Cd]:"Use `AggregateError` when throwing collected errors."},languages:["js/js"]}},"unicorn/prefer-observer-apis":{create:e=>{e.on("CallExpression",t=>{var r,n;let o;if(r=t,n=e,tw(r,{method:"addEventListener",minimumArguments:2,maximumArguments:3,optionalCall:!1,optionalMember:!1})?!!CL(r.callee.object,n):!(tm(r,{name:"addEventListener",minimumArguments:2,maximumArguments:3,optional:!1},tp)&&of(r.callee,n)))return;let[a,i]=t.arguments,s=tn(o=rj(a))??((e,t)=>{let{parserServices:r}=t.sourceCode;if(r?.program)try{var n=r.getTypeAtLocation(e);if(n.isStringLiteral?.())return n.value;return}catch{}})(o,e);if(!CD.has(s))return;let l=((e,t)=>{if(tv(e=rj(e)))return e;if("Identifier"!==e.type)return;let r=ey(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&&rj(n.node.init);if("Variable"===n.type&&"const"===n.parent.kind&&o&&tv(o))return o})(i,e);if(l&&CW(l.body,e))return{node:a,messageId:s}})},meta:{type:"suggestion",docs:{description:"Prefer observer APIs over resize and scroll listeners with layout reads.",recommended:!0},schema:[],messages:CC,languages:["js/js"]}},"unicorn/prefer-set-methods":{create:e=>{e.on("NewExpression",t=>{let r=((e,t)=>{if(!CX(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 C0(e,t)&&(r=e.argument,tf(r,{name:"Set",argumentsLength:0})&&of(r.callee,t)||!ez(r,t.sourceCode,{considerGetters:!0}))}))return{node:e,messageId:C_,fix:n=>n.replaceText(e,CH(e,((e,t)=>{let[r,...n]=e.elements.map(e=>e.argument),o=CY(r,t);for(let e of n)o+=`.union(${e4(e,t)})`;return o})(r,t),t))}})(t,e);if(r)return r;if(!CX(t,e))return;let[n]=t.arguments;return C2((e=>{for(;e?.type==="ParenthesizedExpression"||rI(e);)e=e.expression;return e})(n),t,e)}),e.on("CallExpression",t=>{if(!(e=>{let{parent:t}=e=CZ(e);return(t?.type==="CallExpression"||t?.type==="NewExpression")&&(t.callee===e||t.arguments.includes(e))})(t))return C2(t,t,e)})},meta:{type:"suggestion",docs:{description:"Prefer `Set` methods for Set operations.",recommended:!0},fixable:"code",hasSuggestions:!0,messages:{[C_]:"Use `Set#union()` instead of spreading Sets into a new Set.",[Cz]:"Use `Set#intersection()` instead of filtering by `Set#has()`.",[CK]:"Use `Set#intersection()`.",[CG]:"Use `Set#difference()` instead of filtering by `Set#has()`.",[CJ]:"Use `Set#difference()`."},languages:["js/js"]}},"unicorn/prefer-toggle-attribute":{create:e=>{let{sourceCode:t}=e;e.on(["IfStatement","ConditionalExpression"],r=>{let n=C4(r.consequent),o=C4(r.alternate);if(!((e,t,r)=>!!(e&&t&&("setAttribute"===e.method&&"removeAttribute"===t.method||"removeAttribute"===e.method&&"setAttribute"===t.method)&&C7(e,t)&&!rY(e.receiver)&&!rY(t.receiver)&&!De(e,r)&&!De(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=C5(t);if(a?.method==="hasAttribute"&&C7(a,r)&&!rY(a.receiver))return{isNegative:o,isKnownNonDom:De(a,n)}}(r.test,a,e);if(s?.isKnownNonDom)return;let l=s&&i===s.isNegative?"":C6(r.test,e,!i),u=a.hasEmptyAttributeValue||void 0!==tn(a.attributeValue),p=!!l&&a.isOptional||!u,c=[a.receiver,a.attributeName];l&&c.push(r.test);let d=p||rL(e,r,c)?void 0:function*(n){var o;let i,s=(i=e4(o=a.receiver,e),!e7(o,e.sourceCode)&&oZ(o,e)?`(${i})`:i),u=e4(a.attributeName,e),p=a.isOptional?"?":"",c="ConditionalExpression"===r.type,d=`${s}${p}.toggleAttribute(${u}${l?`, ${l}`:""})`;c||(d+=";"),oD(t.getTokenBefore(r),e,d)&&(d=`;${d}`),yield n.replaceText(r,d),c&&(yield aP(n,r,e))};return((e,t,{forceSuggestion:r=!1}={})=>{let n={node:e,messageId:C3};if(!t)return n;let o="IfStatement"!==e.type&&!(tb(e)||tb(e.parent));return r||o?n.suggest=[{messageId:C8,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:{[C3]:"Prefer using `Element#toggleAttribute()` to toggle attributes.",[C8]:"Replace with `Element#toggleAttribute()`."},languages:["js/js"]}},"unicorn/prefer-url-search-parameters":{create:e=>{e.on("CallExpression",t=>{let r,n=((e,t)=>{if(!(tw(e,{object:"Object",method:"fromEntries",argumentsLength:1,computed:!1,optionalCall:!1,optionalMember:!1})&&Da("Object",e,t)))return;let[r]=e.arguments,n=Dl(r,t);if(!n)return;let o=Dp(e,r,Du(n.query,t),t);return Dd({node:e,query:n.query,replacement:o,preservedNodes:[...Dc(e,r,t),n.query]},t)})(t,e);if(n)return n;if((r=(e=>{let t=e,{parent:r}=e;for(;rI(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?tn(e)===t:"Identifier"===e.type&&e.name===t)(r.callee.property,"fromEntries",{computed:r.callee.computed})||tf(r,{names:["Map","URLSearchParams"],argumentsLength:1})))return;let o=Dl(t,e);if(o)return Dd({node:t,query:o.query,replacement:Du(o.query,e)},e)}),e.on("NewExpression",t=>((e,t)=>{let r=tf(e,{name:"Map",argumentsLength:1})&&Da("Map",e,t);if(!r&&!tf(e,{name:"URLSearchParams",argumentsLength:1}))return;let[n]=e.arguments,o=Dl(n,t);if(!o)return;let a=Ds(o.query,t),i=Du(o.query,t),s=Dp(e,n,r?i:a,t);return Dd({node:e,query:o.query,replacement:s,preservedNodes:[...Dc(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:{[Dt]:"Prefer `URLSearchParams` over manually splitting query strings.",[Dr]:"Use `{{replacement}}`."},languages:["js/js"]}},"unicorn/no-unsafe-promise-all-settled-values":{create:e=>{e.on("CallExpression",t=>(function(e,t){if(!tw(e,{method:"then",minimumArguments:1,optionalCall:!1,optionalMember:!1})||!Db(e.callee.object))return;let[r]=e.arguments;if(!Dh(r)||0===r.params.length)return;let[n]=r.params,o=DF(n)&&ey(t.sourceCode.getScope(n),n);if(o)return function e(t,r,n){if(t=Dx(t),!(!t?.type||Dh(t))&&"ClassExpression"!==t.type&&"ClassDeclaration"!==t.type){if(tw(t,{method:"map",minimumArguments:1,maximumArguments:2,optionalCall:!1,optionalMember:!1})&&function e(t,r,n){return!!D_(t=Dx(t),r,n)||Dv(t)&&e(t.callee.object,r,n)}(t.callee.object,r,n)&&!Dz(t.callee.object)){let e=DK(t,n,{knownPromiseSettledResultArray:!0});if(e)return e}for(let[o,a]of Object.entries(t))if(!("parent"===o||DW(t,o))&&a&&"object"==typeof a)for(let t of Array.isArray(a)?a:[a]){let o=e(t,r,n);if(o)return o}}}(r.body,o,t)})(t,e)??DK(t,e))},meta:{type:"problem",docs:{description:"Disallow reading `.value` from `Promise.allSettled()` results without a fulfilled status guard.",recommended:"unopinionated"},schema:[],messages:{[Dm]:"Do not read `.value` from `Promise.allSettled()` results without checking that the result is fulfilled."},languages:["js/js"]}},"unicorn/prefer-abort-signal-any":{create:e=>{e.on("VariableDeclarator",t=>((e,t)=>{var r;let n,o,{sourceCode:a}=t,s=e.parent,{id:l,init:u}=e;if("VariableDeclaration"!==s.type||"const"!==s.kind||1!==s.declarations.length||"Identifier"!==l.type||!(tf(u,{name:"AbortController",argumentsLength:0})&&of(u.callee,t))||(n=ey(t.sourceCode.getScope(l),"AbortSignal"))&&0!==n.defs.length||r$(t,a.getRange(u))||l.typeAnnotation&&r$(t,a.getRange(l.typeAnnotation)))return;let p=((e,t,r)=>{var n;let o,a=DQ(e);if(a?.type!=="ForOfStatement"||a.await||!Sy(a,r)||DZ(r,e,a)||!Si(a.right,r)||D5(a.right,r)||St(a.right,t,r)||Se(a.right,r)||!Sm(a.right,r)||!(!(o=Sa(a.right,r))||o.length>1&&o.every(e=>Sn(e,r))))return;let s=(e=>{if("VariableDeclaration"!==e.type||"const"!==e.kind||1!==e.declarations.length)return;let[t]=e.declarations;if("Identifier"===t.id.type&&!t.init)return t.id})(a.left);if(!s||!Sr(s,r))return;let l=Sg("ExpressionStatement"===(n=a.body).type?n:"BlockStatement"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type?n.body[0]:void 0);if(!l||!rC(rj(l.sourceSignal),s))return;let u=Sf(l.call.arguments[1],t,s,r);if(u)return{abortReferences:new i([u]),replacement:`AbortSignal.any(${((e,t)=>{let r=t.sourceCode.getText(e);if(!Sd(e,t))return r;let n=rj(e);if("ArrayExpression"===n.type)return t.sourceCode.getText(n);let o=n===e?r:`(${r})`;return`[...${o}]`})(a.right,r)})`,statements:[a]}})(s,l.name,t)??((e,t,r)=>{let n=[],o=[],a=new i,s=e,l=DQ(e);for(;l;){let e=Sg(l);if(!e||!Sy(l,r)||DZ(r,s,l)||St(e.sourceSignal,t,r)||Se(e.sourceSignal,r)||!Sn(e.sourceSignal,r))break;let i=Sf(e.call.arguments[1],t,e.sourceSignal,r);if(!i)break;n.push(l),o.push(e.sourceSignal),a.add(i),s=l,l=DQ(l)}if(!(n.length<2))return{abortReferences:a,replacement:`AbortSignal.any([${o.map(e=>r.sourceCode.getText(e)).join(", ")}])`,statements:n}})(s,l.name,t);if(!p)return;let c=ey(a.getScope(l),l);if(!c)return;for(let e of p.abortReferences)if(ey(a.getScope(e),e)!==c)return;let d=((e,t,r)=>{let n=[];for(let o of e.references){let{identifier:e}=o;if(t.has(e)||o.init)continue;if(o.isWrite())return;let a=D1(e,r);if(!a)return;n.push(a)}return n.length>0?n:void 0})(c,p.abortReferences,t);if(!d)return;let m=(r=l.name,o=r,("abortController"===r?o="abortSignal":"controller"===r&&(o="signal"),o===r||Sh(o,c,c.identifiers[0],t)||d.some(e=>Sh(o,c,e,t)))?r:o);return{node:l,messageId:DG,suggest:[{messageId:DJ,*fix(e){if(yield e.replaceText(u,p.replacement),l.typeAnnotation&&(yield e.replaceText(l.typeAnnotation,": AbortSignal")),m!==l.name){let[t]=a.getRange(l);yield e.replaceTextRange([t,t+l.name.length],m)}for(let t of d)yield e.replaceText(t,m);yield((e,t,r)=>{if(1===e.length)return aO(e[0],t,r);let{sourceCode:n}=t,{lines:o}=n,a=e[0],i=e.at(-1),s=n.getLoc(a).start,l=n.getLoc(i).end,u=o[s.line-1].slice(0,s.column),p=o[l.line-1].slice(l.column),{text:c}=n,[d]=n.getRange(a),[,m]=n.getRange(i);return/^\s*$/.test(u)&&/^\s*$/.test(p)&&(m+=p.length,0===d?"\r"===c[m]&&"\n"===c[m+1]?m+=2:("\n"===c[m]||"\r"===c[m])&&m++:"\r"===c[(d-=u.length)-2]&&"\n"===c[d-1]?d-=2:("\n"===c[d-1]||"\r"===c[d-1])&&d--),r.removeRange([d,m])})(p.statements,t,e)}}]}})(t,e))},meta:{type:"suggestion",docs:{description:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",recommended:!0},hasSuggestions:!0,schema:[],messages:{[DG]:"Prefer `AbortSignal.any()` over manually forwarding abort events between signals.",[DJ]:"Replace with `AbortSignal.any()`."},languages:["js/js"]}},"unicorn/prefer-block-statement-over-iife":{create:e=>{let{sourceCode:t}=e,{visitorKeys:r}=t;e.on("ExpressionStatement",n=>{let o,a,{expression:i}=n;if("CallExpression"!==i.type||i.optional||i.arguments.length>0)return;let{callee:s}=i;if(!("FunctionExpression"!==s.type&&"ArrowFunctionExpression"!==s.type||s.id||s.async||s.generator||s.params.length>0||"BlockStatement"!==s.body.type||s.body.body.some(e=>tg(e))||SC(s.body,r,e=>"ReturnStatement"===e.type||"VariableDeclaration"===e.type&&"var"===e.kind||"CallExpression"===e.type&&"Identifier"===e.callee.type&&"eval"===e.callee.name)||(o=s.body,"script"===t.ast.sourceType&&SC(o,t.visitorKeys,e=>"FunctionDeclaration"===e.type))||(a=s.body,rL(e,SD(n,e.sourceCode),[a]))||"FunctionExpression"===s.type&&SC(s.body,r,Sb,Sv))){let t;return{node:i,messageId:Sx,fix:(t=s.body,r=>r.replaceTextRange(SD(n,e.sourceCode),e.sourceCode.getText(t)))}}})},meta:{type:"suggestion",docs:{description:"Prefer block statements over IIFEs used only for scoping.",recommended:"unopinionated"},fixable:"code",schema:[],messages:{[Sx]:"Prefer a block statement over an IIFE used only for scoping."},languages:["js/js"]}},"unicorn/no-multiple-promise-resolver-calls":{create:e=>{let t,{sourceCode:r}=e,n=new s,a=(e,r)=>{var n;t.currentSegments.add(e),n=t,"CatchClause"===r.type&&n.catchClausesBySegment.set(e,r)},u=e=>{t.currentSegments.delete(e)};e.on("onCodePathStart",(a,s)=>{let l=t;t={upper:l,codePath:a,currentSegments:new i,eventsBySegment:new o,executors:new i,catchClausesBySegment:new o,ignoredLoopEdges:[],hasResolverReferences:l?.hasResolverReferences??!1},Sk(s,e)&&function(e,t,r){let n=!1;for(let o of e.params.slice(0,2)){if("Identifier"!==o.type)continue;let a=ey(r.getScope(o),o);if(!(!a||SI(a)))for(let r of a.references)t.set(r.identifier,e),n=!0}return n}(s,n,r)&&(t.hasResolverReferences=!0)}),e.on("onCodePathEnd",()=>{!function(e,t){var r;let n;if(0===e.executors.size)return;let a=(r=e.codePath,n=[],r.traverseSegments(e=>{e.reachable&&n.push(e)}),n),i=new l;for(let r of e.executors){let n=function(e,t,r){let n,a=new o;do for(let o of(n=!1,r)){let r=function(e,t,r){for(let n of t)e=SB(e,n,r);return e}(SL(o,a,e),e.eventsBySegment.get(o)??[],t);SP(r,a.get(o))||(a.set(o,r),n=!0)}while(n);return a}(e,r,a);for(let o of a){let a=SL(o,n,e);for(let n of e.eventsBySegment.get(o)??[])n.executor===r&&a.resolverCalled&&!i.has(n.node)&&(i.add(n.node),t.report({node:n.node,messageId:SS})),a=SB(a,n,r)}}}(t,e),t=t.upper}),e.on("onCodePathSegmentStart",a),e.on("onUnreachableCodePathSegmentStart",a),e.on("onCodePathSegmentEnd",u),e.on("onUnreachableCodePathSegmentEnd",u),e.on("onCodePathSegmentLoop",(e,r,n)=>{(SN(n)||function(e){if("ContinueStatement"!==e.type)return!1;let t=e.label?.name,r=!1,n=e,{parent:o}=e;for(;o&&!tv(o);){if("TryStatement"===o.type&&o.finalizer&&(o.block===n||o.handler===n)&&(r=!0),t&&"LabeledStatement"===o.type&&o.label.name===t||!t&&tD(o))return r;n=o,{parent:o}=o}return!1}(n))&&t.ignoredLoopEdges.push({previousSegment:e,segment:r})}),e.onExit(["Identifier","CallExpression","ImportExpression","MemberExpression","NewExpression","ThrowStatement","YieldExpression"],r=>{if(!t.hasResolverReferences||"Identifier"===r.type&&(n.has(r)||!S$(r))||"ImportExpression"===r.type&&!S$(r))return;let o=((e,t)=>{if("CallExpression"!==e.type)return;let r=Sw(e.callee);return"Identifier"===r.type?t.get(r):void 0})(r,n),{catchClause:a,finallyBlocks:i}=o?{catchClause:void 0,finallyBlocks:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tv(n);)"TryStatement"===n.type&&n.finalizer===r&&t.push(n.finalizer),r=n,{parent:n}=n;return t}(r)}:function(e){let t=[],r=e,{parent:n}=e;for(;n&&!tv(n);){if("TryStatement"===n.type){if(n.block===r&&n.handler)return{catchClause:n.handler,finallyBlocks:t};n.finalizer&&(n.block===r||n.handler===r)&&t.push(n.finalizer)}r=n,{parent:n}=n}return{catchClause:void 0,finallyBlocks:t}}(r);if((o||a)&&!(function(e){let t=e,{parent:r}=e;for(;r;){if(SN(r)&&("WhileStatement"===r.type&&r.body===t||"ForStatement"===r.type&&(r.body===t||r.update===t)))return!0;t=r,{parent:r}=r}return!1}(r)||o&&function(e,t){let r=e,{parent:n}=e;for(;n;){if("AssignmentPattern"===n.type&&n.right===r&&Sk(n.parent,t)&&n.parent.params.slice(0,2).includes(n))return!0;r=n,{parent:n}=n}return!1}(r,e))){var s=t,l={catchClause:a,finallyBlocks:i,node:r,executor:o};for(let e of s.currentSegments){if(!e.reachable)continue;let t=s.eventsBySegment.get(e);t||(t=[],s.eventsBySegment.set(e,t)),t.push(l)}o&&t.executors.add(o)}})},meta:{type:"problem",docs:{description:"Disallow calling Promise executor resolver functions more than once on the same execution path.",recommended:"unopinionated"},messages:{[SS]:"Promise executor resolver functions may be called multiple times on the same execution path."},languages:["js/js"]}},"unicorn/no-unnecessary-string-trim":{create:e=>{e.on("CallExpression",t=>{if(!tw(t,{methods:SO,maximumArguments:1,optionalCall:!1,optionalMember:!1}))return;let r=t.callee.object;if(!tw(r,{method:"trim",argumentsLength:0,optionalCall:!1,optionalMember:!1})||rY(t))return;let n=r.callee.object;if(((e,t)=>{if(e=rj(e),e=rj(rq(e,t)??e),Sq.has(e.type))return!0;let r=SV(e,t);return!!r&&"string"!=typeof r.value})(n,e)||or(n,e))return;let{property:o}=t.callee,{property:a}=r.callee,i=o.name,[s]=t.arguments;if(s){let t=((e,t)=>{let r=SV(e,t);if(!r)return;let{value:n}=r;return null===n||SU.has(typeof n)?String(n):void 0})(s,e);if(void 0===t||("startsWith"===i?t!==t.trimEnd():t!==t.trimStart()))return}let l="startsWith"===i?"trimStart":"trimEnd";return{node:a,messageId:SM,data:{method:i,replacement:l},fix:e=>e.replaceText(a,l)}})},meta:{type:"suggestion",docs:{description:"Disallow `String#trim()` before `String#startsWith()` or `String#endsWith()`.",recommended:"unopinionated"},fixable:"code",messages:{[SM]:"Prefer `String#{{replacement}}()` before `String#{{method}}()`."},languages:["js/js"]}},"unicorn/no-useless-re-export":{create:e=>{let{sourceCode:t}=e,r=[],n=[];e.on("ExportAllDeclaration",e=>{e.exported||r.push({node:e,request:Sz(e,t)})}),e.on("ExportNamedDeclaration",e=>{e.source&&n.push(e)});let o=(e,n)=>{let o=S_(n.exported);if("default"===o)return;let a=S_(n.local),[i]=t.getRange(n.local),[s]=t.getRange(n.exported);if(a===o&&i!==s)return;let l="type"===n.exportKind||"type"===e.exportKind,u=Sz(e,t);if(a===o&&r.some(e=>e.request===u&&"default"!==o&&("type"!==e.node.exportKind||l)))return{node:n,messageId:SW}};e.on("Program:exit",function*(){if(1===new i(r.map(e=>e.request)).size)for(let e of n)for(let t of e.specifiers){let r=o(e,t);r&&(yield r)}})},meta:{type:"suggestion",docs:{description:"Disallow redundant re-exports.",recommended:"unopinionated"},schema:[],messages:{[SW]:"This export is redundant because the same module is already exported with `export *`."},languages:["js/js"]}}}).map(([e,t])=>{let r;return[e,{meta:{schema:[],...t.meta,docs:{...t.meta.docs,url:(r=v.basename(e,".js"),`https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v72.0.0/docs/rules/${r}.md`)}},create:oz(t.create)}]})))};module.exports=SK;